forked from surrealdb/surrealdb.node
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
25 lines (23 loc) · 1.47 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export class Surreal {
constructor()
connect(endpoint: string, opts?: Record<string, unknown>): Promise<void>
use(value: { namespace?: string; database?: string }): Promise<void>
set(key: string, value: unknown): Promise<void>
unset(key: string): Promise<void>
signup(credentials: { namespace: string; database: string; scope: string; [k: string]: unknown }): Promise<string>
signin(credentials: { username: string; password: string } | { namespace: string; username: string; password: string } | { namespace: string; database: string; username: string; password: string } | { namespace: string; database: string; scope: string; [k: string]: unknown }): Promise<string>
invalidate(): Promise<void>
authenticate(token: string): Promise<boolean>
query(sql: string, bindings?: Record<string, unknown>): Promise<unknown[]>
select(resource: string): Promise<{ id: string; [k: string]: unknown }[]>
create(resource: string, data?: Record<string, unknown>): Promise<{ id: string; [k: string]: unknown }[]>
update(resource: string, data?: Record<string, unknown>): Promise<{ id: string; [k: string]: unknown }[]>
merge(resource: string, data: Record<string, unknown>): Promise<{ id: string; [k: string]: unknown }[]>
patch(resource: string, data: unknown[]): Promise<unknown[]>
delete(resource: string): Promise<{ id: string; [k: string]: unknown }[]>
version(): Promise<string>
health(): Promise<void>
}