@eventmodelers/node-kit 0.0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -0
- package/package.json +36 -0
- package/src/cli.js +176 -0
- package/templates/.claude/skills/connect/SKILL.md +169 -0
- package/templates/.claude/skills/load-slice/SKILL.md +86 -0
- package/templates/realtime-agent/node_modules/.package-lock.json +107 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/LICENSE +21 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/README.md +190 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js +7 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthAdminApi.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js +7 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/AuthClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts +716 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js +1108 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueAdminApi.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts +2473 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js +5217 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/GoTrueClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts +9 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js +20 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts +76 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js +269 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/base64url.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts +26 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js +31 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/constants.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js +3 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/error-codes.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts +258 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js +290 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/errors.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts +54 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js +200 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/fetch.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts +94 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js +406 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/helpers.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts +9 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js +21 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/local-storage.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts +107 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js +349 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/locks.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js +29 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/polyfills.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts +2498 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js +23 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js +11 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts +96 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js +66 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/ethereum.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts +160 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/web3/solana.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts +284 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts +583 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.dom.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts +85 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js +272 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.errors.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js +707 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/main/lib/webauthn.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthAdminApi.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js +4 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/AuthClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts +716 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js +1105 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueAdminApi.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts +2473 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js +5214 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/GoTrueClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts +9 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js +9 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts +76 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js +257 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/base64url.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts +26 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js +28 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/constants.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js +2 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/error-codes.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts +258 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js +267 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/errors.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts +54 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js +190 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/fetch.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts +94 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js +378 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/helpers.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts +9 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js +18 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/local-storage.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts +107 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js +341 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/locks.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js +26 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/polyfills.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts +2498 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js +20 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js +8 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts +96 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js +60 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/ethereum.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts +160 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js +3 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/web3/solana.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts +284 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts +583 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js +3 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.dom.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts +85 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js +264 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.errors.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js +689 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/module/lib/webauthn.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.module.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/dist/tsconfig.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/package.json +44 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthAdminApi.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/AuthClient.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueAdminApi.ts +1267 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/GoTrueClient.ts +6360 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/index.ts +13 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/base64url.ts +308 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/constants.ts +34 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/error-codes.ts +90 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/errors.ts +359 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/fetch.ts +320 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/helpers.ts +476 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/local-storage.ts +21 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/locks.ts +420 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/polyfills.ts +23 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/types.ts +2917 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/version.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/ethereum.ts +184 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/web3/solana.ts +186 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.dom.ts +636 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.errors.ts +329 -0
- package/templates/realtime-agent/node_modules/@supabase/auth-js/src/lib/webauthn.ts +946 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/README.md +134 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts +177 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js +309 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/FunctionsClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts +3 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js +11 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/helper.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts +3 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js +12 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts +122 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js +98 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js +11 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/main/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts +177 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js +305 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/FunctionsClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts +3 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js +7 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/helper.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts +3 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js +3 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts +122 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js +91 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js +8 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/module/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.module.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/dist/tsconfig.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/package.json +52 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/FunctionsClient.ts +335 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/edge-runtime.d.ts +214 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/helper.ts +8 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/index.ts +10 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/types.ts +146 -0
- package/templates/realtime-agent/node_modules/@supabase/functions-js/src/version.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/LICENSE.md +22 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/README.md +121 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/ajax.js +116 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/channel.js +331 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/constants.js +35 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/index.js +212 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/longpoll.js +192 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/presence.js +208 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/push.js +134 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/serializer.js +133 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/socket.js +756 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/timer.js +48 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/types.js +184 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/assets/js/phoenix/utils.js +16 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/package.json +58 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/favicon.ico +0 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix-orange.png +0 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js +1825 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.cjs.js.map +7 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.js +1847 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.min.js +2 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs +1802 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.mjs.map +7 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/phoenix.png +0 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts +10 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/ajax.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts +167 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/channel.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts +36 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/constants.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts +10 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts +29 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/longpoll.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts +107 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/presence.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts +70 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/push.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts +74 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/serializer.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts +291 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/socket.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts +36 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/timer.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts +280 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/priv/static/types/utils.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/phoenix/tsconfig.json +20 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/README.md +213 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs +5025 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.cjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts +3828 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.cts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts +3828 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.d.mts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs +5017 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/dist/index.mjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/package.json +69 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestBuilder.ts +688 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestClient.ts +447 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestError.ts +41 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestFilterBuilder.ts +2137 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestQueryBuilder.ts +1703 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/PostgrestTransformBuilder.ts +981 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/constants.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/index.ts +34 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/parser.ts +476 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/result.ts +550 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/types.ts +129 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/select-query-parser/utils.ts +704 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/common.ts +83 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/common/rpc.ts +148 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/feature-flags.ts +17 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/types/types.ts +161 -0
- package/templates/realtime-agent/node_modules/@supabase/postgrest-js/src/version.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/README.md +326 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts +442 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js +719 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeChannel.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts +275 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js +697 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimeClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts +62 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js +43 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/RealtimePresence.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts +6 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js +18 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts +43 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js +43 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/constants.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts +10 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js +29 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/normalizeChannelError.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts +33 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js +155 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/serializer.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts +109 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js +241 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/transformers.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js +11 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts +82 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js +130 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/lib/websocket-factory.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts +32 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js +103 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/channelAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts +53 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js +93 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/presenceAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts +38 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js +114 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/socketAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js +3 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/main/phoenix/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts +442 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js +714 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeChannel.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts +275 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js +693 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimeClient.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts +62 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js +38 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/RealtimePresence.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts +6 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js +6 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/index.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts +43 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js +40 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/constants.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts +10 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js +26 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/normalizeChannelError.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts +33 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js +152 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/serializer.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts +109 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js +229 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/transformers.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts +2 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js +8 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/version.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts +82 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js +126 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/lib/websocket-factory.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts +32 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js +100 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/channelAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts +53 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js +90 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/presenceAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts +38 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js +111 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/socketAdapter.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts +5 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.d.ts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js +2 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/module/phoenix/types.js.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.module.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/dist/tsconfig.tsbuildinfo +1 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/package.json +58 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeChannel.ts +1118 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimeClient.ts +868 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/RealtimePresence.ts +71 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/index.ts +53 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/constants.ts +62 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/normalizeChannelError.ts +30 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/serializer.ts +203 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/transformers.ts +270 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/version.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/lib/websocket-factory.ts +204 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/channelAdapter.ts +149 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/presenceAdapter.ts +116 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/socketAdapter.ts +168 -0
- package/templates/realtime-agent/node_modules/@supabase/realtime-js/src/phoenix/types.ts +32 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/README.md +1262 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs +2995 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.cjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts +2956 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.cts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts +2956 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.d.mts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs +2979 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/index.mjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/dist/umd/supabase.js +1 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/package.json +62 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/StorageClient.ts +98 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/index.ts +19 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/BaseApiClient.ts +104 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/errors.ts +160 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/fetch.ts +303 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/headers.ts +43 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/common/helpers.ts +146 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/constants.ts +4 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/types.ts +654 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/lib/version.ts +7 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/BlobDownloadBuilder.ts +62 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageAnalyticsClient.ts +420 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageBucketApi.ts +414 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageFileApi.ts +1423 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StorageVectorsClient.ts +644 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/StreamDownloadBuilder.ts +39 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorBucketApi.ts +73 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorDataApi.ts +98 -0
- package/templates/realtime-agent/node_modules/@supabase/storage-js/src/packages/VectorIndexApi.ts +90 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/README.md +238 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs +89 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.cjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts +58 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.cts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts +58 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.d.mts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs +88 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/cors.mjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs +660 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.cjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts +616 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.cts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts +616 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.d.mts.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs +607 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/index.mjs.map +1 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/dist/umd/supabase.js +24 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/package.json +122 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/SupabaseClient.ts +625 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/cors.ts +84 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/index.ts +106 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/SupabaseAuthClient.ts +8 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/constants.ts +35 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/fetch.ts +36 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/helpers.ts +98 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/common.ts +93 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/rest/types/common/rpc.ts +158 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/types.ts +196 -0
- package/templates/realtime-agent/node_modules/@supabase/supabase-js/src/lib/version.ts +7 -0
- package/templates/realtime-agent/node_modules/iceberg-js/LICENSE +21 -0
- package/templates/realtime-agent/node_modules/iceberg-js/README.md +439 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs +596 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.cjs.map +1 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.cts +547 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.d.ts +547 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs +587 -0
- package/templates/realtime-agent/node_modules/iceberg-js/dist/index.mjs.map +1 -0
- package/templates/realtime-agent/node_modules/iceberg-js/package.json +77 -0
- package/templates/realtime-agent/node_modules/tslib/CopyrightNotice.txt +15 -0
- package/templates/realtime-agent/node_modules/tslib/LICENSE.txt +12 -0
- package/templates/realtime-agent/node_modules/tslib/README.md +164 -0
- package/templates/realtime-agent/node_modules/tslib/SECURITY.md +41 -0
- package/templates/realtime-agent/node_modules/tslib/modules/index.d.ts +38 -0
- package/templates/realtime-agent/node_modules/tslib/modules/index.js +70 -0
- package/templates/realtime-agent/node_modules/tslib/modules/package.json +3 -0
- package/templates/realtime-agent/node_modules/tslib/package.json +47 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.d.ts +460 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.es6.html +1 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.es6.js +402 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.es6.mjs +401 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.html +1 -0
- package/templates/realtime-agent/node_modules/tslib/tslib.js +484 -0
- package/templates/realtime-agent/package-lock.json +114 -0
- package/templates/realtime-agent/package.json +11 -0
- package/templates/realtime-agent/src/index.js +152 -0
- package/templates/root/AGENT.md +37 -0
- package/templates/root/model.md +1 -0
- package/templates/root/prompt.md +91 -0
- package/templates/root/ralph.sh +47 -0
|
@@ -0,0 +1,704 @@
|
|
|
1
|
+
import { Ast } from './parser'
|
|
2
|
+
import {
|
|
3
|
+
AggregateFunctions,
|
|
4
|
+
ContainsNull,
|
|
5
|
+
GenericRelationship,
|
|
6
|
+
GenericSchema,
|
|
7
|
+
GenericTable,
|
|
8
|
+
IsNonEmptyArray,
|
|
9
|
+
TablesAndViews,
|
|
10
|
+
UnionToArray,
|
|
11
|
+
GenericFunction,
|
|
12
|
+
GenericSetofOption,
|
|
13
|
+
} from './types'
|
|
14
|
+
|
|
15
|
+
export type IsAny<T> = 0 extends 1 & T ? true : false
|
|
16
|
+
|
|
17
|
+
export type SelectQueryError<Message extends string> = { error: true } & Message
|
|
18
|
+
|
|
19
|
+
/*
|
|
20
|
+
** Because of pg-meta types generation there is some cases where a same relationship can be duplicated
|
|
21
|
+
** if the relation is across schemas and views this ensure that we dedup those relations and treat them
|
|
22
|
+
** as postgrest would.
|
|
23
|
+
** This is no longer the case and has been patched here: https://github.com/supabase/postgres-meta/pull/809
|
|
24
|
+
** But we still need this for retro-compatibilty with older generated types
|
|
25
|
+
** TODO: Remove this in next major version
|
|
26
|
+
*/
|
|
27
|
+
export type DeduplicateRelationships<T extends readonly unknown[]> = T extends readonly [
|
|
28
|
+
infer First,
|
|
29
|
+
...infer Rest,
|
|
30
|
+
]
|
|
31
|
+
? First extends Rest[number]
|
|
32
|
+
? DeduplicateRelationships<Rest extends readonly unknown[] ? Rest : []>
|
|
33
|
+
: [First, ...DeduplicateRelationships<Rest extends readonly unknown[] ? Rest : []>]
|
|
34
|
+
: T
|
|
35
|
+
|
|
36
|
+
export type GetFieldNodeResultName<Field extends Ast.FieldNode> = Field['alias'] extends string
|
|
37
|
+
? Field['alias']
|
|
38
|
+
: Field['aggregateFunction'] extends AggregateFunctions
|
|
39
|
+
? Field['aggregateFunction']
|
|
40
|
+
: Field['name']
|
|
41
|
+
|
|
42
|
+
type FilterRelationNodes<Nodes extends Ast.Node[]> = UnionToArray<
|
|
43
|
+
{
|
|
44
|
+
[K in keyof Nodes]: Nodes[K] extends Ast.SpreadNode
|
|
45
|
+
? Nodes[K]['target']
|
|
46
|
+
: Nodes[K] extends Ast.FieldNode
|
|
47
|
+
? IsNonEmptyArray<Nodes[K]['children']> extends true
|
|
48
|
+
? Nodes[K]
|
|
49
|
+
: never
|
|
50
|
+
: never
|
|
51
|
+
}[number]
|
|
52
|
+
>
|
|
53
|
+
|
|
54
|
+
type ResolveRelationships<
|
|
55
|
+
Schema extends GenericSchema,
|
|
56
|
+
RelationName extends string,
|
|
57
|
+
Relationships extends GenericRelationship[],
|
|
58
|
+
Nodes extends Ast.FieldNode[],
|
|
59
|
+
> = UnionToArray<{
|
|
60
|
+
[K in keyof Nodes]: Nodes[K] extends Ast.FieldNode
|
|
61
|
+
? ResolveRelationship<Schema, Relationships, Nodes[K], RelationName> extends infer Relation
|
|
62
|
+
? Relation extends {
|
|
63
|
+
relation: {
|
|
64
|
+
referencedRelation: string
|
|
65
|
+
foreignKeyName: string
|
|
66
|
+
match: string
|
|
67
|
+
}
|
|
68
|
+
from: string
|
|
69
|
+
}
|
|
70
|
+
? {
|
|
71
|
+
referencedTable: Relation['relation']['referencedRelation']
|
|
72
|
+
fkName: Relation['relation']['foreignKeyName']
|
|
73
|
+
from: Relation['from']
|
|
74
|
+
match: Relation['relation']['match']
|
|
75
|
+
fieldName: GetFieldNodeResultName<Nodes[K]>
|
|
76
|
+
}
|
|
77
|
+
: Relation
|
|
78
|
+
: never
|
|
79
|
+
: never
|
|
80
|
+
}>[0]
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* Checks if a relation is implicitly referenced twice, requiring disambiguation
|
|
84
|
+
*/
|
|
85
|
+
type IsDoubleReference<T, U> = T extends {
|
|
86
|
+
referencedTable: infer RT
|
|
87
|
+
fieldName: infer FN
|
|
88
|
+
match: infer M
|
|
89
|
+
}
|
|
90
|
+
? M extends 'col' | 'refrel'
|
|
91
|
+
? U extends { referencedTable: RT; fieldName: FN; match: M }
|
|
92
|
+
? true
|
|
93
|
+
: false
|
|
94
|
+
: false
|
|
95
|
+
: false
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Compares one element with all other elements in the array to find duplicates
|
|
99
|
+
*/
|
|
100
|
+
type CheckDuplicates<Arr extends any[], Current> = Arr extends [infer Head, ...infer Tail]
|
|
101
|
+
? IsDoubleReference<Current, Head> extends true
|
|
102
|
+
? Head | CheckDuplicates<Tail, Current> // Return the Head if duplicate
|
|
103
|
+
: CheckDuplicates<Tail, Current> // Otherwise, continue checking
|
|
104
|
+
: never
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* Iterates over the elements of the array to find duplicates
|
|
108
|
+
*/
|
|
109
|
+
type FindDuplicatesWithinDeduplicated<Arr extends any[]> = Arr extends [infer Head, ...infer Tail]
|
|
110
|
+
? CheckDuplicates<Tail, Head> | FindDuplicatesWithinDeduplicated<Tail>
|
|
111
|
+
: never
|
|
112
|
+
|
|
113
|
+
type FindDuplicates<Arr extends any[]> = FindDuplicatesWithinDeduplicated<
|
|
114
|
+
DeduplicateRelationships<Arr>
|
|
115
|
+
>
|
|
116
|
+
|
|
117
|
+
export type CheckDuplicateEmbededReference<
|
|
118
|
+
Schema extends GenericSchema,
|
|
119
|
+
RelationName extends string,
|
|
120
|
+
Relationships extends GenericRelationship[],
|
|
121
|
+
Nodes extends Ast.Node[],
|
|
122
|
+
> =
|
|
123
|
+
FilterRelationNodes<Nodes> extends infer RelationsNodes
|
|
124
|
+
? RelationsNodes extends Ast.FieldNode[]
|
|
125
|
+
? ResolveRelationships<
|
|
126
|
+
Schema,
|
|
127
|
+
RelationName,
|
|
128
|
+
Relationships,
|
|
129
|
+
RelationsNodes
|
|
130
|
+
> extends infer ResolvedRels
|
|
131
|
+
? ResolvedRels extends unknown[]
|
|
132
|
+
? FindDuplicates<ResolvedRels> extends infer Duplicates
|
|
133
|
+
? Duplicates extends never
|
|
134
|
+
? false
|
|
135
|
+
: Duplicates extends { fieldName: infer FieldName }
|
|
136
|
+
? FieldName extends string
|
|
137
|
+
? {
|
|
138
|
+
[K in FieldName]: SelectQueryError<`table "${RelationName}" specified more than once use hinting for desambiguation`>
|
|
139
|
+
}
|
|
140
|
+
: false
|
|
141
|
+
: false
|
|
142
|
+
: false
|
|
143
|
+
: false
|
|
144
|
+
: false
|
|
145
|
+
: false
|
|
146
|
+
: false
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Returns a boolean representing whether there is a foreign key referencing
|
|
150
|
+
* a given relation.
|
|
151
|
+
*/
|
|
152
|
+
type HasFKeyToFRel<FRelName, Relationships> = Relationships extends [infer R]
|
|
153
|
+
? R extends { referencedRelation: FRelName }
|
|
154
|
+
? true
|
|
155
|
+
: false
|
|
156
|
+
: Relationships extends [infer R, ...infer Rest]
|
|
157
|
+
? HasFKeyToFRel<FRelName, [R]> extends true
|
|
158
|
+
? true
|
|
159
|
+
: HasFKeyToFRel<FRelName, Rest>
|
|
160
|
+
: false
|
|
161
|
+
/**
|
|
162
|
+
* Checks if there is more than one relation to a given foreign relation name in the Relationships.
|
|
163
|
+
*/
|
|
164
|
+
type HasMultipleFKeysToFRelDeduplicated<FRelName, Relationships> = Relationships extends [
|
|
165
|
+
infer R,
|
|
166
|
+
...infer Rest,
|
|
167
|
+
]
|
|
168
|
+
? R extends { referencedRelation: FRelName }
|
|
169
|
+
? HasFKeyToFRel<FRelName, Rest> extends true
|
|
170
|
+
? true
|
|
171
|
+
: HasMultipleFKeysToFRelDeduplicated<FRelName, Rest>
|
|
172
|
+
: HasMultipleFKeysToFRelDeduplicated<FRelName, Rest>
|
|
173
|
+
: false
|
|
174
|
+
|
|
175
|
+
type HasMultipleFKeysToFRel<
|
|
176
|
+
FRelName,
|
|
177
|
+
Relationships extends unknown[],
|
|
178
|
+
> = HasMultipleFKeysToFRelDeduplicated<FRelName, DeduplicateRelationships<Relationships>>
|
|
179
|
+
|
|
180
|
+
type CheckRelationshipError<
|
|
181
|
+
Schema extends GenericSchema,
|
|
182
|
+
Relationships extends GenericRelationship[],
|
|
183
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
184
|
+
FoundRelation,
|
|
185
|
+
> =
|
|
186
|
+
FoundRelation extends SelectQueryError<string>
|
|
187
|
+
? FoundRelation
|
|
188
|
+
: // If the relation is a reverse relation with no hint (matching by name)
|
|
189
|
+
FoundRelation extends {
|
|
190
|
+
relation: {
|
|
191
|
+
referencedRelation: infer RelatedRelationName
|
|
192
|
+
name: string
|
|
193
|
+
}
|
|
194
|
+
direction: 'reverse'
|
|
195
|
+
}
|
|
196
|
+
? RelatedRelationName extends string
|
|
197
|
+
? // We check if there is possible confusion with other relations with this table
|
|
198
|
+
HasMultipleFKeysToFRel<RelatedRelationName, Relationships> extends true
|
|
199
|
+
? // If there is, postgrest will fail at runtime, and require desambiguation via hinting
|
|
200
|
+
SelectQueryError<`Could not embed because more than one relationship was found for '${RelatedRelationName}' and '${CurrentTableOrView}' you need to hint the column with ${RelatedRelationName}!<columnName> ?`>
|
|
201
|
+
: FoundRelation
|
|
202
|
+
: never
|
|
203
|
+
: // Same check for forward relationships, but we must gather the relationships from the found relation
|
|
204
|
+
FoundRelation extends {
|
|
205
|
+
relation: {
|
|
206
|
+
referencedRelation: infer RelatedRelationName
|
|
207
|
+
name: string
|
|
208
|
+
}
|
|
209
|
+
direction: 'forward'
|
|
210
|
+
from: infer From
|
|
211
|
+
}
|
|
212
|
+
? RelatedRelationName extends string
|
|
213
|
+
? From extends keyof TablesAndViews<Schema> & string
|
|
214
|
+
? HasMultipleFKeysToFRel<
|
|
215
|
+
RelatedRelationName,
|
|
216
|
+
TablesAndViews<Schema>[From]['Relationships']
|
|
217
|
+
> extends true
|
|
218
|
+
? SelectQueryError<`Could not embed because more than one relationship was found for '${From}' and '${RelatedRelationName}' you need to hint the column with ${From}!<columnName> ?`>
|
|
219
|
+
: FoundRelation
|
|
220
|
+
: never
|
|
221
|
+
: never
|
|
222
|
+
: FoundRelation
|
|
223
|
+
/**
|
|
224
|
+
* Resolves relationships for embedded resources and retrieves the referenced Table
|
|
225
|
+
*/
|
|
226
|
+
export type ResolveRelationship<
|
|
227
|
+
Schema extends GenericSchema,
|
|
228
|
+
Relationships extends GenericRelationship[],
|
|
229
|
+
Field extends Ast.FieldNode,
|
|
230
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
231
|
+
> =
|
|
232
|
+
ResolveReverseRelationship<
|
|
233
|
+
Schema,
|
|
234
|
+
Relationships,
|
|
235
|
+
Field,
|
|
236
|
+
CurrentTableOrView
|
|
237
|
+
> extends infer ReverseRelationship
|
|
238
|
+
? ReverseRelationship extends false
|
|
239
|
+
? CheckRelationshipError<
|
|
240
|
+
Schema,
|
|
241
|
+
Relationships,
|
|
242
|
+
CurrentTableOrView,
|
|
243
|
+
ResolveForwardRelationship<Schema, Field, CurrentTableOrView>
|
|
244
|
+
>
|
|
245
|
+
: CheckRelationshipError<Schema, Relationships, CurrentTableOrView, ReverseRelationship>
|
|
246
|
+
: never
|
|
247
|
+
|
|
248
|
+
/**
|
|
249
|
+
* Resolves reverse relationships (from children to parent)
|
|
250
|
+
*/
|
|
251
|
+
type ResolveReverseRelationship<
|
|
252
|
+
Schema extends GenericSchema,
|
|
253
|
+
Relationships extends GenericRelationship[],
|
|
254
|
+
Field extends Ast.FieldNode,
|
|
255
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
256
|
+
> =
|
|
257
|
+
FindFieldMatchingRelationships<Schema, Relationships, Field> extends infer FoundRelation
|
|
258
|
+
? FoundRelation extends never
|
|
259
|
+
? false
|
|
260
|
+
: FoundRelation extends { referencedRelation: infer RelatedRelationName }
|
|
261
|
+
? RelatedRelationName extends string
|
|
262
|
+
? RelatedRelationName extends keyof TablesAndViews<Schema>
|
|
263
|
+
? // If the relation was found via hinting we just return it without any more checks
|
|
264
|
+
FoundRelation extends { hint: string }
|
|
265
|
+
? {
|
|
266
|
+
referencedTable: TablesAndViews<Schema>[RelatedRelationName]
|
|
267
|
+
relation: FoundRelation
|
|
268
|
+
direction: 'reverse'
|
|
269
|
+
from: CurrentTableOrView
|
|
270
|
+
}
|
|
271
|
+
: // If the relation was found via implicit relation naming, we must ensure there is no conflicting matches
|
|
272
|
+
HasMultipleFKeysToFRel<RelatedRelationName, Relationships> extends true
|
|
273
|
+
? SelectQueryError<`Could not embed because more than one relationship was found for '${RelatedRelationName}' and '${CurrentTableOrView}' you need to hint the column with ${RelatedRelationName}!<columnName> ?`>
|
|
274
|
+
: {
|
|
275
|
+
referencedTable: TablesAndViews<Schema>[RelatedRelationName]
|
|
276
|
+
relation: FoundRelation
|
|
277
|
+
direction: 'reverse'
|
|
278
|
+
from: CurrentTableOrView
|
|
279
|
+
}
|
|
280
|
+
: SelectQueryError<`Relation '${RelatedRelationName}' not found in schema.`>
|
|
281
|
+
: false
|
|
282
|
+
: false
|
|
283
|
+
: false
|
|
284
|
+
|
|
285
|
+
export type FindMatchingTableRelationships<
|
|
286
|
+
Schema extends GenericSchema,
|
|
287
|
+
Relationships extends GenericRelationship[],
|
|
288
|
+
value extends string,
|
|
289
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
290
|
+
? Rest extends GenericRelationship[]
|
|
291
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
292
|
+
? ReferencedRelation extends keyof Schema['Tables']
|
|
293
|
+
? R extends { foreignKeyName: value }
|
|
294
|
+
? R & { match: 'fkname' }
|
|
295
|
+
: R extends { referencedRelation: value }
|
|
296
|
+
? R & { match: 'refrel' }
|
|
297
|
+
: R extends { columns: [value] }
|
|
298
|
+
? R & { match: 'col' }
|
|
299
|
+
: FindMatchingTableRelationships<Schema, Rest, value>
|
|
300
|
+
: FindMatchingTableRelationships<Schema, Rest, value>
|
|
301
|
+
: false
|
|
302
|
+
: false
|
|
303
|
+
: false
|
|
304
|
+
|
|
305
|
+
export type FindMatchingViewRelationships<
|
|
306
|
+
Schema extends GenericSchema,
|
|
307
|
+
Relationships extends GenericRelationship[],
|
|
308
|
+
value extends string,
|
|
309
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
310
|
+
? Rest extends GenericRelationship[]
|
|
311
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
312
|
+
? ReferencedRelation extends keyof Schema['Views']
|
|
313
|
+
? R extends { foreignKeyName: value }
|
|
314
|
+
? R & { match: 'fkname' }
|
|
315
|
+
: R extends { referencedRelation: value }
|
|
316
|
+
? R & { match: 'refrel' }
|
|
317
|
+
: R extends { columns: [value] }
|
|
318
|
+
? R & { match: 'col' }
|
|
319
|
+
: FindMatchingViewRelationships<Schema, Rest, value>
|
|
320
|
+
: FindMatchingViewRelationships<Schema, Rest, value>
|
|
321
|
+
: false
|
|
322
|
+
: false
|
|
323
|
+
: false
|
|
324
|
+
|
|
325
|
+
export type FindMatchingHintTableRelationships<
|
|
326
|
+
Schema extends GenericSchema,
|
|
327
|
+
Relationships extends GenericRelationship[],
|
|
328
|
+
hint extends string,
|
|
329
|
+
name extends string,
|
|
330
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
331
|
+
? Rest extends GenericRelationship[]
|
|
332
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
333
|
+
? ReferencedRelation extends name
|
|
334
|
+
? R extends { foreignKeyName: hint }
|
|
335
|
+
? R & { match: 'fkname' }
|
|
336
|
+
: R extends { referencedRelation: hint }
|
|
337
|
+
? R & { match: 'refrel' }
|
|
338
|
+
: R extends { columns: [hint] }
|
|
339
|
+
? R & { match: 'col' }
|
|
340
|
+
: FindMatchingHintTableRelationships<Schema, Rest, hint, name>
|
|
341
|
+
: FindMatchingHintTableRelationships<Schema, Rest, hint, name>
|
|
342
|
+
: false
|
|
343
|
+
: false
|
|
344
|
+
: false
|
|
345
|
+
export type FindMatchingHintViewRelationships<
|
|
346
|
+
Schema extends GenericSchema,
|
|
347
|
+
Relationships extends GenericRelationship[],
|
|
348
|
+
hint extends string,
|
|
349
|
+
name extends string,
|
|
350
|
+
> = Relationships extends [infer R, ...infer Rest]
|
|
351
|
+
? Rest extends GenericRelationship[]
|
|
352
|
+
? R extends { referencedRelation: infer ReferencedRelation }
|
|
353
|
+
? ReferencedRelation extends name
|
|
354
|
+
? R extends { foreignKeyName: hint }
|
|
355
|
+
? R & { match: 'fkname' }
|
|
356
|
+
: R extends { referencedRelation: hint }
|
|
357
|
+
? R & { match: 'refrel' }
|
|
358
|
+
: R extends { columns: [hint] }
|
|
359
|
+
? R & { match: 'col' }
|
|
360
|
+
: FindMatchingHintViewRelationships<Schema, Rest, hint, name>
|
|
361
|
+
: FindMatchingHintViewRelationships<Schema, Rest, hint, name>
|
|
362
|
+
: false
|
|
363
|
+
: false
|
|
364
|
+
: false
|
|
365
|
+
|
|
366
|
+
type IsColumnsNullable<
|
|
367
|
+
Table extends Pick<GenericTable, 'Row'>,
|
|
368
|
+
Columns extends (keyof Table['Row'])[],
|
|
369
|
+
> = Columns extends [infer Column, ...infer Rest]
|
|
370
|
+
? Column extends keyof Table['Row']
|
|
371
|
+
? ContainsNull<Table['Row'][Column]> extends true
|
|
372
|
+
? true
|
|
373
|
+
: IsColumnsNullable<Table, Rest extends (keyof Table['Row'])[] ? Rest : []>
|
|
374
|
+
: false
|
|
375
|
+
: false
|
|
376
|
+
|
|
377
|
+
// Check weither or not a 1-1 relation is nullable by checking against the type of the columns
|
|
378
|
+
export type IsRelationNullable<
|
|
379
|
+
Table extends GenericTable,
|
|
380
|
+
Relation extends GenericRelationship,
|
|
381
|
+
> = IsColumnsNullable<Table, Relation['columns']>
|
|
382
|
+
|
|
383
|
+
type TableForwardRelationships<
|
|
384
|
+
Schema extends GenericSchema,
|
|
385
|
+
TName,
|
|
386
|
+
> = TName extends keyof TablesAndViews<Schema>
|
|
387
|
+
? UnionToArray<
|
|
388
|
+
RecursivelyFindRelationships<Schema, TName, keyof TablesAndViews<Schema>>
|
|
389
|
+
> extends infer R
|
|
390
|
+
? R extends (GenericRelationship & { from: keyof TablesAndViews<Schema> })[]
|
|
391
|
+
? R
|
|
392
|
+
: []
|
|
393
|
+
: []
|
|
394
|
+
: []
|
|
395
|
+
|
|
396
|
+
type RecursivelyFindRelationships<
|
|
397
|
+
Schema extends GenericSchema,
|
|
398
|
+
TName,
|
|
399
|
+
Keys extends keyof TablesAndViews<Schema>,
|
|
400
|
+
> = Keys extends infer K
|
|
401
|
+
? K extends keyof TablesAndViews<Schema>
|
|
402
|
+
? FilterRelationships<TablesAndViews<Schema>[K]['Relationships'], TName, K> extends never
|
|
403
|
+
? RecursivelyFindRelationships<Schema, TName, Exclude<Keys, K>>
|
|
404
|
+
:
|
|
405
|
+
| FilterRelationships<TablesAndViews<Schema>[K]['Relationships'], TName, K>
|
|
406
|
+
| RecursivelyFindRelationships<Schema, TName, Exclude<Keys, K>>
|
|
407
|
+
: false
|
|
408
|
+
: false
|
|
409
|
+
|
|
410
|
+
type FilterRelationships<R, TName, From> = R extends readonly (infer Rel)[]
|
|
411
|
+
? Rel extends { referencedRelation: TName }
|
|
412
|
+
? Rel & { from: From }
|
|
413
|
+
: never
|
|
414
|
+
: never
|
|
415
|
+
|
|
416
|
+
export type ResolveForwardRelationship<
|
|
417
|
+
Schema extends GenericSchema,
|
|
418
|
+
Field extends Ast.FieldNode,
|
|
419
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
420
|
+
> =
|
|
421
|
+
FindFieldMatchingRelationships<
|
|
422
|
+
Schema,
|
|
423
|
+
TablesAndViews<Schema>[Field['name']]['Relationships'],
|
|
424
|
+
Ast.FieldNode & { name: CurrentTableOrView; hint: Field['hint'] }
|
|
425
|
+
> extends infer FoundByName
|
|
426
|
+
? FoundByName extends GenericRelationship
|
|
427
|
+
? {
|
|
428
|
+
referencedTable: TablesAndViews<Schema>[Field['name']]
|
|
429
|
+
relation: FoundByName
|
|
430
|
+
direction: 'forward'
|
|
431
|
+
from: Field['name']
|
|
432
|
+
type: 'found-by-name'
|
|
433
|
+
}
|
|
434
|
+
: FindFieldMatchingRelationships<
|
|
435
|
+
Schema,
|
|
436
|
+
TableForwardRelationships<Schema, CurrentTableOrView>,
|
|
437
|
+
Field
|
|
438
|
+
> extends infer FoundByMatch
|
|
439
|
+
? FoundByMatch extends GenericRelationship & {
|
|
440
|
+
from: keyof TablesAndViews<Schema>
|
|
441
|
+
}
|
|
442
|
+
? {
|
|
443
|
+
referencedTable: TablesAndViews<Schema>[FoundByMatch['from']]
|
|
444
|
+
relation: FoundByMatch
|
|
445
|
+
direction: 'forward'
|
|
446
|
+
from: CurrentTableOrView
|
|
447
|
+
type: 'found-by-match'
|
|
448
|
+
}
|
|
449
|
+
: FindJoinTableRelationship<
|
|
450
|
+
Schema,
|
|
451
|
+
CurrentTableOrView,
|
|
452
|
+
Field['name']
|
|
453
|
+
> extends infer FoundByJoinTable
|
|
454
|
+
? FoundByJoinTable extends GenericRelationship
|
|
455
|
+
? {
|
|
456
|
+
referencedTable: TablesAndViews<Schema>[FoundByJoinTable['referencedRelation']]
|
|
457
|
+
relation: FoundByJoinTable & { match: 'refrel' }
|
|
458
|
+
direction: 'forward'
|
|
459
|
+
from: CurrentTableOrView
|
|
460
|
+
type: 'found-by-join-table'
|
|
461
|
+
}
|
|
462
|
+
: ResolveEmbededFunctionJoinTableRelationship<
|
|
463
|
+
Schema,
|
|
464
|
+
CurrentTableOrView,
|
|
465
|
+
Field['name']
|
|
466
|
+
> extends infer FoundEmbededFunctionJoinTableRelation
|
|
467
|
+
? FoundEmbededFunctionJoinTableRelation extends GenericFunction
|
|
468
|
+
? FoundEmbededFunctionJoinTableRelation['SetofOptions'] extends GenericSetofOption
|
|
469
|
+
? FoundEmbededFunctionJoinTableRelation['SetofOptions']['to'] extends ''
|
|
470
|
+
? // Scalar computed column: function returns a primitive (not a table row).
|
|
471
|
+
// `to` is '' because there is no target table — the value is returned directly.
|
|
472
|
+
{
|
|
473
|
+
referencedTable: { Row: Record<string, never>; Relationships: [] }
|
|
474
|
+
relation: {
|
|
475
|
+
foreignKeyName: `${Field['name']}_${CurrentTableOrView}_scalar_forward`
|
|
476
|
+
columns: []
|
|
477
|
+
isOneToOne: false
|
|
478
|
+
referencedColumns: []
|
|
479
|
+
referencedRelation: ''
|
|
480
|
+
} & {
|
|
481
|
+
match: 'func'
|
|
482
|
+
isNotNullable: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isNotNullable'] extends true
|
|
483
|
+
? true
|
|
484
|
+
: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isSetofReturn'] extends true
|
|
485
|
+
? false
|
|
486
|
+
: true
|
|
487
|
+
isSetofReturn: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isSetofReturn']
|
|
488
|
+
}
|
|
489
|
+
scalarType: FoundEmbededFunctionJoinTableRelation['Returns']
|
|
490
|
+
direction: 'forward'
|
|
491
|
+
from: CurrentTableOrView
|
|
492
|
+
type: 'found-by-embeded-scalar-function'
|
|
493
|
+
}
|
|
494
|
+
: // Table-valued function: `to` names the target table/view.
|
|
495
|
+
{
|
|
496
|
+
referencedTable: TablesAndViews<Schema>[FoundEmbededFunctionJoinTableRelation['SetofOptions']['to']]
|
|
497
|
+
relation: {
|
|
498
|
+
foreignKeyName: `${Field['name']}_${CurrentTableOrView}_${FoundEmbededFunctionJoinTableRelation['SetofOptions']['to']}_forward`
|
|
499
|
+
columns: []
|
|
500
|
+
isOneToOne: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isOneToOne'] extends true
|
|
501
|
+
? true
|
|
502
|
+
: false
|
|
503
|
+
referencedColumns: []
|
|
504
|
+
referencedRelation: FoundEmbededFunctionJoinTableRelation['SetofOptions']['to']
|
|
505
|
+
} & {
|
|
506
|
+
match: 'func'
|
|
507
|
+
isNotNullable: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isNotNullable'] extends true
|
|
508
|
+
? true
|
|
509
|
+
: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isSetofReturn'] extends true
|
|
510
|
+
? false
|
|
511
|
+
: true
|
|
512
|
+
isSetofReturn: FoundEmbededFunctionJoinTableRelation['SetofOptions']['isSetofReturn']
|
|
513
|
+
}
|
|
514
|
+
direction: 'forward'
|
|
515
|
+
from: CurrentTableOrView
|
|
516
|
+
type: 'found-by-embeded-function'
|
|
517
|
+
}
|
|
518
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
519
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
520
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
521
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
522
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
523
|
+
: SelectQueryError<`could not find the relation between ${CurrentTableOrView} and ${Field['name']}`>
|
|
524
|
+
|
|
525
|
+
/**
|
|
526
|
+
* Given a CurrentTableOrView, finds all join tables to this relation.
|
|
527
|
+
* For example, if products and categories are linked via product_categories table:
|
|
528
|
+
*
|
|
529
|
+
* @example Find join table relationship
|
|
530
|
+
* Given:
|
|
531
|
+
* - CurrentTableView = 'products'
|
|
532
|
+
* - FieldName = "categories"
|
|
533
|
+
*
|
|
534
|
+
* It should return this relationship from product_categories:
|
|
535
|
+
* {
|
|
536
|
+
* foreignKeyName: "product_categories_category_id_fkey",
|
|
537
|
+
* columns: ["category_id"],
|
|
538
|
+
* isOneToOne: false,
|
|
539
|
+
* referencedRelation: "categories",
|
|
540
|
+
* referencedColumns: ["id"]
|
|
541
|
+
* }
|
|
542
|
+
*/
|
|
543
|
+
type ResolveJoinTableRelationship<
|
|
544
|
+
Schema extends GenericSchema,
|
|
545
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
546
|
+
FieldName extends string,
|
|
547
|
+
> = {
|
|
548
|
+
[TableName in keyof TablesAndViews<Schema>]: DeduplicateRelationships<
|
|
549
|
+
TablesAndViews<Schema>[TableName]['Relationships']
|
|
550
|
+
> extends readonly (infer Rel)[]
|
|
551
|
+
? Rel extends { referencedRelation: CurrentTableOrView }
|
|
552
|
+
? DeduplicateRelationships<
|
|
553
|
+
TablesAndViews<Schema>[TableName]['Relationships']
|
|
554
|
+
> extends readonly (infer OtherRel)[]
|
|
555
|
+
? OtherRel extends { referencedRelation: FieldName }
|
|
556
|
+
? OtherRel
|
|
557
|
+
: never
|
|
558
|
+
: never
|
|
559
|
+
: never
|
|
560
|
+
: never
|
|
561
|
+
}[keyof TablesAndViews<Schema>]
|
|
562
|
+
|
|
563
|
+
type ResolveEmbededFunctionJoinTableRelationship<
|
|
564
|
+
Schema extends GenericSchema,
|
|
565
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
566
|
+
FieldName extends string,
|
|
567
|
+
> =
|
|
568
|
+
FindMatchingFunctionBySetofFrom<
|
|
569
|
+
Schema['Functions'][FieldName],
|
|
570
|
+
CurrentTableOrView
|
|
571
|
+
> extends infer Fn
|
|
572
|
+
? Fn extends GenericFunction
|
|
573
|
+
? Fn
|
|
574
|
+
: false
|
|
575
|
+
: false
|
|
576
|
+
|
|
577
|
+
export type FindJoinTableRelationship<
|
|
578
|
+
Schema extends GenericSchema,
|
|
579
|
+
CurrentTableOrView extends keyof TablesAndViews<Schema> & string,
|
|
580
|
+
FieldName extends string,
|
|
581
|
+
> =
|
|
582
|
+
ResolveJoinTableRelationship<Schema, CurrentTableOrView, FieldName> extends infer Result
|
|
583
|
+
? [Result] extends [never]
|
|
584
|
+
? false
|
|
585
|
+
: Result
|
|
586
|
+
: never
|
|
587
|
+
/**
|
|
588
|
+
* Finds a matching relationship based on the FieldNode's name and optional hint.
|
|
589
|
+
*/
|
|
590
|
+
export type FindFieldMatchingRelationships<
|
|
591
|
+
Schema extends GenericSchema,
|
|
592
|
+
Relationships extends GenericRelationship[],
|
|
593
|
+
Field extends Ast.FieldNode,
|
|
594
|
+
> = Field extends { hint: string }
|
|
595
|
+
? FindMatchingHintTableRelationships<
|
|
596
|
+
Schema,
|
|
597
|
+
Relationships,
|
|
598
|
+
Field['hint'],
|
|
599
|
+
Field['name']
|
|
600
|
+
> extends GenericRelationship
|
|
601
|
+
? FindMatchingHintTableRelationships<Schema, Relationships, Field['hint'], Field['name']> & {
|
|
602
|
+
branch: 'found-in-table-via-hint'
|
|
603
|
+
hint: Field['hint']
|
|
604
|
+
}
|
|
605
|
+
: FindMatchingHintViewRelationships<
|
|
606
|
+
Schema,
|
|
607
|
+
Relationships,
|
|
608
|
+
Field['hint'],
|
|
609
|
+
Field['name']
|
|
610
|
+
> extends GenericRelationship
|
|
611
|
+
? FindMatchingHintViewRelationships<Schema, Relationships, Field['hint'], Field['name']> & {
|
|
612
|
+
branch: 'found-in-view-via-hint'
|
|
613
|
+
hint: Field['hint']
|
|
614
|
+
}
|
|
615
|
+
: SelectQueryError<'Failed to find matching relation via hint'>
|
|
616
|
+
: FindMatchingTableRelationships<Schema, Relationships, Field['name']> extends GenericRelationship
|
|
617
|
+
? FindMatchingTableRelationships<Schema, Relationships, Field['name']> & {
|
|
618
|
+
branch: 'found-in-table-via-name'
|
|
619
|
+
name: Field['name']
|
|
620
|
+
}
|
|
621
|
+
: FindMatchingViewRelationships<
|
|
622
|
+
Schema,
|
|
623
|
+
Relationships,
|
|
624
|
+
Field['name']
|
|
625
|
+
> extends GenericRelationship
|
|
626
|
+
? FindMatchingViewRelationships<Schema, Relationships, Field['name']> & {
|
|
627
|
+
branch: 'found-in-view-via-name'
|
|
628
|
+
name: Field['name']
|
|
629
|
+
}
|
|
630
|
+
: SelectQueryError<'Failed to find matching relation via name'>
|
|
631
|
+
|
|
632
|
+
export type JsonPathToAccessor<Path extends string> = Path extends `${infer P1}->${infer P2}`
|
|
633
|
+
? P2 extends `>${infer Rest}` // Handle ->> operator
|
|
634
|
+
? JsonPathToAccessor<`${P1}.${Rest}`>
|
|
635
|
+
: P2 extends string // Handle -> operator
|
|
636
|
+
? JsonPathToAccessor<`${P1}.${P2}`>
|
|
637
|
+
: Path
|
|
638
|
+
: Path extends `>${infer Rest}` // Clean up any remaining > characters
|
|
639
|
+
? JsonPathToAccessor<Rest>
|
|
640
|
+
: Path extends `${infer P1}::${infer _}` // Handle type casting
|
|
641
|
+
? JsonPathToAccessor<P1>
|
|
642
|
+
: Path extends `${infer P1}${')' | ','}${infer _}` // Handle closing parenthesis and comma
|
|
643
|
+
? P1
|
|
644
|
+
: Path
|
|
645
|
+
|
|
646
|
+
export type JsonPathToType<T, Path extends string> = Path extends ''
|
|
647
|
+
? T
|
|
648
|
+
: ContainsNull<T> extends true
|
|
649
|
+
? JsonPathToType<Exclude<T, null>, Path>
|
|
650
|
+
: Path extends `${infer Key}.${infer Rest}`
|
|
651
|
+
? Key extends keyof T
|
|
652
|
+
? JsonPathToType<T[Key], Rest>
|
|
653
|
+
: never
|
|
654
|
+
: Path extends keyof T
|
|
655
|
+
? T[Path]
|
|
656
|
+
: never
|
|
657
|
+
|
|
658
|
+
export type IsStringUnion<T> = string extends T
|
|
659
|
+
? false
|
|
660
|
+
: T extends string
|
|
661
|
+
? [T] extends [never]
|
|
662
|
+
? false
|
|
663
|
+
: true
|
|
664
|
+
: false
|
|
665
|
+
|
|
666
|
+
type MatchingFunctionBySetofFrom<
|
|
667
|
+
Fn extends GenericFunction,
|
|
668
|
+
TableName extends string,
|
|
669
|
+
> = Fn['SetofOptions'] extends GenericSetofOption
|
|
670
|
+
? TableName extends Fn['SetofOptions']['from']
|
|
671
|
+
? Fn
|
|
672
|
+
: never
|
|
673
|
+
: false
|
|
674
|
+
|
|
675
|
+
type FindMatchingFunctionBySetofFrom<
|
|
676
|
+
FnUnion,
|
|
677
|
+
TableName extends string,
|
|
678
|
+
> = FnUnion extends infer Fn extends GenericFunction
|
|
679
|
+
? MatchingFunctionBySetofFrom<Fn, TableName>
|
|
680
|
+
: false
|
|
681
|
+
|
|
682
|
+
type ComputedField<
|
|
683
|
+
Schema extends GenericSchema,
|
|
684
|
+
RelationName extends keyof TablesAndViews<Schema>,
|
|
685
|
+
FieldName extends keyof TablesAndViews<Schema>[RelationName]['Row'],
|
|
686
|
+
> = FieldName extends keyof Schema['Functions']
|
|
687
|
+
? [Schema['Functions'][FieldName]['Args']] extends [never]
|
|
688
|
+
? never
|
|
689
|
+
: Schema['Functions'][FieldName] extends {
|
|
690
|
+
Args: { '': TablesAndViews<Schema>[RelationName]['Row'] }
|
|
691
|
+
Returns: any
|
|
692
|
+
}
|
|
693
|
+
? FieldName
|
|
694
|
+
: never
|
|
695
|
+
: never
|
|
696
|
+
|
|
697
|
+
// Given a relation name (Table or View) extract all the "computed fields" based on the Row
|
|
698
|
+
// object, and the schema functions definitions
|
|
699
|
+
export type GetComputedFields<
|
|
700
|
+
Schema extends GenericSchema,
|
|
701
|
+
RelationName extends keyof TablesAndViews<Schema>,
|
|
702
|
+
> = {
|
|
703
|
+
[K in keyof TablesAndViews<Schema>[RelationName]['Row']]: ComputedField<Schema, RelationName, K>
|
|
704
|
+
}[keyof TablesAndViews<Schema>[RelationName]['Row']]
|