@supabase/lite 0.0.1-next.1
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/Connection-rAPmec1m.d.ts +710 -0
- package/dist/cli/index.d.ts +1 -0
- package/dist/cli/index.js +30950 -0
- package/dist/cli/lib.d.ts +158 -0
- package/dist/cli/lib.js +18598 -0
- package/dist/db/browser/index.d.ts +550 -0
- package/dist/db/browser/index.js +16112 -0
- package/dist/db/bun/index.d.ts +548 -0
- package/dist/db/bun/index.js +16100 -0
- package/dist/db/fallback.d.ts +182 -0
- package/dist/db/fallback.js +15996 -0
- package/dist/db/node/index.d.ts +547 -0
- package/dist/db/node/index.js +16093 -0
- package/dist/db/postgres/BasePostgresConnection-B7zHDAib.d.ts +24 -0
- package/dist/db/postgres/PostgresConnection.d.ts +16 -0
- package/dist/db/postgres/PostgresConnection.js +611 -0
- package/dist/db/postgres/pglite/PgliteConnection.d.ts +38 -0
- package/dist/db/postgres/pglite/PgliteConnection.js +890 -0
- package/dist/db/workerd/index.d.ts +570 -0
- package/dist/db/workerd/index.js +16218 -0
- package/dist/index-xv_pDjEt.d.ts +769 -0
- package/dist/index.d.ts +2498 -0
- package/dist/index.js +32305 -0
- package/dist/static/.vite/manifest.json +11 -0
- package/dist/static/assets/main-BsWx0q9l.js +40913 -0
- package/dist/static/assets/main-DexXgo9R.css +4002 -0
- package/dist/static/favicon.ico +0 -0
- package/dist/static/fonts/CustomFont-Black.woff2 +0 -0
- package/dist/static/fonts/CustomFont-BlackItalic.woff2 +0 -0
- package/dist/static/fonts/CustomFont-Bold.woff2 +0 -0
- package/dist/static/fonts/CustomFont-BoldItalic.woff2 +0 -0
- package/dist/static/fonts/CustomFont-Book.woff2 +0 -0
- package/dist/static/fonts/CustomFont-BookItalic.woff2 +0 -0
- package/dist/static/fonts/CustomFont-Medium.woff2 +0 -0
- package/dist/vite/index.d.ts +3017 -0
- package/dist/vite/index.js +1923 -0
- package/package.json +195 -0
|
@@ -0,0 +1,158 @@
|
|
|
1
|
+
import * as _supabase_supabase_js from '@supabase/supabase-js';
|
|
2
|
+
import { SupportedStorage, SupabaseClient } from '@supabase/supabase-js';
|
|
3
|
+
import { S as Schema } from '../index-xv_pDjEt.js';
|
|
4
|
+
import { Connection, DefaultAppConfig, App } from '@supabase/lite';
|
|
5
|
+
import 'jsonv-ts';
|
|
6
|
+
|
|
7
|
+
declare class Filesystem {
|
|
8
|
+
readonly root: string;
|
|
9
|
+
constructor(_path?: string, _root?: string);
|
|
10
|
+
private ensureRoot;
|
|
11
|
+
static homeDir(): string;
|
|
12
|
+
static projectDir(): string;
|
|
13
|
+
deleteAll(silent?: boolean): void;
|
|
14
|
+
delete(name: string, silent?: boolean): void;
|
|
15
|
+
write(name: string, content: string, silent?: boolean): void;
|
|
16
|
+
read(name: string, silent?: boolean): string | undefined;
|
|
17
|
+
relativePath(name?: string): string;
|
|
18
|
+
path(name?: string): string;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
declare class AuthStorage implements SupportedStorage {
|
|
22
|
+
private readonly root;
|
|
23
|
+
constructor(root: string);
|
|
24
|
+
getItem(key: string): Promise<string | null>;
|
|
25
|
+
setItem(key: string, value: string): Promise<void>;
|
|
26
|
+
removeItem(key: string): Promise<void>;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
interface BaseApiConfig {
|
|
30
|
+
host?: string;
|
|
31
|
+
token?: string;
|
|
32
|
+
root?: string;
|
|
33
|
+
client?: SupabaseClient;
|
|
34
|
+
authStorage?: AuthStorage;
|
|
35
|
+
withSupabaseClient?: boolean;
|
|
36
|
+
}
|
|
37
|
+
declare abstract class BaseApi<Config extends BaseApiConfig = BaseApiConfig> {
|
|
38
|
+
readonly config: Config;
|
|
39
|
+
protected readonly tempFs: Filesystem;
|
|
40
|
+
protected readonly projectFs: Filesystem;
|
|
41
|
+
protected readonly schemaFs: Filesystem;
|
|
42
|
+
protected readonly _client: SupabaseClient | undefined;
|
|
43
|
+
protected readonly authStorage: AuthStorage;
|
|
44
|
+
constructor(config: Config);
|
|
45
|
+
fetch(input: string | URL, init?: RequestInit): Promise<Response>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
type Project = {
|
|
49
|
+
id: string;
|
|
50
|
+
name?: string;
|
|
51
|
+
created_at: string;
|
|
52
|
+
};
|
|
53
|
+
interface ProjectApiConfig extends BaseApiConfig {
|
|
54
|
+
host: string;
|
|
55
|
+
}
|
|
56
|
+
declare class ProjectApi extends BaseApi {
|
|
57
|
+
readonly config: ProjectApiConfig;
|
|
58
|
+
constructor(config: ProjectApiConfig);
|
|
59
|
+
protected get client(): SupabaseClient;
|
|
60
|
+
protected projectRef(): string | undefined;
|
|
61
|
+
protected projectUrl(projectRef: string): string;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
declare class ProjectLocalApi extends ProjectApi {
|
|
65
|
+
ref(): string | undefined;
|
|
66
|
+
setRef(projectRef: string): this;
|
|
67
|
+
link(project: Project): Project;
|
|
68
|
+
unlink(): this;
|
|
69
|
+
url(): string;
|
|
70
|
+
getConfigPath(file_path?: string): Promise<string | undefined>;
|
|
71
|
+
protected readConfig(file_path?: string): Promise<Schema>;
|
|
72
|
+
createConnection(): Promise<Connection>;
|
|
73
|
+
getConfig(file_path?: string): Promise<DefaultAppConfig>;
|
|
74
|
+
createApp(config_path?: string): Promise<App>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
declare class ProjectRemoteApi extends ProjectApi {
|
|
78
|
+
url(projectRef: string): string;
|
|
79
|
+
ping(): Promise<boolean>;
|
|
80
|
+
list(): Promise<Project[]>;
|
|
81
|
+
get(projectRef?: string): Promise<Project>;
|
|
82
|
+
create(project?: Partial<Omit<Project, "id" | "created_at">>): Promise<Project>;
|
|
83
|
+
getConfig(projectRef: string): Promise<DefaultAppConfig>;
|
|
84
|
+
setConfig(projectRef: string, config: any): Promise<boolean>;
|
|
85
|
+
createApp(projectRef: string): Promise<App>;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface ApiConfig extends BaseApiConfig {
|
|
89
|
+
host: string;
|
|
90
|
+
root: string;
|
|
91
|
+
}
|
|
92
|
+
declare class Api extends BaseApi<ApiConfig> {
|
|
93
|
+
project: {
|
|
94
|
+
local: ProjectLocalApi;
|
|
95
|
+
remote: ProjectRemoteApi;
|
|
96
|
+
};
|
|
97
|
+
get client(): SupabaseClient;
|
|
98
|
+
getSession(): Promise<{
|
|
99
|
+
data: {
|
|
100
|
+
session: _supabase_supabase_js.AuthSession;
|
|
101
|
+
};
|
|
102
|
+
error: null;
|
|
103
|
+
} | {
|
|
104
|
+
data: {
|
|
105
|
+
session: null;
|
|
106
|
+
};
|
|
107
|
+
error: _supabase_supabase_js.AuthError;
|
|
108
|
+
} | {
|
|
109
|
+
data: {
|
|
110
|
+
session: null;
|
|
111
|
+
};
|
|
112
|
+
error: null;
|
|
113
|
+
}>;
|
|
114
|
+
getAccessToken(): Promise<string | undefined>;
|
|
115
|
+
requireSession(): Promise<string>;
|
|
116
|
+
init(): Promise<this>;
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
declare function createApi(options?: Partial<ApiConfig>): Promise<Api>;
|
|
120
|
+
|
|
121
|
+
declare function ensureInitialStructure(opts?: Partial<{
|
|
122
|
+
configFormat: "toml" | "json";
|
|
123
|
+
driver: NonNullable<Schema["db"]>["driver"];
|
|
124
|
+
recreate: boolean;
|
|
125
|
+
template: boolean;
|
|
126
|
+
}>): Promise<void>;
|
|
127
|
+
|
|
128
|
+
declare function ensureSchema(app: App, opts?: {
|
|
129
|
+
force?: boolean;
|
|
130
|
+
}): Promise<void>;
|
|
131
|
+
declare function watchSchema(app: App, opts?: {
|
|
132
|
+
force?: boolean;
|
|
133
|
+
translate?: boolean;
|
|
134
|
+
}): void;
|
|
135
|
+
|
|
136
|
+
interface MigrationFile {
|
|
137
|
+
version: string;
|
|
138
|
+
name: string | null;
|
|
139
|
+
filename: string;
|
|
140
|
+
path: string;
|
|
141
|
+
sql: string;
|
|
142
|
+
}
|
|
143
|
+
declare function migrationsDir(app: App): string;
|
|
144
|
+
declare function listMigrationFiles(app: App): Promise<MigrationFile[]>;
|
|
145
|
+
|
|
146
|
+
interface ApplyResult {
|
|
147
|
+
applied: MigrationFile[];
|
|
148
|
+
skipped: MigrationFile[];
|
|
149
|
+
}
|
|
150
|
+
/**
|
|
151
|
+
* Apply pending migrations to the connected database, one implicit transaction
|
|
152
|
+
* per file. The history INSERT is appended to the file's batch so a failure in
|
|
153
|
+
* any statement rolls back the record too — same semantics as Supabase CLI
|
|
154
|
+
* (`~/supabase/cli/pkg/migration/file.go:72-103` `ExecBatch`).
|
|
155
|
+
*/
|
|
156
|
+
declare function applyPendingMigrations(app: App): Promise<ApplyResult>;
|
|
157
|
+
|
|
158
|
+
export { applyPendingMigrations, createApi, ensureInitialStructure, ensureSchema, listMigrationFiles, migrationsDir, watchSchema };
|