Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(adapters): add SurrealDB adapter #6251

Merged
merged 57 commits into from
Sep 23, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
57 commits
Select commit Hold shift + click to select a range
3bcc11d
feat(adapter-surrealdb): implemented with unit tests
martinschaer Dec 28, 2022
f40b07c
Merge branch 'main' into feature/adapter-surrealdb
martinschaer Dec 30, 2022
2fc501e
chore: update README
martinschaer Jan 13, 2023
165c08b
Merge branch 'main' into feature/adapter-surrealdb
martinschaer Jan 13, 2023
308a18c
Use stateless DB connection
martinschaer Jan 15, 2023
fde4b49
Merge pull request #1 from martinschaer/feature/rest-adapter-surrealdb
martinschaer Jan 15, 2023
0da0783
Update surrealdb-rest-ts
martinschaer Jan 15, 2023
15d253e
Merge pull request #2 from martinschaer/feature/rest-adapter-surrealdb
martinschaer Jan 15, 2023
7af7ca4
chore: bump turbo and pnpm
balazsorban44 Mar 31, 2023
bc1a24b
chore(docs): fix dynamodb typo (#7130)
jakzo Apr 2, 2023
cdf4db4
chore: bump pnpm
balazsorban44 Apr 2, 2023
0503717
Merge branch 'main' of github.com:nextauthjs/next-auth
balazsorban44 Apr 2, 2023
11b073a
chore: update lock file, bump dev dependencies
balazsorban44 Apr 2, 2023
8afa92c
chore: run `pnpm install --fix-lockfile`
balazsorban44 Apr 2, 2023
cf3a4bb
chore: re-run pnpm install
balazsorban44 Apr 2, 2023
6f17c85
chore: add missing dev dep
balazsorban44 Apr 3, 2023
1f0fc7b
Merge branch 'main' into feature/adapter-surrealdb
martinschaer Apr 3, 2023
ef92bd7
revert lock
martinschaer Apr 3, 2023
0de02bd
update lock
martinschaer Apr 3, 2023
52b7244
use surrealdb.js
martinschaer Apr 3, 2023
1acce56
add rest test
martinschaer Apr 3, 2023
2426f12
remove commented-out code
martinschaer Apr 3, 2023
50ef715
update readme
martinschaer Apr 3, 2023
a289bc9
modularize repeated code
martinschaer Apr 3, 2023
c2eb9b3
fix(docs): fix default `maxAge` formula (#7406)
vixeven Apr 30, 2023
d739e8e
feat(adapters): add Account mapping before database write (#7369)
balazsorban44 Apr 30, 2023
5400645
chore: improve errors, add more docs (#7415)
balazsorban44 May 1, 2023
542c35d
fix: loosen profile types
balazsorban44 May 1, 2023
62e2ad1
chore: type fixes
balazsorban44 May 1, 2023
92a0fc4
fix: allow handling OAuth callback error response
balazsorban44 May 1, 2023
e3bdb38
fix(docs): remove extra heading
balazsorban44 May 3, 2023
6f5a503
chore: use `@ts-ignore`
balazsorban44 May 4, 2023
d6bc65f
chore: support release any package as experimental
balazsorban44 May 4, 2023
99247ce
chore: separate manual release job
balazsorban44 May 4, 2023
e0b5f18
chore: skip test for manual release
balazsorban44 May 4, 2023
eaf5080
chore: tweak
balazsorban44 May 4, 2023
8f416b6
chore: tweaks
balazsorban44 May 4, 2023
b96f013
chore: tweak manual release version
balazsorban44 May 5, 2023
8bf9b88
Use query instead of select to be able to use query params
martinschaer May 6, 2023
a47130a
Fix lint errors
martinschaer May 7, 2023
ab941b2
Merge branch 'main' into feature/adapter-surrealdb
martinschaer May 7, 2023
c8a7a6f
Update surrealdb.js and remove surrealdb-rest-ts in favor of Experime…
martinschaer May 7, 2023
106aebe
Merge branch 'main' into feature/adapter-surrealdb
martinschaer Sep 17, 2023
f2977ce
update pnpm-lock
martinschaer Sep 17, 2023
ab045b6
fix merge
martinschaer Sep 17, 2023
9070aed
fix merge
martinschaer Sep 17, 2023
72f95b6
fix merge
martinschaer Sep 17, 2023
e463d82
migrate surrealdb.js api
martinschaer Sep 17, 2023
a4ff2df
fix queries
martinschaer Sep 17, 2023
1ee9edc
update package.json
martinschaer Sep 17, 2023
a644937
fix types
martinschaer Sep 17, 2023
aea2d7f
prepare for rest
martinschaer Sep 17, 2023
2600a74
update readme
martinschaer Sep 17, 2023
d1c5647
Merge branch 'main' into feature/adapter-surrealdb
ThangHuuVu Sep 23, 2023
e3516cb
chore: format PR
ThangHuuVu Sep 23, 2023
b121cd9
Update README.md
ThangHuuVu Sep 23, 2023
56aeb74
Update package.json
ThangHuuVu Sep 23, 2023
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions docs/docs/reference/adapters/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,10 @@ Using an Auth.js / NextAuth.js adapter you can connect to any database service o
<img src="/img/adapters/supabase.svg" width="25" />
<h4 class="adapter-card__title">Supabase Adapter</h4>
</a>
<a href="/reference/adapter/surrealdb" class="adapter-card">
<img src="/img/adapters/surreal.png" width="25" />
<h4 class="adapter-card__title">SurrealDB Adapter</h4>
</a>
<a href="/reference/adapter/typeorm" class="adapter-card">
<img src="/img/adapters/typeorm.png" width="30" />
<h4 class="adapter-card__title">TypeORM Adapter</h4>
Expand Down
1 change: 1 addition & 0 deletions docs/docusaurus.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -299,6 +299,7 @@ const docusaurusConfig = {
typedocAdapter("TypeORM"),
typedocAdapter("Sequelize"),
typedocAdapter("Supabase"),
typedocAdapter("SurrealDB"),
typedocAdapter("Upstash Redis"),
typedocAdapter("Xata"),
]),
Expand Down
1 change: 1 addition & 0 deletions docs/sidebars.js
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,7 @@ module.exports = {
{ type: "doc", id: "reference/adapter/prisma/index" },
{ type: "doc", id: "reference/adapter/sequelize/index" },
{ type: "doc", id: "reference/adapter/supabase/index" },
{ type: "doc", id: "reference/adapter/surrealdb/index" },
{ type: "doc", id: "reference/adapter/typeorm/index" },
{ type: "doc", id: "reference/adapter/upstash-redis/index" },
{ type: "doc", id: "reference/adapter/xata/index" },
Expand Down
Binary file added docs/static/img/adapters/surreal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
28 changes: 28 additions & 0 deletions packages/adapter-surrealdb/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<p align="center">
<br/>
<a href="https://authjs.dev" target="_blank">
<img height="64px" src="https://authjs.dev/img/logo/logo-sm.png" />
</a>
<a href="https://surrealdb.com/" target="_blank">
<img height="64px" src="https://authjs.dev/img/adapters/surrealdb.png"/>
</a>
<h3 align="center"><b>Surreal DB Adapter</b> - NextAuth.js / Auth.js</a></h3>
<p align="center" style="align: center;">
<a href="https://npm.im/@auth/surrealdb-adapter">
<img src="https://img.shields.io/badge/TypeScript-blue?style=flat-square" alt="TypeScript" />
</a>
<a href="https://npm.im/@auth/surrealdb-adapter">
<img alt="npm" src="https://img.shields.io/npm/v/@auth/surrealdb-adapter?color=green&label=@auth/surrealdb-adapter&style=flat-square">
</a>
<a href="https://www.npmtrends.com/@auth/surrealdb-adapter">
<img src="https://img.shields.io/npm/dm/@auth/surrealdb-adapter?label=%20downloads&style=flat-square" alt="Downloads" />
</a>
<a href="https://github.com/nextauthjs/next-auth/stargazers">
<img src="https://img.shields.io/github/stars/nextauthjs/next-auth?style=flat-square" alt="Github Stars" />
</a>
</p>
</p>

---

Check out the documentation at [authjs.dev](https://authjs.dev/reference/adapter/surrealdb).
60 changes: 60 additions & 0 deletions packages/adapter-surrealdb/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
{
"name": "@next-auth/surrealdb-adapter",
"version": "0.0.0",
"description": "SurrealDB adapter for next-auth.",
"homepage": "https://authjs.dev",
"repository": "https://github.com/nextauthjs/next-auth",
"bugs": {
"url": "https://github.com/nextauthjs/next-auth/issues"
},
"author": "Martin Schaer <martin@schaerweb.com>",
"contributors": [
"Thang Huu Vu <hi@thvu.dev>"
],
"type": "module",
"types": "./index.d.ts",
"files": [
"*.js",
"*.d.ts*",
"src"
],
"exports": {
".": {
"types": "./index.d.ts",
"import": "./index.js"
}
},
"license": "ISC",
"keywords": [
"next-auth",
"next.js",
"oauth",
"mongodb",
"adapter"
],
"private": false,
"publishConfig": {
"access": "public"
},
"scripts": {
"test": "./tests/test.sh",
"test:watch": "./tests/test.sh -w",
"build": "tsc"
},
"dependencies": {
"@auth/core": "workspace:*"
},
"peerDependencies": {
"surrealdb.js": "^0.9.0"
},
"devDependencies": {
"@types/node-fetch": "^2.5.11",
"@auth/adapter-test": "workspace:*",
"@auth/tsconfig": "workspace:*",
"jest": "^27.4.3",
"node-fetch": "^2.6.1"
},
"jest": {
"preset": "@auth/adapter-test/jest"
}
}
Loading
Loading