Skip to content

Commit 0c4f39c

Browse files
thorwebdevinian
andauthored
feat: add functions-js (#403)
* chore: update dependencies. * chore: fix typedoc commands. * feat: add functions-js client. * chore: add example. * chore: update functions-js. * fix functions endpoint for self hosting Co-authored-by: Inian <[email protected]>
1 parent 41d6113 commit 0c4f39c

File tree

9 files changed

+17571
-791
lines changed

9 files changed

+17571
-791
lines changed

example/next-ts/next-env.d.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
/// <reference types="next" />
2-
/// <reference types="next/types/global" />
2+
/// <reference types="next/image-types/global" />
3+
4+
// NOTE: This file should not be edited
5+
// see https://nextjs.org/docs/basic-features/typescript for more information.

example/next-ts/package-lock.json

Lines changed: 8618 additions & 275 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import { NextApiRequest, NextApiResponse } from 'next'
2+
import { createClient } from '@supabase/supabase-js'
3+
4+
const supabase = createClient(process.env.NEXT_PUBLIC_SUPABASE_URL, process.env.SUPABASE_SECRET_KEY)
5+
6+
export default async (req: NextApiRequest, res: NextApiResponse) => {
7+
// Invoke your project's `hello-world` function.
8+
const { data, error } = await supabase.functions.invoke('hello-world', { responseType: 'text' })
9+
console.log('functions', data, error)
10+
11+
res.status(200).json({ data, error })
12+
}

example/next-ts/tsconfig.json

Lines changed: 5 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,7 @@
11
{
22
"compilerOptions": {
33
"target": "es5",
4-
"lib": [
5-
"dom",
6-
"dom.iterable",
7-
"esnext"
8-
],
4+
"lib": ["dom", "dom.iterable", "esnext"],
95
"allowJs": true,
106
"skipLibCheck": true,
117
"strict": false,
@@ -16,14 +12,9 @@
1612
"moduleResolution": "node",
1713
"resolveJsonModule": true,
1814
"isolatedModules": true,
19-
"jsx": "preserve"
15+
"jsx": "preserve",
16+
"incremental": true
2017
},
21-
"include": [
22-
"next-env.d.ts",
23-
"**/*.ts",
24-
"**/*.tsx"
25-
],
26-
"exclude": [
27-
"node_modules"
28-
]
18+
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
19+
"exclude": ["node_modules"]
2920
}

example/next-ts/yarn.lock

Lines changed: 108 additions & 332 deletions
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)