From a24c236bbba7182381d00626562720bcd2e0e45a Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Fri, 1 Aug 2025 12:16:58 -0400 Subject: [PATCH 1/9] beginning of draft doc --- .../routes/docs/integrations/gel/index.mdx | 60 +++++++++++++++++++ 1 file changed, 60 insertions(+) create mode 100644 packages/docs/src/routes/docs/integrations/gel/index.mdx diff --git a/packages/docs/src/routes/docs/integrations/gel/index.mdx b/packages/docs/src/routes/docs/integrations/gel/index.mdx new file mode 100644 index 00000000000..57c232996ea --- /dev/null +++ b/packages/docs/src/routes/docs/integrations/gel/index.mdx @@ -0,0 +1,60 @@ +--- +title: Gel | Integrations +keywords: 'Gel, EdgeDB, database, data, postgres' +contributors: + - nabrams +updated_at: '2024-08-01T18:53:23Z' +created_at: '2025-08-01T23:00:50Z' +--- + +import PackageManagerTabs from '~/components/package-manager-tabs/index.tsx'; + +# Gel Data + +[GelDB](https://www.geldata.com/) Gel is a scalable, integrated data platform on top of Postgres. + +Gel gives the relational model a fresh facelift, solves n+1, simplifies migrations, + +and streamlines your entire database workflow. + +Gel can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side. + +The easiest way to add Gel to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `db` folder with the drizzle schema. + + + +```shell +pnpm run qwik add gel +``` + + +```shell +npm run qwik add gel +``` + + +```shell +yarn run qwik add gel +``` + + +```shell +bun run qwik add gel +``` + + + +> Gel is a modern data platform built on PostgreSQL that provides a unified interface for managing, querying, and scaling your data. It offers features like real-time analytics, seamless migrations, and integrated workflows to simplify database operations for developers and teams. + +## Auto-generating queries + +Gel lets you automatically generate queries for your database schema by using + +their query language EdgeQL combined with `npm install @gel/generate --save-dev`. + +The following ``s are currently supported: + +- `queries`: Generate typed functions from *.edgeql files +- `interfaces`: Generate interfaces for your schema types +- `edgeql-js`: Generate the query builder + From ec02b33d64d1029319c8b2846b3e3e860e0a3062 Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Wed, 24 Sep 2025 18:33:56 -0400 Subject: [PATCH 2/9] add all base files for user to add gel to their qwik project with simple example db --- starters/features/gel/gel.toml | 7 ++ starters/features/gel/gel/queries/.gitkeep | 0 .../features/gel/gel/queries/getUser.edgeql | 5 ++ .../gel/queries/insertOrUpdateEmail.edgeql | 27 +++++++ .../gel/gel/queries/insertOrUpdateUser.edgeql | 40 ++++++++++ starters/features/gel/gel/schema/default.gel | 29 +++++++ .../gel/gel/schema/migrations/.gitkeep | 0 starters/features/gel/package.json | 22 ++++++ starters/features/gel/src/.gitkeep | 0 starters/features/gel/src/actions/.gitkeep | 0 starters/features/gel/src/actions/client.ts | 75 +++++++++++++++++++ .../features/gel/src/actions/user/.gitkeep | 0 .../features/gel/src/actions/user/index.ts | 9 +++ starters/features/gel/src/hooks/.gitkeep | 0 starters/features/gel/src/hooks/user.hooks.ts | 13 ++++ 15 files changed, 227 insertions(+) create mode 100644 starters/features/gel/gel.toml create mode 100644 starters/features/gel/gel/queries/.gitkeep create mode 100644 starters/features/gel/gel/queries/getUser.edgeql create mode 100644 starters/features/gel/gel/queries/insertOrUpdateEmail.edgeql create mode 100644 starters/features/gel/gel/queries/insertOrUpdateUser.edgeql create mode 100644 starters/features/gel/gel/schema/default.gel create mode 100644 starters/features/gel/gel/schema/migrations/.gitkeep create mode 100644 starters/features/gel/package.json create mode 100644 starters/features/gel/src/.gitkeep create mode 100644 starters/features/gel/src/actions/.gitkeep create mode 100644 starters/features/gel/src/actions/client.ts create mode 100644 starters/features/gel/src/actions/user/.gitkeep create mode 100644 starters/features/gel/src/actions/user/index.ts create mode 100644 starters/features/gel/src/hooks/.gitkeep create mode 100644 starters/features/gel/src/hooks/user.hooks.ts diff --git a/starters/features/gel/gel.toml b/starters/features/gel/gel.toml new file mode 100644 index 00000000000..e2752ceea62 --- /dev/null +++ b/starters/features/gel/gel.toml @@ -0,0 +1,7 @@ +watch = [] + +[instance] +server-version = "6.7" + +[hooks] +schema.update.after = "pnpm generate queries --file" \ No newline at end of file diff --git a/starters/features/gel/gel/queries/.gitkeep b/starters/features/gel/gel/queries/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/starters/features/gel/gel/queries/getUser.edgeql b/starters/features/gel/gel/queries/getUser.edgeql new file mode 100644 index 00000000000..b47fc5bee06 --- /dev/null +++ b/starters/features/gel/gel/queries/getUser.edgeql @@ -0,0 +1,5 @@ +select User { ** +} filter assert_exists(User.name) ?= $name; + +# Filter here is optional. +# If no filter is provided, all Users will be returned. diff --git a/starters/features/gel/gel/queries/insertOrUpdateEmail.edgeql b/starters/features/gel/gel/queries/insertOrUpdateEmail.edgeql new file mode 100644 index 00000000000..d7eab2683ef --- /dev/null +++ b/starters/features/gel/gel/queries/insertOrUpdateEmail.edgeql @@ -0,0 +1,27 @@ +with + NewEmail := ( + insert Email { + address := $address, + provider := $package_version, + user := ( + select User + filter .name = $name + limit 1 + ) + } + unless conflict on .address + else ( + update Email + filter .address = $address + set { + provider := $package_version, + user := ( + select User + filter .name = $name + limit 1 + ) + } + ) + ) + +select NewEmail { ** }; diff --git a/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql b/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql new file mode 100644 index 00000000000..1b6775826f7 --- /dev/null +++ b/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql @@ -0,0 +1,40 @@ +with + NewUser := ( + insert User { + name := $name, + description := $package_version, + has_profile := $has_profile, + } + unless conflict on .name + else ( + update User + filter .name = $name + set { + package_version := $package_version, + description := $package_version, + has_profile := $has_profile, + } + ) + ), + + InsertEmails := ( + for email in array_unpack(>>$dependencies) + union ( + insert Email { + address := email.address, + provider := email.provider, + user := NewUser, + } + unless conflict on (.address) + else ( + update Email + filter .address = email.address + and .user.name = NewUser.name + set { + provider := email.provider, + } + ) + ) + ), + +select NewUser { ** }; diff --git a/starters/features/gel/gel/schema/default.gel b/starters/features/gel/gel/schema/default.gel new file mode 100644 index 00000000000..17dca7eeeda --- /dev/null +++ b/starters/features/gel/gel/schema/default.gel @@ -0,0 +1,29 @@ +// This is where the database schema goes +// Read more here: https://docs.geldata.com/reference/datamodel + + abstract type Timestamped { + last_updated: datetime { + rewrite insert, update using (datetime_of_statement()); + }; + } + +type User extends Timestamped { + errmessage := 'A user with that name already exists!' + required name: str { + constraint exclusive; + }; + description: str; + has_profile: bool; + multi emails: . { + const message = error instanceof Error ? error.message.toLowerCase() : ""; + return ( + message.includes("connection") || + message.includes("timeout") || + message.includes("network") || + message.includes("invalidreferenceerror") + ); +}; + +const createNewClient = (): Executor => { + console.log("Creating new database client"); + return createClient(); +}; + +const closeClient = (): void => { + if (client) { + client = null; + console.log("Database client closed"); + } +}; + +// Main client management functions +export const getClient = (): Executor => { + if (!client) { + closeClient(); + client = createNewClient(); + } + + return client; +}; + +// Regular async function preserves generic types with optional args +export const executeQuery = async ( + queryFn: TArgs extends void + ? (client: Executor) => Promise + : (client: Executor, args: TArgs) => Promise, + args?: TArgs, +): Promise => { + const dbClient = getClient(); + + try { + if (args === undefined) { + return await (queryFn as (client: Executor) => Promise)(dbClient); + } else { + return await (queryFn as (client: Executor, args: TArgs) => Promise)( + dbClient, + args, + ); + } + } catch (error) { + console.error("Database query failed:", error); + + if (isConnectionError(error)) { + console.log("Connection error detected, recreating client..."); + closeClient(); + const newClient = getClient(); + if (args === undefined) { + return await (queryFn as (client: Executor) => Promise)(newClient); + } else { + return await (queryFn as (client: Executor, args: TArgs) => Promise)( + newClient, + args, + ); + } + } + + throw error; + } +}; diff --git a/starters/features/gel/src/actions/user/.gitkeep b/starters/features/gel/src/actions/user/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/starters/features/gel/src/actions/user/index.ts b/starters/features/gel/src/actions/user/index.ts new file mode 100644 index 00000000000..0c92fd53545 --- /dev/null +++ b/starters/features/gel/src/actions/user/index.ts @@ -0,0 +1,9 @@ +import { server$ } from "@qwik.dev/router"; +import { executeQuery } from "../client"; +import * as queries from "../../../gel/queries"; + + +export const getAllUsers = server$(async () => { + return await executeQuery(queries.getAllUsers); +}); + diff --git a/starters/features/gel/src/hooks/.gitkeep b/starters/features/gel/src/hooks/.gitkeep new file mode 100644 index 00000000000..e69de29bb2d diff --git a/starters/features/gel/src/hooks/user.hooks.ts b/starters/features/gel/src/hooks/user.hooks.ts new file mode 100644 index 00000000000..07b39e162f9 --- /dev/null +++ b/starters/features/gel/src/hooks/user.hooks.ts @@ -0,0 +1,13 @@ +import { useSignal, useTask$ } from "@qwik.dev/core"; +import { + getUsers, +} from "~/actions/user"; + +export const useGetUsers = () => { + const signal = useSignal>>([]); + useTask$(async () => { + const result = await getUsers(); + signal.value = result; + }); + return signal; +}; \ No newline at end of file From 3f218d769a3268456b74c3e325cdb0bb299fc0da Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Wed, 24 Sep 2025 18:35:02 -0400 Subject: [PATCH 3/9] meant to delete --- starters/features/gel/gel/queries/insertOrUpdateUser.edgeql | 1 - 1 file changed, 1 deletion(-) diff --git a/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql b/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql index 1b6775826f7..ab499c56e3e 100644 --- a/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql +++ b/starters/features/gel/gel/queries/insertOrUpdateUser.edgeql @@ -29,7 +29,6 @@ with else ( update Email filter .address = email.address - and .user.name = NewUser.name set { provider := email.provider, } From 90fc2118ff5e5a4abc1b9a7940f57db4efdc8b63 Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Thu, 25 Sep 2025 15:40:13 -0400 Subject: [PATCH 4/9] add to tests --- .../Docs/integrations-pages-load.spec.ts | 5 ++ .../tests/Docs/pages-load-test.spec.ts | 1 + .../routes/docs/integrations/gel/index.mdx | 6 ++- packages/docs/src/routes/docs/menu.md | 1 + starters/features/gel/package.json | 54 +++++++++++-------- 5 files changed, 44 insertions(+), 23 deletions(-) diff --git a/e2e/docs-e2e/tests/Docs/integrations-pages-load.spec.ts b/e2e/docs-e2e/tests/Docs/integrations-pages-load.spec.ts index d580c8457b6..aa97902362a 100644 --- a/e2e/docs-e2e/tests/Docs/integrations-pages-load.spec.ts +++ b/e2e/docs-e2e/tests/Docs/integrations-pages-load.spec.ts @@ -35,6 +35,11 @@ test('Integrations Drizzle page loads', async ({ page }) => { await expect(page).toHaveTitle('Drizzle | Integrations 📚 Qwik Documentation'); }); +test('Integrations Gel page loads', async ({ page }) => { + await page.goto('/docs/integrations/gel/'); + await expect(page).toHaveTitle('Gel | Integrations 📚 Qwik Documentation'); +}); + test('Integrations Internationalization page loads', async ({ page }) => { await page.goto('/docs/integrations/i18n/'); await expect(page).toHaveTitle('Internationalization | Integrations 📚 Qwik Documentation'); diff --git a/e2e/docs-e2e/tests/Docs/pages-load-test.spec.ts b/e2e/docs-e2e/tests/Docs/pages-load-test.spec.ts index 1720624cc71..d6b4b3b559f 100644 --- a/e2e/docs-e2e/tests/Docs/pages-load-test.spec.ts +++ b/e2e/docs-e2e/tests/Docs/pages-load-test.spec.ts @@ -102,6 +102,7 @@ test('docs page loads', async ({ page }) => { 'Builder.io', 'Cypress', 'Drizzle', + 'Gel', 'i18n', 'Icons', 'Image Optimization', diff --git a/packages/docs/src/routes/docs/integrations/gel/index.mdx b/packages/docs/src/routes/docs/integrations/gel/index.mdx index 57c232996ea..2d4fd80d4b8 100644 --- a/packages/docs/src/routes/docs/integrations/gel/index.mdx +++ b/packages/docs/src/routes/docs/integrations/gel/index.mdx @@ -3,7 +3,7 @@ title: Gel | Integrations keywords: 'Gel, EdgeDB, database, data, postgres' contributors: - nabrams -updated_at: '2024-08-01T18:53:23Z' +updated_at: '2025-09-25T18:53:23Z' created_at: '2025-08-01T23:00:50Z' --- @@ -19,7 +19,9 @@ and streamlines your entire database workflow. Gel can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side. -The easiest way to add Gel to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `db` folder with the drizzle schema. +The easiest way to add Gel to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `gel` folder with the gel schema. + +It will also create a `gel.toml` file to configure the gel instance. Everything you need to get started is there. diff --git a/packages/docs/src/routes/docs/menu.md b/packages/docs/src/routes/docs/menu.md index d77d6583a3f..bfd5fda55ee 100644 --- a/packages/docs/src/routes/docs/menu.md +++ b/packages/docs/src/routes/docs/menu.md @@ -65,6 +65,7 @@ - [Builder.io](integrations/builderio/index.mdx) - [Cypress](integrations/cypress/index.mdx) - [Drizzle](integrations/drizzle/index.mdx) +- [Gel](integrations/gel/index.mdx) - [i18n](integrations/i18n/index.mdx) - [Icons](integrations/icons/index.mdx) - [Image Optimization](integrations/image-optimization/index.mdx) diff --git a/starters/features/gel/package.json b/starters/features/gel/package.json index c5ac0fecffa..392ce274e88 100644 --- a/starters/features/gel/package.json +++ b/starters/features/gel/package.json @@ -1,22 +1,34 @@ { - "description": "Gel: Graph Relational Database on top of Postgres", - "__qwik__": { - "displayName": "Integration: GelDB", - "priority": -10, - "docs": [ - "https://www.geldata.com/docs/quickstart" - ] - }, - "viteConfig": {}, - "scripts": { - "gel:generate": "pnpm run gel:generate:queries && pnpm run gel:generate:queries --file && pnpm run gel:generate:interfaces && pnpm run gel:generate:edgeql-js" - }, - "devDependencies": { - "@gel/generate": "^0.6.3", - "@qwik.dev/router": "2.0.0-beta.6", - "@qwik.dev/core": "2.0.0-beta.6" - }, - "dependencies": { - "gel": "2.1.1" - } - } \ No newline at end of file + "description": "Gel: Graph Relational Database on top of Postgres", + "__qwik__": { + "displayName": "Integration: GelDB", + "priority": -10, + "docs": [ + "https://www.geldata.com/docs/quickstart" + ] + }, + "viteConfig": {}, + "nextSteps": { + "title": "Next Steps", + "lines": [ + " Gel was installed with a simple DB schema and some demo routes,", + " now you need to run `npm run gel:migrate` to setup the database.", + "", + "", + "", + " Gel ui was also added which you can access by running `npm run gel:ui`,", + "", + " Check out the Gel docs for more info:", + " - https://www.geldata.com/docs/overview" + ] + }, + "scripts": { + "gel:generate": "pnpm run gel generate:queries && pnpm run gel generate:queries --file && pnpm run gel generate:interfaces && pnpm run gel generate:edgeql-js", + "gel:migrate": "pnpm run gel migrate", + "gel:ui": "pnpm run gel ui" + }, + "dependencies": { + "@gel/generate": "^0.6.4", + "gel": "^2.1.1" + } +} From 9f3045fdf68869cd7954250caa20af001c7dc9ff Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Wed, 1 Oct 2025 18:16:47 -0400 Subject: [PATCH 5/9] fix linting errors --- packages/qwik/src/qwikloader.unit.ts | 1 - starters/features/gel/src/actions/user/index.ts | 2 -- starters/features/gel/src/hooks/user.hooks.ts | 12 +++++------- .../{prettier.config.js => prettier.config.mjs} | 0 4 files changed, 5 insertions(+), 10 deletions(-) rename starters/features/tailwind-v3/{prettier.config.js => prettier.config.mjs} (100%) diff --git a/packages/qwik/src/qwikloader.unit.ts b/packages/qwik/src/qwikloader.unit.ts index 08dede8f7d3..2e201d2a0cf 100644 --- a/packages/qwik/src/qwikloader.unit.ts +++ b/packages/qwik/src/qwikloader.unit.ts @@ -29,7 +29,6 @@ test('qwikloader script', () => { `); expect(qwikLoader).toMatchInlineSnapshot( - //eslint-disable-next-line `"const t=document,e=window,n=new Set,o=new Set([t]);let r;const s=(t,e)=>Array.from(t.querySelectorAll(e)),a=t=>{const e=[];return o.forEach(n=>e.push(...s(n,t))),e},i=t=>{w(t),s(t,"[q\\\\:shadowroot]").forEach(t=>{const e=t.shadowRoot;e&&i(e)})},c=t=>t&&"function"==typeof t.then,l=(t,e,n=e.type)=>{a("[on"+t+"\\\\:"+n+"]").forEach(o=>{b(o,t,e,n)})},f=e=>{if(void 0===e._qwikjson_){let n=(e===t.documentElement?t.body:e).lastElementChild;for(;n;){if("SCRIPT"===n.tagName&&"qwik/json"===n.getAttribute("type")){e._qwikjson_=JSON.parse(n.textContent.replace(/\\\\x3C(\\/?script)/gi,"<$1"));break}n=n.previousElementSibling}}},p=(t,e)=>new CustomEvent(t,{detail:e}),b=async(e,n,o,r=o.type)=>{const s="on"+n+":"+r;e.hasAttribute("preventdefault:"+r)&&o.preventDefault(),e.hasAttribute("stoppropagation:"+r)&&o.stopPropagation();const a=e._qc_,i=a&&a.li.filter(t=>t[0]===s);if(i&&i.length>0){for(const t of i){const n=t[1].getFn([e,o],()=>e.isConnected)(o,e),r=o.cancelBubble;c(n)&&await n,r&&o.stopPropagation()}return}const l=e.getAttribute(s);if(l){const n=e.closest("[q\\\\:container]"),r=n.getAttribute("q:base"),s=n.getAttribute("q:version")||"unknown",a=n.getAttribute("q:manifest-hash")||"dev",i=new URL(r,t.baseURI);for(const p of l.split("\\n")){const l=new URL(p,i),b=l.href,h=l.hash.replace(/^#?([^?[|]*).*$/,"$1")||"default",q=performance.now();let _,d,y;const w=p.startsWith("#"),g={qBase:r,qManifest:a,qVersion:s,href:b,symbol:h,element:e,reqTime:q};if(w){const e=n.getAttribute("q:instance");_=(t["qFuncs_"+e]||[])[Number.parseInt(h)],_||(d="sync",y=Error("sym:"+h))}else{u("qsymbol",g);const t=l.href.split("#")[0];try{const e=import(t);f(n),_=(await e)[h],_||(d="no-symbol",y=Error(\`\${h} not in \${t}\`))}catch(t){d||(d="async"),y=t}}if(!_){u("qerror",{importError:d,error:y,...g}),console.error(y);break}const m=t.__q_context__;if(e.isConnected)try{t.__q_context__=[e,o,l];const n=_(o,e);c(n)&&await n}catch(t){u("qerror",{error:t,...g})}finally{t.__q_context__=m}}}},u=(e,n)=>{t.dispatchEvent(p(e,n))},h=t=>t.replace(/([A-Z])/g,t=>"-"+t.toLowerCase()),q=async t=>{let e=h(t.type),n=t.target;for(l("-document",t,e);n&&n.getAttribute;){const o=b(n,"",t,e);let r=t.cancelBubble;c(o)&&await o,r||(r=r||t.cancelBubble||n.hasAttribute("stoppropagation:"+t.type)),n=t.bubbles&&!0!==r?n.parentElement:null}},_=t=>{l("-window",t,h(t.type))},d=()=>{const s=t.readyState;if(!r&&("interactive"==s||"complete"==s)&&(o.forEach(i),r=1,u("qinit"),(e.requestIdleCallback??e.setTimeout).bind(e)(()=>u("qidle")),n.has("qvisible"))){const t=a("[on\\\\:qvisible]"),e=new IntersectionObserver(t=>{for(const n of t)n.isIntersecting&&(e.unobserve(n.target),b(n.target,"",p("qvisible",n)))});t.forEach(t=>e.observe(t))}},y=(t,e,n,o=!1)=>{t.addEventListener(e,n,{capture:o,passive:!1})},w=(...t)=>{for(const r of t)"string"==typeof r?n.has(r)||(o.forEach(t=>y(t,r,q,!0)),y(e,r,_,!0),n.add(r)):o.has(r)||(n.forEach(t=>y(r,t,q,!0)),o.add(r))};if(!("__q_context__"in t)){t.__q_context__=0;const r=e.qwikevents;r&&(Array.isArray(r)?w(...r):w("click","input")),e.qwikevents={events:n,roots:o,push:w},y(t,"readystatechange",d),d()}"` ); }); diff --git a/starters/features/gel/src/actions/user/index.ts b/starters/features/gel/src/actions/user/index.ts index 0c92fd53545..450db747a5c 100644 --- a/starters/features/gel/src/actions/user/index.ts +++ b/starters/features/gel/src/actions/user/index.ts @@ -2,8 +2,6 @@ import { server$ } from "@qwik.dev/router"; import { executeQuery } from "../client"; import * as queries from "../../../gel/queries"; - export const getAllUsers = server$(async () => { return await executeQuery(queries.getAllUsers); }); - diff --git a/starters/features/gel/src/hooks/user.hooks.ts b/starters/features/gel/src/hooks/user.hooks.ts index 07b39e162f9..4b92c1a0524 100644 --- a/starters/features/gel/src/hooks/user.hooks.ts +++ b/starters/features/gel/src/hooks/user.hooks.ts @@ -1,13 +1,11 @@ -import { useSignal, useTask$ } from "@qwik.dev/core"; -import { - getUsers, -} from "~/actions/user"; +import { useSignal, useTask$ } from "@builder.io/qwik"; +import { getAllUsers } from "../actions/user"; export const useGetUsers = () => { - const signal = useSignal>>([]); + const signal = useSignal>>([]); useTask$(async () => { - const result = await getUsers(); + const result = await getAllUsers(); signal.value = result; }); return signal; -}; \ No newline at end of file +}; diff --git a/starters/features/tailwind-v3/prettier.config.js b/starters/features/tailwind-v3/prettier.config.mjs similarity index 100% rename from starters/features/tailwind-v3/prettier.config.js rename to starters/features/tailwind-v3/prettier.config.mjs From 1c86d2e4fab2f348f22c8b7061fca0797313f536 Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Wed, 1 Oct 2025 18:40:01 -0400 Subject: [PATCH 6/9] fix irrelevant broken tests --- package.json | 3 +- packages/docs/src/routes/api/qwik/api.json | 2 +- packages/docs/src/routes/api/qwik/index.mdx | 2 +- .../src/optimizer/src/qwik-binding-map.ts | 28 ------------------- starters/e2e/e2e.use-id.spec.ts | 3 +- 5 files changed, 6 insertions(+), 32 deletions(-) diff --git a/package.json b/package.json index 3410b15ea69..8f66b16e139 100644 --- a/package.json +++ b/package.json @@ -235,12 +235,13 @@ "serve.debug": "tsx --require ./scripts/runBefore.ts --inspect-brk --conditions=development starters/dev-server.ts 3300", "start": "pnpm run --stream \"/.*\\.watch/\"", "test": "pnpm build.full && pnpm test.unit && pnpm test.e2e", - "test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit && test.e2e.integrations", + "test.e2e": "pnpm test.e2e.chromium && pnpm test.e2e.webkit && pnpm test.e2e.integrations", "test.e2e.chromium": "playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.chromium.debug": "PWDEBUG=1 playwright test starters --browser=chromium --config starters/playwright.config.ts", "test.e2e.city": "playwright test starters/e2e/qwikcity --browser=chromium --config starters/playwright.config.ts", "test.e2e.cli": "pnpm --filter qwik-cli-e2e e2e", "test.e2e.firefox": "playwright test starters --browser=firefox --config starters/playwright.config.ts", + "test.e2e.integrations": "pnpm test.e2e.integrations.chromium && pnpm test.e2e.integrations.webkit", "test.e2e.integrations.chromium": "playwright test e2e/adapters-e2e/tests --project=chromium --config e2e/adapters-e2e/playwright.config.ts", "test.e2e.integrations.webkit": "playwright test e2e/adapters-e2e/tests --project=webkit --config e2e/adapters-e2e/playwright.config.ts", "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", diff --git a/packages/docs/src/routes/api/qwik/api.json b/packages/docs/src/routes/api/qwik/api.json index 91d5fcdccaa..8750f3fe20d 100644 --- a/packages/docs/src/routes/api/qwik/api.json +++ b/packages/docs/src/routes/api/qwik/api.json @@ -1774,7 +1774,7 @@ } ], "kind": "Function", - "content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\n> Warning: This API is now obsolete.\n> \n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\n> \n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n\n\n\n
\n\n**Returns:**\n\n[JSXNode](#jsxnode)<'script'>", + "content": "> This API is provided as an alpha preview for developers and may change based on feedback that we receive. Do not use this API in a production environment.\n> \n\n> Warning: This API is now obsolete.\n> \n> This is no longer needed as the preloading happens automatically in qrl-class.ts. Leave this in your app for a while so it uninstalls existing service workers, but don't use it for new projects.\n> \n\n\n```typescript\nPrefetchServiceWorker: (opts: {\n base?: string;\n scope?: string;\n path?: string;\n verbose?: boolean;\n fetchBundleGraph?: boolean;\n nonce?: string;\n}) => JSXNode<'script'>\n```\n\n\n\n\n
\n\nParameter\n\n\n\n\nType\n\n\n\n\nDescription\n\n\n
\n\nopts\n\n\n\n\n{ base?: string; scope?: string; path?: string; verbose?: boolean; fetchBundleGraph?: boolean; nonce?: string; }\n\n\n\n\n\n
\n\n**Returns:**\n\nJSXNode<'script'>", "editUrl": "https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts", "mdFile": "qwik.prefetchserviceworker.md" }, diff --git a/packages/docs/src/routes/api/qwik/index.mdx b/packages/docs/src/routes/api/qwik/index.mdx index 1ddbfe7a032..0b47efdd79d 100644 --- a/packages/docs/src/routes/api/qwik/index.mdx +++ b/packages/docs/src/routes/api/qwik/index.mdx @@ -3667,7 +3667,7 @@ opts **Returns:** -[JSXNode](#jsxnode)<'script'> +JSXNode<'script'> [Edit this section](https://github.com/QwikDev/qwik/tree/main/packages/qwik/src/core/components/prefetch.ts) diff --git a/packages/qwik/src/optimizer/src/qwik-binding-map.ts b/packages/qwik/src/optimizer/src/qwik-binding-map.ts index cceeb273668..857c9ae8fff 100644 --- a/packages/qwik/src/optimizer/src/qwik-binding-map.ts +++ b/packages/qwik/src/optimizer/src/qwik-binding-map.ts @@ -11,34 +11,6 @@ export const QWIK_BINDING_MAP = { "abi": null, "platformArchABI": "qwik.darwin-arm64.node" } - ], - "x64": [ - { - "platform": "darwin", - "arch": "x64", - "abi": null, - "platformArchABI": "qwik.darwin-x64.node" - } - ] - }, - "win32": { - "x64": [ - { - "platform": "win32", - "arch": "x64", - "abi": "msvc", - "platformArchABI": "qwik.win32-x64-msvc.node" - } - ] - }, - "linux": { - "x64": [ - { - "platform": "linux", - "arch": "x64", - "abi": "gnu", - "platformArchABI": "qwik.linux-x64-gnu.node" - } ] } }; diff --git a/starters/e2e/e2e.use-id.spec.ts b/starters/e2e/e2e.use-id.spec.ts index d98e732b749..e2ee7279229 100644 --- a/starters/e2e/e2e.use-id.spec.ts +++ b/starters/e2e/e2e.use-id.spec.ts @@ -1,4 +1,5 @@ -import { test, expect, Locator } from "@playwright/test"; +import { test, expect } from "@playwright/test"; +import type { Locator } from "@playwright/test"; test.describe("use-id", () => { test.beforeEach(async ({ page }) => { From 68ffac3d425fb80f1a43479a2633bcd17fb34ecd Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Mon, 6 Oct 2025 18:19:01 -0400 Subject: [PATCH 7/9] fixed the integration scripts and implementation to have it initialze gel for user# Please enter the commit message for your changes. Lines starting --- starters/features/gel/dbschema/default.gel | 29 +++++++++++++ starters/features/gel/dbschema/extensions.gel | 33 ++++++++++++++ starters/features/gel/dbschema/futures.gel | 4 ++ .../dbschema/migrations/00001-m1nmosd.edgeql | 35 +++++++++++++++ starters/features/gel/gel/schema/default.gel | 29 ------------- .../gel/gel/schema/migrations/.gitkeep | 0 starters/features/gel/package.json | 43 +++++++++++-------- .../features/gel/{gel => }/queries/.gitkeep | 0 .../gel/{gel => }/queries/getUser.edgeql | 0 .../queries/insertOrUpdateEmail.edgeql | 0 .../queries/insertOrUpdateUser.edgeql | 0 11 files changed, 125 insertions(+), 48 deletions(-) create mode 100644 starters/features/gel/dbschema/default.gel create mode 100644 starters/features/gel/dbschema/extensions.gel create mode 100644 starters/features/gel/dbschema/futures.gel create mode 100644 starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql delete mode 100644 starters/features/gel/gel/schema/default.gel delete mode 100644 starters/features/gel/gel/schema/migrations/.gitkeep rename starters/features/gel/{gel => }/queries/.gitkeep (100%) rename starters/features/gel/{gel => }/queries/getUser.edgeql (100%) rename starters/features/gel/{gel => }/queries/insertOrUpdateEmail.edgeql (100%) rename starters/features/gel/{gel => }/queries/insertOrUpdateUser.edgeql (100%) diff --git a/starters/features/gel/dbschema/default.gel b/starters/features/gel/dbschema/default.gel new file mode 100644 index 00000000000..e4bedd9e379 --- /dev/null +++ b/starters/features/gel/dbschema/default.gel @@ -0,0 +1,29 @@ +module default { + abstract type Timestamped { + last_updated: datetime { + rewrite insert, update using (datetime_of_statement()); + }; + } + + type User extending Timestamped{ + errmessage := 'A user with that name already exists!'; + required name: str { + constraint exclusive; + }; + description: str; + has_profile: bool; + multi emails: Email; + + index on (.name); + + } + + type Email { + errmessage := 'an email with that address already exists!'; + required address: str { + constraint exclusive; + }; + provider: str; + required user: User; + } +} diff --git a/starters/features/gel/dbschema/extensions.gel b/starters/features/gel/dbschema/extensions.gel new file mode 100644 index 00000000000..c566b414fd4 --- /dev/null +++ b/starters/features/gel/dbschema/extensions.gel @@ -0,0 +1,33 @@ +# This file contains Gel extensions used by the project. +# Uncomment the `using extension ...` below to enable them. + + +# Gel Auth is a batteries-included authentication solution +# for your app built into the Gel server. +# +# See: https://docs.geldata.com/reference/auth +# +#using extension auth; + + +# Gel AI is a set of tools designed to enable you to ship +# AI-enabled apps with practically no effort. +# +# See: https://docs.geldata.com/reference/ai +# +#using extension ai; + + +# The `ext::postgis` extension exposes the functionality of the +# PostGIS library. It is a vast library dedicated to handling +# geographic and various geometric data. The scope of the Gel +# extension is to mainly adapt the types and functions used in +# this library with minimal changes. +# +# See: https://docs.geldata.com/reference/stdlib/postgis +# +# `ext::postgis` is not installed by default, use the command +# `gel extension` to manage its installation, then uncomment +# the line below to enable it. +# +#using extension postgis; diff --git a/starters/features/gel/dbschema/futures.gel b/starters/features/gel/dbschema/futures.gel new file mode 100644 index 00000000000..20f2ff302b4 --- /dev/null +++ b/starters/features/gel/dbschema/futures.gel @@ -0,0 +1,4 @@ +# Use a simpler algorithm for resolving the scope of object names. +# This behavior will become the default in Gel 8.0. +# See: https://docs.geldata.com/reference/edgeql/path_resolution#new-path-scoping +using future simple_scoping; diff --git a/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql b/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql new file mode 100644 index 00000000000..4da7c1fb98e --- /dev/null +++ b/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql @@ -0,0 +1,35 @@ +CREATE MIGRATION m1nmosduidfn2cl6attui644sivfoenkklq3y6m2b6vacma2pwoeva + ONTO initial +{ + CREATE FUTURE simple_scoping; + CREATE TYPE default::Email { + CREATE REQUIRED PROPERTY address: std::str { + CREATE CONSTRAINT std::exclusive; + }; + CREATE PROPERTY errmessage := ('an email with that address already exists!'); + CREATE PROPERTY provider: std::str; + }; + CREATE ABSTRACT TYPE default::Timestamped { + CREATE PROPERTY last_updated: std::datetime { + CREATE REWRITE + INSERT + USING (std::datetime_of_statement()); + CREATE REWRITE + UPDATE + USING (std::datetime_of_statement()); + }; + }; + CREATE TYPE default::User EXTENDING default::Timestamped { + CREATE MULTI LINK emails: default::Email; + CREATE REQUIRED PROPERTY name: std::str { + CREATE CONSTRAINT std::exclusive; + }; + CREATE INDEX ON (.name); + CREATE PROPERTY description: std::str; + CREATE PROPERTY errmessage := ('A user with that name already exists!'); + CREATE PROPERTY has_profile: std::bool; + }; + ALTER TYPE default::Email { + CREATE REQUIRED LINK user: default::User; + }; +}; diff --git a/starters/features/gel/gel/schema/default.gel b/starters/features/gel/gel/schema/default.gel deleted file mode 100644 index 17dca7eeeda..00000000000 --- a/starters/features/gel/gel/schema/default.gel +++ /dev/null @@ -1,29 +0,0 @@ -// This is where the database schema goes -// Read more here: https://docs.geldata.com/reference/datamodel - - abstract type Timestamped { - last_updated: datetime { - rewrite insert, update using (datetime_of_statement()); - }; - } - -type User extends Timestamped { - errmessage := 'A user with that name already exists!' - required name: str { - constraint exclusive; - }; - description: str; - has_profile: bool; - multi emails: . Date: Thu, 9 Oct 2025 23:13:28 -0600 Subject: [PATCH 8/9] simplify db schema, add more queries, make ui viz work --- e2e/docs-e2e/package.json | 2 +- e2e/qwik-react-e2e/package.json | 8 +- package.json | 2 +- .../routes/docs/integrations/gel/index.mdx | 98 +++++++++++++++++-- packages/qwik/package.json | 12 +-- starters/features/gel/dbschema/default.gel | 24 ++--- .../dbschema/migrations/00001-m1nmosd.edgeql | 35 ------- .../features/gel/queries/deleteUser.edgeql | 6 ++ .../features/gel/queries/getAllUsers.edgeql | 2 + starters/features/gel/queries/getUser.edgeql | 15 ++- .../gel/queries/insertOrUpdateEmail.edgeql | 27 ----- .../gel/queries/insertOrUpdateUser.edgeql | 37 +++---- starters/features/gel/src/actions/client.ts | 2 - .../features/gel/src/actions/user/index.ts | 27 ++++- starters/features/gel/src/hooks/user.hooks.ts | 44 ++++++++- .../features/gel/src/routes/create/index.tsx | 59 +++++++++++ starters/features/gel/src/routes/index.tsx | 35 +++++++ .../gel/src/routes/users/[userId]/index.tsx | 46 +++++++++ .../features/gel/src/routes/users/index.tsx | 43 ++++++++ 19 files changed, 391 insertions(+), 133 deletions(-) delete mode 100644 starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql create mode 100644 starters/features/gel/queries/deleteUser.edgeql create mode 100644 starters/features/gel/queries/getAllUsers.edgeql delete mode 100644 starters/features/gel/queries/insertOrUpdateEmail.edgeql create mode 100644 starters/features/gel/src/routes/create/index.tsx create mode 100644 starters/features/gel/src/routes/index.tsx create mode 100644 starters/features/gel/src/routes/users/[userId]/index.tsx create mode 100644 starters/features/gel/src/routes/users/index.tsx diff --git a/e2e/docs-e2e/package.json b/e2e/docs-e2e/package.json index bbb9fb2081a..dca847986dd 100644 --- a/e2e/docs-e2e/package.json +++ b/e2e/docs-e2e/package.json @@ -1,7 +1,6 @@ { "name": "docs-e2e", "description": "", - "private": true, "author": "", "devDependencies": { "@playwright/test": "1.50.1", @@ -10,6 +9,7 @@ "keywords": [], "license": "ISC", "main": "index.js", + "private": true, "scripts": { "test": "pnpm exec playwright test --config=playwright.config.ts --project=chromium", "test-ui": "pnpm exec playwright test --config=playwright.config.ts --project=chromium --ui" diff --git a/e2e/qwik-react-e2e/package.json b/e2e/qwik-react-e2e/package.json index 71d5c96f4d9..ed24607458b 100644 --- a/e2e/qwik-react-e2e/package.json +++ b/e2e/qwik-react-e2e/package.json @@ -1,10 +1,6 @@ { "name": "qwik-react-test-app", "description": "Qwik react test app", - "engines": { - "node": "^18.17.0 || ^20.3.0 || >=21.0.0" - }, - "private": true, "devDependencies": { "@builder.io/qwik-react": "workspace:^", "@types/react": "18.3.3", @@ -12,6 +8,10 @@ "react": "18.3.1", "react-dom": "18.3.1" }, + "engines": { + "node": "^18.17.0 || ^20.3.0 || >=21.0.0" + }, + "private": true, "scripts": { "build": "qwik build", "build.client": "vite build", diff --git a/package.json b/package.json index 8f66b16e139..968905f082e 100644 --- a/package.json +++ b/package.json @@ -244,9 +244,9 @@ "test.e2e.integrations": "pnpm test.e2e.integrations.chromium && pnpm test.e2e.integrations.webkit", "test.e2e.integrations.chromium": "playwright test e2e/adapters-e2e/tests --project=chromium --config e2e/adapters-e2e/playwright.config.ts", "test.e2e.integrations.webkit": "playwright test e2e/adapters-e2e/tests --project=webkit --config e2e/adapters-e2e/playwright.config.ts", - "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", "test.e2e.qwik-react.chromium": "playwright test e2e/qwik-react-e2e/tests --project=chromium --config e2e/qwik-react-e2e/playwright.config.ts", "test.e2e.qwik-react.webkit": "playwright test e2e/qwik-react-e2e/tests --project=webkit --config e2e/qwik-react-e2e/playwright.config.ts", + "test.e2e.webkit": "playwright test starters --browser=webkit --config starters/playwright.config.ts", "test.rust": "make test", "test.rust.update": "make test-update", "test.unit": "vitest packages", diff --git a/packages/docs/src/routes/docs/integrations/gel/index.mdx b/packages/docs/src/routes/docs/integrations/gel/index.mdx index 2d4fd80d4b8..885391c1865 100644 --- a/packages/docs/src/routes/docs/integrations/gel/index.mdx +++ b/packages/docs/src/routes/docs/integrations/gel/index.mdx @@ -13,18 +13,17 @@ import PackageManagerTabs from '~/components/package-manager-tabs/index.tsx'; [GelDB](https://www.geldata.com/) Gel is a scalable, integrated data platform on top of Postgres. -Gel gives the relational model a fresh facelift, solves n+1, simplifies migrations, - -and streamlines your entire database workflow. +Gel gives the relational model a fresh facelift, solves n+1, simplifies migrations, and streamlines your entire database workflow. Gel can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side. -The easiest way to add Gel to Qwik is using the Qwik CLI command. This will install the required dependencies and create a `gel` folder with the gel schema. +The simplest way to add Gel to your Qwik project is by running the Qwik CLI command. This will automatically install all necessary dependencies, set up a basic schema in the `dbschema` folder, and generate a `queries` directory to help you start building your own API queries. Additionally, it will scaffold `actions` and `hooks` folders with example routes and files, giving you a ready-to-use foundation for working with Gel in your app. -It will also create a `gel.toml` file to configure the gel instance. Everything you need to get started is there. +It will also create a `gel.toml` file to configure the gel instance. Everything you need to start building your app with Gel is there. + ```shell pnpm run qwik add gel ``` @@ -50,13 +49,92 @@ bun run qwik add gel ## Auto-generating queries -Gel lets you automatically generate queries for your database schema by using +Gel lets you automatically generate queries for your database schema by using their query language EdgeQL. +It is already installed for you and you can use the following scripts to utilize it: -their query language EdgeQL combined with `npm install @gel/generate --save-dev`. +*** Before you start, make sure you have run the following command: +```shell +pnpm run gel:generate:all +``` The following ``s are currently supported: -- `queries`: Generate typed functions from *.edgeql files -- `interfaces`: Generate interfaces for your schema types -- `edgeql-js`: Generate the query builder +- Command: `gel:generate:queries` > + - `queries`: Generate typed functions from *.edgeql files +- Command: `gel:generate:types` > + - `interfaces`: Generate interfaces for your schema types + - `edgeql-js`: Generate the query builder +- Command: `gel:generate:all` > + - `queries` + `interfaces` + `edgeql-js` + + + + +## Gel UI + +You can also use the Gel UI to view and edit your database schema, query your data, among other things. +To do so, run the following command: + + + +```shell +pnpm run gel:ui +``` + + +```shell +npm run gel:ui +``` + + +```shell +yarn run gel:ui +``` + + +```shell +bun run gel:ui +``` + + + +## Listing users + +We will use `routeLoader$` to query all users in the DB, using `db.query.users.findMany()`, and returning the result. + +```tsx {7} /Gel/ title="src/routes/users/index.tsx" +import { component$ } from "@builder.io/qwik"; +import { routeLoader$ } from "@builder.io/qwik-city"; +import { drizzle } from "drizzle-orm/better-sqlite3"; +import Database from "better-sqlite3"; +import { schema } from "../../../drizzle/schema"; + +export const useGetUsers = routeLoader$(async () => { + const sqlite = new Database("./drizzle/db/db.sqlite"); + const db = drizzle(sqlite, { schema }); + const users = await db.query.users.findMany(); + return users; +}); + +export default component$(() => { + const users = useGetUsers(); + return ( +
+

User's directory

+ +
+ ); +}); + +``` + + diff --git a/packages/qwik/package.json b/packages/qwik/package.json index 9015e82a484..77eab0281bb 100644 --- a/packages/qwik/package.json +++ b/packages/qwik/package.json @@ -47,8 +47,8 @@ "import": { "development": "./dist/core.mjs", "production": "./dist/core.prod.mjs", - "min": "./dist/core.min.mjs", - "default": "./dist/core.prod.mjs" + "default": "./dist/core.prod.mjs", + "min": "./dist/core.min.mjs" }, "require": { "development": "./dist/core.cjs", @@ -64,8 +64,8 @@ "import": { "development": "./dist/core.mjs", "production": "./dist/core.prod.mjs", - "min": "./dist/core.min.mjs", - "default": "./dist/core.prod.mjs" + "default": "./dist/core.prod.mjs", + "min": "./dist/core.min.mjs" }, "require": { "development": "./dist/core.cjs", @@ -78,8 +78,8 @@ "import": { "development": "./dist/core.mjs", "production": "./dist/core.prod.mjs", - "min": "./dist/core.min.mjs", - "default": "./dist/core.mjs" + "default": "./dist/core.mjs", + "min": "./dist/core.min.mjs" }, "require": { "development": "./dist/core.cjs", diff --git a/starters/features/gel/dbschema/default.gel b/starters/features/gel/dbschema/default.gel index e4bedd9e379..6768f04c092 100644 --- a/starters/features/gel/dbschema/default.gel +++ b/starters/features/gel/dbschema/default.gel @@ -5,25 +5,19 @@ module default { }; } - type User extending Timestamped{ - errmessage := 'A user with that name already exists!'; + type User extending Timestamped { required name: str { - constraint exclusive; + constraint exclusive { + errmessage := 'A user with that name already exists!'; + }; + }; + email: str { + constraint exclusive { + errmessage := 'A user with that email already exists!'; + }; }; - description: str; has_profile: bool; - multi emails: Email; index on (.name); - - } - - type Email { - errmessage := 'an email with that address already exists!'; - required address: str { - constraint exclusive; - }; - provider: str; - required user: User; } } diff --git a/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql b/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql deleted file mode 100644 index 4da7c1fb98e..00000000000 --- a/starters/features/gel/dbschema/migrations/00001-m1nmosd.edgeql +++ /dev/null @@ -1,35 +0,0 @@ -CREATE MIGRATION m1nmosduidfn2cl6attui644sivfoenkklq3y6m2b6vacma2pwoeva - ONTO initial -{ - CREATE FUTURE simple_scoping; - CREATE TYPE default::Email { - CREATE REQUIRED PROPERTY address: std::str { - CREATE CONSTRAINT std::exclusive; - }; - CREATE PROPERTY errmessage := ('an email with that address already exists!'); - CREATE PROPERTY provider: std::str; - }; - CREATE ABSTRACT TYPE default::Timestamped { - CREATE PROPERTY last_updated: std::datetime { - CREATE REWRITE - INSERT - USING (std::datetime_of_statement()); - CREATE REWRITE - UPDATE - USING (std::datetime_of_statement()); - }; - }; - CREATE TYPE default::User EXTENDING default::Timestamped { - CREATE MULTI LINK emails: default::Email; - CREATE REQUIRED PROPERTY name: std::str { - CREATE CONSTRAINT std::exclusive; - }; - CREATE INDEX ON (.name); - CREATE PROPERTY description: std::str; - CREATE PROPERTY errmessage := ('A user with that name already exists!'); - CREATE PROPERTY has_profile: std::bool; - }; - ALTER TYPE default::Email { - CREATE REQUIRED LINK user: default::User; - }; -}; diff --git a/starters/features/gel/queries/deleteUser.edgeql b/starters/features/gel/queries/deleteUser.edgeql new file mode 100644 index 00000000000..37a66104bda --- /dev/null +++ b/starters/features/gel/queries/deleteUser.edgeql @@ -0,0 +1,6 @@ +delete User +filter + ( + (assert_exists(User.name) ?= $name) ?? + (assert_exists(User.email) ?= $email) + ); diff --git a/starters/features/gel/queries/getAllUsers.edgeql b/starters/features/gel/queries/getAllUsers.edgeql new file mode 100644 index 00000000000..d2fd8408413 --- /dev/null +++ b/starters/features/gel/queries/getAllUsers.edgeql @@ -0,0 +1,2 @@ +select User { ** +} \ No newline at end of file diff --git a/starters/features/gel/queries/getUser.edgeql b/starters/features/gel/queries/getUser.edgeql index b47fc5bee06..be1186a59af 100644 --- a/starters/features/gel/queries/getUser.edgeql +++ b/starters/features/gel/queries/getUser.edgeql @@ -1,5 +1,12 @@ -select User { ** -} filter assert_exists(User.name) ?= $name; +select User { + ** +} +filter + ( + exists($name) and .name = $name + ) + or + ( + exists($email) and .email = $email + ); -# Filter here is optional. -# If no filter is provided, all Users will be returned. diff --git a/starters/features/gel/queries/insertOrUpdateEmail.edgeql b/starters/features/gel/queries/insertOrUpdateEmail.edgeql deleted file mode 100644 index d7eab2683ef..00000000000 --- a/starters/features/gel/queries/insertOrUpdateEmail.edgeql +++ /dev/null @@ -1,27 +0,0 @@ -with - NewEmail := ( - insert Email { - address := $address, - provider := $package_version, - user := ( - select User - filter .name = $name - limit 1 - ) - } - unless conflict on .address - else ( - update Email - filter .address = $address - set { - provider := $package_version, - user := ( - select User - filter .name = $name - limit 1 - ) - } - ) - ) - -select NewEmail { ** }; diff --git a/starters/features/gel/queries/insertOrUpdateUser.edgeql b/starters/features/gel/queries/insertOrUpdateUser.edgeql index ab499c56e3e..1d1b4233882 100644 --- a/starters/features/gel/queries/insertOrUpdateUser.edgeql +++ b/starters/features/gel/queries/insertOrUpdateUser.edgeql @@ -2,38 +2,27 @@ with NewUser := ( insert User { name := $name, - description := $package_version, - has_profile := $has_profile, + email := $email, + has_profile := $has_profile, } - unless conflict on .name + unless conflict on .name else ( update User filter .name = $name set { - package_version := $package_version, - description := $package_version, - has_profile := $has_profile, + email := $email, + has_profile := $has_profile, } ) - ), - - InsertEmails := ( - for email in array_unpack(>>$dependencies) - union ( - insert Email { - address := email.address, - provider := email.provider, - user := NewUser, + unless conflict on .email + else ( + update User + filter .email = $email + set { + name := $name, + has_profile := $has_profile, } - unless conflict on (.address) - else ( - update Email - filter .address = email.address - set { - provider := email.provider, - } - ) ) - ), + ) select NewUser { ** }; diff --git a/starters/features/gel/src/actions/client.ts b/starters/features/gel/src/actions/client.ts index 2e63a8f4556..94b9ac36f94 100644 --- a/starters/features/gel/src/actions/client.ts +++ b/starters/features/gel/src/actions/client.ts @@ -28,10 +28,8 @@ const closeClient = (): void => { // Main client management functions export const getClient = (): Executor => { if (!client) { - closeClient(); client = createNewClient(); } - return client; }; diff --git a/starters/features/gel/src/actions/user/index.ts b/starters/features/gel/src/actions/user/index.ts index 450db747a5c..32289dfd755 100644 --- a/starters/features/gel/src/actions/user/index.ts +++ b/starters/features/gel/src/actions/user/index.ts @@ -1,7 +1,28 @@ -import { server$ } from "@qwik.dev/router"; -import { executeQuery } from "../client"; -import * as queries from "../../../gel/queries"; +import { server$ } from "@builder.io/qwik-city"; +import { executeQuery } from "../../actions/client"; +import * as queries from "../../../dbschema/queries"; export const getAllUsers = server$(async () => { return await executeQuery(queries.getAllUsers); }); + +export const getUserByName = server$(async (name: string) => { + return await executeQuery(queries.getUserByName, { name: name }); +}); + +export const getUserByEmail = server$(async (email: string) => { + return await executeQuery(queries.getUserByEmail, { email: email }); +}); + +export const deleteUser = server$(async (name: string) => { + return await executeQuery(queries.deleteUser, { name: name }); +}); + +export const insertOrUpdateUser = server$( + async (name: string, email: string) => { + return await executeQuery(queries.insertOrUpdateUser, { + name: name, + email: email, + }); + }, +); diff --git a/starters/features/gel/src/hooks/user.hooks.ts b/starters/features/gel/src/hooks/user.hooks.ts index 4b92c1a0524..90a74ec77af 100644 --- a/starters/features/gel/src/hooks/user.hooks.ts +++ b/starters/features/gel/src/hooks/user.hooks.ts @@ -1,5 +1,11 @@ import { useSignal, useTask$ } from "@builder.io/qwik"; -import { getAllUsers } from "../actions/user"; +import { + getAllUsers, + getUserByEmail, + getUserByName, + deleteUser, + insertOrUpdateUser, +} from "../actions/user"; export const useGetUsers = () => { const signal = useSignal>>([]); @@ -9,3 +15,39 @@ export const useGetUsers = () => { }); return signal; }; + +export const useGetUserByName = (name: string) => { + const signal = useSignal>>([]); + useTask$(async () => { + const result = await getUserByName(name); + signal.value = result; + }); + return signal; +}; + +export const useGetUserByEmail = (email: string) => { + const signal = useSignal>>([]); + useTask$(async () => { + const result = await getUserByEmail(email); + signal.value = result; + }); + return signal; +}; + +export const useDeleteUser = (name: string) => { + const signal = useSignal>>([]); + useTask$(async () => { + const result = await deleteUser(name); + signal.value = result; + }); + return signal; +}; + +export const useCreateOrUpdateUser = (name: string, email: string) => { + const signal = useSignal>>([]); + useTask$(async () => { + const result = await insertOrUpdateUser(name, email); + signal.value = result; + }); + return signal; +}; diff --git a/starters/features/gel/src/routes/create/index.tsx b/starters/features/gel/src/routes/create/index.tsx new file mode 100644 index 00000000000..a11eb0f4f3e --- /dev/null +++ b/starters/features/gel/src/routes/create/index.tsx @@ -0,0 +1,59 @@ +import { component$ } from "@builder.io/qwik"; +import { routeAction$, zod$, z, Form } from "@builder.io/qwik-city"; +import { executeQuery } from "../../actions/client"; +import * as queries from "../../../dbschema/queries"; + +export const useCreateUser = routeAction$( + async (data) => { + // GEL implementation: use EdgeQL query to insert or update user + // Map form data to EdgeQL parameters + const params = { + name: data.name, + package_version: "", // You may want to collect this from the form or set a default + has_profile: true, // You may want to collect this from the form or set a default + dependencies: [ + { + address: data.email, + provider: "email", // You may want to collect this from the form or set a default + }, + ], + }; + const user = await executeQuery(queries.insertOrUpdateUser, params); + return user; + }, + zod$({ + name: z.string(), + email: z.string().email(), + }), +); + +export default component$(() => { + const createUserAction = useCreateUser(); + return ( +
+

Create User

+
+ + + +
+ {createUserAction.value && ( +
+

User created successfully!

+
+ )} +
+ ); +}); diff --git a/starters/features/gel/src/routes/index.tsx b/starters/features/gel/src/routes/index.tsx new file mode 100644 index 00000000000..b111ffda80e --- /dev/null +++ b/starters/features/gel/src/routes/index.tsx @@ -0,0 +1,35 @@ +import { component$ } from "@builder.io/qwik"; +import type { DocumentHead } from "@builder.io/qwik-city"; + +export default component$(() => { + return ( + <> +

Hi 👋

+
+ Can't wait to see what you build with qwik! +
+ Happy coding. +
+ + + ); +}); + +export const head: DocumentHead = { + title: "Welcome to Qwik", + meta: [ + { + name: "description", + content: "Qwik site description", + }, + ], +}; diff --git a/starters/features/gel/src/routes/users/[userId]/index.tsx b/starters/features/gel/src/routes/users/[userId]/index.tsx new file mode 100644 index 00000000000..19c7dac37f2 --- /dev/null +++ b/starters/features/gel/src/routes/users/[userId]/index.tsx @@ -0,0 +1,46 @@ +import { component$ } from "@builder.io/qwik"; +import { routeLoader$ } from "@builder.io/qwik-city"; +import { executeQuery } from "../../../actions/client"; +import * as queries from "../../../../dbschema/queries"; + +export const useGetUser = routeLoader$(async (requestEvent) => { + const userId = requestEvent.params["userId"]; + // getUser returns an array of users, filter by name (which is userId) + const users = await executeQuery(queries.getUser, { name: userId }); + // users is an array, so check if we got at least one + if (!users || users.length === 0) { + requestEvent.status(404); + return null; + } + // Return the first user found + return users[0]; +}); + +export default component$(() => { + const user = useGetUser(); + return ( +
+

User detail

+ {user.value ? ( + <> +

Name: {user.value.name}

+ {/* Show all emails if available */} + {user.value.emails && user.value.emails.length > 0 ? ( +
    + {user.value.emails.map((email: any) => ( +
  • + Email: {email.address} + {email.provider ? <> (Provider: {email.provider}) : null} +
  • + ))} +
+ ) : ( +

No emails found for this user.

+ )} + + ) : ( +

User not found

+ )} +
+ ); +}); diff --git a/starters/features/gel/src/routes/users/index.tsx b/starters/features/gel/src/routes/users/index.tsx new file mode 100644 index 00000000000..e154265c1c6 --- /dev/null +++ b/starters/features/gel/src/routes/users/index.tsx @@ -0,0 +1,43 @@ +import { component$ } from "@builder.io/qwik"; +import { useGetUsers } from "../../hooks/user.hooks"; + +// Issues with the original code: +// 1. The comment says "Call useGetUsers with an empty object", but it's called with no arguments. If useGetUsers expects an argument, this could be a bug. +// 2. The key for each
  • is user.name. If user.name is not unique, this could cause rendering issues. It's better to use a unique id if available. +// 3. The code assumes users.value is always defined before mapping. If users.value is undefined/null, it could cause errors. The check is present, but if users.value is not an array, it could still fail. +// 4. The apostrophe in

    User's directory

    is grammatically odd. "Users Directory" or "User Directory" is more standard. +// 5. The code uses any for user and email, which loses type safety. If possible, use proper types. +// 6. The emails are shown as a comma-separated string inside the link, which may not be ideal for accessibility or clarity. + +export default component$(async () => { + // If useGetUsers expects an argument, pass an empty object; otherwise, leave as is. + const users = await useGetUsers(); + console.log(users.value); + + return ( +
    +

    Users Directory

    +
      + {Array.isArray(users.value) && users.value.length > 0 ? ( + users.value.map((user: any) => ( +
    • + {user.name} + {user.emails && user.emails.length > 0 && ( +
        + {user.emails.map((email: any) => ( +
      • + {email.address} + {email.provider ? ` (${email.provider})` : ""} +
      • + ))} +
      + )} +
    • + )) + ) : ( +
    • No users found.
    • + )} +
    +
    + ); +}); From dd53daca03fa646a56958c7a4816c9bbfde1f709 Mon Sep 17 00:00:00 2001 From: Natalie Abrams Date: Fri, 10 Oct 2025 16:07:53 -0600 Subject: [PATCH 9/9] final files + docs for integration --- .../routes/docs/integrations/gel/index.mdx | 156 +- starters/features/gel/dbschema/default.gel | 12 +- .../gel/dbschema/edgeql-js/__spec__.ts | 10258 ++++++++++++++++ .../gel/dbschema/edgeql-js/cardinality.ts | 388 + .../features/gel/dbschema/edgeql-js/cast.ts | 63 + .../gel/dbschema/edgeql-js/castMaps.ts | 774 ++ .../gel/dbschema/edgeql-js/casting.ts | 171 + .../gel/dbschema/edgeql-js/collections.ts | 365 + .../gel/dbschema/edgeql-js/config.json | 2 + .../gel/dbschema/edgeql-js/detached.ts | 23 + .../gel/dbschema/edgeql-js/external.ts | 30 + .../features/gel/dbschema/edgeql-js/for.ts | 59 + .../gel/dbschema/edgeql-js/funcops.ts | 478 + .../features/gel/dbschema/edgeql-js/future.ts | 6 + .../gel/dbschema/edgeql-js/globals.ts | 29 + .../features/gel/dbschema/edgeql-js/group.ts | 350 + .../gel/dbschema/edgeql-js/hydrate.ts | 350 + .../gel/dbschema/edgeql-js/imports.ts | 6 + .../features/gel/dbschema/edgeql-js/index.ts | 42 + .../features/gel/dbschema/edgeql-js/insert.ts | 296 + .../features/gel/dbschema/edgeql-js/json.ts | 92 + .../gel/dbschema/edgeql-js/literal.ts | 48 + .../gel/dbschema/edgeql-js/modules/cfg.ts | 1253 ++ .../gel/dbschema/edgeql-js/modules/default.ts | 8 + .../gel/dbschema/edgeql-js/modules/schema.ts | 4472 +++++++ .../gel/dbschema/edgeql-js/modules/std.ts | 9423 ++++++++++++++ .../gel/dbschema/edgeql-js/modules/std/cal.ts | 935 ++ .../gel/dbschema/edgeql-js/modules/std/enc.ts | 184 + .../gel/dbschema/edgeql-js/modules/std/fts.ts | 530 + .../dbschema/edgeql-js/modules/std/math.ts | 1126 ++ .../gel/dbschema/edgeql-js/modules/std/net.ts | 43 + .../edgeql-js/modules/std/net/http.ts | 336 + .../gel/dbschema/edgeql-js/modules/std/pg.ts | 49 + .../gel/dbschema/edgeql-js/modules/sys.ts | 1006 ++ .../gel/dbschema/edgeql-js/operators.ts | 6782 ++++++++++ .../features/gel/dbschema/edgeql-js/params.ts | 140 + .../features/gel/dbschema/edgeql-js/path.ts | 503 + .../features/gel/dbschema/edgeql-js/query.ts | 58 + .../features/gel/dbschema/edgeql-js/range.ts | 201 + .../gel/dbschema/edgeql-js/reflection.ts | 10 + .../features/gel/dbschema/edgeql-js/select.ts | 1252 ++ .../features/gel/dbschema/edgeql-js/set.ts | 219 + .../gel/dbschema/edgeql-js/setImpl.ts | 129 + .../features/gel/dbschema/edgeql-js/syntax.ts | 23 + .../gel/dbschema/edgeql-js/toEdgeQL.ts | 1745 +++ .../gel/dbschema/edgeql-js/typesystem.ts | 945 ++ .../features/gel/dbschema/edgeql-js/update.ts | 138 + .../features/gel/dbschema/edgeql-js/with.ts | 73 + starters/features/gel/dbschema/interfaces.ts | 745 ++ .../dbschema/migrations/00001-m1lsxf3.edgeql | 23 + starters/features/gel/dbschema/queries.ts | 87 + starters/features/gel/gel.local.toml | 165 + starters/features/gel/package.json | 22 +- starters/features/gel/queries/.gitkeep | 0 .../features/gel/queries/deleteUser.edgeql | 6 - .../features/gel/queries/getAllUsers.query.ts | 17 + .../features/gel/queries/getUser.query.ts | 37 + .../gel/queries/insertOrUpdateUser.edgeql | 28 - .../features/gel/queries/insertUser.edgeql | 14 + .../features/gel/queries/insertUser.query.ts | 39 + starters/features/gel/src/.gitkeep | 0 .../features/gel/src/actions/user/.gitkeep | 0 .../features/gel/src/actions/user/index.ts | 15 +- starters/features/gel/src/hooks/.gitkeep | 0 starters/features/gel/src/hooks/user.hooks.ts | 53 - .../features/gel/src/routes/create/index.tsx | 66 +- starters/features/gel/src/routes/index.tsx | 1 + .../gel/src/routes/users/[userId]/index.tsx | 46 - .../features/gel/src/routes/users/index.tsx | 41 +- 69 files changed, 46742 insertions(+), 244 deletions(-) create mode 100644 starters/features/gel/dbschema/edgeql-js/__spec__.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/cardinality.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/cast.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/castMaps.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/casting.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/collections.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/config.json create mode 100644 starters/features/gel/dbschema/edgeql-js/detached.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/external.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/for.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/funcops.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/future.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/globals.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/group.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/hydrate.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/imports.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/index.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/insert.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/json.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/literal.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/cfg.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/default.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/schema.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/cal.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/enc.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/fts.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/math.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/net.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/net/http.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/std/pg.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/modules/sys.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/operators.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/params.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/path.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/query.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/range.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/reflection.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/select.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/set.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/setImpl.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/syntax.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/toEdgeQL.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/typesystem.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/update.ts create mode 100644 starters/features/gel/dbschema/edgeql-js/with.ts create mode 100644 starters/features/gel/dbschema/interfaces.ts create mode 100644 starters/features/gel/dbschema/migrations/00001-m1lsxf3.edgeql create mode 100644 starters/features/gel/dbschema/queries.ts create mode 100644 starters/features/gel/gel.local.toml delete mode 100644 starters/features/gel/queries/.gitkeep delete mode 100644 starters/features/gel/queries/deleteUser.edgeql create mode 100644 starters/features/gel/queries/getAllUsers.query.ts create mode 100644 starters/features/gel/queries/getUser.query.ts delete mode 100644 starters/features/gel/queries/insertOrUpdateUser.edgeql create mode 100644 starters/features/gel/queries/insertUser.edgeql create mode 100644 starters/features/gel/queries/insertUser.query.ts delete mode 100644 starters/features/gel/src/.gitkeep delete mode 100644 starters/features/gel/src/actions/user/.gitkeep delete mode 100644 starters/features/gel/src/hooks/.gitkeep delete mode 100644 starters/features/gel/src/hooks/user.hooks.ts delete mode 100644 starters/features/gel/src/routes/users/[userId]/index.tsx diff --git a/packages/docs/src/routes/docs/integrations/gel/index.mdx b/packages/docs/src/routes/docs/integrations/gel/index.mdx index 885391c1865..e68b514a4ae 100644 --- a/packages/docs/src/routes/docs/integrations/gel/index.mdx +++ b/packages/docs/src/routes/docs/integrations/gel/index.mdx @@ -3,7 +3,7 @@ title: Gel | Integrations keywords: 'Gel, EdgeDB, database, data, postgres' contributors: - nabrams -updated_at: '2025-09-25T18:53:23Z' +updated_at: '2025-10-10T18:53:23Z' created_at: '2025-08-01T23:00:50Z' --- @@ -17,7 +17,7 @@ Gel gives the relational model a fresh facelift, solves n+1, simplifies migratio Gel can be used in Qwik with `routeLoader$`, `routeAction$` and `server$` functions. These are Qwik APIs to allow code to execute only on the server-side. -The simplest way to add Gel to your Qwik project is by running the Qwik CLI command. This will automatically install all necessary dependencies, set up a basic schema in the `dbschema` folder, and generate a `queries` directory to help you start building your own API queries. Additionally, it will scaffold `actions` and `hooks` folders with example routes and files, giving you a ready-to-use foundation for working with Gel in your app. +The simplest way to add Gel to your Qwik project is by running the Qwik CLI command. This will automatically install all necessary dependencies, set up a basic schema in the `dbschema` folder, and generate a `queries` directory to help you start building your own API queries. Additionally, it will scaffold an `actions` folder with example routes and files, giving you a ready-to-use foundation for working with Gel in your app. It will also create a `gel.toml` file to configure the gel instance. Everything you need to start building your app with Gel is there. @@ -54,7 +54,8 @@ It is already installed for you and you can use the following scripts to utilize *** Before you start, make sure you have run the following command: ```shell -pnpm run gel:generate:all +pnpm gel:generate:queries && +pnpm gel:generate:types ``` The following ``s are currently supported: @@ -64,9 +65,6 @@ The following ``s are currently supported: - Command: `gel:generate:types` > - `interfaces`: Generate interfaces for your schema types - `edgeql-js`: Generate the query builder -- Command: `gel:generate:all` > - - `queries` + `interfaces` + `edgeql-js` - @@ -78,63 +76,165 @@ To do so, run the following command: ```shell -pnpm run gel:ui +pnpm gel:ui ``` ```shell -npm run gel:ui +npm gel:ui ``` ```shell -yarn run gel:ui +yarn gel:ui ``` ```shell -bun run gel:ui +bun gel:ui ``` +## Client user actions + +We will use these client actions to query and insert users in the DB below. + +```tsx {7} /Gel/ title="src/actions/client.tsx" +import { server$ } from "@builder.io/qwik-city"; +import { executeQuery } from "../../actions/client"; +import * as queries from "../../../dbschema/queries"; + +export const getAllUsers = server$(async () => { + return await executeQuery(queries.getAllUsers); +}); + +export const insertUser = server$( + async (name: string, email: string, has_profile: boolean) => { + return await executeQuery(queries.insertUser, { + name: name, + email: email, + has_profile: has_profile, + }); + }, +); +``` + ## Listing users -We will use `routeLoader$` to query all users in the DB, using `db.query.users.findMany()`, and returning the result. +We will use `routeLoader$` to query all users in the DB, and return the result. ```tsx {7} /Gel/ title="src/routes/users/index.tsx" + import { component$ } from "@builder.io/qwik"; import { routeLoader$ } from "@builder.io/qwik-city"; -import { drizzle } from "drizzle-orm/better-sqlite3"; -import Database from "better-sqlite3"; -import { schema } from "../../../drizzle/schema"; - -export const useGetUsers = routeLoader$(async () => { - const sqlite = new Database("./drizzle/db/db.sqlite"); - const db = drizzle(sqlite, { schema }); - const users = await db.query.users.findMany(); +import { getAllUsers } from "../../actions/user"; + +export const useGetAllUsers = routeLoader$(async () => { + const users = await getAllUsers(); return users; }); export default component$(() => { - const users = useGetUsers(); + const users = useGetAllUsers().value; + return (
    -

    User's directory

    +

    Users Directory

      - {users.value.map((user) => ( -
    • - - {user.name} ({user.email}) - -
    • - ))} + {Array.isArray(users) && users.length > 0 ? ( + users.map((user: any) => ( +
    • + Name: {user.name} + {user.email && ( +
      + + Email: {user.email} + +
      + )} +
    • + )) + ) : ( +
    • No users found.
    • + )}
    ); }); + +``` + +## Adding users + +We will use `routeAction$` and `zod$` form to create user. + +```tsx {7} /Gel/ title="src/routes/users/index.tsx" + +import { component$ } from "@builder.io/qwik"; +import { routeAction$, zod$, z, Form } from "@builder.io/qwik-city"; +import { insertUser } from "../../actions/user"; + +export const useCreateUser = routeAction$( + async ({ name, email }) => { + const user = await insertUser(name, email, true); + if (!user) + return { error: "A user already exists with that email.", user: null }; + return { error: null, user }; + }, + zod$({ + name: z.string().min(1, { message: "Name is required" }), + email: z.string().email({ message: "Invalid email address" }), + }), +); + +export default component$(() => { + const action = useCreateUser(); + const errors = action.value?.fieldErrors; + const customError = action.value?.error; + + return ( +
    +

    Create User

    +
    + + + +
    + {action.value?.user &&

    User created successfully!

    } + {(errors || customError) && ( +
    + {errors?.name && ( +
    +

    {errors.name}

    +
    + )} + {errors?.email && ( +
    +

    {errors.email}

    +
    + )} + {customError && ( +
    +

    {customError}

    +
    + )} +
    + )} +
    + ); +}); + ``` + + diff --git a/starters/features/gel/dbschema/default.gel b/starters/features/gel/dbschema/default.gel index 6768f04c092..1d06c2fabc1 100644 --- a/starters/features/gel/dbschema/default.gel +++ b/starters/features/gel/dbschema/default.gel @@ -6,18 +6,12 @@ module default { } type User extending Timestamped { - required name: str { - constraint exclusive { - errmessage := 'A user with that name already exists!'; - }; - }; + required name: str; email: str { - constraint exclusive { - errmessage := 'A user with that email already exists!'; - }; + constraint exclusive; }; has_profile: bool; - index on (.name); + index on (.email); } } diff --git a/starters/features/gel/dbschema/edgeql-js/__spec__.ts b/starters/features/gel/dbschema/edgeql-js/__spec__.ts new file mode 100644 index 00000000000..96f2040156f --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/__spec__.ts @@ -0,0 +1,10258 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "./reflection"; +const spec: $.introspect.Types = new $.StrictMap(); + +spec.set("00000000-0000-0000-0000-000000000003", { + id: "00000000-0000-0000-0000-000000000003", + name: "anyobject", + is_abstract: false, + kind: "unknown", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("00000000-0000-0000-0000-000000000002", { + id: "00000000-0000-0000-0000-000000000002", + name: "anytuple", + is_abstract: false, + kind: "unknown", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("00000000-0000-0000-0000-000000000001", { + id: "00000000-0000-0000-0000-000000000001", + name: "anytype", + is_abstract: false, + kind: "unknown", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("a6f5468c-c2a6-5852-8f73-57484b1c6831", { + id: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + name: "array", + is_abstract: true, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000001", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("076e152a-1033-5b20-86e5-b6eadf43dfe7", { + id: "076e152a-1033-5b20-86e5-b6eadf43dfe7", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "50264e27-859e-5d2b-a589-ebb3d8ba4d8c", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("bf2c38cc-745d-57b7-b769-a9722f265802", { + id: "bf2c38cc-745d-57b7-b769-a9722f265802", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "1adbf789-39c3-5070-bc17-776f94d59e46", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("4511ca9c-2120-586c-a5f8-f7a8255fe6ce", { + id: "4511ca9c-2120-586c-a5f8-f7a8255fe6ce", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "7cb23cda-17b8-575c-9561-05e2e9351897", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("f0ba0b92-4861-5028-82a2-edc873e65700", { + id: "f0ba0b92-4861-5028-82a2-edc873e65700", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "258dbe3b-cb49-5713-b9fb-b220c8065c01", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("67346a5e-de86-5fc8-a59c-63ccd350e8ef", { + id: "67346a5e-de86-5fc8-a59c-63ccd350e8ef", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "6dc9f7f4-5b6b-5afc-9e5e-57a6b2f15cbc", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("098ef8fe-53aa-5402-a896-509f4833d8e2", { + id: "098ef8fe-53aa-5402-a896-509f4833d8e2", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "43ce9f9e-00cd-5303-a1b3-fea515a046d8", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("d18632a0-9f79-5926-8ccf-c2670d20bbab", { + id: "d18632a0-9f79-5926-8ccf-c2670d20bbab", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000130", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("3ed001c4-98e8-53a8-b2d1-0cad168d926c", { + id: "3ed001c4-98e8-53a8-b2d1-0cad168d926c", + name: "array>", + is_abstract: true, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("14eee508-6c7a-53b6-a0f3-a9360fa44128", { + id: "14eee508-6c7a-53b6-a0f3-a9360fa44128", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "998b88fc-083a-584b-85bb-372ade248f66", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("dc4af10d-1bdc-5d7a-93b4-10a7e9a75f45", { + id: "dc4af10d-1bdc-5d7a-93b4-10a7e9a75f45", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "d8c466cc-109e-587c-aff8-42e50705b5b0", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("52ee599e-5741-529f-b431-de573eb82260", { + id: "52ee599e-5741-529f-b431-de573eb82260", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "94abc2f6-2e3e-55fc-8e97-b44ba70a3950", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("316c55c8-d7ab-56b1-b66b-cc92dd8c858d", { + id: "316c55c8-d7ab-56b1-b66b-cc92dd8c858d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "b31b2d9a-681c-5709-bec5-321897ea5bd6", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8fd16cbd-1645-5398-8f9b-d881bb4aeb0b", { + id: "8fd16cbd-1645-5398-8f9b-d881bb4aeb0b", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "8fcfde20-139b-5c17-93b9-9a49512b83dc", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("b55485d2-b5ef-5b30-8f8d-70a7b9946aaa", { + id: "b55485d2-b5ef-5b30-8f8d-70a7b9946aaa", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "e48403f0-7017-5bf5-ab92-22825d9f1090", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("0e05a8c0-16a7-5ad5-a8ce-7c5b328f6304", { + id: "0e05a8c0-16a7-5ad5-a8ce-7c5b328f6304", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "8037d84a-de95-5e63-ab76-727112419261", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("07ffd064-ee25-5ae8-ae6f-696065ca17ba", { + id: "07ffd064-ee25-5ae8-ae6f-696065ca17ba", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "a06f04aa-88b7-5d9a-b520-b8139fd64d0c", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("b6d3560b-59c6-5ab3-8536-3ad6958036f8", { + id: "b6d3560b-59c6-5ab3-8536-3ad6958036f8", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "1c938388-8739-57a7-8095-cc173226ad8e", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("3967e4e7-34fc-50ed-9d93-b1191d6b459e", { + id: "3967e4e7-34fc-50ed-9d93-b1191d6b459e", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "6b925c92-5e48-5e6d-96f2-4125d9119b66", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("60611fc3-69df-5257-a002-c37409407915", { + id: "60611fc3-69df-5257-a002-c37409407915", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "3c6fa29f-8481-59c9-a9bf-ac30ab50be32", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("3a7619f5-7a70-541d-9b98-33c05c082f3f", { + id: "3a7619f5-7a70-541d-9b98-33c05c082f3f", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "20998fe7-4392-5673-96b5-5f1cd736b5df", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8d7f7f3f-529c-5f1f-98c1-ca1730e2db41", { + id: "8d7f7f3f-529c-5f1f-98c1-ca1730e2db41", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "a2c7e6ae-370c-53a7-842c-21e238faf3ee", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("71546d36-0e27-5d3e-99fa-1cf2d628467e", { + id: "71546d36-0e27-5d3e-99fa-1cf2d628467e", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "67722d75-1145-54b6-af26-94602de09d51", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("b8f06ef2-45d1-5290-8fb8-e46aeb1fde02", { + id: "b8f06ef2-45d1-5290-8fb8-e46aeb1fde02", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "de5b90f2-6e49-5543-991b-28a156c7867f", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("dc0b4639-9025-5e25-b0d0-95ed8aa02937", { + id: "dc0b4639-9025-5e25-b0d0-95ed8aa02937", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("d851204c-f422-584c-b13b-038291e3ac38", { + id: "d851204c-f422-584c-b13b-038291e3ac38", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "584feb89-c83d-561d-aa78-24e6d779f044", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("81e54fbd-635f-54e1-850f-7b992be06818", { + id: "81e54fbd-635f-54e1-850f-7b992be06818", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000110", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("00937900-7c03-5137-acf1-e5e4b457c270", { + id: "00937900-7c03-5137-acf1-e5e4b457c270", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000109", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("48aa45ef-4d93-5fbd-bfb5-81bf67b49eab", { + id: "48aa45ef-4d93-5fbd-bfb5-81bf67b49eab", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000102", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("5b410a6f-a231-524b-8682-4ce2020c1d98", { + id: "5b410a6f-a231-524b-8682-4ce2020c1d98", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000112", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8571477b-d954-5809-b360-4b1f03253699", { + id: "8571477b-d954-5809-b360-4b1f03253699", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010c", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("c05958e2-0753-5a63-b7c4-db3626b0d6b5", { + id: "c05958e2-0753-5a63-b7c4-db3626b0d6b5", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010b", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("75ba1b6e-7f51-5c49-b955-e32f20e4f72e", { + id: "75ba1b6e-7f51-5c49-b955-e32f20e4f72e", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010d", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("d50ba716-d5fd-5f69-8afe-9c82fe7436d9", { + id: "d50ba716-d5fd-5f69-8afe-9c82fe7436d9", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000111", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("6494bf49-5d46-5402-8198-cdb039071f0d", { + id: "6494bf49-5d46-5402-8198-cdb039071f0d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010a", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("7ed79f70-e306-5eea-b424-34c081809229", { + id: "7ed79f70-e306-5eea-b424-34c081809229", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000108", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("2a8f8149-1ff0-554c-ac17-3a303d0ef423", { + id: "2a8f8149-1ff0-554c-ac17-3a303d0ef423", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010e", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("eaa9266d-3ca5-5a9c-9446-b56f858d2a8d", { + id: "eaa9266d-3ca5-5a9c-9446-b56f858d2a8d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "5ca96424-93ba-560a-994b-7820c9623e3d", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("a2e5149c-6c82-58a4-a588-c4a064088ad5", { + id: "a2e5149c-6c82-58a4-a588-c4a064088ad5", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000106", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("2b65df4c-4942-59b1-8819-061ca68b2f4e", { + id: "2b65df4c-4942-59b1-8819-061ca68b2f4e", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000107", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("183cac13-da68-5b1d-aac2-65e4a46fe276", { + id: "183cac13-da68-5b1d-aac2-65e4a46fe276", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "de04eafc-46d5-5037-aae6-52774a4cf421", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("455f2a01-3a09-5d87-8eb2-d21ef65315f7", { + id: "455f2a01-3a09-5d87-8eb2-d21ef65315f7", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "efb3a506-d101-5c65-b845-abf56604c8e3", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("c28ce254-73ff-5fea-8364-992b6664387d", { + id: "c28ce254-73ff-5fea-8364-992b6664387d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "17c3aca3-4464-5257-bc9f-591fb7bf704c", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("23f0dc14-e618-5437-b751-27e7c992238a", { + id: "23f0dc14-e618-5437-b751-27e7c992238a", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "f613baf6-1ed8-557e-8f68-e91a0d39e65d", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("490b3665-0958-5498-bd04-2b5577c01f33", { + id: "490b3665-0958-5498-bd04-2b5577c01f33", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "cb579c2d-cc54-54e6-9636-fff6c1643771", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("574de665-be6f-5562-a55d-448593e7b73d", { + id: "574de665-be6f-5562-a55d-448593e7b73d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000103", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("0f5eae5c-2ab0-543f-a334-b6b24e35aa2a", { + id: "0f5eae5c-2ab0-543f-a334-b6b24e35aa2a", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000104", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8bf93a3b-22f6-5c02-ad98-96ad95622822", { + id: "8bf93a3b-22f6-5c02-ad98-96ad95622822", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000105", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("b441b816-8f3c-5efe-9109-2d6e99b73029", { + id: "b441b816-8f3c-5efe-9109-2d6e99b73029", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-00000000010f", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("26a866dd-d762-5152-9164-ea5f9c0ca50d", { + id: "26a866dd-d762-5152-9164-ea5f9c0ca50d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "8b93ef2e-2ddd-5ba2-9333-2e28a4d56ede", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("7c97b406-ded1-5a84-9062-09adbdb6c7fa", { + id: "7c97b406-ded1-5a84-9062-09adbdb6c7fa", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "5b46c56e-937c-59d2-b3e6-99c31c7c60f0", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("1c170d08-6188-524d-8b52-502cf2e83530", { + id: "1c170d08-6188-524d-8b52-502cf2e83530", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "8896d50c-81c2-5d7d-bb2f-cb2bfba3c628", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("9a509897-f8f6-5ecc-9a8c-a69158fc0656", { + id: "9a509897-f8f6-5ecc-9a8c-a69158fc0656", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000001000004", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("915c6d15-a5e6-5f48-9fce-0de187a09c9a", { + id: "915c6d15-a5e6-5f48-9fce-0de187a09c9a", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000001000005", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("e2532312-99ba-5532-9e4c-18690607fcb9", { + id: "e2532312-99ba-5532-9e4c-18690607fcb9", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000001000001", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("686d0330-45e0-50c2-88c0-07e6e0cccb5e", { + id: "686d0330-45e0-50c2-88c0-07e6e0cccb5e", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000001000003", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("ef3017b6-5eb5-5c6c-aa2c-a0915d4a9b3d", { + id: "ef3017b6-5eb5-5c6c-aa2c-a0915d4a9b3d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000001000002", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("bb221d39-09f1-507e-8851-62075bb61823", { + id: "bb221d39-09f1-507e-8851-62075bb61823", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000101", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("1378c9c3-b11a-5a95-bdac-066a4143094d", { + id: "1378c9c3-b11a-5a95-bdac-066a4143094d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "00000000-0000-0000-0000-000000000100", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("064df4ea-1738-525d-8b99-4d5e87fdc958", { + id: "064df4ea-1738-525d-8b99-4d5e87fdc958", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "cae65a8c-a99f-5524-9872-daecdc545531", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("29437f07-9501-5fa1-b80f-8861cb1f50fc", { + id: "29437f07-9501-5fa1-b80f-8861cb1f50fc", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "f2887f6f-bd51-5422-8ac7-d1732fdcd17d", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("a0b83290-3fbc-5823-a058-e19b65ed6b74", { + id: "a0b83290-3fbc-5823-a058-e19b65ed6b74", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "775fc501-0b35-57fa-8587-cd7c53557cdf", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("3731b51b-b271-53cd-a4d6-3b1a9abe2d35", { + id: "3731b51b-b271-53cd-a4d6-3b1a9abe2d35", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "2eb021ec-461e-5b65-859c-26c1eee234a1", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8daff374-5f73-5443-8de3-61e01f281c0d", { + id: "8daff374-5f73-5443-8de3-61e01f281c0d", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "070715f3-0100-5580-9473-696f961243eb", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("157457d9-2a7f-5bc8-a9a8-be7db7e831bf", { + id: "157457d9-2a7f-5bc8-a9a8-be7db7e831bf", + name: "array", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "16a08f13-b1b1-57f4-8e82-062f67fb2a4c", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("212f4161-55eb-569e-945d-ae24bdab437a", { + id: "212f4161-55eb-569e-945d-ae24bdab437a", + name: "array>", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "f5e31516-7567-519d-847f-397a0762ce23", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("cc3f58f4-ffd4-5f38-97d9-6b5844e89037", { + id: "cc3f58f4-ffd4-5f38-97d9-6b5844e89037", + name: "array>>>", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "27d815f4-6518-598a-a3c5-9364342d6e06", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("29b1b6f1-a0e0-577d-adcf-e493f6b2303a", { + id: "29b1b6f1-a0e0-577d-adcf-e493f6b2303a", + name: "array>", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "08ede6a9-78ab-555f-944a-fca75d31eb5a", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("db5fcf76-8269-568c-ba2b-b36b0796b880", { + id: "db5fcf76-8269-568c-ba2b-b36b0796b880", + name: "array>>", + is_abstract: false, + kind: "array", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: "67996f7a-c82f-5b58-bb0a-f29764ee45c2", + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("0d14e49f-d9f9-51f0-b8f4-c432982cbac2", { + id: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + name: "std::BaseObject", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [ + { + card: "One", + name: "id", + target_id: "00000000-0000-0000-0000-000000000100", + kind: "property", + is_exclusive: true, + is_computed: false, + is_readonly: true, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "__type__", + target_id: "2662a1b4-4f3f-5875-b6eb-ce52101a90a3", + kind: "link", + is_exclusive: false, + is_computed: false, + is_readonly: true, + has_default: false, + pointers: [], + }, + ], + exclusives: [ + { + id: { + card: "One", + name: "id", + target_id: "00000000-0000-0000-0000-000000000100", + kind: "property", + is_exclusive: true, + is_computed: false, + is_readonly: true, + has_default: true, + pointers: [], + }, + }, + ], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("d408002f-3891-5b9a-b19c-23589a88998b", { + id: "d408002f-3891-5b9a-b19c-23589a88998b", + name: "cfg::ConfigObject", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [{ id: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2" }], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("8b66e734-a01e-5638-a812-359e0d005a37", { + id: "8b66e734-a01e-5638-a812-359e0d005a37", + name: "cfg::AbstractConfig", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [{ id: "d408002f-3891-5b9a-b19c-23589a88998b" }], + union_of: [], + intersection_of: [], + pointers: [ + { + card: "One", + name: "default_transaction_access_mode", + target_id: "775fc501-0b35-57fa-8587-cd7c53557cdf", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "session_idle_timeout", + target_id: "00000000-0000-0000-0000-00000000010e", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "default_transaction_isolation", + target_id: "070715f3-0100-5580-9473-696f961243eb", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "default_transaction_deferrable", + target_id: "2eb021ec-461e-5b65-859c-26c1eee234a1", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "session_idle_transaction_timeout", + target_id: "00000000-0000-0000-0000-00000000010e", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "query_execution_timeout", + target_id: "00000000-0000-0000-0000-00000000010e", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "One", + name: "listen_port", + target_id: "00000000-0000-0000-0000-000000000104", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "Many", + name: "listen_addresses", + target_id: "00000000-0000-0000-0000-000000000101", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "current_email_provider_name", + target_id: "00000000-0000-0000-0000-000000000101", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "allow_dml_in_functions", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "allow_bare_ddl", + target_id: "50264e27-859e-5d2b-a589-ebb3d8ba4d8c", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "store_migration_sdl", + target_id: "43ce9f9e-00cd-5303-a1b3-fea515a046d8", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "apply_access_policies", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "apply_access_policies_pg", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "allow_user_specified_id", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "simple_scoping", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "warn_old_scoping", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "Many", + name: "cors_allow_origins", + target_id: "00000000-0000-0000-0000-000000000101", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "auto_rebuild_query_cache", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "auto_rebuild_query_cache_timeout", + target_id: "00000000-0000-0000-0000-00000000010e", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "query_cache_mode", + target_id: "7cb23cda-17b8-575c-9561-05e2e9351897", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "http_max_connections", + target_id: "00000000-0000-0000-0000-000000000105", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "shared_buffers", + target_id: "00000000-0000-0000-0000-000000000130", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "query_work_mem", + target_id: "00000000-0000-0000-0000-000000000130", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "maintenance_work_mem", + target_id: "00000000-0000-0000-0000-000000000130", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "effective_cache_size", + target_id: "00000000-0000-0000-0000-000000000130", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "effective_io_concurrency", + target_id: "00000000-0000-0000-0000-000000000105", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "default_statistics_target", + target_id: "00000000-0000-0000-0000-000000000105", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "AtMostOne", + name: "force_database_error", + target_id: "00000000-0000-0000-0000-000000000101", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "_pg_prepared_statement_cache_size", + target_id: "00000000-0000-0000-0000-000000000103", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "track_query_stats", + target_id: "258dbe3b-cb49-5713-b9fb-b220c8065c01", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "Many", + name: "extensions", + target_id: "89fb9b8b-d3b2-5075-9d1a-f5b116a0f188", + kind: "link", + is_exclusive: false, + is_computed: true, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "Many", + name: "auth", + target_id: "a2ba7516-d398-5ec2-b25e-221b2f7b9e87", + kind: "link", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "Many", + name: "email_providers", + target_id: "0caa4e7a-7c52-5cff-aee4-920ede8a569c", + kind: "link", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + ], + exclusives: [], + backlinks: [ + { + card: "AtMostOne", + name: "", + is_abstract: true, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "581b0325-a044-58d4-aa37-3a85ea671313", +} as any); +spec.set("74568c88-a8c3-5a02-9acd-64616d07ab8b", { + id: "74568c88-a8c3-5a02-9acd-64616d07ab8b", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-00000000010c", +} as any); +spec.set("37c39ed3-114c-5835-b662-80d80db0199d", { + id: "37c39ed3-114c-5835-b662-80d80db0199d", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-00000000010b", +} as any); +spec.set("58da8bd4-709a-50bc-b0b4-a1918b7dc2ba", { + id: "58da8bd4-709a-50bc-b0b4-a1918b7dc2ba", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-00000000010a", +} as any); +spec.set("80da35c5-4ed6-5799-8eea-1c5923a3f8d3", { + id: "80da35c5-4ed6-5799-8eea-1c5923a3f8d3", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-000000000108", +} as any); +spec.set("18b39277-efe3-582c-8bdc-b18f4ed46e09", { + id: "18b39277-efe3-582c-8bdc-b18f4ed46e09", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-0000000001ff", +} as any); +spec.set("75f5b5c7-f201-56a8-9fd0-bd139e69fdbe", { + id: "75f5b5c7-f201-56a8-9fd0-bd139e69fdbe", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-0000000001ff", +} as any); +spec.set("a36a494d-f2c1-5886-8e17-b0c8ba9337ff", { + id: "a36a494d-f2c1-5886-8e17-b0c8ba9337ff", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-0000000001ff", +} as any); +spec.set("da3c9da3-1b79-53d0-ae36-82026533939b", { + id: "da3c9da3-1b79-53d0-ae36-82026533939b", + name: "multirange", + is_abstract: false, + kind: "multirange", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: "00000000-0000-0000-0000-0000000001ff", +} as any); +spec.set("49748e47-8d91-5269-9a34-2e8ca194e0f2", { + id: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + name: "range", + is_abstract: true, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "581b0325-a044-58d4-aa37-3a85ea671313", + multirange_element_id: null, +} as any); +spec.set("c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", { + id: "c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-00000000010c", + multirange_element_id: null, +} as any); +spec.set("44825479-8abf-55f6-93bf-572798ec8f12", { + id: "44825479-8abf-55f6-93bf-572798ec8f12", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-00000000010b", + multirange_element_id: null, +} as any); +spec.set("10674aaf-8d88-5593-abe9-f7d82be5162b", { + id: "10674aaf-8d88-5593-abe9-f7d82be5162b", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-00000000010a", + multirange_element_id: null, +} as any); +spec.set("c61dd200-697a-5b70-9ff0-6c623a700c14", { + id: "c61dd200-697a-5b70-9ff0-6c623a700c14", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-000000000108", + multirange_element_id: null, +} as any); +spec.set("ef0fdfe1-43f9-5954-b804-56e9b7015ffc", { + id: "ef0fdfe1-43f9-5954-b804-56e9b7015ffc", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-0000000001ff", + multirange_element_id: null, +} as any); +spec.set("b2f8ab6d-ebca-517d-9f16-086423c5bb9c", { + id: "b2f8ab6d-ebca-517d-9f16-086423c5bb9c", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-0000000001ff", + multirange_element_id: null, +} as any); +spec.set("38b58945-dfd2-572c-bf7e-8cadf204a2ec", { + id: "38b58945-dfd2-572c-bf7e-8cadf204a2ec", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-0000000001ff", + multirange_element_id: null, +} as any); +spec.set("356c02b7-20fa-5d27-90fc-aa628dd37c5e", { + id: "356c02b7-20fa-5d27-90fc-aa628dd37c5e", + name: "range", + is_abstract: false, + kind: "range", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: "00000000-0000-0000-0000-0000000001ff", + multirange_element_id: null, +} as any); +spec.set("998b88fc-083a-584b-85bb-372ade248f66", { + id: "998b88fc-083a-584b-85bb-372ade248f66", + name: "schema::AccessKind", + is_abstract: false, + kind: "scalar", + enum_values: ["Select", "UpdateRead", "UpdateWrite", "Delete", "Insert"], + is_seq: false, + material_id: null, + bases: [{ id: "48896eaf-b8af-5f80-9073-0884475d6ee5" }], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("32faaa35-9475-53cf-88fc-e68ecf1be4d9", { + id: "32faaa35-9475-53cf-88fc-e68ecf1be4d9", + name: "schema::Object", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [{ id: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2" }], + union_of: [], + intersection_of: [], + pointers: [ + { + card: "One", + name: "name", + target_id: "00000000-0000-0000-0000-000000000101", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "One", + name: "internal", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "One", + name: "builtin", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "computed_fields", + target_id: "bb221d39-09f1-507e-8851-62075bb61823", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + ], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("145b7b6f-8fa4-5b14-bcd3-5d6d10dc25da", { + id: "145b7b6f-8fa4-5b14-bcd3-5d6d10dc25da", + name: "schema::SubclassableObject", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [{ id: "32faaa35-9475-53cf-88fc-e68ecf1be4d9" }], + union_of: [], + intersection_of: [], + pointers: [ + { + card: "AtMostOne", + name: "abstract", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: true, + pointers: [], + }, + { + card: "AtMostOne", + name: "is_abstract", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: true, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "One", + name: "final", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: true, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "One", + name: "is_final", + target_id: "00000000-0000-0000-0000-000000000109", + kind: "property", + is_exclusive: false, + is_computed: true, + is_readonly: false, + has_default: false, + pointers: [], + }, + ], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("825a1378-6b30-5f15-82f1-1c92e57691f2", { + id: "825a1378-6b30-5f15-82f1-1c92e57691f2", + name: "schema::InheritingObject", + is_abstract: true, + kind: "object", + enum_values: null, + is_seq: false, + material_id: null, + bases: [{ id: "145b7b6f-8fa4-5b14-bcd3-5d6d10dc25da" }], + union_of: [], + intersection_of: [], + pointers: [ + { + card: "AtMostOne", + name: "inherited_fields", + target_id: "bb221d39-09f1-507e-8851-62075bb61823", + kind: "property", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [], + }, + { + card: "Many", + name: "bases", + target_id: "825a1378-6b30-5f15-82f1-1c92e57691f2", + kind: "link", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [ + { + card: "AtMostOne", + name: "@index", + target_id: "00000000-0000-0000-0000-000000000105", + kind: "property", + is_computed: false, + is_readonly: false, + }, + ], + }, + { + card: "Many", + name: "ancestors", + target_id: "825a1378-6b30-5f15-82f1-1c92e57691f2", + kind: "link", + is_exclusive: false, + is_computed: false, + is_readonly: false, + has_default: false, + pointers: [ + { + card: "AtMostOne", + name: "@index", + target_id: "00000000-0000-0000-0000-000000000105", + kind: "property", + is_computed: false, + is_readonly: false, + }, + ], + }, + ], + exclusives: [], + backlinks: [ + { + card: "Many", + name: "", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "8b93ef2e-2ddd-5ba2-9333-2e28a4d56ede", name: "kind" }, + { target_id: "00000000-0000-0000-0000-000000000101", name: "message" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("2b6d1efa-c38a-5c12-ad0e-535e393979ba", { + id: "2b6d1efa-c38a-5c12-ad0e-535e393979ba", + name: "tuple", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000103", name: "major" }, + { target_id: "00000000-0000-0000-0000-000000000103", name: "minor" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("2e1efa8d-b194-5b38-ad67-93b27aec520c", { + id: "2e1efa8d-b194-5b38-ad67-93b27aec520c", + name: "tuple>", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000105", name: "major" }, + { target_id: "00000000-0000-0000-0000-000000000105", name: "minor" }, + { target_id: "00000000-0000-0000-0000-000000000101", name: "stage" }, + { target_id: "00000000-0000-0000-0000-000000000105", name: "stage_no" }, + { target_id: "bb221d39-09f1-507e-8851-62075bb61823", name: "local" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("48a4615d-2402-5744-bd11-17015ad18bb9", { + id: "48a4615d-2402-5744-bd11-17015ad18bb9", + name: "tuple>", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000105", name: "major" }, + { target_id: "00000000-0000-0000-0000-000000000105", name: "minor" }, + { target_id: "16a08f13-b1b1-57f4-8e82-062f67fb2a4c", name: "stage" }, + { target_id: "00000000-0000-0000-0000-000000000105", name: "stage_no" }, + { target_id: "bb221d39-09f1-507e-8851-62075bb61823", name: "local" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("f5e31516-7567-519d-847f-397a0762ce23", { + id: "f5e31516-7567-519d-847f-397a0762ce23", + name: "tuple", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000101", name: "name" }, + { target_id: "00000000-0000-0000-0000-000000000101", name: "expr" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("27d815f4-6518-598a-a3c5-9364342d6e06", { + id: "27d815f4-6518-598a-a3c5-9364342d6e06", + name: "tuple>>", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000101", name: "name" }, + { target_id: "67996f7a-c82f-5b58-bb0a-f29764ee45c2", name: "expr" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("08ede6a9-78ab-555f-944a-fca75d31eb5a", { + id: "08ede6a9-78ab-555f-944a-fca75d31eb5a", + name: "tuple", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000101", name: "name" }, + { target_id: "00000000-0000-0000-0000-000000000101", name: "value" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("c13eb6f1-a05c-533f-bfe8-a50b1a077fd0", { + id: "c13eb6f1-a05c-533f-bfe8-a50b1a077fd0", + name: "tuple", + is_abstract: true, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000003", name: "object" }, + { target_id: "00000000-0000-0000-0000-000000000106", name: "score" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("e34cf562-ee0c-58d3-a1ee-ff9fbb35bfc3", { + id: "e34cf562-ee0c-58d3-a1ee-ff9fbb35bfc3", + name: "tuple", + is_abstract: true, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000105", name: "0" }, + { target_id: "00000000-0000-0000-0000-000000000001", name: "1" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("b20a2c38-2942-5085-88a3-1bbb1eea755f", { + id: "b20a2c38-2942-5085-88a3-1bbb1eea755f", + name: "tuple", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000105", name: "0" }, + { target_id: "00000000-0000-0000-0000-000000000105", name: "1" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("416fe1a6-d62c-5481-80cd-2102a37b3415", { + id: "416fe1a6-d62c-5481-80cd-2102a37b3415", + name: "tuple", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000101", name: "0" }, + { target_id: "00000000-0000-0000-0000-00000000010f", name: "1" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("67996f7a-c82f-5b58-bb0a-f29764ee45c2", { + id: "67996f7a-c82f-5b58-bb0a-f29764ee45c2", + name: "tuple>", + is_abstract: false, + kind: "tuple", + enum_values: null, + is_seq: false, + material_id: null, + bases: [], + union_of: [], + intersection_of: [], + pointers: [], + exclusives: [], + backlinks: [], + backlink_stubs: [], + array_element_id: null, + tuple_elements: [ + { target_id: "00000000-0000-0000-0000-000000000101", name: "text" }, + { target_id: "1378c9c3-b11a-5a95-bdac-066a4143094d", name: "refs" }, + ], + range_element_id: null, + multirange_element_id: null, +} as any); +spec.set("00000000-0000-0000-0000-0000000001ff", { + id: "00000000-0000-0000-0000-0000000001ff", + name: "std::number", + is_abstract: false, + is_seq: false, + kind: "scalar", + enum_values: null, + material_id: null, + bases: [], +} as any); + +const complexParamKinds: Set<$.TypeKind> = new Set([]); + +export { spec, complexParamKinds }; diff --git a/starters/features/gel/dbschema/edgeql-js/cardinality.ts b/starters/features/gel/dbschema/edgeql-js/cardinality.ts new file mode 100644 index 00000000000..432cc42e8d4 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/cardinality.ts @@ -0,0 +1,388 @@ +// GENERATED by @gel/generate v0.6.4 + +import { Cardinality } from "gel/dist/reflection/index"; +import type { TypeSet } from "./typesystem"; + +// Computing cardinality of path +// From base set cardinality and pointer cardinality +// Used in path expressions +// Cardinality Empty AtMostOne One Many AtLeastOne +// Empty 0 0 0 0 0 +// AtMostOne 0 AtMostOne AtMostOne Many Many +// One 0 AtMostOne One Many AtLeastOne +// Many 0 Many Many Many Many +// AtLeastOne 0 Many AtLeastOne Many AtLeastOne +export namespace cardutil { + export type multiplyCardinalities< + C1 extends Cardinality, + C2 extends Cardinality, + > = C1 extends Cardinality.Empty + ? Cardinality.Empty + : C1 extends Cardinality.One + ? C2 + : C1 extends Cardinality.AtMostOne + ? C2 extends Cardinality.One + ? Cardinality.AtMostOne + : C2 extends Cardinality.AtLeastOne + ? Cardinality.Many + : C2 + : C1 extends Cardinality.Many + ? C2 extends Cardinality.Empty + ? Cardinality.Empty + : Cardinality.Many + : C1 extends Cardinality.AtLeastOne + ? C2 extends Cardinality.AtMostOne + ? Cardinality.Many + : C2 extends Cardinality.One + ? Cardinality.AtLeastOne + : C2 + : never; + + export function multiplyCardinalities( + c1: Cardinality, + c2: Cardinality, + ): Cardinality { + if (c1 === Cardinality.Empty) return Cardinality.Empty; + + if (c1 === Cardinality.One) return c2; + if (c1 === Cardinality.AtMostOne) { + if (c2 === Cardinality.One) return Cardinality.AtMostOne; + if (c2 === Cardinality.AtLeastOne) return Cardinality.Many; + return c2; + } + if (c1 === Cardinality.Many) { + if (c2 === Cardinality.Empty) return Cardinality.Empty; + return Cardinality.Many; + } + if (c1 === Cardinality.AtLeastOne) { + if (c2 === Cardinality.AtMostOne) return Cardinality.Many; + if (c2 === Cardinality.One) return Cardinality.AtLeastOne; + return c2; + } + throw new Error(`Invalid Cardinality ${c1}`); + } + + type _multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + > = Cards extends [infer Card] + ? Card + : Cards extends [infer A, infer B, ...infer Rest] + ? A extends Cardinality + ? B extends Cardinality + ? Rest extends Cardinality[] + ? multiplyCardinalities extends Cardinality + ? _multiplyCardinalitiesVariadic< + [multiplyCardinalities, ...Rest] + > + : never + : never + : never + : never + : never; + + export type multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + > = + _multiplyCardinalitiesVariadic extends Cardinality + ? _multiplyCardinalitiesVariadic + : never; + + export function multiplyCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + >(cards: Cards): multiplyCardinalitiesVariadic { + if (cards.length === 0) throw new Error("Empty tuple not allowed"); + if (cards.length === 1) return cards[0] as any; + return cards.reduce( + (product, card) => multiplyCardinalities(product, card), + Cardinality.One, + ) as any; + } + + // Merging two sets + // Used in set constructor + // Cardinality Empty AtMostOne One Many AtLeastOne + // Empty Empty AtMostOne One Many AtLeastOne + // AtMostOne AtMostOne Many AtLeastOne Many AtLeastOne + // One One AtLeastOne AtLeastOne AtLeastOne AtLeastOne + // Many Many Many AtLeastOne Many AtLeastOne + // AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne + + export type mergeCardinalities< + A extends Cardinality, + B extends Cardinality, + > = A extends Cardinality.Empty + ? B + : B extends Cardinality.Empty + ? A + : A extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : B extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : A extends Cardinality.One + ? Cardinality.AtLeastOne + : B extends Cardinality.One + ? Cardinality.AtLeastOne + : Cardinality.Many; + + export function mergeCardinalities< + A extends Cardinality, + B extends Cardinality, + >(a: A, b: B): mergeCardinalities { + if (a === Cardinality.Empty) return b as any; + if (b === Cardinality.Empty) return a as any; + if (a === Cardinality.AtLeastOne) return Cardinality.AtLeastOne as any; + if (b === Cardinality.AtLeastOne) return Cardinality.AtLeastOne as any; + if (a === Cardinality.One) return Cardinality.AtLeastOne as any; + if (b === Cardinality.One) return Cardinality.AtLeastOne as any; + return Cardinality.Many as any; + } + + type _mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + > = Cards extends [infer Card] + ? Card + : Cards extends [infer A, infer B, ...infer Rest] + ? A extends Cardinality + ? B extends Cardinality + ? Rest extends Cardinality[] + ? mergeCardinalities extends Cardinality + ? _mergeCardinalitiesVariadic<[mergeCardinalities, ...Rest]> + : never + : never + : never + : never + : never; + + export type mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + > = + _mergeCardinalitiesVariadic extends Cardinality + ? _mergeCardinalitiesVariadic + : never; + export function mergeCardinalitiesVariadic< + Cards extends [Cardinality, ...Cardinality[]], + >(cards: Cards): mergeCardinalitiesVariadic { + if (cards.length === 0) throw new Error("Empty tuple not allowed"); + if (cards.length === 1) return cards[0] as any; + const [first, second, ...rest] = cards as unknown as [ + Cardinality, + Cardinality, + ...Cardinality[], + ]; + if (cards.length === 2) return mergeCardinalities(first, second) as any; + return mergeCardinalitiesVariadic([ + mergeCardinalities(first, second), + ...rest, + ]); + } + + // 'or' cardinalities together + // used in the IF ELSE operator, for expr (a IF bool ELSE b) + // result cardinality is 'a' cardinality *or* 'b' cardinality + // Cardinality Empty AtMostOne One Many AtLeastOne + // Empty 0 AtMostOne AtMostOne Many Many + // AtMostOne AtMostOne AtMostOne AtMostOne Many Many + // One AtMostOne AtMostOne One Many AtLeastOne + // Many Many Many Many Many Many + // AtLeastOne Many Many AtLeastOne Many AtLeastOne + + export type orCardinalities< + C1 extends Cardinality, + C2 extends Cardinality, + > = C1 extends C2 + ? C1 + : C1 extends Cardinality.Many + ? C1 + : C1 extends Cardinality.AtMostOne + ? C2 extends Cardinality.Many + ? C2 + : C2 extends Cardinality.AtLeastOne + ? Cardinality.Many + : C1 + : C1 extends Cardinality.AtLeastOne + ? C2 extends Cardinality.One + ? Cardinality.AtLeastOne + : Cardinality.Many + : C1 extends Cardinality.Empty + ? C2 extends Cardinality.AtMostOne + ? Cardinality.AtMostOne + : C2 extends Cardinality.One + ? Cardinality.AtMostOne + : Cardinality.Many + : C2 extends Cardinality.Empty + ? Cardinality.AtMostOne + : C2; + + export function orCardinalities( + c1: Cardinality, + c2: Cardinality, + ): Cardinality { + if (c1 === c2 || c1 === Cardinality.Many) return c1; + if (c1 === Cardinality.AtLeastOne) { + if (c2 === Cardinality.One) return Cardinality.AtLeastOne; + return Cardinality.Many; + } + if (c1 === Cardinality.AtMostOne) { + if (c2 === Cardinality.Many || c2 === Cardinality.AtLeastOne) { + return Cardinality.Many; + } + return c1; + } + if (c1 === Cardinality.Empty) { + if (c2 === Cardinality.AtMostOne || c2 === Cardinality.One) { + return Cardinality.AtMostOne; + } + return Cardinality.Many; + } + if (c2 === Cardinality.Empty) return Cardinality.AtMostOne; + return c2; + } + + // Empty AtMostOne One Many AtLeastOne + // One One One One AtLeastOne AtLeastOne + // Zero 0 AtMostOne AtMostOne Many Many + + export type overrideLowerBound< + C extends Cardinality, + O extends "One" | "Zero", + > = O extends "One" + ? C extends Cardinality.Many + ? Cardinality.AtLeastOne + : C extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : Cardinality.One + : C extends Cardinality.Empty + ? Cardinality.Empty + : C extends Cardinality.Many + ? Cardinality.Many + : C extends Cardinality.AtLeastOne + ? Cardinality.Many + : Cardinality.AtMostOne; + + export function overrideLowerBound< + C extends Cardinality, + O extends "One" | "Zero", + >(card: C, override: O): overrideLowerBound { + if (override === "One") { + if (card === Cardinality.Many || card === Cardinality.AtLeastOne) { + return Cardinality.AtLeastOne as any; + } else { + return Cardinality.One as any; + } + } else { + if (card === Cardinality.Many || card === Cardinality.AtLeastOne) { + return Cardinality.Many as any; + } else if (card === Cardinality.Empty) { + return Cardinality.Empty as any; + } else { + return Cardinality.AtMostOne as any; + } + } + } + + // Empty AtMostOne One Many AtLeastOne + // One AtMostOne AtMostOne One AtMostOne One + // Many Many Many AtLeastOne Many AtLeastOne + + export type overrideUpperBound< + C extends Cardinality, + O extends "One" | "Many", + > = O extends "One" + ? C extends Cardinality.Many + ? Cardinality.AtMostOne + : C extends Cardinality.AtLeastOne + ? Cardinality.One + : C extends Cardinality.Empty + ? Cardinality.AtMostOne + : C + : C extends Cardinality.One + ? Cardinality.AtLeastOne + : C extends Cardinality.AtMostOne + ? Cardinality.Many + : C extends Cardinality.Empty + ? Cardinality.Many + : C; + + export function overrideUpperBound< + C extends Cardinality, + O extends "One" | "Many", + >(card: C, override: O): overrideUpperBound { + if (override === "One") { + if (card === Cardinality.One || card === Cardinality.AtLeastOne) { + return Cardinality.One as any; + } else { + return Cardinality.AtMostOne as any; + } + } else { + if (card === Cardinality.One || card === Cardinality.AtLeastOne) { + return Cardinality.AtLeastOne as any; + } else { + return Cardinality.Many as any; + } + } + } + + export type paramCardinality

    = [P] extends [TypeSet] + ? // default to one + // fixes multiplyCardinalities bug for func with optional args + [Cardinality] extends [P["__cardinality__"]] + ? Cardinality.One + : P["__cardinality__"] + : Cardinality.One; + + export type optionalParamCardinality

    = overrideLowerBound< + paramCardinality

    , + "One" + >; + + type _paramArrayCardinality = { + [K in keyof T]: T[K] extends TypeSet + ? T[K]["__cardinality__"] + : Cardinality.One; + }; + + export type paramArrayCardinality = + multiplyCardinalitiesVariadic<_paramArrayCardinality>; + + export type assignable = C extends Cardinality.Empty + ? Cardinality.Empty + : C extends Cardinality.One + ? Cardinality.One + : C extends Cardinality.AtMostOne + ? Cardinality.One | Cardinality.AtMostOne | Cardinality.Empty + : C extends Cardinality.AtLeastOne + ? Cardinality.One | Cardinality.AtLeastOne | Cardinality.Many + : C extends Cardinality.Many + ? Cardinality + : never; + + // Cardinality Empty AtMostOne One Many AtLeastOne + // Empty Empty AtMostOne One Many AtLeastOne + // AtMostOne AtMostOne AtMostOne One Many AtLeastOne + // One One One One One One + // Many Many Many AtLeastOne Many AtLeastOne + // AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne AtLeastOne + + export type coalesceCardinalities< + C1 extends Cardinality, + C2 extends Cardinality, + > = C1 extends Cardinality.One + ? C1 + : C1 extends Cardinality.AtLeastOne + ? C1 + : C2 extends Cardinality.One + ? overrideLowerBound + : C2 extends Cardinality.AtLeastOne + ? Cardinality.AtLeastOne + : orCardinalities; + + export function coalesceCardinalities( + c1: Cardinality, + c2: Cardinality, + ): Cardinality { + if (c1 === Cardinality.One || c1 === Cardinality.AtLeastOne) return c1; + if (c2 === Cardinality.One) return overrideLowerBound(c1, "One"); + if (c2 === Cardinality.AtLeastOne) return Cardinality.AtLeastOne; + return orCardinalities(c1, c2); + } +} diff --git a/starters/features/gel/dbschema/edgeql-js/cast.ts b/starters/features/gel/dbschema/edgeql-js/cast.ts new file mode 100644 index 00000000000..e9841ce5cf5 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/cast.ts @@ -0,0 +1,63 @@ +// GENERATED by @gel/generate v0.6.4 + +import { ExpressionKind, Cardinality } from "gel/dist/reflection/index"; +import type { + Expression, + BaseType, + TypeSet, + ObjectTypeExpression, + ScalarType, +} from "./typesystem"; +import { $expressionify } from "./path"; +import type { orScalarLiteral } from "./castMaps"; +import { literalToTypeSet } from "./castMaps"; + +export function cast( + target: Target, + arg: null, +): $expr_Cast< + Target extends BaseType + ? Target + : Target extends ObjectTypeExpression + ? Target["__element__"] + : never, + Cardinality.Empty +>; +export function cast< + Target extends ObjectTypeExpression, + Card extends Cardinality, +>( + target: Target, + arg: TypeSet, Card>, +): $expr_Cast; +export function cast( + target: Target, + expr: orScalarLiteral, +): $expr_Cast< + Target, + Cardinality extends Expr["__cardinality__"] + ? Cardinality.One + : Expr["__cardinality__"] +>; +export function cast(target: BaseType, expr: any) { + const cleanedExpr = expr === null ? null : literalToTypeSet(expr); + return $expressionify({ + __element__: (target as any).__cardinality__ + ? (target as any).__element__ + : target, + __cardinality__: + cleanedExpr === null ? Cardinality.Empty : cleanedExpr.__cardinality__, + __expr__: cleanedExpr, + __kind__: ExpressionKind.Cast, + }) as any; +} + +export type $expr_Cast< + Target extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> = Expression<{ + __element__: Target; + __cardinality__: Card; + __kind__: ExpressionKind.Cast; + __expr__: TypeSet | null; +}>; diff --git a/starters/features/gel/dbschema/edgeql-js/castMaps.ts b/starters/features/gel/dbschema/edgeql-js/castMaps.ts new file mode 100644 index 00000000000..0f1cc0c0e27 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/castMaps.ts @@ -0,0 +1,774 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as gel from "gel"; +import type * as $ from "./reflection"; +import * as literal from "./literal"; +import type * as _std from "./modules/std"; +import type * as _sys from "./modules/sys"; +import type * as _stdpg from "./modules/std/pg"; +import type * as _stdnethttp from "./modules/std/net/http"; +import type * as _stdnet from "./modules/std/net"; +import type * as _stdfts from "./modules/std/fts"; +import type * as _stdenc from "./modules/std/enc"; +import type * as _stdcal from "./modules/std/cal"; +import type * as _schema from "./modules/schema"; +import type * as _cfg from "./modules/cfg"; +export interface ScalarAssignableByMap { + "std::number": _std.$number; + "sys::VersionStage": _sys.$VersionStage; + "sys::TransactionIsolation": _sys.$TransactionIsolation; + "sys::TransactionDeferrability": _sys.$TransactionDeferrability; + "sys::TransactionAccessMode": _sys.$TransactionAccessMode; + "sys::QueryType": _sys.$QueryType; + "sys::OutputFormat": _sys.$OutputFormat; + "std::uuid": _std.$uuid; + "std::str": _std.$str; + "std::pg::timestamptz": _stdpg.$timestamptz; + "std::pg::timestamp": _stdpg.$timestamp; + "std::pg::json": _stdpg.$json; + "std::pg::interval": _stdpg.$interval; + "std::pg::date": _stdpg.$date; + "std::net::http::Method": _stdnethttp.$Method; + "std::net::RequestState": _stdnet.$RequestState; + "std::net::RequestFailureKind": _stdnet.$RequestFailureKind; + "std::json": _std.$json; + "std::int64": _std.$int64; + "std::int32": _std.$int32; + "std::int16": _std.$int16; + "std::fts::document": _stdfts.$document; + "std::fts::Weight": _stdfts.$Weight; + "std::fts::PGLanguage": _stdfts.$PGLanguage; + "std::fts::LuceneLanguage": _stdfts.$LuceneLanguage; + "std::fts::Language": _stdfts.$Language; + "std::fts::ElasticLanguage": _stdfts.$ElasticLanguage; + "std::float64": _std.$float64; + "std::float32": _std.$float32; + "std::enc::Base64Alphabet": _stdenc.$Base64Alphabet; + "std::duration": _std.$duration; + "std::decimal": _std.$decimalλIAssignableBy; + "std::datetime": _std.$datetime; + "std::cal::relative_duration": _stdcal.$relative_durationλIAssignableBy; + "std::cal::local_time": _stdcal.$local_time; + "std::cal::local_datetime": _stdcal.$local_datetimeλIAssignableBy; + "std::cal::local_date": _stdcal.$local_date; + "std::cal::date_duration": _stdcal.$date_duration; + "std::bytes": _std.$bytes; + "std::bool": _std.$bool; + "std::bigint": _std.$bigint; + "std::JsonEmpty": _std.$JsonEmpty; + "std::Endian": _std.$Endian; + "schema::Volatility": _schema.$Volatility; + "schema::TypeModifier": _schema.$TypeModifier; + "schema::TriggerTiming": _schema.$TriggerTiming; + "schema::TriggerScope": _schema.$TriggerScope; + "schema::TriggerKind": _schema.$TriggerKind; + "schema::TargetDeleteAction": _schema.$TargetDeleteAction; + "schema::SourceDeleteAction": _schema.$SourceDeleteAction; + "schema::RewriteKind": _schema.$RewriteKind; + "schema::ParameterKind": _schema.$ParameterKind; + "schema::OperatorKind": _schema.$OperatorKind; + "schema::MigrationGeneratedBy": _schema.$MigrationGeneratedBy; + "schema::IndexDeferrability": _schema.$IndexDeferrability; + "schema::Cardinality": _schema.$Cardinality; + "schema::AccessPolicyAction": _schema.$AccessPolicyAction; + "schema::AccessKind": _schema.$AccessKind; + "cfg::memory": _cfg.$memory; + "cfg::StoreMigrationSDL": _cfg.$StoreMigrationSDL; + "cfg::SMTPSecurity": _cfg.$SMTPSecurity; + "cfg::QueryStatsOption": _cfg.$QueryStatsOption; + "cfg::QueryCacheMode": _cfg.$QueryCacheMode; + "cfg::ConnectionTransport": _cfg.$ConnectionTransport; + "cfg::AllowBareDDL": _cfg.$AllowBareDDL; +} +export type scalarAssignableBy = + T extends $.ScalarType + ? ScalarAssignableByMap[N] + : never; + +export interface ScalarCastableFromMap { + "std::number": _std.$number; + "sys::VersionStage": _sys.$VersionStage; + "sys::TransactionIsolation": _sys.$TransactionIsolation; + "sys::TransactionDeferrability": _sys.$TransactionDeferrability; + "sys::TransactionAccessMode": _sys.$TransactionAccessMode; + "sys::QueryType": _sys.$QueryType; + "sys::OutputFormat": _sys.$OutputFormat; + "std::uuid": _std.$uuid; + "std::str": _std.$str; + "std::pg::timestamptz": _stdpg.$timestamptz; + "std::pg::timestamp": _stdpg.$timestamp; + "std::pg::json": _stdpg.$json; + "std::pg::interval": _stdpg.$interval; + "std::pg::date": _stdpg.$date; + "std::net::http::Method": _stdnethttp.$Method; + "std::net::RequestState": _stdnet.$RequestState; + "std::net::RequestFailureKind": _stdnet.$RequestFailureKind; + "std::json": _std.$json; + "std::int64": _std.$int64; + "std::int32": _std.$int32; + "std::int16": _std.$int16; + "std::fts::document": _stdfts.$document; + "std::fts::Weight": _stdfts.$Weight; + "std::fts::PGLanguage": _stdfts.$PGLanguage; + "std::fts::LuceneLanguage": _stdfts.$LuceneLanguage; + "std::fts::Language": _stdfts.$Language; + "std::fts::ElasticLanguage": _stdfts.$ElasticLanguage; + "std::float64": _std.$float64; + "std::float32": _std.$float32; + "std::enc::Base64Alphabet": _stdenc.$Base64Alphabet; + "std::duration": _std.$duration; + "std::decimal": _std.$decimalλICastableTo; + "std::datetime": _std.$datetime; + "std::cal::relative_duration": _stdcal.$relative_durationλICastableTo; + "std::cal::local_time": _stdcal.$local_time; + "std::cal::local_datetime": _stdcal.$local_datetimeλICastableTo; + "std::cal::local_date": _stdcal.$local_date; + "std::cal::date_duration": _stdcal.$date_duration; + "std::bytes": _std.$bytes; + "std::bool": _std.$bool; + "std::bigint": _std.$bigint; + "std::JsonEmpty": _std.$JsonEmpty; + "std::Endian": _std.$Endian; + "schema::Volatility": _schema.$Volatility; + "schema::TypeModifier": _schema.$TypeModifier; + "schema::TriggerTiming": _schema.$TriggerTiming; + "schema::TriggerScope": _schema.$TriggerScope; + "schema::TriggerKind": _schema.$TriggerKind; + "schema::TargetDeleteAction": _schema.$TargetDeleteAction; + "schema::SourceDeleteAction": _schema.$SourceDeleteAction; + "schema::RewriteKind": _schema.$RewriteKind; + "schema::ParameterKind": _schema.$ParameterKind; + "schema::OperatorKind": _schema.$OperatorKind; + "schema::MigrationGeneratedBy": _schema.$MigrationGeneratedBy; + "schema::IndexDeferrability": _schema.$IndexDeferrability; + "schema::Cardinality": _schema.$Cardinality; + "schema::AccessPolicyAction": _schema.$AccessPolicyAction; + "schema::AccessKind": _schema.$AccessKind; + "cfg::memory": _cfg.$memory; + "cfg::StoreMigrationSDL": _cfg.$StoreMigrationSDL; + "cfg::SMTPSecurity": _cfg.$SMTPSecurity; + "cfg::QueryStatsOption": _cfg.$QueryStatsOption; + "cfg::QueryCacheMode": _cfg.$QueryCacheMode; + "cfg::ConnectionTransport": _cfg.$ConnectionTransport; + "cfg::AllowBareDDL": _cfg.$AllowBareDDL; +} +export type scalarCastableFrom = + T extends $.ScalarType + ? ScalarCastableFromMap[N] + : never; + +type getSharedParentScalar = + A extends $.ScalarType + ? B extends $.ScalarType + ? AName extends "std::decimal" + ? BName extends "std::decimal" + ? B + : BName extends "std::bigint" + ? A + : never + : AName extends "std::cal::relative_duration" + ? BName extends "std::cal::relative_duration" + ? B + : BName extends "std::cal::date_duration" + ? A + : never + : AName extends "std::cal::local_datetime" + ? BName extends "std::cal::local_datetime" + ? B + : BName extends "std::cal::local_date" + ? A + : never + : AName extends "std::cal::local_date" + ? BName extends "std::cal::local_datetime" + ? B + : BName extends "std::cal::local_date" + ? B + : never + : AName extends "std::cal::date_duration" + ? BName extends "std::cal::relative_duration" + ? B + : BName extends "std::cal::date_duration" + ? B + : never + : AName extends "std::bigint" + ? BName extends "std::decimal" + ? B + : BName extends "std::bigint" + ? B + : never + : AName extends BName + ? A + : never + : never + : never; + +function getSharedParentScalar( + a: A, + b: B, +): A | B { + a = (a as any).__casttype__ || a; + b = (b as any).__casttype__ || b; + if (a.__name__ === "std::number") { + if (b.__name__ === "std::number") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::VersionStage") { + if (b.__name__ === "sys::VersionStage") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::TransactionIsolation") { + if (b.__name__ === "sys::TransactionIsolation") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::TransactionDeferrability") { + if (b.__name__ === "sys::TransactionDeferrability") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::TransactionAccessMode") { + if (b.__name__ === "sys::TransactionAccessMode") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::QueryType") { + if (b.__name__ === "sys::QueryType") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "sys::OutputFormat") { + if (b.__name__ === "sys::OutputFormat") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::uuid") { + if (b.__name__ === "std::uuid") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::str") { + if (b.__name__ === "std::str") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::pg::timestamptz") { + if (b.__name__ === "std::pg::timestamptz") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::pg::timestamp") { + if (b.__name__ === "std::pg::timestamp") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::pg::json") { + if (b.__name__ === "std::pg::json") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::pg::interval") { + if (b.__name__ === "std::pg::interval") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::pg::date") { + if (b.__name__ === "std::pg::date") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::net::http::Method") { + if (b.__name__ === "std::net::http::Method") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::net::RequestState") { + if (b.__name__ === "std::net::RequestState") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::net::RequestFailureKind") { + if (b.__name__ === "std::net::RequestFailureKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::json") { + if (b.__name__ === "std::json") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int64") { + if (b.__name__ === "std::int64") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int32") { + if (b.__name__ === "std::int32") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::int16") { + if (b.__name__ === "std::int16") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::document") { + if (b.__name__ === "std::fts::document") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::Weight") { + if (b.__name__ === "std::fts::Weight") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::PGLanguage") { + if (b.__name__ === "std::fts::PGLanguage") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::LuceneLanguage") { + if (b.__name__ === "std::fts::LuceneLanguage") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::Language") { + if (b.__name__ === "std::fts::Language") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::fts::ElasticLanguage") { + if (b.__name__ === "std::fts::ElasticLanguage") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::float64") { + if (b.__name__ === "std::float64") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::float32") { + if (b.__name__ === "std::float32") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::enc::Base64Alphabet") { + if (b.__name__ === "std::enc::Base64Alphabet") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::duration") { + if (b.__name__ === "std::duration") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::decimal") { + if (b.__name__ === "std::decimal") { + return b; + } + if (b.__name__ === "std::bigint") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::datetime") { + if (b.__name__ === "std::datetime") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::cal::relative_duration") { + if (b.__name__ === "std::cal::relative_duration") { + return b; + } + if (b.__name__ === "std::cal::date_duration") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::cal::local_time") { + if (b.__name__ === "std::cal::local_time") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::cal::local_datetime") { + if (b.__name__ === "std::cal::local_datetime") { + return b; + } + if (b.__name__ === "std::cal::local_date") { + return a; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::cal::local_date") { + if (b.__name__ === "std::cal::local_datetime") { + return b; + } + if (b.__name__ === "std::cal::local_date") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::cal::date_duration") { + if (b.__name__ === "std::cal::relative_duration") { + return b; + } + if (b.__name__ === "std::cal::date_duration") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bytes") { + if (b.__name__ === "std::bytes") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bool") { + if (b.__name__ === "std::bool") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::bigint") { + if (b.__name__ === "std::decimal") { + return b; + } + if (b.__name__ === "std::bigint") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::JsonEmpty") { + if (b.__name__ === "std::JsonEmpty") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "std::Endian") { + if (b.__name__ === "std::Endian") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::Volatility") { + if (b.__name__ === "schema::Volatility") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TypeModifier") { + if (b.__name__ === "schema::TypeModifier") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerTiming") { + if (b.__name__ === "schema::TriggerTiming") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerScope") { + if (b.__name__ === "schema::TriggerScope") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TriggerKind") { + if (b.__name__ === "schema::TriggerKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::TargetDeleteAction") { + if (b.__name__ === "schema::TargetDeleteAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::SourceDeleteAction") { + if (b.__name__ === "schema::SourceDeleteAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::RewriteKind") { + if (b.__name__ === "schema::RewriteKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::ParameterKind") { + if (b.__name__ === "schema::ParameterKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::OperatorKind") { + if (b.__name__ === "schema::OperatorKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::MigrationGeneratedBy") { + if (b.__name__ === "schema::MigrationGeneratedBy") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::IndexDeferrability") { + if (b.__name__ === "schema::IndexDeferrability") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::Cardinality") { + if (b.__name__ === "schema::Cardinality") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::AccessPolicyAction") { + if (b.__name__ === "schema::AccessPolicyAction") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "schema::AccessKind") { + if (b.__name__ === "schema::AccessKind") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::memory") { + if (b.__name__ === "cfg::memory") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::StoreMigrationSDL") { + if (b.__name__ === "cfg::StoreMigrationSDL") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::SMTPSecurity") { + if (b.__name__ === "cfg::SMTPSecurity") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::QueryStatsOption") { + if (b.__name__ === "cfg::QueryStatsOption") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::QueryCacheMode") { + if (b.__name__ === "cfg::QueryCacheMode") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::ConnectionTransport") { + if (b.__name__ === "cfg::ConnectionTransport") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + if (a.__name__ === "cfg::AllowBareDDL") { + if (b.__name__ === "cfg::AllowBareDDL") { + return b; + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); + } + throw new Error(`Types are not castable: ${a.__name__}, ${b.__name__}`); +} + +const implicitCastMap = new Map>([ + ["std::cal::date_duration", new Set(["std::cal::relative_duration"])], + ["std::cal::local_date", new Set(["std::cal::local_datetime"])], + ["std::bigint", new Set(["std::decimal"])], +]); +function isImplicitlyCastableTo(from: string, to: string): boolean { + const _a = implicitCastMap.get(from), + _b = _a != null ? _a.has(to) : null; + return _b != null ? _b : false; +} + +export type scalarLiterals = + | number + | string + | boolean + | bigint + | Uint8Array + | Date + | gel.Duration + | gel.ConfigMemory + | Float32Array + | gel.LocalDateTime + | gel.LocalDate + | gel.LocalTime + | gel.RelativeDuration + | gel.DateDuration + | gel.Range + | gel.MultiRange; + +type getTsType = T extends $.ScalarType + ? T extends + | _std.$decimal + | _stdfts.$document + | _std.$json + | _stdpg.$date + | _stdpg.$interval + | _stdpg.$json + | _stdpg.$timestamp + | _stdpg.$timestamptz + | _std.$uuid + ? never + : T["__tstype__"] + : T extends $.RangeType + ? gel.Range + : T extends $.MultiRangeType + ? gel.MultiRange + : never; +export type orScalarLiteral = + | T + | ($.BaseTypeSet extends T + ? scalarLiterals + : $.Cardinality extends T["__cardinality__"] + ? getTsType + : $.computeTsTypeCard< + getTsType, + T["__cardinality__"] + >); +export type scalarWithConstType< + T extends $.ScalarType, + TsConstType, +> = $.ScalarType< + T["__name__"], + T["__tstype__"], + T["__tsargtype__"], + TsConstType +>; +export type literalToScalarType = T extends number + ? scalarWithConstType<_std.$number, T> + : T extends string + ? scalarWithConstType<_std.$str, T> + : T extends boolean + ? scalarWithConstType<_std.$bool, T> + : T extends bigint + ? scalarWithConstType<_std.$bigint, T> + : T extends Uint8Array + ? scalarWithConstType<_std.$bytes, T> + : T extends Date + ? scalarWithConstType<_std.$datetime, T> + : T extends gel.Duration + ? scalarWithConstType<_std.$duration, T> + : T extends gel.ConfigMemory + ? scalarWithConstType<_cfg.$memory, T> + : T extends gel.LocalDateTime + ? scalarWithConstType<_stdcal.$local_datetime, T> + : T extends gel.LocalDate + ? scalarWithConstType<_stdcal.$local_date, T> + : T extends gel.LocalTime + ? scalarWithConstType<_stdcal.$local_time, T> + : T extends gel.RelativeDuration + ? scalarWithConstType<_stdcal.$relative_duration, T> + : T extends gel.DateDuration + ? scalarWithConstType<_stdcal.$date_duration, T> + : T extends gel.Range + ? $.RangeType> + : T extends gel.MultiRange + ? $.MultiRangeType> + : $.BaseType; + +type literalToTypeSet = T extends $.TypeSet + ? T + : $.$expr_Literal>; + +export type mapLiteralToTypeSet = { + [k in keyof T]: literalToTypeSet; +}; + +function literalToTypeSet(type: any): $.TypeSet { + if (type && type.__element__) { + return type; + } + if (typeof type === "number") { + return literal.$getType("00000000-0000-0000-0000-0000000001ff")(type); + } + if (typeof type === "string") { + return literal.$getType("00000000-0000-0000-0000-000000000101")(type); + } + if (typeof type === "boolean") { + return literal.$getType("00000000-0000-0000-0000-000000000109")(type); + } + if (typeof type === "bigint") { + return literal.$getType("00000000-0000-0000-0000-000000000110")(type); + } + if (type instanceof Uint8Array) { + return literal.$getType("00000000-0000-0000-0000-000000000102")(type); + } + if (type instanceof Date) { + return literal.$getType("00000000-0000-0000-0000-00000000010a")(type); + } + if (type instanceof gel.Duration) { + return literal.$getType("00000000-0000-0000-0000-00000000010e")(type); + } + if (type instanceof gel.ConfigMemory) { + return literal.$getType("00000000-0000-0000-0000-000000000130")(type); + } + if (type instanceof gel.LocalDateTime) { + return literal.$getType("00000000-0000-0000-0000-00000000010b")(type); + } + if (type instanceof gel.LocalDate) { + return literal.$getType("00000000-0000-0000-0000-00000000010c")(type); + } + if (type instanceof gel.LocalTime) { + return literal.$getType("00000000-0000-0000-0000-00000000010d")(type); + } + if (type instanceof gel.RelativeDuration) { + return literal.$getType("00000000-0000-0000-0000-000000000111")(type); + } + if (type instanceof gel.DateDuration) { + return literal.$getType("00000000-0000-0000-0000-000000000112")(type); + } + throw new Error(`Cannot convert literal '${type}' into scalar type`); +} + +export { getSharedParentScalar, isImplicitlyCastableTo, literalToTypeSet }; diff --git a/starters/features/gel/dbschema/edgeql-js/casting.ts b/starters/features/gel/dbschema/edgeql-js/casting.ts new file mode 100644 index 00000000000..0911b4071ea --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/casting.ts @@ -0,0 +1,171 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Cardinality } from "gel/dist/reflection/index"; +import type { + ArrayType, + BaseType, + BaseTypeTuple, + BaseTypeToTsType, + EnumType, + LinkDesc, + NamedTupleType, + ObjectType, + ObjectTypeSet, + PrimitiveTypeSet, + PropertyDesc, + ScalarType, + TupleType, + TypeSet, + RangeType, + MultiRangeType, +} from "./typesystem"; +import type { cardutil } from "./cardinality"; + +import type { scalarCastableFrom, scalarAssignableBy } from "./castMaps"; + +export type anonymizeObject = ObjectType< + string, + T["__pointers__"], + any +>; + +//////////////// +// ASSIGNABLE +//////////////// + +type assignableTuple = { + [k in keyof Items]: Items[k] extends BaseType + ? assignableBy + : never; +} extends infer NewItems + ? NewItems extends BaseTypeTuple + ? NewItems + : never + : never; + +export type assignableBy = T extends ScalarType + ? scalarAssignableBy + : T extends ObjectType + ? anonymizeObject + : T extends EnumType + ? T + : T extends ArrayType + ? ArrayType> + : T extends TupleType + ? TupleType> + : T extends NamedTupleType + ? NamedTupleType<{ + [k in keyof T["__shape__"]]: assignableBy; + }> + : T extends RangeType + ? RangeType< + scalarAssignableBy extends ScalarType + ? scalarAssignableBy + : never + > + : T extends MultiRangeType + ? MultiRangeType< + scalarAssignableBy extends ScalarType + ? scalarAssignableBy + : never + > + : never; + +export type pointerToAssignmentExpression< + Pointer extends PropertyDesc | LinkDesc, + IsSetModifier extends boolean = false, +> = setToAssignmentExpression< + TypeSet, + IsSetModifier +>; + +export type setToAssignmentExpression< + Set extends TypeSet, + IsSetModifier extends boolean, +> = [Set] extends [PrimitiveTypeSet] + ? + | TypeSet< + assignableBy, + cardutil.assignable< + // Set["__cardinality__"] + cardutil.overrideLowerBound + > + > + | getAssignmentLiteral + : [Set] extends [ObjectTypeSet] + ? TypeSet< + ObjectType< + // anonymize the object type + string, + Set["__element__"]["__pointers__"] + >, + cardutil.assignable< + // Allow expressions with AtMostOne or Many cardinality in + // insert/update shape even when link is required since Gel will + // assert cardinality at runtime + cardutil.overrideLowerBound + > + > + : never; + +type getAssignmentLiteral< + Set extends PrimitiveTypeSet, + IsSetModifier extends boolean, +> = + BaseTypeToTsType extends infer TsType + ? + | TsType + | (Set["__cardinality__"] extends Cardinality.Many + ? readonly TsType[] + : Set["__cardinality__"] extends Cardinality.AtLeastOne + ? IsSetModifier extends true + ? readonly TsType[] + : readonly [TsType, ...TsType[]] + : never) + : never; + +//////////////// +// CASTABLES +//////////////// + +type castableTuple = { + [k in keyof Items]: Items[k] extends BaseType + ? castableFrom + : never; +} extends infer NewItems + ? NewItems extends BaseTypeTuple + ? NewItems + : never + : never; + +export type castableFrom = T extends ScalarType + ? scalarCastableFrom + : T extends ObjectType + ? anonymizeObject + : T extends ArrayType + ? ArrayType> + : T extends TupleType + ? TupleType> + : T extends NamedTupleType + ? NamedTupleType<{ + [k in keyof T["__shape__"]]: castableFrom; + }> + : never; + +export type pointerToCastableExpression< + Pointer extends PropertyDesc | LinkDesc, +> = [Pointer] extends [PropertyDesc] + ? { + __element__: castableFrom; + __cardinality__: cardutil.assignable; + } + : [Pointer] extends [LinkDesc] + ? TypeSet< + ObjectType< + // anonymize the object type + string, + Pointer["target"]["__pointers__"] + >, + cardutil.assignable + > + : never; diff --git a/starters/features/gel/dbschema/edgeql-js/collections.ts b/starters/features/gel/dbschema/edgeql-js/collections.ts new file mode 100644 index 00000000000..f595d961fb0 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/collections.ts @@ -0,0 +1,365 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + Cardinality, + ExpressionKind, + TypeKind, + type typeutil, +} from "gel/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import type { + $expr_Array, + $expr_NamedTuple, + $expr_Tuple, + $expr_TuplePath, + ArrayType, + BaseType, + getPrimitiveBaseType, + NamedTupleLiteralShape, + NamedTupleShape, + NamedTupleType, + NonArrayType, + ObjectTypeExpression, + ObjectTypePointers, + PropertyDesc, + TupleType, + TypeSet, +} from "./typesystem"; + +import { $expressionify, type ExpressionRoot } from "./path"; +import type { getCardsFromExprs } from "./set"; +import { + type literalToScalarType, + literalToTypeSet, + type mapLiteralToTypeSet, + type orScalarLiteral, + type scalarLiterals, +} from "./castMaps"; + +const indexSliceRegx = /^(-?\d+)(?:(:)(-?\d+)?)?|:(-?\d+)$/; + +const arrayLikeProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + const match = typeof prop === "string" ? prop.match(indexSliceRegx) : null; + if (match) { + const start = match[1]; + const end = match[3] ?? match[4]; + const isIndex = start && !match[2]; + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: + target.__element__.__kind__ === TypeKind.array && isIndex + ? (target.__element__ as ArrayType).__element__ + : target.__element__, + __cardinality__: target.__cardinality__, + __name__: "[]", + __opkind__: "Infix", + __args__: [ + proxy, + isIndex + ? literalToTypeSet(Number(start)) + : [ + start && literalToTypeSet(Number(start)), + end && literalToTypeSet(Number(end)), + ], + ], + }) as any; + } + return (target as any)[prop]; + }, +}; + +function arrayLikeIndex(this: ExpressionRoot, index: any) { + const indexTypeSet = literalToTypeSet(index); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: + this.__element__.__kind__ === TypeKind.array + ? (this.__element__ as ArrayType).__element__ + : this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + this.__cardinality__, + indexTypeSet.__cardinality__, + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, indexTypeSet], + }) as any; +} + +function arrayLikeSlice(this: ExpressionRoot, start: any, end: any) { + const startTypeSet = start && literalToTypeSet(start); + const endTypeSet = end && literalToTypeSet(end); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + cardutil.multiplyCardinalities( + this.__cardinality__, + startTypeSet?.__cardinality__ ?? Cardinality.One, + ), + endTypeSet?.__cardinality__ ?? Cardinality.One, + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, [startTypeSet, endTypeSet]], + }) as any; +} + +export function $arrayLikeIndexify(_expr: ExpressionRoot) { + if ( + _expr.__element__.__kind__ === TypeKind.array || + (_expr.__element__.__kind__ === TypeKind.scalar && + (_expr.__element__.__name__ === "std::str" || + _expr.__element__.__name__ === "std::bytes")) + ) { + const expr = new Proxy(_expr, arrayLikeProxyHandlers) as any; + + expr.index = arrayLikeIndex.bind(expr); + expr.slice = arrayLikeSlice.bind(expr); + + return expr; + } + + return _expr; +} + +// ARRAY +export function array( + element: Element, +): ArrayType; +export function array< + Expr extends TypeSet | scalarLiterals, + Exprs extends orScalarLiteral< + TypeSet< + Expr extends TypeSet + ? getPrimitiveBaseType + : getPrimitiveBaseType> + > + >[], +>( + arg: [Expr, ...Exprs], +): $expr_Array< + ArrayType< + Expr extends TypeSet + ? getPrimitiveBaseType + : getPrimitiveBaseType> + >, + cardutil.multiplyCardinalitiesVariadic< + getCardsFromExprs> + > +>; +export function array(arg: any) { + if (Array.isArray(arg)) { + const items = arg.map((a) => literalToTypeSet(a)); + return $expressionify({ + __kind__: ExpressionKind.Array, + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + items.map((item) => item.__cardinality__) as any, + ), + __element__: { + __kind__: TypeKind.array, + __name__: `array<${items[0]!.__element__.__name__}>`, + __element__: items[0]!.__element__, + } as any, + __items__: items, + }); + } + if (arg.__kind__) { + return { + __kind__: TypeKind.array, + __name__: `array<${arg.__name__}>`, + __element__: arg, + } as any; + } + + throw new Error("Invalid array input."); +} + +// TUPLE + +const tupleProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + const type = target.__element__; + const items = + type.__kind__ === TypeKind.tuple + ? (type as TupleType).__items__ + : type.__kind__ === TypeKind.namedtuple + ? (type as NamedTupleType).__shape__ + : null; + return items && Object.prototype.hasOwnProperty.call(items, prop) + ? tuplePath(proxy, (items as any)[prop], prop as any) + : (target as any)[prop]; + }, +}; + +export function $tuplePathify(expr: ExpressionRoot) { + if ( + expr.__element__.__kind__ !== TypeKind.tuple && + expr.__element__.__kind__ !== TypeKind.namedtuple + ) { + return expr; + } + + return new Proxy(expr, tupleProxyHandlers); +} + +function tuplePath( + parent: $expr_Tuple | $expr_TuplePath, + itemType: BaseType, + index: string, +): $expr_TuplePath { + return $expressionify({ + __kind__: ExpressionKind.TuplePath, + __element__: itemType, + __cardinality__: parent.__cardinality__, + __parent__: parent, + __index__: index, + }) as any; +} + +function makeTupleType(name: string, items: BaseType[]) { + return { + __kind__: TypeKind.tuple, + __name__: name, + __items__: items, + } as any; +} + +const typeKinds = new Set(Object.values(TypeKind)); + +export function tuple>( + items: Items, +): TupleType; +export function tuple< + _Item extends TypeSet | scalarLiterals, + Items extends typeutil.tupleOf, +>( + items: Items, +): $expr_Tuple< + Items extends typeutil.tupleOf ? mapLiteralToTypeSet : never +>; +export function tuple( + shape: Shape, +): NamedTupleType; +export function tuple( + shape: Shape, +): $expr_NamedTuple>; +export function tuple(input: any) { + if (Array.isArray(input)) { + // is tuple + if (input.every((item) => typeKinds.has(item.__kind__))) { + const typeItems = input as BaseType[]; + const typeName = `tuple<${typeItems + .map((item) => item.__name__) + .join(", ")}>`; + return makeTupleType(typeName, typeItems); + } + + const items = input.map((item) => literalToTypeSet(item)); + const name = `tuple<${items + .map((item) => item.__element__.__name__) + .join(", ")}>`; + return $expressionify({ + __kind__: ExpressionKind.Tuple, + __element__: makeTupleType( + name, + items.map((item) => item.__element__), + ), + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + items.map((i) => i.__cardinality__) as any, + ), + __items__: items, + }) as any; + } else { + // is named tuple + if (Object.values(input).every((el: any) => typeKinds.has(el.__kind__))) { + const typeName = `tuple<${Object.entries(input) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`; + return { + __kind__: TypeKind.namedtuple, + __name__: typeName, + __shape__: input, + } as any; + } + + const exprShape: NamedTupleLiteralShape = {}; + const typeShape: NamedTupleShape = {}; + for (const [key, val] of Object.entries(input)) { + const typeSet = literalToTypeSet(val); + exprShape[key] = typeSet; + typeShape[key] = typeSet.__element__; + } + const name = `tuple<${Object.entries(exprShape) + .map(([key, val]) => `${key}: ${val.__element__.__name__}`) + .join(", ")}>`; + return $expressionify({ + __kind__: ExpressionKind.NamedTuple, + __element__: { + __kind__: TypeKind.namedtuple, + __name__: name, + __shape__: typeShape, + } as any, + __cardinality__: cardutil.multiplyCardinalitiesVariadic( + Object.values(exprShape).map((val) => val.__cardinality__) as any, + ), + __shape__: exprShape, + }) as any; + } +} + +type PropertyNamesFromPointers = { + [k in keyof Pointers as Pointers[k] extends PropertyDesc + ? Pointers[k]["computed"] extends true + ? never + : k + : never]: Pointers[k]; +}; + +export function $objectTypeToTupleType( + objectType: Expr, +): PropertyNamesFromPointers< + Expr["__element__"]["__pointers__"] +> extends infer Pointers + ? Pointers extends ObjectTypePointers + ? NamedTupleType<{ + [k in keyof Pointers as k extends "id" + ? never + : k]: Pointers[k]["target"]; + }> + : never + : never; +export function $objectTypeToTupleType< + Expr extends ObjectTypeExpression, + Fields extends keyof PropertyNamesFromPointers< + Expr["__element__"]["__pointers__"] + >, +>( + objectType: Expr, + includeFields: Fields[], +): NamedTupleType<{ + [k in Fields]: Expr["__element__"]["__pointers__"][k] extends PropertyDesc + ? Expr["__element__"]["__pointers__"][k]["target"] + : never; +}>; +export function $objectTypeToTupleType(...args: any[]): any { + const [objExpr, fields] = args as [ + ObjectTypeExpression, + string[] | undefined, + ]; + const shape = Object.entries(objExpr.__element__.__pointers__).reduce( + (_shape, [key, val]) => { + if ( + fields?.length + ? fields.includes(key) + : key !== "id" && val.__kind__ === "property" && !val.computed + ) { + _shape[key] = val.target; + } + return _shape; + }, + {} as NamedTupleShape, + ); + return tuple(shape); +} diff --git a/starters/features/gel/dbschema/edgeql-js/config.json b/starters/features/gel/dbschema/edgeql-js/config.json new file mode 100644 index 00000000000..b4ca914e982 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/config.json @@ -0,0 +1,2 @@ +// Gel query builder +{ "target": "ts" } diff --git a/starters/features/gel/dbschema/edgeql-js/detached.ts b/starters/features/gel/dbschema/edgeql-js/detached.ts new file mode 100644 index 00000000000..99fc22aef91 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/detached.ts @@ -0,0 +1,23 @@ +// GENERATED by @gel/generate v0.6.4 + +import { ExpressionKind } from "gel/dist/reflection/index"; +import type { Expression, TypeSet } from "./typesystem"; +import { $expressionify } from "./path"; + +export function detached( + expr: Expr, +): $expr_Detached { + return $expressionify({ + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + __kind__: ExpressionKind.Detached, + }) as any; +} + +export type $expr_Detached = Expression<{ + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __kind__: ExpressionKind.Detached; + __expr__: TypeSet; +}>; diff --git a/starters/features/gel/dbschema/edgeql-js/external.ts b/starters/features/gel/dbschema/edgeql-js/external.ts new file mode 100644 index 00000000000..096f7c63ad8 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/external.ts @@ -0,0 +1,30 @@ +// GENERATED by @gel/generate v0.6.4 + +export { literal } from "./literal"; +export {} from "./path"; +export { set } from "./set"; +export { cast } from "./cast"; +export { + ASC, + DESC, + EMPTY_FIRST, + EMPTY_LAST, + is, + delete, + select, +} from "./select"; +export { update } from "./update"; +export { insert } from "./insert"; +export { + array, + tuple, + $objectTypeToTupleType as objectTypeToTupleType, +} from "./collections"; +export {} from "./funcops"; +export { for } from "./for"; +export { alias, with } from "./with"; +export { optional, params } from "./params"; +export { detached } from "./detached"; +export {} from "./toEdgeQL"; + +export type { setToTsType as $infer } from "./typesystem"; diff --git a/starters/features/gel/dbschema/edgeql-js/for.ts b/starters/features/gel/dbschema/edgeql-js/for.ts new file mode 100644 index 00000000000..72c61e8c79b --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/for.ts @@ -0,0 +1,59 @@ +// GENERATED by @gel/generate v0.6.4 + +import { Cardinality, ExpressionKind } from "gel/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import type { Expression, BaseType, BaseTypeSet } from "./typesystem"; +import { $expressionify } from "./path"; + +export type $expr_For< + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality, + // IterSet extends BaseTypeSet = BaseTypeSet, + // Expr extends BaseTypeSet = BaseTypeSet +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.For; + __iterSet__: BaseTypeSet; + __forVar__: $expr_ForVar; + __expr__: BaseTypeSet; +}>; + +export type $expr_ForVar = Expression<{ + __element__: Type; + __cardinality__: Cardinality.One; + __kind__: ExpressionKind.ForVar; +}>; + +function _for( + set: IteratorSet, + expr: (variable: $expr_ForVar) => Expr, +): $expr_For< + Expr["__element__"], + cardutil.multiplyCardinalities< + IteratorSet["__cardinality__"], + Expr["__cardinality__"] + > +> { + const forVar = $expressionify({ + __kind__: ExpressionKind.ForVar, + __element__: set.__element__, + __cardinality__: Cardinality.One, + }) as $expr_ForVar; + + const returnExpr = expr(forVar); + + return $expressionify({ + __kind__: ExpressionKind.For, + __element__: returnExpr.__element__, + __cardinality__: cardutil.multiplyCardinalities( + set.__cardinality__, + returnExpr.__cardinality__, + ), + __iterSet__: set, + __expr__: returnExpr, + __forVar__: forVar, + }) as any; +} + +export { _for as for }; diff --git a/starters/features/gel/dbschema/edgeql-js/funcops.ts b/starters/features/gel/dbschema/edgeql-js/funcops.ts new file mode 100644 index 00000000000..777ac208a3a --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/funcops.ts @@ -0,0 +1,478 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + Cardinality, + type introspect, + TypeKind, +} from "gel/dist/reflection/index"; +import { cardutil } from "./cardinality"; +import { makeType } from "./hydrate"; +import type { + BaseType, + BaseTypeSet, + ArrayType, + ObjectType, + TypeSet, + RangeType, + Expression, + MultiRangeType, +} from "./typesystem"; +import { cast } from "./cast"; +import { isImplicitlyCastableTo, literalToTypeSet } from "./castMaps"; +import { literal } from "./literal"; + +import type { ExpressionKind, OperatorKind } from "gel/dist/reflection/index"; + +export type $expr_Function< + // Name extends string = string, + // Args extends (BaseTypeSet | undefined)[] = (BaseTypeSet | undefined)[], + // NamedArgs extends {[key: string]: BaseTypeSet} = { + // [key: string]: BaseTypeSet; + // }, + // ReturnType extends BaseTypeSet = BaseTypeSet, + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Function; + __name__: string; + __args__: (BaseTypeSet | undefined)[]; + __namedargs__: { [key: string]: BaseTypeSet }; +}>; + +export type $expr_Operator< + // Name extends string = string, + // OpKind extends OperatorKind = OperatorKind, + // Args extends TypeSet[] = TypeSet[], + // ReturnType extends TypeSet = TypeSet, + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Operator; + __name__: string; + __opkind__: OperatorKind; + __args__: TypeSet[]; +}>; + +interface OverloadFuncArgDef { + typeId: string; + optional?: boolean; + setoftype?: boolean; + variadic?: boolean; +} + +interface OverloadFuncDef { + kind?: string; + args: OverloadFuncArgDef[]; + namedArgs?: { [key: string]: OverloadFuncArgDef }; + returnTypeId: string; + returnTypemod?: "SetOfType" | "OptionalType"; + preservesOptionality?: boolean; +} + +function mapLiteralToTypeSet(literals: any[]): TypeSet[]; +function mapLiteralToTypeSet(literals: { [key: string]: any }): { + [key: string]: TypeSet; +}; +function mapLiteralToTypeSet(literals: any[] | { [key: string]: any }) { + if (Array.isArray(literals)) { + return literals.map((lit) => (lit != null ? literalToTypeSet(lit) : lit)); + } + const obj: { [key: string]: TypeSet } = {}; + for (const key of Object.keys(literals)) { + obj[key] = + literals[key] != null ? literalToTypeSet(literals[key]) : literals[key]; + } + return obj; +} + +export function $resolveOverload( + funcName: string, + args: any[], + typeSpec: introspect.Types, + funcDefs: OverloadFuncDef[], +) { + const positionalArgs: (TypeSet | undefined)[] = []; + let namedArgs: { [key: string]: TypeSet } | undefined; + if (args.length) { + if (args[0] !== undefined) { + try { + positionalArgs.push(literalToTypeSet(args[0])); + } catch { + // first arg is not a expr or literal type, so assume named args object + namedArgs = mapLiteralToTypeSet(args[0] as object); + } + } else { + positionalArgs.push(undefined); + } + positionalArgs.push(...mapLiteralToTypeSet(args.slice(1))); + } + + for (const def of funcDefs) { + const resolvedOverload = _tryOverload( + funcName, + positionalArgs, + namedArgs, + typeSpec, + def, + ); + if (resolvedOverload !== null) { + return resolvedOverload; + } + } + + throw new Error( + `No function overload found for ${ + funcName.includes("::") + ? `'e.${funcName.split("::").join(".")}()'` + : `operator '${funcName}'` + } with args: ${[...positionalArgs, ...Object.values(namedArgs ?? {})] + .filter(Boolean) + .map( + (arg) => + `Element: ${arg!.__element__.__name__} (${arg!.__cardinality__})`, + ) + .join(", ")}`, + ); +} + +const ANYTYPE_ARG = Symbol(); + +function _tryOverload( + funcName: string, + args: (BaseTypeSet | undefined)[], + namedArgs: { [key: string]: BaseTypeSet } | undefined, + typeSpec: introspect.Types, + funcDef: OverloadFuncDef, +): { + kind?: string; + returnType: BaseType; + cardinality: Cardinality; + args: BaseTypeSet[]; + namedArgs: { [key: string]: BaseTypeSet }; +} | null { + if ( + (funcDef.namedArgs === undefined && namedArgs !== undefined) || + (namedArgs === undefined && + funcDef.namedArgs && + Object.values(funcDef.namedArgs).some((arg) => !arg.optional)) + ) { + return null; + } + + const lastParamVariadic = funcDef.args[funcDef.args.length - 1]?.variadic; + if (!lastParamVariadic && args.length > funcDef.args.length) { + return null; + } + + const paramCardinalities: [Cardinality, ...Cardinality[]] = [Cardinality.One]; + + if (namedArgs) { + for (const [key, value] of Object.entries(namedArgs)) { + const argDef = funcDef.namedArgs?.[key]; + if ( + !argDef || + !compareType(typeSpec, argDef.typeId, value.__element__).match + ) { + return null; + } + + paramCardinalities.push( + argDef.setoftype + ? funcDef.preservesOptionality + ? cardutil.overrideUpperBound(value.__cardinality__, "One") + : Cardinality.One + : argDef.optional + ? cardutil.overrideLowerBound(value.__cardinality__, "One") + : value.__cardinality__, + ); + } + } + + let positionalArgs: BaseTypeSet[] = []; + + let returnAnytype: BaseType | undefined; + let needsAnytypeReplacement = false; + + for (let i = 0; i < funcDef.args.length; i++) { + const argDef = funcDef.args[i]!; + const arg = args[i]; + + if (arg === undefined) { + if (!argDef.optional) { + return null; + } + + if (i < args.length) { + // arg is explicitly undefined, inject empty set + const argTypeName = typeSpec.get(argDef.typeId).name; + if ( + argTypeName.includes("anytype") || + argTypeName.includes("std::anypoint") + ) { + if (!returnAnytype) { + positionalArgs.push(ANYTYPE_ARG as any); + needsAnytypeReplacement = true; + } else { + positionalArgs.push(cast(returnAnytype, null)); + } + } else { + const argType = makeType(typeSpec, argDef.typeId, literal); + positionalArgs.push(cast(argType, null)); + } + } + } else { + const { match, anytype } = compareType( + typeSpec, + argDef.typeId, + arg.__element__, + ); + + if (!match) { + return null; + } + if (!returnAnytype && anytype) { + returnAnytype = anytype; + } + + positionalArgs.push( + ...(argDef.variadic ? (args.slice(i) as BaseTypeSet[]) : [arg]), + ); + if (argDef.setoftype) { + paramCardinalities.push( + funcDef.preservesOptionality + ? cardutil.overrideUpperBound(arg.__cardinality__, "One") + : Cardinality.One, + ); + } else { + const card = argDef.variadic + ? cardutil.multiplyCardinalitiesVariadic( + (args.slice(i) as BaseTypeSet[]).map( + (el) => el.__cardinality__, + ) as [Cardinality, ...Cardinality[]], + ) + : arg.__cardinality__; + + paramCardinalities.push( + argDef.optional ? cardutil.overrideLowerBound(card, "One") : card, + ); + } + } + } + + let cardinality: Cardinality; + if (funcName === "if_else") { + cardinality = cardutil.multiplyCardinalities( + cardutil.orCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[2]!.__cardinality__, + ), + positionalArgs[1]!.__cardinality__, + ); + } else if (funcName === "std::assert_exists") { + cardinality = cardutil.overrideLowerBound( + positionalArgs[0]!.__cardinality__, + "One", + ); + } else if (funcName === "union") { + cardinality = cardutil.mergeCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[1]!.__cardinality__, + ); + } else if (funcName === "??") { + cardinality = cardutil.coalesceCardinalities( + positionalArgs[0]!.__cardinality__, + positionalArgs[1]!.__cardinality__, + ); + } else if (funcName === "distinct") { + cardinality = positionalArgs[0]!.__cardinality__; + } else { + cardinality = + funcDef.returnTypemod === "SetOfType" + ? Cardinality.Many + : cardutil.multiplyCardinalitiesVariadic(paramCardinalities); + + if ( + funcDef.returnTypemod === "OptionalType" && + !funcDef.preservesOptionality + ) { + cardinality = cardutil.overrideLowerBound(cardinality, "Zero"); + } + } + + if (needsAnytypeReplacement) { + if (!returnAnytype) { + throw new Error(`could not resolve anytype for ${funcName}`); + } + positionalArgs = positionalArgs.map((arg) => + (arg as any) === ANYTYPE_ARG ? cast(returnAnytype!, null) : arg, + ); + } + + return { + kind: funcDef.kind, + returnType: makeType( + typeSpec, + funcDef.returnTypeId, + literal, + returnAnytype, + ), + cardinality, + args: positionalArgs, + namedArgs: namedArgs ?? {}, + }; +} + +const nameRemapping: { [key: string]: string } = { + "std::int16": "std::number", + "std::int32": "std::number", + "std::int64": "std::number", + "std::float32": "std::number", + "std::float64": "std::number", +}; +const descendantCache = new Map(); +function getDescendantNames(typeSpec: introspect.Types, typeId: string) { + if (descendantCache.has(typeId)) { + return descendantCache.get(typeId)!; + } + const descendants: string[] = [ + ...new Set( + [...typeSpec.values()] + .filter( + (type) => + type.kind === "scalar" && + type.bases.some(({ id }) => id === typeId), + ) + .flatMap((type) => + type.is_abstract + ? getDescendantNames(typeSpec, type.id) + : [nameRemapping[type.name]!, type.name], + ), + ), + ]; + descendantCache.set(typeId, descendants); + return descendants; +} + +function compareType( + typeSpec: introspect.Types, + typeId: string, + arg: BaseType, +): { match: boolean; anytype?: BaseType } { + const type = typeSpec.get(typeId); + + if (type.name === "anytype") { + return { match: true, anytype: arg }; + } + + if (type.name === "anyobject") { + return { match: arg.__kind__ === TypeKind.object, anytype: arg }; + } + + if (type.name === "std::anypoint") { + const descendants = getDescendantNames(typeSpec, typeId); + if (descendants.includes(arg.__name__)) { + return { match: true, anytype: arg }; + } + } + + if (type.name === "std::anyenum") { + return { match: arg.__kind__ === TypeKind.enum }; + } + + if (type.kind === "scalar") { + arg = (arg as any).__casttype__ ?? arg; + return { + match: + (arg.__kind__ === TypeKind.scalar || arg.__kind__ === TypeKind.enum) && + (arg.__name__ === type.name || + isImplicitlyCastableTo(arg.__name__, type.name)), + }; + } + if (type.kind === "array") { + if (arg.__kind__ === TypeKind.array) { + return compareType( + typeSpec, + type.array_element_id, + (arg as any as ArrayType).__element__ as BaseType, + ); + } + } + if (type.kind === "range") { + if (arg.__kind__ === TypeKind.range) { + return compareType( + typeSpec, + type.range_element_id, + (arg as any as RangeType).__element__ as BaseType, + ); + } + } + if (type.kind === "multirange") { + if (arg.__kind__ === TypeKind.multirange) { + return compareType( + typeSpec, + type.multirange_element_id, + (arg as any as MultiRangeType).__element__ as BaseType, + ); + } + } + if (type.kind === "object") { + if (arg.__kind__ !== TypeKind.object) return { match: false }; + + const objectArg = arg as ObjectType; + let match = true; + + // shape comparison + for (const ptr of type.pointers) { + if (objectArg.__pointers__[ptr.name]) { + const argPtr = objectArg.__pointers__[ptr.name]!; + const ptrTarget = typeSpec.get(ptr.target_id); + if ( + ptrTarget.name !== argPtr.target.__name__ || + ptr.card !== argPtr.cardinality + ) { + match = false; + } + } + } + + return { + match, + }; + } + if (type.kind === "tuple") { + const items = + arg.__kind__ === TypeKind.tuple + ? (arg as any).__items__ + : arg.__kind__ === TypeKind.namedtuple + ? (arg as any).__shape__ + : null; + if (items) { + const keys = Object.keys(items); + + if (keys.length === type.tuple_elements.length) { + let anytype: BaseType | undefined; + for (let i = 0; i < keys.length; i++) { + if (keys[i] !== type.tuple_elements[i]!.name) { + return { match: false }; + } + const { match: m, anytype: a } = compareType( + typeSpec, + type.tuple_elements[i]!.target_id, + (items as any)[keys[i]!], + ); + if (!m) { + return { match: false }; + } + if (a) anytype = a; + } + return { match: true, anytype }; + } + } + } + + return { match: false }; +} diff --git a/starters/features/gel/dbschema/edgeql-js/future.ts b/starters/features/gel/dbschema/edgeql-js/future.ts new file mode 100644 index 00000000000..c03f1d4c86a --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/future.ts @@ -0,0 +1,6 @@ +// GENERATED by @gel/generate v0.6.4 + +export const future = { + polymorphismAsDiscriminatedUnions: false, + strictTypeNames: false, +} as const; diff --git a/starters/features/gel/dbschema/edgeql-js/globals.ts b/starters/features/gel/dbschema/edgeql-js/globals.ts new file mode 100644 index 00000000000..e2fd1ff8230 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/globals.ts @@ -0,0 +1,29 @@ +// GENERATED by @gel/generate v0.6.4 + +import { type Cardinality, ExpressionKind } from "gel/dist/reflection/index"; +import type { Expression, BaseType } from "./typesystem"; +import { $expressionify } from "./path"; + +export function makeGlobal< + // Name extends string, + Type extends BaseType, + Card extends Cardinality, +>(name: string, type: Type, card: Card): $expr_Global { + return $expressionify({ + __name__: name, + __element__: type, + __cardinality__: card, + __kind__: ExpressionKind.Global, + }); +} + +export type $expr_Global< + // Name extends string = string, + Type extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> = Expression<{ + __name__: string; + __element__: Type; + __cardinality__: Card; + __kind__: ExpressionKind.Global; +}>; diff --git a/starters/features/gel/dbschema/edgeql-js/group.ts b/starters/features/gel/dbschema/edgeql-js/group.ts new file mode 100644 index 00000000000..6341ca2057e --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/group.ts @@ -0,0 +1,350 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { + Expression, + ObjectType, + ObjectTypeSet, + TypeSet, + BaseType, + $scopify, + PropertyDesc, + LinkDesc, +} from "./typesystem"; +import { + Cardinality, + ExpressionKind, + TypeKind, +} from "gel/dist/reflection/index"; +import { makeType } from "./hydrate"; + +import { $expressionify, $getScopedExpr } from "./path"; +import type { $FreeObjectλShape, $str } from "./modules/std"; +import { spec } from "./__spec__"; +import { literal } from "./literal"; +import { resolveShapeElement } from "./select"; +import type { + normaliseShape, + // normaliseElement, + objectTypeToSelectShape, +} from "./select"; + +type SingletonSet = Expression< + TypeSet +>; +type SimpleGroupElements = { [k: string]: SingletonSet }; +type GroupModifiers = { by: SimpleGroupElements }; +type NestedGroupElements = { + [k: string]: SingletonSet | GroupingSet; +}; + +export type GroupingSet = { + __kind__: "groupingset"; + __settype__: "set" | "tuple" | "rollup" | "cube"; + __elements__: NestedGroupElements; + __exprs__: [string, SingletonSet][]; +}; +export function isGroupingSet(arg: any): arg is GroupingSet { + return arg.__kind__ === "groupingset"; +} + +// result is partial to prevent "X is specified more than once" errors +// the return type is a lie, this function returns a grouping set +// but it pretends to return a SimpleGroupElements +// to make the static computatation of `key` easier +const makeGroupingSet = + (prefix: string) => + (grps: T): { [k in keyof T]?: T[k] } => { + const seenKeys = new Map(); + const unfiltered = Object.entries(grps as NestedGroupElements).flatMap( + ([k, grp]) => + isGroupingSet(grp) + ? grp.__exprs__ + : ([[k, grp]] as [string, SingletonSet][]), + ); + const filtered = unfiltered.filter(([k, expr]) => { + if (!seenKeys.has(k)) { + seenKeys.set(k, expr); + return true; + } + + if (expr !== seenKeys.get(k)) { + throw new Error( + `Cannot override pre-existing expression with key "${k}"`, + ); + } + + return false; + }); + + return { + [`${Math.round(1000000 * Math.random())}___`]: { + __kind__: "groupingset", + __settype__: prefix, + __elements__: grps, + __exprs__: filtered, + } as GroupingSet, + } as any; + }; +const set = makeGroupingSet("set"); +const tuple = makeGroupingSet("tuple"); +const rollup = makeGroupingSet("rollup"); +const cube = makeGroupingSet("cube"); + +const setFuncs = { set, tuple, rollup, cube }; + +export type $expr_Group< + Expr extends ObjectTypeSet = ObjectTypeSet, + Mods extends GroupModifiers = GroupModifiers, + Shape extends object = { id: true }, +> = Expression<{ + __element__: ObjectType< + "std::FreeObject", + $FreeObjectλShape & { + // adding free shape elements into __pointers__ + // because objectTypeToSelectShape doesn't allow shapes on computeds + // and setToTsType can't handle that currently + grouping: PropertyDesc<$str, Cardinality.Many, false, true, true, false>; + key: LinkDesc< + ObjectType< + "std::FreeObject", + { + [k in keyof Mods["by"]]: Mods["by"][k]["__element__"] extends ObjectType + ? never + : PropertyDesc< + Mods["by"][k]["__element__"], + Cardinality.AtMostOne + >; + } + >, + Cardinality.One, + // todo check if this can be fixed better + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + {}, + false, + true, + true, + false + >; + elements: LinkDesc< + Expr["__element__"], + Cardinality.Many, + // todo check if this can be fixed better + // eslint-disable-next-line @typescript-eslint/no-empty-object-type + {}, + false, + true, + true, + false + >; + }, + { + // grouping: true; + // key: {[k in keyof Mods["by"]]: true}; + // elements: normaliseShape; + grouping: TypeSet<$str, Cardinality.Many>; + key: Expression<{ + __element__: ObjectType< + "std::FreeObject", + $FreeObjectλShape, + { + [k in keyof Mods["by"]]: Expression<{ + __element__: Mods["by"][k]["__element__"]; + __cardinality__: Cardinality.AtMostOne; + }>; + } + >; + __cardinality__: Cardinality.One; + }>; + elements: Expression<{ + __element__: ObjectType< + Expr["__element__"]["__name__"], + Expr["__element__"]["__pointers__"], + // Omit, "by"> + normaliseShape + >; + __cardinality__: Cardinality.Many; + }>; + } + >; + __cardinality__: Cardinality.Many; + // bit of a lie, this is a GroupingSet at runtime + __modifiers__: Mods; + __kind__: ExpressionKind.Group; + __expr__: ObjectTypeSet; + __scope__: ObjectTypeSet; +}>; + +// type modifierKeys = "by"; +type noUndefined = T extends undefined ? never : T; +type groupFunc = < + Expr extends ObjectTypeSet, + // Shape extends GroupModifiers + // Grps extends SimpleGroupElements, + Shape extends { by?: SimpleGroupElements } & objectTypeToSelectShape< + Expr["__element__"] + >, + // Mods extends GroupModifiers = {by: Shape["by"]} +>( + expr: Expr, + getter: (arg: $scopify) => Readonly, +) => $expr_Group< + Expr, + { by: noUndefined }, + normaliseShape +>; + +const groupFunc: groupFunc = (expr, getter) => { + const { shape, scope, modifiers } = resolveShape(getter, expr); + // const scope = $getScopedExpr(expr as any); + // const rawGroupings = getter(scope); + const groupSet = tuple(modifiers.by); + + // only one key in object returned from makeGroupingSet + const key = Object.keys(groupSet)[0]!; + const grouping = groupSet[key] as any as GroupingSet; + const keyShape: any = {}; + const keyPointers: any = {}; + const keyShapeElement: any = {}; + + for (const [k, e] of grouping.__exprs__) { + keyShape[k] = $expressionify({ + __element__: e.__element__, + __cardinality__: Cardinality.AtMostOne, + } as any); + keyPointers[k] = { + __kind__: "property", + target: e.__element__, + cardinality: Cardinality.AtMostOne, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as PropertyDesc; + keyShapeElement[k] = true; + } + + const $FreeObject = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::FreeObject")!.id, + literal, + ); + + const str = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::str")!.id, + literal, + ); + + return $expressionify({ + __element__: { + ...$FreeObject, + __name__: "std::FreeObject", + __pointers__: { + ...($FreeObject as any).__pointers__, + __name__: "std::FreeObject", + grouping: { + __kind__: "property", + target: str, + cardinality: Cardinality.Many, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as PropertyDesc, + key: { + __kind__: "link", + target: { + ...$FreeObject, + __name__: "std::FreeObject", + __pointers__: { + ...($FreeObject as any).__pointers__, + ...keyPointers, + }, + __shape__: keyShape, + }, + properties: {}, + cardinality: Cardinality.One, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as LinkDesc, + + elements: { + __kind__: "link", + target: expr.__element__, + cardinality: Cardinality.Many, + properties: {}, + exclusive: false, + computed: false, + readonly: false, + hasDefault: false, + } as LinkDesc, + }, + __shape__: { + grouping: $expressionify({ + __element__: str, + __cardinality__: Cardinality.Many, + } as any), + key: $expressionify({ + __element__: { + ...$FreeObject, + __shape__: keyShape, + }, + __cardinality__: Cardinality.One, + } as any), + elements: $expressionify({ + __element__: { ...expr.__element__, __shape__: shape } as any, + __cardinality__: Cardinality.Many, + } as any), + }, + }, + + __cardinality__: Cardinality.Many, + __expr__: expr, + __modifiers__: { by: grouping }, + __kind__: ExpressionKind.Group, + __scope__: scope, + }) as any; +}; +Object.assign(groupFunc, setFuncs); + +function resolveShape( + shapeGetter: ((scope: any) => any) | any, + expr: TypeSet, +): { modifiers: { by: SimpleGroupElements }; shape: any; scope: TypeSet } { + const modifiers: { by: SimpleGroupElements } = {} as any; + const shape: any = {}; + + // get scoped object if expression is objecttypeset + const scope = $getScopedExpr(expr as any) as ObjectTypeSet; + + // execute getter with scope + const selectShape = + typeof shapeGetter === "function" ? shapeGetter(scope) : shapeGetter; + + for (const [key, value] of Object.entries(selectShape)) { + // handle modifier keys + if (key === "by") { + modifiers[key] = value as any; + } else { + // for scalar expressions, scope === expr + // shape keys are not allowed + if (expr.__element__.__kind__ !== TypeKind.object) { + throw new Error( + `Invalid select shape key '${key}' on scalar expression, ` + + `only modifiers are allowed (filter, order_by, offset and limit)`, + ); + } + shape[key] = resolveShapeElement(key, value, scope); + } + } + if (Object.keys(shape).length === 0) { + shape.id = true; + } + if (!modifiers.by) { + throw new Error("Must provide a `by` key in `e.group`"); + } + return { shape, modifiers, scope }; +} +export const group: typeof setFuncs & groupFunc = groupFunc as any; diff --git a/starters/features/gel/dbschema/edgeql-js/hydrate.ts b/starters/features/gel/dbschema/edgeql-js/hydrate.ts new file mode 100644 index 00000000000..42a2ef2b093 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/hydrate.ts @@ -0,0 +1,350 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { $ } from "gel"; + +import type { + BaseType, + ObjectType, + ObjectTypePointers, + LinkDesc, + PropertyDesc, + TupleType, +} from "./typesystem"; + +import { util, TypeKind } from "gel/dist/reflection/index"; +import type { typeutil } from "gel/dist/reflection/index"; + +const typeCache = new Map(); + +const _linkProps = Symbol(); + +function applySpec( + spec: $.introspect.Types, + type: $.introspect.ObjectType, + shape: any, + seen: Set, + literal: any, +): void { + const allPointers = [ + ...type.pointers, + ...type.backlinks, + ...type.backlink_stubs, + ]; + for (const ptr of allPointers) { + if (seen.has(ptr.name)) { + continue; + } + seen.add(ptr.name); + + if (ptr.kind === "link") { + shape[ptr.name] = { + __kind__: "link", + cardinality: ptr.card, + exclusive: ptr.is_exclusive, + computed: ptr.is_computed, + readonly: ptr.is_readonly, + } as LinkDesc; + util.defineGetter(shape[ptr.name], "target", () => + makeType(spec, ptr.target_id, literal), + ); + util.defineGetter(shape[ptr.name], "properties", () => { + if (!shape[ptr.name][_linkProps]) { + const linkProperties: { [k: string]: any } = (shape[ptr.name][ + _linkProps + ] = {}); + for (const linkProp of ptr.pointers ?? []) { + // We only support "link properties" in Gel, currently. + if (linkProp.kind !== "property") { + return; + } + // No use for them reflected, at the moment. + if (linkProp.name === "source" || linkProp.name === "target") { + return; + } + + const linkPropObject: any = { + __kind__: "property", + }; + linkPropObject.cardinality = linkProp.card; + util.defineGetter(linkPropObject, "target", () => { + return makeType(spec, linkProp.target_id, literal); + }); + linkProperties[linkProp.name] = linkPropObject; + } + } + return shape[ptr.name][_linkProps]; + }); + } else if (ptr.kind === "property") { + shape[ptr.name] = { + __kind__: "property", + cardinality: ptr.card, + exclusive: ptr.is_exclusive, + computed: ptr.is_computed, + readonly: ptr.is_readonly, + } as PropertyDesc; + util.defineGetter(shape[ptr.name], "target", () => + makeType(spec, ptr.target_id, literal), + ); + } + } +} + +function applySpecToAncestors( + spec: $.introspect.Types, + ancestors: { + id: $.introspect.UUID; + }[], + shape: any, + seen: Set, + literal: any, +) { + for (const anc of ancestors) { + const ancType = spec.get(anc.id); + if (ancType.kind === "object" || ancType.kind === "scalar") { + ancestors.push(...ancType.bases); + } + if (ancType.kind !== "object") { + throw new Error(`Not an object: ${anc.id}`); + } + applySpec(spec, ancType, shape, seen, literal); + } +} + +function getCommonPointers(arr: Record[]): Record { + if (arr.length === 0) return {}; + + const firstObj = arr[0]!; + const commonPointers: Record = {}; + + Object.keys(firstObj).forEach((key) => { + const value = firstObj[key]; + const isCommon = arr.every((obj) => obj[key] !== undefined); + if (isCommon) { + commonPointers[key] = value; + } + }); + + return commonPointers; +} + +export function makeType( + spec: $.introspect.Types, + id: string, + // should be (type: any, val: any) => any, but causes + // 'Type instantiation is excessively deep and possibly infinite' error + // in typescript 4.5 + literal: any, + anytype?: BaseType, +): T { + const type = spec.get(id); + + if (type.name === "anytype" || type.name === "std::anypoint") { + if (anytype) return anytype as unknown as T; + throw new Error("anytype not provided"); + } + + if (typeCache.has(id)) { + return typeCache.get(id) as T; + } + + const obj: any = {}; + obj.__name__ = type.name; + + if (type.kind === "object") { + obj.__kind__ = TypeKind.object; + + let pointers: Record = {}; + const seen = new Set(); + applySpec(spec, type, pointers, seen, literal); + const ancestors = [...type.bases]; + + if (type.union_of.length) { + const unionPointers = Array(type.union_of.length) + .fill(null) + .map(() => ({})); + + type.union_of.forEach(({ id }, index) => { + const seen = new Set(); + const unionType = spec.get(id); + + if (unionType.kind === "object") { + applySpec(spec, unionType, unionPointers[index], seen, literal); + const ancestors = [...unionType.bases]; + applySpecToAncestors( + spec, + ancestors, + unionPointers[index], + seen, + literal, + ); + } + }); + + const commonPointers = getCommonPointers(unionPointers); + pointers = { ...pointers, ...commonPointers }; + } else { + applySpecToAncestors(spec, ancestors, pointers, seen, literal); + } + + obj.__pointers__ = pointers; + obj.__shape__ = {}; + typeCache.set(id, obj); + return obj; + } else if (type.kind === "scalar") { + const scalarObj = type.is_abstract + ? {} + : type.enum_values + ? {} + : // : type.name === "std::json" + // ? (((val: any) => { + // return literal(scalarObj, JSON.stringify(val)); + // }) as any) + (((val: any) => { + return literal(scalarObj, val); + }) as any); + + if (type.enum_values) { + scalarObj.__kind__ = TypeKind.enum; + scalarObj.__values__ = type.enum_values; + for (const val of type.enum_values) { + Object.defineProperty(scalarObj, val, { + get() { + return literal(scalarObj, val); + }, + }); + } + } else { + scalarObj.__kind__ = TypeKind.scalar; + } + scalarObj.__name__ = type.name; + + if (type.cast_type) { + scalarObj.__casttype__ = makeType(spec, type.cast_type, literal); + } + typeCache.set(id, scalarObj); + return scalarObj; + } else if (type.kind === "array") { + obj.__kind__ = TypeKind.array; + util.defineGetter(obj, "__element__", () => { + return makeType(spec, type.array_element_id, literal, anytype); + }); + util.defineGetter(obj, "__name__", () => { + return `array<${obj.__element__.__name__}>`; + }); + return obj; + } else if (type.kind === "tuple") { + if (type.tuple_elements[0]!.name === "0") { + // unnamed tuple + obj.__kind__ = TypeKind.tuple; + + util.defineGetter(obj, "__items__", () => { + return type.tuple_elements.map((el) => + makeType(spec, el.target_id, literal, anytype), + ) as any; + }); + util.defineGetter(obj, "__name__", () => { + return `tuple<${obj.__items__ + .map((item: any) => item.__name__) + .join(", ")}>`; + }); + return obj; + } else { + // named tuple + obj.__kind__ = TypeKind.namedtuple; + + util.defineGetter(obj, "__shape__", () => { + const shape: any = {}; + for (const el of type.tuple_elements) { + shape[el.name] = makeType(spec, el.target_id, literal, anytype); + } + return shape; + }); + util.defineGetter(obj, "__name__", () => { + return `tuple<${Object.entries(obj.__shape__) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`; + }); + return obj; + } + } else if (type.kind === "range") { + obj.__kind__ = TypeKind.range; + util.defineGetter(obj, "__element__", () => { + return makeType(spec, type.range_element_id, literal, anytype); + }); + util.defineGetter(obj, "__name__", () => { + return `range<${obj.__element__.__name__}>`; + }); + return obj; + } else if (type.kind === "multirange") { + obj.__kind__ = TypeKind.multirange; + util.defineGetter(obj, "__element__", () => { + return makeType(spec, type.multirange_element_id, literal, anytype); + }); + util.defineGetter(obj, "__name__", () => { + return `multirange<${obj.__element__.__name__}>`; + }); + return obj; + } else { + throw new Error(`Invalid type: ${JSON.stringify(type, null, 2)}`); + } +} +export type mergeObjectShapes< + A extends ObjectTypePointers, + B extends ObjectTypePointers, +> = typeutil.flatten<{ + [k in keyof A & keyof B]: A[k] extends B[k] // possible performance issue? + ? B[k] extends A[k] + ? A[k] + : never + : never; +}>; + +export type mergeObjectTypes< + A extends ObjectType | undefined, + B extends ObjectType | undefined, +> = A extends ObjectType + ? B extends ObjectType + ? ObjectType< + `${A["__name__"]} UNION ${B["__name__"]}`, + mergeObjectShapes, + null + > + : A + : B extends ObjectType + ? B + : undefined; + +export function $mergeObjectTypes( + a: A, + b: B, +): mergeObjectTypes { + const obj = { + __kind__: TypeKind.object, + __name__: `${a.__name__} UNION ${b.__name__}`, + get __pointers__() { + const merged: any = {}; + for (const [akey, aitem] of Object.entries(a.__pointers__)) { + if (!b.__pointers__[akey]) continue; + + const bitem = b.__pointers__[akey]!; + if (aitem.cardinality !== bitem.cardinality) continue; + // names must reflect full type + if (aitem.target.__name__ !== bitem.target.__name__) continue; + merged[akey] = aitem; + } + return merged; + }, + __shape__: {}, + }; + return obj as any; +} + +export function $mergeTupleTypes( + a: A, + b: B, +): TupleType { + if (a.__items__.length !== b.__items__.length) { + throw new Error("Incompatible tuple types; lengths differ."); + } + return {} as TupleType; +} diff --git a/starters/features/gel/dbschema/edgeql-js/imports.ts b/starters/features/gel/dbschema/edgeql-js/imports.ts new file mode 100644 index 00000000000..fd3bf062e15 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/imports.ts @@ -0,0 +1,6 @@ +// GENERATED by @gel/generate v0.6.4 + +export * as gel from "gel"; +export { spec } from "./__spec__"; +export * as syntax from "./syntax"; +export * as castMaps from "./castMaps"; diff --git a/starters/features/gel/dbschema/edgeql-js/index.ts b/starters/features/gel/dbschema/edgeql-js/index.ts new file mode 100644 index 00000000000..03db2c3a6d2 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/index.ts @@ -0,0 +1,42 @@ +// GENERATED by @gel/generate v0.6.4 + +export * from "./external"; +export { createClient } from "gel"; +import * as $ from "./reflection"; +import * as $syntax from "./syntax"; +import * as $op from "./operators"; +import _std from "./modules/std"; +import _cfg from "./modules/cfg"; +import _schema from "./modules/schema"; +import _sys from "./modules/sys"; +import _default from "./modules/default"; + +const ExportDefault: typeof _std & + typeof _default & + $.util.OmitDollarPrefixed & + typeof $op & { + std: typeof _std; + cfg: typeof _cfg; + schema: typeof _schema; + sys: typeof _sys; + default: typeof _default; + } = { + ..._std, + ..._default, + ...$.util.omitDollarPrefixed($syntax), + ...$op, + std: _std, + cfg: _cfg, + schema: _schema, + sys: _sys, + default: _default, +}; +const Cardinality = $.Cardinality; +type Cardinality = $.Cardinality; +export type Set< + Type extends $.BaseType, + Card extends $.Cardinality = $.Cardinality.Many, +> = $.TypeSet; + +export default ExportDefault; +export { Cardinality }; diff --git a/starters/features/gel/dbschema/edgeql-js/insert.ts b/starters/features/gel/dbschema/edgeql-js/insert.ts new file mode 100644 index 00000000000..1db9580f0cd --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/insert.ts @@ -0,0 +1,296 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + Cardinality, + ExpressionKind, + type typeutil, + TypeKind, +} from "gel/dist/reflection/index"; +import type { + Expression, + LinkDesc, + ObjectTypeSet, + ObjectTypePointers, + PropertyDesc, + stripBacklinks, + stripNonInsertables, + $scopify, + stripSet, + TypeSet, + ObjectType, + NamedTupleType, +} from "./typesystem"; +import type { pointerToAssignmentExpression } from "./casting"; +import { $expressionify, $getScopedExpr } from "./path"; +import { cast } from "./cast"; +import { set } from "./set"; +import { literal } from "./literal"; +import { $getTypeByName } from "./literal"; +import type { $expr_PathNode } from "./path"; +import type { $Object } from "./modules/std"; +import type { scalarLiterals } from "./castMaps"; + +export type pointerIsOptional = + T["cardinality"] extends + | Cardinality.Many + | Cardinality.Empty + | Cardinality.AtMostOne + ? true + : false; + +export type InsertShape = typeutil.flatten< + RawInsertShape +>; + +export type RawInsertShape = + // short-circuit infinitely deep + ObjectType extends El + ? never + : typeutil.stripNever< + stripNonInsertables> + > extends infer Shape + ? Shape extends ObjectTypePointers + ? typeutil.addQuestionMarks<{ + [k in keyof Shape]: + | pointerToAssignmentExpression + | (pointerIsOptional extends true + ? undefined | null + : never) + | (Shape[k]["hasDefault"] extends true ? undefined : never); + }> & { [k in `@${string}`]: TypeSet | scalarLiterals } + : never + : never; + +interface UnlessConflict { + on: TypeSet | null; + else?: TypeSet; +} + +type InsertBaseExpression = { + __kind__: ExpressionKind.Insert; + __element__: Root["__element__"]; + __cardinality__: Cardinality.One; + __expr__: stripSet; + __shape__: any; +}; +export type $expr_Insert< + // Root extends $expr_PathNode = $expr_PathNode + El extends ObjectType = ObjectType, + // Conflict = UnlessConflict | null + // Shape extends InsertShape = any +> = Expression<{ + __kind__: ExpressionKind.Insert; + __element__: El; + __cardinality__: Cardinality.One; + __expr__: $expr_PathNode; + __shape__: InsertShape; + + unlessConflict(): $expr_InsertUnlessConflict< + El, + // Expression<{ + // __kind__: ExpressionKind.Insert; + // __element__: El; + // __cardinality__: Cardinality.One; + // __expr__: $expr_PathNode; + // __shape__: InsertShape; + // }>, + { on: null } + >; + unlessConflict( + conflictGetter: (scope: $scopify) => Conflict, + ): $expr_InsertUnlessConflict< + El, + // Expression<{ + // __kind__: ExpressionKind.Insert; + // __element__: El; + // __cardinality__: Cardinality.One; + // __expr__: $expr_PathNode; + // __shape__: InsertShape; + // }>, + Conflict + >; +}>; + +export type $expr_InsertUnlessConflict< + El extends ObjectType = ObjectType, + // Root extends InsertBaseExpression = InsertBaseExpression, + Conflict extends UnlessConflict = UnlessConflict, +> = Expression<{ + __kind__: ExpressionKind.InsertUnlessConflict; + __element__: Conflict["else"] extends TypeSet + ? Conflict["else"]["__element__"]["__name__"] extends El["__name__"] + ? El + : $Object + : El; + __cardinality__: Conflict["else"] extends TypeSet + ? Conflict["else"]["__cardinality__"] + : Cardinality.AtMostOne; + __expr__: InsertBaseExpression; + __conflict__: Conflict; +}>; + +function unlessConflict( + this: $expr_Insert, + conflictGetter?: (scope: TypeSet) => UnlessConflict, +) { + const expr: any = { + __kind__: ExpressionKind.InsertUnlessConflict, + __element__: this.__element__, + __cardinality__: Cardinality.AtMostOne, + __expr__: this, + // __conflict__: Conflict; + }; + + if (!conflictGetter) { + expr.__conflict__ = { on: null }; + return $expressionify(expr); + } else { + const scopedExpr = $getScopedExpr(this.__expr__); + const conflict = conflictGetter(scopedExpr); + expr.__conflict__ = conflict; + if (conflict.else) { + expr.__cardinality__ = conflict.else.__cardinality__; + if (this.__element__.__name__ !== conflict.else.__element__.__name__) { + expr.__element__ = $getTypeByName("std::Object"); + } + } + return $expressionify(expr); + } +} + +export function $insertify( + expr: Omit<$expr_Insert, "unlessConflict">, +): $expr_Insert { + (expr as any).unlessConflict = unlessConflict.bind(expr as any); + return expr as any; +} + +export function $normaliseInsertShape( + root: ObjectTypeSet, + shape: { [key: string]: any }, + isUpdate = false, +): { [key: string]: TypeSet | { "+=": TypeSet } | { "-=": TypeSet } } { + const newShape: { + [key: string]: TypeSet | { "+=": TypeSet } | { "-=": TypeSet }; + } = {}; + + const _shape: [string, any][] = + shape.__element__?.__kind__ === TypeKind.namedtuple + ? Object.keys((shape.__element__ as NamedTupleType).__shape__).map( + (key) => [key, shape[key]], + ) + : Object.entries(shape); + for (const [key, _val] of _shape) { + let val = _val; + let setModify: string | null = null; + if (isUpdate && _val != null && typeof _val === "object") { + const valKeys = Object.keys(_val); + if ( + valKeys.length === 1 && + (valKeys[0] === "+=" || valKeys[0] === "-=") + ) { + val = _val[valKeys[0]]; + setModify = valKeys[0]; + } + } + + const pointer = root.__element__.__pointers__[key]; + + // no pointer, not a link property + const isLinkProp = key[0] === "@"; + if (!pointer && !isLinkProp) { + throw new Error( + `Could not find property pointer for ${ + isUpdate ? "update" : "insert" + } shape key: '${key}'`, + ); + } + + // skip undefined vals + if (val === undefined) continue; + + // is val is expression, assign to newShape + if (val?.__kind__) { + // ranges can contain null values, so if the type is 'std::number' + // we need to set the type to the exact number type of the pointer + // so null casts are correct + if ( + val.__kind__ === ExpressionKind.Literal && + val.__element__.__kind__ === TypeKind.range && + val.__element__.__element__.__name__ === "std::number" + ) { + newShape[key] = (literal as any)(pointer?.target, val.__value__); + } else { + newShape[key] = _val; + } + continue; + } + + // handle link props + // after this guard, pointer definitely is defined + if (isLinkProp) { + throw new Error( + `Cannot assign plain data to link property '${key}'. Provide an expression instead.`, + ); + } + // Workaround to tell TypeScript pointer definitely is defined + if (!pointer) { + throw new Error( + "Code will never reach here, but TypeScript cannot determine", + ); + } + + // trying to assign plain data to a link + if (pointer.__kind__ !== "property" && val !== null) { + throw new Error( + `Must provide subquery when assigning to link '${key}' in ${ + isUpdate ? "update" : "insert" + } query.`, + ); + } + + // val is plain data + // key corresponds to pointer or starts with "@" + const isMulti = + pointer.cardinality === Cardinality.AtLeastOne || + pointer.cardinality === Cardinality.Many; + + const wrappedVal = + val === null + ? cast(pointer.target, null) + : isMulti && Array.isArray(val) + ? val.length === 0 + ? cast(pointer.target, null) + : set(...val.map((v) => (literal as any)(pointer.target, v))) + : (literal as any)(pointer.target, val); + newShape[key] = setModify + ? ({ [setModify]: wrappedVal } as any) + : wrappedVal; + } + return newShape; +} + +export function insert( + root: Root, + shape: InsertShape, +): $expr_Insert { + if (typeof shape !== "object") { + throw new Error( + `invalid insert shape.${ + typeof shape === "function" + ? " Hint: Insert shape is expected to be an object, " + + "not a function returning a shape object." + : "" + }`, + ); + } + const expr: any = { + __kind__: ExpressionKind.Insert, + __element__: root.__element__, + __cardinality__: Cardinality.One, + __expr__: root, + __shape__: $normaliseInsertShape(root, shape), + }; + (expr as any).unlessConflict = unlessConflict.bind(expr); + return $expressionify($insertify(expr)) as any; +} diff --git a/starters/features/gel/dbschema/edgeql-js/json.ts b/starters/features/gel/dbschema/edgeql-js/json.ts new file mode 100644 index 00000000000..5878a8fffcf --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/json.ts @@ -0,0 +1,92 @@ +// GENERATED by @gel/generate v0.6.4 + +import { ExpressionKind, TypeKind } from "gel/dist/reflection/index"; +import type { ParamType } from "./typesystem"; +import { encodeB64 } from "gel/dist/primitives/buffer"; +import type { $expr_WithParams } from "./params"; + +function jsonStringify(type: ParamType, val: any): string { + if (type.__kind__ === TypeKind.array) { + if (Array.isArray(val)) { + return `[${val + .map((item) => jsonStringify(type.__element__, item)) + .join()}]`; + } + throw new Error(`Param with array type is not an array`); + } + if (type.__kind__ === TypeKind.tuple) { + if (!Array.isArray(val)) { + throw new Error(`Param with tuple type is not an array`); + } + if (val.length !== type.__items__.length) { + throw new Error( + `Param with tuple type has incorrect number of items. Got ${val.length} expected ${type.__items__.length}`, + ); + } + return `[${val + .map((item, i) => jsonStringify(type.__items__[i]!, item)) + .join()}]`; + } + if (type.__kind__ === TypeKind.namedtuple) { + if (typeof val !== "object") { + throw new Error(`Param with named tuple type is not an object`); + } + if (Object.keys(val).length !== Object.keys(type.__shape__).length) { + throw new Error( + `Param with named tuple type has incorrect number of items. Got ${ + Object.keys(val).length + } expected ${Object.keys(type.__shape__).length}`, + ); + } + return `{${Object.entries(val) + .map(([key, item]) => { + if (!type.__shape__[key]) { + throw new Error( + `Unexpected key in named tuple param: ${key}, expected keys: ${Object.keys( + type.__shape__, + ).join()}`, + ); + } + return `"${key}": ${jsonStringify(type.__shape__[key]!, item)}`; + }) + .join()}}`; + } + if ( + type.__kind__ === TypeKind.scalar + // || type.__kind__ === TypeKind.castonlyscalar + ) { + switch (type.__name__) { + case "std::bigint": + return val.toString(); + case "std::json": + return JSON.stringify(val); + case "std::bytes": + return `"${encodeB64(val)}"`; + case "cfg::memory": + return `"${val.toString()}"`; + default: + return JSON.stringify(val); + } + } + if (type.__kind__ === TypeKind.enum) { + return JSON.stringify(val); + } + throw new Error(`Invalid param type: ${(type as any).__kind__}`); +} + +export function jsonifyComplexParams(expr: any, _args: any) { + if (_args && expr.__kind__ === ExpressionKind.WithParams) { + const args = { ..._args }; + for (const param of (expr as $expr_WithParams).__params__) { + if (param.__isComplex__) { + args[param.__name__] = jsonStringify( + param.__element__ as any, + args[param.__name__], + ); + } + } + + return args; + } + return _args; +} diff --git a/starters/features/gel/dbschema/edgeql-js/literal.ts b/starters/features/gel/dbschema/edgeql-js/literal.ts new file mode 100644 index 00000000000..f8b3d9a3183 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/literal.ts @@ -0,0 +1,48 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { + Expression, + BaseType, + BaseTypeToTsType, + ScalarType, +} from "./typesystem"; + +import { $expressionify } from "./path"; +import { spec } from "./__spec__"; +import { Cardinality, ExpressionKind } from "gel/dist/reflection/index"; +import { makeType } from "./hydrate"; + +export type $expr_Literal = Expression<{ + __element__: Type; + __cardinality__: Cardinality.One; + __kind__: ExpressionKind.Literal; + __value__: any; +}>; + +export function literal< + T extends BaseType, + TsType extends BaseTypeToTsType = BaseTypeToTsType, + ExprType extends $expr_Literal = $expr_Literal, +>(type: T, value: TsType): ExprType { + return $expressionify({ + __element__: type, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Literal, + __value__: value, + }) as ExprType; +} + +export const $nameMapping = new Map([ + ...([...spec.values()].map((type) => [type.name, type.id]) as any), + ["std::number", "00000000-0000-0000-0000-0000000001ff"], +]); + +export function $getType(id: string): (val: any) => $expr_Literal { + return makeType(spec, id, literal) as any; +} + +export function $getTypeByName( + name: string, +): (val: any) => $expr_Literal { + return makeType(spec, $nameMapping.get(name)!, literal) as any; +} diff --git a/starters/features/gel/dbschema/edgeql-js/modules/cfg.ts b/starters/features/gel/dbschema/edgeql-js/modules/cfg.ts new file mode 100644 index 00000000000..e9ab5e3e2c3 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/cfg.ts @@ -0,0 +1,1253 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +import type * as _sys from "./sys"; +export type $AllowBareDDL = { + AlwaysAllow: $.$expr_Literal<$AllowBareDDL>; + NeverAllow: $.$expr_Literal<$AllowBareDDL>; +} & $.EnumType<"cfg::AllowBareDDL", ["AlwaysAllow", "NeverAllow"]>; +const AllowBareDDL: $AllowBareDDL = $.makeType<$AllowBareDDL>( + _.spec, + "50264e27-859e-5d2b-a589-ebb3d8ba4d8c", + _.syntax.literal, +); + +export type $ConnectionTransport = { + TCP: $.$expr_Literal<$ConnectionTransport>; + TCP_PG: $.$expr_Literal<$ConnectionTransport>; + HTTP: $.$expr_Literal<$ConnectionTransport>; + SIMPLE_HTTP: $.$expr_Literal<$ConnectionTransport>; + HTTP_METRICS: $.$expr_Literal<$ConnectionTransport>; + HTTP_HEALTH: $.$expr_Literal<$ConnectionTransport>; +} & $.EnumType< + "cfg::ConnectionTransport", + ["TCP", "TCP_PG", "HTTP", "SIMPLE_HTTP", "HTTP_METRICS", "HTTP_HEALTH"] +>; +const ConnectionTransport: $ConnectionTransport = + $.makeType<$ConnectionTransport>( + _.spec, + "1adbf789-39c3-5070-bc17-776f94d59e46", + _.syntax.literal, + ); + +export type $QueryCacheMode = { + InMemory: $.$expr_Literal<$QueryCacheMode>; + RegInline: $.$expr_Literal<$QueryCacheMode>; + PgFunc: $.$expr_Literal<$QueryCacheMode>; + Default: $.$expr_Literal<$QueryCacheMode>; +} & $.EnumType< + "cfg::QueryCacheMode", + ["InMemory", "RegInline", "PgFunc", "Default"] +>; +const QueryCacheMode: $QueryCacheMode = $.makeType<$QueryCacheMode>( + _.spec, + "7cb23cda-17b8-575c-9561-05e2e9351897", + _.syntax.literal, +); + +export type $QueryStatsOption = { + None: $.$expr_Literal<$QueryStatsOption>; + All: $.$expr_Literal<$QueryStatsOption>; +} & $.EnumType<"cfg::QueryStatsOption", ["None", "All"]>; +const QueryStatsOption: $QueryStatsOption = $.makeType<$QueryStatsOption>( + _.spec, + "258dbe3b-cb49-5713-b9fb-b220c8065c01", + _.syntax.literal, +); + +export type $SMTPSecurity = { + PlainText: $.$expr_Literal<$SMTPSecurity>; + TLS: $.$expr_Literal<$SMTPSecurity>; + STARTTLS: $.$expr_Literal<$SMTPSecurity>; + STARTTLSOrPlainText: $.$expr_Literal<$SMTPSecurity>; +} & $.EnumType< + "cfg::SMTPSecurity", + ["PlainText", "TLS", "STARTTLS", "STARTTLSOrPlainText"] +>; +const SMTPSecurity: $SMTPSecurity = $.makeType<$SMTPSecurity>( + _.spec, + "6dc9f7f4-5b6b-5afc-9e5e-57a6b2f15cbc", + _.syntax.literal, +); + +export type $StoreMigrationSDL = { + AlwaysStore: $.$expr_Literal<$StoreMigrationSDL>; + NeverStore: $.$expr_Literal<$StoreMigrationSDL>; +} & $.EnumType<"cfg::StoreMigrationSDL", ["AlwaysStore", "NeverStore"]>; +const StoreMigrationSDL: $StoreMigrationSDL = $.makeType<$StoreMigrationSDL>( + _.spec, + "43ce9f9e-00cd-5303-a1b3-fea515a046d8", + _.syntax.literal, +); + +export type $memory = $.ScalarType<"cfg::memory", _.gel.ConfigMemory>; +const memory: $.scalarTypeWithConstructor<$memory, string> = $.makeType< + $.scalarTypeWithConstructor<$memory, string> +>(_.spec, "00000000-0000-0000-0000-000000000130", _.syntax.literal); + +export type $ConfigObjectλShape = $.typeutil.flatten< + _std.$BaseObjectλShape & {} +>; +type $ConfigObject = $.ObjectType< + "cfg::ConfigObject", + $ConfigObjectλShape, + null, + [..._std.$BaseObject["__exclusives__"]], + | "cfg::Auth" + | "cfg::DatabaseConfig" + | "cfg::BranchConfig" + | "cfg::Config" + | "cfg::InstanceConfig" + | "cfg::JWT" + | "cfg::Password" + | "cfg::SCRAM" + | "cfg::SMTPProviderConfig" + | "cfg::Trust" + | "cfg::mTLS" +>; +const $ConfigObject = $.makeType<$ConfigObject>( + _.spec, + "d408002f-3891-5b9a-b19c-23589a88998b", + _.syntax.literal, +); + +const ConfigObject: $.$expr_PathNode< + $.TypeSet<$ConfigObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ConfigObject, $.Cardinality.Many), null); + +export type $AbstractConfigλShape = $.typeutil.flatten< + $ConfigObjectλShape & { + default_transaction_access_mode: $.PropertyDesc< + _sys.$TransactionAccessMode, + $.Cardinality.One, + false, + false, + false, + true + >; + session_idle_timeout: $.PropertyDesc< + _std.$duration, + $.Cardinality.One, + false, + false, + false, + true + >; + default_transaction_isolation: $.PropertyDesc< + _sys.$TransactionIsolation, + $.Cardinality.One, + false, + false, + false, + true + >; + default_transaction_deferrable: $.PropertyDesc< + _sys.$TransactionDeferrability, + $.Cardinality.One, + false, + false, + false, + true + >; + session_idle_transaction_timeout: $.PropertyDesc< + _std.$duration, + $.Cardinality.One, + false, + false, + false, + true + >; + query_execution_timeout: $.PropertyDesc< + _std.$duration, + $.Cardinality.One, + false, + false, + false, + false + >; + listen_port: $.PropertyDesc< + _std.$int32, + $.Cardinality.One, + false, + false, + false, + true + >; + listen_addresses: $.PropertyDesc< + _std.$str, + $.Cardinality.Many, + false, + false, + false, + false + >; + current_email_provider_name: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + allow_dml_in_functions: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + allow_bare_ddl: $.PropertyDesc< + $AllowBareDDL, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + store_migration_sdl: $.PropertyDesc< + $StoreMigrationSDL, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + apply_access_policies: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + apply_access_policies_pg: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + allow_user_specified_id: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + simple_scoping: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + warn_old_scoping: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + cors_allow_origins: $.PropertyDesc< + _std.$str, + $.Cardinality.Many, + false, + false, + false, + false + >; + auto_rebuild_query_cache: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + auto_rebuild_query_cache_timeout: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + query_cache_mode: $.PropertyDesc< + $QueryCacheMode, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + http_max_connections: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + shared_buffers: $.PropertyDesc< + $memory, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + query_work_mem: $.PropertyDesc< + $memory, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + maintenance_work_mem: $.PropertyDesc< + $memory, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + effective_cache_size: $.PropertyDesc< + $memory, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + effective_io_concurrency: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + default_statistics_target: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + force_database_error: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + _pg_prepared_statement_cache_size: $.PropertyDesc< + _std.$int16, + $.Cardinality.One, + false, + false, + false, + true + >; + track_query_stats: $.PropertyDesc< + $QueryStatsOption, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + extensions: $.LinkDesc< + $ExtensionConfig, + $.Cardinality.Many, + {}, + false, + true, + false, + false + >; + auth: $.LinkDesc<$Auth, $.Cardinality.Many, {}, false, false, false, false>; + email_providers: $.LinkDesc< + $EmailProviderConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $AbstractConfig = $.ObjectType< + "cfg::AbstractConfig", + $AbstractConfigλShape, + null, + [...$ConfigObject["__exclusives__"]], + | "cfg::DatabaseConfig" + | "cfg::BranchConfig" + | "cfg::Config" + | "cfg::InstanceConfig" +>; +const $AbstractConfig = $.makeType<$AbstractConfig>( + _.spec, + "8b66e734-a01e-5638-a812-359e0d005a37", + _.syntax.literal, +); + +const AbstractConfig: $.$expr_PathNode< + $.TypeSet<$AbstractConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($AbstractConfig, $.Cardinality.Many), null); + +export type $AuthλShape = $.typeutil.flatten< + $ConfigObjectλShape & { + priority: $.PropertyDesc< + _std.$int64, + $.Cardinality.One, + true, + false, + true, + false + >; + user: $.PropertyDesc< + _std.$str, + $.Cardinality.Many, + false, + false, + true, + true + >; + comment: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + true, + false + >; + method: $.LinkDesc< + $AuthMethod, + $.Cardinality.AtMostOne, + {}, + true, + false, + true, + false + >; + "; + "; + "; + "; + "; + "; + } +>; +type $Auth = $.ObjectType< + "cfg::Auth", + $AuthλShape, + null, + [ + ...$ConfigObject["__exclusives__"], + { + priority: { + __element__: _std.$int64; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + { + method: { + __element__: $AuthMethod; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "cfg::Auth" +>; +const $Auth = $.makeType<$Auth>( + _.spec, + "a2ba7516-d398-5ec2-b25e-221b2f7b9e87", + _.syntax.literal, +); + +const Auth: $.$expr_PathNode< + $.TypeSet<$Auth, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Auth, $.Cardinality.Many), null); + +export type $AuthMethodλShape = $.typeutil.flatten< + $ConfigObjectλShape & { + transports: $.PropertyDesc< + $ConnectionTransport, + $.Cardinality.Many, + false, + false, + true, + false + >; + "; + "; + } +>; +type $AuthMethod = $.ObjectType< + "cfg::AuthMethod", + $AuthMethodλShape, + null, + [...$ConfigObject["__exclusives__"]], + "cfg::JWT" | "cfg::Password" | "cfg::SCRAM" | "cfg::Trust" | "cfg::mTLS" +>; +const $AuthMethod = $.makeType<$AuthMethod>( + _.spec, + "128fcc80-bf32-5bdc-abac-09cf1532a7c1", + _.syntax.literal, +); + +const AuthMethod: $.$expr_PathNode< + $.TypeSet<$AuthMethod, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($AuthMethod, $.Cardinality.Many), null); + +export type $DatabaseConfigλShape = $.typeutil.flatten< + $AbstractConfigλShape & {} +>; +type $DatabaseConfig = $.ObjectType< + "cfg::DatabaseConfig", + $DatabaseConfigλShape, + null, + [...$AbstractConfig["__exclusives__"]], + "cfg::DatabaseConfig" | "cfg::BranchConfig" +>; +const $DatabaseConfig = $.makeType<$DatabaseConfig>( + _.spec, + "c046988e-25f8-55b8-8d94-9e2a13d7625f", + _.syntax.literal, +); + +const DatabaseConfig: $.$expr_PathNode< + $.TypeSet<$DatabaseConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($DatabaseConfig, $.Cardinality.Many), null); + +export type $BranchConfigλShape = $.typeutil.flatten< + $DatabaseConfigλShape & {} +>; +type $BranchConfig = $.ObjectType< + "cfg::BranchConfig", + $BranchConfigλShape, + null, + [...$DatabaseConfig["__exclusives__"]], + "cfg::BranchConfig" +>; +const $BranchConfig = $.makeType<$BranchConfig>( + _.spec, + "b8b6fefa-f0c7-5eea-9f2f-98a5222c7c5e", + _.syntax.literal, +); + +const BranchConfig: $.$expr_PathNode< + $.TypeSet<$BranchConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($BranchConfig, $.Cardinality.Many), null); + +export type $ConfigλShape = $.typeutil.flatten<$AbstractConfigλShape & {}>; +type $Config = $.ObjectType< + "cfg::Config", + $ConfigλShape, + null, + [...$AbstractConfig["__exclusives__"]], + "cfg::Config" +>; +const $Config = $.makeType<$Config>( + _.spec, + "363133b1-e993-50a0-94d3-aa0472b1a0a7", + _.syntax.literal, +); + +const Config: $.$expr_PathNode< + $.TypeSet<$Config, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Config, $.Cardinality.Many), null); + +export type $EmailProviderConfigλShape = $.typeutil.flatten< + $ConfigObjectλShape & { + name: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + true, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + } +>; +type $EmailProviderConfig = $.ObjectType< + "cfg::EmailProviderConfig", + $EmailProviderConfigλShape, + null, + [ + ...$ConfigObject["__exclusives__"], + { + name: { + __element__: _std.$str; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "cfg::SMTPProviderConfig" +>; +const $EmailProviderConfig = $.makeType<$EmailProviderConfig>( + _.spec, + "0caa4e7a-7c52-5cff-aee4-920ede8a569c", + _.syntax.literal, +); + +const EmailProviderConfig: $.$expr_PathNode< + $.TypeSet<$EmailProviderConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode( + $.$toSet($EmailProviderConfig, $.Cardinality.Many), + null, +); + +export type $ExtensionConfigλShape = $.typeutil.flatten< + $ConfigObjectλShape & { + cfg: $.LinkDesc< + $AbstractConfig, + $.Cardinality.One, + {}, + true, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + } +>; +type $ExtensionConfig = $.ObjectType< + "cfg::ExtensionConfig", + $ExtensionConfigλShape, + null, + [ + ...$ConfigObject["__exclusives__"], + { + cfg: { + __element__: $AbstractConfig; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + never +>; +const $ExtensionConfig = $.makeType<$ExtensionConfig>( + _.spec, + "89fb9b8b-d3b2-5075-9d1a-f5b116a0f188", + _.syntax.literal, +); + +const ExtensionConfig: $.$expr_PathNode< + $.TypeSet<$ExtensionConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ExtensionConfig, $.Cardinality.Many), null); + +export type $InstanceConfigλShape = $.typeutil.flatten< + $AbstractConfigλShape & {} +>; +type $InstanceConfig = $.ObjectType< + "cfg::InstanceConfig", + $InstanceConfigλShape, + null, + [...$AbstractConfig["__exclusives__"]], + "cfg::InstanceConfig" +>; +const $InstanceConfig = $.makeType<$InstanceConfig>( + _.spec, + "d9e9f342-7992-544c-b6af-459302121188", + _.syntax.literal, +); + +const InstanceConfig: $.$expr_PathNode< + $.TypeSet<$InstanceConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($InstanceConfig, $.Cardinality.Many), null); + +export type $JWTλShape = $.typeutil.flatten< + Omit<$AuthMethodλShape, "transports"> & { + transports: $.PropertyDesc< + $ConnectionTransport, + $.Cardinality.Many, + false, + false, + true, + true + >; + } +>; +type $JWT = $.ObjectType< + "cfg::JWT", + $JWTλShape, + null, + [...$AuthMethod["__exclusives__"]], + "cfg::JWT" +>; +const $JWT = $.makeType<$JWT>( + _.spec, + "4e795376-37e8-5381-8ae4-d621c80bbc7b", + _.syntax.literal, +); + +const JWT: $.$expr_PathNode< + $.TypeSet<$JWT, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($JWT, $.Cardinality.Many), null); + +export type $PasswordλShape = $.typeutil.flatten< + Omit<$AuthMethodλShape, "transports"> & { + transports: $.PropertyDesc< + $ConnectionTransport, + $.Cardinality.Many, + false, + false, + true, + true + >; + } +>; +type $Password = $.ObjectType< + "cfg::Password", + $PasswordλShape, + null, + [...$AuthMethod["__exclusives__"]], + "cfg::Password" +>; +const $Password = $.makeType<$Password>( + _.spec, + "9df8c566-c274-5d75-a948-2d901505d7de", + _.syntax.literal, +); + +const Password: $.$expr_PathNode< + $.TypeSet<$Password, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Password, $.Cardinality.Many), null); + +export type $SCRAMλShape = $.typeutil.flatten< + Omit<$AuthMethodλShape, "transports"> & { + transports: $.PropertyDesc< + $ConnectionTransport, + $.Cardinality.Many, + false, + false, + true, + true + >; + } +>; +type $SCRAM = $.ObjectType< + "cfg::SCRAM", + $SCRAMλShape, + null, + [...$AuthMethod["__exclusives__"]], + "cfg::SCRAM" +>; +const $SCRAM = $.makeType<$SCRAM>( + _.spec, + "ca43bc46-6dd2-55fc-98dc-358978df0f24", + _.syntax.literal, +); + +const SCRAM: $.$expr_PathNode< + $.TypeSet<$SCRAM, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($SCRAM, $.Cardinality.Many), null); + +export type $SMTPProviderConfigλShape = $.typeutil.flatten< + $EmailProviderConfigλShape & { + sender: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + host: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + port: $.PropertyDesc< + _std.$int32, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + username: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + password: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + security: $.PropertyDesc< + $SMTPSecurity, + $.Cardinality.One, + false, + false, + false, + true + >; + validate_certs: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + false, + false, + true + >; + timeout_per_email: $.PropertyDesc< + _std.$duration, + $.Cardinality.One, + false, + false, + false, + true + >; + timeout_per_attempt: $.PropertyDesc< + _std.$duration, + $.Cardinality.One, + false, + false, + false, + true + >; + } +>; +type $SMTPProviderConfig = $.ObjectType< + "cfg::SMTPProviderConfig", + $SMTPProviderConfigλShape, + null, + [...$EmailProviderConfig["__exclusives__"]], + "cfg::SMTPProviderConfig" +>; +const $SMTPProviderConfig = $.makeType<$SMTPProviderConfig>( + _.spec, + "519a3483-0198-576f-932d-508587433ec7", + _.syntax.literal, +); + +const SMTPProviderConfig: $.$expr_PathNode< + $.TypeSet<$SMTPProviderConfig, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($SMTPProviderConfig, $.Cardinality.Many), null); + +export type $TrustλShape = $.typeutil.flatten<$AuthMethodλShape & {}>; +type $Trust = $.ObjectType< + "cfg::Trust", + $TrustλShape, + null, + [...$AuthMethod["__exclusives__"]], + "cfg::Trust" +>; +const $Trust = $.makeType<$Trust>( + _.spec, + "7fc09ace-4af4-5d90-a9ab-94f9bb4cdb42", + _.syntax.literal, +); + +const Trust: $.$expr_PathNode< + $.TypeSet<$Trust, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Trust, $.Cardinality.Many), null); + +export type $mTLSλShape = $.typeutil.flatten< + Omit<$AuthMethodλShape, "transports"> & { + transports: $.PropertyDesc< + $ConnectionTransport, + $.Cardinality.Many, + false, + false, + true, + true + >; + } +>; +type $mTLS = $.ObjectType< + "cfg::mTLS", + $mTLSλShape, + null, + [...$AuthMethod["__exclusives__"]], + "cfg::mTLS" +>; +const $mTLS = $.makeType<$mTLS>( + _.spec, + "e96db572-9980-5ce1-8049-1561b3980d0e", + _.syntax.literal, +); + +const mTLS: $.$expr_PathNode< + $.TypeSet<$mTLS, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($mTLS, $.Cardinality.Many), null); + +type get_config_jsonλFuncExpr< + NamedArgs extends { + sources?: $.TypeSet<$.ArrayType<_std.$str>>; + max_source?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }, +> = $.$expr_Function< + _std.$json, + $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + > +>; +function get_config_json< + NamedArgs extends { + sources?: $.TypeSet<$.ArrayType<_std.$str>>; + max_source?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }, +>(namedArgs: NamedArgs): get_config_jsonλFuncExpr; +function get_config_json(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("cfg::get_config_json", args, _.spec, [ + { + args: [], + namedArgs: { + sources: { + typeId: "bb221d39-09f1-507e-8851-62075bb61823", + optional: true, + setoftype: false, + variadic: false, + }, + max_source: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-00000000010f", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "cfg::get_config_json", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { + AllowBareDDL, + ConnectionTransport, + QueryCacheMode, + QueryStatsOption, + SMTPSecurity, + StoreMigrationSDL, + memory, + $ConfigObject, + ConfigObject, + $AbstractConfig, + AbstractConfig, + $Auth, + Auth, + $AuthMethod, + AuthMethod, + $DatabaseConfig, + DatabaseConfig, + $BranchConfig, + BranchConfig, + $Config, + Config, + $EmailProviderConfig, + EmailProviderConfig, + $ExtensionConfig, + ExtensionConfig, + $InstanceConfig, + InstanceConfig, + $JWT, + JWT, + $Password, + Password, + $SCRAM, + SCRAM, + $SMTPProviderConfig, + SMTPProviderConfig, + $Trust, + Trust, + $mTLS, + mTLS, +}; + +type __defaultExports = { + AllowBareDDL: typeof AllowBareDDL; + ConnectionTransport: typeof ConnectionTransport; + QueryCacheMode: typeof QueryCacheMode; + QueryStatsOption: typeof QueryStatsOption; + SMTPSecurity: typeof SMTPSecurity; + StoreMigrationSDL: typeof StoreMigrationSDL; + memory: typeof memory; + ConfigObject: typeof ConfigObject; + AbstractConfig: typeof AbstractConfig; + Auth: typeof Auth; + AuthMethod: typeof AuthMethod; + DatabaseConfig: typeof DatabaseConfig; + BranchConfig: typeof BranchConfig; + Config: typeof Config; + EmailProviderConfig: typeof EmailProviderConfig; + ExtensionConfig: typeof ExtensionConfig; + InstanceConfig: typeof InstanceConfig; + JWT: typeof JWT; + Password: typeof Password; + SCRAM: typeof SCRAM; + SMTPProviderConfig: typeof SMTPProviderConfig; + Trust: typeof Trust; + mTLS: typeof mTLS; + get_config_json: typeof get_config_json; +}; +const __defaultExports: __defaultExports = { + AllowBareDDL: AllowBareDDL, + ConnectionTransport: ConnectionTransport, + QueryCacheMode: QueryCacheMode, + QueryStatsOption: QueryStatsOption, + SMTPSecurity: SMTPSecurity, + StoreMigrationSDL: StoreMigrationSDL, + memory: memory, + ConfigObject: ConfigObject, + AbstractConfig: AbstractConfig, + Auth: Auth, + AuthMethod: AuthMethod, + DatabaseConfig: DatabaseConfig, + BranchConfig: BranchConfig, + Config: Config, + EmailProviderConfig: EmailProviderConfig, + ExtensionConfig: ExtensionConfig, + InstanceConfig: InstanceConfig, + JWT: JWT, + Password: Password, + SCRAM: SCRAM, + SMTPProviderConfig: SMTPProviderConfig, + Trust: Trust, + mTLS: mTLS, + get_config_json: get_config_json, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/default.ts b/starters/features/gel/dbschema/edgeql-js/modules/default.ts new file mode 100644 index 00000000000..10b60a9ca7e --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/default.ts @@ -0,0 +1,8 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../reflection"; +import * as _ from "../imports"; + +type __defaultExports = {}; +const __defaultExports: __defaultExports = {}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/schema.ts b/starters/features/gel/dbschema/edgeql-js/modules/schema.ts new file mode 100644 index 00000000000..3ead872a7f2 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/schema.ts @@ -0,0 +1,4472 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _std from "./std"; +import type * as _sys from "./sys"; +import type * as _cfg from "./cfg"; +import type * as _stdnethttp from "./std/net/http"; +export type $AccessKind = { + Select: $.$expr_Literal<$AccessKind>; + UpdateRead: $.$expr_Literal<$AccessKind>; + UpdateWrite: $.$expr_Literal<$AccessKind>; + Delete: $.$expr_Literal<$AccessKind>; + Insert: $.$expr_Literal<$AccessKind>; +} & $.EnumType< + "schema::AccessKind", + ["Select", "UpdateRead", "UpdateWrite", "Delete", "Insert"] +>; +const AccessKind: $AccessKind = $.makeType<$AccessKind>( + _.spec, + "998b88fc-083a-584b-85bb-372ade248f66", + _.syntax.literal, +); + +export type $AccessPolicyAction = { + Allow: $.$expr_Literal<$AccessPolicyAction>; + Deny: $.$expr_Literal<$AccessPolicyAction>; +} & $.EnumType<"schema::AccessPolicyAction", ["Allow", "Deny"]>; +const AccessPolicyAction: $AccessPolicyAction = $.makeType<$AccessPolicyAction>( + _.spec, + "d8c466cc-109e-587c-aff8-42e50705b5b0", + _.syntax.literal, +); + +export type $Cardinality = { + One: $.$expr_Literal<$Cardinality>; + Many: $.$expr_Literal<$Cardinality>; +} & $.EnumType<"schema::Cardinality", ["One", "Many"]>; +const Cardinality: $Cardinality = $.makeType<$Cardinality>( + _.spec, + "94abc2f6-2e3e-55fc-8e97-b44ba70a3950", + _.syntax.literal, +); + +export type $IndexDeferrability = { + Prohibited: $.$expr_Literal<$IndexDeferrability>; + Permitted: $.$expr_Literal<$IndexDeferrability>; + Required: $.$expr_Literal<$IndexDeferrability>; +} & $.EnumType< + "schema::IndexDeferrability", + ["Prohibited", "Permitted", "Required"] +>; +const IndexDeferrability: $IndexDeferrability = $.makeType<$IndexDeferrability>( + _.spec, + "b31b2d9a-681c-5709-bec5-321897ea5bd6", + _.syntax.literal, +); + +export type $MigrationGeneratedBy = { + DevMode: $.$expr_Literal<$MigrationGeneratedBy>; + DDLStatement: $.$expr_Literal<$MigrationGeneratedBy>; +} & $.EnumType<"schema::MigrationGeneratedBy", ["DevMode", "DDLStatement"]>; +const MigrationGeneratedBy: $MigrationGeneratedBy = + $.makeType<$MigrationGeneratedBy>( + _.spec, + "8fcfde20-139b-5c17-93b9-9a49512b83dc", + _.syntax.literal, + ); + +export type $OperatorKind = { + Infix: $.$expr_Literal<$OperatorKind>; + Postfix: $.$expr_Literal<$OperatorKind>; + Prefix: $.$expr_Literal<$OperatorKind>; + Ternary: $.$expr_Literal<$OperatorKind>; +} & $.EnumType< + "schema::OperatorKind", + ["Infix", "Postfix", "Prefix", "Ternary"] +>; +const OperatorKind: $OperatorKind = $.makeType<$OperatorKind>( + _.spec, + "e48403f0-7017-5bf5-ab92-22825d9f1090", + _.syntax.literal, +); + +export type $ParameterKind = { + VariadicParam: $.$expr_Literal<$ParameterKind>; + NamedOnlyParam: $.$expr_Literal<$ParameterKind>; + PositionalParam: $.$expr_Literal<$ParameterKind>; +} & $.EnumType< + "schema::ParameterKind", + ["VariadicParam", "NamedOnlyParam", "PositionalParam"] +>; +const ParameterKind: $ParameterKind = $.makeType<$ParameterKind>( + _.spec, + "8037d84a-de95-5e63-ab76-727112419261", + _.syntax.literal, +); + +export type $RewriteKind = { + Update: $.$expr_Literal<$RewriteKind>; + Insert: $.$expr_Literal<$RewriteKind>; +} & $.EnumType<"schema::RewriteKind", ["Update", "Insert"]>; +const RewriteKind: $RewriteKind = $.makeType<$RewriteKind>( + _.spec, + "a06f04aa-88b7-5d9a-b520-b8139fd64d0c", + _.syntax.literal, +); + +export type $SourceDeleteAction = { + DeleteTarget: $.$expr_Literal<$SourceDeleteAction>; + Allow: $.$expr_Literal<$SourceDeleteAction>; + DeleteTargetIfOrphan: $.$expr_Literal<$SourceDeleteAction>; +} & $.EnumType< + "schema::SourceDeleteAction", + ["DeleteTarget", "Allow", "DeleteTargetIfOrphan"] +>; +const SourceDeleteAction: $SourceDeleteAction = $.makeType<$SourceDeleteAction>( + _.spec, + "1c938388-8739-57a7-8095-cc173226ad8e", + _.syntax.literal, +); + +export type $TargetDeleteAction = { + Restrict: $.$expr_Literal<$TargetDeleteAction>; + DeleteSource: $.$expr_Literal<$TargetDeleteAction>; + Allow: $.$expr_Literal<$TargetDeleteAction>; + DeferredRestrict: $.$expr_Literal<$TargetDeleteAction>; +} & $.EnumType< + "schema::TargetDeleteAction", + ["Restrict", "DeleteSource", "Allow", "DeferredRestrict"] +>; +const TargetDeleteAction: $TargetDeleteAction = $.makeType<$TargetDeleteAction>( + _.spec, + "6b925c92-5e48-5e6d-96f2-4125d9119b66", + _.syntax.literal, +); + +export type $TriggerKind = { + Update: $.$expr_Literal<$TriggerKind>; + Delete: $.$expr_Literal<$TriggerKind>; + Insert: $.$expr_Literal<$TriggerKind>; +} & $.EnumType<"schema::TriggerKind", ["Update", "Delete", "Insert"]>; +const TriggerKind: $TriggerKind = $.makeType<$TriggerKind>( + _.spec, + "3c6fa29f-8481-59c9-a9bf-ac30ab50be32", + _.syntax.literal, +); + +export type $TriggerScope = { + All: $.$expr_Literal<$TriggerScope>; + Each: $.$expr_Literal<$TriggerScope>; +} & $.EnumType<"schema::TriggerScope", ["All", "Each"]>; +const TriggerScope: $TriggerScope = $.makeType<$TriggerScope>( + _.spec, + "20998fe7-4392-5673-96b5-5f1cd736b5df", + _.syntax.literal, +); + +export type $TriggerTiming = { + After: $.$expr_Literal<$TriggerTiming>; + AfterCommitOf: $.$expr_Literal<$TriggerTiming>; +} & $.EnumType<"schema::TriggerTiming", ["After", "AfterCommitOf"]>; +const TriggerTiming: $TriggerTiming = $.makeType<$TriggerTiming>( + _.spec, + "a2c7e6ae-370c-53a7-842c-21e238faf3ee", + _.syntax.literal, +); + +export type $TypeModifier = { + SetOfType: $.$expr_Literal<$TypeModifier>; + OptionalType: $.$expr_Literal<$TypeModifier>; + SingletonType: $.$expr_Literal<$TypeModifier>; +} & $.EnumType< + "schema::TypeModifier", + ["SetOfType", "OptionalType", "SingletonType"] +>; +const TypeModifier: $TypeModifier = $.makeType<$TypeModifier>( + _.spec, + "67722d75-1145-54b6-af26-94602de09d51", + _.syntax.literal, +); + +export type $Volatility = { + Immutable: $.$expr_Literal<$Volatility>; + Stable: $.$expr_Literal<$Volatility>; + Volatile: $.$expr_Literal<$Volatility>; + Modifying: $.$expr_Literal<$Volatility>; +} & $.EnumType< + "schema::Volatility", + ["Immutable", "Stable", "Volatile", "Modifying"] +>; +const Volatility: $Volatility = $.makeType<$Volatility>( + _.spec, + "de5b90f2-6e49-5543-991b-28a156c7867f", + _.syntax.literal, +); + +export type $Object_32faaa35947553cf88fce68ecf1be4d9λShape = $.typeutil.flatten< + _std.$BaseObjectλShape & { + name: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + internal: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + false, + false, + true + >; + builtin: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + false, + false, + true + >; + computed_fields: $.PropertyDesc< + $.ArrayType<_std.$str>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + } +>; +type $Object_32faaa35947553cf88fce68ecf1be4d9 = $.ObjectType< + "schema::Object", + $Object_32faaa35947553cf88fce68ecf1be4d9λShape, + null, + [..._std.$BaseObject["__exclusives__"]], + | "schema::AccessPolicy" + | "schema::Alias" + | "schema::Annotation" + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::Cast" + | "schema::Constraint" + | "schema::Delta" + | "schema::Extension" + | "schema::Function" + | "schema::FutureBehavior" + | "schema::Global" + | "schema::Index" + | "schema::Link" + | "schema::Migration" + | "schema::Module" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::ObjectType" + | "schema::Operator" + | "schema::Parameter" + | "schema::Property" + | "schema::PseudoType" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::Rewrite" + | "schema::ScalarType" + | "schema::Trigger" + | "schema::Tuple" + | "schema::TupleExprAlias" + | "sys::Branch" + | "sys::Database" + | "sys::ExtensionPackage" + | "sys::ExtensionPackageMigration" + | "sys::QueryStats" + | "sys::Role" +>; +const $Object_32faaa35947553cf88fce68ecf1be4d9 = + $.makeType<$Object_32faaa35947553cf88fce68ecf1be4d9>( + _.spec, + "32faaa35-9475-53cf-88fc-e68ecf1be4d9", + _.syntax.literal, + ); + +const Object_32faaa35947553cf88fce68ecf1be4d9: $.$expr_PathNode< + $.TypeSet<$Object_32faaa35947553cf88fce68ecf1be4d9, $.Cardinality.Many>, + null +> = _.syntax.$PathNode( + $.$toSet($Object_32faaa35947553cf88fce68ecf1be4d9, $.Cardinality.Many), + null, +); + +export type $SubclassableObjectλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + abstract: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + is_abstract: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + true, + false, + false + >; + final: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + true, + false, + false + >; + is_final: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + true, + false, + false + >; + } +>; +type $SubclassableObject = $.ObjectType< + "schema::SubclassableObject", + $SubclassableObjectλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + | "schema::AccessPolicy" + | "schema::Annotation" + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::Constraint" + | "schema::Index" + | "schema::Link" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::ObjectType" + | "schema::Property" + | "schema::PseudoType" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::Rewrite" + | "schema::ScalarType" + | "schema::Trigger" + | "schema::Tuple" + | "schema::TupleExprAlias" + | "sys::Role" +>; +const $SubclassableObject = $.makeType<$SubclassableObject>( + _.spec, + "145b7b6f-8fa4-5b14-bcd3-5d6d10dc25da", + _.syntax.literal, +); + +const SubclassableObject: $.$expr_PathNode< + $.TypeSet<$SubclassableObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($SubclassableObject, $.Cardinality.Many), null); + +export type $InheritingObjectλShape = $.typeutil.flatten< + $SubclassableObjectλShape & { + inherited_fields: $.PropertyDesc< + $.ArrayType<_std.$str>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + bases: $.LinkDesc< + $InheritingObject, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + ancestors: $.LinkDesc< + $InheritingObject, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + } +>; +type $InheritingObject = $.ObjectType< + "schema::InheritingObject", + $InheritingObjectλShape, + null, + [...$SubclassableObject["__exclusives__"]], + | "schema::AccessPolicy" + | "schema::Annotation" + | "schema::Constraint" + | "schema::Index" + | "schema::Link" + | "schema::ObjectType" + | "schema::Property" + | "schema::PseudoType" + | "schema::Rewrite" + | "schema::ScalarType" + | "schema::Trigger" + | "sys::Role" +>; +const $InheritingObject = $.makeType<$InheritingObject>( + _.spec, + "825a1378-6b30-5f15-82f1-1c92e57691f2", + _.syntax.literal, +); + +const InheritingObject: $.$expr_PathNode< + $.TypeSet<$InheritingObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($InheritingObject, $.Cardinality.Many), null); + +export type $AnnotationSubjectλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + annotations: $.LinkDesc< + $Annotation, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@value": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + } +>; +type $AnnotationSubject = $.ObjectType< + "schema::AnnotationSubject", + $AnnotationSubjectλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + | "schema::AccessPolicy" + | "schema::Alias" + | "schema::Annotation" + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::Cast" + | "schema::Constraint" + | "schema::Extension" + | "schema::Function" + | "schema::Global" + | "schema::Index" + | "schema::Link" + | "schema::Migration" + | "schema::Module" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::ObjectType" + | "schema::Operator" + | "schema::Property" + | "schema::PseudoType" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::Rewrite" + | "schema::ScalarType" + | "schema::Trigger" + | "schema::Tuple" + | "schema::TupleExprAlias" + | "sys::Branch" + | "sys::Database" + | "sys::ExtensionPackage" + | "sys::ExtensionPackageMigration" + | "sys::Role" +>; +const $AnnotationSubject = $.makeType<$AnnotationSubject>( + _.spec, + "970b2d83-85d8-5a46-a4e8-337d28abc12e", + _.syntax.literal, +); + +const AnnotationSubject: $.$expr_PathNode< + $.TypeSet<$AnnotationSubject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($AnnotationSubject, $.Cardinality.Many), null); + +export type $AccessPolicyλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + access_kinds: $.PropertyDesc< + $AccessKind, + $.Cardinality.Many, + false, + false, + false, + false + >; + condition: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + action: $.PropertyDesc< + $AccessPolicyAction, + $.Cardinality.One, + false, + false, + false, + false + >; + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + errmessage: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + subject: $.LinkDesc< + $ObjectType, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $AccessPolicy = $.ObjectType< + "schema::AccessPolicy", + $AccessPolicyλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::AccessPolicy" +>; +const $AccessPolicy = $.makeType<$AccessPolicy>( + _.spec, + "a8462073-0539-5640-9d9d-2db251c0b350", + _.syntax.literal, +); + +const AccessPolicy: $.$expr_PathNode< + $.TypeSet<$AccessPolicy, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($AccessPolicy, $.Cardinality.Many), null); + +export type $AliasλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & { + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + type: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + } +>; +type $Alias = $.ObjectType< + "schema::Alias", + $AliasλShape, + null, + [...$AnnotationSubject["__exclusives__"]], + "schema::Alias" +>; +const $Alias = $.makeType<$Alias>( + _.spec, + "4388400b-e01d-582c-b1da-8161814835a6", + _.syntax.literal, +); + +const Alias: $.$expr_PathNode< + $.TypeSet<$Alias, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Alias, $.Cardinality.Many), null); + +export type $AnnotationλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + inheritable: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + } +>; +type $Annotation = $.ObjectType< + "schema::Annotation", + $AnnotationλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::Annotation" +>; +const $Annotation = $.makeType<$Annotation>( + _.spec, + "273b8735-318f-53f6-9297-6f20162c9105", + _.syntax.literal, +); + +const Annotation: $.$expr_PathNode< + $.TypeSet<$Annotation, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Annotation, $.Cardinality.Many), null); + +export type $TypeλShape = $.typeutil.flatten< + $SubclassableObjectλShape & + $AnnotationSubjectλShape & { + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + from_alias: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + is_from_alias: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + true, + false, + false + >; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + "; + } +>; +type $Type = $.ObjectType< + "schema::Type", + $TypeλShape, + null, + [ + ...$SubclassableObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::ObjectType" + | "schema::PseudoType" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::ScalarType" + | "schema::Tuple" + | "schema::TupleExprAlias" +>; +const $Type = $.makeType<$Type>( + _.spec, + "8e652319-e551-5b5c-a7bd-9591f0ef5303", + _.syntax.literal, +); + +const Type: $.$expr_PathNode< + $.TypeSet<$Type, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Type, $.Cardinality.Many), null); + +export type $PrimitiveTypeλShape = $.typeutil.flatten<$TypeλShape & {}>; +type $PrimitiveType = $.ObjectType< + "schema::PrimitiveType", + $PrimitiveTypeλShape, + null, + [...$Type["__exclusives__"]], + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::ScalarType" + | "schema::Tuple" + | "schema::TupleExprAlias" +>; +const $PrimitiveType = $.makeType<$PrimitiveType>( + _.spec, + "da26fa09-3541-5cba-b93f-d5ba58d25589", + _.syntax.literal, +); + +const PrimitiveType: $.$expr_PathNode< + $.TypeSet<$PrimitiveType, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($PrimitiveType, $.Cardinality.Many), null); + +export type $CollectionTypeλShape = $.typeutil.flatten< + $PrimitiveTypeλShape & {} +>; +type $CollectionType = $.ObjectType< + "schema::CollectionType", + $CollectionTypeλShape, + null, + [...$PrimitiveType["__exclusives__"]], + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::Tuple" + | "schema::TupleExprAlias" +>; +const $CollectionType = $.makeType<$CollectionType>( + _.spec, + "e3a7ccf7-4a20-5151-80b3-5156c9373889", + _.syntax.literal, +); + +const CollectionType: $.$expr_PathNode< + $.TypeSet<$CollectionType, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($CollectionType, $.Cardinality.Many), null); + +export type $ArrayλShape = $.typeutil.flatten< + $CollectionTypeλShape & { + dimensions: $.PropertyDesc< + $.ArrayType<_std.$int16>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + element_type: $.LinkDesc< + $Type, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + } +>; +type $Array = $.ObjectType< + "schema::Array", + $ArrayλShape, + null, + [...$CollectionType["__exclusives__"]], + "schema::Array" | "schema::ArrayExprAlias" +>; +const $Array = $.makeType<$Array>( + _.spec, + "283cc7a9-7bf6-5eda-a323-b4e5173f2927", + _.syntax.literal, +); + +const Array: $.$expr_PathNode< + $.TypeSet<$Array, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Array, $.Cardinality.Many), null); + +export type $ArrayExprAliasλShape = $.typeutil.flatten<$ArrayλShape & {}>; +type $ArrayExprAlias = $.ObjectType< + "schema::ArrayExprAlias", + $ArrayExprAliasλShape, + null, + [...$Array["__exclusives__"]], + "schema::ArrayExprAlias" +>; +const $ArrayExprAlias = $.makeType<$ArrayExprAlias>( + _.spec, + "2e55d7f5-18ed-54b4-ade0-ba404dd482d3", + _.syntax.literal, +); + +const ArrayExprAlias: $.$expr_PathNode< + $.TypeSet<$ArrayExprAlias, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ArrayExprAlias, $.Cardinality.Many), null); + +export type $CallableObjectλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & { + return_typemod: $.PropertyDesc< + $TypeModifier, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + params: $.LinkDesc< + $Parameter, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + return_type: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + } +>; +type $CallableObject = $.ObjectType< + "schema::CallableObject", + $CallableObjectλShape, + null, + [...$AnnotationSubject["__exclusives__"]], + "schema::Constraint" | "schema::Function" | "schema::Operator" +>; +const $CallableObject = $.makeType<$CallableObject>( + _.spec, + "800f2df9-dd86-5681-9e3c-b529af481a9d", + _.syntax.literal, +); + +const CallableObject: $.$expr_PathNode< + $.TypeSet<$CallableObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($CallableObject, $.Cardinality.Many), null); + +export type $VolatilitySubjectλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + volatility: $.PropertyDesc< + $Volatility, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + } +>; +type $VolatilitySubject = $.ObjectType< + "schema::VolatilitySubject", + $VolatilitySubjectλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + "schema::Cast" | "schema::Function" | "schema::Operator" +>; +const $VolatilitySubject = $.makeType<$VolatilitySubject>( + _.spec, + "ed8e20ca-f2dc-5626-bccb-05ef9ed65791", + _.syntax.literal, +); + +const VolatilitySubject: $.$expr_PathNode< + $.TypeSet<$VolatilitySubject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($VolatilitySubject, $.Cardinality.Many), null); + +export type $CastλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & + $VolatilitySubjectλShape & { + allow_implicit: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + allow_assignment: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + from_type: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + to_type: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + } +>; +type $Cast = $.ObjectType< + "schema::Cast", + $CastλShape, + null, + [ + ...$AnnotationSubject["__exclusives__"], + ...$VolatilitySubject["__exclusives__"], + ], + "schema::Cast" +>; +const $Cast = $.makeType<$Cast>( + _.spec, + "2b25c5a4-5ad4-5c4b-b545-574ccac3fd7f", + _.syntax.literal, +); + +const Cast: $.$expr_PathNode< + $.TypeSet<$Cast, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Cast, $.Cardinality.Many), null); + +export type $ConsistencySubjectλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + constraints: $.LinkDesc< + $Constraint, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + "; + "; + } +>; +type $ConsistencySubject = $.ObjectType< + "schema::ConsistencySubject", + $ConsistencySubjectλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + { + constraints: { + __element__: $Constraint; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + | "schema::Link" + | "schema::ObjectType" + | "schema::Property" + | "schema::ScalarType" +>; +const $ConsistencySubject = $.makeType<$ConsistencySubject>( + _.spec, + "883ec593-7428-5707-af16-d446e5d8ed28", + _.syntax.literal, +); + +const ConsistencySubject: $.$expr_PathNode< + $.TypeSet<$ConsistencySubject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ConsistencySubject, $.Cardinality.Many), null); + +export type $ConstraintλShape = $.typeutil.flatten< + Omit<$CallableObjectλShape, "params"> & + $InheritingObjectλShape & { + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + subjectexpr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + finalexpr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + errmessage: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + delegated: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + except_expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + subject: $.LinkDesc< + $ConsistencySubject, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + params: $.LinkDesc< + $Parameter, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + "@value": $.PropertyDesc<_std.$str, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + "; + } +>; +type $Constraint = $.ObjectType< + "schema::Constraint", + $ConstraintλShape, + null, + [ + ...$CallableObject["__exclusives__"], + ...$InheritingObject["__exclusives__"], + ], + "schema::Constraint" +>; +const $Constraint = $.makeType<$Constraint>( + _.spec, + "9346c403-6ee6-50b6-81b2-a35551cfab2f", + _.syntax.literal, +); + +const Constraint: $.$expr_PathNode< + $.TypeSet<$Constraint, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Constraint, $.Cardinality.Many), null); + +export type $DeltaλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + parents: $.LinkDesc< + $Delta, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Delta = $.ObjectType< + "schema::Delta", + $DeltaλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + "schema::Delta" +>; +const $Delta = $.makeType<$Delta>( + _.spec, + "c974be74-46d8-5848-b2a9-be5eda14f73e", + _.syntax.literal, +); + +const Delta: $.$expr_PathNode< + $.TypeSet<$Delta, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Delta, $.Cardinality.Many), null); + +export type $ExtensionλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + package: $.LinkDesc< + _sys.$ExtensionPackage, + $.Cardinality.One, + {}, + true, + false, + false, + false + >; + } +>; +type $Extension = $.ObjectType< + "schema::Extension", + $ExtensionλShape, + null, + [ + ...$AnnotationSubject["__exclusives__"], + ...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"], + { + package: { + __element__: _sys.$ExtensionPackage; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "schema::Extension" +>; +const $Extension = $.makeType<$Extension>( + _.spec, + "b9c53751-8d28-5077-b1db-a03ea59557ed", + _.syntax.literal, +); + +const Extension: $.$expr_PathNode< + $.TypeSet<$Extension, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Extension, $.Cardinality.Many), null); + +export type $FunctionλShape = $.typeutil.flatten< + $CallableObjectλShape & + $VolatilitySubjectλShape & { + preserves_optionality: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + body: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + language: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + used_globals: $.LinkDesc< + $Global, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + } +>; +type $Function = $.ObjectType< + "schema::Function", + $FunctionλShape, + null, + [ + ...$CallableObject["__exclusives__"], + ...$VolatilitySubject["__exclusives__"], + ], + "schema::Function" +>; +const $Function = $.makeType<$Function>( + _.spec, + "3a60f555-7c03-5287-b4c9-f078692a89ef", + _.syntax.literal, +); + +const Function: $.$expr_PathNode< + $.TypeSet<$Function, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Function, $.Cardinality.Many), null); + +export type $FutureBehaviorλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & {} +>; +type $FutureBehavior = $.ObjectType< + "schema::FutureBehavior", + $FutureBehaviorλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + "schema::FutureBehavior" +>; +const $FutureBehavior = $.makeType<$FutureBehavior>( + _.spec, + "003feed0-dc7d-564e-abb5-93a42ba99d64", + _.syntax.literal, +); + +const FutureBehavior: $.$expr_PathNode< + $.TypeSet<$FutureBehavior, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($FutureBehavior, $.Cardinality.Many), null); + +export type $GlobalλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & { + default: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + required: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + cardinality: $.PropertyDesc< + $Cardinality, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + target: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Global = $.ObjectType< + "schema::Global", + $GlobalλShape, + null, + [...$AnnotationSubject["__exclusives__"]], + "schema::Global" +>; +const $Global = $.makeType<$Global>( + _.spec, + "e1294378-bb3d-57e0-81d2-6a19ea088231", + _.syntax.literal, +); + +const Global: $.$expr_PathNode< + $.TypeSet<$Global, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Global, $.Cardinality.Many), null); + +export type $IndexλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + except_expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + deferrability: $.PropertyDesc< + $IndexDeferrability, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + deferred: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + kwargs: $.PropertyDesc< + $.ArrayType<$.NamedTupleType<{ name: _std.$str; expr: _std.$str }>>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + params: $.LinkDesc< + $Parameter, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + false, + false, + false, + false + >; + "; + "; + "; + "; + } +>; +type $Index = $.ObjectType< + "schema::Index", + $IndexλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::Index" +>; +const $Index = $.makeType<$Index>( + _.spec, + "decfa7fb-1f66-5986-be86-fc9b6c268a97", + _.syntax.literal, +); + +const Index: $.$expr_PathNode< + $.TypeSet<$Index, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Index, $.Cardinality.Many), null); + +export type $PointerλShape = $.typeutil.flatten< + Omit<$ConsistencySubjectλShape, " & + $AnnotationSubjectλShape & { + cardinality: $.PropertyDesc< + $Cardinality, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + required: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + readonly: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + default: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + secret: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + source: $.LinkDesc< + $Source, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + target: $.LinkDesc< + $Type, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + rewrites: $.LinkDesc< + $Rewrite, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + "; + "; + "; + "; + "; + "; + } +>; +type $Pointer = $.ObjectType< + "schema::Pointer", + $PointerλShape, + null, + [ + ...$ConsistencySubject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + { + rewrites: { + __element__: $Rewrite; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "schema::Link" | "schema::Property" +>; +const $Pointer = $.makeType<$Pointer>( + _.spec, + "57e1c6b1-ce76-5b5b-943f-f01f1e6a16a3", + _.syntax.literal, +); + +const Pointer: $.$expr_PathNode< + $.TypeSet<$Pointer, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Pointer, $.Cardinality.Many), null); + +export type $SourceλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + pointers: $.LinkDesc< + $Pointer, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + indexes: $.LinkDesc< + $Index, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + "; + "; + "; + "; + } +>; +type $Source = $.ObjectType< + "schema::Source", + $SourceλShape, + null, + [ + ...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"], + { + indexes: { + __element__: $Index; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + { + pointers: { + __element__: $Pointer; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "schema::Link" | "schema::ObjectType" +>; +const $Source = $.makeType<$Source>( + _.spec, + "0368bb5e-ae06-5c00-9316-15095185b828", + _.syntax.literal, +); + +const Source: $.$expr_PathNode< + $.TypeSet<$Source, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Source, $.Cardinality.Many), null); + +export type $LinkλShape = $.typeutil.flatten< + Omit<$PointerλShape, "target"> & + $SourceλShape & { + on_target_delete: $.PropertyDesc< + $TargetDeleteAction, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + on_source_delete: $.PropertyDesc< + $SourceDeleteAction, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + target: $.LinkDesc< + $ObjectType, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + properties: $.LinkDesc< + $Property, + $.Cardinality.Many, + {}, + false, + true, + false, + false + >; + "; + "; + } +>; +type $Link = $.ObjectType< + "schema::Link", + $LinkλShape, + null, + [...$Pointer["__exclusives__"], ...$Source["__exclusives__"]], + "schema::Link" +>; +const $Link = $.makeType<$Link>( + _.spec, + "98fe77cc-128e-58fe-b87a-1251c3288548", + _.syntax.literal, +); + +const Link: $.$expr_PathNode< + $.TypeSet<$Link, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Link, $.Cardinality.Many), null); + +export type $MigrationλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + script: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + sdl: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + message: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + generated_by: $.PropertyDesc< + $MigrationGeneratedBy, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + parents: $.LinkDesc< + $Migration, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Migration = $.ObjectType< + "schema::Migration", + $MigrationλShape, + null, + [ + ...$AnnotationSubject["__exclusives__"], + ...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"], + ], + "schema::Migration" +>; +const $Migration = $.makeType<$Migration>( + _.spec, + "31f74b3a-d9b1-5e35-a746-057f44c58e76", + _.syntax.literal, +); + +const Migration: $.$expr_PathNode< + $.TypeSet<$Migration, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Migration, $.Cardinality.Many), null); + +export type $ModuleλShape = $.typeutil.flatten< + $AnnotationSubjectλShape & $Object_32faaa35947553cf88fce68ecf1be4d9λShape & {} +>; +type $Module = $.ObjectType< + "schema::Module", + $ModuleλShape, + null, + [ + ...$AnnotationSubject["__exclusives__"], + ...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"], + ], + "schema::Module" +>; +const $Module = $.makeType<$Module>( + _.spec, + "7106039a-ed86-5868-8227-3e2fc5e3e5ec", + _.syntax.literal, +); + +const Module: $.$expr_PathNode< + $.TypeSet<$Module, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Module, $.Cardinality.Many), null); + +export type $MultiRangeλShape = $.typeutil.flatten< + $CollectionTypeλShape & { + element_type: $.LinkDesc< + $Type, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + } +>; +type $MultiRange = $.ObjectType< + "schema::MultiRange", + $MultiRangeλShape, + null, + [...$CollectionType["__exclusives__"]], + "schema::MultiRange" | "schema::MultiRangeExprAlias" +>; +const $MultiRange = $.makeType<$MultiRange>( + _.spec, + "800c4a49-db9d-5a39-9cf2-aa213b858616", + _.syntax.literal, +); + +const MultiRange: $.$expr_PathNode< + $.TypeSet<$MultiRange, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($MultiRange, $.Cardinality.Many), null); + +export type $MultiRangeExprAliasλShape = $.typeutil.flatten< + $MultiRangeλShape & {} +>; +type $MultiRangeExprAlias = $.ObjectType< + "schema::MultiRangeExprAlias", + $MultiRangeExprAliasλShape, + null, + [...$MultiRange["__exclusives__"]], + "schema::MultiRangeExprAlias" +>; +const $MultiRangeExprAlias = $.makeType<$MultiRangeExprAlias>( + _.spec, + "a92ef6fd-611e-5b00-8115-cc0ebb5f0be5", + _.syntax.literal, +); + +const MultiRangeExprAlias: $.$expr_PathNode< + $.TypeSet<$MultiRangeExprAlias, $.Cardinality.Many>, + null +> = _.syntax.$PathNode( + $.$toSet($MultiRangeExprAlias, $.Cardinality.Many), + null, +); + +export type $ObjectTypeλShape = $.typeutil.flatten< + $SourceλShape & + Omit<$ConsistencySubjectλShape, " & + $InheritingObjectλShape & + Omit<$TypeλShape, " & + $AnnotationSubjectλShape & { + compound_type: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + true, + false, + false + >; + is_compound_type: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + true, + false, + false + >; + union_of: $.LinkDesc< + $ObjectType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + intersection_of: $.LinkDesc< + $ObjectType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + links: $.LinkDesc< + $Link, + $.Cardinality.Many, + {}, + false, + true, + false, + false + >; + properties: $.LinkDesc< + $Property, + $.Cardinality.Many, + {}, + false, + true, + false, + false + >; + access_policies: $.LinkDesc< + $AccessPolicy, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + triggers: $.LinkDesc< + $Trigger, + $.Cardinality.Many, + { + "@owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + "@is_owned": $.PropertyDesc<_std.$bool, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + "<__type__[is std::BaseObject]": $.LinkDesc< + $.ObjectType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::TupleElement]": $.LinkDesc< + $TupleElement, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Object]": $.LinkDesc< + $Object_32faaa35947553cf88fce68ecf1be4d9, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::VolatilitySubject]": $.LinkDesc< + $VolatilitySubject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::SubclassableObject]": $.LinkDesc< + $SubclassableObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::InheritingObject]": $.LinkDesc< + $InheritingObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Delta]": $.LinkDesc< + $Delta, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::AnnotationSubject]": $.LinkDesc< + $AnnotationSubject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is std::Object]": $.LinkDesc< + _std.$Object_8ce8c71ee4fa5f73840c22d7eaa58588, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + "; + "; + "<__type__[is schema::FutureBehavior]": $.LinkDesc< + $FutureBehavior, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::SystemObject]": $.LinkDesc< + _sys.$SystemObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::ExternalObject]": $.LinkDesc< + _sys.$ExternalObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::Branch]": $.LinkDesc< + _sys.$Branch, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::Database]": $.LinkDesc< + _sys.$Database, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::ExtensionPackage]": $.LinkDesc< + _sys.$ExtensionPackage, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::ExtensionPackageMigration]": $.LinkDesc< + _sys.$ExtensionPackageMigration, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::Role]": $.LinkDesc< + _sys.$Role, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is sys::QueryStats]": $.LinkDesc< + _sys.$QueryStats, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::ConfigObject]": $.LinkDesc< + _cfg.$ConfigObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::AuthMethod]": $.LinkDesc< + _cfg.$AuthMethod, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::Trust]": $.LinkDesc< + _cfg.$Trust, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::SCRAM]": $.LinkDesc< + _cfg.$SCRAM, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::JWT]": $.LinkDesc< + _cfg.$JWT, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::Password]": $.LinkDesc< + _cfg.$Password, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::mTLS]": $.LinkDesc< + _cfg.$mTLS, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::Auth]": $.LinkDesc< + _cfg.$Auth, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::EmailProviderConfig]": $.LinkDesc< + _cfg.$EmailProviderConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::SMTPProviderConfig]": $.LinkDesc< + _cfg.$SMTPProviderConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::AbstractConfig]": $.LinkDesc< + _cfg.$AbstractConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::ExtensionConfig]": $.LinkDesc< + _cfg.$ExtensionConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::Config]": $.LinkDesc< + _cfg.$Config, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::InstanceConfig]": $.LinkDesc< + _cfg.$InstanceConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Annotation]": $.LinkDesc< + $Annotation, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::DatabaseConfig]": $.LinkDesc< + _cfg.$DatabaseConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is cfg::BranchConfig]": $.LinkDesc< + _cfg.$BranchConfig, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is std::net::http::Response]": $.LinkDesc< + _stdnethttp.$Response, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is std::net::http::ScheduledRequest]": $.LinkDesc< + _stdnethttp.$ScheduledRequest, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Type]": $.LinkDesc< + $Type, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::PrimitiveType]": $.LinkDesc< + $PrimitiveType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::CollectionType]": $.LinkDesc< + $CollectionType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Array]": $.LinkDesc< + $Array, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::ArrayExprAlias]": $.LinkDesc< + $ArrayExprAlias, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Tuple]": $.LinkDesc< + $Tuple, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::TupleExprAlias]": $.LinkDesc< + $TupleExprAlias, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Range]": $.LinkDesc< + $Range, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::RangeExprAlias]": $.LinkDesc< + $RangeExprAlias, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::MultiRange]": $.LinkDesc< + $MultiRange, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::MultiRangeExprAlias]": $.LinkDesc< + $MultiRangeExprAlias, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Alias]": $.LinkDesc< + $Alias, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Global]": $.LinkDesc< + $Global, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Parameter]": $.LinkDesc< + $Parameter, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::CallableObject]": $.LinkDesc< + $CallableObject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Function]": $.LinkDesc< + $Function, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Operator]": $.LinkDesc< + $Operator, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Cast]": $.LinkDesc< + $Cast, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Migration]": $.LinkDesc< + $Migration, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Module]": $.LinkDesc< + $Module, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::PseudoType]": $.LinkDesc< + $PseudoType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Constraint]": $.LinkDesc< + $Constraint, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::ConsistencySubject]": $.LinkDesc< + $ConsistencySubject, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Rewrite]": $.LinkDesc< + $Rewrite, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Pointer]": $.LinkDesc< + $Pointer, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Property]": $.LinkDesc< + $Property, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::ScalarType]": $.LinkDesc< + $ScalarType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Index]": $.LinkDesc< + $Index, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Source]": $.LinkDesc< + $Source, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Link]": $.LinkDesc< + $Link, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "<__type__[is schema::AccessPolicy]": $.LinkDesc< + $AccessPolicy, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Trigger]": $.LinkDesc< + $Trigger, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::ObjectType]": $.LinkDesc< + $ObjectType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__[is schema::Extension]": $.LinkDesc< + $Extension, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "<__type__": $.LinkDesc< + $.ObjectType, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + "; + "; + } +>; +type $ObjectType = $.ObjectType< + "schema::ObjectType", + $ObjectTypeλShape, + null, + [ + ...$Source["__exclusives__"], + ...$ConsistencySubject["__exclusives__"], + ...$InheritingObject["__exclusives__"], + ...$Type["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + { + access_policies: { + __element__: $AccessPolicy; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + { + triggers: { + __element__: $Trigger; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "schema::ObjectType" +>; +const $ObjectType = $.makeType<$ObjectType>( + _.spec, + "2662a1b4-4f3f-5875-b6eb-ce52101a90a3", + _.syntax.literal, +); + +const ObjectType: $.$expr_PathNode< + $.TypeSet<$ObjectType, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ObjectType, $.Cardinality.Many), null); + +export type $OperatorλShape = $.typeutil.flatten< + $CallableObjectλShape & + $VolatilitySubjectλShape & { + operator_kind: $.PropertyDesc< + $OperatorKind, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + is_abstract: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + true, + false, + false + >; + abstract: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + true + >; + } +>; +type $Operator = $.ObjectType< + "schema::Operator", + $OperatorλShape, + null, + [ + ...$CallableObject["__exclusives__"], + ...$VolatilitySubject["__exclusives__"], + ], + "schema::Operator" +>; +const $Operator = $.makeType<$Operator>( + _.spec, + "e37bd85e-5e2f-5daa-9dd9-d21d419032be", + _.syntax.literal, +); + +const Operator: $.$expr_PathNode< + $.TypeSet<$Operator, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Operator, $.Cardinality.Many), null); + +export type $ParameterλShape = $.typeutil.flatten< + $Object_32faaa35947553cf88fce68ecf1be4d9λShape & { + typemod: $.PropertyDesc< + $TypeModifier, + $.Cardinality.One, + false, + false, + false, + false + >; + kind: $.PropertyDesc< + $ParameterKind, + $.Cardinality.One, + false, + false, + false, + false + >; + num: $.PropertyDesc< + _std.$int64, + $.Cardinality.One, + false, + false, + false, + false + >; + default: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + type: $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; + "; + "; + "; + "; + "; + "; + } +>; +type $Parameter = $.ObjectType< + "schema::Parameter", + $ParameterλShape, + null, + [...$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + "schema::Parameter" +>; +const $Parameter = $.makeType<$Parameter>( + _.spec, + "87f7d583-3e3c-507e-9fbb-4bf3b9e5aa24", + _.syntax.literal, +); + +const Parameter: $.$expr_PathNode< + $.TypeSet<$Parameter, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Parameter, $.Cardinality.Many), null); + +export type $PropertyλShape = $.typeutil.flatten< + $PointerλShape & { + "; + "; + "; + } +>; +type $Property = $.ObjectType< + "schema::Property", + $PropertyλShape, + null, + [...$Pointer["__exclusives__"]], + "schema::Property" +>; +const $Property = $.makeType<$Property>( + _.spec, + "a57f48ff-3bb9-5693-a2e1-bf328a2ddbfc", + _.syntax.literal, +); + +const Property: $.$expr_PathNode< + $.TypeSet<$Property, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Property, $.Cardinality.Many), null); + +export type $PseudoTypeλShape = $.typeutil.flatten< + $InheritingObjectλShape & $TypeλShape & {} +>; +type $PseudoType = $.ObjectType< + "schema::PseudoType", + $PseudoTypeλShape, + null, + [...$InheritingObject["__exclusives__"], ...$Type["__exclusives__"]], + "schema::PseudoType" +>; +const $PseudoType = $.makeType<$PseudoType>( + _.spec, + "0875f8c3-7033-5cc4-af04-2b6d80e289e0", + _.syntax.literal, +); + +const PseudoType: $.$expr_PathNode< + $.TypeSet<$PseudoType, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($PseudoType, $.Cardinality.Many), null); + +export type $RangeλShape = $.typeutil.flatten< + $CollectionTypeλShape & { + element_type: $.LinkDesc< + $Type, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + } +>; +type $Range = $.ObjectType< + "schema::Range", + $RangeλShape, + null, + [...$CollectionType["__exclusives__"]], + "schema::Range" | "schema::RangeExprAlias" +>; +const $Range = $.makeType<$Range>( + _.spec, + "cced31f8-8167-59d7-b269-c49ae88a0ac1", + _.syntax.literal, +); + +const Range: $.$expr_PathNode< + $.TypeSet<$Range, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Range, $.Cardinality.Many), null); + +export type $RangeExprAliasλShape = $.typeutil.flatten<$RangeλShape & {}>; +type $RangeExprAlias = $.ObjectType< + "schema::RangeExprAlias", + $RangeExprAliasλShape, + null, + [...$Range["__exclusives__"]], + "schema::RangeExprAlias" +>; +const $RangeExprAlias = $.makeType<$RangeExprAlias>( + _.spec, + "bc63491c-2a88-5353-b5f0-6f2188a4f65d", + _.syntax.literal, +); + +const RangeExprAlias: $.$expr_PathNode< + $.TypeSet<$RangeExprAlias, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($RangeExprAlias, $.Cardinality.Many), null); + +export type $RewriteλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + kind: $.PropertyDesc< + $TriggerKind, + $.Cardinality.One, + false, + false, + false, + false + >; + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + subject: $.LinkDesc< + $Pointer, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + "; + "; + "; + "; + } +>; +type $Rewrite = $.ObjectType< + "schema::Rewrite", + $RewriteλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::Rewrite" +>; +const $Rewrite = $.makeType<$Rewrite>( + _.spec, + "d60198c8-ad58-5c4c-b3b6-d520c19f5cef", + _.syntax.literal, +); + +const Rewrite: $.$expr_PathNode< + $.TypeSet<$Rewrite, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Rewrite, $.Cardinality.Many), null); + +export type $ScalarTypeλShape = $.typeutil.flatten< + $PrimitiveTypeλShape & + $ConsistencySubjectλShape & + $AnnotationSubjectλShape & { + default: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + enum_values: $.PropertyDesc< + $.ArrayType<_std.$str>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + arg_values: $.PropertyDesc< + $.ArrayType<_std.$str>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + } +>; +type $ScalarType = $.ObjectType< + "schema::ScalarType", + $ScalarTypeλShape, + null, + [ + ...$PrimitiveType["__exclusives__"], + ...$ConsistencySubject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::ScalarType" +>; +const $ScalarType = $.makeType<$ScalarType>( + _.spec, + "d055dd47-3eb9-5a31-9d8f-5e7053bbe11e", + _.syntax.literal, +); + +const ScalarType: $.$expr_PathNode< + $.TypeSet<$ScalarType, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ScalarType, $.Cardinality.Many), null); + +export type $TriggerλShape = $.typeutil.flatten< + $InheritingObjectλShape & + $AnnotationSubjectλShape & { + timing: $.PropertyDesc< + $TriggerTiming, + $.Cardinality.One, + false, + false, + false, + false + >; + kinds: $.PropertyDesc< + $TriggerKind, + $.Cardinality.Many, + false, + false, + false, + false + >; + scope: $.PropertyDesc< + $TriggerScope, + $.Cardinality.One, + false, + false, + false, + false + >; + expr: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + condition: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + subject: $.LinkDesc< + $ObjectType, + $.Cardinality.One, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Trigger = $.ObjectType< + "schema::Trigger", + $TriggerλShape, + null, + [ + ...$InheritingObject["__exclusives__"], + ...$AnnotationSubject["__exclusives__"], + ], + "schema::Trigger" +>; +const $Trigger = $.makeType<$Trigger>( + _.spec, + "2b738231-1ef7-59d0-a04c-dae012181a02", + _.syntax.literal, +); + +const Trigger: $.$expr_PathNode< + $.TypeSet<$Trigger, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Trigger, $.Cardinality.Many), null); + +export type $TupleλShape = $.typeutil.flatten< + $CollectionTypeλShape & { + named: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + false, + false, + false + >; + element_types: $.LinkDesc< + $TupleElement, + $.Cardinality.Many, + { + "@index": $.PropertyDesc<_std.$int64, $.Cardinality.AtMostOne>; + }, + true, + false, + false, + false + >; + } +>; +type $Tuple = $.ObjectType< + "schema::Tuple", + $TupleλShape, + null, + [ + ...$CollectionType["__exclusives__"], + { + element_types: { + __element__: $TupleElement; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "schema::Tuple" | "schema::TupleExprAlias" +>; +const $Tuple = $.makeType<$Tuple>( + _.spec, + "d88b4a0c-9561-56f4-b0a9-7b24027b4de8", + _.syntax.literal, +); + +const Tuple: $.$expr_PathNode< + $.TypeSet<$Tuple, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Tuple, $.Cardinality.Many), null); + +export type $TupleElementλShape = $.typeutil.flatten< + _std.$BaseObjectλShape & { + name: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + type: $.LinkDesc<$Type, $.Cardinality.One, {}, false, false, false, false>; + "; + "; + "; + } +>; +type $TupleElement = $.ObjectType< + "schema::TupleElement", + $TupleElementλShape, + null, + [..._std.$BaseObject["__exclusives__"]], + "schema::TupleElement" +>; +const $TupleElement = $.makeType<$TupleElement>( + _.spec, + "9cc04b0b-11e0-5670-a8a1-441a323e12fb", + _.syntax.literal, +); + +const TupleElement: $.$expr_PathNode< + $.TypeSet<$TupleElement, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($TupleElement, $.Cardinality.Many), null); + +export type $TupleExprAliasλShape = $.typeutil.flatten<$TupleλShape & {}>; +type $TupleExprAlias = $.ObjectType< + "schema::TupleExprAlias", + $TupleExprAliasλShape, + null, + [...$Tuple["__exclusives__"]], + "schema::TupleExprAlias" +>; +const $TupleExprAlias = $.makeType<$TupleExprAlias>( + _.spec, + "b7744aa3-50fc-54e0-ae51-20d78737e25b", + _.syntax.literal, +); + +const TupleExprAlias: $.$expr_PathNode< + $.TypeSet<$TupleExprAlias, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($TupleExprAlias, $.Cardinality.Many), null); + +export { + AccessKind, + AccessPolicyAction, + Cardinality, + IndexDeferrability, + MigrationGeneratedBy, + OperatorKind, + ParameterKind, + RewriteKind, + SourceDeleteAction, + TargetDeleteAction, + TriggerKind, + TriggerScope, + TriggerTiming, + TypeModifier, + Volatility, + $Object_32faaa35947553cf88fce68ecf1be4d9, + Object_32faaa35947553cf88fce68ecf1be4d9, + $SubclassableObject, + SubclassableObject, + $InheritingObject, + InheritingObject, + $AnnotationSubject, + AnnotationSubject, + $AccessPolicy, + AccessPolicy, + $Alias, + Alias, + $Annotation, + Annotation, + $Type, + Type, + $PrimitiveType, + PrimitiveType, + $CollectionType, + CollectionType, + $Array, + Array, + $ArrayExprAlias, + ArrayExprAlias, + $CallableObject, + CallableObject, + $VolatilitySubject, + VolatilitySubject, + $Cast, + Cast, + $ConsistencySubject, + ConsistencySubject, + $Constraint, + Constraint, + $Delta, + Delta, + $Extension, + Extension, + $Function, + Function, + $FutureBehavior, + FutureBehavior, + $Global, + Global, + $Index, + Index, + $Pointer, + Pointer, + $Source, + Source, + $Link, + Link, + $Migration, + Migration, + $Module, + Module, + $MultiRange, + MultiRange, + $MultiRangeExprAlias, + MultiRangeExprAlias, + $ObjectType, + ObjectType, + $Operator, + Operator, + $Parameter, + Parameter, + $Property, + Property, + $PseudoType, + PseudoType, + $Range, + Range, + $RangeExprAlias, + RangeExprAlias, + $Rewrite, + Rewrite, + $ScalarType, + ScalarType, + $Trigger, + Trigger, + $Tuple, + Tuple, + $TupleElement, + TupleElement, + $TupleExprAlias, + TupleExprAlias, +}; + +type __defaultExports = { + AccessKind: typeof AccessKind; + AccessPolicyAction: typeof AccessPolicyAction; + Cardinality: typeof Cardinality; + IndexDeferrability: typeof IndexDeferrability; + MigrationGeneratedBy: typeof MigrationGeneratedBy; + OperatorKind: typeof OperatorKind; + ParameterKind: typeof ParameterKind; + RewriteKind: typeof RewriteKind; + SourceDeleteAction: typeof SourceDeleteAction; + TargetDeleteAction: typeof TargetDeleteAction; + TriggerKind: typeof TriggerKind; + TriggerScope: typeof TriggerScope; + TriggerTiming: typeof TriggerTiming; + TypeModifier: typeof TypeModifier; + Volatility: typeof Volatility; + Object: typeof Object_32faaa35947553cf88fce68ecf1be4d9; + SubclassableObject: typeof SubclassableObject; + InheritingObject: typeof InheritingObject; + AnnotationSubject: typeof AnnotationSubject; + AccessPolicy: typeof AccessPolicy; + Alias: typeof Alias; + Annotation: typeof Annotation; + Type: typeof Type; + PrimitiveType: typeof PrimitiveType; + CollectionType: typeof CollectionType; + Array: typeof Array; + ArrayExprAlias: typeof ArrayExprAlias; + CallableObject: typeof CallableObject; + VolatilitySubject: typeof VolatilitySubject; + Cast: typeof Cast; + ConsistencySubject: typeof ConsistencySubject; + Constraint: typeof Constraint; + Delta: typeof Delta; + Extension: typeof Extension; + Function: typeof Function; + FutureBehavior: typeof FutureBehavior; + Global: typeof Global; + Index: typeof Index; + Pointer: typeof Pointer; + Source: typeof Source; + Link: typeof Link; + Migration: typeof Migration; + Module: typeof Module; + MultiRange: typeof MultiRange; + MultiRangeExprAlias: typeof MultiRangeExprAlias; + ObjectType: typeof ObjectType; + Operator: typeof Operator; + Parameter: typeof Parameter; + Property: typeof Property; + PseudoType: typeof PseudoType; + Range: typeof Range; + RangeExprAlias: typeof RangeExprAlias; + Rewrite: typeof Rewrite; + ScalarType: typeof ScalarType; + Trigger: typeof Trigger; + Tuple: typeof Tuple; + TupleElement: typeof TupleElement; + TupleExprAlias: typeof TupleExprAlias; +}; +const __defaultExports: __defaultExports = { + AccessKind: AccessKind, + AccessPolicyAction: AccessPolicyAction, + Cardinality: Cardinality, + IndexDeferrability: IndexDeferrability, + MigrationGeneratedBy: MigrationGeneratedBy, + OperatorKind: OperatorKind, + ParameterKind: ParameterKind, + RewriteKind: RewriteKind, + SourceDeleteAction: SourceDeleteAction, + TargetDeleteAction: TargetDeleteAction, + TriggerKind: TriggerKind, + TriggerScope: TriggerScope, + TriggerTiming: TriggerTiming, + TypeModifier: TypeModifier, + Volatility: Volatility, + Object: Object_32faaa35947553cf88fce68ecf1be4d9, + SubclassableObject: SubclassableObject, + InheritingObject: InheritingObject, + AnnotationSubject: AnnotationSubject, + AccessPolicy: AccessPolicy, + Alias: Alias, + Annotation: Annotation, + Type: Type, + PrimitiveType: PrimitiveType, + CollectionType: CollectionType, + Array: Array, + ArrayExprAlias: ArrayExprAlias, + CallableObject: CallableObject, + VolatilitySubject: VolatilitySubject, + Cast: Cast, + ConsistencySubject: ConsistencySubject, + Constraint: Constraint, + Delta: Delta, + Extension: Extension, + Function: Function, + FutureBehavior: FutureBehavior, + Global: Global, + Index: Index, + Pointer: Pointer, + Source: Source, + Link: Link, + Migration: Migration, + Module: Module, + MultiRange: MultiRange, + MultiRangeExprAlias: MultiRangeExprAlias, + ObjectType: ObjectType, + Operator: Operator, + Parameter: Parameter, + Property: Property, + PseudoType: PseudoType, + Range: Range, + RangeExprAlias: RangeExprAlias, + Rewrite: Rewrite, + ScalarType: ScalarType, + Trigger: Trigger, + Tuple: Tuple, + TupleElement: TupleElement, + TupleExprAlias: TupleExprAlias, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std.ts b/starters/features/gel/dbschema/edgeql-js/modules/std.ts new file mode 100644 index 00000000000..23ca4bbf918 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std.ts @@ -0,0 +1,9423 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import _module__cal from "./std/cal"; +import _module__enc from "./std/enc"; +import _module__fts from "./std/fts"; +import _module__net from "./std/net"; +import _module__pg from "./std/pg"; +import _module__math from "./std/math"; +import type * as _cfg from "./cfg"; +import type * as _stdcal from "./std/cal"; +import type * as _stdpg from "./std/pg"; +import type * as _schema from "./schema"; +type $anyscalar = + | $anypoint + | $anyreal + | $.EnumType + | $bool + | $bytes + | $uuid + | $str + | $json + | _cfg.$memory + | _stdcal.$local_time + | _stdcal.$relative_duration + | _stdcal.$date_duration + | _stdpg.$json; + +export type $Endian = { + Little: $.$expr_Literal<$Endian>; + Big: $.$expr_Literal<$Endian>; +} & $.EnumType<"std::Endian", ["Little", "Big"]>; +const Endian: $Endian = $.makeType<$Endian>( + _.spec, + "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + _.syntax.literal, +); + +export type $JsonEmpty = { + ReturnEmpty: $.$expr_Literal<$JsonEmpty>; + ReturnTarget: $.$expr_Literal<$JsonEmpty>; + Error: $.$expr_Literal<$JsonEmpty>; + UseNull: $.$expr_Literal<$JsonEmpty>; + DeleteKey: $.$expr_Literal<$JsonEmpty>; +} & $.EnumType< + "std::JsonEmpty", + ["ReturnEmpty", "ReturnTarget", "Error", "UseNull", "DeleteKey"] +>; +const JsonEmpty: $JsonEmpty = $.makeType<$JsonEmpty>( + _.spec, + "584feb89-c83d-561d-aa78-24e6d779f044", + _.syntax.literal, +); + +type $anypoint = $anydiscrete | $anycontiguous; + +type $anycontiguous = + | $anyfloat + | $datetime + | $duration + | $decimal + | _stdcal.$local_datetime + | _stdpg.$timestamptz + | _stdpg.$timestamp + | _stdpg.$interval; + +type $anydiscrete = $number | _stdcal.$local_date | _stdpg.$date; + +type $anyreal = $anyint | $anyfloat | $anynumeric; + +type $anyfloat = $number; + +type $anyint = $number | $bigint; + +type $anynumeric = $decimal | $bigint; + +export type $bigint = $.ScalarType<"std::bigint", bigint>; +const bigint: $.scalarTypeWithConstructor<$bigint, never> = $.makeType< + $.scalarTypeWithConstructor<$bigint, never> +>(_.spec, "00000000-0000-0000-0000-000000000110", _.syntax.literal); + +export type $bool = $.ScalarType<"std::bool", boolean>; +const bool: $.scalarTypeWithConstructor<$bool, never> = $.makeType< + $.scalarTypeWithConstructor<$bool, never> +>(_.spec, "00000000-0000-0000-0000-000000000109", _.syntax.literal); + +export type $bytes = $.ScalarType<"std::bytes", Uint8Array>; +const bytes: $.scalarTypeWithConstructor<$bytes, never> = $.makeType< + $.scalarTypeWithConstructor<$bytes, never> +>(_.spec, "00000000-0000-0000-0000-000000000102", _.syntax.literal); + +export type $datetime = $.ScalarType<"std::datetime", Date>; +const datetime: $.scalarTypeWithConstructor<$datetime, string> = $.makeType< + $.scalarTypeWithConstructor<$datetime, string> +>(_.spec, "00000000-0000-0000-0000-00000000010a", _.syntax.literal); + +export type $decimal = $.ScalarType<"std::decimal", string>; +const decimal: $.scalarTypeWithConstructor<$decimal, never> = $.makeType< + $.scalarTypeWithConstructor<$decimal, never> +>(_.spec, "00000000-0000-0000-0000-000000000108", _.syntax.literal); +export type $decimalλICastableTo = $decimal | $bigint; +export type $decimalλIAssignableBy = $decimal | $bigint; + +export type $duration = $.ScalarType<"std::duration", _.gel.Duration>; +const duration: $.scalarTypeWithConstructor<$duration, string> = $.makeType< + $.scalarTypeWithConstructor<$duration, string> +>(_.spec, "00000000-0000-0000-0000-00000000010e", _.syntax.literal); + +export type $float32 = $.ScalarType<"std::number", number>; +const float32: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-000000000106", _.syntax.literal); + +export type $float64 = $.ScalarType<"std::number", number>; +const float64: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-000000000107", _.syntax.literal); + +export type $int16 = $.ScalarType<"std::number", number>; +const int16: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-000000000103", _.syntax.literal); + +export type $int32 = $.ScalarType<"std::number", number>; +const int32: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-000000000104", _.syntax.literal); + +export type $int64 = $.ScalarType<"std::number", number>; +const int64: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-000000000105", _.syntax.literal); + +export type $json = $.ScalarType<"std::json", unknown>; +const json: $.scalarTypeWithConstructor<$json, never> = $.makeType< + $.scalarTypeWithConstructor<$json, never> +>(_.spec, "00000000-0000-0000-0000-00000000010f", _.syntax.literal); + +interface $sequence extends $int64 {} +const $sequence: $sequence = $.makeType<$sequence>( + _.spec, + "fd1c52ea-74a9-541b-88e2-378d1edb02fd", + _.syntax.literal, +); + +export type $str = $.ScalarType<"std::str", string>; +const str: $.scalarTypeWithConstructor<$str, never> = $.makeType< + $.scalarTypeWithConstructor<$str, never> +>(_.spec, "00000000-0000-0000-0000-000000000101", _.syntax.literal); + +export type $uuid = $.ScalarType<"std::uuid", string>; +const uuid: $.scalarTypeWithConstructor<$uuid, never> = $.makeType< + $.scalarTypeWithConstructor<$uuid, never> +>(_.spec, "00000000-0000-0000-0000-000000000100", _.syntax.literal); + +export type $number = $.ScalarType<"std::number", number>; +const number: $.scalarTypeWithConstructor<$number, string> = $.makeType< + $.scalarTypeWithConstructor<$number, string> +>(_.spec, "00000000-0000-0000-0000-0000000001ff", _.syntax.literal); + +export type $BaseObjectλShape = $.typeutil.flatten<{ + id: $.PropertyDesc<$uuid, $.Cardinality.One, true, false, true, true>; + __type__: $.LinkDesc< + _schema.$ObjectType, + $.Cardinality.One, + {}, + false, + false, + true, + false + >; +}>; +type $BaseObject = $.ObjectType< + "std::BaseObject", + $BaseObjectλShape, + null, + [ + { + id: { + __element__: $uuid; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + | "cfg::Auth" + | "cfg::DatabaseConfig" + | "cfg::BranchConfig" + | "cfg::Config" + | "cfg::InstanceConfig" + | "cfg::JWT" + | "cfg::Password" + | "cfg::SCRAM" + | "cfg::SMTPProviderConfig" + | "cfg::Trust" + | "cfg::mTLS" + | "schema::AccessPolicy" + | "schema::Alias" + | "schema::Annotation" + | "schema::Array" + | "schema::ArrayExprAlias" + | "schema::Cast" + | "schema::Constraint" + | "schema::Delta" + | "schema::Extension" + | "schema::Function" + | "schema::FutureBehavior" + | "schema::Global" + | "schema::Index" + | "schema::Link" + | "schema::Migration" + | "schema::Module" + | "schema::MultiRange" + | "schema::MultiRangeExprAlias" + | "schema::ObjectType" + | "schema::Operator" + | "schema::Parameter" + | "schema::Property" + | "schema::PseudoType" + | "schema::Range" + | "schema::RangeExprAlias" + | "schema::Rewrite" + | "schema::ScalarType" + | "schema::Trigger" + | "schema::Tuple" + | "schema::TupleElement" + | "schema::TupleExprAlias" + | "std::net::http::Response" + | "std::net::http::ScheduledRequest" + | "sys::Branch" + | "sys::Database" + | "sys::ExtensionPackage" + | "sys::ExtensionPackageMigration" + | "sys::QueryStats" + | "sys::Role" +>; +const $BaseObject = $.makeType<$BaseObject>( + _.spec, + "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + _.syntax.literal, +); + +const BaseObject: $.$expr_PathNode< + $.TypeSet<$BaseObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($BaseObject, $.Cardinality.Many), null); + +export type $FreeObjectλShape = $.typeutil.flatten<{}>; +type $FreeObject = $.ObjectType< + "std::FreeObject", + $FreeObjectλShape, + null, + [], + "std::FreeObject" +>; +const $FreeObject = $.makeType<$FreeObject>( + _.spec, + "3b741934-07ef-5b95-b7d6-cdc864fd2ae8", + _.syntax.literal, +); + +const FreeObject: $.$expr_PathNode< + $.TypeSet<$FreeObject, $.Cardinality.One>, + null +> = _.syntax.$PathNode($.$toSet($FreeObject, $.Cardinality.One), null); + +export type $Object_8ce8c71ee4fa5f73840c22d7eaa58588λShape = $.typeutil.flatten< + $BaseObjectλShape & {} +>; +type $Object_8ce8c71ee4fa5f73840c22d7eaa58588 = $.ObjectType< + "std::Object", + $Object_8ce8c71ee4fa5f73840c22d7eaa58588λShape, + null, + [...$BaseObject["__exclusives__"]], + never +>; +export type $Object = $Object_8ce8c71ee4fa5f73840c22d7eaa58588; +const $Object_8ce8c71ee4fa5f73840c22d7eaa58588 = + $.makeType<$Object_8ce8c71ee4fa5f73840c22d7eaa58588>( + _.spec, + "8ce8c71e-e4fa-5f73-840c-22d7eaa58588", + _.syntax.literal, + ); + +const Object_8ce8c71ee4fa5f73840c22d7eaa58588: $.$expr_PathNode< + $.TypeSet<$Object_8ce8c71ee4fa5f73840c22d7eaa58588, $.Cardinality.Many>, + null +> = _.syntax.$PathNode( + $.$toSet($Object_8ce8c71ee4fa5f73840c22d7eaa58588, $.Cardinality.Many), + null, +); + +type assert_singleλFuncExpr< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.multiplyCardinalities< + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One">, + $.cardutil.optionalParamCardinality + > +>; +type assert_singleλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Check that the input set contains at most one element, raise + CardinalityViolationError otherwise. + */ +function assert_single< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(namedArgs: NamedArgs, input: P1): assert_singleλFuncExpr; +/** + * Check that the input set contains at most one element, raise + CardinalityViolationError otherwise. + */ +function assert_single< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(input: P1): assert_singleλFuncExpr2; +function assert_single(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::assert_single", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + namedArgs: { + message: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_single", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type assert_existsλFuncExpr< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "One"> +>; +type assert_existsλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Check that the input set contains at least one element, raise + CardinalityViolationError otherwise. + */ +function assert_exists< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(namedArgs: NamedArgs, input: P1): assert_existsλFuncExpr; +/** + * Check that the input set contains at least one element, raise + CardinalityViolationError otherwise. + */ +function assert_exists< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(input: P1): assert_existsλFuncExpr2; +function assert_exists(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::assert_exists", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + namedArgs: { + message: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_exists", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type assert_distinctλFuncExpr< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.Cardinality.Many +>; +type assert_distinctλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.Cardinality.Many +>; +/** + * Check that the input set is a proper set, i.e. all elements + are unique + */ +function assert_distinct< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(namedArgs: NamedArgs, input: P1): assert_distinctλFuncExpr; +/** + * Check that the input set is a proper set, i.e. all elements + are unique + */ +function assert_distinct< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(input: P1): assert_distinctλFuncExpr2; +function assert_distinct(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::assert_distinct", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + namedArgs: { + message: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + preservesOptionality: true, + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert_distinct", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type assertλFuncExpr< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type assertλFuncExpr2>> = + $.$expr_Function<$bool, $.cardutil.paramCardinality>; +/** + * Assert that a boolean value is true. + */ +function assert< + NamedArgs extends { + message?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bool>>, +>(namedArgs: NamedArgs, input: P1): assertλFuncExpr; +/** + * Assert that a boolean value is true. + */ +function assert>>( + input: P1, +): assertλFuncExpr2; +function assert(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::assert", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + message: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::assert", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type materializedλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.paramCardinality +>; +/** + * Force materialization of a set. + */ +function materialized< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(input: P1): materializedλFuncExpr; +function materialized(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::materialized", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::materialized", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type lenλFuncExpr>> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +type lenλFuncExpr2>> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +type lenλFuncExpr3>> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len>>( + str: P1, +): lenλFuncExpr; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len>>( + bytes: P1, +): lenλFuncExpr2; +/** + * A polymorphic function to calculate a "length" of its first argument. + */ +function len>>( + array: P1, +): lenλFuncExpr3; +function len(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::len", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::len", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type sumλFuncExpr>> = + $.$expr_Function<$bigint, $.Cardinality.One>; +type sumλFuncExpr2>> = + $.$expr_Function<$number, $.Cardinality.One>; +type sumλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function<$decimal, $.Cardinality.One>; +/** + * Return the sum of the set of numbers. + */ +function sum>>( + s: P1, +): sumλFuncExpr; +/** + * Return the sum of the set of numbers. + */ +function sum>>( + s: P1, +): sumλFuncExpr2; +/** + * Return the sum of the set of numbers. + */ +function sum< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>(s: P1): sumλFuncExpr3; +function sum(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::sum", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sum", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type countλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function<$number, $.Cardinality.One>; +/** + * Return the number of elements in a set. + */ +function count>>( + s: P1, +): countλFuncExpr; +function count(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::count", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::count", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type randomλFuncExpr = $.$expr_Function<$number, $.Cardinality.One>; +/** + * Return a pseudo-random number in the range `0.0 <= x < 1.0` + */ +function random(): randomλFuncExpr; +function random(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::random", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-0000000001ff" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::random", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type minλFuncExpr>> = + $.$expr_Function< + $anyreal, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type minλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +> = $.$expr_Function< + $.EnumType, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr3>> = + $.$expr_Function< + $str, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type minλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +> = $.$expr_Function< + $datetime, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr6< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +> = $.$expr_Function< + _stdcal.$local_date, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, +> = $.$expr_Function< + _stdcal.$local_time, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +> = $.$expr_Function< + _stdcal.$date_duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr9< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_stdcal.$local_datetime>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr10>> = + $.$expr_Function< + $.ArrayType<_stdcal.$local_date>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type minλFuncExpr11>> = + $.$expr_Function< + $.ArrayType<_stdcal.$local_time>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type minλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_stdcal.$relative_duration>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr13>> = + $.$expr_Function< + $.ArrayType<_stdcal.$date_duration>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type minλFuncExpr14< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, +> = $.$expr_Function< + _stdcal.$local_datetime, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr15< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +> = $.$expr_Function< + _stdcal.$relative_duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type minλFuncExpr16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr2; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr3; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr4; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr5; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +>(vals: P1): minλFuncExpr6; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, +>(vals: P1): minλFuncExpr7; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +>(vals: P1): minλFuncExpr8; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, +>(vals: P1): minλFuncExpr9; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr10; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr11; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, +>(vals: P1): minλFuncExpr12; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr13; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, +>(vals: P1): minλFuncExpr14; +/** + * Return the smallest value of the input set. + */ +function min< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +>(vals: P1): minλFuncExpr15; +/** + * Return the smallest value of the input set. + */ +function min>>( + vals: P1, +): minλFuncExpr16; +function min(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::min", args, _.spec, [ + { + args: [ + { + typeId: "04976545-1176-5536-8673-c9f7d18d581b", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "04976545-1176-5536-8673-c9f7d18d581b", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "c05958e2-0753-5a63-b7c4-db3626b0d6b5", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "c05958e2-0753-5a63-b7c4-db3626b0d6b5", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "8571477b-d954-5809-b360-4b1f03253699", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "8571477b-d954-5809-b360-4b1f03253699", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "75ba1b6e-7f51-5c49-b955-e32f20e4f72e", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "75ba1b6e-7f51-5c49-b955-e32f20e4f72e", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "d50ba716-d5fd-5f69-8afe-9c82fe7436d9", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "d50ba716-d5fd-5f69-8afe-9c82fe7436d9", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "5b410a6f-a231-524b-8682-4ce2020c1d98", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "5b410a6f-a231-524b-8682-4ce2020c1d98", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::min", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type maxλFuncExpr>> = + $.$expr_Function< + $anyreal, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type maxλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>, +> = $.$expr_Function< + $.EnumType, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr3>> = + $.$expr_Function< + $str, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type maxλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, +> = $.$expr_Function< + $datetime, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function< + $duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr6< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +> = $.$expr_Function< + _stdcal.$local_date, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, +> = $.$expr_Function< + _stdcal.$local_time, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +> = $.$expr_Function< + _stdcal.$date_duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr9< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_stdcal.$local_datetime>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr10>> = + $.$expr_Function< + $.ArrayType<_stdcal.$local_date>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type maxλFuncExpr11>> = + $.$expr_Function< + $.ArrayType<_stdcal.$local_time>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type maxλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, +> = $.$expr_Function< + $.ArrayType<_stdcal.$relative_duration>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr13>> = + $.$expr_Function< + $.ArrayType<_stdcal.$date_duration>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> + >; +type maxλFuncExpr14< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, +> = $.$expr_Function< + _stdcal.$local_datetime, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr15< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +> = $.$expr_Function< + _stdcal.$relative_duration, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +type maxλFuncExpr16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.overrideUpperBound<$.cardutil.paramCardinality, "One"> +>; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr2; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr3; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr4; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr5; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +>(vals: P1): maxλFuncExpr6; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, +>(vals: P1): maxλFuncExpr7; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +>(vals: P1): maxλFuncExpr8; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, +>(vals: P1): maxλFuncExpr9; +/** + * Return the smallest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr10; +/** + * Return the smallest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr11; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, +>(vals: P1): maxλFuncExpr12; +/** + * Return the smallest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr13; +/** + * Return the smallest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, +>(vals: P1): maxλFuncExpr14; +/** + * Return the greatest value of the input set. + */ +function max< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +>(vals: P1): maxλFuncExpr15; +/** + * Return the greatest value of the input set. + */ +function max>>( + vals: P1, +): maxλFuncExpr16; +function max(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::max", args, _.spec, [ + { + args: [ + { + typeId: "04976545-1176-5536-8673-c9f7d18d581b", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "04976545-1176-5536-8673-c9f7d18d581b", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "c05958e2-0753-5a63-b7c4-db3626b0d6b5", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "c05958e2-0753-5a63-b7c4-db3626b0d6b5", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "8571477b-d954-5809-b360-4b1f03253699", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "8571477b-d954-5809-b360-4b1f03253699", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "75ba1b6e-7f51-5c49-b955-e32f20e4f72e", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "75ba1b6e-7f51-5c49-b955-e32f20e4f72e", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "d50ba716-d5fd-5f69-8afe-9c82fe7436d9", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "d50ba716-d5fd-5f69-8afe-9c82fe7436d9", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "5b410a6f-a231-524b-8682-4ce2020c1d98", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "5b410a6f-a231-524b-8682-4ce2020c1d98", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "OptionalType", + preservesOptionality: true, + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::max", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type allλFuncExpr>> = + $.$expr_Function<$bool, $.Cardinality.One>; +/** + * Generalized boolean `AND` applied to the set of *values*. + */ +function all>>( + vals: P1, +): allλFuncExpr; +function all(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::all", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::all", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type anyλFuncExpr>> = + $.$expr_Function<$bool, $.Cardinality.One>; +/** + * Generalized boolean `OR` applied to the set of *values*. + */ +function any>>( + vals: P1, +): anyλFuncExpr; +function any(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::any", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::any", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type enumerateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> = $.$expr_Function< + $.TupleType< + [ + $int64, + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + ] + >, + $.Cardinality.Many +>; +/** + * Return a set of tuples of the form `(index, element)`. + */ +function enumerate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +>(vals: P1): enumerateλFuncExpr; +function enumerate(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::enumerate", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "e34cf562-ee0c-58d3-a1ee-ff9fbb35bfc3", + returnTypemod: "SetOfType", + preservesOptionality: true, + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::enumerate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type roundλFuncExpr>> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +type roundλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, +> = $.$expr_Function<$bigint, $.cardutil.paramCardinality>; +type roundλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function<$decimal, $.cardutil.paramCardinality>; +type roundλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $decimal, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Round to the nearest value. + */ +function round>>( + val: P1, +): roundλFuncExpr; +/** + * Round to the nearest value. + */ +function round>>( + val: P1, +): roundλFuncExpr2; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>(val: P1): roundλFuncExpr3; +/** + * Round to the nearest value. + */ +function round< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, d: P2): roundλFuncExpr4; +function round(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::round", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::round", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type containsλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr4< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr5< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr6< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr7< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr8< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr9< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr10< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr11< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr13< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr14< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr15< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type containsλFuncExpr16< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(haystack: P1, needle: P2): containsλFuncExpr; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>(haystack: P1, needle: P2): containsλFuncExpr2; +/** + * A polymorphic function to test if one JSON value contains another JSON value. + */ +function contains< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>(haystack: P1, needle: P2): containsλFuncExpr3; +function contains< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr4; +function contains< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr5; +function contains< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr6; +function contains< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr7; +function contains< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr8; +function contains< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +>(haystack: P1, needle: P2): containsλFuncExpr9; +function contains< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, +>(haystack: P1, needle: P2): containsλFuncExpr10; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +>(haystack: P1, needle: P2): containsλFuncExpr11; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +>(haystack: P1, needle: P2): containsλFuncExpr12; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, +>(haystack: P1, needle: P2): containsλFuncExpr13; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, +>(haystack: P1, needle: P2): containsλFuncExpr14; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, +>(haystack: P1, needle: P2): containsλFuncExpr15; +/** + * A polymorphic function to test if a sequence contains a certain element. + */ +function contains< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +>(haystack: P1, needle: P2): containsλFuncExpr16; +function contains(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::contains", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "581b0325-a044-58d4-aa37-3a85ea671313", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "581b0325-a044-58d4-aa37-3a85ea671313", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "74568c88-a8c3-5a02-9acd-64616d07ab8b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::contains", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_fillλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.ArrayType< + $.getPrimitiveNonArrayBaseType< + _.castMaps.literalToTypeSet["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Return an array filled with the given value repeated as many times as specified. + */ +function array_fill< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, n: P2): array_fillλFuncExpr; +function array_fill(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_fill", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_fill", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type findλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type findλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type findλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type findλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type findλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type findλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type findλFuncExpr7< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type findλFuncExpr8< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(haystack: P1, needle: P2): findλFuncExpr; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>(haystack: P1, needle: P2): findλFuncExpr2; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr3; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr4; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr5; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr6; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr7; +/** + * A polymorphic function to find index of an element in a sequence. + */ +function find< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>> | undefined, +>(haystack: P1, needle: P2, from_pos?: P3): findλFuncExpr8; +function find(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::find", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::find", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_andλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Bitwise AND operator for 16-bit integers. + */ +function bit_and< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(l: P1, r: P2): bit_andλFuncExpr; +function bit_and(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_and", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_and", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_orλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Bitwise OR operator for 16-bit integers. + */ +function bit_or< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(l: P1, r: P2): bit_orλFuncExpr; +function bit_or(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_or", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_or", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_xorλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Bitwise exclusive OR operator for 16-bit integers. + */ +function bit_xor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(l: P1, r: P2): bit_xorλFuncExpr; +function bit_xor(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_xor", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_xor", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_notλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.cardutil.paramCardinality>; +/** + * Bitwise NOT operator for 16-bit integers. + */ +function bit_not>>( + r: P1, +): bit_notλFuncExpr; +function bit_not(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_not", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_not", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_rshiftλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Bitwise right-shift operator for 16-bit integers. + */ +function bit_rshift< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, n: P2): bit_rshiftλFuncExpr; +function bit_rshift(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_rshift", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_rshift", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_lshiftλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Bitwise left-shift operator for 16-bit integers. + */ +function bit_lshift< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, n: P2): bit_lshiftλFuncExpr; +function bit_lshift(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_lshift", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_lshift", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bit_countλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.cardutil.paramCardinality>; +type bit_countλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function<$number, $.cardutil.paramCardinality>; +/** + * Count the number of set bits in a 16-bit integer. + */ +function bit_count>>( + val: P1, +): bit_countλFuncExpr; +/** + * Count the number of set bits the bytes value. + */ +function bit_count>>( + bytes: P1, +): bit_countλFuncExpr2; +function bit_count(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bit_count", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bit_count", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_aggλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, +> = $.$expr_Function< + $.ArrayType< + $.getPrimitiveNonArrayBaseType< + _.castMaps.literalToTypeSet["__element__"] + > + >, + $.Cardinality.One +>; +/** + * Return the array made from all of the input set elements. + */ +function array_agg< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$.NonArrayType>>, +>(s: P1): array_aggλFuncExpr; +function array_agg(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_agg", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_agg", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_unpackλFuncExpr>> = + $.$expr_Function< + $.getPrimitiveNonArrayBaseType, + $.Cardinality.Many + >; +/** + * Return array elements as a set. + */ +function array_unpack>>( + array: P1, +): array_unpackλFuncExpr; +function array_unpack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_unpack", args, _.spec, [ + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_replaceλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P2["__element__"] + >, + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_replaceλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P2["__element__"] + >, + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_replaceλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P2["__element__"] + >, + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_replaceλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.mergeObjectTypes< + _.syntax.mergeObjectTypes< + P1["__element__"]["__element__"], + P2["__element__"] + >, + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_replaceλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P2["__element__"] + >, + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_replaceλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType>, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr2; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends $.TypeSet<$decimalλICastableTo>, + P3 extends $.TypeSet<$decimalλICastableTo>, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr3; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends $.TypeSet<$.ObjectType>, + P3 extends $.TypeSet<$.ObjectType>, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr4; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends $.TypeSet<$.AnyTupleType>, + P3 extends $.TypeSet<$.AnyTupleType>, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr5; +/** + * Replace each array element equal to the second argument with the third argument. + */ +function array_replace< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +>(array: P1, old: P2, new_2: P3): array_replaceλFuncExpr6; +function array_replace(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_replace", args, _.spec, [ + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_getλFuncExpr< + NamedArgs extends { + default?: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive< + NamedArgs["default"] extends $.TypeSet + ? NamedArgs["default"]["__element__"] + : undefined, + P1["__element__"]["__element__"] + >, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr3< + NamedArgs extends { + default?: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive< + NamedArgs["default"] extends $.TypeSet + ? NamedArgs["default"]["__element__"] + : undefined, + P1["__element__"]["__element__"] + >, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr5< + NamedArgs extends { + default?: $.TypeSet<$decimalλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive< + NamedArgs["default"] extends $.TypeSet + ? NamedArgs["default"]["__element__"] + : undefined, + P1["__element__"]["__element__"] + >, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr7< + NamedArgs extends { + default?: $.TypeSet<$.ObjectType>; + }, + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.mergeObjectTypes< + NamedArgs["default"] extends $.TypeSet + ? NamedArgs["default"]["__element__"] + : undefined, + P1["__element__"]["__element__"] + >, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr8< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr9< + NamedArgs extends { + default?: $.TypeSet<$.AnyTupleType>; + }, + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + _.syntax.getSharedParentPrimitive< + NamedArgs["default"] extends $.TypeSet + ? NamedArgs["default"]["__element__"] + : undefined, + P1["__element__"]["__element__"] + >, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr10< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + P1["__element__"]["__element__"], + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr11< + NamedArgs extends { + default?: _.castMaps.orScalarLiteral< + $.TypeSet< + $.getPrimitiveNonArrayBaseType + > + >; + }, + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.getPrimitiveNonArrayBaseType, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type array_getλFuncExpr12< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $.getPrimitiveNonArrayBaseType, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr2; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr3; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr4; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: $.TypeSet<$decimalλICastableTo>; + }, + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr5; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr6; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: $.TypeSet<$.ObjectType>; + }, + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr7; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr8; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: $.TypeSet<$.AnyTupleType>; + }, + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr9; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr10; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + NamedArgs extends { + default?: _.castMaps.orScalarLiteral< + $.TypeSet< + $.getPrimitiveNonArrayBaseType + > + >; + }, + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + namedArgs: NamedArgs, + array: P1, + idx: P2, +): array_getλFuncExpr11; +/** + * Return the element of *array* at the specified *index*. + */ +function array_get< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(array: P1, idx: P2): array_getλFuncExpr12; +function array_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_get", args, _.spec, [ + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + default: { + typeId: "00000000-0000-0000-0000-000000000001", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_setλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_setλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_setλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_setλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.mergeObjectTypes< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_setλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_setλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType>, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr2; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$decimalλICastableTo>, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr3; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.ObjectType>, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr4; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.AnyTupleType>, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr5; +/** + * Set the element of *array* at the specified *index*. + */ +function array_set< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +>(array: P1, idx: P2, val: P3): array_setλFuncExpr6; +function array_set(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_set", args, _.spec, [ + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_set", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_insertλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_insertλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_insertλFuncExpr3< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$decimalλICastableTo>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_insertλFuncExpr4< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.ObjectType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.mergeObjectTypes< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_insertλFuncExpr5< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.AnyTupleType>, +> = $.$expr_Function< + $.ArrayType< + _.syntax.getSharedParentPrimitive< + P1["__element__"]["__element__"], + P3["__element__"] + > + >, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type array_insertλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +> = $.$expr_Function< + $.ArrayType<$.getPrimitiveNonArrayBaseType>, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$relative_durationλICastableTo>, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<_stdcal.$local_datetimeλICastableTo>, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr2; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$decimalλICastableTo>, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr3; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<$.ObjectType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.ObjectType>, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr4; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<$.AnyTupleType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends $.TypeSet<$.AnyTupleType>, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr5; +/** + * Insert *val* at the specified *index* of the *array*. + */ +function array_insert< + P1 extends $.TypeSet<$.ArrayType<$.NonArrayType>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral< + $.TypeSet<$.getPrimitiveNonArrayBaseType> + >, +>(array: P1, idx: P2, val: P3): array_insertλFuncExpr6; +function array_insert(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_insert", args, _.spec, [ + { + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_insert", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type array_joinλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type array_joinλFuncExpr2< + P1 extends $.TypeSet<$.ArrayType<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function< + $bytes, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Render an array to a string. + */ +function array_join< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(array: P1, delimiter: P2): array_joinλFuncExpr; +/** + * Render an array to a byte-string. + */ +function array_join< + P1 extends $.TypeSet<$.ArrayType<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +>(array: P1, delimiter: P2): array_joinλFuncExpr2; +function array_join(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::array_join", args, _.spec, [ + { + args: [ + { + typeId: "bb221d39-09f1-507e-8851-62075bb61823", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "48aa45ef-4d93-5fbd-bfb5-81bf67b49eab", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::array_join", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bytes_get_bitλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Get the *nth* bit of the *bytes* value. + */ +function bytes_get_bit< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(bytes: P1, num: P2): bytes_get_bitλFuncExpr; +function bytes_get_bit(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bytes_get_bit", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bytes_get_bit", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type datetime_currentλFuncExpr = $.$expr_Function<$datetime, $.Cardinality.One>; +/** + * Return the current server date and time. + */ +function datetime_current(): datetime_currentλFuncExpr; +function datetime_current(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::datetime_current", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_current", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type datetime_of_transactionλFuncExpr = $.$expr_Function< + $datetime, + $.Cardinality.One +>; +/** + * Return the date and time of the start of the current transaction. + */ +function datetime_of_transaction(): datetime_of_transactionλFuncExpr; +function datetime_of_transaction(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::datetime_of_transaction", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_of_transaction", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type datetime_of_statementλFuncExpr = $.$expr_Function< + $datetime, + $.Cardinality.One +>; +/** + * Return the date and time of the start of the current statement. + */ +function datetime_of_statement(): datetime_of_statementλFuncExpr; +function datetime_of_statement(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::datetime_of_statement", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-00000000010a" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_of_statement", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type datetime_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type datetime_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Extract a specific element of input datetime by name. + */ +function datetime_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, el: P2): datetime_getλFuncExpr; +/** + * Extract a specific element of input datetime by name. + */ +function datetime_get< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, el: P2): datetime_getλFuncExpr2; +function datetime_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::datetime_get", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type datetime_truncateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Truncate the input datetime to a particular precision. + */ +function datetime_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, unit: P2): datetime_truncateλFuncExpr; +function datetime_truncate(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::datetime_truncate", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::datetime_truncate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_pad_startλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string padded at the start to the length *n*. + */ +function str_pad_start< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, n: P2, fill?: P3): str_pad_startλFuncExpr; +function str_pad_start(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_pad_start", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_pad_start", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_lpadλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string left-padded to the length *n*. + */ +function str_lpad< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, n: P2, fill?: P3): str_lpadλFuncExpr; +function str_lpad(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_lpad", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_lpad", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type duration_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type duration_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type duration_getλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, el: P2): duration_getλFuncExpr; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, el: P2): duration_getλFuncExpr2; +/** + * Extract a specific element of input duration by name. + */ +function duration_get< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, el: P2): duration_getλFuncExpr3; +function duration_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::duration_get", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type duration_truncateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $duration, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type duration_truncateλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + _stdcal.$date_duration, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type duration_truncateλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + _stdcal.$relative_duration, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, unit: P2): duration_truncateλFuncExpr; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, unit: P2): duration_truncateλFuncExpr2; +/** + * Truncate the input duration to a particular precision. + */ +function duration_truncate< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(dt: P1, unit: P2): duration_truncateλFuncExpr3; +function duration_truncate(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::duration_truncate", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_truncate", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type duration_to_secondsλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function<$decimal, $.cardutil.paramCardinality>; +/** + * Return duration as total number of seconds in interval. + */ +function duration_to_seconds< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>(dur: P1): duration_to_secondsλFuncExpr; +function duration_to_seconds(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::duration_to_seconds", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::duration_to_seconds", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_typeofλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function<$str, $.cardutil.paramCardinality>; +/** + * Return the type of the outermost JSON value as a string. + */ +function json_typeof>>( + json: P1, +): json_typeofλFuncExpr; +function json_typeof(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_typeof", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_typeof", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_array_unpackλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function<$json, $.Cardinality.Many>; +/** + * Return elements of JSON array as a set of `json`. + */ +function json_array_unpack< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>(array: P1): json_array_unpackλFuncExpr; +function json_array_unpack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_array_unpack", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010f", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_array_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_object_unpackλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function<$.TupleType<[$str, $json]>, $.Cardinality.Many>; +/** + * Return set of key/value tuples that make up the JSON object. + */ +function json_object_unpack< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +>(obj: P1): json_object_unpackλFuncExpr; +function json_object_unpack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_object_unpack", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "416fe1a6-d62c-5481-80cd-2102a37b3415", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_object_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_object_packλFuncExpr< + P1 extends $.TypeSet<$.TupleType<[$str, $json]>>, +> = $.$expr_Function<$json, $.Cardinality.One>; +/** + * Return a JSON object with set key/value pairs. + */ +function json_object_pack>>( + pairs: P1, +): json_object_packλFuncExpr; +function json_object_pack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_object_pack", args, _.spec, [ + { + args: [ + { + typeId: "416fe1a6-d62c-5481-80cd-2102a37b3415", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010f", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_object_pack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_getλFuncExpr< + NamedArgs extends { + default?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +> = $.$expr_Function< + $json, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramArrayCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type json_getλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +> = $.$expr_Function< + $json, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramArrayCardinality + >, + "Zero" + > +>; +/** + * Return the JSON value at the end of the specified path or an empty set. + */ +function json_get< + NamedArgs extends { + default?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +>( + namedArgs: NamedArgs, + json: P1, + ...path: P2 +): json_getλFuncExpr; +/** + * Return the JSON value at the end of the specified path or an empty set. + */ +function json_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +>(json: P1, ...path: P2): json_getλFuncExpr2; +function json_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_get", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: true, + }, + ], + namedArgs: { + default: { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-00000000010f", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type json_setλFuncExpr< + NamedArgs extends { + value?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>; + create_if_missing?: _.castMaps.orScalarLiteral<$.TypeSet<$bool>>; + empty_treatment?: _.castMaps.orScalarLiteral<$.TypeSet<$JsonEmpty>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +> = $.$expr_Function< + $json, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramArrayCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type json_setλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +> = $.$expr_Function< + $json, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramArrayCardinality + >, + "Zero" + > +>; +/** + * Return an updated JSON target with a new value. + */ +function json_set< + NamedArgs extends { + value?: _.castMaps.orScalarLiteral<$.TypeSet<$json>>; + create_if_missing?: _.castMaps.orScalarLiteral<$.TypeSet<$bool>>; + empty_treatment?: _.castMaps.orScalarLiteral<$.TypeSet<$JsonEmpty>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +>( + namedArgs: NamedArgs, + target: P1, + ...path: P2 +): json_setλFuncExpr; +/** + * Return an updated JSON target with a new value. + */ +function json_set< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends [ + _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + ..._.castMaps.orScalarLiteral<$.TypeSet<$str>>[], + ], +>(target: P1, ...path: P2): json_setλFuncExpr2; +function json_set(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::json_set", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: true, + }, + ], + namedArgs: { + value: { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + create_if_missing: { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + empty_treatment: { + typeId: "584feb89-c83d-561d-aa78-24e6d779f044", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-00000000010f", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::json_set", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type re_matchλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $.ArrayType<$str>, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Find the first regular expression match in a string. + */ +function re_match< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(pattern: P1, str: P2): re_matchλFuncExpr; +function re_match(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::re_match", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "bb221d39-09f1-507e-8851-62075bb61823", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_match", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type re_match_allλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function<$.ArrayType<$str>, $.Cardinality.Many>; +/** + * Find all regular expression matches in a string. + */ +function re_match_all< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(pattern: P1, str: P2): re_match_allλFuncExpr; +function re_match_all(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::re_match_all", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "bb221d39-09f1-507e-8851-62075bb61823", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_match_all", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type re_testλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Test if a regular expression has a match in a string. + */ +function re_test< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(pattern: P1, str: P2): re_testλFuncExpr; +function re_test(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::re_test", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_test", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type re_replaceλFuncExpr< + NamedArgs extends { + flags?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type re_replaceλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Replace matching substrings in a given string. + */ +function re_replace< + NamedArgs extends { + flags?: _.castMaps.orScalarLiteral<$.TypeSet<$str>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + namedArgs: NamedArgs, + pattern: P1, + sub: P2, + str: P3, +): re_replaceλFuncExpr; +/** + * Replace matching substrings in a given string. + */ +function re_replace< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(pattern: P1, sub: P2, str: P3): re_replaceλFuncExpr2; +function re_replace(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::re_replace", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + flags: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::re_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_repeatλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Repeat the input *string* *n* times. + */ +function str_repeat< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(s: P1, n: P2): str_repeatλFuncExpr; +function str_repeat(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_repeat", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_repeat", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_lowerλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function<$str, $.cardutil.paramCardinality>; +/** + * Return a lowercase copy of the input *string*. + */ +function str_lower>>( + s: P1, +): str_lowerλFuncExpr; +function str_lower(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_lower", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_upperλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function<$str, $.cardutil.paramCardinality>; +/** + * Return an uppercase copy of the input *string*. + */ +function str_upper>>( + s: P1, +): str_upperλFuncExpr; +function str_upper(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_upper", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_titleλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function<$str, $.cardutil.paramCardinality>; +/** + * Return a titlecase copy of the input *string*. + */ +function str_title>>( + s: P1, +): str_titleλFuncExpr; +function str_title(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_title", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_title", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_pad_endλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string padded at the end to the length *n*. + */ +function str_pad_end< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, n: P2, fill?: P3): str_pad_endλFuncExpr; +function str_pad_end(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_pad_end", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_pad_end", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_rpadλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string right-padded to the length *n*. + */ +function str_rpad< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, n: P2, fill?: P3): str_rpadλFuncExpr; +function str_rpad(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_rpad", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_rpad", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_trim_startλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string with all *trim* characters removed from its start. + */ +function str_trim_start< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, tr?: P2): str_trim_startλFuncExpr; +function str_trim_start(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_trim_start", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim_start", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_ltrimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string with all leftmost *trim* characters removed. + */ +function str_ltrim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, tr?: P2): str_ltrimλFuncExpr; +function str_ltrim(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_ltrim", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_ltrim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_trim_endλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string with all *trim* characters removed from its end. + */ +function str_trim_end< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, tr?: P2): str_trim_endλFuncExpr; +function str_trim_end(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_trim_end", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim_end", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_rtrimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string with all rightmost *trim* characters removed. + */ +function str_rtrim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, tr?: P2): str_rtrimλFuncExpr; +function str_rtrim(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_rtrim", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_rtrim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_trimλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Return the input string with *trim* characters removed from both ends. + */ +function str_trim< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, tr?: P2): str_trimλFuncExpr; +function str_trim(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_trim", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_trim", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_splitλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $.ArrayType<$str>, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Split string into array elements using the supplied delimiter. + */ +function str_split< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(s: P1, delimiter: P2): str_splitλFuncExpr; +function str_split(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_split", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "bb221d39-09f1-507e-8851-62075bb61823", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_split", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_replaceλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Given a string, find a matching substring and replace all its occurrences with a new substring. + */ +function str_replace< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(s: P1, old: P2, new_2: P3): str_replaceλFuncExpr; +function str_replace(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_replace", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_replace", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type str_reverseλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function<$str, $.cardutil.paramCardinality>; +/** + * Reverse the order of the characters in the string. + */ +function str_reverse>>( + s: P1, +): str_reverseλFuncExpr; +function str_reverse(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::str_reverse", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::str_reverse", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type uuid_generate_v1mcλFuncExpr = $.$expr_Function<$uuid, $.Cardinality.One>; +/** + * Return a version 1 UUID. + */ +function uuid_generate_v1mc(): uuid_generate_v1mcλFuncExpr; +function uuid_generate_v1mc(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::uuid_generate_v1mc", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000100" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::uuid_generate_v1mc", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type uuid_generate_v4λFuncExpr = $.$expr_Function<$uuid, $.Cardinality.One>; +/** + * Return a version 4 UUID. + */ +function uuid_generate_v4(): uuid_generate_v4λFuncExpr; +function uuid_generate_v4(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::uuid_generate_v4", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000100" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::uuid_generate_v4", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +const range = _.syntax.$range; + +type multirangeλFuncExpr< + P1 extends $.TypeSet<$.ArrayType<$.RangeType<$anypoint>>>, +> = $.$expr_Function< + $.MultiRangeType< + $.getPrimitiveBaseType + >, + $.cardutil.paramCardinality +>; +function multirange>>>( + ranges: P1, +): multirangeλFuncExpr; +function multirange(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::multirange", args, _.spec, [ + { + args: [ + { + typeId: "3ed001c4-98e8-53a8-b2d1-0cad168d926c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::multirange", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_is_emptyλFuncExpr>> = + $.$expr_Function<$bool, $.cardutil.paramCardinality>; +type range_is_emptyλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +> = $.$expr_Function<$bool, $.cardutil.paramCardinality>; +function range_is_empty>>( + val: P1, +): range_is_emptyλFuncExpr; +function range_is_empty>>( + val: P1, +): range_is_emptyλFuncExpr2; +function range_is_empty(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_is_empty", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_empty", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_unpackλFuncExpr>> = + $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr2>> = + $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr3< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_date>>, +> = $.$expr_Function<_stdcal.$local_date, $.Cardinality.Many>; +type range_unpackλFuncExpr4< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr5< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr6< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr7< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.Cardinality.Many>; +type range_unpackλFuncExpr8< + P1 extends $.TypeSet<$.RangeType<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +> = $.$expr_Function<$datetime, $.Cardinality.Many>; +type range_unpackλFuncExpr9< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +> = $.$expr_Function<_stdcal.$local_date, $.Cardinality.Many>; +type range_unpackλFuncExpr10< + P1 extends $.TypeSet<$.RangeType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function<$decimal, $.Cardinality.Many>; +type range_unpackλFuncExpr11< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +> = $.$expr_Function<_stdcal.$local_datetime, $.Cardinality.Many>; +function range_unpack>>( + val: P1, +): range_unpackλFuncExpr; +function range_unpack>>( + val: P1, +): range_unpackλFuncExpr2; +function range_unpack>>( + val: P1, +): range_unpackλFuncExpr3; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, step: P2): range_unpackλFuncExpr4; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, step: P2): range_unpackλFuncExpr5; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, step: P2): range_unpackλFuncExpr6; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(val: P1, step: P2): range_unpackλFuncExpr7; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, +>(val: P1, step: P2): range_unpackλFuncExpr8; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>, +>(val: P1, step: P2): range_unpackλFuncExpr9; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>(val: P1, step: P2): range_unpackλFuncExpr10; +function range_unpack< + P1 extends $.TypeSet<$.RangeType<_stdcal.$local_datetimeλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, +>(val: P1, step: P2): range_unpackλFuncExpr11; +function range_unpack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_unpack", args, _.spec, [ + { + args: [ + { + typeId: "38b58945-dfd2-572c-bf7e-8cadf204a2ec", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "356c02b7-20fa-5d27-90fc-aa628dd37c5e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "38b58945-dfd2-572c-bf7e-8cadf204a2ec", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "356c02b7-20fa-5d27-90fc-aa628dd37c5e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "ef0fdfe1-43f9-5954-b804-56e9b7015ffc", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "b2f8ab6d-ebca-517d-9f16-086423c5bb9c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "10674aaf-8d88-5593-abe9-f7d82be5162b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "c61dd200-697a-5b70-9ff0-6c623a700c14", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "44825479-8abf-55f6-93bf-572798ec8f12", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_get_upperλFuncExpr>> = + $.$expr_Function< + $.getPrimitiveBaseType, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "Zero"> + >; +type range_get_upperλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +> = $.$expr_Function< + $.getPrimitiveBaseType, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "Zero"> +>; +function range_get_upper>>( + r: P1, +): range_get_upperλFuncExpr; +function range_get_upper>>( + r: P1, +): range_get_upperλFuncExpr2; +function range_get_upper(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_get_upper", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "581b0325-a044-58d4-aa37-3a85ea671313", + returnTypemod: "OptionalType", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "581b0325-a044-58d4-aa37-3a85ea671313", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_get_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_get_lowerλFuncExpr>> = + $.$expr_Function< + $.getPrimitiveBaseType, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "Zero"> + >; +type range_get_lowerλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +> = $.$expr_Function< + $.getPrimitiveBaseType, + $.cardutil.overrideLowerBound<$.cardutil.paramCardinality, "Zero"> +>; +function range_get_lower>>( + r: P1, +): range_get_lowerλFuncExpr; +function range_get_lower>>( + r: P1, +): range_get_lowerλFuncExpr2; +function range_get_lower(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_get_lower", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "581b0325-a044-58d4-aa37-3a85ea671313", + returnTypemod: "OptionalType", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "581b0325-a044-58d4-aa37-3a85ea671313", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_get_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_is_inclusive_upperλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function<$bool, $.cardutil.paramCardinality>; +type range_is_inclusive_upperλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +> = $.$expr_Function<$bool, $.cardutil.paramCardinality>; +function range_is_inclusive_upper>>( + r: P1, +): range_is_inclusive_upperλFuncExpr; +function range_is_inclusive_upper< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +>(r: P1): range_is_inclusive_upperλFuncExpr2; +function range_is_inclusive_upper(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_is_inclusive_upper", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_inclusive_upper", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type range_is_inclusive_lowerλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, +> = $.$expr_Function<$bool, $.cardutil.paramCardinality>; +type range_is_inclusive_lowerλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +> = $.$expr_Function<$bool, $.cardutil.paramCardinality>; +function range_is_inclusive_lower>>( + r: P1, +): range_is_inclusive_lowerλFuncExpr; +function range_is_inclusive_lower< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, +>(r: P1): range_is_inclusive_lowerλFuncExpr2; +function range_is_inclusive_lower(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::range_is_inclusive_lower", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range_is_inclusive_lower", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type overlapsλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type overlapsλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function overlaps< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): overlapsλFuncExpr; +function overlaps< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): overlapsλFuncExpr2; +function overlaps(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::overlaps", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::overlaps", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type multirange_unpackλFuncExpr< + P1 extends $.TypeSet<$.MultiRangeType<$number>>, +> = $.$expr_Function<$.RangeType<$number>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$number>>, +> = $.$expr_Function<$.RangeType<$number>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr3< + P1 extends $.TypeSet<$.MultiRangeType<$number>>, +> = $.$expr_Function<$.RangeType<$number>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr4< + P1 extends $.TypeSet<$.MultiRangeType<$number>>, +> = $.$expr_Function<$.RangeType<$number>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr5< + P1 extends $.TypeSet<$.MultiRangeType<$decimalλICastableTo>>, +> = $.$expr_Function<$.RangeType<$decimal>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr6< + P1 extends $.TypeSet<$.MultiRangeType<$datetime>>, +> = $.$expr_Function<$.RangeType<$datetime>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr7< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_datetimeλICastableTo>>, +> = $.$expr_Function<$.RangeType<_stdcal.$local_datetime>, $.Cardinality.Many>; +type multirange_unpackλFuncExpr8< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_date>>, +> = $.$expr_Function<$.RangeType<_stdcal.$local_date>, $.Cardinality.Many>; +function multirange_unpack>>( + val: P1, +): multirange_unpackλFuncExpr; +function multirange_unpack>>( + val: P1, +): multirange_unpackλFuncExpr2; +function multirange_unpack>>( + val: P1, +): multirange_unpackλFuncExpr3; +function multirange_unpack>>( + val: P1, +): multirange_unpackλFuncExpr4; +function multirange_unpack< + P1 extends $.TypeSet<$.MultiRangeType<$decimalλICastableTo>>, +>(val: P1): multirange_unpackλFuncExpr5; +function multirange_unpack>>( + val: P1, +): multirange_unpackλFuncExpr6; +function multirange_unpack< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_datetimeλICastableTo>>, +>(val: P1): multirange_unpackλFuncExpr7; +function multirange_unpack< + P1 extends $.TypeSet<$.MultiRangeType<_stdcal.$local_date>>, +>(val: P1): multirange_unpackλFuncExpr8; +function multirange_unpack(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::multirange_unpack", args, _.spec, [ + { + args: [ + { + typeId: "a36a494d-f2c1-5886-8e17-b0c8ba9337ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "38b58945-dfd2-572c-bf7e-8cadf204a2ec", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "da3c9da3-1b79-53d0-ae36-82026533939b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "356c02b7-20fa-5d27-90fc-aa628dd37c5e", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "18b39277-efe3-582c-8bdc-b18f4ed46e09", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "ef0fdfe1-43f9-5954-b804-56e9b7015ffc", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "75f5b5c7-f201-56a8-9fd0-bd139e69fdbe", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "b2f8ab6d-ebca-517d-9f16-086423c5bb9c", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "80da35c5-4ed6-5799-8eea-1c5923a3f8d3", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c61dd200-697a-5b70-9ff0-6c623a700c14", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "58da8bd4-709a-50bc-b0b4-a1918b7dc2ba", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "10674aaf-8d88-5593-abe9-f7d82be5162b", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "37c39ed3-114c-5835-b662-80d80db0199d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "44825479-8abf-55f6-93bf-572798ec8f12", + returnTypemod: "SetOfType", + }, + { + args: [ + { + typeId: "74568c88-a8c3-5a02-9acd-64616d07ab8b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c38cc584-72e2-5b3d-a9cc-e8e256c2dd0d", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::multirange_unpack", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type strictly_belowλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type strictly_belowλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function strictly_below< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): strictly_belowλFuncExpr; +function strictly_below< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): strictly_belowλFuncExpr2; +function strictly_below(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::strictly_below", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::strictly_below", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type strictly_aboveλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type strictly_aboveλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function strictly_above< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): strictly_aboveλFuncExpr; +function strictly_above< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): strictly_aboveλFuncExpr2; +function strictly_above(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::strictly_above", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::strictly_above", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bounded_aboveλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type bounded_aboveλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function bounded_above< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): bounded_aboveλFuncExpr; +function bounded_above< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): bounded_aboveλFuncExpr2; +function bounded_above(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bounded_above", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bounded_above", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type bounded_belowλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type bounded_belowλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function bounded_below< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): bounded_belowλFuncExpr; +function bounded_below< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): bounded_belowλFuncExpr2; +function bounded_below(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::bounded_below", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::bounded_below", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type adjacentλFuncExpr< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type adjacentλFuncExpr2< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +> = $.$expr_Function< + $bool, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function adjacent< + P1 extends $.TypeSet<$.RangeType<$anypoint>>, + P2 extends $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): adjacentλFuncExpr; +function adjacent< + P1 extends $.TypeSet<$.MultiRangeType<$anypoint>>, + P2 extends $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >, +>(l: P1, r: P2): adjacentλFuncExpr2; +function adjacent(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::adjacent", args, _.spec, [ + { + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::adjacent", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$number, $.Cardinality.Many>; +function _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>( + start: P1, + stop: P2, +): _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7λFuncExpr; +function _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::__pg_generate_series", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "SetOfType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::__pg_generate_series", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_strλFuncExpr>> = + $.$expr_Function<$str, $.cardutil.paramCardinality>; +type to_strλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr6< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type to_strλFuncExpr7< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr8< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr9< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr10< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr11< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_strλFuncExpr12< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $str, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Convert a binary UTF-8 string to a text value. + */ +function to_str>>( + b: P1, +): to_strλFuncExpr; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(dt: P1, fmt?: P2): to_strλFuncExpr2; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$duration>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(td: P1, fmt?: P2): to_strλFuncExpr3; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(i: P1, fmt?: P2): to_strλFuncExpr4; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bigint>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(d: P1, fmt?: P2): to_strλFuncExpr5; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends $.TypeSet<$.ArrayType<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(array: P1, delimiter: P2): to_strλFuncExpr6; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(json: P1, fmt?: P2): to_strλFuncExpr7; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(d: P1, fmt?: P2): to_strλFuncExpr8; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(nt: P1, fmt?: P2): to_strλFuncExpr9; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(d: P1, fmt?: P2): to_strλFuncExpr10; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(dt: P1, fmt?: P2): to_strλFuncExpr11; +/** + * Return string representation of the input value. + */ +function to_str< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(rd: P1, fmt?: P2): to_strλFuncExpr12; +function to_str(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_str", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "bb221d39-09f1-507e-8851-62075bb61823", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_str", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_bytesλFuncExpr>> = + $.$expr_Function<$bytes, $.cardutil.paramCardinality>; +type to_bytesλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$json>>, +> = $.$expr_Function<$bytes, $.cardutil.paramCardinality>; +type to_bytesλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$uuid>>, +> = $.$expr_Function<$bytes, $.cardutil.paramCardinality>; +type to_bytesλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +> = $.$expr_Function< + $bytes, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Convert a text string to a binary UTF-8 string. + */ +function to_bytes>>( + s: P1, +): to_bytesλFuncExpr; +/** + * Convert a json value to a binary UTF-8 string. + */ +function to_bytes>>( + j: P1, +): to_bytesλFuncExpr2; +/** + * Convert an UUID to binary format. + */ +function to_bytes>>( + val: P1, +): to_bytesλFuncExpr3; +/** + * Convert an int16 using specified endian binary format. + */ +function to_bytes< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +>(val: P1, endian: P2): to_bytesλFuncExpr4; +function to_bytes(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_bytes", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_bytes", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_jsonλFuncExpr>> = + $.$expr_Function<$json, $.cardutil.paramCardinality>; +/** + * Return JSON value represented by the input *string*. + */ +function to_json>>( + str: P1, +): to_jsonλFuncExpr; +function to_json(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_json", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010f", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_json", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_datetimeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function<$datetime, $.cardutil.paramCardinality>; +type to_datetimeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_datetimeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P7 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +type to_datetimeλFuncExpr4< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +> = $.$expr_Function<$datetime, $.cardutil.paramCardinality>; +type to_datetimeλFuncExpr5< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +> = $.$expr_Function< + $datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Create a `datetime` value. + */ +function to_datetime>>( + epochseconds: P1, +): to_datetimeλFuncExpr; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_datetimeλFuncExpr2; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, + P7 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>( + year: P1, + month: P2, + day: P3, + hour: P4, + min: P5, + sec: P6, + timezone: P7, +): to_datetimeλFuncExpr3; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$decimalλICastableTo>>, +>(epochseconds: P1): to_datetimeλFuncExpr4; +/** + * Create a `datetime` value. + */ +function to_datetime< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, +>(local: P1, zone: P2): to_datetimeλFuncExpr5; +function to_datetime(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_datetime", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_datetime", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_durationλFuncExpr< + NamedArgs extends { + hours?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + minutes?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + seconds?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + microseconds?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + }, +> = $.$expr_Function< + $duration, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `duration` value. + */ +function to_duration< + NamedArgs extends { + hours?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + minutes?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + seconds?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + microseconds?: _.castMaps.orScalarLiteral<$.TypeSet<$number>>; + }, +>(namedArgs: NamedArgs): to_durationλFuncExpr; +function to_duration(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_duration", args, _.spec, [ + { + args: [], + namedArgs: { + hours: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + minutes: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + seconds: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + microseconds: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_bigintλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $bigint, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `bigint` value. + */ +function to_bigint< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_bigintλFuncExpr; +function to_bigint(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_bigint", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_bigint", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_decimalλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $decimal, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `decimal` value. + */ +function to_decimal< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_decimalλFuncExpr; +function to_decimal(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_decimal", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_decimal", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_int64λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_int64λFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Create a `int64` value. + */ +function to_int64< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_int64λFuncExpr; +/** + * Convert bytes into `int64` value. + */ +function to_int64< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +>(val: P1, endian: P2): to_int64λFuncExpr2; +function to_int64(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_int64", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int64", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_int32λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_int32λFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Create a `int32` value. + */ +function to_int32< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_int32λFuncExpr; +/** + * Convert bytes into `int32` value. + */ +function to_int32< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +>(val: P1, endian: P2): to_int32λFuncExpr2; +function to_int32(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_int32", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int32", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_int16λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_int16λFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Create a `int16` value. + */ +function to_int16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_int16λFuncExpr; +/** + * Convert bytes into `int16` value. + */ +function to_int16< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$Endian>>, +>(val: P1, endian: P2): to_int16λFuncExpr2; +function to_int16(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_int16", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "e4a1d11b-227e-5744-a0c9-31f9cd756e7b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_int16", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_float64λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `float64` value. + */ +function to_float64< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_float64λFuncExpr; +function to_float64(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_float64", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_float64", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_float32λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `float32` value. + */ +function to_float32< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$str>> | undefined, +>(s: P1, fmt?: P2): to_float32λFuncExpr; +function to_float32(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_float32", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_float32", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_uuidλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$bytes>>, +> = $.$expr_Function<$uuid, $.cardutil.paramCardinality>; +/** + * Convert binary representation into UUID value. + */ +function to_uuid>>( + val: P1, +): to_uuidλFuncExpr; +function to_uuid(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::to_uuid", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000100", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::to_uuid", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type sequence_resetλFuncExpr> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +type sequence_resetλFuncExpr2< + P1 extends $.TypeSet<_schema.$ScalarType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +> = $.$expr_Function< + $number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +function sequence_reset>( + seq: P1, +): sequence_resetλFuncExpr; +function sequence_reset< + P1 extends $.TypeSet<_schema.$ScalarType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<$number>>, +>(seq: P1, value: P2): sequence_resetλFuncExpr2; +function sequence_reset(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::sequence_reset", args, _.spec, [ + { + args: [ + { + typeId: "d055dd47-3eb9-5a31-9d8f-5e7053bbe11e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "d055dd47-3eb9-5a31-9d8f-5e7053bbe11e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sequence_reset", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type sequence_nextλFuncExpr> = + $.$expr_Function<$number, $.cardutil.paramCardinality>; +function sequence_next>( + seq: P1, +): sequence_nextλFuncExpr; +function sequence_next(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::sequence_next", args, _.spec, [ + { + args: [ + { + typeId: "d055dd47-3eb9-5a31-9d8f-5e7053bbe11e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::sequence_next", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { + Endian, + JsonEmpty, + bigint, + bool, + bytes, + datetime, + decimal, + duration, + float32, + float64, + int16, + int32, + int64, + json, + $sequence, + str, + uuid, + number, + $BaseObject, + BaseObject, + $FreeObject, + FreeObject, + $Object_8ce8c71ee4fa5f73840c22d7eaa58588, + Object_8ce8c71ee4fa5f73840c22d7eaa58588, +}; + +export type { + $anyscalar, + $anypoint, + $anycontiguous, + $anydiscrete, + $anyreal, + $anyfloat, + $anyint, + $anynumeric, +}; + +type __defaultExports = { + Endian: typeof Endian; + JsonEmpty: typeof JsonEmpty; + bigint: typeof bigint; + bool: typeof bool; + bytes: typeof bytes; + datetime: typeof datetime; + decimal: typeof decimal; + duration: typeof duration; + float32: typeof float32; + float64: typeof float64; + int16: typeof int16; + int32: typeof int32; + int64: typeof int64; + json: typeof json; + str: typeof str; + uuid: typeof uuid; + BaseObject: typeof BaseObject; + FreeObject: typeof FreeObject; + Object: typeof Object_8ce8c71ee4fa5f73840c22d7eaa58588; + assert_single: typeof assert_single; + assert_exists: typeof assert_exists; + assert_distinct: typeof assert_distinct; + assert: typeof assert; + materialized: typeof materialized; + len: typeof len; + sum: typeof sum; + count: typeof count; + random: typeof random; + min: typeof min; + max: typeof max; + all: typeof all; + any: typeof any; + enumerate: typeof enumerate; + round: typeof round; + contains: typeof contains; + array_fill: typeof array_fill; + find: typeof find; + bit_and: typeof bit_and; + bit_or: typeof bit_or; + bit_xor: typeof bit_xor; + bit_not: typeof bit_not; + bit_rshift: typeof bit_rshift; + bit_lshift: typeof bit_lshift; + bit_count: typeof bit_count; + array_agg: typeof array_agg; + array_unpack: typeof array_unpack; + array_replace: typeof array_replace; + array_get: typeof array_get; + array_set: typeof array_set; + array_insert: typeof array_insert; + array_join: typeof array_join; + bytes_get_bit: typeof bytes_get_bit; + datetime_current: typeof datetime_current; + datetime_of_transaction: typeof datetime_of_transaction; + datetime_of_statement: typeof datetime_of_statement; + datetime_get: typeof datetime_get; + datetime_truncate: typeof datetime_truncate; + str_pad_start: typeof str_pad_start; + str_lpad: typeof str_lpad; + duration_get: typeof duration_get; + duration_truncate: typeof duration_truncate; + duration_to_seconds: typeof duration_to_seconds; + json_typeof: typeof json_typeof; + json_array_unpack: typeof json_array_unpack; + json_object_unpack: typeof json_object_unpack; + json_object_pack: typeof json_object_pack; + json_get: typeof json_get; + json_set: typeof json_set; + re_match: typeof re_match; + re_match_all: typeof re_match_all; + re_test: typeof re_test; + re_replace: typeof re_replace; + str_repeat: typeof str_repeat; + str_lower: typeof str_lower; + str_upper: typeof str_upper; + str_title: typeof str_title; + str_pad_end: typeof str_pad_end; + str_rpad: typeof str_rpad; + str_trim_start: typeof str_trim_start; + str_ltrim: typeof str_ltrim; + str_trim_end: typeof str_trim_end; + str_rtrim: typeof str_rtrim; + str_trim: typeof str_trim; + str_split: typeof str_split; + str_replace: typeof str_replace; + str_reverse: typeof str_reverse; + uuid_generate_v1mc: typeof uuid_generate_v1mc; + uuid_generate_v4: typeof uuid_generate_v4; + range: typeof range; + multirange: typeof multirange; + range_is_empty: typeof range_is_empty; + range_unpack: typeof range_unpack; + range_get_upper: typeof range_get_upper; + range_get_lower: typeof range_get_lower; + range_is_inclusive_upper: typeof range_is_inclusive_upper; + range_is_inclusive_lower: typeof range_is_inclusive_lower; + overlaps: typeof overlaps; + multirange_unpack: typeof multirange_unpack; + strictly_below: typeof strictly_below; + strictly_above: typeof strictly_above; + bounded_above: typeof bounded_above; + bounded_below: typeof bounded_below; + adjacent: typeof adjacent; + __pg_generate_series: typeof _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7; + to_str: typeof to_str; + to_bytes: typeof to_bytes; + to_json: typeof to_json; + to_datetime: typeof to_datetime; + to_duration: typeof to_duration; + to_bigint: typeof to_bigint; + to_decimal: typeof to_decimal; + to_int64: typeof to_int64; + to_int32: typeof to_int32; + to_int16: typeof to_int16; + to_float64: typeof to_float64; + to_float32: typeof to_float32; + to_uuid: typeof to_uuid; + sequence_reset: typeof sequence_reset; + sequence_next: typeof sequence_next; + cal: typeof _module__cal; + enc: typeof _module__enc; + fts: typeof _module__fts; + net: typeof _module__net; + pg: typeof _module__pg; + math: typeof _module__math; +}; +const __defaultExports: __defaultExports = { + Endian: Endian, + JsonEmpty: JsonEmpty, + bigint: bigint, + bool: bool, + bytes: bytes, + datetime: datetime, + decimal: decimal, + duration: duration, + float32: float32, + float64: float64, + int16: int16, + int32: int32, + int64: int64, + json: json, + str: str, + uuid: uuid, + BaseObject: BaseObject, + FreeObject: FreeObject, + Object: Object_8ce8c71ee4fa5f73840c22d7eaa58588, + assert_single: assert_single, + assert_exists: assert_exists, + assert_distinct: assert_distinct, + assert: assert, + materialized: materialized, + len: len, + sum: sum, + count: count, + random: random, + min: min, + max: max, + all: all, + any: any, + enumerate: enumerate, + round: round, + contains: contains, + array_fill: array_fill, + find: find, + bit_and: bit_and, + bit_or: bit_or, + bit_xor: bit_xor, + bit_not: bit_not, + bit_rshift: bit_rshift, + bit_lshift: bit_lshift, + bit_count: bit_count, + array_agg: array_agg, + array_unpack: array_unpack, + array_replace: array_replace, + array_get: array_get, + array_set: array_set, + array_insert: array_insert, + array_join: array_join, + bytes_get_bit: bytes_get_bit, + datetime_current: datetime_current, + datetime_of_transaction: datetime_of_transaction, + datetime_of_statement: datetime_of_statement, + datetime_get: datetime_get, + datetime_truncate: datetime_truncate, + str_pad_start: str_pad_start, + str_lpad: str_lpad, + duration_get: duration_get, + duration_truncate: duration_truncate, + duration_to_seconds: duration_to_seconds, + json_typeof: json_typeof, + json_array_unpack: json_array_unpack, + json_object_unpack: json_object_unpack, + json_object_pack: json_object_pack, + json_get: json_get, + json_set: json_set, + re_match: re_match, + re_match_all: re_match_all, + re_test: re_test, + re_replace: re_replace, + str_repeat: str_repeat, + str_lower: str_lower, + str_upper: str_upper, + str_title: str_title, + str_pad_end: str_pad_end, + str_rpad: str_rpad, + str_trim_start: str_trim_start, + str_ltrim: str_ltrim, + str_trim_end: str_trim_end, + str_rtrim: str_rtrim, + str_trim: str_trim, + str_split: str_split, + str_replace: str_replace, + str_reverse: str_reverse, + uuid_generate_v1mc: uuid_generate_v1mc, + uuid_generate_v4: uuid_generate_v4, + range: range, + multirange: multirange, + range_is_empty: range_is_empty, + range_unpack: range_unpack, + range_get_upper: range_get_upper, + range_get_lower: range_get_lower, + range_is_inclusive_upper: range_is_inclusive_upper, + range_is_inclusive_lower: range_is_inclusive_lower, + overlaps: overlaps, + multirange_unpack: multirange_unpack, + strictly_below: strictly_below, + strictly_above: strictly_above, + bounded_above: bounded_above, + bounded_below: bounded_below, + adjacent: adjacent, + __pg_generate_series: _pg_generate_series_9045e2a9ba5f5d288595c71d08e0d9d7, + to_str: to_str, + to_bytes: to_bytes, + to_json: to_json, + to_datetime: to_datetime, + to_duration: to_duration, + to_bigint: to_bigint, + to_decimal: to_decimal, + to_int64: to_int64, + to_int32: to_int32, + to_int16: to_int16, + to_float64: to_float64, + to_float32: to_float32, + to_uuid: to_uuid, + sequence_reset: sequence_reset, + sequence_next: sequence_next, + cal: _module__cal, + enc: _module__enc, + fts: _module__fts, + net: _module__net, + pg: _module__pg, + math: _module__math, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/cal.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/cal.ts new file mode 100644 index 00000000000..6c0544059d6 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/cal.ts @@ -0,0 +1,935 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +import type * as _std from "../std"; +export type $date_duration = $.ScalarType< + "std::cal::date_duration", + _.gel.DateDuration +>; +const date_duration: $.scalarTypeWithConstructor<$date_duration, string> = + $.makeType<$.scalarTypeWithConstructor<$date_duration, string>>( + _.spec, + "00000000-0000-0000-0000-000000000112", + _.syntax.literal, + ); + +export type $local_date = $.ScalarType<"std::cal::local_date", _.gel.LocalDate>; +const local_date: $.scalarTypeWithConstructor<$local_date, string> = $.makeType< + $.scalarTypeWithConstructor<$local_date, string> +>(_.spec, "00000000-0000-0000-0000-00000000010c", _.syntax.literal); + +export type $local_datetime = $.ScalarType< + "std::cal::local_datetime", + _.gel.LocalDateTime +>; +const local_datetime: $.scalarTypeWithConstructor<$local_datetime, string> = + $.makeType<$.scalarTypeWithConstructor<$local_datetime, string>>( + _.spec, + "00000000-0000-0000-0000-00000000010b", + _.syntax.literal, + ); +export type $local_datetimeλICastableTo = $local_datetime | $local_date; +export type $local_datetimeλIAssignableBy = $local_datetime | $local_date; + +export type $local_time = $.ScalarType<"std::cal::local_time", _.gel.LocalTime>; +const local_time: $.scalarTypeWithConstructor<$local_time, string> = $.makeType< + $.scalarTypeWithConstructor<$local_time, string> +>(_.spec, "00000000-0000-0000-0000-00000000010d", _.syntax.literal); + +export type $relative_duration = $.ScalarType< + "std::cal::relative_duration", + _.gel.RelativeDuration +>; +const relative_duration: $.scalarTypeWithConstructor< + $relative_duration, + string +> = $.makeType<$.scalarTypeWithConstructor<$relative_duration, string>>( + _.spec, + "00000000-0000-0000-0000-000000000111", + _.syntax.literal, +); +export type $relative_durationλICastableTo = + | $relative_duration + | $date_duration; +export type $relative_durationλIAssignableBy = + | $relative_duration + | $date_duration; + +type to_local_timeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_time, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_local_timeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_time, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type to_local_timeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_time, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Create a `std::cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>(s: P1, fmt?: P2): to_local_timeλFuncExpr; +/** + * Create a `std::cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(dt: P1, zone: P2): to_local_timeλFuncExpr2; +/** + * Create a `std::cal::local_time` value. + */ +function to_local_time< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(hour: P1, min: P2, sec: P3): to_local_timeλFuncExpr3; +function to_local_time(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::to_local_time", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::to_local_time", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_local_datetimeλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_local_datetimeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type to_local_datetimeλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_datetime, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Create a `std::cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>(s: P1, fmt?: P2): to_local_datetimeλFuncExpr; +/** + * Create a `std::cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(dt: P1, zone: P2): to_local_datetimeλFuncExpr2; +/** + * Create a `std::cal::local_datetime` value. + */ +function to_local_datetime< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P4 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P5 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P6 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>( + year: P1, + month: P2, + day: P3, + hour: P4, + min: P5, + sec: P6, +): to_local_datetimeλFuncExpr3; +function to_local_datetime(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::to_local_datetime", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::to_local_datetime", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_local_dateλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +> = $.$expr_Function< + $local_date, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + > +>; +type to_local_dateλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $local_date, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +type to_local_dateλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + $local_date, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +/** + * Create a `std::cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>> | undefined, +>(s: P1, fmt?: P2): to_local_dateλFuncExpr; +/** + * Create a `std::cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(dt: P1, zone: P2): to_local_dateλFuncExpr2; +/** + * Create a `std::cal::local_date` value. + */ +function to_local_date< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P3 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(year: P1, month: P2, day: P3): to_local_dateλFuncExpr3; +function to_local_date(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::to_local_date", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::to_local_date", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_relative_durationλFuncExpr< + NamedArgs extends { + years?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + months?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + days?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + hours?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + minutes?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + seconds?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + microseconds?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + }, +> = $.$expr_Function< + $relative_duration, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `std::cal::relative_duration` value. + */ +function to_relative_duration< + NamedArgs extends { + years?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + months?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + days?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + hours?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + minutes?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + seconds?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + microseconds?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + }, +>(namedArgs: NamedArgs): to_relative_durationλFuncExpr; +function to_relative_duration(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload( + "std::cal::to_relative_duration", + args, + _.spec, + [ + { + args: [], + namedArgs: { + years: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + months: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + days: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + hours: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + minutes: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + seconds: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + microseconds: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + ); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::to_relative_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type to_date_durationλFuncExpr< + NamedArgs extends { + years?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + months?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + days?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + }, +> = $.$expr_Function< + $date_duration, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * Create a `std::cal::date_duration` value. + */ +function to_date_duration< + NamedArgs extends { + years?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + months?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + days?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + }, +>(namedArgs: NamedArgs): to_date_durationλFuncExpr; +function to_date_duration(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::to_date_duration", args, _.spec, [ + { + args: [], + namedArgs: { + years: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + months: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + days: { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::to_date_duration", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type time_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + _std.$number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Extract a specific element of input time by name. + */ +function time_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_time>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(dt: P1, el: P2): time_getλFuncExpr; +function time_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::time_get", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::time_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type date_getλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + _std.$number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Extract a specific element of input date by name. + */ +function date_get< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$local_date>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(dt: P1, el: P2): date_getλFuncExpr; +function date_get(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::cal::date_get", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::date_get", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type duration_normalize_hoursλFuncExpr< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<$relative_durationλICastableTo> + >, +> = $.$expr_Function<$relative_duration, $.cardutil.paramCardinality>; +/** + * Convert 24-hour chunks into days. + */ +function duration_normalize_hours< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<$relative_durationλICastableTo> + >, +>(dur: P1): duration_normalize_hoursλFuncExpr; +function duration_normalize_hours(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload( + "std::cal::duration_normalize_hours", + args, + _.spec, + [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + ); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::duration_normalize_hours", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type duration_normalize_daysλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$date_duration>>, +> = $.$expr_Function<$date_duration, $.cardutil.paramCardinality>; +type duration_normalize_daysλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<$relative_durationλICastableTo> + >, +> = $.$expr_Function<$relative_duration, $.cardutil.paramCardinality>; +/** + * Convert 30-day chunks into months. + */ +function duration_normalize_days< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<$date_duration>>, +>(dur: P1): duration_normalize_daysλFuncExpr; +/** + * Convert 30-day chunks into months. + */ +function duration_normalize_days< + P1 extends _.castMaps.orScalarLiteral< + $.TypeSet<$relative_durationλICastableTo> + >, +>(dur: P1): duration_normalize_daysλFuncExpr2; +function duration_normalize_days(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload( + "std::cal::duration_normalize_days", + args, + _.spec, + [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + ); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::cal::duration_normalize_days", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { + date_duration, + local_date, + local_datetime, + local_time, + relative_duration, +}; + +type __defaultExports = { + date_duration: typeof date_duration; + local_date: typeof local_date; + local_datetime: typeof local_datetime; + local_time: typeof local_time; + relative_duration: typeof relative_duration; + to_local_time: typeof to_local_time; + to_local_datetime: typeof to_local_datetime; + to_local_date: typeof to_local_date; + to_relative_duration: typeof to_relative_duration; + to_date_duration: typeof to_date_duration; + time_get: typeof time_get; + date_get: typeof date_get; + duration_normalize_hours: typeof duration_normalize_hours; + duration_normalize_days: typeof duration_normalize_days; +}; +const __defaultExports: __defaultExports = { + date_duration: date_duration, + local_date: local_date, + local_datetime: local_datetime, + local_time: local_time, + relative_duration: relative_duration, + to_local_time: to_local_time, + to_local_datetime: to_local_datetime, + to_local_date: to_local_date, + to_relative_duration: to_relative_duration, + to_date_duration: to_date_duration, + time_get: time_get, + date_get: date_get, + duration_normalize_hours: duration_normalize_hours, + duration_normalize_days: duration_normalize_days, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/enc.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/enc.ts new file mode 100644 index 00000000000..5349b6e8aa8 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/enc.ts @@ -0,0 +1,184 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +import type * as _std from "../std"; +export type $Base64Alphabet = { + standard: $.$expr_Literal<$Base64Alphabet>; + urlsafe: $.$expr_Literal<$Base64Alphabet>; +} & $.EnumType<"std::enc::Base64Alphabet", ["standard", "urlsafe"]>; +const Base64Alphabet: $Base64Alphabet = $.makeType<$Base64Alphabet>( + _.spec, + "5ca96424-93ba-560a-994b-7820c9623e3d", + _.syntax.literal, +); + +type base64_encodeλFuncExpr< + NamedArgs extends { + alphabet?: _.castMaps.orScalarLiteral<$.TypeSet<$Base64Alphabet>>; + padding?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +> = $.$expr_Function< + _std.$str, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type base64_encodeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +> = $.$expr_Function<_std.$str, $.cardutil.paramCardinality>; +/** + * Encode given data as a base64 string + */ +function base64_encode< + NamedArgs extends { + alphabet?: _.castMaps.orScalarLiteral<$.TypeSet<$Base64Alphabet>>; + padding?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>(namedArgs: NamedArgs, data: P1): base64_encodeλFuncExpr; +/** + * Encode given data as a base64 string + */ +function base64_encode< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>, +>(data: P1): base64_encodeλFuncExpr2; +function base64_encode(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::enc::base64_encode", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + alphabet: { + typeId: "5ca96424-93ba-560a-994b-7820c9623e3d", + optional: true, + setoftype: false, + variadic: false, + }, + padding: { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::enc::base64_encode", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type base64_decodeλFuncExpr< + NamedArgs extends { + alphabet?: _.castMaps.orScalarLiteral<$.TypeSet<$Base64Alphabet>>; + padding?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + _std.$bytes, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type base64_decodeλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function<_std.$bytes, $.cardutil.paramCardinality>; +/** + * Decode the byte64-encoded byte string and return decoded bytes. + */ +function base64_decode< + NamedArgs extends { + alphabet?: _.castMaps.orScalarLiteral<$.TypeSet<$Base64Alphabet>>; + padding?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(namedArgs: NamedArgs, data: P1): base64_decodeλFuncExpr; +/** + * Decode the byte64-encoded byte string and return decoded bytes. + */ +function base64_decode< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(data: P1): base64_decodeλFuncExpr2; +function base64_decode(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::enc::base64_decode", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + alphabet: { + typeId: "5ca96424-93ba-560a-994b-7820c9623e3d", + optional: true, + setoftype: false, + variadic: false, + }, + padding: { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::enc::base64_decode", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { Base64Alphabet }; + +type __defaultExports = { + Base64Alphabet: typeof Base64Alphabet; + base64_encode: typeof base64_encode; + base64_decode: typeof base64_decode; +}; +const __defaultExports: __defaultExports = { + Base64Alphabet: Base64Alphabet, + base64_encode: base64_encode, + base64_decode: base64_decode, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/fts.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/fts.ts new file mode 100644 index 00000000000..5dea39b6121 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/fts.ts @@ -0,0 +1,530 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +import type * as _std from "../std"; +export type $ElasticLanguage = { + ara: $.$expr_Literal<$ElasticLanguage>; + bul: $.$expr_Literal<$ElasticLanguage>; + cat: $.$expr_Literal<$ElasticLanguage>; + ces: $.$expr_Literal<$ElasticLanguage>; + ckb: $.$expr_Literal<$ElasticLanguage>; + dan: $.$expr_Literal<$ElasticLanguage>; + deu: $.$expr_Literal<$ElasticLanguage>; + ell: $.$expr_Literal<$ElasticLanguage>; + eng: $.$expr_Literal<$ElasticLanguage>; + eus: $.$expr_Literal<$ElasticLanguage>; + fas: $.$expr_Literal<$ElasticLanguage>; + fin: $.$expr_Literal<$ElasticLanguage>; + fra: $.$expr_Literal<$ElasticLanguage>; + gle: $.$expr_Literal<$ElasticLanguage>; + glg: $.$expr_Literal<$ElasticLanguage>; + hin: $.$expr_Literal<$ElasticLanguage>; + hun: $.$expr_Literal<$ElasticLanguage>; + hye: $.$expr_Literal<$ElasticLanguage>; + ind: $.$expr_Literal<$ElasticLanguage>; + ita: $.$expr_Literal<$ElasticLanguage>; + lav: $.$expr_Literal<$ElasticLanguage>; + nld: $.$expr_Literal<$ElasticLanguage>; + nor: $.$expr_Literal<$ElasticLanguage>; + por: $.$expr_Literal<$ElasticLanguage>; + ron: $.$expr_Literal<$ElasticLanguage>; + rus: $.$expr_Literal<$ElasticLanguage>; + spa: $.$expr_Literal<$ElasticLanguage>; + swe: $.$expr_Literal<$ElasticLanguage>; + tha: $.$expr_Literal<$ElasticLanguage>; + tur: $.$expr_Literal<$ElasticLanguage>; + zho: $.$expr_Literal<$ElasticLanguage>; + edb_Brazilian: $.$expr_Literal<$ElasticLanguage>; + edb_ChineseJapaneseKorean: $.$expr_Literal<$ElasticLanguage>; +} & $.EnumType< + "std::fts::ElasticLanguage", + [ + "ara", + "bul", + "cat", + "ces", + "ckb", + "dan", + "deu", + "ell", + "eng", + "eus", + "fas", + "fin", + "fra", + "gle", + "glg", + "hin", + "hun", + "hye", + "ind", + "ita", + "lav", + "nld", + "nor", + "por", + "ron", + "rus", + "spa", + "swe", + "tha", + "tur", + "zho", + "edb_Brazilian", + "edb_ChineseJapaneseKorean", + ] +>; +const ElasticLanguage: $ElasticLanguage = $.makeType<$ElasticLanguage>( + _.spec, + "de04eafc-46d5-5037-aae6-52774a4cf421", + _.syntax.literal, +); + +export type $Language = { + ara: $.$expr_Literal<$Language>; + hye: $.$expr_Literal<$Language>; + eus: $.$expr_Literal<$Language>; + cat: $.$expr_Literal<$Language>; + dan: $.$expr_Literal<$Language>; + nld: $.$expr_Literal<$Language>; + eng: $.$expr_Literal<$Language>; + fin: $.$expr_Literal<$Language>; + fra: $.$expr_Literal<$Language>; + deu: $.$expr_Literal<$Language>; + ell: $.$expr_Literal<$Language>; + hin: $.$expr_Literal<$Language>; + hun: $.$expr_Literal<$Language>; + ind: $.$expr_Literal<$Language>; + gle: $.$expr_Literal<$Language>; + ita: $.$expr_Literal<$Language>; + nor: $.$expr_Literal<$Language>; + por: $.$expr_Literal<$Language>; + ron: $.$expr_Literal<$Language>; + rus: $.$expr_Literal<$Language>; + spa: $.$expr_Literal<$Language>; + swe: $.$expr_Literal<$Language>; + tur: $.$expr_Literal<$Language>; +} & $.EnumType< + "std::fts::Language", + [ + "ara", + "hye", + "eus", + "cat", + "dan", + "nld", + "eng", + "fin", + "fra", + "deu", + "ell", + "hin", + "hun", + "ind", + "gle", + "ita", + "nor", + "por", + "ron", + "rus", + "spa", + "swe", + "tur", + ] +>; +const Language: $Language = $.makeType<$Language>( + _.spec, + "efb3a506-d101-5c65-b845-abf56604c8e3", + _.syntax.literal, +); + +export type $LuceneLanguage = { + ara: $.$expr_Literal<$LuceneLanguage>; + ben: $.$expr_Literal<$LuceneLanguage>; + bul: $.$expr_Literal<$LuceneLanguage>; + cat: $.$expr_Literal<$LuceneLanguage>; + ces: $.$expr_Literal<$LuceneLanguage>; + ckb: $.$expr_Literal<$LuceneLanguage>; + dan: $.$expr_Literal<$LuceneLanguage>; + deu: $.$expr_Literal<$LuceneLanguage>; + ell: $.$expr_Literal<$LuceneLanguage>; + eng: $.$expr_Literal<$LuceneLanguage>; + est: $.$expr_Literal<$LuceneLanguage>; + eus: $.$expr_Literal<$LuceneLanguage>; + fas: $.$expr_Literal<$LuceneLanguage>; + fin: $.$expr_Literal<$LuceneLanguage>; + fra: $.$expr_Literal<$LuceneLanguage>; + gle: $.$expr_Literal<$LuceneLanguage>; + glg: $.$expr_Literal<$LuceneLanguage>; + hin: $.$expr_Literal<$LuceneLanguage>; + hun: $.$expr_Literal<$LuceneLanguage>; + hye: $.$expr_Literal<$LuceneLanguage>; + ind: $.$expr_Literal<$LuceneLanguage>; + ita: $.$expr_Literal<$LuceneLanguage>; + lav: $.$expr_Literal<$LuceneLanguage>; + lit: $.$expr_Literal<$LuceneLanguage>; + nld: $.$expr_Literal<$LuceneLanguage>; + nor: $.$expr_Literal<$LuceneLanguage>; + por: $.$expr_Literal<$LuceneLanguage>; + ron: $.$expr_Literal<$LuceneLanguage>; + rus: $.$expr_Literal<$LuceneLanguage>; + spa: $.$expr_Literal<$LuceneLanguage>; + srp: $.$expr_Literal<$LuceneLanguage>; + swe: $.$expr_Literal<$LuceneLanguage>; + tha: $.$expr_Literal<$LuceneLanguage>; + tur: $.$expr_Literal<$LuceneLanguage>; + edb_Brazilian: $.$expr_Literal<$LuceneLanguage>; + edb_ChineseJapaneseKorean: $.$expr_Literal<$LuceneLanguage>; + edb_Indian: $.$expr_Literal<$LuceneLanguage>; +} & $.EnumType< + "std::fts::LuceneLanguage", + [ + "ara", + "ben", + "bul", + "cat", + "ces", + "ckb", + "dan", + "deu", + "ell", + "eng", + "est", + "eus", + "fas", + "fin", + "fra", + "gle", + "glg", + "hin", + "hun", + "hye", + "ind", + "ita", + "lav", + "lit", + "nld", + "nor", + "por", + "ron", + "rus", + "spa", + "srp", + "swe", + "tha", + "tur", + "edb_Brazilian", + "edb_ChineseJapaneseKorean", + "edb_Indian", + ] +>; +const LuceneLanguage: $LuceneLanguage = $.makeType<$LuceneLanguage>( + _.spec, + "17c3aca3-4464-5257-bc9f-591fb7bf704c", + _.syntax.literal, +); + +export type $PGLanguage = { + xxx_simple: $.$expr_Literal<$PGLanguage>; + ara: $.$expr_Literal<$PGLanguage>; + hye: $.$expr_Literal<$PGLanguage>; + eus: $.$expr_Literal<$PGLanguage>; + cat: $.$expr_Literal<$PGLanguage>; + dan: $.$expr_Literal<$PGLanguage>; + nld: $.$expr_Literal<$PGLanguage>; + eng: $.$expr_Literal<$PGLanguage>; + fin: $.$expr_Literal<$PGLanguage>; + fra: $.$expr_Literal<$PGLanguage>; + deu: $.$expr_Literal<$PGLanguage>; + ell: $.$expr_Literal<$PGLanguage>; + hin: $.$expr_Literal<$PGLanguage>; + hun: $.$expr_Literal<$PGLanguage>; + ind: $.$expr_Literal<$PGLanguage>; + gle: $.$expr_Literal<$PGLanguage>; + ita: $.$expr_Literal<$PGLanguage>; + lit: $.$expr_Literal<$PGLanguage>; + npi: $.$expr_Literal<$PGLanguage>; + nor: $.$expr_Literal<$PGLanguage>; + por: $.$expr_Literal<$PGLanguage>; + ron: $.$expr_Literal<$PGLanguage>; + rus: $.$expr_Literal<$PGLanguage>; + srp: $.$expr_Literal<$PGLanguage>; + spa: $.$expr_Literal<$PGLanguage>; + swe: $.$expr_Literal<$PGLanguage>; + tam: $.$expr_Literal<$PGLanguage>; + tur: $.$expr_Literal<$PGLanguage>; + yid: $.$expr_Literal<$PGLanguage>; +} & $.EnumType< + "std::fts::PGLanguage", + [ + "xxx_simple", + "ara", + "hye", + "eus", + "cat", + "dan", + "nld", + "eng", + "fin", + "fra", + "deu", + "ell", + "hin", + "hun", + "ind", + "gle", + "ita", + "lit", + "npi", + "nor", + "por", + "ron", + "rus", + "srp", + "spa", + "swe", + "tam", + "tur", + "yid", + ] +>; +const PGLanguage: $PGLanguage = $.makeType<$PGLanguage>( + _.spec, + "f613baf6-1ed8-557e-8f68-e91a0d39e65d", + _.syntax.literal, +); + +export type $Weight = { + A: $.$expr_Literal<$Weight>; + B: $.$expr_Literal<$Weight>; + C: $.$expr_Literal<$Weight>; + D: $.$expr_Literal<$Weight>; +} & $.EnumType<"std::fts::Weight", ["A", "B", "C", "D"]>; +const Weight: $Weight = $.makeType<$Weight>( + _.spec, + "cb579c2d-cc54-54e6-9636-fff6c1643771", + _.syntax.literal, +); + +export type $document = $.ScalarType<"std::fts::document", unknown>; +const document: $.scalarTypeWithConstructor<$document, never> = $.makeType< + $.scalarTypeWithConstructor<$document, never> +>(_.spec, "1d63520b-60fc-5ffe-a70c-ebdb1b3887c2", _.syntax.literal); + +type with_optionsλFuncExpr< + NamedArgs extends { + language: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + weight_category?: _.castMaps.orScalarLiteral<$.TypeSet<$Weight>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $document, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +/** + * + Adds language and weight category information to a string, + so it be indexed with std::fts::index. + + */ +function with_options< + NamedArgs extends { + language: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + weight_category?: _.castMaps.orScalarLiteral<$.TypeSet<$Weight>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(namedArgs: NamedArgs, text: P1): with_optionsλFuncExpr; +function with_options(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::fts::with_options", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + language: { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + weight_category: { + typeId: "cb579c2d-cc54-54e6-9636-fff6c1643771", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "1d63520b-60fc-5ffe-a70c-ebdb1b3887c2", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::fts::with_options", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type searchλFuncExpr< + NamedArgs extends { + language?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + weights?: $.TypeSet<$.ArrayType<_std.$float64>>; + }, + P1 extends $.TypeSet<$.AnyObjectType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $.NamedTupleType<{ object: $.AnyObjectType; score: _std.$float32 }>, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +type searchλFuncExpr2< + P1 extends $.TypeSet<$.AnyObjectType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $.NamedTupleType<{ object: $.AnyObjectType; score: _std.$float32 }>, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + "Zero" + > +>; +/** + * + Search an object using its std::fts::index index. + Returns objects that match the specified query and the matching score. + + */ +function search< + NamedArgs extends { + language?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + weights?: $.TypeSet<$.ArrayType<_std.$float64>>; + }, + P1 extends $.TypeSet<$.AnyObjectType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>( + namedArgs: NamedArgs, + object: P1, + query: P2, +): searchλFuncExpr; +/** + * + Search an object using its std::fts::index index. + Returns objects that match the specified query and the matching score. + + */ +function search< + P1 extends $.TypeSet<$.AnyObjectType>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(object: P1, query: P2): searchλFuncExpr2; +function search(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::fts::search", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000003", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + language: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + weights: { + typeId: "2b65df4c-4942-59b1-8819-061ca68b2f4e", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "c13eb6f1-a05c-533f-bfe8-a50b1a077fd0", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::fts::search", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { + ElasticLanguage, + Language, + LuceneLanguage, + PGLanguage, + Weight, + document, +}; + +type __defaultExports = { + ElasticLanguage: typeof ElasticLanguage; + Language: typeof Language; + LuceneLanguage: typeof LuceneLanguage; + PGLanguage: typeof PGLanguage; + Weight: typeof Weight; + document: typeof document; + with_options: typeof with_options; + search: typeof search; +}; +const __defaultExports: __defaultExports = { + ElasticLanguage: ElasticLanguage, + Language: Language, + LuceneLanguage: LuceneLanguage, + PGLanguage: PGLanguage, + Weight: Weight, + document: document, + with_options: with_options, + search: search, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/math.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/math.ts new file mode 100644 index 00000000000..eb598933819 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/math.ts @@ -0,0 +1,1126 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +import type * as _std from "../std"; +type lgλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +type lgλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.cardutil.paramCardinality>; +/** + * Return the base 10 logarithm of the input value. + */ +function lg>>( + x: P1, +): lgλFuncExpr; +/** + * Return the base 10 logarithm of the input value. + */ +function lg< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(x: P1): lgλFuncExpr2; +function lg(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::lg", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::lg", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type absλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyreal>>, +> = $.$expr_Function<_std.$anyreal, $.cardutil.paramCardinality>; +/** + * Return the absolute value of the input *x*. + */ +function abs>>( + x: P1, +): absλFuncExpr; +function abs(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::abs", args, _.spec, [ + { + args: [ + { + typeId: "04976545-1176-5536-8673-c9f7d18d581b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "04976545-1176-5536-8673-c9f7d18d581b", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::abs", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type ceilλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +type ceilλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +> = $.$expr_Function<_std.$bigint, $.cardutil.paramCardinality>; +type ceilλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.cardutil.paramCardinality>; +/** + * Round up to the nearest integer. + */ +function ceil>>( + x: P1, +): ceilλFuncExpr; +/** + * Round up to the nearest integer. + */ +function ceil>>( + x: P1, +): ceilλFuncExpr2; +/** + * Round up to the nearest integer. + */ +function ceil< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(x: P1): ceilλFuncExpr3; +function ceil(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::ceil", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::ceil", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type floorλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +type floorλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>, +> = $.$expr_Function<_std.$bigint, $.cardutil.paramCardinality>; +type floorλFuncExpr3< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.cardutil.paramCardinality>; +/** + * Round down to the nearest integer. + */ +function floor>>( + x: P1, +): floorλFuncExpr; +/** + * Round down to the nearest integer. + */ +function floor>>( + x: P1, +): floorλFuncExpr2; +/** + * Round down to the nearest integer. + */ +function floor< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(x: P1): floorλFuncExpr3; +function floor(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::floor", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::floor", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type lnλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +type lnλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.cardutil.paramCardinality>; +/** + * Return the natural logarithm of the input value. + */ +function ln>>( + x: P1, +): lnλFuncExpr; +/** + * Return the natural logarithm of the input value. + */ +function ln< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(x: P1): lnλFuncExpr2; +function ln(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::ln", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::ln", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type logλFuncExpr< + NamedArgs extends { + base: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Return the logarithm of the input value in the specified *base*. + */ +function log< + NamedArgs extends { + base: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(namedArgs: NamedArgs, x: P1): logλFuncExpr; +function log(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::log", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + base: { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::log", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type sqrtλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +type sqrtλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.cardutil.paramCardinality>; +/** + * Return the square root of the input value. + */ +function sqrt>>( + x: P1, +): sqrtλFuncExpr; +/** + * Return the square root of the input value. + */ +function sqrt< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(x: P1): sqrtλFuncExpr2; +function sqrt(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::sqrt", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::sqrt", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type meanλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.Cardinality.One>; +type meanλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.Cardinality.One>; +/** + * Return the arithmetic mean of the input set. + */ +function mean>>( + vals: P1, +): meanλFuncExpr; +/** + * Return the arithmetic mean of the input set. + */ +function mean< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(vals: P1): meanλFuncExpr2; +function mean(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::mean", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::mean", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type stddevλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.Cardinality.One>; +type stddevλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.Cardinality.One>; +/** + * Return the sample standard deviation of the input set. + */ +function stddev>>( + vals: P1, +): stddevλFuncExpr; +/** + * Return the sample standard deviation of the input set. + */ +function stddev< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(vals: P1): stddevλFuncExpr2; +function stddev(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::stddev", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::stddev", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type stddev_popλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.Cardinality.One>; +type stddev_popλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function<_std.$decimal, $.Cardinality.One>; +/** + * Return the population standard deviation of the input set. + */ +function stddev_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(vals: P1): stddev_popλFuncExpr; +/** + * Return the population standard deviation of the input set. + */ +function stddev_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(vals: P1): stddev_popλFuncExpr2; +function stddev_pop(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::stddev_pop", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::stddev_pop", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type var_6499cc9d9d4c58bcaa35075aa52c9823λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, + $.cardutil.overrideLowerBound<$.Cardinality.One, "Zero"> +>; +type var_6499cc9d9d4c58bcaa35075aa52c9823λFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, + $.cardutil.overrideLowerBound<$.Cardinality.One, "Zero"> +>; +/** + * Return the sample variance of the input set. + */ +function var_6499cc9d9d4c58bcaa35075aa52c9823< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(vals: P1): var_6499cc9d9d4c58bcaa35075aa52c9823λFuncExpr; +/** + * Return the sample variance of the input set. + */ +function var_6499cc9d9d4c58bcaa35075aa52c9823< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(vals: P1): var_6499cc9d9d4c58bcaa35075aa52c9823λFuncExpr2; +function var_6499cc9d9d4c58bcaa35075aa52c9823(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::var", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "OptionalType", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::var", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type var_popλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, + $.cardutil.overrideLowerBound<$.Cardinality.One, "Zero"> +>; +type var_popλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +> = $.$expr_Function< + _std.$decimal, + $.cardutil.overrideLowerBound<$.Cardinality.One, "Zero"> +>; +/** + * Return the population variance of the input set. + */ +function var_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(vals: P1): var_popλFuncExpr; +/** + * Return the population variance of the input set. + */ +function var_pop< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, +>(vals: P1): var_popλFuncExpr2; +function var_pop(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::var_pop", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + returnTypemod: "OptionalType", + }, + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::var_pop", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type piλFuncExpr = $.$expr_Function<_std.$number, $.Cardinality.One>; +/** + * Return the constant value of pi. + */ +function pi(): piλFuncExpr; +function pi(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::pi", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-0000000001ff" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::pi", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type acosλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the inverse cosine of the input value. + */ +function acos>>( + x: P1, +): acosλFuncExpr; +function acos(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::acos", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::acos", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type asinλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the inverse sine of the input value. + */ +function asin>>( + x: P1, +): asinλFuncExpr; +function asin(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::asin", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::asin", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type atanλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the inverse tangent of the input value. + */ +function atan>>( + x: P1, +): atanλFuncExpr; +function atan(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::atan", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::atan", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type atan2λFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function< + _std.$number, + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + > +>; +/** + * Return the inverse tangent of y/x of the input value. + */ +function atan2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, + P2 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +>(y: P1, x: P2): atan2λFuncExpr; +function atan2(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::atan2", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::atan2", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type cosλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the cosine of the input value. + */ +function cos>>( + x: P1, +): cosλFuncExpr; +function cos(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::cos", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::cos", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type cotλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the cotangent of the input value. + */ +function cot>>( + x: P1, +): cotλFuncExpr; +function cot(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::cot", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::cot", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type sinλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the sine of the input value. + */ +function sin>>( + x: P1, +): sinλFuncExpr; +function sin(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::sin", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::sin", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type tanλFuncExpr< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>, +> = $.$expr_Function<_std.$number, $.cardutil.paramCardinality>; +/** + * Return the tangent of the input value. + */ +function tan>>( + x: P1, +): tanλFuncExpr; +function tan(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("std::math::tan", args, _.spec, [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::math::tan", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type __defaultExports = { + lg: typeof lg; + abs: typeof abs; + ceil: typeof ceil; + floor: typeof floor; + ln: typeof ln; + log: typeof log; + sqrt: typeof sqrt; + mean: typeof mean; + stddev: typeof stddev; + stddev_pop: typeof stddev_pop; + var: typeof var_6499cc9d9d4c58bcaa35075aa52c9823; + var_pop: typeof var_pop; + pi: typeof pi; + acos: typeof acos; + asin: typeof asin; + atan: typeof atan; + atan2: typeof atan2; + cos: typeof cos; + cot: typeof cot; + sin: typeof sin; + tan: typeof tan; +}; +const __defaultExports: __defaultExports = { + lg: lg, + abs: abs, + ceil: ceil, + floor: floor, + ln: ln, + log: log, + sqrt: sqrt, + mean: mean, + stddev: stddev, + stddev_pop: stddev_pop, + var: var_6499cc9d9d4c58bcaa35075aa52c9823, + var_pop: var_pop, + pi: pi, + acos: acos, + asin: asin, + atan: atan, + atan2: atan2, + cos: cos, + cot: cot, + sin: sin, + tan: tan, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/net.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/net.ts new file mode 100644 index 00000000000..975cd6e067b --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/net.ts @@ -0,0 +1,43 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +import _module__http from "./net/http"; +export type $RequestFailureKind = { + NetworkError: $.$expr_Literal<$RequestFailureKind>; + Timeout: $.$expr_Literal<$RequestFailureKind>; +} & $.EnumType<"std::net::RequestFailureKind", ["NetworkError", "Timeout"]>; +const RequestFailureKind: $RequestFailureKind = $.makeType<$RequestFailureKind>( + _.spec, + "8b93ef2e-2ddd-5ba2-9333-2e28a4d56ede", + _.syntax.literal, +); + +export type $RequestState = { + Pending: $.$expr_Literal<$RequestState>; + InProgress: $.$expr_Literal<$RequestState>; + Completed: $.$expr_Literal<$RequestState>; + Failed: $.$expr_Literal<$RequestState>; +} & $.EnumType< + "std::net::RequestState", + ["Pending", "InProgress", "Completed", "Failed"] +>; +const RequestState: $RequestState = $.makeType<$RequestState>( + _.spec, + "5b46c56e-937c-59d2-b3e6-99c31c7c60f0", + _.syntax.literal, +); + +export { RequestFailureKind, RequestState }; + +type __defaultExports = { + RequestFailureKind: typeof RequestFailureKind; + RequestState: typeof RequestState; + http: typeof _module__http; +}; +const __defaultExports: __defaultExports = { + RequestFailureKind: RequestFailureKind, + RequestState: RequestState, + http: _module__http, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/net/http.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/net/http.ts new file mode 100644 index 00000000000..11012683fdb --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/net/http.ts @@ -0,0 +1,336 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../../reflection"; +import * as _ from "../../../imports"; +import type * as _std from "../../std"; +import type * as _stdnet from "../net"; +export type $Method = { + GET: $.$expr_Literal<$Method>; + POST: $.$expr_Literal<$Method>; + PUT: $.$expr_Literal<$Method>; + DELETE: $.$expr_Literal<$Method>; + HEAD: $.$expr_Literal<$Method>; + OPTIONS: $.$expr_Literal<$Method>; + PATCH: $.$expr_Literal<$Method>; +} & $.EnumType< + "std::net::http::Method", + ["GET", "POST", "PUT", "DELETE", "HEAD", "OPTIONS", "PATCH"] +>; +const Method: $Method = $.makeType<$Method>( + _.spec, + "8896d50c-81c2-5d7d-bb2f-cb2bfba3c628", + _.syntax.literal, +); + +export type $ResponseλShape = $.typeutil.flatten< + _std.$BaseObjectλShape & { + created_at: $.PropertyDesc< + _std.$datetime, + $.Cardinality.One, + false, + false, + false, + false + >; + status: $.PropertyDesc< + _std.$int16, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + headers: $.PropertyDesc< + $.ArrayType<$.NamedTupleType<{ name: _std.$str; value: _std.$str }>>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + body: $.PropertyDesc< + _std.$bytes, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + request: $.LinkDesc< + $ScheduledRequest, + $.Cardinality.AtMostOne, + {}, + false, + true, + false, + false + >; + "; + "; + } +>; +type $Response = $.ObjectType< + "std::net::http::Response", + $ResponseλShape, + null, + [..._std.$BaseObject["__exclusives__"]], + "std::net::http::Response" +>; +const $Response = $.makeType<$Response>( + _.spec, + "6f217eab-7720-5bbc-8b1f-b02098bc9a4e", + _.syntax.literal, +); + +const Response: $.$expr_PathNode< + $.TypeSet<$Response, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Response, $.Cardinality.Many), null); + +export type $ScheduledRequestλShape = $.typeutil.flatten< + _std.$BaseObjectλShape & { + state: $.PropertyDesc< + _stdnet.$RequestState, + $.Cardinality.One, + false, + false, + false, + false + >; + created_at: $.PropertyDesc< + _std.$datetime, + $.Cardinality.One, + false, + false, + false, + false + >; + updated_at: $.PropertyDesc< + _std.$datetime, + $.Cardinality.One, + false, + false, + false, + false + >; + failure: $.PropertyDesc< + $.NamedTupleType<{ + kind: _stdnet.$RequestFailureKind; + message: _std.$str; + }>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + url: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + method: $.PropertyDesc< + $Method, + $.Cardinality.One, + false, + false, + false, + false + >; + headers: $.PropertyDesc< + $.ArrayType<$.NamedTupleType<{ name: _std.$str; value: _std.$str }>>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + body: $.PropertyDesc< + _std.$bytes, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + response: $.LinkDesc< + $Response, + $.Cardinality.AtMostOne, + {}, + true, + false, + false, + false + >; + "; + "; + } +>; +type $ScheduledRequest = $.ObjectType< + "std::net::http::ScheduledRequest", + $ScheduledRequestλShape, + null, + [ + ..._std.$BaseObject["__exclusives__"], + { + response: { + __element__: $Response; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "std::net::http::ScheduledRequest" +>; +const $ScheduledRequest = $.makeType<$ScheduledRequest>( + _.spec, + "e6bf05a7-60c7-51dd-b30d-c8fce5bcadfd", + _.syntax.literal, +); + +const ScheduledRequest: $.$expr_PathNode< + $.TypeSet<$ScheduledRequest, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ScheduledRequest, $.Cardinality.Many), null); + +type schedule_requestλFuncExpr< + NamedArgs extends { + body?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + headers?: $.TypeSet< + $.ArrayType<$.NamedTupleType<{ name: _std.$str; value: _std.$str }>> + >; + method?: _.castMaps.orScalarLiteral<$.TypeSet<$Method>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function< + $ScheduledRequest, + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + > +>; +type schedule_requestλFuncExpr2< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +> = $.$expr_Function<$ScheduledRequest, $.cardutil.paramCardinality>; +function schedule_request< + NamedArgs extends { + body?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + headers?: $.TypeSet< + $.ArrayType<$.NamedTupleType<{ name: _std.$str; value: _std.$str }>> + >; + method?: _.castMaps.orScalarLiteral<$.TypeSet<$Method>>; + }, + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(namedArgs: NamedArgs, url: P1): schedule_requestλFuncExpr; +function schedule_request< + P1 extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>, +>(url: P1): schedule_requestλFuncExpr2; +function schedule_request(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload( + "std::net::http::schedule_request", + args, + _.spec, + [ + { + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + body: { + typeId: "00000000-0000-0000-0000-000000000102", + optional: true, + setoftype: false, + variadic: false, + }, + headers: { + typeId: "29b1b6f1-a0e0-577d-adcf-e493f6b2303a", + optional: true, + setoftype: false, + variadic: false, + }, + method: { + typeId: "8896d50c-81c2-5d7d-bb2f-cb2bfba3c628", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "e6bf05a7-60c7-51dd-b30d-c8fce5bcadfd", + }, + ], + ); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::net::http::schedule_request", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { Method, $Response, Response, $ScheduledRequest, ScheduledRequest }; + +type __defaultExports = { + Method: typeof Method; + Response: typeof Response; + ScheduledRequest: typeof ScheduledRequest; + schedule_request: typeof schedule_request; +}; +const __defaultExports: __defaultExports = { + Method: Method, + Response: Response, + ScheduledRequest: ScheduledRequest, + schedule_request: schedule_request, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/std/pg.ts b/starters/features/gel/dbschema/edgeql-js/modules/std/pg.ts new file mode 100644 index 00000000000..3019d32f8b7 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/std/pg.ts @@ -0,0 +1,49 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../../reflection"; +import * as _ from "../../imports"; +export type $date = $.ScalarType<"std::pg::date", unknown>; +const date: $.scalarTypeWithConstructor<$date, never> = $.makeType< + $.scalarTypeWithConstructor<$date, never> +>(_.spec, "00000000-0000-0000-0000-000001000004", _.syntax.literal); + +export type $interval = $.ScalarType<"std::pg::interval", unknown>; +const interval: $.scalarTypeWithConstructor<$interval, never> = $.makeType< + $.scalarTypeWithConstructor<$interval, never> +>(_.spec, "00000000-0000-0000-0000-000001000005", _.syntax.literal); + +export type $json = $.ScalarType<"std::pg::json", unknown>; +const json: $.scalarTypeWithConstructor<$json, never> = $.makeType< + $.scalarTypeWithConstructor<$json, never> +>(_.spec, "00000000-0000-0000-0000-000001000001", _.syntax.literal); + +export type $timestamp = $.ScalarType<"std::pg::timestamp", unknown>; +const timestamp: $.scalarTypeWithConstructor<$timestamp, never> = $.makeType< + $.scalarTypeWithConstructor<$timestamp, never> +>(_.spec, "00000000-0000-0000-0000-000001000003", _.syntax.literal); + +export type $timestamptz = $.ScalarType<"std::pg::timestamptz", unknown>; +const timestamptz: $.scalarTypeWithConstructor<$timestamptz, never> = + $.makeType<$.scalarTypeWithConstructor<$timestamptz, never>>( + _.spec, + "00000000-0000-0000-0000-000001000002", + _.syntax.literal, + ); + +export { date, interval, json, timestamp, timestamptz }; + +type __defaultExports = { + date: typeof date; + interval: typeof interval; + json: typeof json; + timestamp: typeof timestamp; + timestamptz: typeof timestamptz; +}; +const __defaultExports: __defaultExports = { + date: date, + interval: interval, + json: json, + timestamp: timestamp, + timestamptz: timestamptz, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/modules/sys.ts b/starters/features/gel/dbschema/edgeql-js/modules/sys.ts new file mode 100644 index 00000000000..6500c28a8f2 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/modules/sys.ts @@ -0,0 +1,1006 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "../reflection"; +import * as _ from "../imports"; +import type * as _schema from "./schema"; +import type * as _std from "./std"; +export type $OutputFormat = { + BINARY: $.$expr_Literal<$OutputFormat>; + JSON: $.$expr_Literal<$OutputFormat>; + JSON_ELEMENTS: $.$expr_Literal<$OutputFormat>; + NONE: $.$expr_Literal<$OutputFormat>; +} & $.EnumType< + "sys::OutputFormat", + ["BINARY", "JSON", "JSON_ELEMENTS", "NONE"] +>; +const OutputFormat: $OutputFormat = $.makeType<$OutputFormat>( + _.spec, + "cae65a8c-a99f-5524-9872-daecdc545531", + _.syntax.literal, +); + +export type $QueryType = { + EdgeQL: $.$expr_Literal<$QueryType>; + SQL: $.$expr_Literal<$QueryType>; +} & $.EnumType<"sys::QueryType", ["EdgeQL", "SQL"]>; +const QueryType: $QueryType = $.makeType<$QueryType>( + _.spec, + "f2887f6f-bd51-5422-8ac7-d1732fdcd17d", + _.syntax.literal, +); + +export type $TransactionAccessMode = { + ReadOnly: $.$expr_Literal<$TransactionAccessMode>; + ReadWrite: $.$expr_Literal<$TransactionAccessMode>; +} & $.EnumType<"sys::TransactionAccessMode", ["ReadOnly", "ReadWrite"]>; +const TransactionAccessMode: $TransactionAccessMode = + $.makeType<$TransactionAccessMode>( + _.spec, + "775fc501-0b35-57fa-8587-cd7c53557cdf", + _.syntax.literal, + ); + +export type $TransactionDeferrability = { + Deferrable: $.$expr_Literal<$TransactionDeferrability>; + NotDeferrable: $.$expr_Literal<$TransactionDeferrability>; +} & $.EnumType< + "sys::TransactionDeferrability", + ["Deferrable", "NotDeferrable"] +>; +const TransactionDeferrability: $TransactionDeferrability = + $.makeType<$TransactionDeferrability>( + _.spec, + "2eb021ec-461e-5b65-859c-26c1eee234a1", + _.syntax.literal, + ); + +export type $TransactionIsolation = { + RepeatableRead: $.$expr_Literal<$TransactionIsolation>; + Serializable: $.$expr_Literal<$TransactionIsolation>; +} & $.EnumType<"sys::TransactionIsolation", ["RepeatableRead", "Serializable"]>; +const TransactionIsolation: $TransactionIsolation = + $.makeType<$TransactionIsolation>( + _.spec, + "070715f3-0100-5580-9473-696f961243eb", + _.syntax.literal, + ); + +export type $VersionStage = { + dev: $.$expr_Literal<$VersionStage>; + alpha: $.$expr_Literal<$VersionStage>; + beta: $.$expr_Literal<$VersionStage>; + rc: $.$expr_Literal<$VersionStage>; + final: $.$expr_Literal<$VersionStage>; +} & $.EnumType<"sys::VersionStage", ["dev", "alpha", "beta", "rc", "final"]>; +const VersionStage: $VersionStage = $.makeType<$VersionStage>( + _.spec, + "16a08f13-b1b1-57f4-8e82-062f67fb2a4c", + _.syntax.literal, +); + +export type $SystemObjectλShape = $.typeutil.flatten< + _schema.$Object_32faaa35947553cf88fce68ecf1be4d9λShape & {} +>; +type $SystemObject = $.ObjectType< + "sys::SystemObject", + $SystemObjectλShape, + null, + [..._schema.$Object_32faaa35947553cf88fce68ecf1be4d9["__exclusives__"]], + | "sys::Branch" + | "sys::Database" + | "sys::ExtensionPackage" + | "sys::ExtensionPackageMigration" + | "sys::QueryStats" + | "sys::Role" +>; +const $SystemObject = $.makeType<$SystemObject>( + _.spec, + "43f8d5e9-5b2e-535b-a46b-acf8af101718", + _.syntax.literal, +); + +const SystemObject: $.$expr_PathNode< + $.TypeSet<$SystemObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($SystemObject, $.Cardinality.Many), null); + +export type $ExternalObjectλShape = $.typeutil.flatten< + $SystemObjectλShape & {} +>; +type $ExternalObject = $.ObjectType< + "sys::ExternalObject", + $ExternalObjectλShape, + null, + [...$SystemObject["__exclusives__"]], + "sys::Branch" | "sys::Database" | "sys::QueryStats" +>; +const $ExternalObject = $.makeType<$ExternalObject>( + _.spec, + "e3838826-d523-59f9-86f4-be3cecdf0d4f", + _.syntax.literal, +); + +const ExternalObject: $.$expr_PathNode< + $.TypeSet<$ExternalObject, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ExternalObject, $.Cardinality.Many), null); + +export type $BranchλShape = $.typeutil.flatten< + $ExternalObjectλShape & + _schema.$AnnotationSubjectλShape & { + name: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + true, + false, + false, + false + >; + last_migration: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Branch = $.ObjectType< + "sys::Branch", + $BranchλShape, + null, + [ + ...$ExternalObject["__exclusives__"], + ..._schema.$AnnotationSubject["__exclusives__"], + { + name: { + __element__: _std.$str; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "sys::Branch" | "sys::Database" +>; +const $Branch = $.makeType<$Branch>( + _.spec, + "2572fefc-1810-5379-bc6e-af9b8cf3943b", + _.syntax.literal, +); + +const Branch: $.$expr_PathNode< + $.TypeSet<$Branch, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Branch, $.Cardinality.Many), null); + +export type $DatabaseλShape = $.typeutil.flatten<$BranchλShape & {}>; +type $Database = $.ObjectType< + "sys::Database", + $DatabaseλShape, + null, + [...$Branch["__exclusives__"]], + "sys::Database" +>; +const $Database = $.makeType<$Database>( + _.spec, + "fd469647-1cf1-5702-85b6-bbdb7e7f1c7e", + _.syntax.literal, +); + +const Database: $.$expr_PathNode< + $.TypeSet<$Database, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Database, $.Cardinality.Many), null); + +export type $ExtensionPackageλShape = $.typeutil.flatten< + $SystemObjectλShape & + _schema.$AnnotationSubjectλShape & { + script: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + version: $.PropertyDesc< + $.NamedTupleType<{ + major: _std.$int64; + minor: _std.$int64; + stage: $VersionStage; + stage_no: _std.$int64; + local: $.ArrayType<_std.$str>; + }>, + $.Cardinality.One, + false, + false, + false, + false + >; + "; + "; + } +>; +type $ExtensionPackage = $.ObjectType< + "sys::ExtensionPackage", + $ExtensionPackageλShape, + null, + [ + ...$SystemObject["__exclusives__"], + ..._schema.$AnnotationSubject["__exclusives__"], + ], + "sys::ExtensionPackage" +>; +const $ExtensionPackage = $.makeType<$ExtensionPackage>( + _.spec, + "87787989-1e54-5529-9cc4-524cc873528d", + _.syntax.literal, +); + +const ExtensionPackage: $.$expr_PathNode< + $.TypeSet<$ExtensionPackage, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($ExtensionPackage, $.Cardinality.Many), null); + +export type $ExtensionPackageMigrationλShape = $.typeutil.flatten< + $SystemObjectλShape & + _schema.$AnnotationSubjectλShape & { + script: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + false, + false, + false, + false + >; + from_version: $.PropertyDesc< + $.NamedTupleType<{ + major: _std.$int64; + minor: _std.$int64; + stage: $VersionStage; + stage_no: _std.$int64; + local: $.ArrayType<_std.$str>; + }>, + $.Cardinality.One, + false, + false, + false, + false + >; + to_version: $.PropertyDesc< + $.NamedTupleType<{ + major: _std.$int64; + minor: _std.$int64; + stage: $VersionStage; + stage_no: _std.$int64; + local: $.ArrayType<_std.$str>; + }>, + $.Cardinality.One, + false, + false, + false, + false + >; + } +>; +type $ExtensionPackageMigration = $.ObjectType< + "sys::ExtensionPackageMigration", + $ExtensionPackageMigrationλShape, + null, + [ + ...$SystemObject["__exclusives__"], + ..._schema.$AnnotationSubject["__exclusives__"], + ], + "sys::ExtensionPackageMigration" +>; +const $ExtensionPackageMigration = $.makeType<$ExtensionPackageMigration>( + _.spec, + "e3aaabec-f88b-5fe0-b06e-cea0b3d46fa8", + _.syntax.literal, +); + +const ExtensionPackageMigration: $.$expr_PathNode< + $.TypeSet<$ExtensionPackageMigration, $.Cardinality.Many>, + null +> = _.syntax.$PathNode( + $.$toSet($ExtensionPackageMigration, $.Cardinality.Many), + null, +); + +export type $QueryStatsλShape = $.typeutil.flatten< + $ExternalObjectλShape & { + query: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + query_type: $.PropertyDesc< + $QueryType, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + tag: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + compilation_config: $.PropertyDesc< + _std.$json, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + protocol_version: $.PropertyDesc< + $.NamedTupleType<{ major: _std.$int16; minor: _std.$int16 }>, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + default_namespace: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + namespace_aliases: $.PropertyDesc< + _std.$json, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + output_format: $.PropertyDesc< + $OutputFormat, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + expect_one: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + implicit_limit: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + inline_typeids: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + inline_typenames: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + inline_objectids: $.PropertyDesc< + _std.$bool, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + plans: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + total_plan_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + min_plan_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + max_plan_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + mean_plan_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + stddev_plan_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + calls: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + total_exec_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + min_exec_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + max_exec_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + mean_exec_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + stddev_exec_time: $.PropertyDesc< + _std.$duration, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + rows: $.PropertyDesc< + _std.$int64, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + stats_since: $.PropertyDesc< + _std.$datetime, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + minmax_stats_since: $.PropertyDesc< + _std.$datetime, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + branch: $.LinkDesc< + $Branch, + $.Cardinality.AtMostOne, + {}, + false, + false, + false, + false + >; + } +>; +type $QueryStats = $.ObjectType< + "sys::QueryStats", + $QueryStatsλShape, + null, + [...$ExternalObject["__exclusives__"]], + "sys::QueryStats" +>; +const $QueryStats = $.makeType<$QueryStats>( + _.spec, + "ce92490c-1d17-5950-8bdd-cf9e23817551", + _.syntax.literal, +); + +const QueryStats: $.$expr_PathNode< + $.TypeSet<$QueryStats, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($QueryStats, $.Cardinality.Many), null); + +export type $RoleλShape = $.typeutil.flatten< + $SystemObjectλShape & + _schema.$InheritingObjectλShape & + _schema.$AnnotationSubjectλShape & { + name: $.PropertyDesc< + _std.$str, + $.Cardinality.One, + true, + false, + false, + false + >; + superuser: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + false, + false, + false + >; + is_superuser: $.PropertyDesc< + _std.$bool, + $.Cardinality.One, + false, + true, + false, + false + >; + password: $.PropertyDesc< + _std.$str, + $.Cardinality.AtMostOne, + false, + false, + false, + false + >; + member_of: $.LinkDesc< + $Role, + $.Cardinality.Many, + {}, + false, + false, + false, + false + >; + "; + "; + } +>; +type $Role = $.ObjectType< + "sys::Role", + $RoleλShape, + null, + [ + ...$SystemObject["__exclusives__"], + ..._schema.$InheritingObject["__exclusives__"], + ..._schema.$AnnotationSubject["__exclusives__"], + { + name: { + __element__: _std.$str; + __cardinality__: $.Cardinality.One | $.Cardinality.AtMostOne; + }; + }, + ], + "sys::Role" +>; +const $Role = $.makeType<$Role>( + _.spec, + "04d3804d-c37f-5969-86b2-a24309653b14", + _.syntax.literal, +); + +const Role: $.$expr_PathNode< + $.TypeSet<$Role, $.Cardinality.Many>, + null +> = _.syntax.$PathNode($.$toSet($Role, $.Cardinality.Many), null); + +type reset_query_statsλFuncExpr< + NamedArgs extends { + branch_name?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + id?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + minmax_only?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, +> = $.$expr_Function< + _std.$datetime, + $.cardutil.overrideLowerBound< + $.cardutil.multiplyCardinalities< + $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + >, + $.cardutil.optionalParamCardinality + >, + "Zero" + > +>; +/** + * Discard query statistics gathered so far corresponding to the specified `branch_name` and `id`. If either of the parameters is not specified, the statistics that match with the other parameter will be reset. If no parameter is specified, it will discard all statistics. When `minmax_only` is `true`, only the values of minimum and maximum planning and execution time will be reset (i.e. `min_plan_time`, `max_plan_time`, `min_exec_time` and `max_exec_time` fields). The default value for `minmax_only` parameter is `false`. This function returns the time of a reset. This time is saved to `stats_reset` or `minmax_stats_since` field of `sys::QueryStats` if the corresponding reset was actually performed. + */ +function reset_query_stats< + NamedArgs extends { + branch_name?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + id?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + minmax_only?: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }, +>(namedArgs: NamedArgs): reset_query_statsλFuncExpr; +function reset_query_stats(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::reset_query_stats", args, _.spec, [ + { + args: [], + namedArgs: { + branch_name: { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + id: { + typeId: "00000000-0000-0000-0000-000000000100", + optional: true, + setoftype: false, + variadic: false, + }, + minmax_only: { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: "00000000-0000-0000-0000-00000000010a", + returnTypemod: "OptionalType", + }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::reset_query_stats", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_versionλFuncExpr = $.$expr_Function< + $.NamedTupleType<{ + major: _std.$int64; + minor: _std.$int64; + stage: $VersionStage; + stage_no: _std.$int64; + local: $.ArrayType<_std.$str>; + }>, + $.Cardinality.One +>; +/** + * Return the server version as a tuple. + */ +function get_version(): get_versionλFuncExpr; +function get_version(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::get_version", args, _.spec, [ + { args: [], returnTypeId: "48a4615d-2402-5744-bd11-17015ad18bb9" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_version", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_version_as_strλFuncExpr = $.$expr_Function< + _std.$str, + $.Cardinality.One +>; +/** + * Return the server version as a string. + */ +function get_version_as_str(): get_version_as_strλFuncExpr; +function get_version_as_str(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::get_version_as_str", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000101" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_version_as_str", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_instance_nameλFuncExpr = $.$expr_Function< + _std.$str, + $.Cardinality.One +>; +/** + * Return the server instance name. + */ +function get_instance_name(): get_instance_nameλFuncExpr; +function get_instance_name(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::get_instance_name", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000101" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_instance_name", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_transaction_isolationλFuncExpr = $.$expr_Function< + $TransactionIsolation, + $.Cardinality.One +>; +/** + * Return the isolation level of the current transaction. + */ +function get_transaction_isolation(): get_transaction_isolationλFuncExpr; +function get_transaction_isolation(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload( + "sys::get_transaction_isolation", + args, + _.spec, + [{ args: [], returnTypeId: "070715f3-0100-5580-9473-696f961243eb" }], + ); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_transaction_isolation", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_current_databaseλFuncExpr = $.$expr_Function< + _std.$str, + $.Cardinality.One +>; +/** + * Return the name of the current database branch as a string. + */ +function get_current_database(): get_current_databaseλFuncExpr; +function get_current_database(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::get_current_database", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000101" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_current_database", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +type get_current_branchλFuncExpr = $.$expr_Function< + _std.$str, + $.Cardinality.One +>; +/** + * Return the name of the current database branch as a string. + */ +function get_current_branch(): get_current_branchλFuncExpr; +function get_current_branch(...args: any[]) { + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = _.syntax.$resolveOverload("sys::get_current_branch", args, _.spec, [ + { args: [], returnTypeId: "00000000-0000-0000-0000-000000000101" }, + ]); + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "sys::get_current_branch", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { + OutputFormat, + QueryType, + TransactionAccessMode, + TransactionDeferrability, + TransactionIsolation, + VersionStage, + $SystemObject, + SystemObject, + $ExternalObject, + ExternalObject, + $Branch, + Branch, + $Database, + Database, + $ExtensionPackage, + ExtensionPackage, + $ExtensionPackageMigration, + ExtensionPackageMigration, + $QueryStats, + QueryStats, + $Role, + Role, +}; + +type __defaultExports = { + OutputFormat: typeof OutputFormat; + QueryType: typeof QueryType; + TransactionAccessMode: typeof TransactionAccessMode; + TransactionDeferrability: typeof TransactionDeferrability; + TransactionIsolation: typeof TransactionIsolation; + VersionStage: typeof VersionStage; + SystemObject: typeof SystemObject; + ExternalObject: typeof ExternalObject; + Branch: typeof Branch; + Database: typeof Database; + ExtensionPackage: typeof ExtensionPackage; + ExtensionPackageMigration: typeof ExtensionPackageMigration; + QueryStats: typeof QueryStats; + Role: typeof Role; + reset_query_stats: typeof reset_query_stats; + get_version: typeof get_version; + get_version_as_str: typeof get_version_as_str; + get_instance_name: typeof get_instance_name; + get_transaction_isolation: typeof get_transaction_isolation; + get_current_database: typeof get_current_database; + get_current_branch: typeof get_current_branch; +}; +const __defaultExports: __defaultExports = { + OutputFormat: OutputFormat, + QueryType: QueryType, + TransactionAccessMode: TransactionAccessMode, + TransactionDeferrability: TransactionDeferrability, + TransactionIsolation: TransactionIsolation, + VersionStage: VersionStage, + SystemObject: SystemObject, + ExternalObject: ExternalObject, + Branch: Branch, + Database: Database, + ExtensionPackage: ExtensionPackage, + ExtensionPackageMigration: ExtensionPackageMigration, + QueryStats: QueryStats, + Role: Role, + reset_query_stats: reset_query_stats, + get_version: get_version, + get_version_as_str: get_version_as_str, + get_instance_name: get_instance_name, + get_transaction_isolation: get_transaction_isolation, + get_current_database: get_current_database, + get_current_branch: get_current_branch, +}; +export default __defaultExports; diff --git a/starters/features/gel/dbschema/edgeql-js/operators.ts b/starters/features/gel/dbschema/edgeql-js/operators.ts new file mode 100644 index 00000000000..b93125172b0 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/operators.ts @@ -0,0 +1,6782 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "./reflection"; +import * as _ from "./imports"; +import type * as _std from "./modules/std"; +import type * as _stdcal from "./modules/std/cal"; +import type * as _cfg from "./modules/cfg"; +const overloadDefs: { + [opKind in "Infix" | "Prefix" | "Postfix" | "Ternary"]: { + [opSymbol: string]: any[]; + }; +} = { + Infix: { + "=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "?=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "!=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "?!=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: true, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + ">=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + ">": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "<=": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "<": [ + { + kind: "Infix", + args: [ + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a64cb492-91a2-5ee0-890a-6caeb3e32aa5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000002", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "48896eaf-b8af-5f80-9073-0884475d6ee5", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000100", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "0d14e49f-d9f9-51f0-b8f4-c432982cbac2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000130", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "15315dad-c4ad-5335-97d6-4612e66ffb71", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + or: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + and: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "+": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + "-": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010c", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000112", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000112", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010a", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010a", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010c", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010d", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010d", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010b", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010b", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + "*": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Infix", + args: [ + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "49748e47-8d91-5269-9a34-2e8ca194e0f2", + }, + { + kind: "Infix", + args: [ + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "c3231f27-c8a1-5a0c-9830-c71206020eac", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + "/": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + "//": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + "%": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + "^": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + in: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "not in": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + union: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + except: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + intersect: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + "??": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + "++": [ + { + kind: "Infix", + args: [ + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "a6f5468c-c2a6-5852-8f73-57484b1c6831", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000102", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000102", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000101", + }, + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-00000000010f", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010f", + }, + ], + like: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + ilike: [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "not like": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "not ilike": [ + { + kind: "Infix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000101", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + }, + Postfix: {}, + Prefix: { + not: [ + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + "+": [ + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + ], + "-": [ + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-0000000001ff", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-0000000001ff", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000110", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000110", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-00000000010e", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-00000000010e", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000108", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000108", + }, + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000111", + optional: false, + setoftype: false, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000111", + }, + ], + exists: [ + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000109", + }, + ], + distinct: [ + { + kind: "Prefix", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + }, + Ternary: { + if_else: [ + { + kind: "Ternary", + args: [ + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000109", + optional: false, + setoftype: false, + variadic: false, + }, + { + typeId: "00000000-0000-0000-0000-000000000001", + optional: false, + setoftype: true, + variadic: false, + }, + ], + returnTypeId: "00000000-0000-0000-0000-000000000001", + returnTypemod: "SetOfType", + }, + ], + }, +}; + +interface infixOperandsBaseType< + LHS extends _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>, +> { + lhs: LHS; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]> + > + >; +} + +interface infixOperandsRangeType< + LHS extends $.TypeSet<$.RangeType<_std.$anypoint>>, +> { + lhs: LHS; + rhs: $.TypeSet< + $.RangeType<$.getPrimitiveBaseType> + >; +} + +interface infixOperandsMultiRangeType< + LHS extends $.TypeSet<$.MultiRangeType<_std.$anypoint>>, +> { + lhs: LHS; + rhs: $.TypeSet< + $.MultiRangeType<$.getPrimitiveBaseType> + >; +} + +interface infixOperandsArrayTypeNonArray< + LHS extends $.TypeSet<$.ArrayType<$.NonArrayType>>, +> { + lhs: LHS; + rhs: $.TypeSet< + $.ArrayType< + $.getPrimitiveNonArrayBaseType + > + >; +} + +interface PrefixBooleanOperators { + not: { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>> }; +} + +interface PrefixBooleanOneOperators { + exists: { operand: _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> }; +} + +interface PrefixHomogeneousOperators { + "+": + | { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>> } + | { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>> } + | { + operand: _.castMaps.orScalarLiteral< + $.TypeSet<_std.$decimalλICastableTo> + >; + }; + "-": + | { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>> } + | { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>> } + | { operand: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>> } + | { + operand: _.castMaps.orScalarLiteral< + $.TypeSet<_std.$decimalλICastableTo> + >; + } + | { + operand: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + distinct: { operand: _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> }; +} + +interface InfixBooleanMultiplyOperators { + "=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "!=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + ">=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + ">": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "<=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "<": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + or: { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }; + and: { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + }; + like: { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }; + ilike: { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }; + "not like": { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }; + "not ilike": { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + }; +} + +interface InfixBooleanMultiplyOptionalOperators { + "?=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "?!=": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyscalar>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<$.EnumType>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>> + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$uuid>>; + } + | infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>> + | infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>> + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_cfg.$memory>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$anyint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; +} + +interface InfixBooleanMultiplyOneOperators { + in: + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | infixOperandsBaseType<_.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>>; + "not in": + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> } + | infixOperandsBaseType<_.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>>>; +} + +interface InfixScalarMultiplyOperators { + "+": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "-": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$date_duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$datetime>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_date>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_stdcal.$local_time>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$duration>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >; + } + | { + lhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + rhs: _.castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >; + }; + "*": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }; + "/": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }; + "//": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }; + "%": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }; + "^": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$number>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bigint>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>; + }; + "++": + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$bytes>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$str>>; + } + | { + lhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + rhs: _.castMaps.orScalarLiteral<$.TypeSet<_std.$json>>; + }; +} + +interface InfixContainerMultiplyOperators { + union: + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> }; + except: + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> }; + intersect: + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> }; +} + +interface InfixRangeTypeMultiplyOperators { + "+": infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>>; + "-": infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>>; + "*": infixOperandsRangeType<$.TypeSet<$.RangeType<_std.$anypoint>>>; +} + +interface InfixMultiRangeTypeMultiplyOperators { + "+": infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>>; + "-": infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>>; + "*": infixOperandsMultiRangeType<$.TypeSet<$.MultiRangeType<_std.$anypoint>>>; +} + +interface InfixArrayTypeMultiplyOperators { + "++": + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + rhs: $.TypeSet<$.ArrayType<$.AnyTupleType>>; + } + | infixOperandsArrayTypeNonArray<$.TypeSet<$.ArrayType<$.NonArrayType>>>; +} + +interface InfixObjectArrayTypeMultiplyOperators { + "++": { + lhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + rhs: $.TypeSet<$.ArrayType<$.ObjectType>>; + }; +} + +interface InfixBaseTypeMultiplyOneOperators { + except: infixOperandsBaseType< + _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> + >; + intersect: infixOperandsBaseType< + _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> + >; +} + +interface InfixBaseTypeMergeOperators { + union: infixOperandsBaseType< + _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> + >; +} + +interface InfixMergeOperators { + union: { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> }; +} + +interface InfixMergeManyOperators { + except: { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> }; + intersect: { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> }; +} + +interface InfixCoalesceContainerOperators { + "??": + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> }; +} + +interface InfixCoalesceBaseTypeOperators { + "??": infixOperandsBaseType< + _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> + >; +} + +interface InfixCoalesceObjectOperators { + "??": { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> }; +} + +interface TernaryContainerOperators { + if_else: + | { + lhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + rhs: $.TypeSet<_stdcal.$relative_durationλICastableTo>; + } + | { + lhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + rhs: $.TypeSet<_stdcal.$local_datetimeλICastableTo>; + } + | { + lhs: $.TypeSet<_std.$decimalλICastableTo>; + rhs: $.TypeSet<_std.$decimalλICastableTo>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>; + } + | { + lhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + rhs: $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>; + } + | { lhs: $.TypeSet<$.AnyTupleType>; rhs: $.TypeSet<$.AnyTupleType> }; +} + +interface TernaryBaseTypeOperators { + if_else: infixOperandsBaseType< + _.castMaps.orScalarLiteral<$.TypeSet<$.BaseType>> + >; +} + +interface TernaryMergeOperators { + if_else: { lhs: $.TypeSet<$.ObjectType>; rhs: $.TypeSet<$.ObjectType> }; +} + +type ExtractRHS = T extends { lhs: infer LHSType; rhs: infer RHSType } + ? LHS extends LHSType + ? RHSType + : never + : never; + +function op< + Op extends keyof InfixBooleanMultiplyOperators, + LHS extends InfixBooleanMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _std.$bool, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixBooleanMultiplyOptionalOperators, + LHS extends InfixBooleanMultiplyOptionalOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _std.$bool, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.optionalParamCardinality, + $.cardutil.optionalParamCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixBooleanMultiplyOneOperators, + LHS extends InfixBooleanMultiplyOneOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _std.$bool, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.Cardinality.One + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof PrefixBooleanOperators, + Operand extends PrefixBooleanOperators[Op]["operand"], +>( + op: Op, + operand: Operand, +): $.$expr_Operator<_std.$bool, $.cardutil.paramCardinality>; + +function op< + Op extends keyof PrefixBooleanOneOperators, + Operand extends PrefixBooleanOneOperators[Op]["operand"], +>(op: Op, operand: Operand): $.$expr_Operator<_std.$bool, $.Cardinality.One>; + +function op< + Op extends keyof PrefixHomogeneousOperators, + Operand extends PrefixHomogeneousOperators[Op]["operand"], + Element extends _.castMaps.literalToTypeSet["__element__"], + Card extends $.cardutil.paramCardinality, +>(op: Op, operand: Operand): $.$expr_Operator; + +function op< + Op extends keyof InfixScalarMultiplyOperators, + LHS extends InfixScalarMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.getPrimitiveBaseType< + _.castMaps.literalToTypeSet["__element__"] + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixCoalesceBaseTypeOperators, + LHS extends InfixCoalesceBaseTypeOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.getPrimitiveBaseType< + _.castMaps.literalToTypeSet["__element__"] + >, + Card extends $.cardutil.coalesceCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixCoalesceContainerOperators, + LHS extends InfixCoalesceContainerOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _.syntax.getSharedParentPrimitive< + LHS["__element__"], + RHS["__element__"] + >, + Card extends $.cardutil.coalesceCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixCoalesceObjectOperators, + LHS extends InfixCoalesceObjectOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _.syntax.mergeObjectTypes< + LHS["__element__"], + RHS["__element__"] + >, + Card extends $.cardutil.coalesceCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixContainerMultiplyOperators, + LHS extends InfixContainerMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _.syntax.getSharedParentPrimitive< + LHS["__element__"], + RHS["__element__"] + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixRangeTypeMultiplyOperators, + LHS extends InfixRangeTypeMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.RangeType< + $.getPrimitiveBaseType + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixMultiRangeTypeMultiplyOperators, + LHS extends InfixMultiRangeTypeMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.MultiRangeType< + $.getPrimitiveBaseType + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixArrayTypeMultiplyOperators, + LHS extends InfixArrayTypeMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.ArrayType< + _.syntax.getSharedParentPrimitive< + LHS["__element__"]["__element__"], + RHS["__element__"]["__element__"] + > + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixObjectArrayTypeMultiplyOperators, + LHS extends InfixObjectArrayTypeMultiplyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.ArrayType< + _.syntax.mergeObjectTypes< + LHS["__element__"]["__element__"], + RHS["__element__"]["__element__"] + > + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixBaseTypeMultiplyOneOperators, + LHS extends InfixBaseTypeMultiplyOneOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.getPrimitiveBaseType< + _.castMaps.literalToTypeSet["__element__"] + >, + Card extends $.cardutil.multiplyCardinalities< + $.cardutil.paramCardinality, + $.Cardinality.One + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixBaseTypeMergeOperators, + LHS extends InfixBaseTypeMergeOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends $.getPrimitiveBaseType< + _.castMaps.literalToTypeSet["__element__"] + >, + Card extends $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixMergeOperators, + LHS extends InfixMergeOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _.syntax.mergeObjectTypes< + LHS["__element__"], + RHS["__element__"] + >, + Card extends $.cardutil.mergeCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Op extends keyof InfixMergeManyOperators, + LHS extends InfixMergeManyOperators[Op]["lhs"], + RHS extends ExtractRHS, + Element extends _.syntax.mergeObjectTypes< + LHS["__element__"], + RHS["__element__"] + >, + Card extends $.Cardinality.Many, +>(lhs: LHS, op: Op, rhs: RHS): $.$expr_Operator; + +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryContainerOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + lhs: LHS, + op1: "if", + cond: Cond, + op2: "else", + rhs: RHS, +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryContainerOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + op1: "if", + cond: Cond, + op2: "then", + lhs: LHS, + op3: "else", + rhs: RHS, +): $.$expr_Operator< + _.syntax.getSharedParentPrimitive, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; + +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryBaseTypeOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + lhs: LHS, + op1: "if", + cond: Cond, + op2: "else", + rhs: RHS, +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryBaseTypeOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + op1: "if", + cond: Cond, + op2: "then", + lhs: LHS, + op3: "else", + rhs: RHS, +): $.$expr_Operator< + $.getPrimitiveBaseType<_.castMaps.literalToTypeSet["__element__"]>, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; + +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryMergeOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + lhs: LHS, + op1: "if", + cond: Cond, + op2: "else", + rhs: RHS, +): $.$expr_Operator< + _.syntax.mergeObjectTypes, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; +function op< + Cond extends _.castMaps.orScalarLiteral<$.TypeSet<_std.$bool>>, + LHS extends TernaryMergeOperators["if_else"]["lhs"], + RHS extends ExtractRHS, +>( + op1: "if", + cond: Cond, + op2: "then", + lhs: LHS, + op3: "else", + rhs: RHS, +): $.$expr_Operator< + _.syntax.mergeObjectTypes, + $.cardutil.multiplyCardinalities< + $.cardutil.orCardinalities< + $.cardutil.paramCardinality, + $.cardutil.paramCardinality + >, + $.cardutil.paramCardinality + > +>; + +function op(...args: any[]) { + let op: string = ""; + let params: any[] = []; + let defs: any[] | null | undefined = null; + if (args.length === 2) { + if (typeof args[0] === "string" && overloadDefs.Prefix[args[0]]) { + op = args[0]; + params = [args[1]]; + defs = overloadDefs.Prefix[op]; + } else if (typeof args[1] === "string" && overloadDefs.Postfix[args[1]]) { + op = args[1]; + params = [args[0]]; + defs = overloadDefs.Postfix[op]; + } + } else if (args.length === 3) { + if (typeof args[1] === "string") { + op = args[1]; + params = [args[0], args[2]]; + defs = overloadDefs.Infix[op]; + } + } else if (args.length === 5) { + if (typeof args[1] === "string" && typeof args[3] === "string") { + // Python-style if-else + op = `${args[1]}_${args[3]}`; + params = [args[0], args[2], args[4]]; + defs = overloadDefs.Ternary[op]; + } + } else if (args.length === 6) { + // Functional-style if-then-else + if ( + typeof args[0] === "string" && + typeof args[2] === "string" && + typeof args[4] === "string" + ) { + op = `${args[0]}_${args[4]}`; + params = [args[3], args[1], args[5]]; + defs = overloadDefs.Ternary[op]; + } + } + + if (!defs) { + throw new Error( + `No operator exists with signature: ${args.map((arg) => `${arg}`).join(", ")}`, + ); + } + + const { + kind, + returnType, + cardinality, + args: resolvedArgs, + } = _.syntax.$resolveOverload(op, params, _.spec, defs); + + return _.syntax.$expressionify({ + __kind__: $.ExpressionKind.Operator, + __element__: returnType, + __cardinality__: cardinality, + __name__: op, + __opkind__: kind, + __args__: resolvedArgs, + }) as any; +} + +export { op }; diff --git a/starters/features/gel/dbschema/edgeql-js/params.ts b/starters/features/gel/dbschema/edgeql-js/params.ts new file mode 100644 index 00000000000..4df451dc0da --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/params.ts @@ -0,0 +1,140 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel"; +import { + ExpressionKind, + Cardinality, + TypeKind, +} from "gel/dist/reflection/index"; +import type { + Expression, + ParamType, + setToTsType, + TypeSet, + BaseTypeToTsType, +} from "./typesystem"; +import { $expressionify } from "./path"; +import { runnableExpressionKinds } from "./query"; +import { select } from "./select"; +import { complexParamKinds } from "./__spec__"; + +type Param = ParamType | $expr_OptionalParam; + +type ParamsRecord = Record; + +export type $expr_OptionalParam = { + __kind__: ExpressionKind.OptionalParam; + __type__: Type; +}; + +export function optional( + type: Type, +): $expr_OptionalParam { + return { + __kind__: ExpressionKind.OptionalParam, + __type__: type, + }; +} + +export type QueryableWithParamsExpression< + Set extends TypeSet = TypeSet, + Params extends ParamsRecord = Record, +> = Expression & { + run( + cxn: Executor, + args: paramsToParamArgs, + ): Promise>; + runJSON(cxn: Executor, args: paramsToParamArgs): Promise; +}; + +export type $expr_WithParams< + Params extends ParamsRecord = Record, + Expr extends TypeSet = TypeSet, +> = QueryableWithParamsExpression< + { + __kind__: ExpressionKind.WithParams; + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __expr__: Expr; + __params__: $expr_Param[]; + }, + Params +>; + +type paramsToParamArgs = { + [key in keyof Params as Params[key] extends ParamType + ? key + : never]: Params[key] extends ParamType + ? Readonly> + : never; +} & { + [key in keyof Params as Params[key] extends $expr_OptionalParam + ? key + : never]?: Params[key] extends $expr_OptionalParam + ? Readonly | null> + : never; +}; + +export type $expr_Param< + Name extends string | number | symbol = string, + Type extends ParamType = ParamType, + Optional extends boolean = boolean, +> = Expression<{ + __kind__: ExpressionKind.Param; + __element__: Type; + __cardinality__: Optional extends true + ? Cardinality.AtMostOne + : Cardinality.One; + __name__: Name; + __isComplex__: boolean; +}>; + +type paramsToParamExprs = { + [key in keyof Params]: Params[key] extends $expr_OptionalParam + ? $expr_Param + : Params[key] extends ParamType + ? $expr_Param + : never; +}; + +export function params< + Params extends ParamsRecord = Record, + Expr extends Expression = Expression, +>( + paramsDef: Params, + expr: (params: paramsToParamExprs) => Expr, +): $expr_WithParams { + const paramExprs: { [key: string]: $expr_Param } = {}; + for (const [key, param] of Object.entries(paramsDef)) { + const paramType = + param.__kind__ === ExpressionKind.OptionalParam ? param.__type__ : param; + const isComplex = + complexParamKinds.has(paramType.__kind__) || + (paramType.__kind__ === TypeKind.array && + complexParamKinds.has(paramType.__element__.__kind__)); + paramExprs[key] = $expressionify({ + __kind__: ExpressionKind.Param, + __element__: paramType, + __cardinality__: + param.__kind__ === ExpressionKind.OptionalParam + ? Cardinality.AtMostOne + : Cardinality.One, + __name__: key, + __isComplex__: isComplex, + }) as any; + } + + let returnExpr = expr(paramExprs as any); + + if (!runnableExpressionKinds.has((returnExpr as any).__kind__)) { + returnExpr = select(returnExpr) as any; + } + + return $expressionify({ + __kind__: ExpressionKind.WithParams, + __element__: returnExpr.__element__, + __cardinality__: returnExpr.__cardinality__, + __expr__: returnExpr, + __params__: Object.values(paramExprs), + }) as any; +} diff --git a/starters/features/gel/dbschema/edgeql-js/path.ts b/starters/features/gel/dbschema/edgeql-js/path.ts new file mode 100644 index 00000000000..879fdd0174a --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/path.ts @@ -0,0 +1,503 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + // cardutil, + // ObjectTypeSet, + // TypeSet, + // Expression, + ExpressionKind, + TypeKind, + // LinkDesc, + // PropertyDesc, + Cardinality, + // BaseType, + type typeutil, +} from "gel/dist/reflection/index"; + +import { cardutil } from "./cardinality"; + +import { literalToTypeSet } from "./castMaps"; +import { $arrayLikeIndexify, $tuplePathify } from "./collections"; +import { $toEdgeQL } from "./toEdgeQL"; +import { $queryFunc, $queryFuncJSON } from "./query"; + +import type { + BaseType, + Expression, + LinkDesc, + ObjectType, + ObjectTypePointers, + ObjectTypeSet, + PropertyDesc, + PropertyShape, + TypeSet, + ScalarType, +} from "./typesystem"; +import type { future } from "./future"; +import type { $expr_Function } from "./funcops"; +// import {typeutil} from "./typeutil"; +// import {cardutil} from "./cardinality"; + +// get the set representing the result of a path traversal +// including cardinality merging +type getChildOfObjectTypeSet< + Root extends ObjectTypeSet, + ChildKey extends keyof Root["__element__"]["__pointers__"], +> = TypeSet< + ChildKey extends "name" + ? Root extends { [typenameSymbol]: string } + ? ScalarType< + "std::str", + (typeof future)["strictTypeNames"] extends true + ? Root[typeof typenameSymbol] + : string, + Root[typeof typenameSymbol] + > + : Root["__element__"]["__pointers__"][ChildKey]["target"] + : Root["__element__"]["__pointers__"][ChildKey]["target"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Root["__element__"]["__pointers__"][ChildKey]["cardinality"] + > +>; + +// path parent must be object expression +export interface PathParent< + Parent extends ObjectTypeSet = ObjectTypeSet, + L extends string = string, +> { + type: Parent; + linkName: L; +} + +export type $linkPropify = Root extends { + __parent__: PathParent; +} + ? Parent["__element__"]["__pointers__"][L] extends LinkDesc< + any, + any, + infer LinkProps, + any, + any, + any, + any + > + ? pathifyLinkProps> + : object + : unknown; + +export type $pathify< + Root extends TypeSet, + // Parent extends PathParent | null = null +> = Root extends ObjectTypeSet + ? ObjectTypeSet extends Root + ? unknown // Root is literally ObjectTypeSet + : pathifyPointers & pathifyShape & $linkPropify + : unknown; // pathify does nothing on non-object types + +export type pathifyPointers< + Root extends ObjectTypeSet, + // Parent extends PathParent | null = null +> = ObjectTypePointers extends Root["__element__"]["__pointers__"] + ? unknown + : { + // & string required to avoid typeError on linkName + [k in keyof Root["__element__"]["__pointers__"] & + string]: Root["__element__"]["__pointers__"][k] extends PropertyDesc + ? $expr_PathLeaf< + getChildOfObjectTypeSet, + { type: anonymizeObjectTypeSet; linkName: k } + > + : Root["__element__"]["__pointers__"][k] extends LinkDesc + ? getChildOfObjectTypeSet extends ObjectTypeSet + ? $expr_PathNode< + getChildOfObjectTypeSet, + { type: anonymizeObjectTypeSet; linkName: k }, + k extends "__type__" + ? Root["__element__"]["__polyTypenames__"] + : null + > + : unknown + : unknown; + }; + +type anonymizeObjectTypeSet = typeutil.flatten<{ + __element__: ObjectType< + T["__element__"]["__name__"], + T["__element__"]["__pointers__"], + { id: true } + >; + __cardinality__: T["__cardinality__"]; +}>; + +export type pathifyShape< + Root extends ObjectTypeSet, + Shape extends { [k: string]: any } = Root["__element__"]["__shape__"], +> = string extends keyof Shape + ? object + : { + [k in keyof Shape & string]: Shape[k] extends ObjectTypeSet + ? $expr_PathNode< + TypeSet< + Shape[k]["__element__"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Shape[k]["__cardinality__"] + > + >, + { type: Root; linkName: k } + // false + > + : Shape[k] extends TypeSet + ? $expr_PathLeaf< + TypeSet< + Shape[k]["__element__"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Shape[k]["__cardinality__"] + > + >, + { type: Root; linkName: k } + // false + > + : // must be unknown (not never) to avoid overriding + // a pointer with the same key + unknown; + }; + +type pathifyLinkProps< + Props extends PropertyShape, + Root extends ObjectTypeSet, + Parent extends PathParent | null = null, +> = { + [k in keyof Props & string]: Props[k] extends PropertyDesc + ? $expr_PathLeaf< + TypeSet< + Props[k]["target"], + cardutil.multiplyCardinalities< + Root["__cardinality__"], + Props[k]["cardinality"] + > + >, + { type: $expr_PathNode; linkName: k } + // {type: $expr_PathNode; linkName: k}, + // Props[k]["exclusive"] + > + : unknown; +}; + +export type getPropsShape = typeutil.flatten< + typeutil.stripNever<{ + [k in keyof T["__pointers__"]]: T["__pointers__"][k]["__kind__"] extends "property" + ? true + : never; + }> +>; + +const typenameSymbol = Symbol("typename"); + +export type $expr_PathNode< + Root extends ObjectTypeSet = ObjectTypeSet, + Parent extends PathParent | null = PathParent | null, + TypeName extends string | null = null, + // Exclusive extends boolean = boolean +> = Expression<{ + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __parent__: Parent; + __kind__: ExpressionKind.PathNode; + [typenameSymbol]: TypeName; + // __exclusive__: boolean; + "*": getPropsShape; +}>; + +export type $expr_TypeIntersection< + Card extends Cardinality = Cardinality, + Intersection extends ObjectType = ObjectType, +> = Expression<{ + __element__: Intersection; + __cardinality__: Card; + __kind__: ExpressionKind.TypeIntersection; + __expr__: TypeSet; +}>; + +export type $expr_PathLeaf< + Root extends TypeSet = TypeSet, + Parent extends PathParent = PathParent, + // Exclusive extends boolean = boolean +> = Expression<{ + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __kind__: ExpressionKind.PathLeaf; + __parent__: Parent; + // __exclusive__: boolean; +}>; + +export type ExpressionRoot = { + __element__: BaseType; + __cardinality__: Cardinality; + __kind__: ExpressionKind; +}; + +function PathLeaf< + Root extends TypeSet, + Parent extends PathParent, + Exclusive extends boolean = boolean, +>( + root: Root, + parent: Parent, + _exclusive: Exclusive, + scopeRoot: TypeSet | null = null, +): $expr_PathLeaf { + return $expressionify({ + __kind__: ExpressionKind.PathLeaf, + __element__: root.__element__, + __cardinality__: root.__cardinality__, + __parent__: parent, + // __exclusive__: exclusive, + __scopeRoot__: scopeRoot, + }) as any; +} + +function getStarShapeFromPointers(pointers: ObjectTypePointers) { + const shape: any = {}; + for (const [key, ptr] of Object.entries(pointers)) { + if (ptr.__kind__ === "property") { + shape[key] = true; + } + } + return shape; +} + +function PathNode< + Root extends ObjectTypeSet, + Parent extends PathParent | null, + // Exclusive extends boolean = boolean +>( + root: Root, + parent: Parent, + // exclusive: boolean, + scopeRoot: TypeSet | null = null, +): $expr_PathNode { + const obj = { + __kind__: ExpressionKind.PathNode, + __element__: root.__element__, + __cardinality__: root.__cardinality__, + __parent__: parent, + // __exclusive__: exclusive, + __scopeRoot__: scopeRoot, + }; + + Object.defineProperty(obj, "*", { + writable: false, + value: getStarShapeFromPointers(obj.__element__.__pointers__), + }); + return $expressionify(obj) as any; +} + +const _pathCache = Symbol(); +const _pointers = Symbol(); + +const pathifyProxyHandlers: ProxyHandler = { + get(target: any, prop: string | symbol, proxy: any) { + const ptr = target[_pointers][prop as any] as LinkDesc | PropertyDesc; + if (ptr) { + return ( + target[_pathCache][prop] ?? + (target[_pathCache][prop] = ( + (ptr.__kind__ === "property" ? PathLeaf : PathNode) as any + )( + { + __element__: ptr.target, + __cardinality__: cardutil.multiplyCardinalities( + target.__cardinality__, + ptr.cardinality, + ), + }, + { + linkName: prop, + type: proxy, + }, + ptr.exclusive ?? false, + target.__scopeRoot__ ?? (scopeRoots.has(proxy) ? proxy : null), + )) + ); + } + return target[prop]; + }, +}; + +export function $pathify( + _root: Root, +): $pathify { + if (_root.__element__.__kind__ !== TypeKind.object) { + return _root as any; + } + + const root: $expr_PathNode = _root as any; + + let pointers = { + ...root.__element__.__pointers__, + }; + + if (root.__parent__) { + const { type, linkName } = root.__parent__; + const parentPointer = type.__element__.__pointers__[linkName]; + if (parentPointer?.__kind__ === "link") { + pointers = { ...pointers, ...parentPointer.properties }; + } + } + + for (const [key, val] of Object.entries( + root.__element__.__shape__ || { id: true }, + )) { + if (pointers[key]) continue; + const valType: BaseType = (val as any)?.__element__; + if (!valType) continue; + + pointers[key] = { + __kind__: valType.__kind__ === TypeKind.object ? "link" : "property", + properties: {}, + target: (val as any).__element__, + cardinality: (val as any).__cardinality__, + exclusive: false, + computed: true, + readonly: true, + hasDefault: false, + }; + } + + (root as any)[_pointers] = pointers; + (root as any)[_pathCache] = {}; + + return new Proxy(root, pathifyProxyHandlers); +} + +function isFunc(this: any, expr: ObjectTypeSet) { + return $expressionify({ + __kind__: ExpressionKind.TypeIntersection, + __cardinality__: this.__cardinality__, + __element__: { + ...expr.__element__, + __shape__: { id: true }, + } as any, + __expr__: this, + }); +} + +export function $assert_single(expr: Expression) { + return $expressionify({ + __kind__: ExpressionKind.Function, + __element__: expr.__element__, + __cardinality__: cardutil.overrideUpperBound(expr.__cardinality__, "One"), + __name__: "std::assert_single", + __args__: [expr], + __namedargs__: {}, + }) as any; +} + +export function $unwrap_assert_single(expr: Expression) { + if ( + (expr as any).__kind__ === ExpressionKind.Function && + (expr as $expr_Function).__name__ === "std::assert_single" + ) { + return (expr as $expr_Function).__args__[0] as Expression; + } + return null; +} + +const jsonDestructureProxyHandlers: ProxyHandler = { + get(target: ExpressionRoot, prop: string | symbol, proxy: any) { + if (typeof prop === "string" && !(prop in target)) { + const parsedProp = Number.isInteger(Number(prop)) ? Number(prop) : prop; + return jsonDestructure.call(proxy, parsedProp); + } + return (target as any)[prop]; + }, +}; + +function jsonDestructure(this: ExpressionRoot, path: any) { + const pathTypeSet = literalToTypeSet(path); + return $expressionify({ + __kind__: ExpressionKind.Operator, + __element__: this.__element__, + __cardinality__: cardutil.multiplyCardinalities( + this.__cardinality__, + pathTypeSet.__cardinality__, + ), + __name__: "[]", + __opkind__: "Infix", + __args__: [this, pathTypeSet], + }) as any; +} + +export function $jsonDestructure(_expr: ExpressionRoot) { + if ( + _expr.__element__.__kind__ === TypeKind.scalar && + _expr.__element__.__name__ === "std::json" + ) { + const expr = new Proxy(_expr, jsonDestructureProxyHandlers) as any; + + expr.destructure = jsonDestructure.bind(expr); + + return expr; + } + + return _expr; +} + +export function $expressionify( + _expr: T, +): Expression { + const expr: Expression = $pathify( + $jsonDestructure($arrayLikeIndexify($tuplePathify(_expr))), + ) as any; + + expr.run = $queryFunc.bind(expr) as any; + expr.runJSON = $queryFuncJSON.bind(expr) as any; + expr.is = isFunc.bind(expr) as any; + expr.toEdgeQL = $toEdgeQL.bind(expr); + expr.assert_single = () => $assert_single(expr) as any; + + return Object.freeze(expr) as any; +} + +const scopedExprCache = new WeakMap(); +const scopeRoots = new WeakSet(); + +export function $getScopedExpr( + expr: T, + existingScopes?: Set, +): Expression { + let scopedExpr = scopedExprCache.get(expr); + if (!scopedExpr || existingScopes?.has(scopedExpr)) { + // free objects should not be scopified + const isFreeObject = + expr.__cardinality__ === Cardinality.One && + expr.__element__.__name__ === "std::FreeObject"; + + scopedExpr = isFreeObject + ? (expr as any as Expression>) + : $expressionify({ + ...expr, + __cardinality__: Cardinality.One, + __scopedFrom__: expr, + ...(expr.__element__.__kind__ === TypeKind.object + ? { + "*": getStarShapeFromPointers( + (expr.__element__ as ObjectType).__pointers__, + ), + } + : {}), + }); + scopeRoots.add(scopedExpr); + const uncached = !scopedExpr; + if (uncached) { + scopedExprCache.set(expr, scopedExpr); + } + } + existingScopes?.add(scopedExpr); + return scopedExpr as any; +} + +export { PathLeaf as $PathLeaf, PathNode as $PathNode }; diff --git a/starters/features/gel/dbschema/edgeql-js/query.ts b/starters/features/gel/dbschema/edgeql-js/query.ts new file mode 100644 index 00000000000..5cd4baf804f --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/query.ts @@ -0,0 +1,58 @@ +// GENERATED by @gel/generate v0.6.4 + +import type * as gel from "gel"; +import { Cardinality, ExpressionKind } from "gel/dist/reflection/index"; +import { jsonifyComplexParams } from "./json"; +import { select } from "./select"; + +export const runnableExpressionKinds = new Set([ + ExpressionKind.Select, + ExpressionKind.Update, + ExpressionKind.Insert, + ExpressionKind.InsertUnlessConflict, + ExpressionKind.Delete, + ExpressionKind.Group, + ExpressionKind.For, + ExpressionKind.With, + ExpressionKind.WithParams, +]); + +const wrappedExprCache = new WeakMap(); + +export async function $queryFunc(this: any, cxn: gel.Executor, args: any) { + const expr = runnableExpressionKinds.has(this.__kind__) + ? this + : (wrappedExprCache.get(this) ?? + wrappedExprCache.set(this, select(this)).get(this)); + + const _args = jsonifyComplexParams(expr, args); + + const query = expr.toEdgeQL(); + + if ( + expr.__cardinality__ === Cardinality.One || + expr.__cardinality__ === Cardinality.AtMostOne || + expr.__cardinality__ === Cardinality.Empty + ) { + return cxn.querySingle(query, _args); + } else { + return cxn.query(query, _args); + } +} + +export async function $queryFuncJSON(this: any, cxn: gel.Executor, args: any) { + const expr = runnableExpressionKinds.has(this.__kind__) + ? this + : (wrappedExprCache.get(this) ?? + wrappedExprCache.set(this, select(this)).get(this)); + const _args = jsonifyComplexParams(expr, args); + + if ( + expr.__cardinality__ === Cardinality.One || + expr.__cardinality__ === Cardinality.AtMostOne + ) { + return cxn.querySingleJSON(expr.toEdgeQL(), _args); + } else { + return cxn.queryJSON(expr.toEdgeQL(), _args); + } +} diff --git a/starters/features/gel/dbschema/edgeql-js/range.ts b/starters/features/gel/dbschema/edgeql-js/range.ts new file mode 100644 index 00000000000..bd9bca5c944 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/range.ts @@ -0,0 +1,201 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { LocalDate, LocalDateTime, Duration } from "gel"; +import { Range } from "gel"; +import { TypeKind, ExpressionKind } from "gel/dist/reflection/index"; + +import type { cardutil } from "./cardinality"; +import type { + RangeType, + getPrimitiveBaseType, + TypeSet, + BaseType, +} from "./typesystem"; +import type { $expr_Literal } from "./literal"; + +import type { + $number, + $decimal, + $datetime, + $duration, + $bool, +} from "./modules/std"; +import type { $local_date, $local_datetime } from "./modules/std/cal"; +import type { literalToScalarType, orScalarLiteral } from "./castMaps"; +import { literalToTypeSet } from "./castMaps"; +import { spec } from "./__spec__"; +import { literal, $nameMapping } from "./literal"; +import { type $expr_Function, $resolveOverload } from "./funcops"; +import { $expressionify } from "./path"; + +type $anypoint = + | $number + | $local_date + | $decimal + | $datetime + | $local_datetime + | $duration; + +function range(element: Element): RangeType; +function range( + val: Range, +): $expr_Literal>>>; +function range< + NamedArgs extends { + inc_lower?: orScalarLiteral>; + inc_upper?: orScalarLiteral>; + empty?: orScalarLiteral>; + }, + P1 extends orScalarLiteral> | undefined, + P2 extends + | orScalarLiteral< + TypeSet< + BaseType extends literalToScalarType + ? $anypoint + : getPrimitiveBaseType> + > + > + | undefined, +>( + namedArgs: NamedArgs, + lower?: P1, + upper?: P2, +): $expr_Function< + // "std::range", + // mapLiteralToTypeSet<[P1, P2]>, + // mapLiteralToTypeSet, + // TypeSet< + RangeType< + literalToScalarType extends $anypoint + ? literalToScalarType + : literalToScalarType extends $anypoint + ? literalToScalarType + : $anypoint + >, + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + cardutil.optionalParamCardinality, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + >, + cardutil.optionalParamCardinality + > + // > +>; +function range< + P1 extends orScalarLiteral> | undefined, + P2 extends + | orScalarLiteral< + TypeSet< + BaseType extends literalToScalarType + ? $anypoint + : getPrimitiveBaseType> + > + > + | undefined, +>( + lower?: P1, + upper?: P2, +): $expr_Function< + // "std::range", + // mapLiteralToTypeSet<[P1, P2]>, + // {}, + // TypeSet< + RangeType< + literalToScalarType extends $anypoint + ? literalToScalarType + : literalToScalarType extends $anypoint + ? literalToScalarType + : $anypoint + >, + cardutil.multiplyCardinalities< + cardutil.optionalParamCardinality, + cardutil.optionalParamCardinality + > + // > +>; +function range(...args: any[]): any { + if (args.length === 1) { + const arg = args[0]; + if (arg instanceof Range) { + if (arg.lower === null && arg.upper === null) { + throw new Error( + `Can't create literal expression from unbounded range. Try this instead:\n\n e.range(e.cast(e.int64, e.set()), e.cast(e.int64, e.set()))`, + ); + } + if (arg.isEmpty) { + throw new Error(`Can't create literal expression from empty range.`); + } + return literal( + range(literalToTypeSet(arg.lower ?? arg.upper).__element__ as any), + arg, + ); + } + if (arg.__kind__ && !arg.__element__) { + return { + __kind__: TypeKind.range, + __name__: `range<${arg.__name__}>`, + __element__: arg, + } as any; + } + } + const { + returnType, + cardinality, + args: positionalArgs, + namedArgs, + } = $resolveOverload("std::range", args, spec, [ + { + args: [ + { + typeId: $nameMapping.get("std::anypoint")!, + optional: true, + setoftype: false, + variadic: false, + }, + { + typeId: $nameMapping.get("std::anypoint")!, + optional: true, + setoftype: false, + variadic: false, + }, + ], + namedArgs: { + inc_lower: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + inc_upper: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + empty: { + typeId: $nameMapping.get("std::bool")!, + optional: true, + setoftype: false, + variadic: false, + }, + }, + returnTypeId: $nameMapping.get("range")!, + }, + ]); + return $expressionify({ + __kind__: ExpressionKind.Function, + __element__: returnType, + __cardinality__: cardinality, + __name__: "std::range", + __args__: positionalArgs, + __namedargs__: namedArgs, + }) as any; +} + +export { range as $range }; diff --git a/starters/features/gel/dbschema/edgeql-js/reflection.ts b/starters/features/gel/dbschema/edgeql-js/reflection.ts new file mode 100644 index 00000000000..74f2279e7e8 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/reflection.ts @@ -0,0 +1,10 @@ +// GENERATED by @gel/generate v0.6.4 + +export * from "gel/dist/reflection/index"; +export * from "./typesystem"; +export { cardutil } from "./cardinality"; +export type { $expr_Literal } from "./literal"; +export type { $expr_PathNode, $expr_PathLeaf } from "./path"; +export type { $expr_Function, $expr_Operator } from "./funcops"; +export { makeType, $mergeObjectTypes } from "./hydrate"; +export type { mergeObjectTypes } from "./hydrate"; diff --git a/starters/features/gel/dbschema/edgeql-js/select.ts b/starters/features/gel/dbschema/edgeql-js/select.ts new file mode 100644 index 00000000000..0d98a7e29d1 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/select.ts @@ -0,0 +1,1252 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + LocalDateTime, + LocalDate, + LocalTime, + Duration, + RelativeDuration, + ConfigMemory, + DateDuration, +} from "gel"; +import type { $bool, $number } from "./modules/std"; + +import { + Cardinality, + ExpressionKind, + TypeKind, + OperatorKind, +} from "gel/dist/reflection/index"; +import { makeType } from "./hydrate"; + +import { cardutil } from "./cardinality"; +import type { + $expr_PolyShapeElement, + $scopify, + Expression, + LinkDesc, + ObjectType, + ObjectTypeExpression, + ObjectTypePointers, + ObjectTypeSet, + PrimitiveTypeSet, + PropertyDesc, + ScalarType, + stripSet, + TypeSet, + BaseType, + ExclusiveTuple, + orLiteralValue, + EnumType, +} from "./typesystem"; + +import { + $assert_single, + type $expr_PathLeaf, + type $expr_PathNode, + type $linkPropify, + type ExpressionRoot, +} from "./path"; +import type { anonymizeObject } from "./casting"; +import { $expressionify, $getScopedExpr } from "./path"; +import { $getTypeByName, literal } from "./literal"; +import { spec } from "./__spec__"; +import { + type scalarLiterals, + type literalToScalarType, + literalToTypeSet, +} from "./castMaps"; +import type { $expr_Operator } from "./funcops"; + +export const ASC = "ASC"; +export const DESC = "DESC"; +export const EMPTY_FIRST = "EMPTY FIRST"; +export const EMPTY_LAST = "EMPTY LAST"; +export type OrderByDirection = "ASC" | "DESC"; +export type OrderByEmpty = "EMPTY FIRST" | "EMPTY LAST"; + +export type OrderByExpr = TypeSet< + ScalarType | EnumType | ObjectType, + Cardinality +>; +export type OrderByObjExpr = { + expression: OrderByExpr; + direction?: OrderByDirection; + empty?: OrderByEmpty; +}; + +export type OrderByExpression = + | OrderByExpr + | OrderByObjExpr + | [OrderByExpr | OrderByObjExpr, ...(OrderByExpr | OrderByObjExpr)[]]; + +export type OffsetExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; + +export type SelectFilterExpression = TypeSet<$bool, Cardinality>; +export type LimitOffsetExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; +export type LimitExpression = TypeSet< + $number, + Cardinality.Empty | Cardinality.One | Cardinality.AtMostOne +>; + +export type SelectModifierNames = + | "filter" + | "filter_single" + | "order_by" + | "offset" + | "limit"; + +type filterSingle = T extends ObjectTypeSet + ? TypeSet, T["__cardinality__"]> + : orLiteralValue; + +export type exclusivesToFilterSingle = + ExclusiveTuple extends E + ? never + : E extends [] + ? never + : { + [j in keyof E]: { + [k in keyof E[j]]: filterSingle; + }; + }[number]; +export type SelectModifiers = { + // export type SelectModifiers = { + filter?: SelectFilterExpression; + filter_single?: // | Partial< + // typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc + // ? orScalarLiteral<{ + // __element__: T["__pointers__"][k]["target"]; + // __cardinality__: T["__pointers__"][k]["cardinality"]; + // }> + // : never; + // }> + // > + + // | (ObjectType extends T + // ? unknown + // : typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc< + // infer T, + // infer C, + // infer E + // > + // ? E extends true + // ? orScalarLiteral<{ + // __element__: T; + // __cardinality__: C; + // }> + // : never + // : never; + // }>) + exclusivesToFilterSingle | SelectFilterExpression; + + // | (ObjectType extends T + // ? unknown + // : typeutil.stripNever<{ + // [k in keyof T["__pointers__"]]: T["__pointers__"][k] + // extends PropertyDesc< + // infer T, + // infer C, + // infer E + // > + // ? E extends true + // ? orScalarLiteral<{ + // __element__: T; + // __cardinality__: C; + // }> + // : never + // : never; + // }>); + order_by?: OrderByExpression; + offset?: OffsetExpression | number; + limit?: LimitExpression | number; +}; + +export type UnknownSelectModifiers = { [k in keyof SelectModifiers]: unknown }; + +export type NormalisedSelectModifiers = { + filter?: SelectFilterExpression; + order_by?: OrderByObjExpr[]; + offset?: OffsetExpression; + limit?: LimitExpression; + singleton: boolean; +}; + +// type NormaliseOrderByModifier = +// Mods extends OrderByExpr +// ? [{expression: Mods}] +// : Mods extends OrderByObjExpr +// ? [Mods] +// : Mods extends (OrderByExpr | OrderByObjExpr)[] +// ? { +// [K in keyof Mods]: Mods[K] extends OrderByExpr +// ? {expression: Mods[K]} +// : Mods[K]; +// } +// : []; + +// type NormaliseSelectModifiers = { +// filter: Mods["filter"]; +// order_by: Mods["order_by"] extends OrderByExpression +// ? NormaliseOrderByModifier +// : []; +// offset: Mods["offset"] extends number +// ? $expr_Literal> +// : Mods["offset"]; +// limit: Mods["offset"] extends number +// ? $expr_Literal> +// : Mods["offset"]; +// }; + +export type $expr_Select = Expression<{ + __element__: Set["__element__"]; + __cardinality__: Set["__cardinality__"]; + __expr__: TypeSet; + __kind__: ExpressionKind.Select; + __modifiers__: NormalisedSelectModifiers; + __scope__?: ObjectTypeExpression; +}>; +// Modifier methods removed for now, until we can fix typescript inference +// problems / excessively deep errors +// & SelectModifierMethods>; + +export interface SelectModifierMethods { + filter( + filter: + | Filter + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet, + ) => Filter), + ): this; + order_by( + order_by: + | OrderByExpression + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet, + ) => OrderByExpression), + ): this; + offset( + offset: + | OffsetExpression + | number + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet, + ) => OffsetExpression | number), + ): this; + // $expr_Select<{ + // __element__: Root["__element__"]; + // __cardinality__: cardutil.overrideLowerBound< + // Root["__cardinality__"], + // "Zero" + // >; + // }>; + limit( + limit: + | LimitExpression + | number + | (( + scope: Root extends ObjectTypeSet + ? $scopify + : stripSet, + ) => LimitExpression | number), + ): this; + // $expr_Select<{ + // __element__: Root["__element__"]; + // __cardinality__: cardutil.overrideLowerBound< + // Root["__cardinality__"], + // "Zero" + // >; + // }>; +} +// Base is ObjectTypeSet & +// Filter is equality & +// Filter.args[0] is PathLeaf +// Filter.args[0] is __exclusive__ & +// Filter.args[0].parent.__element__ === Base.__element__ +// Filter.args[1].__cardinality__ is AtMostOne or One +// if Filter.args[0] is PathNode: +// Filter.args[0] is __exclusive__ & +// if Filter.args[0].parent === null +// Filter.args[0].parent.__element__ === Base.__element__ +// Filter.args[1].__cardinality__ is AtMostOne or One +// else +// Filter.args[0].type.__element__ === Base.__element__ & +// Filter.args[1].__cardinality__ is AtMostOne or One + +// type argCardToResultCard< +// OpCard extends Cardinality, +// BaseCase extends Cardinality +// > = [OpCard] extends [Cardinality.AtMostOne | Cardinality.One] +// ? Cardinality.AtMostOne +// : [OpCard] extends [Cardinality.Empty] +// ? Cardinality.Empty +// : BaseCase; + +// export type InferFilterCardinality< +// Base extends TypeSet, +// Filter +// > = Filter extends TypeSet +// ? // Base is ObjectTypeExpression & +// Base extends ObjectTypeSet // $expr_PathNode +// ? // Filter is equality +// Filter extends $expr_Operator<"=", any, infer Args, any> +// ? // Filter.args[0] is PathLeaf +// Args[0] extends $expr_PathLeaf +// ? // Filter.args[0] is unique +// Args[0]["__exclusive__"] extends true +// ? // Filter.args[0].parent.__element__ === Base.__element__ +// typeutil.assertEqual extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Args[0] extends $expr_PathNode +// ? Args[0]["__exclusive__"] extends true +// ? // Filter.args[0].parent.__element__ === Base.__element__ +// Args[0]["__parent__"] extends null +// ? typeutil.assertEqual< +// Args[0]["__element__"]["__name__"], +// Base["__element__"]["__name__"] +// > extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Args[0]["__parent__"] extends infer Parent +// ? Parent extends PathParent +// ? typeutil.assertEqual< +// Parent["type"]["__element__"]["__name__"], +// Base["__element__"]["__name__"] +// > extends true +// ? // Filter.args[1].__cardinality__ is AtMostOne or One +// argCardToResultCard< +// Args[1]["__cardinality__"], +// Base["__cardinality__"] +// > +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"] +// : Base["__cardinality__"]; + +export type InferOffsetLimitCardinality< + Card extends Cardinality, + Modifiers extends UnknownSelectModifiers, +> = Modifiers["limit"] extends number | LimitExpression + ? cardutil.overrideLowerBound + : Modifiers["offset"] extends number | OffsetExpression + ? cardutil.overrideLowerBound + : Card; + +// export type ComputeSelectCardinality< +// Expr extends ObjectTypeExpression, +// Modifiers extends UnknownSelectModifiers +// > = InferOffsetLimitCardinality< +// InferFilterCardinality, +// Modifiers +// >; +export type ComputeSelectCardinality< + Expr extends ObjectTypeExpression, + Modifiers extends UnknownSelectModifiers, +> = InferOffsetLimitCardinality< + undefined extends Modifiers["filter_single"] + ? Expr["__cardinality__"] + : cardutil.overrideUpperBound, + Modifiers +>; + +export function is< + Expr extends ObjectTypeExpression, + Shape extends objectTypeToSelectShape, + ReturnT extends { + [k in Exclude< + keyof Shape, + SelectModifierNames | "id" + >]: $expr_PolyShapeElement>; + }, +>(expr: Expr, shape: Shape): ReturnT { + const mappedShape: any = {}; + for (const [key, value] of Object.entries(shape)) { + if (key === "id") continue; + mappedShape[key] = { + __kind__: ExpressionKind.PolyShapeElement, + __polyType__: expr, + __shapeElement__: value, + }; + } + return mappedShape; +} + +// function computeFilterCardinality( +// expr: SelectFilterExpression, +// cardinality: Cardinality, +// base: TypeSet +// ) { +// let card = cardinality; + +// const filter: any = expr; +// // Base is ObjectExpression +// const baseIsObjectExpr = base?.__element__?.__kind__ === TypeKind.object; +// const filterExprIsEq = +// filter.__kind__ === ExpressionKind.Operator && filter.__name__ === "="; +// const arg0: $expr_PathLeaf | $expr_PathNode = filter?.__args__?.[0]; +// const arg1: TypeSet = filter?.__args__?.[1]; +// const argsExist = !!arg0 && !!arg1 && !!arg1.__cardinality__; +// const arg0IsUnique = arg0?.__exclusive__ === true; + +// if (baseIsObjectExpr && filterExprIsEq && argsExist && arg0IsUnique) { +// const newCard = +// arg1.__cardinality__ === Cardinality.One || +// arg1.__cardinality__ === Cardinality.AtMostOne +// ? Cardinality.AtMostOne +// : arg1.__cardinality__ === Cardinality.Empty +// ? Cardinality.Empty +// : cardinality; + +// if (arg0.__kind__ === ExpressionKind.PathLeaf) { +// const arg0ParentMatchesBase = +// arg0.__parent__.type.__element__.__name__ === +// base.__element__.__name__; +// if (arg0ParentMatchesBase) { +// card = newCard; +// } +// } else if (arg0.__kind__ === ExpressionKind.PathNode) { +// // if Filter.args[0] is PathNode: +// // Filter.args[0] is __exclusive__ & +// // if Filter.args[0].parent === null +// // Filter.args[0].__element__ === Base.__element__ +// // Filter.args[1].__cardinality__ is AtMostOne or One +// // else +// // Filter.args[0].type.__element__ === Base.__element__ & +// // Filter.args[1].__cardinality__ is AtMostOne or One +// const parent = arg0.__parent__; +// if (parent === null) { +// const arg0MatchesBase = +// arg0.__element__.__name__ === base.__element__.__name__; +// if (arg0MatchesBase) { +// card = newCard; +// } +// } else { +// const arg0ParentMatchesBase = +// parent?.type.__element__.__name__ === base.__element__.__name__; +// if (arg0ParentMatchesBase) { +// card = newCard; +// } +// } +// } +// } + +// return card; +// } + +export function $handleModifiers( + modifiers: SelectModifiers, + params: { root: TypeSet; scope: TypeSet }, +): { + modifiers: NormalisedSelectModifiers; + cardinality: Cardinality; + needsAssertSingle: boolean; +} { + const { root, scope } = params; + const mods: NormalisedSelectModifiers = { + singleton: !!modifiers["filter_single"], + }; + + let card = root.__cardinality__; + let needsAssertSingle = false; + + if (modifiers.filter) { + mods.filter = modifiers.filter; + // card = computeFilterCardinality(mods.filter, card, rootExpr); + } + + if (modifiers.filter_single) { + if (root.__element__.__kind__ !== TypeKind.object) { + throw new Error("filter_single can only be used with object types"); + } + card = Cardinality.AtMostOne; + // mods.filter = modifiers.filter_single; + const fs: any = modifiers.filter_single; + if (fs.__element__) { + mods.filter = modifiers.filter_single as any; + needsAssertSingle = true; + } else { + const exprs = Object.keys(fs).map((key) => { + const val = fs[key].__element__ + ? fs[key] + : (literal as any)( + (root.__element__ as any as ObjectType)["__pointers__"][key]![ + "target" + ], + fs[key], + ); + return $expressionify({ + __element__: { + __name__: "std::bool", + __kind__: TypeKind.scalar, + } as any, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Operator, + __opkind__: OperatorKind.Infix, + __name__: "=", + __args__: [(scope as any)[key], val], + }) as $expr_Operator; + }); + if (exprs.length === 1) { + mods.filter = exprs[0] as any; + } else { + mods.filter = exprs.reduce((a, b) => { + return $expressionify({ + __element__: { + __name__: "std::bool", + __kind__: TypeKind.scalar, + } as any, + __cardinality__: Cardinality.One, + __kind__: ExpressionKind.Operator, + __opkind__: OperatorKind.Infix, + __name__: "and", + __args__: [a, b], + }) as $expr_Operator; + }) as any; + } + } + } + if (modifiers.order_by) { + const orderExprs = Array.isArray(modifiers.order_by) + ? modifiers.order_by + : [modifiers.order_by]; + mods.order_by = orderExprs.map((expr) => + typeof (expr as any).__element__ === "undefined" + ? expr + : { expression: expr }, + ) as any; + } + if (modifiers.offset) { + mods.offset = + typeof modifiers.offset === "number" + ? ($getTypeByName("std::number")(modifiers.offset) as any) + : modifiers.offset; + card = cardutil.overrideLowerBound(card, "Zero"); + } + if (modifiers.limit) { + let expr: LimitExpression; + if (typeof modifiers.limit === "number") { + expr = $getTypeByName("std::number")(modifiers.limit) as any; + } else { + const type = + (modifiers.limit.__element__ as any).__casttype__ ?? + modifiers.limit.__element__; + if ( + type.__kind__ === TypeKind.scalar && + type.__name__ === "std::number" + ) { + expr = modifiers.limit; + } else { + throw new Error("Invalid value for `limit` modifier"); + } + } + mods.limit = expr; + card = cardutil.overrideLowerBound(card, "Zero"); + } + + return { + modifiers: mods as NormalisedSelectModifiers, + cardinality: card, + needsAssertSingle, + }; +} + +export type $expr_Delete = + Expression<{ + __kind__: ExpressionKind.Delete; + __element__: Root["__element__"]; + __cardinality__: Root["__cardinality__"]; + __expr__: ObjectTypeSet; + }>; + +function deleteExpr< + Expr extends ObjectTypeExpression, + Modifiers extends SelectModifiers, +>( + expr: Expr, + modifiers?: (scope: $scopify) => Readonly, +): $expr_Delete<{ + __element__: ObjectType< + Expr["__element__"]["__name__"], + Expr["__element__"]["__pointers__"], + { id: true } + >; + __cardinality__: ComputeSelectCardinality; +}>; +function deleteExpr(expr: any, modifiersGetter: any) { + const selectExpr = select(expr, modifiersGetter); + + return $expressionify({ + __kind__: ExpressionKind.Delete, + __element__: selectExpr.__element__, + __cardinality__: selectExpr.__cardinality__, + __expr__: selectExpr, + }) as any; +} + +export { deleteExpr as delete }; + +// Modifier methods removed for now, until we can fix typescript inference +// problems / excessively deep errors + +// function resolveModifierGetter(parent: any, modGetter: any) { +// if (typeof modGetter === "function" && !modGetter.__kind__) { +// if (parent.__expr__.__element__.__kind__ === TypeKind.object) { +// const shape = parent.__element__.__shape__; +// const _scope = +// parent.__scope__ ?? $getScopedExpr(parent.__expr__, +// $existingScopes); +// const scope = new Proxy(_scope, { +// get(target: any, prop: string) { +// if (shape[prop] && shape[prop] !== true) { +// return shape[prop]; +// } +// return target[prop]; +// }, +// }); +// return { +// scope: _scope, +// modExpr: modGetter(scope), +// }; +// } else { +// return { +// scope: undefined, +// modExpr: modGetter(parent.__expr__), +// }; +// } +// } else { +// return {scope: parent.__scope__, modExpr: modGetter}; +// } +// } + +// function updateModifier( +// parent: any, +// modName: "filter" | "order_by" | "offset" | "limit", +// modGetter: any +// ) { +// const modifiers = { +// ...parent.__modifiers__, +// }; +// const cardinality = parent.__cardinality__; + +// const {modExpr, scope} = resolveModifierGetter(parent, modGetter); + +// switch (modName) { +// case "filter": +// modifiers.filter = modifiers.filter +// ? op(modifiers.filter, "and", modExpr) +// : modExpr; + +// // methods no longer change cardinality +// // cardinality = computeFilterCardinality( +// // modExpr, +// // cardinality, +// // parent.__expr__ +// // ); +// break; +// case "order_by": +// const ordering = +// typeof (modExpr as any).__element__ === "undefined" +// ? modExpr +// : {expression: modExpr}; +// modifiers.order_by = modifiers.order_by +// ? [...modifiers.order_by, ordering] +// : [ordering]; +// break; +// case "offset": +// modifiers.offset = +// typeof modExpr === "number" ? _std.number(modExpr) : modExpr; +// // methods no longer change cardinality +// // cardinality = cardutil +// .overrideLowerBound(cardinality, "Zero"); +// break; +// case "limit": +// modifiers.limit = +// typeof modExpr === "number" +// ? _std.number(modExpr) +// : (modExpr as any).__kind__ === ExpressionKind.Set +// ? (modExpr as any).__exprs__[0] +// : modExpr; +// // methods no longer change cardinality +// // cardinality = cardutil +// .overrideLowerBound(cardinality, "Zero"); +// break; +// } + +// return $expressionify( +// $selectify({ +// __kind__: ExpressionKind.Select, +// __element__: parent.__element__, +// __cardinality__: cardinality, +// __expr__: parent.__expr__, +// __modifiers__: modifiers, +// __scope__: scope, +// }) +// ); +// } + +export function $selectify(expr: Expr) { + // Object.assign(expr, { + // filter: (filter: any) => updateModifier(expr, "filter", filter), + // order_by: (order_by: any) => updateModifier(expr, "order_by", order_by), + // offset: (offset: any) => updateModifier(expr, "offset", offset), + // limit: (limit: any) => updateModifier(expr, "limit", limit), + // }); + return expr; +} + +export type linkDescToLinkProps = { + [k in keyof Desc["properties"] & string]: $expr_PathLeaf< + TypeSet< + Desc["properties"][k]["target"], + Desc["properties"][k]["cardinality"] + > + // { + // type: $scopify; + // linkName: k; + // }, + // Desc["properties"][k]["exclusive"] + >; +}; + +export type pointersToObjectType

    = ObjectType< + string, + P, + object +>; + +type linkDescToShape = objectTypeToSelectShape< + L["target"] +> & + objectTypeToSelectShape> & + SelectModifiers; + +type linkDescToSelectElement = + | boolean + | TypeSet, cardutil.assignable> + | linkDescToShape + | (( + scope: $scopify & linkDescToLinkProps, + ) => linkDescToShape); + +type propDescToSelectElement

    = + | boolean + | TypeSet> + | $expr_PolyShapeElement; + +// object types -> pointers +// pointers -> links +// links -> target object type +// links -> link properties +export type objectTypeToSelectShape< + T extends ObjectType = ObjectType, + Pointers extends ObjectTypePointers = T["__pointers__"], +> = Partial<{ + [k in keyof Pointers]: Pointers[k] extends PropertyDesc + ? propDescToSelectElement + : Pointers[k] extends LinkDesc + ? linkDescToSelectElement + : any; +}> & { [k: string]: unknown }; + +// incorporate __shape__ (computeds) on selection shapes +// this works but a major rewrite of setToTsType is required +// to incorporate __shape__-based selection shapes into +// result type inference +// & [k in keyof T["__shape__"]]: +// string | number | symbol extends k // Partial<{ // & +// ? unknown +// : T["__shape__"][k] extends infer U +// ? U extends ObjectTypeSet +// ? +// | boolean +// | TypeSet< +// anonymizeObject, +// cardutil.assignable +// > +// | objectTypeToSelectShape +// | (( +// scope: $scopify +// ) => objectTypeToSelectShape & +// SelectModifiers) +// : U extends TypeSet +// ? +// | boolean +// | TypeSet< +// U["__element__"], +// cardutil.assignable +// > +// : unknown +// : unknown; +// }> + +export type normaliseElement = El extends boolean + ? El + : El extends TypeSet + ? stripSet + : El extends (...scope: any[]) => any + ? normaliseShape> + : El extends object + ? normaliseShape> + : stripSet; + +export type normaliseShape< + Shape extends object, + Strip = SelectModifierNames, +> = { + [k in Exclude]: normaliseElement; +}; + +const $FreeObject = makeType( + spec, + [...spec.values()].find((s) => s.name === "std::FreeObject")!.id, + literal, +); +const FreeObject: $expr_PathNode = { + __kind__: ExpressionKind.PathNode, + __element__: $FreeObject as any, + __cardinality__: Cardinality.One, + __parent__: null, + __exclusive__: true, + __scopeRoot__: null, +} as any; + +export const $existingScopes = new Set< + Expression> +>(); + +const shapeSymbol = Symbol("portableShape"); + +export interface $Shape< + Element extends ObjectType, + SelectShape, + Card extends Cardinality = Cardinality.One, +> { + [shapeSymbol]: { + __element__: Element; + __cardinality__: Card; + __shape__: SelectShape; + }; +} + +function $shape< + Expr extends ObjectTypeExpression, + Element extends Expr["__element__"], + Shape extends objectTypeToSelectShape & SelectModifiers, + SelectCard extends ComputeSelectCardinality< + Expr, + Pick + >, + Scope extends $scopify & + $linkPropify<{ + [k in keyof Expr]: k extends "__cardinality__" + ? Cardinality.One + : Expr[k]; + }>, +>( + _expr: Expr, + shape: (scope: Scope) => Readonly, +): ((scope: unknown) => Readonly) & $Shape; +function $shape(_a: unknown, b: (...args: any) => any) { + return b; +} +export { $shape as shape }; + +export function select< + Expr extends ObjectTypeExpression, + Element extends Expr["__element__"], + ElementName extends `${Element["__name__"]}`, + ElementPointers extends Element["__pointers__"], + ElementShape extends Element["__shape__"], + ElementExclusives extends Element["__exclusives__"], + ElementPolyTypenames extends Element["__polyTypenames__"], + Card extends Expr["__cardinality__"], +>( + expr: Expr, +): $expr_Select<{ + __element__: ObjectType< + ElementName, + ElementPointers, + ElementShape, + ElementExclusives, + ElementPolyTypenames + >; + __cardinality__: Card; +}>; +export function select( + expr: Expr, +): $expr_Select>; +export function select< + Expr extends ObjectTypeExpression, + Element extends Expr["__element__"], + Shape extends objectTypeToSelectShape & SelectModifiers, + SelectCard extends ComputeSelectCardinality, + SelectShape extends normaliseShape, + Scope extends $scopify & + $linkPropify<{ + [k in keyof Expr]: k extends "__cardinality__" + ? Cardinality.One + : Expr[k]; + }>, + ElementName extends `${Element["__name__"]}`, + Modifiers extends UnknownSelectModifiers = Pick, +>( + expr: Expr, + shape: (scope: Scope) => Readonly, +): $expr_Select<{ + __element__: ObjectType< + ElementName, + Element["__pointers__"], + SelectShape, + Element["__exclusives__"], + Element["__polyTypenames__"] + >; + __cardinality__: SelectCard; +}>; +/* + +For the moment is isn't possible to implement both closure-based and plain +object overloads without breaking autocomplete on one or the other. +This is due to a limitation in TS: + +https://github.com/microsoft/TypeScript/issues/26892 +https://github.com/microsoft/TypeScript/issues/47081 + +*/ + +export function select< + Expr extends PrimitiveTypeSet, + Modifiers extends SelectModifiers, +>( + expr: Expr, + modifiers: (expr: Expr) => Readonly, +): $expr_Select<{ + __element__: Expr["__element__"]; + __cardinality__: InferOffsetLimitCardinality< + Expr["__cardinality__"], + Modifiers + >; +}>; +export function select( + shape: Shape, +): $expr_Select<{ + __element__: ObjectType< + `std::FreeObject`, + { + [k in keyof Shape]: Shape[k]["__element__"] extends ObjectType + ? LinkDesc< + Shape[k]["__element__"], + Shape[k]["__cardinality__"], + Record, + false, + true, + true, + false + > + : PropertyDesc< + Shape[k]["__element__"], + Shape[k]["__cardinality__"], + false, + true, + true, + false + >; + }, + Shape + >; // _shape + __cardinality__: Cardinality.One; +}>; +export function select( + expr: Expr, +): $expr_Select<{ + __element__: literalToScalarType; + __cardinality__: Cardinality.One; +}>; +export function select(...args: any[]) { + const firstArg = args[0]; + + if ( + typeof firstArg !== "object" || + firstArg instanceof Uint8Array || + firstArg instanceof Date || + firstArg instanceof Duration || + firstArg instanceof LocalDateTime || + firstArg instanceof LocalDate || + firstArg instanceof LocalTime || + firstArg instanceof RelativeDuration || + firstArg instanceof DateDuration || + firstArg instanceof ConfigMemory || + firstArg instanceof Float32Array + ) { + const literalExpr = literalToTypeSet(firstArg); + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: literalExpr.__element__, + __cardinality__: literalExpr.__cardinality__, + __expr__: literalExpr, + __modifiers__: {}, + }), + ) as any; + } + + const exprPair: [TypeSet, (scope: any) => any] = + typeof args[0].__element__ !== "undefined" + ? (args as any) + : [FreeObject, () => args[0]]; + + let expr = exprPair[0]; + const shapeGetter = exprPair[1]; + if (expr === FreeObject) { + const freeObjectPtrs: ObjectTypePointers = {}; + for (const [k, v] of Object.entries(args[0]) as [string, TypeSet][]) { + freeObjectPtrs[k] = { + __kind__: + v.__element__.__kind__ === TypeKind.object ? "link" : "property", + target: v.__element__, + + cardinality: v.__cardinality__, + exclusive: false, + computed: true, + readonly: true, + hasDefault: false, + properties: {}, + }; + } + expr = { + ...FreeObject, + __element__: { + ...FreeObject.__element__, + __pointers__: { + ...FreeObject.__element__.__pointers__, + ...freeObjectPtrs, + }, + } as any, + }; + } + if (!shapeGetter) { + if (expr.__element__.__kind__ === TypeKind.object) { + const objectExpr: ObjectTypeSet = expr as any; + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: { + __kind__: TypeKind.object, + __name__: `${objectExpr.__element__.__name__}`, // _shape + __pointers__: objectExpr.__element__.__pointers__, + __shape__: objectExpr.__element__.__shape__, + } as any, + __cardinality__: objectExpr.__cardinality__, + __expr__: objectExpr, + __modifiers__: {}, + }), + ) as any; + } else { + return $expressionify( + $selectify({ + __kind__: ExpressionKind.Select, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + __modifiers__: {}, + }), + ) as any; + } + } + + const cleanScopedExprs = $existingScopes.size === 0; + + const { modifiers: mods, shape, scope } = resolveShape(shapeGetter, expr); + + if (cleanScopedExprs) { + $existingScopes.clear(); + } + + const { modifiers, cardinality, needsAssertSingle } = $handleModifiers(mods, { + root: expr, + scope, + }); + const selectExpr = $selectify({ + __kind__: ExpressionKind.Select, + __element__: + expr.__element__.__kind__ === TypeKind.object + ? { + __kind__: TypeKind.object, + __name__: `${expr.__element__.__name__}`, // _shape + __pointers__: (expr.__element__ as ObjectType).__pointers__, + __shape__: shape, + } + : expr.__element__, + __cardinality__: cardinality, + __expr__: expr, + __modifiers__: modifiers, + __scope__: expr !== scope ? scope : undefined, + }) as any; + + return needsAssertSingle + ? $assert_single(selectExpr) + : $expressionify(selectExpr); +} + +function resolveShape( + shapeGetter: ((scope: any) => any) | any, + expr: TypeSet, +): { modifiers: any; shape: any; scope: TypeSet } { + const modifiers: any = {}; + const shape: any = {}; + + // get scoped object if expression is objecttypeset + const scope = + expr.__element__.__kind__ === TypeKind.object + ? $getScopedExpr(expr as any, $existingScopes) + : expr; + + // execute getter with scope + const selectShape = + typeof shapeGetter === "function" ? shapeGetter(scope) : shapeGetter; + + for (const [key, value] of Object.entries(selectShape)) { + // handle modifier keys + if ( + key === "filter" || + key === "filter_single" || + key === "order_by" || + key === "offset" || + key === "limit" + ) { + modifiers[key] = value; + } else { + // for scalar expressions, scope === expr + // shape keys are not allowed + if (expr.__element__.__kind__ !== TypeKind.object) { + throw new Error( + `Invalid select shape key '${key}' on scalar expression, ` + + `only modifiers are allowed (filter, order_by, offset and limit)`, + ); + } + shape[key] = resolveShapeElement(key, value, scope); + } + } + return { shape, modifiers, scope }; +} + +export function resolveShapeElement( + key: any, + value: any, + scope: ObjectTypeExpression, +): any { + // if value is a nested closure + // or a nested shape object + const isSubshape = + typeof value === "object" && typeof (value as any).__kind__ === "undefined"; + const isClosure = + typeof value === "function" && + scope.__element__.__pointers__[key]?.__kind__ === "link"; + // if (isSubshape) { + // // return value; + // const childExpr = (scope as any)[key]; + // const { + // shape: childShape, + // // scope: childScope, + // // modifiers: mods, + // } = resolveShape(value as any, childExpr); + // return childShape; + // } + if (isSubshape || isClosure) { + // get child node expression + // this relies on Proxy-based getters + const childExpr = (scope as any)[key]; + if (!childExpr) { + throw new Error( + `Invalid shape element "${key}" for type ${scope.__element__.__name__}`, + ); + } + const { + shape: childShape, + scope: childScope, + modifiers: mods, + } = resolveShape(value as any, childExpr); + + // extracts normalized modifiers + const { modifiers, needsAssertSingle } = $handleModifiers(mods, { + root: childExpr, + scope: childScope, + }); + + const selectExpr = { + __kind__: ExpressionKind.Select, + __element__: { + __kind__: TypeKind.object, + __name__: `${childExpr.__element__.__name__}`, + __pointers__: childExpr.__element__.__pointers__, + __shape__: childShape, + }, + __cardinality__: + scope.__element__.__pointers__?.[key]?.cardinality || + scope.__element__.__shape__?.[key]?.__cardinality__, + __expr__: childExpr, + __modifiers__: modifiers, + __scope__: childExpr !== childScope ? childScope : undefined, + }; + return needsAssertSingle ? $assert_single(selectExpr as any) : selectExpr; + } else if ((value as any)?.__kind__ === ExpressionKind.PolyShapeElement) { + const polyElement = value as $expr_PolyShapeElement; + + const polyScope = (scope as any).is(polyElement.__polyType__); + return { + __kind__: ExpressionKind.PolyShapeElement, + __polyType__: polyScope, + __shapeElement__: resolveShapeElement( + key, + polyElement.__shapeElement__, + polyScope, + ), + }; + } else if (typeof value === "boolean" && key.startsWith("@")) { + const linkProp = (scope as any)[key]; + if (!linkProp) { + throw new Error( + (scope as any).__parent__ + ? `link property '${key}' does not exist on link ${ + (scope as any).__parent__.linkName + }` + : `cannot select link property '${key}' on an object (${scope.__element__.__name__})`, + ); + } + return value ? linkProp : false; + } else { + return value; + } +} diff --git a/starters/features/gel/dbschema/edgeql-js/set.ts b/starters/features/gel/dbschema/edgeql-js/set.ts new file mode 100644 index 00000000000..fd2c8412cf3 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/set.ts @@ -0,0 +1,219 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { ExpressionKind, Cardinality } from "gel/dist/reflection/index"; +import { TypeKind } from "gel/dist/reflection/index"; +import type { + ArrayType, + BaseTypeTuple, + BaseType, + NamedTupleType, + ObjectTypeSet, + TypeSet, + TupleType, + Expression, + ObjectType, + getPrimitiveBaseType, + SomeType, +} from "./typesystem"; + +import { $mergeObjectTypes, type mergeObjectTypes } from "./hydrate"; + +import * as castMaps from "./castMaps"; + +export function getSharedParent(a: SomeType, b: SomeType): SomeType { + if (a.__kind__ !== b.__kind__) { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}`, + ); + } + if (a.__kind__ === TypeKind.scalar && b.__kind__ === TypeKind.scalar) { + return castMaps.getSharedParentScalar(a, b); + } else if (a.__kind__ === TypeKind.object && b.__kind__ === TypeKind.object) { + return $mergeObjectTypes(a, b); + } else if (a.__kind__ === TypeKind.tuple && b.__kind__ === TypeKind.tuple) { + if (a.__items__.length !== b.__items__.length) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}`, + ); + } + try { + const items = a.__items__.map((_, i) => { + if (!a.__items__[i] || !b.__items__[i]) { + throw new Error(); + } + return getSharedParent( + a.__items__[i] as SomeType, + b.__items__[i] as SomeType, + ); + }); + + return { + __kind__: TypeKind.tuple, + __name__: `tuple<${items.map((item) => item.__name__).join(", ")}>`, + __items__: items as BaseTypeTuple, + }; + } catch (_err) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}`, + ); + } + } else if ( + a.__kind__ === TypeKind.namedtuple && + b.__kind__ === TypeKind.namedtuple + ) { + const aKeys = Object.keys(a); + const bKeys = new Set(Object.keys(b)); + const sameKeys = + aKeys.length === bKeys.size && aKeys.every((k) => bKeys.has(k)); + if (!sameKeys) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}`, + ); + } + try { + const items: { [k: string]: BaseType } = {}; + for (const [i] of Object.entries(a.__shape__)) { + if (!a.__shape__[i] || !b.__shape__[i]) { + throw new Error(); + } + items[i] = getSharedParent( + a.__shape__[i] as SomeType, + b.__shape__[i] as SomeType, + ); + } + + return { + __kind__: TypeKind.namedtuple, + __name__: `tuple<${Object.entries(items) + .map(([key, val]: [string, any]) => `${key}: ${val.__name__}`) + .join(", ")}>`, + __shape__: items, + }; + } catch (_err) { + throw new Error( + `Incompatible tuple types: ${a.__name__} and ${b.__name__}`, + ); + } + } else if (a.__kind__ === TypeKind.array && b.__kind__ === TypeKind.array) { + try { + const mergedEl: any = getSharedParent( + a.__element__ as any, + b.__element__ as any, + ); + return { + __kind__: TypeKind.array, + __name__: a.__name__, + __element__: mergedEl, + } as ArrayType; + } catch (_err) { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}`, + ); + } + } else if (a.__kind__ === TypeKind.enum && b.__kind__ === TypeKind.enum) { + if (a.__name__ === b.__name__) return a; + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}`, + ); + } else { + throw new Error( + `Incompatible array types: ${a.__name__} and ${b.__name__}`, + ); + } +} + +export { set } from "./setImpl"; + +// export type $expr_Set = Expression< +export type $expr_Set = Expression<{ + __element__: Set["__element__"]; + __cardinality__: Set["__cardinality__"]; + __exprs__: TypeSet[]; + __kind__: ExpressionKind.Set; +}>; + +type mergeTypeTuples = { + [k in keyof AItems]: k extends keyof BItems + ? getSharedParentPrimitive + : never; +}; + +// find shared parent of two primitives +export type getSharedParentPrimitive = A extends undefined + ? B extends undefined + ? undefined + : B + : B extends undefined + ? A + : A extends ArrayType + ? B extends ArrayType + ? ArrayType> + : never + : A extends NamedTupleType + ? B extends NamedTupleType + ? NamedTupleType<{ + [k in keyof AShape & + keyof BShape]: castMaps.getSharedParentScalar< + AShape[k], + BShape[k] + >; + }> + : never + : A extends TupleType + ? B extends TupleType + ? mergeTypeTuples extends BaseTypeTuple + ? TupleType> + : never + : never + : castMaps.getSharedParentScalar; + +type _getSharedParentPrimitiveVariadic = + Types extends [infer U] + ? U + : Types extends [infer A, infer B, ...infer Rest] + ? _getSharedParentPrimitiveVariadic< + [getSharedParentPrimitive, ...Rest] + > + : never; + +export type getSharedParentPrimitiveVariadic = + _getSharedParentPrimitiveVariadic; + +export type LooseTypeSet = { + __element__: T; + __cardinality__: C; +}; + +export type { mergeObjectTypes }; + +type _mergeObjectTypesVariadic = + Types extends [infer U] + ? U + : Types extends [infer A, infer B, ...infer Rest] + ? A extends ObjectType + ? B extends ObjectType + ? mergeObjectTypes extends BaseType + ? mergeObjectTypesVariadic<[mergeObjectTypes, ...Rest]> + : never + : never + : never + : never; + +export type mergeObjectTypesVariadic = + _mergeObjectTypesVariadic; + +export type getTypesFromExprs = { + [k in keyof Exprs]: Exprs[k] extends TypeSet + ? getPrimitiveBaseType + : never; +}; + +export type getTypesFromObjectExprs< + Exprs extends [ObjectTypeSet, ...ObjectTypeSet[]], +> = { + [k in keyof Exprs]: Exprs[k] extends TypeSet ? El : never; +}; + +export type getCardsFromExprs = { + [k in keyof Exprs]: Exprs[k] extends TypeSet ? Card : never; +}; diff --git a/starters/features/gel/dbschema/edgeql-js/setImpl.ts b/starters/features/gel/dbschema/edgeql-js/setImpl.ts new file mode 100644 index 00000000000..3735d06f1f4 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/setImpl.ts @@ -0,0 +1,129 @@ +// GENERATED by @gel/generate v0.6.4 + +import * as $ from "./reflection"; +import * as castMaps from "./castMaps"; +import { $expressionify } from "./path"; +import type { + $expr_Set, + mergeObjectTypesVariadic, + getTypesFromExprs, + getTypesFromObjectExprs, + getCardsFromExprs, + getSharedParentPrimitiveVariadic, + LooseTypeSet, +} from "./set"; +import { getSharedParent } from "./set"; +import type * as _stdcal from "./modules/std/cal"; +import type * as _std from "./modules/std"; + +type getSetTypeFromExprs = + LooseTypeSet< + getSharedParentPrimitiveVariadic>, + $.cardutil.mergeCardinalitiesVariadic> + >; + +function set(): null; +function set>( + expr: Expr, +): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$relative_durationλICastableTo> + >, + Exprs extends [Expr, ...Expr[]], +>( + ...exprs: Exprs +): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_stdcal.$relative_durationλICastableTo>>, + Exprs extends [Expr, ...Expr[]], +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral< + $.TypeSet<_stdcal.$local_datetimeλICastableTo> + >, + Exprs extends [Expr, ...Expr[]], +>( + ...exprs: Exprs +): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_stdcal.$local_datetimeλICastableTo>>, + Exprs extends [Expr, ...Expr[]], +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends castMaps.orScalarLiteral<$.TypeSet<_std.$decimalλICastableTo>>, + Exprs extends [Expr, ...Expr[]], +>( + ...exprs: Exprs +): $expr_Set>>; +function set< + Expr extends $.TypeSet<$.ArrayType<_std.$decimalλICastableTo>>, + Exprs extends [Expr, ...Expr[]], +>(...exprs: Exprs): $expr_Set>; +function set( + ...exprs: Exprs +): $expr_Set< + LooseTypeSet< + mergeObjectTypesVariadic>, + $.cardutil.mergeCardinalitiesVariadic> + > +>; +function set< + Expr extends $.TypeSet<$.AnyTupleType>, + Exprs extends [Expr, ...Expr[]], +>(...exprs: Exprs): $expr_Set>; +function set< + Expr extends $.TypeSet<$.BaseType> | castMaps.scalarLiterals, + Exprs extends castMaps.orScalarLiteral< + $.TypeSet< + $.getPrimitiveBaseType["__element__"]> + > + >[], +>( + expr: Expr, + ...exprs: Exprs +): $expr_Set< + $.TypeSet< + $.getPrimitiveBaseType["__element__"]>, + $.cardutil.mergeCardinalitiesVariadic< + getCardsFromExprs> + > + > +>; +function set | castMaps.scalarLiterals>( + ...exprs: Expr[] +): $expr_Set< + $.TypeSet< + $.getPrimitiveBaseType["__element__"]>, + $.Cardinality.Many + > +>; +function set(..._exprs: any[]) { + // if no arg + // if arg + // return empty set + // if object set + // merged objects + // if primitive + // return shared parent of scalars + if (_exprs.length === 0) { + return null; + } + + const exprs: $.TypeSet[] = _exprs.map((expr) => + castMaps.literalToTypeSet(expr), + ); + + return $expressionify({ + __kind__: $.ExpressionKind.Set, + __element__: exprs + .map((expr) => expr.__element__ as any) + .reduce(getSharedParent), + __cardinality__: $.cardutil.mergeCardinalitiesVariadic( + exprs.map((expr) => expr.__cardinality__) as any, + ), + __exprs__: exprs, + }) as any; +} + +export { set }; diff --git a/starters/features/gel/dbschema/edgeql-js/syntax.ts b/starters/features/gel/dbschema/edgeql-js/syntax.ts new file mode 100644 index 00000000000..74bfaad53bd --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/syntax.ts @@ -0,0 +1,23 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { TypeSet, setToTsType } from "./typesystem"; + +export * from "./literal"; +export * from "./path"; +export * from "./set"; +export * from "./cast"; +export * from "./select"; +export * from "./update"; +export * from "./insert"; +export * from "./group"; +export * from "./collections"; +export * from "./funcops"; +export * from "./for"; +export * from "./with"; +export * from "./params"; +export * from "./globals"; +export * from "./detached"; +export * from "./toEdgeQL"; +export * from "./range"; + +export type $infer = setToTsType; diff --git a/starters/features/gel/dbschema/edgeql-js/toEdgeQL.ts b/starters/features/gel/dbschema/edgeql-js/toEdgeQL.ts new file mode 100644 index 00000000000..58e04e1768b --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/toEdgeQL.ts @@ -0,0 +1,1745 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + Duration, + LocalDate, + LocalDateTime, + LocalTime, + RelativeDuration, + DateDuration, + Range, + InputDataError, +} from "gel"; +import { + Cardinality, + ExpressionKind, + OperatorKind, + TypeKind, + util, +} from "gel/dist/reflection/index"; +import { + type $expr_Array, + type $expr_NamedTuple, + type $expr_Tuple, + type $expr_TuplePath, + type BaseType, + type EnumType, + isArrayType, + isNamedTupleType, + isObjectType, + isTupleType, + type ObjectType, + type ObjectTypeSet, + type RangeType, + type TypeSet, +} from "./typesystem"; +import type { $expr_Literal } from "./literal"; +import type { + $expr_PathLeaf, + $expr_PathNode, + $expr_TypeIntersection, +} from "./path"; +import { reservedKeywords } from "gel/dist/reflection/index"; +import type { $expr_Cast } from "./cast"; +import type { $expr_Detached } from "./detached"; +import type { $expr_For, $expr_ForVar } from "./for"; +import type { $expr_Function, $expr_Operator } from "./funcops"; +import type { $expr_Insert, $expr_InsertUnlessConflict } from "./insert"; +import type { $expr_Param, $expr_WithParams } from "./params"; +import type { + $expr_Delete, + $expr_Select, + LimitExpression, + OffsetExpression, +} from "./select"; +import type { $expr_Set } from "./set"; +import type { $expr_Update } from "./update"; +import type { $expr_Alias, $expr_With } from "./with"; +import type { $expr_Group, GroupingSet } from "./group"; +import type { $expr_Global } from "./globals"; +import { future } from "./future"; + +export type SomeExpression = + | $expr_PathNode + | $expr_PathLeaf + | $expr_Literal + | $expr_Set + | $expr_Array + | $expr_Tuple + | $expr_NamedTuple + | $expr_TuplePath + | $expr_Cast + | $expr_Select + | $expr_Delete + | $expr_Update + | $expr_Insert + | $expr_InsertUnlessConflict + | $expr_Function + | $expr_Operator + | $expr_For + | $expr_ForVar + | $expr_TypeIntersection + | $expr_Alias + | $expr_With + | $expr_WithParams + | $expr_Param + | $expr_Detached + | $expr_Group + | $expr_Global; + +type WithScopeExpr = + | $expr_Select + | $expr_Update + | $expr_Insert + | $expr_InsertUnlessConflict + | $expr_For + | $expr_Group; + +interface RenderCtx { + // mapping withable expr to list of with vars + withBlocks: Map>; + // metadata about each with var + withVars: Map< + SomeExpression, + { + name: string; + scope: WithScopeExpr; + childExprs: Set; + scopedExpr?: SomeExpression; // scope vars only + } + >; + renderWithVar?: SomeExpression; + forVars: Map<$expr_ForVar, string>; + linkProps: Map; +} + +const toEdgeQLCache = new WeakMap(); + +export function $toEdgeQL(this: any) { + if (toEdgeQLCache.has(this)) { + return toEdgeQLCache.get(this)!; + } + + const walkExprCtx: WalkExprTreeCtx = { + seen: new Map(), + rootScope: null, + }; + + walkExprTree(this, null, walkExprCtx); + + // get variables by block + const withBlocks: RenderCtx["withBlocks"] = new Map(); + // get per-variable metadata + const withVars: RenderCtx["withVars"] = new Map(); + const seen = new Map(walkExprCtx.seen); + const linkProps: RenderCtx["linkProps"] = new Map(); + + // iterate over all expressions + for (const [expr, refData] of seen) { + // delete from seen after visitinng + seen.delete(expr); + + // convert referenced link props to simple string array + if (refData.linkProps.length) { + linkProps.set( + expr, + refData.linkProps.map((linkProp) => + linkProp.__parent__.linkName.slice(1), + ), + ); + } + + // already extracted + if (withVars.has(expr)) { + continue; + } + + // ignore unbound leaves, nodes, and intersections + // these should be rendered as is + if ( + !refData.boundScope && + (expr.__kind__ === ExpressionKind.PathLeaf || + expr.__kind__ === ExpressionKind.PathNode || + expr.__kind__ === ExpressionKind.TypeIntersection) + ) { + continue; + } + + // forvars and params should not be hoisted + if ( + expr.__kind__ === ExpressionKind.ForVar || + expr.__kind__ === ExpressionKind.Param + ) { + continue; + } + + // pull out scope variables + // from select, update, and group expressions. + // these are always rendered in with blocks + if ( + (expr.__kind__ === ExpressionKind.Select || + expr.__kind__ === ExpressionKind.Update || + expr.__kind__ === ExpressionKind.Group) && + expr.__scope__ && + // with var not previously registered + !withVars.has(expr.__scope__ as any) + ) { + const withBlock = expr; + const scopeVar = expr.__scope__ as SomeExpression; + const scopeVarName = `__scope_${ + withVars.size + }_${scopeVar.__element__.__name__.replace(/[^A-Za-z]/g, "")}`; + + withVars.set(scopeVar, { + name: scopeVarName, + scope: withBlock, + childExprs: new Set(), + scopedExpr: + expr.__element__.__kind__ === TypeKind.object + ? (expr.__expr__ as any) + : undefined, + }); + } + + // expression should be extracted to with block if + // - bound with e.with + // - refcount > 1 + // - aliased with e.alias + if ( + refData.refCount > 1 || + refData.boundScope || + refData.aliases.length > 0 + ) { + // first, check if expr is bound to scope + let withBlock = (refData.boundScope?.__expr__ ?? + null) as WithScopeExpr | null; + + const parentScopes = [...refData.parentScopes]; + + // if expression is unbound + if (!withBlock) { + // if parent scopes haven't all been resolved, + // re-add current expr to `seen` to be resolved later + if ( + parentScopes.some( + (parentScope) => parentScope && seen.has(parentScope), + ) + ) { + seen.set(expr, refData); + continue; + } + + if (parentScopes.some((scope) => scope == null)) { + throw new Error( + `Cannot extract repeated expression into 'WITH' block, ` + + `expression used outside of 'WITH'able expression`, + ); + } + + const [firstParentScopeChain, ...parentScopeChains] = parentScopes.map( + (scope) => { + const scopes: WithScopeExpr[] = [scope!]; + const pendingScopes = [scope]; + while (pendingScopes.length) { + const currentScope = pendingScopes.shift()!; + pendingScopes.push( + ...[...walkExprCtx.seen.get(currentScope)!.parentScopes].filter( + (s) => s !== null, + ), + ); + if (!scopes.includes(currentScope)) { + scopes.push(currentScope); + } + } + return scopes; + }, + ); + const commonParentScope = firstParentScopeChain + ? firstParentScopeChain.find((scope) => + // find the first parent scope in the chain that is shared by + // the other parent scope chains + parentScopeChains.every((otherScope) => + otherScope.includes(scope), + ), + ) + : null; + + withBlock = commonParentScope ?? walkExprCtx.rootScope; + } + + if (!withBlock) { + throw new Error( + `Cannot extract repeated expression into 'WITH' block, ` + + `expression does not appear within common 'WITH'able expression`, + ); + } + + if (!withBlocks.has(withBlock)) { + withBlocks.set(withBlock, new Set()); + } + + if ( + refData.boundScope && + refData.boundScope.__refs__.some( + (ref: any) => + ref !== expr && + seen.has(ref) && + walkExprCtx.seen.get(ref)?.childExprs.includes(expr), + ) + ) { + // if expr is bound to a e.with, and any of it's siblings in the e.with + // refs contain this expr as a child and haven't been resolved yet, + // return this expr to `seen` to be resolved later + seen.set(expr, refData); + continue; + } + + // check all references and aliases are within this block + const validScopes = new Set( + [ + withBlock, + // expressions already explictly bound to with block are also valid scopes + ...(withBlocks.get(withBlock) ?? []), + ] // expand out child exprs of valid with scopes + .flatMap((expr) => [expr, ...walkExprCtx.seen.get(expr)!.childExprs]), + ); + for (const scope of [ + ...refData.parentScopes, + ...util.flatMap(refData.aliases, (alias) => [ + ...walkExprCtx.seen.get(alias)!.parentScopes, + ]), + ]) { + if (scope === null || !validScopes.has(scope)) { + throw new Error( + refData.boundScope + ? `Expr or its aliases used outside of declared 'WITH' block scope` + : `Cannot extract repeated or aliased expression into 'WITH' block, ` + + `expression or its aliases appear outside root scope`, + ); + } + } + + for (const withVar of [expr, ...refData.aliases]) { + // withVar is an alias already explicitly bound + // to an inner WITH block + const withVarBoundScope = walkExprCtx.seen.get(withVar)!.boundScope; + if (withVarBoundScope && withVarBoundScope !== refData.boundScope) { + continue; + } + + const withVarName = `__withVar_${withVars.size}`; + + withBlocks.get(withBlock)!.add(withVar); + withVars.set(withVar, { + name: withVarName, + scope: withBlock, + childExprs: new Set(walkExprCtx.seen.get(withVar)!.childExprs), + }); + } + } + } + + let edgeQL = renderEdgeQL(this, { + withBlocks, + withVars, + forVars: new Map(), + linkProps, + }); + if ( + edgeQL.startsWith("(") && + edgeQL.endsWith(")") && + !( + this.__kind__ === ExpressionKind.Tuple || + this.__kind__ === ExpressionKind.NamedTuple || + this.__kind__ === ExpressionKind.Literal + ) + ) { + edgeQL = edgeQL.slice(1, -1); + } + toEdgeQLCache.set(this, edgeQL); + + return edgeQL; +} + +interface WalkExprTreeCtx { + seen: Map< + SomeExpression, + { + refCount: number; + // tracks all withable ancestors + parentScopes: Set; + // tracks all child exprs + childExprs: SomeExpression[]; + // tracks bound scope from e.with + boundScope: $expr_With | null; + // tracks aliases from e.alias + aliases: SomeExpression[]; + linkProps: $expr_PathLeaf[]; + } + >; + rootScope: WithScopeExpr | null; +} + +// walks entire expression tree +// populates +function walkExprTree( + _expr: TypeSet, + parentScope: WithScopeExpr | null, + ctx: WalkExprTreeCtx, +): SomeExpression[] { + if (!(_expr as any).__kind__) { + throw new Error( + `Expected a valid querybuilder expression, ` + + `instead received ${typeof _expr}${ + typeof _expr !== "undefined" ? `: '${_expr}'` : "" + }.` + + getErrorHint(_expr), + ); + } + + const expr = _expr as SomeExpression; + + if ((expr as any).__scopedFrom__ != null) { + // If expr is marked as being a scoped copy of another expr, treat it as + // an opaque reference and don't walk it. The enclosing select/update that + // owns the scope will walk the actual unscoped expr. + return [expr]; + } + + function walkShape(shape: object) { + for (let param of Object.values(shape)) { + if (param.__kind__ === ExpressionKind.PolyShapeElement) { + param = param.__shapeElement__; + } + if (typeof param === "object") { + if ((param as any).__kind__) { + // param is expression + childExprs.push(...walkExprTree(param as any, expr as any, ctx)); + } else { + walkShape(param); + } + } + } + } + + // set root scope + if (!ctx.rootScope && parentScope) { + ctx.rootScope = parentScope; + } + + // return without walking if expression has been seen + const seenExpr = ctx.seen.get(expr); + if (seenExpr) { + seenExpr.refCount += 1; + // if (seenExpr.refCount > 1) { + // console.log(`###########\nSEEN ${seenExpr.refCount} times`); + // console.log(expr.__kind__); + // console.log(expr.__element__.__name__); + // const arg = (expr as any)?.__parent__ || (expr as any)?.__name__; + // if (arg) console.log(arg); + // } + seenExpr.parentScopes.add(parentScope); + return [expr, ...seenExpr.childExprs]; + } + + const childExprs: SomeExpression[] = []; + ctx.seen.set(expr, { + refCount: 1, + parentScopes: new Set([parentScope]), + childExprs, + boundScope: null, + aliases: [], + linkProps: [], + }); + + switch (expr.__kind__) { + case ExpressionKind.Alias: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + ctx.seen.get(expr.__expr__ as any)!.aliases.push(expr); + break; + case ExpressionKind.With: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + for (const refExpr of expr.__refs__) { + walkExprTree(refExpr, expr.__expr__, ctx); + const seenRef = ctx.seen.get(refExpr as any)!; + if (seenRef.childExprs.includes(expr.__expr__)) { + throw new Error( + `Ref expressions in with() cannot reference the expression to ` + + `which the 'WITH' block is being attached. ` + + `Consider wrapping the expression in a select.`, + ); + } + if (seenRef.boundScope) { + throw new Error(`Expression bound to multiple 'WITH' blocks`); + } + seenRef.boundScope = expr; + } + break; + case ExpressionKind.Literal: + case ExpressionKind.ForVar: + case ExpressionKind.Param: + break; + case ExpressionKind.PathLeaf: + case ExpressionKind.PathNode: + if (expr.__parent__) { + childExprs.push( + ...walkExprTree(expr.__parent__.type, parentScope, ctx), + ); + + if ( + // is link prop + expr.__kind__ === ExpressionKind.PathLeaf && + expr.__parent__.linkName.startsWith("@") + ) { + // don't hoist a linkprop that isn't scoped from parentScope + const parentScopeVar = (parentScope as any).__scope__; + if (parentScopeVar === expr.__parent__.type) { + ctx.seen.get(parentScope!)?.linkProps.push(expr); + } + } + } + break; + case ExpressionKind.Cast: + if (expr.__expr__ === null) break; + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + case ExpressionKind.Set: + for (const subExpr of expr.__exprs__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.Array: + for (const subExpr of expr.__items__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.Tuple: + for (const subExpr of expr.__items__) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.NamedTuple: + for (const subExpr of Object.values(expr.__shape__)) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + break; + case ExpressionKind.TuplePath: + childExprs.push(...walkExprTree(expr.__parent__, parentScope, ctx)); + break; + case ExpressionKind.Select: + case ExpressionKind.Update: { + const modifiers = expr.__modifiers__; + if (modifiers.filter) { + childExprs.push(...walkExprTree(modifiers.filter, expr, ctx)); + } + if (modifiers.order_by) { + for (const orderExpr of modifiers.order_by) { + childExprs.push(...walkExprTree(orderExpr.expression, expr, ctx)); + } + } + if (modifiers.offset) { + childExprs.push(...walkExprTree(modifiers.offset!, expr, ctx)); + } + if (modifiers.limit) { + childExprs.push(...walkExprTree(modifiers.limit!, expr, ctx)); + } + + if (expr.__kind__ === ExpressionKind.Select) { + if ( + isObjectType(expr.__element__) && + // don't walk shape twice if select expr justs wrap another object + // type expr with the same shape + expr.__element__.__shape__ !== + (expr.__expr__ as ObjectTypeSet).__element__.__shape__ + ) { + walkShape(expr.__element__.__shape__ ?? {}); + } + } else { + // Update + const shape: any = expr.__shape__ ?? {}; + + for (const _element of Object.values(shape)) { + let element: any = _element; + if (!element.__element__) { + if (element["+="]) element = element["+="]; + else if (element["-="]) element = element["-="]; + } + childExprs.push(...walkExprTree(element as any, expr, ctx)); + } + } + + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.Delete: { + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Insert: { + const shape: any = expr.__shape__ ?? {}; + + for (const element of Object.values(shape)) { + childExprs.push(...walkExprTree(element as any, expr, ctx)); + } + + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.InsertUnlessConflict: { + // InsertUnlessConflict doesn't create a new scope, the parent scope of + // child expressions is the wrapped Insert expr + const insertChildExprs: SomeExpression[] = []; + if (expr.__conflict__.on) { + insertChildExprs.push( + ...walkExprTree( + expr.__conflict__.on, + expr.__expr__ as $expr_Insert, + ctx, + ), + ); + } + if (expr.__conflict__.else) { + insertChildExprs.push( + ...walkExprTree( + expr.__conflict__.else, + expr.__expr__ as $expr_Insert, + ctx, + ), + ); + } + + childExprs.push( + ...walkExprTree(expr.__expr__, parentScope, ctx), + ...insertChildExprs, + ); + ctx.seen + .get(expr.__expr__ as $expr_Insert)! + .childExprs.push(...insertChildExprs); + break; + } + case ExpressionKind.Group: { + const groupingSet = expr.__modifiers__.by as any as GroupingSet; + // const groupingSet = expr.__grouping__ as any as GroupingSet; + for (const [, groupExpr] of groupingSet.__exprs__) { + // this prevents recurring grouping elements from being walked twice + // this way, these won't get pulled into with blocks, + // which is good because they need to be rendered in `using` + const seen = new Set(); + if (!seen.has(expr)) { + childExprs.push(...walkExprTree(groupExpr, expr, ctx)); + seen.add(expr); + } + } + + if (!expr.__element__.__shape__.elements.__element__.__shape__) { + throw new Error("Missing shape in GROUP statement"); + } + walkShape(expr.__element__.__shape__.elements.__element__.__shape__); + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.TypeIntersection: + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + case ExpressionKind.Operator: + case ExpressionKind.Function: + for (const subExpr of expr.__args__) { + if (Array.isArray(subExpr)) { + for (const arg of subExpr) { + if (arg) childExprs.push(...walkExprTree(arg, parentScope, ctx)); + } + } else { + childExprs.push(...walkExprTree(subExpr!, parentScope, ctx)); + } + } + if (expr.__kind__ === ExpressionKind.Function) { + for (const subExpr of Object.values(expr.__namedargs__)) { + childExprs.push(...walkExprTree(subExpr, parentScope, ctx)); + } + } + break; + case ExpressionKind.For: { + childExprs.push(...walkExprTree(expr.__iterSet__ as any, expr, ctx)); + childExprs.push(...walkExprTree(expr.__expr__, expr, ctx)); + break; + } + case ExpressionKind.WithParams: { + if (parentScope !== null) { + throw new Error( + `'withParams' does not support being used as a nested expression`, + ); + } + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Detached: { + childExprs.push(...walkExprTree(expr.__expr__, parentScope, ctx)); + break; + } + case ExpressionKind.Global: + break; + default: + util.assertNever( + expr, + new Error(`Unrecognized expression kind: "${(expr as any).__kind__}"`), + ); + } + + return [expr, ...childExprs]; +} + +function renderEdgeQL( + _expr: TypeSet, + ctx: RenderCtx, + renderShape = true, + noImplicitDetached = false, +): string { + if (!(_expr as any).__kind__) { + throw new Error("Invalid expression."); + } + const expr = _expr as SomeExpression; + + // if expression is in a with block + // render its name + const withVar = ctx.withVars.get(expr); + + if (withVar && ctx.renderWithVar !== expr) { + return renderShape && + expr.__kind__ === ExpressionKind.Select && + isObjectType(expr.__element__) + ? `(${withVar.name} ${shapeToEdgeQL( + (expr.__element__.__shape__ || {}) as object, + ctx, + null, + true, // render shape only + )})` + : withVar.name; + } + + // render with block expression + function renderWithBlockExpr( + varExpr: SomeExpression, + _noImplicitDetached?: boolean, + ) { + const withBlockElement = ctx.withVars.get(varExpr)!; + let renderedExpr = renderEdgeQL( + withBlockElement.scopedExpr ?? varExpr, + { + ...ctx, + renderWithVar: varExpr, + }, + !withBlockElement.scopedExpr, // render shape if no scopedExpr exists + _noImplicitDetached, + ); + const renderedExprNoDetached = renderEdgeQL( + withBlockElement.scopedExpr ?? varExpr, + { + ...ctx, + renderWithVar: varExpr, + }, + !withBlockElement.scopedExpr, // render shape if no scopedExpr exists + true, + ); + + if (ctx.linkProps.has(expr)) { + renderedExpr = `(SELECT ${renderedExpr} {\n${ctx.linkProps + .get(expr)! + .map( + (linkPropName) => + ` __linkprop_${linkPropName} := ${renderedExprNoDetached}@${linkPropName}`, + ) + .join(",\n")}\n})`; + } + return ` ${withBlockElement.name} := ${ + renderedExpr.includes("\n") + ? `(\n${indent( + renderedExpr[0] === "(" && + renderedExpr[renderedExpr.length - 1] === ")" + ? renderedExpr.slice(1, -1) + : renderedExpr, + 4, + )}\n )` + : renderedExpr + }`; + } + + // extract scope expression from select/update if exists + const scopeExpr = + (expr.__kind__ === ExpressionKind.Select || + expr.__kind__ === ExpressionKind.Update || + expr.__kind__ === ExpressionKind.Group) && + ctx.withVars.has(expr.__scope__ as any) + ? (expr.__scope__ as SomeExpression) + : undefined; + + const scopeExprVar: string[] = []; + const unscopedWithBlock: string[] = []; + const scopedWithBlock: string[] = []; + + // generate with block if needed + if (ctx.withBlocks.has(expr as any) || scopeExpr) { + // sort associated vars + const sortedBlockVars = topoSortWithVars( + ctx.withBlocks.get(expr as any) ?? new Set(), + ctx, + ); + + if (!scopeExpr) { + // if no scope expression exists, all variables are unscoped + unscopedWithBlock.push( + ...sortedBlockVars.map((blockVar) => renderWithBlockExpr(blockVar)), + ); + } + // else if (expr.__kind__ === ExpressionKind.Group) { + // // add all vars into scoped with block + // // this is rendered inside the `using` clause later + // // no need for the with/for trick + // scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + // scopedWithBlock.push( + // ...sortedBlockVars.map(blockVar => renderWithBlockExpr(blockVar)) + // ); + // } + else { + // get scope variable + const scopeVar = ctx.withVars.get(scopeExpr)!; + + // get list of with vars that reference scope + const scopedVars = sortedBlockVars.filter((blockVarExpr) => + ctx.withVars.get(blockVarExpr)?.childExprs.has(scopeExpr), + ); + // filter blockvars to only include vars that don't reference scope + unscopedWithBlock.push( + ...sortedBlockVars + .filter((blockVar) => !scopedVars.includes(blockVar)) + .map((blockVar) => renderWithBlockExpr(blockVar)), + ); + + // when rendering `with` variables that reference current scope + // they are extracted into computed properties defining in a for loop + if (!scopedVars.length) { + scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + } else { + const scopeName = scopeVar.name; + + // render a reference to scoped path (e.g. ".nemesis") + scopeVar.name = scopeName + "_expr"; + scopeExprVar.push(renderWithBlockExpr(scopeExpr, noImplicitDetached)); + // scopedWithBlock.push( + // renderWithBlockExpr(scopeExpr, noImplicitDetached) + // ); + + // render a for loop containing all scoped block vars + // as computed properties + scopeVar.name = scopeName + "_inner"; + scopeExprVar.push( + ` ${scopeName} := (FOR ${scopeVar.name} IN {${ + scopeName + "_expr" + }} UNION (\n WITH\n${indent( + scopedVars + .map((blockVar) => renderWithBlockExpr(blockVar)) + .join(",\n"), + 4, + )}\n SELECT ${scopeVar.name} {\n${scopedVars + .map((blockVar) => { + const name = ctx.withVars.get(blockVar)!.name; + return ` ${name} := ${name}`; + }) + .join(",\n")}\n }\n ))`, + ); + + // change var name back to original value + scopeVar.name = scopeName; + + // reassign name for all scoped block vars + for (const blockVarExpr of scopedVars) { + const blockVar = ctx.withVars.get(blockVarExpr)!; + blockVar.name = `${scopeName}.${blockVar.name}`; + } + } + } + } + + const withBlockElements = [ + ...unscopedWithBlock, + ...scopeExprVar, + ...scopedWithBlock, + ]; + const withBlock = withBlockElements.length + ? `WITH\n${withBlockElements.join(",\n")}\n` + : ""; + + if (expr.__kind__ === ExpressionKind.With) { + return renderEdgeQL(expr.__expr__, ctx); + } else if (expr.__kind__ === ExpressionKind.WithParams) { + return `(WITH\n${expr.__params__ + .map((param) => { + const optional = + param.__cardinality__ === Cardinality.AtMostOne ? "OPTIONAL " : ""; + let paramExpr: string; + if (param.__isComplex__) { + let cast = param.__element__.__name__; + cast = cast.includes("std::decimal") + ? `<${cast}><${cast.replace(/std::decimal/g, "std::str")}>` + : `<${cast}>`; + paramExpr = `${cast}to_json(<${optional}str>$${param.__name__})`; + } else { + paramExpr = `<${optional}${param.__element__.__name__}>$${param.__name__}`; + } + return ` __param__${param.__name__} := ${paramExpr}`; + }) + .join(",\n")}\nSELECT ${renderEdgeQL(expr.__expr__, ctx)})`; + } else if (expr.__kind__ === ExpressionKind.Alias) { + const aliasedExprVar = ctx.withVars.get(expr.__expr__ as any); + if (!aliasedExprVar) { + throw new Error( + `Expression referenced by alias does not exist in 'WITH' block`, + ); + } + return aliasedExprVar.name; + } else if ( + expr.__kind__ === ExpressionKind.PathNode || + expr.__kind__ === ExpressionKind.PathLeaf + ) { + if (!expr.__parent__) { + return `${noImplicitDetached ? "" : "DETACHED "}${ + expr.__element__.__name__ + }`; + } else { + const isScopedLinkProp = + expr.__parent__.linkName.startsWith("@") && + ctx.withVars.has(expr.__parent__.type as any); + const linkName = isScopedLinkProp + ? `__linkprop_${expr.__parent__.linkName.slice(1)}` + : expr.__parent__.linkName; + const parent = renderEdgeQL( + expr.__parent__.type, + ctx, + false, + noImplicitDetached, + ); + return `${parent}${linkName.startsWith("@") ? "" : "."}${q(linkName)}`; + } + } else if (expr.__kind__ === ExpressionKind.Literal) { + return literalToEdgeQL(expr.__element__, expr.__value__); + } else if (expr.__kind__ === ExpressionKind.Set) { + const exprs = expr.__exprs__; + + if ( + exprs.every((ex) => ex.__element__.__kind__ === TypeKind.object) || + exprs.every((ex) => ex.__element__.__kind__ !== TypeKind.object) + ) { + if (exprs.length === 0) return `<${expr.__element__.__name__}>{}`; + return `{ ${exprs.map((ex) => renderEdgeQL(ex, ctx)).join(", ")} }`; + } else { + throw new Error( + `Invalid arguments to set constructor: ${exprs + .map((ex) => ex.__element__.__name__) + .join(", ")}`, + ); + } + } else if (expr.__kind__ === ExpressionKind.Array) { + return `[${expr.__items__ + .map((item) => renderEdgeQL(item, ctx)) + .join(", ")}]`; + } else if (expr.__kind__ === ExpressionKind.Tuple) { + return `(\n${expr.__items__ + .map( + (item) => + ` ` + renderEdgeQL(item, ctx, renderShape, noImplicitDetached), + ) + .join(",\n")}${expr.__items__.length === 1 ? "," : ""}\n)`; + } else if (expr.__kind__ === ExpressionKind.NamedTuple) { + return `(\n${Object.keys(expr.__shape__) + .map( + (key) => + ` ${key} := ${renderEdgeQL( + expr.__shape__[key]!, + ctx, + renderShape, + noImplicitDetached, + )}`, + ) + .join(",\n")}\n)`; + } else if (expr.__kind__ === ExpressionKind.TuplePath) { + return `${renderEdgeQL(expr.__parent__, ctx)}.${expr.__index__}`; + } else if (expr.__kind__ === ExpressionKind.Cast) { + const typeName = + expr.__element__.__name__ === "std::number" + ? "std::float64" + : expr.__element__.__name__; + if (expr.__expr__ === null) { + return `<${typeName}>{}`; + } + const rawInnerExpr = renderEdgeQL(expr.__expr__, ctx); + const isCast = + (expr.__expr__ as any).__kind__ === ExpressionKind.Cast && + rawInnerExpr[0] === "("; + const innerExpr = isCast ? rawInnerExpr.slice(1, -1) : rawInnerExpr; + return `(<${typeName}>${innerExpr})`; + } else if (expr.__kind__ === ExpressionKind.Select) { + const lines: string[] = []; + if (isObjectType(expr.__element__)) { + const selectionTarget = renderEdgeQL( + expr.__scope__ ?? expr.__expr__, + ctx, + false, + ); + + lines.push( + `SELECT${ + selectionTarget === "DETACHED std::FreeObject" + ? "" + : ` ${selectionTarget}` + }`, + ); + + if ( + expr.__element__.__shape__ !== + (expr.__expr__ as ObjectTypeSet).__element__.__shape__ + ) { + lines.push( + shapeToEdgeQL( + (expr.__element__.__shape__ || {}) as object, + ctx, + expr.__element__, + ), + ); + } + } else { + // non-object/non-shape select expression + const needsScalarVar = + (expr.__modifiers__.filter || + expr.__modifiers__.order_by || + expr.__modifiers__.offset || + expr.__modifiers__.limit) && + !ctx.withVars.has(expr.__expr__ as any); + + lines.push( + `SELECT ${needsScalarVar ? "_ := " : ""}${renderEdgeQL( + expr.__expr__, + ctx, + )}`, + ); + + if (needsScalarVar) { + ctx = { ...ctx, withVars: new Map(ctx.withVars) }; + ctx.withVars.set(expr.__expr__ as any, { + name: "_", + childExprs: new Set(), + scope: expr, + }); + } + } + + const modifiers: string[] = []; + + if (expr.__modifiers__.filter) { + modifiers.push(`FILTER ${renderEdgeQL(expr.__modifiers__.filter, ctx)}`); + } + if (expr.__modifiers__.order_by) { + modifiers.push( + ...expr.__modifiers__.order_by.map( + ({ expression, direction, empty }, i) => { + return `${i === 0 ? "ORDER BY" : " THEN"} ${renderEdgeQL( + expression, + ctx, + )}${direction ? " " + direction : ""}${empty ? " " + empty : ""}`; + }, + ), + ); + } + if (expr.__modifiers__.offset) { + modifiers.push( + `OFFSET ${renderEdgeQL( + expr.__modifiers__.offset as OffsetExpression, + ctx, + )}`, + ); + } + if (expr.__modifiers__.limit) { + modifiers.push( + `LIMIT ${renderEdgeQL( + expr.__modifiers__.limit as LimitExpression, + ctx, + )}`, + ); + } + + // without assert_single, the query will return a more informative + // CardinalityMismatchError when the query returns more than one result + return ( + // (expr.__modifiers__.singleton ? `select assert_single((` : ``) + + "(" + + withBlock + + lines.join(" ") + + (modifiers.length ? "\n" + modifiers.join("\n") : "") + + ")" + // + (expr.__modifiers__.singleton ? `))` : ``) + ); + } else if (expr.__kind__ === ExpressionKind.Update) { + return `(${withBlock}UPDATE ${renderEdgeQL(expr.__scope__, ctx, false)}${ + expr.__modifiers__.filter + ? `\nFILTER ${renderEdgeQL(expr.__modifiers__.filter, ctx)}\n` + : " " + }SET ${shapeToEdgeQL(expr.__shape__, ctx, null, false, false)})`; + } else if (expr.__kind__ === ExpressionKind.Delete) { + return `(${withBlock}DELETE ${renderEdgeQL( + expr.__expr__, + ctx, + undefined, + noImplicitDetached, + )})`; + } else if (expr.__kind__ === ExpressionKind.Insert) { + return `(${withBlock}INSERT ${renderEdgeQL( + expr.__expr__, + ctx, + false, + true, + )} ${shapeToEdgeQL(expr.__shape__, ctx, null, false, false)})`; + } else if (expr.__kind__ === ExpressionKind.InsertUnlessConflict) { + const $on = expr.__conflict__.on; + const $else = expr.__conflict__.else; + const clause: string[] = []; + if (!$on) { + clause.push("\nUNLESS CONFLICT"); + } + if ($on) { + clause.push( + `\nUNLESS CONFLICT ON ${renderEdgeQL($on, ctx, false, true)}`, + ); + } + if ($else) { + clause.push(`\nELSE (${renderEdgeQL($else, ctx, true, true)})`); + } + return `(${renderEdgeQL(expr.__expr__, ctx, false, true).slice( + 1, + -1, + )}${clause.join("")})`; + } else if (expr.__kind__ === ExpressionKind.Group) { + const groupingSet = expr.__modifiers__.by as any as GroupingSet; + const elementsShape = + expr.__element__.__shape__.elements.__element__.__shape__; + + const selectStatement: string[] = []; + const groupStatement: string[] = []; + + const groupTarget = renderEdgeQL(expr.__scope__, ctx, false); + groupStatement.push(`GROUP ${groupTarget}`); + + // render scoped withvars in using + const combinedBlock = [ + // ...scopedWithBlock, + // this is deduplicated in e.group + ...groupingSet.__exprs__.map( + ([k, v]) => ` ${k} := ${renderEdgeQL(v, ctx)}`, + ), + ]; + groupStatement.push(`USING\n${combinedBlock.join(",\n")}`); + + let by = renderGroupingSet(groupingSet).trim(); + if (by[0] === "(" && by[by.length - 1] === ")") { + by = by.slice(1, by.length - 1); + } + groupStatement.push(`BY ` + by); + + // clause.push(withBlock.trim()); + + // render scope var and any unscoped withVars in with block + const selectTarget = `${groupTarget}_groups`; + selectStatement.push( + `WITH\n${[ + ...unscopedWithBlock, + ...scopeExprVar, + // ...scopedWithBlock, + ].join(",\n")}, + ${selectTarget} := ( +${indent(groupStatement.join("\n"), 4)} +)`, + ); + + // rename scope var to fix all scope references that + // occur in the `elements` subshape + const scopeVar = ctx.withVars.get(expr.__scope__ as any); + + // replace references to __scope__ with + // .elements reference + const elementsShapeQuery = indent( + shapeToEdgeQL(elementsShape as object, { ...ctx }, expr.__element__), + 2, + ) + .trim() + .split(scopeVar!.name + ".") + .join(`${selectTarget}.elements.`); + + selectStatement.push(`SELECT ${selectTarget} { + key: {${groupingSet.__exprs__.map((e) => e[0]).join(", ")}}, + grouping, + elements: ${elementsShapeQuery} +}`); + return `(${selectStatement.join("\n")})`; + } else if (expr.__kind__ === ExpressionKind.Function) { + const args = expr.__args__.map( + (arg) => `${renderEdgeQL(arg!, ctx, false)}`, + ); + for (const [key, arg] of Object.entries(expr.__namedargs__)) { + args.push(`${q(key)} := ${renderEdgeQL(arg, ctx, false)}`); + } + return `${expr.__name__}(${args.join(", ")})`; + } else if (expr.__kind__ === ExpressionKind.Operator) { + const operator = expr.__name__; + const args = expr.__args__; + switch (expr.__opkind__) { + case OperatorKind.Infix: + if (operator === "[]") { + let index = ""; + if (Array.isArray(args[1])) { + const [start, end] = args[1]; + if (start) { + index += renderEdgeQL(start, ctx); + } + index += ":"; + if (end) { + index += renderEdgeQL(end, ctx); + } + } else { + index = renderEdgeQL(args[1]!, ctx); + } + + return `${renderEdgeQL(args[0]!, ctx)}[${index}]`; + } + return `(${renderEdgeQL(args[0]!, ctx)} ${operator} ${renderEdgeQL( + args[1]!, + ctx, + )})`; + case OperatorKind.Postfix: + return `(${renderEdgeQL(args[0]!, ctx)} ${operator})`; + case OperatorKind.Prefix: + return `(${operator} ${renderEdgeQL(args[0]!, ctx)})`; + case OperatorKind.Ternary: + if (operator === "if_else") { + return `(${renderEdgeQL(args[0]!, ctx)} IF ${renderEdgeQL( + args[1]!, + ctx, + )} ELSE ${renderEdgeQL(args[2]!, ctx)})`; + } else { + throw new Error(`Unknown operator: ${operator}`); + } + default: + util.assertNever( + expr.__opkind__, + new Error(`Unknown operator kind: ${expr.__opkind__}`), + ); + } + } else if (expr.__kind__ === ExpressionKind.TypeIntersection) { + return `${renderEdgeQL(expr.__expr__, ctx, false)}[IS ${ + expr.__element__.__name__ + }]`; + } else if (expr.__kind__ === ExpressionKind.For) { + ctx.forVars.set(expr.__forVar__, `__forVar__${ctx.forVars.size}`); + return `(${withBlock}FOR ${ctx.forVars.get( + expr.__forVar__, + )} IN {${renderEdgeQL(expr.__iterSet__, ctx)}} +UNION (\n${indent(renderEdgeQL(expr.__expr__, ctx), 2)}\n))`; + } else if (expr.__kind__ === ExpressionKind.ForVar) { + const forVar = ctx.forVars.get(expr); + if (!forVar) { + throw new Error(`'FOR' loop variable used outside of 'FOR' loop`); + } + return forVar; + } else if (expr.__kind__ === ExpressionKind.Param) { + return `__param__${expr.__name__}`; + } else if (expr.__kind__ === ExpressionKind.Detached) { + return `(DETACHED ${renderEdgeQL( + expr.__expr__, + { + ...ctx, + renderWithVar: expr.__expr__ as any, + }, + undefined, + true, + )})`; + } else if (expr.__kind__ === ExpressionKind.Global) { + return `(GLOBAL ${expr.__name__})`; + } else { + util.assertNever( + expr, + new Error(`Unrecognized expression kind: "${(expr as any).__kind__}"`), + ); + } +} + +function isGroupingSet(arg: any): arg is GroupingSet { + return arg.__kind__ === "groupingset"; +} + +// recursive renderer +function renderGroupingSet(set: GroupingSet): string { + const contents = Object.entries(set.__elements__) + .map(([k, v]) => { + return isGroupingSet(v) ? renderGroupingSet(v) : k; + }) + .join(", "); + if (set.__settype__ === "tuple") { + return `(${contents})`; + } else if (set.__settype__ === "set") { + return `{${contents}}`; + } else if (set.__settype__ === "cube") { + return `cube(${contents})`; + } else if (set.__settype__ === "rollup") { + return `rollup(${contents})`; + } else { + throw new Error(`Unrecognized set type: "${set.__settype__}"`); + } +} + +function shapeToEdgeQL( + shape: object | null, + ctx: RenderCtx, + type: ObjectType | null = null, + keysOnly = false, + injectImplicitId = true, +) { + const pointers = type?.__pointers__ || null; + const isFreeObject = type?.__name__ === "std::FreeObject"; + if (shape === null) { + return ``; + } + + const lines: string[] = []; + const addLine = (line: string) => + lines.push(`${keysOnly ? "" : " "}${line}`); + + const seen = new Set(); + + let hasPolyEl = false; + + for (const key in shape) { + if (!Object.prototype.hasOwnProperty.call(shape, key)) continue; + if (seen.has(key)) { + console.warn(`Invalid: duplicate key "${key}"`); + continue; + } + seen.add(key); + let val = (shape as any)[key]; + let operator = ":="; + let polyType: SomeExpression | null = null; + + if (typeof val === "object" && !val.__element__) { + if (val["+="]) { + operator = "+="; + val = val["+="]; + } else if (val["-="]) { + operator = "-="; + val = val["-="]; + } + } + if (val.__kind__ === ExpressionKind.PolyShapeElement) { + polyType = val.__polyType__; + val = val.__shapeElement__; + hasPolyEl = true; + } + const polyIntersection = polyType + ? `[IS ${polyType.__element__.__name__}].` + : ""; + + // For computed properties in select shapes, inject the expected + // cardinality inferred by the query builder. This ensures the actual + // type returned by the server matches the inferred return type, or an + // explicit error is thrown, instead of a silent mismatch between + // actual and inferred type. + // Add annotations on FreeObjects, despite the existence of a pointer. + const ptr = pointers?.[key]; + const addCardinalityAnnotations = pointers && (!ptr || isFreeObject); + + const expectedCardinality = + addCardinalityAnnotations && + Object.prototype.hasOwnProperty.call(val, "__cardinality__") + ? val.__cardinality__ === Cardinality.Many || + val.__cardinality__ === Cardinality.AtLeastOne + ? "multi " + : "single " + : ""; + + // if selecting a required multi link, wrap expr in 'assert_exists' + const wrapAssertExists = ptr?.cardinality === Cardinality.AtLeastOne; + + if (typeof val === "boolean") { + if ( + !pointers?.[key] && + key[0] !== "@" && + type && + type?.__name__ !== "std::FreeObject" && + !polyIntersection + ) { + throw new Error(`Field "${key}" does not exist in ${type?.__name__}`); + } + if (val) { + addLine(`${polyIntersection}${q(key)}`); + } + continue; + } + + if (typeof val !== "object") { + throw new Error(`Invalid shape element at "${key}".`); + } + + const valIsExpression = Object.prototype.hasOwnProperty.call( + val, + "__kind__", + ); + + // is subshape + if (!valIsExpression) { + addLine( + `${polyIntersection}${q(key, false)}: ${indent( + shapeToEdgeQL(val, ctx, ptr?.target), + 2, + ).trim()}`, + ); + continue; + } + + // val is expression + + // is computed + if (keysOnly) { + addLine( + q(key, false) + + (isObjectType(val.__element__) + ? `: ${shapeToEdgeQL(val.__element__.__shape__, ctx, null, true)}` + : ""), + ); + continue; + } + const renderedExpr = renderEdgeQL(val, ctx); + + addLine( + `${expectedCardinality}${q(key, false)} ${operator} ${ + wrapAssertExists ? "assert_exists(" : "" + }${ + renderedExpr.includes("\n") + ? `(\n${indent( + renderedExpr[0] === "(" && + renderedExpr[renderedExpr.length - 1] === ")" + ? renderedExpr.slice(1, -1) + : renderedExpr, + 4, + )}\n )` + : renderedExpr + }${wrapAssertExists ? ")" : ""}`, + ); + } + + if (lines.length === 0 && injectImplicitId) { + addLine("id"); + } + if ( + hasPolyEl && + !seen.has("__typename") && + future.polymorphismAsDiscriminatedUnions + ) { + addLine("__typename := .__type__.name"); + } + return keysOnly ? `{${lines.join(", ")}}` : `{\n${lines.join(",\n")}\n}`; +} + +function topoSortWithVars( + vars: Set, + ctx: RenderCtx, +): SomeExpression[] { + if (!vars.size) { + return []; + } + + const sorted: SomeExpression[] = []; + + const unvisited = new Set(vars); + const visiting = new Set(); + + for (const withVar of unvisited) { + visit(withVar); + } + + function visit(withVar: SomeExpression): void { + if (!unvisited.has(withVar)) { + return; + } + if (visiting.has(withVar)) { + throw new Error(`'WITH' variables contain a cyclic dependency`); + } + + visiting.add(withVar); + + for (const child of ctx.withVars.get(withVar)!.childExprs) { + if (vars.has(child)) { + visit(child); + } + } + + visiting.delete(withVar); + unvisited.delete(withVar); + + sorted.push(withVar); + } + return sorted; +} + +const numericalTypes: Record = { + "std::number": true, + "std::int16": true, + "std::int32": true, + "std::int64": true, + "std::float32": true, + "std::float64": true, +}; + +function makeLabel(stringified: string, prefix = "jsonliteral"): string { + const MAX_ITERATIONS = 100; + let counter = 0; + let label = `${prefix}`; + + while (stringified.includes(`$${label}$`) && counter < MAX_ITERATIONS) { + label = `${prefix}${counter}`; + counter++; + } + + if (counter >= MAX_ITERATIONS) { + throw new InputDataError( + "Counter reached 100 without finding a unique label.", + ); + } + return label; +} + +function wrapAsRawString(val: string): string { + const label = makeLabel(val); + return `$${label}$${val}$${label}$`; +} + +function literalToEdgeQL(type: BaseType, val: any): string { + const typename = (type as any).__casttype__?.__name__ ?? type.__name__; + let skipCast = false; + let stringRep; + if (typename === "std::json") { + skipCast = true; + const stringified = JSON.stringify(val); + stringRep = `to_json(${wrapAsRawString(stringified)})`; + } else if (typeof val === "string") { + if (numericalTypes[typename]) { + skipCast = typename === type.__name__; + stringRep = val; + } else if (type.__kind__ === TypeKind.enum) { + skipCast = true; + const vals = (type as EnumType).__values__; + if (vals.includes(val)) { + skipCast = true; + if (val.includes(" ")) { + stringRep = `<${type.__name__}>"${val}"`; + } else { + stringRep = `${type.__name__}.${q(val)}`; + } + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}`, + ); + } + } else { + if (typename === "std::str") { + skipCast = true; + } + stringRep = JSON.stringify(val); + } + } else if (typeof val === "number") { + if (numericalTypes[typename]) { + skipCast = typename === type.__name__; + } else { + throw new Error(`Unknown numerical type: ${type.__name__}!`); + } + stringRep = `${val.toString()}`; + } else if (typeof val === "boolean") { + stringRep = `${val.toString()}`; + skipCast = true; + } else if (typeof val === "bigint") { + stringRep = `${val.toString()}n`; + } else if (Array.isArray(val)) { + skipCast = val.length !== 0; + if (isArrayType(type)) { + stringRep = `[${val + .map((el) => literalToEdgeQL(type.__element__ as any, el)) + .join(", ")}]`; + } else if (isTupleType(type)) { + stringRep = `( ${val + .map((el, j) => literalToEdgeQL(type.__items__[j] as any, el)) + .join(", ")}${type.__items__.length === 1 ? "," : ""} )`; + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}`, + ); + } + } else if (val instanceof Date) { + stringRep = `'${val.toISOString()}'`; + } else if ( + val instanceof LocalDate || + val instanceof LocalDateTime || + val instanceof LocalTime || + val instanceof Duration || + val instanceof RelativeDuration || + val instanceof DateDuration + ) { + stringRep = `'${val.toString()}'`; + } else if (val instanceof Uint8Array) { + stringRep = bufferToStringRep(val); + skipCast = true; + } else if (val instanceof Float32Array) { + stringRep = `[${val.join(",")}]`; + } else if (val instanceof Range) { + const elType = (type as RangeType).__element__; + + // actual type will be inferred from + // defined value + const elTypeName = + elType.__name__ === "std::number" ? "std::int64" : elType.__name__; + + return `std::range(${ + val.lower === null + ? `<${elTypeName}>{}` + : literalToEdgeQL(elType, val.lower) + }, ${ + val.upper === null + ? `<${elTypeName}>{}` + : literalToEdgeQL(elType, val.upper) + }, inc_lower := ${val.incLower}, inc_upper := ${val.incUpper})`; + } else if (typeof val === "object") { + if (isNamedTupleType(type)) { + stringRep = `( ${Object.entries(val).map( + ([key, value]) => + `${key} := ${literalToEdgeQL(type.__shape__[key]!, value)}`, + )} )`; + skipCast = true; + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}`, + ); + } + } else { + throw new Error( + `Invalid value for type ${type.__name__}: ${JSON.stringify(val)}`, + ); + } + if (skipCast) { + return stringRep; + } + return `<${type.__name__}>${stringRep}`; +} + +function indent(str: string, depth: number) { + return str + .split("\n") + .map((line) => " ".repeat(depth) + line) + .join("\n"); +} + +// backtick quote identifiers if needed +// https://github.com/geldata/gel/blob/master/edb/edgeql/quote.py +function q(ident: string, allowBacklinks = true): string { + if ( + !ident || + ident.startsWith("@") || + (allowBacklinks && (ident.startsWith("<") || ident.includes("::"))) + ) { + return ident; + } + + const isAlphaNum = /^([^\W\d]\w*|([1-9]\d*|0))$/.test(ident); + if (isAlphaNum) { + const lident = ident.toLowerCase(); + const isReserved = + lident !== "__type__" && + lident !== "__std__" && + reservedKeywords.has(lident); + + if (!isReserved) { + return ident; + } + } + + return "`" + ident.replace(/`/g, "``") + "`"; +} + +function bufferToStringRep(buf: Uint8Array): string { + let stringRep = ""; + for (const byte of buf) { + if (byte < 32 || byte > 126) { + // non printable ascii + switch (byte) { + case 8: + stringRep += "\\b"; + break; + case 9: + stringRep += "\\t"; + break; + case 10: + stringRep += "\\n"; + break; + case 12: + stringRep += "\\f"; + break; + case 13: + stringRep += "\\r"; + break; + default: + stringRep += `\\x${byte.toString(16).padStart(2, "0")}`; + } + } else { + stringRep += + (byte === 39 || byte === 92 ? "\\" : "") + String.fromCharCode(byte); + } + } + return `b'${stringRep}'`; +} + +function getErrorHint(expr: any): string { + let literalConstructor: string | null = null; + switch (typeof expr) { + case "string": + literalConstructor = "e.str()"; + break; + case "number": + literalConstructor = Number.isInteger(expr) ? "e.int64()" : "e.float64()"; + break; + case "bigint": + literalConstructor = "e.bigint()"; + break; + case "boolean": + literalConstructor = "e.bool()"; + break; + } + switch (true) { + case expr instanceof Date: + literalConstructor = "e.datetime()"; + break; + case expr instanceof Duration: + literalConstructor = "e.duration()"; + break; + case expr instanceof LocalDate: + literalConstructor = "e.cal.local_date()"; + break; + case expr instanceof LocalDateTime: + literalConstructor = "e.cal.local_datetime()"; + break; + case expr instanceof LocalTime: + literalConstructor = "e.cal.local_time()"; + break; + case expr instanceof RelativeDuration: + literalConstructor = "e.cal.relative_duration()"; + break; + case expr instanceof DateDuration: + literalConstructor = "e.cal.date_duration()"; + break; + } + + return literalConstructor + ? `\nHint: Maybe you meant to wrap the value in ` + + `a '${literalConstructor}' expression?` + : ""; +} diff --git a/starters/features/gel/dbschema/edgeql-js/typesystem.ts b/starters/features/gel/dbschema/edgeql-js/typesystem.ts new file mode 100644 index 00000000000..3ca34784cc8 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/typesystem.ts @@ -0,0 +1,945 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel/dist/ifaces"; +import type { $expr_PathNode, $expr_TypeIntersection, $pathify } from "./path"; +import type { $expr_Literal } from "./literal"; +import type { $expr_Operator } from "./funcops"; +import type { + typeutil, + Cardinality, + ExpressionKind, +} from "gel/dist/reflection/index"; +import { TypeKind } from "gel/dist/reflection/index"; +import type { cardutil } from "./cardinality"; +import type { Range, MultiRange } from "gel"; +import type { $Shape, normaliseShape } from "./select"; +import type { future } from "./future"; + +////////////////// +// BASETYPE +////////////////// + +export interface BaseType { + __kind__: TypeKind; + __name__: string; +} +export type BaseTypeSet = { + __element__: BaseType; + __cardinality__: Cardinality; +}; +export type BaseTypeTuple = typeutil.tupleOf; + +////////////////// +// SCALARTYPE +////////////////// + +export interface ScalarType< + Name extends string = string, + TsType = any, + TsArgType = TsType, + TsConstType extends TsType = TsType, +> extends BaseType { + __kind__: TypeKind.scalar; + __tstype__: TsType; + __tsargtype__: TsArgType; + __tsconsttype__: TsConstType; + __name__: Name; +} + +export type scalarTypeWithConstructor< + S extends ScalarType, + ExtraTsTypes = never, +> = S & + (( + val: T, + ) => $expr_Literal< + Omit & { + __tsconsttype__: T extends S["__tstype__"] ? T : S["__tstype__"]; + } + >); + +type $jsonDestructure = + Set extends TypeSet> + ? { + [path: string]: $expr_Operator< + Set["__element__"], + Set["__cardinality__"] + >; + } & { + destructure> | string>( + path: T, + ): $expr_Operator< + Set["__element__"], + cardutil.multiplyCardinalities< + Set["__cardinality__"], + T extends TypeSet ? T["__cardinality__"] : Cardinality.One + > + >; + } + : unknown; + +//////////////////// +// SETS AND EXPRESSIONS +//////////////////// + +export interface TypeSet< + T extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> { + __element__: T; + __cardinality__: Card; +} + +// utility function for creating set +export function $toSet( + root: Root, + card: Card, +): TypeSet { + return { + __element__: root, + __cardinality__: card, + }; +} + +export type Expression< + Set extends TypeSet = TypeSet, + Runnable extends boolean = true, +> = Set & + (BaseType extends Set["__element__"] // short-circuit non-specific types + ? { + run(cxn: Executor): any; + runJSON(cxn: Executor): any; + toEdgeQL(): string; + is: any; + assert_single: any; + // warning: any; + } + : $pathify & + ExpressionMethods> & + (Runnable extends true + ? { + run(cxn: Executor): Promise>; + runJSON(cxn: Executor): Promise; + } + : unknown) & + $tuplePathify & + $arrayLikeIndexify & + $jsonDestructure); + +export type stripSet = "__element__" extends keyof T + ? "__cardinality__" extends keyof T + ? { + __element__: T["__element__"]; + __cardinality__: T["__cardinality__"]; + } + : T + : T; + +// export type stripSet = T extends {__element__: any; __cardinality__: any} +// ? { +// __element__: T["__element__"]; +// __cardinality__: T["__cardinality__"]; +// } +// : any; + +export type stripSetShape = { + [k in keyof T]: stripSet; +}; + +// importing the actual alias from +// generated/modules/std didn't work. +// returned 'any' every time +export type assert_single< + El extends BaseType, + Card extends Cardinality, +> = Expression<{ + __element__: El; // ["__element__"]; + __cardinality__: Card; // cardutil.overrideUpperBound< + // Expr["__cardinality__"], "One" + // >; + __kind__: ExpressionKind.Function; + __name__: "std::assert_single"; + __args__: TypeSet[]; // discard wrapped expression + __namedargs__: object; +}>; + +export type ExpressionMethods = { + toEdgeQL(): string; + + is( + ixn: T, + ): $expr_TypeIntersection< + cardutil.overrideLowerBound, + // might cause performance issues + ObjectType< + T["__element__"]["__name__"], + T["__element__"]["__pointers__"], + { id: true }, + T["__element__"]["__exclusives__"], + T["__element__"]["__polyTypenames__"] + > + >; + assert_single(): assert_single< + ObjectType extends Set["__element__"] + ? ObjectType + : Set["__element__"], + Cardinality.AtMostOne + // cardutil.overrideUpperBound + >; +}; + +////////////////// +// ENUMTYPE +////////////////// +export interface EnumType< + Name extends string = string, + Values extends [string, ...string[]] = [string, ...string[]], +> extends BaseType { + __kind__: TypeKind.enum; + __tstype__: Values[number]; + __name__: Name; + __values__: Values; +} + +////////////////// +// OBJECTTYPE +////////////////// + +export type ObjectTypeSet = TypeSet; +export type ObjectTypeExpression = TypeSet; + +export type ExclusiveTuple = typeutil.tupleOf<{ + [k: string]: TypeSet; +}>; +export interface ObjectType< + Name extends string = string, + Pointers extends ObjectTypePointers = ObjectTypePointers, + Shape extends object | null = any, + Exclusives extends ExclusiveTuple = ExclusiveTuple, + PolyTypenames extends string = string, +> extends BaseType { + __kind__: TypeKind.object; + __name__: Name; + __pointers__: Pointers; + __shape__: Shape; + __exclusives__: Exclusives; + __polyTypenames__: PolyTypenames; +} + +export type PropertyTypes = + | ScalarType + | EnumType + | ArrayType + | TupleType + | NamedTupleType; + +export type SomeType = + | ScalarType + | EnumType + | ArrayType + | TupleType + | ObjectType + | NamedTupleType + | RangeType + | MultiRangeType; + +export interface PropertyDesc< + Type extends BaseType = BaseType, + Card extends Cardinality = Cardinality, + Exclusive extends boolean = boolean, + Computed extends boolean = boolean, + Readonly extends boolean = boolean, + HasDefault extends boolean = boolean, +> { + __kind__: "property"; + target: Type; + cardinality: Card; + exclusive: Exclusive; + computed: Computed; + readonly: Readonly; + hasDefault: HasDefault; +} + +export type $scopify = $expr_PathNode< + TypeSet + // null, + // true // exclusivity +>; + +export type PropertyShape = { + [k: string]: PropertyDesc; +}; + +export interface LinkDesc< + Type extends ObjectType = any, + Card extends Cardinality = Cardinality, + LinkProps extends PropertyShape = any, + Exclusive extends boolean = boolean, + Computed extends boolean = boolean, + Readonly extends boolean = boolean, + HasDefault extends boolean = boolean, +> { + __kind__: "link"; + target: Type; + cardinality: Card; + properties: LinkProps; + exclusive: Exclusive; + computed: Computed; + readonly: Readonly; + hasDefault: HasDefault; +} + +export type ObjectTypePointers = { + [k: string]: PropertyDesc | LinkDesc; +}; + +export type stripBacklinks = { + [k in keyof T]: k extends `<${string}` ? never : T[k]; +}; + +export type omitBacklinks = + T extends `<${string}` ? never : T extends string ? T : never; + +export type stripNonUpdateables = { + [k in keyof T]: [T[k]["computed"]] extends [true] + ? never + : [T[k]["readonly"]] extends [true] + ? never + : k extends "__type__" + ? never + : k extends "id" + ? never + : T[k]; +}; + +export type stripNonInsertables = { + [k in keyof T]: [T[k]["computed"]] extends [true] + ? never + : [k] extends ["__type__"] + ? never + : T[k]; +}; + +type shapeElementToTs< + Pointer extends PropertyDesc | LinkDesc, + Element, + ParentTypeName extends string | null = null, +> = [Element] extends [true] + ? pointerToTsType + : [Element] extends [false] + ? never + : [Element] extends [boolean] + ? pointerToTsType | undefined + : Element extends TypeSet + ? setToTsType> + : Pointer extends LinkDesc + ? Element extends object + ? computeTsTypeCard< + typeutil.flatten< + ([ParentTypeName] extends [string] + ? Element extends { name: true } + ? { name: ParentTypeName } + : unknown + : unknown) & + computeObjectShape< + Pointer["target"]["__pointers__"] & Pointer["properties"], + Element, + (typeof future)["strictTypeNames"] extends true + ? Pointer["target"]["__polyTypenames__"] + : string + > + >, + Pointer["cardinality"] + > + : never + : never; + +// Element extends (scope: any) => any +// ? Pointer["target"] extends ObjectType +// ? computeObjectShape< +// Pointer["target"]["__pointers__"], +// ReturnType +// > +// : never +// : Element extends object +// ? Pointer["target"] extends ObjectType +// ? computeObjectShape +// : never +// : never; + +export type $expr_PolyShapeElement< + PolyType extends ObjectTypeSet = ObjectTypeSet, + ShapeElement = any, +> = { + __kind__: ExpressionKind.PolyShapeElement; + __polyType__: PolyType; + __shapeElement__: ShapeElement; +}; + +export type computeObjectShape< + Pointers extends ObjectTypePointers, + Shape, + TypeName extends string = string, +> = (typeof future)["polymorphismAsDiscriminatedUnions"] extends true + ? computeObjectShapeNew + : computeObjectShapeLegacy; + +type computeObjectShapeLegacy< + Pointers extends ObjectTypePointers, + Shape, + TypeName extends string, +> = typeutil.flatten< + keyof Shape extends never + ? { id: string } + : typeutil.stripNever<{ + [k in keyof Shape]: Shape[k] extends $expr_PolyShapeElement< + infer PolyType, + infer ShapeEl + > + ? [k] extends [keyof PolyType["__element__"]["__pointers__"]] + ? shapeElementToTs< + PolyType["__element__"]["__pointers__"][k], + ShapeEl, + k extends "__type__" ? TypeName : null + > | null + : never + : Shape[k] extends TypeSet + ? [k] extends [keyof Pointers] + ? Shape[k]["__cardinality__"] extends cardutil.assignable< + Pointers[k]["cardinality"] + > + ? setToTsType + : never + : setToTsType + : [k] extends [keyof Pointers] + ? shapeElementToTs< + Pointers[k], + Shape[k], + k extends "__type__" ? TypeName : null + > + : never; + }> +>; + +type computeObjectShapeNew< + Pointers extends ObjectTypePointers, + Shape, + TypeName extends string, +> = keyof Shape extends never + ? { id: string } + : typeutil.flatten< + typeutil.stripNever<{ + [k in keyof Shape as Shape[k] extends $expr_PolyShapeElement + ? never + : k]: Shape[k] extends TypeSet + ? [k] extends [keyof Pointers] + ? Shape[k]["__cardinality__"] extends cardutil.assignable< + Pointers[k]["cardinality"] + > + ? setToTsType + : never + : setToTsType + : [k] extends [keyof Pointers] + ? shapeElementToTs< + Pointers[k], + Shape[k], + k extends "__type__" ? TypeName : null + > + : never; + }> + > & + ({ + [k in keyof Shape as Shape[k] extends $expr_PolyShapeElement + ? k + : never]: Shape[k]; + } extends infer PolyEls + ? keyof PolyEls extends never + ? unknown + : getPolyElTypes extends infer PolyTypeName + ? + | (Exclude extends never + ? never + : { + __typename: Exclude; + }) + | computePolyElShape + : never + : never); + +type computePolyElShape = typeutil.flatten< + PolyTypeName extends string + ? { __typename: PolyTypeName } & { + [k in keyof PolyEls as PolyEls[k] extends $expr_PolyShapeElement + ? PolyTypeName extends PolyEls[k]["__polyType__"]["__element__"]["__polyTypenames__"] + ? k + : never + : never]: PolyEls[k] extends $expr_PolyShapeElement< + infer PolyType, + infer ShapeEl + > + ? [k] extends [keyof PolyType["__element__"]["__pointers__"]] + ? shapeElementToTs< + PolyType["__element__"]["__pointers__"][k], + ShapeEl, + k extends "__type__" ? PolyTypeName : null + > + : never + : never; + } extends infer Shape + ? Shape extends unknown + ? typeutil.stripNever + : never + : never + : never +>; + +type getPolyElTypes = El extends $expr_PolyShapeElement + ? El["__polyType__"]["__element__"]["__polyTypenames__"] + : never; + +export type PrimitiveType = + | ScalarType + | EnumType + | TupleType + | NamedTupleType + | ArrayType + | RangeType + | MultiRangeType; + +export type PrimitiveTypeSet = TypeSet; + +///////////////////////// +/// ARRAYTYPE +///////////////////////// + +type $arrayLikeIndexify = Set["__element__"] extends + | ArrayType + | ScalarType<"std::str"> + | ScalarType<"std::bytes"> + ? { + [index: number]: $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType< + Set["__element__"] extends ArrayType + ? El + : Set["__element__"] + >, + Set["__cardinality__"] + // > + >; + [slice: `${number}:${number | ""}` | `:${number}`]: $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + Set["__cardinality__"] + // > + >; + index> | number>( + index: T, + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType< + Set["__element__"] extends ArrayType + ? El + : Set["__element__"] + >, + cardutil.multiplyCardinalities< + Set["__cardinality__"], + T extends TypeSet ? T["__cardinality__"] : Cardinality.One + > + // > + >; + slice< + S extends TypeSet> | number, + E extends + | TypeSet> + | number + | undefined + | null, + >( + start: S, + end: E, + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + cardutil.multiplyCardinalities< + cardutil.multiplyCardinalities< + Set["__cardinality__"], + S extends TypeSet ? S["__cardinality__"] : Cardinality.One + >, + E extends TypeSet ? C : Cardinality.One + > + // > + >; + slice< + E extends + | TypeSet> + | number + | undefined + | null, + >( + start: undefined | null, + end: E, + ): $expr_Operator< + // "[]", + // OperatorKind.Infix, + // [Set, TypeSet], + // TypeSet< + getPrimitiveBaseType, + cardutil.multiplyCardinalities< + Set["__cardinality__"], + E extends TypeSet ? C : Cardinality.One + > + // > + >; + } + : unknown; +export type $expr_Array< + Type extends ArrayType = ArrayType, + Card extends Cardinality = Cardinality, + // Items extends typeutil.tupleOf> +> = Expression<{ + __kind__: ExpressionKind.Array; + __items__: typeutil.tupleOf>; + __element__: Type; + __cardinality__: Card; +}>; + +export interface ArrayType< + Element extends BaseType = BaseType, + Name extends string = `array<${Element["__name__"]}>`, +> extends BaseType { + __name__: Name; + __kind__: TypeKind.array; + __element__: Element; +} + +interface BaseArrayType extends BaseType { + __name__: string; + __kind__: TypeKind.array; + __element__: BaseType; +} + +///////////////////////// +/// TUPLE TYPE +///////////////////////// + +type $tuplePathify = Set["__element__"] extends TupleType + ? addTuplePaths + : Set["__element__"] extends NamedTupleType + ? addNamedTuplePaths< + Set["__element__"]["__shape__"], + Set["__cardinality__"] + > + : unknown; + +export type $expr_TuplePath< + ItemType extends BaseType = BaseType, + ParentCard extends Cardinality = Cardinality, +> = Expression<{ + __kind__: ExpressionKind.TuplePath; + __element__: ItemType; + __cardinality__: ParentCard; + __parent__: $expr_Tuple | $expr_NamedTuple | $expr_TuplePath; + __index__: string | number; +}>; + +export type baseTupleElementsToTupleType> = + { + [k in keyof T]: T[k] extends TypeSet + ? getPrimitiveBaseType + : never; + }; +export type tupleElementsToTupleType> = + baseTupleElementsToTupleType extends BaseTypeTuple + ? TupleType> + : never; + +export type baseTupleElementsToCardTuple = { + [k in keyof T]: T[k] extends TypeSet ? C : never; +}; + +export type tupleElementsToCardTuple = + baseTupleElementsToCardTuple extends [Cardinality, ...Cardinality[]] + ? baseTupleElementsToCardTuple + : never; + +export type $expr_Tuple< + Items extends typeutil.tupleOf = typeutil.tupleOf, +> = Expression<{ + __kind__: ExpressionKind.Tuple; + __items__: typeutil.tupleOf; + __element__: tupleElementsToTupleType; + __cardinality__: cardutil.multiplyCardinalitiesVariadic< + tupleElementsToCardTuple + >; +}>; + +export type indexKeys = T extends `${number}` ? T : never; + +type addTuplePaths = { + [k in indexKeys]: Items[k] extends BaseType + ? $expr_TuplePath + : never; +}; + +export interface TupleType + extends BaseType { + __name__: string; + __kind__: TypeKind.tuple; + __items__: Items; +} + +type TupleItemsToTsType< + Items extends BaseTypeTuple, + isParam extends boolean = false, +> = { + [k in keyof Items]: BaseTypeToTsType; +}; + +///////////////////////// +/// NAMED TUPLE TYPE +///////////////////////// +type literalShapeToType = NamedTupleType<{ + [k in keyof T]: getPrimitiveBaseType; +}>; +type shapeCardinalities = + Shape[keyof Shape]["__cardinality__"]; +type inferNamedTupleCardinality = [ + Cardinality.Many, +] extends [shapeCardinalities] + ? Cardinality.Many + : [Cardinality.Empty] extends [shapeCardinalities] + ? Cardinality.Empty + : [shapeCardinalities] extends [Cardinality.AtMostOne] + ? Cardinality.AtMostOne + : [shapeCardinalities] extends [ + Cardinality.AtMostOne | Cardinality.One, + ] + ? Cardinality.One + : Cardinality.Many; + +export type $expr_NamedTuple< + Shape extends NamedTupleLiteralShape = NamedTupleLiteralShape, +> = Expression<{ + __kind__: ExpressionKind.NamedTuple; + __element__: literalShapeToType; + __cardinality__: inferNamedTupleCardinality; + __shape__: Shape; +}>; + +type addNamedTuplePaths< + Shape extends NamedTupleShape, + ParentCard extends Cardinality, +> = { + [k in keyof Shape]: Shape[k] extends BaseType + ? $expr_TuplePath + : never; +}; + +export type NamedTupleLiteralShape = { [k: string]: TypeSet }; +export type NamedTupleShape = { [k: string]: BaseType }; +export interface NamedTupleType + extends BaseType { + __name__: string; + __kind__: TypeKind.namedtuple; + __shape__: Shape; +} + +type NamedTupleTypeToTsType< + Type extends NamedTupleType, + isParam extends boolean = false, + Shape extends NamedTupleShape = Type["__shape__"], +> = typeutil.flatten<{ + [k in keyof Shape]: BaseTypeToTsType; +}>; + +///////////////////////// +/// RANGE TYPE +///////////////////////// + +export interface RangeType< + Element extends ScalarType = ScalarType, + Name extends string = `range<${Element["__name__"]}>`, +> extends BaseType { + __name__: Name; + __kind__: TypeKind.range; + __element__: Element; +} + +///////////////////////// +/// MULTIRANGE TYPE +///////////////////////// + +export interface MultiRangeType< + Element extends ScalarType = ScalarType, + Name extends string = `multirange<${Element["__name__"]}>`, +> extends BaseType { + __name__: Name; + __kind__: TypeKind.multirange; + __element__: Element; +} + +///////////////////// +/// TSTYPE COMPUTATION +///////////////////// +export type orLiteralValue = + | Set + | (Set["__element__"] extends ObjectType + ? never + : computeTsType); + +type ScalarTypeToTsType< + T extends ScalarType, + isParam extends boolean, +> = isParam extends true ? T["__tsargtype__"] : T["__tsconsttype__"]; + +type ArrayTypeToTsType< + Type extends BaseArrayType, + isParam extends boolean, +> = isParam extends true + ? readonly BaseTypeToTsType[] + : BaseTypeToTsType[]; + +export type BaseTypeToTsType< + Type extends BaseType, + isParam extends boolean = false, +> = BaseType extends Type + ? unknown + : Type extends ScalarType + ? ScalarTypeToTsType + : Type extends EnumType + ? Type["__tstype__"] + : Type extends BaseArrayType + ? ArrayTypeToTsType + : Type extends RangeType + ? Range + : Type extends MultiRangeType + ? MultiRange + : Type extends TupleType + ? TupleItemsToTsType + : Type extends NamedTupleType + ? NamedTupleTypeToTsType + : Type extends ObjectType + ? computeObjectShape< + Type["__pointers__"], + Type["__shape__"], + (typeof future)["strictTypeNames"] extends true + ? Type["__polyTypenames__"] + : string + > + : never; + +export type setToTsType = + Set extends $Shape + ? Shape extends object + ? computeTsTypeCard< + computeObjectShape< + Element["__pointers__"], + normaliseShape, + (typeof future)["strictTypeNames"] extends true + ? Element["__polyTypenames__"] + : string //todo + >, + Card + > + : never + : Set extends TypeSet + ? computeTsType + : never; + +export type computeTsTypeCard = Cardinality extends C + ? unknown + : C extends Cardinality.Empty + ? null + : C extends Cardinality.One + ? T + : C extends Cardinality.AtLeastOne + ? [T, ...T[]] + : C extends Cardinality.AtMostOne + ? T | null + : C extends Cardinality.Many + ? T[] + : C extends Cardinality + ? unknown + : never; + +export type computeTsType< + T extends BaseType, + C extends Cardinality, +> = BaseType extends T ? unknown : computeTsTypeCard, C>; + +export type pointerToTsType< + El extends PropertyDesc | LinkDesc, + T extends BaseType = El["target"], + C extends Cardinality = El["cardinality"], +> = computeTsType; + +/////////////////// +// TYPE HELPERS +/////////////////// + +export type getPrimitiveBaseType = T extends ScalarType + ? ScalarType + : T; + +export type getPrimitiveNonArrayBaseType = + T extends ArrayType ? never : getPrimitiveBaseType; + +export function isScalarType(type: BaseType): type is ScalarType { + return type.__kind__ === TypeKind.scalar; +} +export function isEnumType(type: BaseType): type is EnumType { + return type.__kind__ === TypeKind.enum; +} +export function isObjectType(type: BaseType): type is ObjectType { + return type.__kind__ === TypeKind.object; +} +export function isTupleType(type: BaseType): type is TupleType { + return type.__kind__ === TypeKind.tuple; +} +export function isNamedTupleType(type: BaseType): type is NamedTupleType { + return type.__kind__ === TypeKind.namedtuple; +} +export function isArrayType(type: BaseType): type is ArrayType { + return type.__kind__ === TypeKind.array; +} + +export type NonArrayType = + | ScalarType + | EnumType + | ObjectType + | TupleType + | NamedTupleType + | RangeType + | MultiRangeType; + +export type AnyTupleType = TupleType | NamedTupleType; + +export type AnyObjectType = ObjectType; + +export type ParamType = + | ScalarType + | EnumType + | ArrayType< + | ScalarType + | TupleType> + | NamedTupleType<{ [k: string]: ParamType }> + | RangeType + | MultiRangeType + > + | TupleType> + | NamedTupleType<{ [k: string]: ParamType }> + | RangeType + | MultiRangeType; diff --git a/starters/features/gel/dbschema/edgeql-js/update.ts b/starters/features/gel/dbschema/edgeql-js/update.ts new file mode 100644 index 00000000000..9251a1b7b30 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/update.ts @@ -0,0 +1,138 @@ +// GENERATED by @gel/generate v0.6.4 + +import { + ExpressionKind, + type typeutil, + type Cardinality, +} from "gel/dist/reflection/index"; +import type { + Expression, + ObjectTypePointers, + TypeSet, + ObjectTypeSet, + stripBacklinks, + stripNonUpdateables, + ObjectTypeExpression, + ObjectType, + $scopify, +} from "./typesystem"; +import type { pointerToAssignmentExpression } from "./casting"; +import { $expressionify, $getScopedExpr, $assert_single } from "./path"; +import { + type SelectModifiers, + type NormalisedSelectModifiers, + type ComputeSelectCardinality, + $existingScopes, + $handleModifiers, +} from "./select"; +import { $normaliseInsertShape, type pointerIsOptional } from "./insert"; + +///////////////// +/// UPDATE +///////////////// + +export type $expr_Update< + El extends ObjectType = ObjectType, + Card extends Cardinality = Cardinality, + // Set extends TypeSet = TypeSet, + // Expr extends ObjectTypeSet = ObjectTypeSet, + // Shape extends UpdateShape = any +> = Expression<{ + __kind__: ExpressionKind.Update; + __element__: El; + __cardinality__: Card; + __expr__: TypeSet; + __shape__: any; + __modifiers__: NormalisedSelectModifiers; + __scope__: ObjectTypeExpression; +}>; + +export type UpdateShape = + typeutil.stripNever< + stripNonUpdateables> + > extends infer Shape + ? Shape extends ObjectTypePointers + ? { + [k in keyof Shape]?: + | ( + | pointerToAssignmentExpression + | (Shape[k]["cardinality"] extends + | Cardinality.Many + | Cardinality.AtLeastOne + ? + | { + "+=": pointerToAssignmentExpression; + } + | { + "-=": pointerToAssignmentExpression; + } + : never) + ) + | (pointerIsOptional extends true + ? undefined | null + : never); + } + : never + : never; + +export function update< + Expr extends ObjectTypeExpression, + Shape extends { + filter?: SelectModifiers["filter"]; + filter_single?: SelectModifiers["filter_single"]; + set: UpdateShape; + }, + // SetShape extends UpdateShape, + // Modifiers extends Pick +>( + expr: Expr, + shape: (scope: $scopify) => Readonly, +): $expr_Update> { + const cleanScopedExprs = $existingScopes.size === 0; + + const scope = $getScopedExpr(expr as any, $existingScopes); + + const resolvedShape = shape(scope); + + if (cleanScopedExprs) { + $existingScopes.clear(); + } + + const mods: any = {}; + let updateShape: any | null; + for (const [key, val] of Object.entries(resolvedShape)) { + if (key === "filter" || key === "filter_single") { + mods[key] = val; + } else if (key === "set") { + updateShape = val; + } else { + throw new Error( + `Invalid update shape key '${key}', only 'filter', 'filter_single', ` + + `and 'set' are allowed`, + ); + } + } + + if (!updateShape) { + throw new Error(`Update shape must contain 'set' shape`); + } + + const { modifiers, cardinality, needsAssertSingle } = $handleModifiers(mods, { + root: expr, + scope, + }); + + const updateExpr = { + __kind__: ExpressionKind.Update, + __element__: expr.__element__, + __cardinality__: cardinality, + __expr__: expr, + __shape__: $normaliseInsertShape(expr, updateShape, true), + __modifiers__: modifiers, + __scope__: scope, + } as any; + + return needsAssertSingle + ? $assert_single(updateExpr) + : $expressionify(updateExpr); +} diff --git a/starters/features/gel/dbschema/edgeql-js/with.ts b/starters/features/gel/dbschema/edgeql-js/with.ts new file mode 100644 index 00000000000..60cccae46b5 --- /dev/null +++ b/starters/features/gel/dbschema/edgeql-js/with.ts @@ -0,0 +1,73 @@ +// GENERATED by @gel/generate v0.6.4 + +import { type Cardinality, ExpressionKind } from "gel/dist/reflection/index"; +import type { BaseType, Expression, TypeSet } from "./typesystem"; +import type { $expr_Select } from "./select"; +import type { $expr_For } from "./for"; +import type { $expr_Insert, $expr_InsertUnlessConflict } from "./insert"; +import type { $expr_Update } from "./update"; +import type { $expr_Group } from "./group"; +import { $assert_single, $expressionify, $unwrap_assert_single } from "./path"; + +export type $expr_Alias< + El extends BaseType = BaseType, + Card extends Cardinality = Cardinality, +> = Expression<{ + __element__: El; + __cardinality__: Card; + __kind__: ExpressionKind.Alias; + __expr__: TypeSet; +}>; + +export function alias( + expr: Expr, +): $expr_Alias { + return $expressionify({ + __kind__: ExpressionKind.Alias, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __expr__: expr, + }) as any; +} + +export type WithableExpression = + | $expr_Select + | $expr_For + | $expr_Insert + | $expr_InsertUnlessConflict + | $expr_Update + | $expr_Group; + +export type $expr_With< + // Refs extends TypeSet[] = TypeSet[], + Expr extends WithableExpression = WithableExpression, +> = Expression<{ + __element__: Expr["__element__"]; + __cardinality__: Expr["__cardinality__"]; + __kind__: ExpressionKind.With; + __expr__: Expr; + __refs__: TypeSet[]; +}>; + +function _with( + refs: Expression[], + expr: Expr, +): $expr_With { + // handle case where e.select/e.update wraps their select/update expr in + // assert_single, for which we need to unwrap so refs are attached to the + // with block of the inner select/update expr, and then re-wrap the whole + // 'with' expr with assert_single + const unwrapped = $unwrap_assert_single(expr); + + const withExpr = $expressionify({ + __kind__: ExpressionKind.With, + __element__: expr.__element__, + __cardinality__: expr.__cardinality__, + __refs__: refs, + __expr__: (unwrapped ?? expr) as any, + }) as any; + + return unwrapped ? $assert_single(withExpr) : withExpr; +} + +export { _with as with }; diff --git a/starters/features/gel/dbschema/interfaces.ts b/starters/features/gel/dbschema/interfaces.ts new file mode 100644 index 00000000000..986ac1e198c --- /dev/null +++ b/starters/features/gel/dbschema/interfaces.ts @@ -0,0 +1,745 @@ +// GENERATED by @gel/generate v0.6.4 + +import type * as gel from "gel"; +export namespace std { + export interface BaseObject { + id: string; + } + export type Endian = "Little" | "Big"; + export interface FreeObject {} + export type JsonEmpty = + | "ReturnEmpty" + | "ReturnTarget" + | "Error" + | "UseNull" + | "DeleteKey"; + export interface $Object extends BaseObject {} + export namespace enc { + export type Base64Alphabet = "standard" | "urlsafe"; + } + export namespace fts { + export type ElasticLanguage = + | "ara" + | "bul" + | "cat" + | "ces" + | "ckb" + | "dan" + | "deu" + | "ell" + | "eng" + | "eus" + | "fas" + | "fin" + | "fra" + | "gle" + | "glg" + | "hin" + | "hun" + | "hye" + | "ind" + | "ita" + | "lav" + | "nld" + | "nor" + | "por" + | "ron" + | "rus" + | "spa" + | "swe" + | "tha" + | "tur" + | "zho" + | "edb_Brazilian" + | "edb_ChineseJapaneseKorean"; + export type Language = + | "ara" + | "hye" + | "eus" + | "cat" + | "dan" + | "nld" + | "eng" + | "fin" + | "fra" + | "deu" + | "ell" + | "hin" + | "hun" + | "ind" + | "gle" + | "ita" + | "nor" + | "por" + | "ron" + | "rus" + | "spa" + | "swe" + | "tur"; + export type LuceneLanguage = + | "ara" + | "ben" + | "bul" + | "cat" + | "ces" + | "ckb" + | "dan" + | "deu" + | "ell" + | "eng" + | "est" + | "eus" + | "fas" + | "fin" + | "fra" + | "gle" + | "glg" + | "hin" + | "hun" + | "hye" + | "ind" + | "ita" + | "lav" + | "lit" + | "nld" + | "nor" + | "por" + | "ron" + | "rus" + | "spa" + | "srp" + | "swe" + | "tha" + | "tur" + | "edb_Brazilian" + | "edb_ChineseJapaneseKorean" + | "edb_Indian"; + export type PGLanguage = + | "xxx_simple" + | "ara" + | "hye" + | "eus" + | "cat" + | "dan" + | "nld" + | "eng" + | "fin" + | "fra" + | "deu" + | "ell" + | "hin" + | "hun" + | "ind" + | "gle" + | "ita" + | "lit" + | "npi" + | "nor" + | "por" + | "ron" + | "rus" + | "srp" + | "spa" + | "swe" + | "tam" + | "tur" + | "yid"; + export type Weight = "A" | "B" | "C" | "D"; + } + export namespace net { + export type RequestFailureKind = "NetworkError" | "Timeout"; + export type RequestState = + | "Pending" + | "InProgress" + | "Completed" + | "Failed"; + export namespace http { + export type Method = + | "GET" + | "POST" + | "PUT" + | "DELETE" + | "HEAD" + | "OPTIONS" + | "PATCH"; + export interface Response extends std.BaseObject { + created_at: Date; + status?: number | null; + headers?: { name: string; value: string }[] | null; + body?: Uint8Array | null; + request?: ScheduledRequest | null; + } + export interface ScheduledRequest extends std.BaseObject { + state: std.net.RequestState; + created_at: Date; + updated_at: Date; + failure?: { kind: std.net.RequestFailureKind; message: string } | null; + url: string; + method: Method; + headers?: { name: string; value: string }[] | null; + body?: Uint8Array | null; + response?: Response | null; + } + } + } +} +export namespace cfg { + export interface ConfigObject extends std.BaseObject {} + export interface AbstractConfig extends ConfigObject { + default_transaction_access_mode: sys.TransactionAccessMode; + session_idle_timeout: gel.Duration; + default_transaction_isolation: sys.TransactionIsolation; + default_transaction_deferrable: sys.TransactionDeferrability; + session_idle_transaction_timeout: gel.Duration; + query_execution_timeout: gel.Duration; + listen_port: number; + listen_addresses: string[]; + current_email_provider_name?: string | null; + allow_dml_in_functions?: boolean | null; + allow_bare_ddl?: AllowBareDDL | null; + store_migration_sdl?: StoreMigrationSDL | null; + apply_access_policies?: boolean | null; + apply_access_policies_pg?: boolean | null; + allow_user_specified_id?: boolean | null; + simple_scoping?: boolean | null; + warn_old_scoping?: boolean | null; + cors_allow_origins: string[]; + auto_rebuild_query_cache?: boolean | null; + auto_rebuild_query_cache_timeout?: gel.Duration | null; + query_cache_mode?: QueryCacheMode | null; + http_max_connections?: number | null; + shared_buffers?: gel.ConfigMemory | null; + query_work_mem?: gel.ConfigMemory | null; + maintenance_work_mem?: gel.ConfigMemory | null; + effective_cache_size?: gel.ConfigMemory | null; + effective_io_concurrency?: number | null; + default_statistics_target?: number | null; + force_database_error?: string | null; + _pg_prepared_statement_cache_size: number; + track_query_stats?: QueryStatsOption | null; + extensions: ExtensionConfig[]; + auth: Auth[]; + email_providers: EmailProviderConfig[]; + } + export type AllowBareDDL = "AlwaysAllow" | "NeverAllow"; + export interface Auth extends ConfigObject { + priority: number; + user: string[]; + comment?: string | null; + method?: AuthMethod | null; + } + export interface AuthMethod extends ConfigObject { + transports: ConnectionTransport[]; + } + export interface DatabaseConfig extends AbstractConfig {} + export interface BranchConfig extends DatabaseConfig {} + export interface Config extends AbstractConfig {} + export type ConnectionTransport = + | "TCP" + | "TCP_PG" + | "HTTP" + | "SIMPLE_HTTP" + | "HTTP_METRICS" + | "HTTP_HEALTH"; + export interface EmailProviderConfig extends ConfigObject { + name: string; + } + export interface ExtensionConfig extends ConfigObject { + cfg: AbstractConfig; + } + export interface InstanceConfig extends AbstractConfig {} + export interface JWT extends AuthMethod { + transports: ConnectionTransport[]; + } + export interface Password extends AuthMethod { + transports: ConnectionTransport[]; + } + export type QueryCacheMode = "InMemory" | "RegInline" | "PgFunc" | "Default"; + export type QueryStatsOption = "None" | "All"; + export interface SCRAM extends AuthMethod { + transports: ConnectionTransport[]; + } + export interface SMTPProviderConfig extends EmailProviderConfig { + sender?: string | null; + host?: string | null; + port?: number | null; + username?: string | null; + password?: string | null; + security: SMTPSecurity; + validate_certs: boolean; + timeout_per_email: gel.Duration; + timeout_per_attempt: gel.Duration; + } + export type SMTPSecurity = + | "PlainText" + | "TLS" + | "STARTTLS" + | "STARTTLSOrPlainText"; + export type StoreMigrationSDL = "AlwaysStore" | "NeverStore"; + export interface Trust extends AuthMethod {} + export interface mTLS extends AuthMethod { + transports: ConnectionTransport[]; + } +} +export namespace sys { + export interface SystemObject extends schema.$Object {} + export interface ExternalObject extends SystemObject {} + export interface Branch extends ExternalObject, schema.AnnotationSubject { + name: string; + last_migration?: string | null; + } + export interface Database extends Branch {} + export interface ExtensionPackage + extends SystemObject, + schema.AnnotationSubject { + script: string; + version: { + major: number; + minor: number; + stage: VersionStage; + stage_no: number; + local: string[]; + }; + } + export interface ExtensionPackageMigration + extends SystemObject, + schema.AnnotationSubject { + script: string; + from_version: { + major: number; + minor: number; + stage: VersionStage; + stage_no: number; + local: string[]; + }; + to_version: { + major: number; + minor: number; + stage: VersionStage; + stage_no: number; + local: string[]; + }; + } + export type OutputFormat = "BINARY" | "JSON" | "JSON_ELEMENTS" | "NONE"; + export interface QueryStats extends ExternalObject { + query?: string | null; + query_type?: QueryType | null; + tag?: string | null; + compilation_config?: unknown | null; + protocol_version?: { major: number; minor: number } | null; + default_namespace?: string | null; + namespace_aliases?: unknown | null; + output_format?: OutputFormat | null; + expect_one?: boolean | null; + implicit_limit?: number | null; + inline_typeids?: boolean | null; + inline_typenames?: boolean | null; + inline_objectids?: boolean | null; + plans?: number | null; + total_plan_time?: gel.Duration | null; + min_plan_time?: gel.Duration | null; + max_plan_time?: gel.Duration | null; + mean_plan_time?: gel.Duration | null; + stddev_plan_time?: gel.Duration | null; + calls?: number | null; + total_exec_time?: gel.Duration | null; + min_exec_time?: gel.Duration | null; + max_exec_time?: gel.Duration | null; + mean_exec_time?: gel.Duration | null; + stddev_exec_time?: gel.Duration | null; + rows?: number | null; + stats_since?: Date | null; + minmax_stats_since?: Date | null; + branch?: Branch | null; + } + export type QueryType = "EdgeQL" | "SQL"; + export interface Role + extends SystemObject, + schema.InheritingObject, + schema.AnnotationSubject { + name: string; + superuser: boolean; + is_superuser: boolean; + password?: string | null; + member_of: Role[]; + } + export type TransactionAccessMode = "ReadOnly" | "ReadWrite"; + export type TransactionDeferrability = "Deferrable" | "NotDeferrable"; + export type TransactionIsolation = "RepeatableRead" | "Serializable"; + export type VersionStage = "dev" | "alpha" | "beta" | "rc" | "final"; +} +export namespace schema { + export type AccessKind = + | "Select" + | "UpdateRead" + | "UpdateWrite" + | "Delete" + | "Insert"; + export interface $Object extends std.BaseObject { + name: string; + internal: boolean; + builtin: boolean; + computed_fields?: string[] | null; + } + export interface SubclassableObject extends $Object { + abstract?: boolean | null; + is_abstract?: boolean | null; + final: boolean; + is_final: boolean; + } + export interface InheritingObject extends SubclassableObject { + inherited_fields?: string[] | null; + bases: InheritingObject[]; + ancestors: InheritingObject[]; + } + export interface AnnotationSubject extends $Object { + annotations: Annotation[]; + } + export interface AccessPolicy extends InheritingObject, AnnotationSubject { + access_kinds: AccessKind[]; + condition?: string | null; + action: AccessPolicyAction; + expr?: string | null; + errmessage?: string | null; + subject: ObjectType; + } + export type AccessPolicyAction = "Allow" | "Deny"; + export interface Alias extends AnnotationSubject { + expr: string; + type?: Type | null; + } + export interface Annotation extends InheritingObject, AnnotationSubject { + inheritable?: boolean | null; + } + export interface Type extends SubclassableObject, AnnotationSubject { + expr?: string | null; + from_alias?: boolean | null; + is_from_alias?: boolean | null; + } + export interface PrimitiveType extends Type {} + export interface CollectionType extends PrimitiveType {} + export interface Array extends CollectionType { + dimensions?: number[] | null; + element_type: Type; + } + export interface ArrayExprAlias extends Array {} + export interface CallableObject extends AnnotationSubject { + return_typemod?: TypeModifier | null; + params: Parameter[]; + return_type?: Type | null; + } + export type Cardinality = "One" | "Many"; + export interface VolatilitySubject extends $Object { + volatility?: Volatility | null; + } + export interface Cast extends AnnotationSubject, VolatilitySubject { + allow_implicit?: boolean | null; + allow_assignment?: boolean | null; + from_type?: Type | null; + to_type?: Type | null; + } + export interface ConsistencySubject + extends InheritingObject, + AnnotationSubject { + constraints: Constraint[]; + } + export interface Constraint extends CallableObject, InheritingObject { + expr?: string | null; + subjectexpr?: string | null; + finalexpr?: string | null; + errmessage?: string | null; + delegated?: boolean | null; + except_expr?: string | null; + subject?: ConsistencySubject | null; + params: Parameter[]; + } + export interface Delta extends $Object { + parents: Delta[]; + } + export interface Extension extends AnnotationSubject, $Object { + package: sys.ExtensionPackage; + } + export interface Function extends CallableObject, VolatilitySubject { + preserves_optionality?: boolean | null; + body?: string | null; + language: string; + used_globals: Global[]; + } + export interface FutureBehavior extends $Object {} + export interface Global extends AnnotationSubject { + default?: string | null; + required?: boolean | null; + cardinality?: Cardinality | null; + expr?: string | null; + target?: Type | null; + } + export interface Index extends InheritingObject, AnnotationSubject { + expr?: string | null; + except_expr?: string | null; + deferrability?: IndexDeferrability | null; + deferred?: boolean | null; + kwargs?: { name: string; expr: string }[] | null; + params: Parameter[]; + } + export type IndexDeferrability = "Prohibited" | "Permitted" | "Required"; + export interface Pointer extends ConsistencySubject, AnnotationSubject { + cardinality?: Cardinality | null; + required?: boolean | null; + readonly?: boolean | null; + default?: string | null; + expr?: string | null; + secret?: boolean | null; + source?: Source | null; + target?: Type | null; + rewrites: Rewrite[]; + } + export interface Source extends $Object { + pointers: Pointer[]; + indexes: Index[]; + } + export interface Link extends Pointer, Source { + on_target_delete?: TargetDeleteAction | null; + on_source_delete?: SourceDeleteAction | null; + target?: ObjectType | null; + properties: Property[]; + } + export interface Migration extends AnnotationSubject, $Object { + script: string; + sdl?: string | null; + message?: string | null; + generated_by?: MigrationGeneratedBy | null; + parents: Migration[]; + } + export type MigrationGeneratedBy = "DevMode" | "DDLStatement"; + export interface Module extends AnnotationSubject, $Object {} + export interface MultiRange extends CollectionType { + element_type: Type; + } + export interface MultiRangeExprAlias extends MultiRange {} + export interface ObjectType + extends Source, + ConsistencySubject, + InheritingObject, + Type, + AnnotationSubject { + compound_type: boolean; + is_compound_type: boolean; + union_of: ObjectType[]; + intersection_of: ObjectType[]; + links: Link[]; + properties: Property[]; + access_policies: AccessPolicy[]; + triggers: Trigger[]; + } + export interface Operator extends CallableObject, VolatilitySubject { + operator_kind?: OperatorKind | null; + is_abstract?: boolean | null; + abstract?: boolean | null; + } + export type OperatorKind = "Infix" | "Postfix" | "Prefix" | "Ternary"; + export interface Parameter extends $Object { + typemod: TypeModifier; + kind: ParameterKind; + num: number; + default?: string | null; + type: Type; + } + export type ParameterKind = + | "VariadicParam" + | "NamedOnlyParam" + | "PositionalParam"; + export interface Property extends Pointer {} + export interface PseudoType extends InheritingObject, Type {} + export interface Range extends CollectionType { + element_type: Type; + } + export interface RangeExprAlias extends Range {} + export interface Rewrite extends InheritingObject, AnnotationSubject { + kind: TriggerKind; + expr: string; + subject: Pointer; + } + export type RewriteKind = "Update" | "Insert"; + export interface ScalarType + extends PrimitiveType, + ConsistencySubject, + AnnotationSubject { + default?: string | null; + enum_values?: string[] | null; + arg_values?: string[] | null; + } + export type SourceDeleteAction = + | "DeleteTarget" + | "Allow" + | "DeleteTargetIfOrphan"; + export type TargetDeleteAction = + | "Restrict" + | "DeleteSource" + | "Allow" + | "DeferredRestrict"; + export interface Trigger extends InheritingObject, AnnotationSubject { + timing: TriggerTiming; + kinds: TriggerKind[]; + scope: TriggerScope; + expr?: string | null; + condition?: string | null; + subject: ObjectType; + } + export type TriggerKind = "Update" | "Delete" | "Insert"; + export type TriggerScope = "All" | "Each"; + export type TriggerTiming = "After" | "AfterCommitOf"; + export interface Tuple extends CollectionType { + named: boolean; + element_types: TupleElement[]; + } + export interface TupleElement extends std.BaseObject { + name?: string | null; + type: Type; + } + export interface TupleExprAlias extends Tuple {} + export type TypeModifier = "SetOfType" | "OptionalType" | "SingletonType"; + export type Volatility = "Immutable" | "Stable" | "Volatile" | "Modifying"; +} +export interface types { + std: { + BaseObject: std.BaseObject; + Endian: std.Endian; + FreeObject: std.FreeObject; + JsonEmpty: std.JsonEmpty; + Object: std.$Object; + enc: { + Base64Alphabet: std.enc.Base64Alphabet; + }; + fts: { + ElasticLanguage: std.fts.ElasticLanguage; + Language: std.fts.Language; + LuceneLanguage: std.fts.LuceneLanguage; + PGLanguage: std.fts.PGLanguage; + Weight: std.fts.Weight; + }; + net: { + RequestFailureKind: std.net.RequestFailureKind; + RequestState: std.net.RequestState; + http: { + Method: std.net.http.Method; + Response: std.net.http.Response; + ScheduledRequest: std.net.http.ScheduledRequest; + }; + }; + }; + cfg: { + ConfigObject: cfg.ConfigObject; + AbstractConfig: cfg.AbstractConfig; + AllowBareDDL: cfg.AllowBareDDL; + Auth: cfg.Auth; + AuthMethod: cfg.AuthMethod; + DatabaseConfig: cfg.DatabaseConfig; + BranchConfig: cfg.BranchConfig; + Config: cfg.Config; + ConnectionTransport: cfg.ConnectionTransport; + EmailProviderConfig: cfg.EmailProviderConfig; + ExtensionConfig: cfg.ExtensionConfig; + InstanceConfig: cfg.InstanceConfig; + JWT: cfg.JWT; + Password: cfg.Password; + QueryCacheMode: cfg.QueryCacheMode; + QueryStatsOption: cfg.QueryStatsOption; + SCRAM: cfg.SCRAM; + SMTPProviderConfig: cfg.SMTPProviderConfig; + SMTPSecurity: cfg.SMTPSecurity; + StoreMigrationSDL: cfg.StoreMigrationSDL; + Trust: cfg.Trust; + mTLS: cfg.mTLS; + }; + sys: { + SystemObject: sys.SystemObject; + ExternalObject: sys.ExternalObject; + Branch: sys.Branch; + Database: sys.Database; + ExtensionPackage: sys.ExtensionPackage; + ExtensionPackageMigration: sys.ExtensionPackageMigration; + OutputFormat: sys.OutputFormat; + QueryStats: sys.QueryStats; + QueryType: sys.QueryType; + Role: sys.Role; + TransactionAccessMode: sys.TransactionAccessMode; + TransactionDeferrability: sys.TransactionDeferrability; + TransactionIsolation: sys.TransactionIsolation; + VersionStage: sys.VersionStage; + }; + schema: { + AccessKind: schema.AccessKind; + Object: schema.$Object; + SubclassableObject: schema.SubclassableObject; + InheritingObject: schema.InheritingObject; + AnnotationSubject: schema.AnnotationSubject; + AccessPolicy: schema.AccessPolicy; + AccessPolicyAction: schema.AccessPolicyAction; + Alias: schema.Alias; + Annotation: schema.Annotation; + Type: schema.Type; + PrimitiveType: schema.PrimitiveType; + CollectionType: schema.CollectionType; + Array: schema.Array; + ArrayExprAlias: schema.ArrayExprAlias; + CallableObject: schema.CallableObject; + Cardinality: schema.Cardinality; + VolatilitySubject: schema.VolatilitySubject; + Cast: schema.Cast; + ConsistencySubject: schema.ConsistencySubject; + Constraint: schema.Constraint; + Delta: schema.Delta; + Extension: schema.Extension; + Function: schema.Function; + FutureBehavior: schema.FutureBehavior; + Global: schema.Global; + Index: schema.Index; + IndexDeferrability: schema.IndexDeferrability; + Pointer: schema.Pointer; + Source: schema.Source; + Link: schema.Link; + Migration: schema.Migration; + MigrationGeneratedBy: schema.MigrationGeneratedBy; + Module: schema.Module; + MultiRange: schema.MultiRange; + MultiRangeExprAlias: schema.MultiRangeExprAlias; + ObjectType: schema.ObjectType; + Operator: schema.Operator; + OperatorKind: schema.OperatorKind; + Parameter: schema.Parameter; + ParameterKind: schema.ParameterKind; + Property: schema.Property; + PseudoType: schema.PseudoType; + Range: schema.Range; + RangeExprAlias: schema.RangeExprAlias; + Rewrite: schema.Rewrite; + RewriteKind: schema.RewriteKind; + ScalarType: schema.ScalarType; + SourceDeleteAction: schema.SourceDeleteAction; + TargetDeleteAction: schema.TargetDeleteAction; + Trigger: schema.Trigger; + TriggerKind: schema.TriggerKind; + TriggerScope: schema.TriggerScope; + TriggerTiming: schema.TriggerTiming; + Tuple: schema.Tuple; + TupleElement: schema.TupleElement; + TupleExprAlias: schema.TupleExprAlias; + TypeModifier: schema.TypeModifier; + Volatility: schema.Volatility; + }; +} + +export namespace helper { + type LinkType = std.BaseObject | std.BaseObject[]; + + export type propertyKeys = { + [k in keyof T]: NonNullable extends LinkType ? never : k; + }[keyof T]; + + export type linkKeys = { + [k in keyof T]: NonNullable extends LinkType ? k : never; + }[keyof T]; + + export type Props = Pick>; + export type Links = Pick>; +} diff --git a/starters/features/gel/dbschema/migrations/00001-m1lsxf3.edgeql b/starters/features/gel/dbschema/migrations/00001-m1lsxf3.edgeql new file mode 100644 index 00000000000..1fb0fce3878 --- /dev/null +++ b/starters/features/gel/dbschema/migrations/00001-m1lsxf3.edgeql @@ -0,0 +1,23 @@ +CREATE MIGRATION m1lsxf35vjd6q2xigdqcpwqnstmu4g6hy734hlv46eoohih7bq2ttq + ONTO initial +{ + CREATE FUTURE simple_scoping; + CREATE ABSTRACT TYPE default::Timestamped { + CREATE PROPERTY last_updated: std::datetime { + CREATE REWRITE + INSERT + USING (std::datetime_of_statement()); + CREATE REWRITE + UPDATE + USING (std::datetime_of_statement()); + }; + }; + CREATE TYPE default::User EXTENDING default::Timestamped { + CREATE PROPERTY email: std::str { + CREATE CONSTRAINT std::exclusive; + }; + CREATE INDEX ON (.email); + CREATE PROPERTY has_profile: std::bool; + CREATE REQUIRED PROPERTY name: std::str; + }; +}; diff --git a/starters/features/gel/dbschema/queries.ts b/starters/features/gel/dbschema/queries.ts new file mode 100644 index 00000000000..02d11515414 --- /dev/null +++ b/starters/features/gel/dbschema/queries.ts @@ -0,0 +1,87 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel"; + +export type GetAllUsersReturns = Array<{ + id: string; + name: string; + email: string | null; + has_profile: boolean | null; + last_updated: Date | null; +}>; + +export function getAllUsers(client: Executor): Promise { + return client.query(`\ +select User { ** +}`); +} + +export type InsertUserArgs = { + readonly email: string; + readonly has_profile: boolean; + readonly name: string; +}; + +export type InsertUserReturns = { + name: string; + email: string | null; + has_profile: boolean | null; +} | null; + +export function insertUser( + client: Executor, + args: InsertUserArgs, +): Promise { + return client.querySingle( + `\ +select + ( + insert User { + name := $name, + email := $email, + has_profile := $has_profile, + } + unless conflict on .email + ) + { + name, + email, + has_profile + }`, + args, + ); +} + +export type GetUserArgs = { + readonly email?: string | null; + readonly name?: string | null; +}; + +export type GetUserReturns = Array<{ + id: string; + name: string; + email: string | null; + has_profile: boolean | null; + last_updated: Date | null; +}>; + +export function getUser( + client: Executor, + args: GetUserArgs, +): Promise { + return client.query( + `\ +select User { + ** +} +filter + ( + exists($name) and .name = $name + ) + or + ( + exists($email) and .email = $email + );`, + args, + ); +} diff --git a/starters/features/gel/gel.local.toml b/starters/features/gel/gel.local.toml new file mode 100644 index 00000000000..e306c5eebff --- /dev/null +++ b/starters/features/gel/gel.local.toml @@ -0,0 +1,165 @@ + +## ==== [ Instance configuration ] ==== + +## This file is applied with `gel init`. +## Generally, it should not be checked into source control. +## It can contain any configuration setting supported by your instance. +## Below is a list of most common and useful settings, commented-out. +## (note: you can embed EdgeQL expressions with {{ … }}) + +## ---- [ Generic config settings ] ---- + +[branch.config] + +# session_idle_transaction_timeout = "30 seconds" +# query_execution_timeout = "1 minute" + +## which SMTP provider to use by default (see the configuration example below) +# current_email_provider_name = "mailtrap_sandbox" + +## DDL & policy flags +# allow_dml_in_functions = false +# allow_bare_ddl = "NeverAllow" # "AlwaysAllow" | "NeverAllow" +# allow_user_specified_id = false +# warn_old_scoping = false + +## CORS & cache +# cors_allow_origins = ["http://localhost:8000", "http://127.0.0.1:8000"] +# auto_rebuild_query_cache = false +# auto_rebuild_query_cache_timeout = "30 seconds" + +# [instance.config] +# http_max_connections = 100 + +## Email providers (SMTP) +# [[branch.config."cfg::SMTPProviderConfig"]] +# name = "mailtrap_sandbox" +# sender = "hello@example.com" +# host = "sandbox.smtp.mailtrap.io" +# port = 2525 +# username = "YOUR_USERNAME" +# password = "YOUR_PASSWORD" +# timeout_per_email = "5 minutes" +# timeout_per_attempt = "1 minute" +# validate_certs = false + + +## ---- [ Auth ] ---- + +## To use these options, you must first enable `auth` extension in your schema. +## 1. Add `using extension auth;` to default.gel, +## 2. Run `gel migration create` +## 3. Run `gel migration apply` + +## general auth settings +# [branch.config."ext::auth::AuthConfig"] +# app_name = "My Project" +# logo_url = "https://localhost:8000/static/logo.png" +# dark_logo_url = "https://localhost:8000/static/darklogo.png" +# brand_color = "#0000FF" +# auth_signing_key = "__GENERATED_UUID__" +# token_time_to_live = "1 hour" +# allowed_redirect_urls = ["http://localhost:8000", "http://testserver"] + +## Email & Password Auth Provider +# [[branch.config."ext::auth::EmailPasswordProviderConfig"]] +# require_verification = false + +## Apple OAuth Provider +# [[branch.config."ext::auth::AppleOAuthProvider"]] +# client_id = "YOUR_APPLE_CLIENT_ID" +# secret = "YOUR_APPLE_SECRET" +# additional_scope = "email name" + +## Azure OAuth Provider +# [[branch.config."ext::auth::AzureOAuthProvider"]] +# client_id = "YOUR_AZURE_CLIENT_ID" +# secret = "YOUR_AZURE_SECRET" +# additional_scope = "openid profile email" + +## Discord OAuth Provider +# [[branch.config."ext::auth::DiscordOAuthProvider"]] +# client_id = "YOUR_DISCORD_CLIENT_ID" +# secret = "YOUR_DISCORD_SECRET" +# additional_scope = "identify email" + +## Slack OAuth Provider +# [[branch.config."ext::auth::SlackOAuthProvider"]] +# client_id = "YOUR_SLACK_CLIENT_ID" +# secret = "YOUR_SLACK_SECRET" +# additional_scope = "identity.basic identity.email" + +## GitHub OAuth Provider +# [[branch.config."ext::auth::GitHubOAuthProvider"]] +# client_id = "YOUR_GITHUB_CLIENT_ID" +# secret = "YOUR_GITHUB_SECRET" +# additional_scope = "read:user user:email" + +## Google OAuth Provider +# [[branch.config."ext::auth::GoogleOAuthProvider"]] +# client_id = "YOUR_GOOGLE_CLIENT_ID" +# secret = "YOUR_GOOGLE_SECRET" +# additional_scope = "openid email profile" + +## WebAuthn Provider +# [[branch.config."ext::auth::WebAuthnProviderConfig"]] +# relying_party_origin = "https://example.com" +# require_verification = true + +## Magic Link Provider +# [[branch.config."ext::auth::MagicLinkProviderConfig"]] +# token_time_to_live = "15 minutes" + +## UI customization +# [branch.config."ext::auth::UIConfig"] +# redirect_to = "http://localhost:8000/auth/callback" +# redirect_to_on_signup = "http://localhost:8000/auth/callback?isSignUp=true" + +## Webhooks (ext::auth::WebhookConfig) +# [[branch.config."ext::auth::WebhookConfig"]] +# url = "https://example.com/webhook" +# events = ["IdentityCreated", "EmailVerified"] +# signing_secret_key = "YOUR_WEBHOOK_SECRET" + + +## ---- [ AI ] ---- + +## To use these options, you must first enable `ai` extension in your schema. +## 1. Add `using extension ai;` to default.gel, +## 2. Run `gel migration create` +## 3. Run `gel migration apply` + +# [branch.config."ext::ai::Config"] +# indexer_naptime = "5 minutes" + +## OpenAI Provider +# [[branch.config."ext::ai::OpenAIProviderConfig"]] +# api_url = "https://api.openai.com/v1" +# secret = "YOUR_API_KEY" +# client_id = "optional_client_id" + +## Anthropic Provider +# [[branch.config."ext::ai::AnthropicProviderConfig"]] +# api_url = "https://api.anthropic.com/v1" +# secret = "YOUR_API_KEY" +# client_id = "optional_client_id" + +## Mistral Provider +# [[branch.config."ext::ai::MistralProviderConfig"]] +# api_url = "https://api.mistral.ai/v1" +# secret = "YOUR_API_KEY" +# client_id = "optional_client_id" + +## Ollama Provider +# [[branch.config."ext::ai::OllamaProviderConfig"]] +# api_url = "http://localhost:11434/api" +# client_id = "optional_client_id" + +## Example custom provider: Google Gemini via OpenAI-compatible API +# [[branch.config."ext::ai::CustomProviderConfig"]] +# api_url = "https://generativelanguage.googleapis.com/v1beta/openai" +# secret = "YOUR_GEMINI_API_KEY" +# client_id = "YOUR_GEMINI_CLIENT_ID" +# api_style = "OpenAI" # "OpenAI" | "Anthropic" | "Ollama" +# name = "google_gemini" +# display_name = "Google Gemini" diff --git a/starters/features/gel/package.json b/starters/features/gel/package.json index 16bfa82a4cd..7839fc3d16c 100644 --- a/starters/features/gel/package.json +++ b/starters/features/gel/package.json @@ -12,13 +12,19 @@ " Gel was installed with a simple DB schema and some demo routes,", "", "", + "TO GET STARTED!!", "", - " Run `npm run gel:ui` to access the Gel UI and see the database schema.", - "Other useful commands are:", - " - `npm run gel:migrate` to create and run migrations", - " - `npm run gel:generate:all` to generate queries, types, and query builders", - " - `npm run gel:generate:queries` to generate queries", - " - `npm run gel:generate:types` to generate types and query builders", + " #1: Run `pnpm run gel:ui` to access the Gel UI and see the database schema.", + "", + " #2: Run `pnpm run dev` to start the development server to see the demo routes.", + "", + "Other useful commands are: ", + "", + " - `pnpm gel:migrate` to create and run migrations", + "", + " - `pnpm gel:generate:queries` to generate your edgeql queries into js files", + "", + " - `pnpm gel:generate:types` to generate interfaces and edgeql-js query builders", "", " Check out the Gel docs for more info:", " - https://www.geldata.com/docs/overview" @@ -29,8 +35,8 @@ "gel:migrate": "gel migration create && gel migrate ", "gel:generate:queries": "generate queries && generate queries --file", "gel:generate:types": "generate interfaces && generate edgeql-js", - "gel:generate:all": "gel:generate:queries && gel:generate:types", - "gel:ui": "gel ui" + "gel:ui": "gel ui", + "postinstall": "gel init" }, "dependencies": { "@gel/generate": "^0.6.4", diff --git a/starters/features/gel/queries/.gitkeep b/starters/features/gel/queries/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/starters/features/gel/queries/deleteUser.edgeql b/starters/features/gel/queries/deleteUser.edgeql deleted file mode 100644 index 37a66104bda..00000000000 --- a/starters/features/gel/queries/deleteUser.edgeql +++ /dev/null @@ -1,6 +0,0 @@ -delete User -filter - ( - (assert_exists(User.name) ?= $name) ?? - (assert_exists(User.email) ?= $email) - ); diff --git a/starters/features/gel/queries/getAllUsers.query.ts b/starters/features/gel/queries/getAllUsers.query.ts new file mode 100644 index 00000000000..2094c583a60 --- /dev/null +++ b/starters/features/gel/queries/getAllUsers.query.ts @@ -0,0 +1,17 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel"; + +export type GetAllUsersReturns = Array<{ + id: string; + name: string; + email: string | null; + has_profile: boolean | null; + last_updated: Date | null; +}>; + +export function getAllUsers(client: Executor): Promise { + return client.query(`\ +select User { ** +}`); +} diff --git a/starters/features/gel/queries/getUser.query.ts b/starters/features/gel/queries/getUser.query.ts new file mode 100644 index 00000000000..582ebb3a2d3 --- /dev/null +++ b/starters/features/gel/queries/getUser.query.ts @@ -0,0 +1,37 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel"; + +export type GetUserArgs = { + readonly email?: string | null; + readonly name?: string | null; +}; + +export type GetUserReturns = Array<{ + id: string; + name: string; + email: string | null; + has_profile: boolean | null; + last_updated: Date | null; +}>; + +export function getUser( + client: Executor, + args: GetUserArgs, +): Promise { + return client.query( + `\ +select User { + ** +} +filter + ( + exists($name) and .name = $name + ) + or + ( + exists($email) and .email = $email + );`, + args, + ); +} diff --git a/starters/features/gel/queries/insertOrUpdateUser.edgeql b/starters/features/gel/queries/insertOrUpdateUser.edgeql deleted file mode 100644 index 1d1b4233882..00000000000 --- a/starters/features/gel/queries/insertOrUpdateUser.edgeql +++ /dev/null @@ -1,28 +0,0 @@ -with - NewUser := ( - insert User { - name := $name, - email := $email, - has_profile := $has_profile, - } - unless conflict on .name - else ( - update User - filter .name = $name - set { - email := $email, - has_profile := $has_profile, - } - ) - unless conflict on .email - else ( - update User - filter .email = $email - set { - name := $name, - has_profile := $has_profile, - } - ) - ) - -select NewUser { ** }; diff --git a/starters/features/gel/queries/insertUser.edgeql b/starters/features/gel/queries/insertUser.edgeql new file mode 100644 index 00000000000..2b552f37080 --- /dev/null +++ b/starters/features/gel/queries/insertUser.edgeql @@ -0,0 +1,14 @@ +select + ( + insert User { + name := $name, + email := $email, + has_profile := $has_profile, + } + unless conflict on .email + ) + { + name, + email, + has_profile + } diff --git a/starters/features/gel/queries/insertUser.query.ts b/starters/features/gel/queries/insertUser.query.ts new file mode 100644 index 00000000000..b5c9ace2fd9 --- /dev/null +++ b/starters/features/gel/queries/insertUser.query.ts @@ -0,0 +1,39 @@ +// GENERATED by @gel/generate v0.6.4 + +import type { Executor } from "gel"; + +export type InsertUserArgs = { + readonly email: string; + readonly has_profile: boolean; + readonly name: string; +}; + +export type InsertUserReturns = { + name: string; + email: string | null; + has_profile: boolean | null; +} | null; + +export function insertUser( + client: Executor, + args: InsertUserArgs, +): Promise { + return client.querySingle( + `\ +select + ( + insert User { + name := $name, + email := $email, + has_profile := $has_profile, + } + unless conflict on .email + ) + { + name, + email, + has_profile + }`, + args, + ); +} diff --git a/starters/features/gel/src/.gitkeep b/starters/features/gel/src/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/starters/features/gel/src/actions/user/.gitkeep b/starters/features/gel/src/actions/user/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/starters/features/gel/src/actions/user/index.ts b/starters/features/gel/src/actions/user/index.ts index 32289dfd755..9b953002496 100644 --- a/starters/features/gel/src/actions/user/index.ts +++ b/starters/features/gel/src/actions/user/index.ts @@ -7,22 +7,19 @@ export const getAllUsers = server$(async () => { }); export const getUserByName = server$(async (name: string) => { - return await executeQuery(queries.getUserByName, { name: name }); + return await executeQuery(queries.getUser, { name: name }); }); export const getUserByEmail = server$(async (email: string) => { - return await executeQuery(queries.getUserByEmail, { email: email }); + return await executeQuery(queries.getUser, { email: email }); }); -export const deleteUser = server$(async (name: string) => { - return await executeQuery(queries.deleteUser, { name: name }); -}); - -export const insertOrUpdateUser = server$( - async (name: string, email: string) => { - return await executeQuery(queries.insertOrUpdateUser, { +export const insertUser = server$( + async (name: string, email: string, has_profile: boolean) => { + return await executeQuery(queries.insertUser, { name: name, email: email, + has_profile: has_profile, }); }, ); diff --git a/starters/features/gel/src/hooks/.gitkeep b/starters/features/gel/src/hooks/.gitkeep deleted file mode 100644 index e69de29bb2d..00000000000 diff --git a/starters/features/gel/src/hooks/user.hooks.ts b/starters/features/gel/src/hooks/user.hooks.ts deleted file mode 100644 index 90a74ec77af..00000000000 --- a/starters/features/gel/src/hooks/user.hooks.ts +++ /dev/null @@ -1,53 +0,0 @@ -import { useSignal, useTask$ } from "@builder.io/qwik"; -import { - getAllUsers, - getUserByEmail, - getUserByName, - deleteUser, - insertOrUpdateUser, -} from "../actions/user"; - -export const useGetUsers = () => { - const signal = useSignal>>([]); - useTask$(async () => { - const result = await getAllUsers(); - signal.value = result; - }); - return signal; -}; - -export const useGetUserByName = (name: string) => { - const signal = useSignal>>([]); - useTask$(async () => { - const result = await getUserByName(name); - signal.value = result; - }); - return signal; -}; - -export const useGetUserByEmail = (email: string) => { - const signal = useSignal>>([]); - useTask$(async () => { - const result = await getUserByEmail(email); - signal.value = result; - }); - return signal; -}; - -export const useDeleteUser = (name: string) => { - const signal = useSignal>>([]); - useTask$(async () => { - const result = await deleteUser(name); - signal.value = result; - }); - return signal; -}; - -export const useCreateOrUpdateUser = (name: string, email: string) => { - const signal = useSignal>>([]); - useTask$(async () => { - const result = await insertOrUpdateUser(name, email); - signal.value = result; - }); - return signal; -}; diff --git a/starters/features/gel/src/routes/create/index.tsx b/starters/features/gel/src/routes/create/index.tsx index a11eb0f4f3e..32e23115cc3 100644 --- a/starters/features/gel/src/routes/create/index.tsx +++ b/starters/features/gel/src/routes/create/index.tsx @@ -1,57 +1,57 @@ import { component$ } from "@builder.io/qwik"; import { routeAction$, zod$, z, Form } from "@builder.io/qwik-city"; -import { executeQuery } from "../../actions/client"; -import * as queries from "../../../dbschema/queries"; +import { insertUser } from "../../actions/user"; export const useCreateUser = routeAction$( - async (data) => { - // GEL implementation: use EdgeQL query to insert or update user - // Map form data to EdgeQL parameters - const params = { - name: data.name, - package_version: "", // You may want to collect this from the form or set a default - has_profile: true, // You may want to collect this from the form or set a default - dependencies: [ - { - address: data.email, - provider: "email", // You may want to collect this from the form or set a default - }, - ], - }; - const user = await executeQuery(queries.insertOrUpdateUser, params); - return user; + async ({ name, email }) => { + const user = await insertUser(name, email, true); + if (!user) + return { error: "A user already exists with that email.", user: null }; + return { error: null, user }; }, zod$({ - name: z.string(), - email: z.string().email(), + name: z.string().min(1, { message: "Name is required" }), + email: z.string().email({ message: "Invalid email address" }), }), ); export default component$(() => { - const createUserAction = useCreateUser(); + const action = useCreateUser(); + const errors = action.value?.fieldErrors; + const customError = action.value?.error; + return (

    Create User

    -
    +
    - {createUserAction.value && ( -
    -

    User created successfully!

    + {action.value?.user &&

    User created successfully!

    } + {(errors || customError) && ( +
    + {errors?.name && ( +
    +

    {errors.name}

    +
    + )} + {errors?.email && ( +
    +

    {errors.email}

    +
    + )} + {customError && ( +
    +

    {customError}

    +
    + )}
    )}
    diff --git a/starters/features/gel/src/routes/index.tsx b/starters/features/gel/src/routes/index.tsx index b111ffda80e..43bb63dbd39 100644 --- a/starters/features/gel/src/routes/index.tsx +++ b/starters/features/gel/src/routes/index.tsx @@ -10,6 +10,7 @@ export default component$(() => {
    Happy coding. +

    Get started with Gel