@rivetkit/supabase 0.0.0-main.9d355a2 → 0.0.0-sqlite-uds.ea644f1
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/dist/mod.d.mts +1 -0
- package/dist/mod.d.ts +1 -0
- package/dist/mod.js +29000 -36
- package/dist/mod.mjs +28962 -35
- package/package.json +10 -4
- package/dist/mod.js.map +0 -1
- package/dist/mod.mjs.map +0 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@rivetkit/supabase",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-sqlite-uds.ea644f1",
|
|
4
4
|
"description": "Supabase Edge Functions integration for RivetKit actors",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"keywords": [
|
|
@@ -34,14 +34,20 @@
|
|
|
34
34
|
},
|
|
35
35
|
"scripts": {
|
|
36
36
|
"build": "tsup src/mod.ts",
|
|
37
|
-
"check-types": "tsc --noEmit"
|
|
37
|
+
"check-types": "tsc --noEmit",
|
|
38
|
+
"size": "size-limit",
|
|
39
|
+
"check-edge-closure": "node ../../../scripts/ci/check-edge-native-closure.mjs"
|
|
38
40
|
},
|
|
39
41
|
"dependencies": {
|
|
40
|
-
"@rivetkit/rivetkit-wasm": "0.0.0-
|
|
41
|
-
"
|
|
42
|
+
"@rivetkit/rivetkit-wasm": "0.0.0-sqlite-uds.ea644f1",
|
|
43
|
+
"cbor-x": "^1.6.0",
|
|
44
|
+
"pino": "^9.5.0"
|
|
42
45
|
},
|
|
43
46
|
"devDependencies": {
|
|
47
|
+
"@size-limit/file": "^11.1.6",
|
|
44
48
|
"@types/node": "^22.0.0",
|
|
49
|
+
"rivetkit": "0.0.0-sqlite-uds.ea644f1",
|
|
50
|
+
"size-limit": "^11.1.6",
|
|
45
51
|
"tsup": "^8.4.0",
|
|
46
52
|
"typescript": "^5.5.2"
|
|
47
53
|
},
|
package/dist/mod.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["/home/runner/work/rivet/rivet/rivetkit-typescript/packages/supabase/dist/mod.js","../src/mod.ts"],"names":[],"mappings":"AAAA;ACAA,kHAA8B;AAC9B;AACC;AAGA;AAAS,oCACH;AAEP,IAAM,qBAAA,EAAuB,YAAA;AAgBtB,SAAS,KAAA,CACf,MAAA,EACc;AACd,EAAA,OAAO,6BAAA;AAAiB,IACvB,OAAA,EAAS,MAAA;AAAA,IACT,IAAA,EAAM,EAAE,QAAA,EAAU,aAAa,CAAA;AAAA,IAC/B,SAAA,EAAW,IAAA;AAAA,IACX,GAAG;AAAA,EACJ,CAA2B,CAAA;AAC5B;AASA,IAAM,eAAA,EAAiB,CAAA,EAAA,GACtB,IAAI,GAAA;AAAA,EAEF,MAAA,CAAA,IAAA,CACC,OAAA,CAAQ,+CAA+C;AAC1D,CAAA;AAED,SAAS,QAAA,CACR,MAAA,EACA,WAAA,EACO;AApDR,EAAA,IAAA,EAAA,EAAA,EAAA;AAqDC,EAAA,GAAA,CAAI,CAAC,MAAA,CAAO,QAAA,EAAU;AACrB,IAAA,MAAM,SAAA,EAAW,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,gBAAgB,CAAA;AAC9C,IAAA,GAAA,CAAI,QAAA,EAAU,MAAA,CAAO,SAAA,EAAW,QAAA;AAAA,EACjC;AACA,EAAA,GAAA,CAAI,CAAC,MAAA,CAAO,SAAA,EAAW;AACtB,IAAA,MAAM,UAAA,EAAY,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,iBAAiB,CAAA;AAChD,IAAA,GAAA,CAAI,SAAA,EAAW,MAAA,CAAO,UAAA,EAAY,SAAA;AAAA,EACnC;AACA,EAAA,GAAA,CAAI,CAAC,MAAA,CAAO,KAAA,EAAO;AAClB,IAAA,MAAM,MAAA,EAAQ,IAAA,CAAK,GAAA,CAAI,GAAA,CAAI,aAAa,CAAA;AACxC,IAAA,GAAA,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EAAA,EAAA,CAAmB,QAAA,CAAA,UACnB,OAAA,CAAQ,aAAA,UACR,sBAAA;AACD,EAAA,QAAA,CAAS,MAAA,EAAQ,WAAW,CAAA;AAE5B,EAAA,MAAM,eAAA,EAAiB,CAAA,EAAA;AAEC,EAAA;AACH,IAAA;AAIF,IAAA;AAGD,MAAA;AACjB,IAAA;AAMsB,IAAA;AACF,IAAA;AACA,MAAA;AACH,MAAA;AACjB,IAAA;AAEmB,IAAA;AACH,MAAA;AAChB,IAAA;AAEW,IAAA;AACV,MAAA;AACD,IAAA;AACA,EAAA;AACF;ADpE0B;AACA;AACA;AACA","file":"/home/runner/work/rivet/rivet/rivetkit-typescript/packages/supabase/dist/mod.js","sourcesContent":[null,"import * as wasmBindings from \"@rivetkit/rivetkit-wasm\";\nimport {\n\tRegistry,\n\ttype RegistryActors,\n\ttype RegistryConfigInput,\n\tsetup as rivetkitSetup,\n} from \"rivetkit\";\n\nconst DEFAULT_MANAGER_PATH = \"/api/rivet\";\n\n/** Config passed to `setup` / `serve`. The wasm runtime is wired automatically. */\nexport type SupabaseSetupConfig<A extends RegistryActors> = Omit<\n\tRegistryConfigInput<A>,\n\t\"runtime\" | \"wasm\"\n>;\n\n/**\n * Wraps rivetkit's `setup` with the Supabase Edge Functions WebAssembly runtime\n * wired in. Returns a typed `Registry`, so you can derive a typed client with\n * `createClient<typeof registry>(...)` and pass the same registry to `serve`.\n *\n * The wasm binary is loaded by `serve` (Deno reads it asynchronously), so this\n * stays synchronous.\n */\nexport function setup<A extends RegistryActors>(\n\tconfig: SupabaseSetupConfig<A>,\n): Registry<A> {\n\treturn rivetkitSetup<A>({\n\t\truntime: \"wasm\",\n\t\twasm: { bindings: wasmBindings },\n\t\tnoWelcome: true,\n\t\t...config,\n\t} as RegistryConfigInput<A>);\n}\n\nexport interface ServeOptions {\n\t/** Path the Rivet manager API is mounted at. Defaults to `/api/rivet`. */\n\tmanagerPath?: string;\n\t/** Handler for requests that fall outside the Rivet manager API path. */\n\tfetch?: (request: Request) => Response | Promise<Response>;\n}\n\nconst resolveWasmUrl = (): URL =>\n\tnew URL(\n\t\t(\n\t\t\timport.meta as unknown as { resolve(specifier: string): string }\n\t\t).resolve(\"@rivetkit/rivetkit-wasm/rivetkit_wasm_bg.wasm\"),\n\t);\n\nfunction applyEnv(\n\tconfig: RegistryConfigInput<RegistryActors>,\n\tmanagerPath: string,\n): void {\n\tif (!config.endpoint) {\n\t\tconst endpoint = Deno.env.get(\"RIVET_ENDPOINT\");\n\t\tif (endpoint) config.endpoint = endpoint;\n\t}\n\tif (!config.namespace) {\n\t\tconst namespace = Deno.env.get(\"RIVET_NAMESPACE\");\n\t\tif (namespace) config.namespace = namespace;\n\t}\n\tif (!config.token) {\n\t\tconst token = Deno.env.get(\"RIVET_TOKEN\");\n\t\tif (token) config.token = token;\n\t}\n\tconst poolName = Deno.env.get(\"RIVET_POOL\");\n\tif (poolName && !config.envoy?.poolName) {\n\t\tconfig.envoy = { ...config.envoy, poolName };\n\t}\n\tif (!config.serverless?.basePath) {\n\t\tconfig.serverless = { ...config.serverless, basePath: managerPath };\n\t}\n}\n\n/**\n * Serves Rivet Actors from a Supabase Edge Function (Deno) on the wasm runtime.\n * Accepts either a registry from this package's `setup` or a setup config (which\n * is wired through `setup` for you).\n *\n * The Rivet manager API is mounted at the configured `serverless.basePath`\n * (or `managerPath`, default `/api/rivet`). Requests outside that path are\n * routed to `options.fetch` if provided. The engine endpoint is read from\n * `RIVET_ENDPOINT` (with `RIVET_NAMESPACE`, `RIVET_TOKEN`, `RIVET_POOL` optional)\n * unless set in the config.\n */\nexport async function serve<A extends RegistryActors>(\n\tregistryOrConfig: Registry<A> | SupabaseSetupConfig<A>,\n\toptions: ServeOptions = {},\n): Promise<void> {\n\tconst registry =\n\t\tregistryOrConfig instanceof Registry\n\t\t\t? registryOrConfig\n\t\t\t: setup(registryOrConfig);\n\n\tconst wasmModule = await Deno.readFile(resolveWasmUrl());\n\tconst config = registry.config as RegistryConfigInput<RegistryActors>;\n\tconfig.wasm = {\n\t\t...config.wasm,\n\t\tbindings: wasmBindings,\n\t\tinitInput: wasmModule,\n\t};\n\n\tconst managerPath =\n\t\tconfig.serverless?.basePath ??\n\t\toptions.managerPath ??\n\t\tDEFAULT_MANAGER_PATH;\n\tapplyEnv(config, managerPath);\n\n\tconst managerSegment = `${managerPath}/`;\n\n\tDeno.serve((request) => {\n\t\tconst url = new URL(request.url);\n\n\t\t// Manager request arriving at the configured base path.\n\t\tif (\n\t\t\turl.pathname === managerPath ||\n\t\t\turl.pathname.startsWith(managerSegment)\n\t\t) {\n\t\t\treturn registry.handler(request);\n\t\t}\n\n\t\t// Supabase mounts the function under `/functions/v1/<name>`, so the\n\t\t// manager API can arrive under a prefix (e.g. `/<name>/api/rivet/...`).\n\t\t// Strip any prefix before the manager path before handing off, so the\n\t\t// example does not need to configure a Supabase-specific base path.\n\t\tconst prefixedIndex = url.pathname.indexOf(managerSegment);\n\t\tif (prefixedIndex > 0) {\n\t\t\turl.pathname = url.pathname.slice(prefixedIndex);\n\t\t\treturn registry.handler(new Request(url, request));\n\t\t}\n\n\t\tif (options.fetch) {\n\t\t\treturn options.fetch(request);\n\t\t}\n\n\t\treturn new Response(\n\t\t\t\"This is a RivetKit server.\\n\\nLearn more at https://rivet.dev\\n\",\n\t\t);\n\t});\n}\n"]}
|
package/dist/mod.mjs.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mod.ts"],"sourcesContent":["import * as wasmBindings from \"@rivetkit/rivetkit-wasm\";\nimport {\n\tRegistry,\n\ttype RegistryActors,\n\ttype RegistryConfigInput,\n\tsetup as rivetkitSetup,\n} from \"rivetkit\";\n\nconst DEFAULT_MANAGER_PATH = \"/api/rivet\";\n\n/** Config passed to `setup` / `serve`. The wasm runtime is wired automatically. */\nexport type SupabaseSetupConfig<A extends RegistryActors> = Omit<\n\tRegistryConfigInput<A>,\n\t\"runtime\" | \"wasm\"\n>;\n\n/**\n * Wraps rivetkit's `setup` with the Supabase Edge Functions WebAssembly runtime\n * wired in. Returns a typed `Registry`, so you can derive a typed client with\n * `createClient<typeof registry>(...)` and pass the same registry to `serve`.\n *\n * The wasm binary is loaded by `serve` (Deno reads it asynchronously), so this\n * stays synchronous.\n */\nexport function setup<A extends RegistryActors>(\n\tconfig: SupabaseSetupConfig<A>,\n): Registry<A> {\n\treturn rivetkitSetup<A>({\n\t\truntime: \"wasm\",\n\t\twasm: { bindings: wasmBindings },\n\t\tnoWelcome: true,\n\t\t...config,\n\t} as RegistryConfigInput<A>);\n}\n\nexport interface ServeOptions {\n\t/** Path the Rivet manager API is mounted at. Defaults to `/api/rivet`. */\n\tmanagerPath?: string;\n\t/** Handler for requests that fall outside the Rivet manager API path. */\n\tfetch?: (request: Request) => Response | Promise<Response>;\n}\n\nconst resolveWasmUrl = (): URL =>\n\tnew URL(\n\t\t(\n\t\t\timport.meta as unknown as { resolve(specifier: string): string }\n\t\t).resolve(\"@rivetkit/rivetkit-wasm/rivetkit_wasm_bg.wasm\"),\n\t);\n\nfunction applyEnv(\n\tconfig: RegistryConfigInput<RegistryActors>,\n\tmanagerPath: string,\n): void {\n\tif (!config.endpoint) {\n\t\tconst endpoint = Deno.env.get(\"RIVET_ENDPOINT\");\n\t\tif (endpoint) config.endpoint = endpoint;\n\t}\n\tif (!config.namespace) {\n\t\tconst namespace = Deno.env.get(\"RIVET_NAMESPACE\");\n\t\tif (namespace) config.namespace = namespace;\n\t}\n\tif (!config.token) {\n\t\tconst token = Deno.env.get(\"RIVET_TOKEN\");\n\t\tif (token) config.token = token;\n\t}\n\tconst poolName = Deno.env.get(\"RIVET_POOL\");\n\tif (poolName && !config.envoy?.poolName) {\n\t\tconfig.envoy = { ...config.envoy, poolName };\n\t}\n\tif (!config.serverless?.basePath) {\n\t\tconfig.serverless = { ...config.serverless, basePath: managerPath };\n\t}\n}\n\n/**\n * Serves Rivet Actors from a Supabase Edge Function (Deno) on the wasm runtime.\n * Accepts either a registry from this package's `setup` or a setup config (which\n * is wired through `setup` for you).\n *\n * The Rivet manager API is mounted at the configured `serverless.basePath`\n * (or `managerPath`, default `/api/rivet`). Requests outside that path are\n * routed to `options.fetch` if provided. The engine endpoint is read from\n * `RIVET_ENDPOINT` (with `RIVET_NAMESPACE`, `RIVET_TOKEN`, `RIVET_POOL` optional)\n * unless set in the config.\n */\nexport async function serve<A extends RegistryActors>(\n\tregistryOrConfig: Registry<A> | SupabaseSetupConfig<A>,\n\toptions: ServeOptions = {},\n): Promise<void> {\n\tconst registry =\n\t\tregistryOrConfig instanceof Registry\n\t\t\t? registryOrConfig\n\t\t\t: setup(registryOrConfig);\n\n\tconst wasmModule = await Deno.readFile(resolveWasmUrl());\n\tconst config = registry.config as RegistryConfigInput<RegistryActors>;\n\tconfig.wasm = {\n\t\t...config.wasm,\n\t\tbindings: wasmBindings,\n\t\tinitInput: wasmModule,\n\t};\n\n\tconst managerPath =\n\t\tconfig.serverless?.basePath ??\n\t\toptions.managerPath ??\n\t\tDEFAULT_MANAGER_PATH;\n\tapplyEnv(config, managerPath);\n\n\tconst managerSegment = `${managerPath}/`;\n\n\tDeno.serve((request) => {\n\t\tconst url = new URL(request.url);\n\n\t\t// Manager request arriving at the configured base path.\n\t\tif (\n\t\t\turl.pathname === managerPath ||\n\t\t\turl.pathname.startsWith(managerSegment)\n\t\t) {\n\t\t\treturn registry.handler(request);\n\t\t}\n\n\t\t// Supabase mounts the function under `/functions/v1/<name>`, so the\n\t\t// manager API can arrive under a prefix (e.g. `/<name>/api/rivet/...`).\n\t\t// Strip any prefix before the manager path before handing off, so the\n\t\t// example does not need to configure a Supabase-specific base path.\n\t\tconst prefixedIndex = url.pathname.indexOf(managerSegment);\n\t\tif (prefixedIndex > 0) {\n\t\t\turl.pathname = url.pathname.slice(prefixedIndex);\n\t\t\treturn registry.handler(new Request(url, request));\n\t\t}\n\n\t\tif (options.fetch) {\n\t\t\treturn options.fetch(request);\n\t\t}\n\n\t\treturn new Response(\n\t\t\t\"This is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