@motherbase/client 1.2.8 → 1.4.0
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/README.md +73 -9
- package/dist/auth.d.ts +172 -14
- package/dist/auth.d.ts.map +1 -1
- package/dist/auth.js +399 -14
- package/dist/auth.js.map +1 -1
- package/dist/channel.d.ts +15 -12
- package/dist/channel.d.ts.map +1 -1
- package/dist/channel.js.map +1 -1
- package/dist/compat.d.ts +40 -0
- package/dist/compat.d.ts.map +1 -0
- package/dist/compat.js +98 -0
- package/dist/compat.js.map +1 -0
- package/dist/cookie.d.ts +23 -2
- package/dist/cookie.d.ts.map +1 -1
- package/dist/cookie.js +71 -9
- package/dist/cookie.js.map +1 -1
- package/dist/database.d.ts +20 -1
- package/dist/database.d.ts.map +1 -1
- package/dist/functions.d.ts +36 -0
- package/dist/functions.d.ts.map +1 -1
- package/dist/functions.js +56 -5
- package/dist/functions.js.map +1 -1
- package/dist/http.d.ts +47 -7
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +73 -12
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +79 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +183 -11
- package/dist/index.js.map +1 -1
- package/dist/postgrest.d.ts +94 -1
- package/dist/postgrest.d.ts.map +1 -1
- package/dist/postgrest.js +185 -17
- package/dist/postgrest.js.map +1 -1
- package/dist/query.d.ts +97 -0
- package/dist/query.d.ts.map +1 -0
- package/dist/query.js +94 -0
- package/dist/query.js.map +1 -0
- package/dist/session.d.ts +19 -1
- package/dist/session.d.ts.map +1 -1
- package/dist/session.js +57 -4
- package/dist/session.js.map +1 -1
- package/dist/storage.d.ts +172 -5
- package/dist/storage.d.ts.map +1 -1
- package/dist/storage.js +249 -6
- package/dist/storage.js.map +1 -1
- package/dist/testing.d.ts +38 -0
- package/dist/testing.d.ts.map +1 -0
- package/dist/testing.js +50 -0
- package/dist/testing.js.map +1 -0
- package/dist/types.d.ts +264 -20
- package/dist/types.d.ts.map +1 -1
- package/dist/warn.d.ts +4 -0
- package/dist/warn.d.ts.map +1 -0
- package/dist/warn.js +27 -0
- package/dist/warn.js.map +1 -0
- package/package.json +60 -52
package/dist/index.js
CHANGED
|
@@ -1,12 +1,36 @@
|
|
|
1
1
|
import { HttpClient, toError } from './http.js';
|
|
2
2
|
import { contractPath } from '@motherbase/contracts';
|
|
3
|
-
import { SessionStore, memoryStorage, localStorageStorage } from './session.js';
|
|
3
|
+
import { SessionStore, memoryStorage, localStorageStorage, keyValueStorage, isKeyValueStorage } from './session.js';
|
|
4
4
|
import { AuthClient } from './auth.js';
|
|
5
5
|
import { StorageClient } from './storage.js';
|
|
6
6
|
import { FunctionsClient } from './functions.js';
|
|
7
7
|
import { RealtimeModule } from './realtime.js';
|
|
8
8
|
import { RealtimeChannel } from './channel.js';
|
|
9
9
|
import { PostgrestQueryBuilder } from './postgrest.js';
|
|
10
|
+
import { isProduction } from './cookie.js';
|
|
11
|
+
/**
|
|
12
|
+
* Pick the session storage from either options shape.
|
|
13
|
+
*
|
|
14
|
+
* Precedence: the native `storage` (explicit and already the right shape), then
|
|
15
|
+
* supabase-js's `auth.storage` (wrapped if it is a key/value store), then
|
|
16
|
+
* `auth.persistSession` on its own, which in supabase-js means localStorage.
|
|
17
|
+
* Returns `undefined` when nothing was asked for, so the caller can tell "no
|
|
18
|
+
* choice made" from "memory was chosen" and warn accordingly.
|
|
19
|
+
*/
|
|
20
|
+
function resolveStorage(options) {
|
|
21
|
+
if (options.storage)
|
|
22
|
+
return options.storage;
|
|
23
|
+
const key = options.auth?.storageKey;
|
|
24
|
+
const provided = options.auth?.storage;
|
|
25
|
+
if (provided) {
|
|
26
|
+
return isKeyValueStorage(provided) ? keyValueStorage(provided, key) : provided;
|
|
27
|
+
}
|
|
28
|
+
if (options.auth?.persistSession === true)
|
|
29
|
+
return localStorageStorage(key);
|
|
30
|
+
if (options.auth?.persistSession === false)
|
|
31
|
+
return memoryStorage();
|
|
32
|
+
return undefined;
|
|
33
|
+
}
|
|
10
34
|
/**
|
|
11
35
|
* Supabase-js-compatible client for a Motherbase backend.
|
|
12
36
|
*
|
|
@@ -26,18 +50,29 @@ export class MotherbaseClient {
|
|
|
26
50
|
this.url = url;
|
|
27
51
|
this.key = key;
|
|
28
52
|
this.channels = new Map();
|
|
53
|
+
this.requestObservers = new Set();
|
|
29
54
|
// `globalThis.fetch` is a native function that requires `this === window`
|
|
30
|
-
// (or an equivalent global) when invoked
|
|
55
|
+
// (or an equivalent global) when invoked: copying the reference without
|
|
31
56
|
// binding it throws "Illegal invocation" the moment it's called as
|
|
32
57
|
// `this.opts.fetch(...)` inside HttpClient. Bind it once here.
|
|
33
|
-
const fetchImpl = options.fetch ?? globalThis.fetch?.bind(globalThis);
|
|
58
|
+
const fetchImpl = options.fetch ?? options.global?.fetch ?? globalThis.fetch?.bind(globalThis);
|
|
34
59
|
if (!fetchImpl) {
|
|
35
60
|
throw new Error('No fetch implementation found. Pass `fetch` in options for this runtime.');
|
|
36
61
|
}
|
|
37
|
-
const autoRefresh = options.autoRefresh ?? true;
|
|
38
|
-
const headers = { ...options.headers };
|
|
62
|
+
const autoRefresh = options.autoRefresh ?? options.auth?.autoRefreshToken ?? true;
|
|
63
|
+
const headers = { ...options.global?.headers, ...options.headers };
|
|
39
64
|
if (key)
|
|
40
65
|
headers['apikey'] = key;
|
|
66
|
+
this.compat = options.compat === 'supabase';
|
|
67
|
+
// Only `public` is exposed by the REST layer. A ported app that asked for
|
|
68
|
+
// another schema would otherwise read `public` under a different name and
|
|
69
|
+
// find the wrong rows (or none), which is far harder to diagnose than the
|
|
70
|
+
// error it gets here.
|
|
71
|
+
const schema = options.db?.schema;
|
|
72
|
+
if (schema && schema !== 'public') {
|
|
73
|
+
throw new Error(`db.schema: '${schema}' is not exposed. The Motherbase REST API serves the public schema only. `
|
|
74
|
+
+ 'Move the tables to public, or expose them through a view or an RPC.');
|
|
75
|
+
}
|
|
41
76
|
// A secret key runs every request as service_role, which bypasses row level
|
|
42
77
|
// security. In a browser it is readable by anyone who opens devtools, so it
|
|
43
78
|
// is not "a key that leaked", it is the whole database published. Warn
|
|
@@ -49,7 +84,22 @@ export class MotherbaseClient {
|
|
|
49
84
|
+ 'Secret keys bypass row level security and must stay server side. '
|
|
50
85
|
+ 'Use the publishable key here.');
|
|
51
86
|
}
|
|
52
|
-
|
|
87
|
+
const storageAdapter = resolveStorage(options);
|
|
88
|
+
// The default adapter keeps the session in memory only: it does not survive
|
|
89
|
+
// a reload, and the server never sees it. That is the right default for a
|
|
90
|
+
// script or a test, and a bug in a browser app, and it presents as
|
|
91
|
+
// "getUser() returns null everywhere", which reads like an auth problem
|
|
92
|
+
// rather than a storage one. Point at the fix once, in development.
|
|
93
|
+
if (!storageAdapter && typeof window !== 'undefined' && !MotherbaseClient.warnedAboutStorage) {
|
|
94
|
+
MotherbaseClient.warnedAboutStorage = true;
|
|
95
|
+
if (!isProduction()) {
|
|
96
|
+
console.warn('[motherbase] createClient() was called in a browser without a `storage` adapter, so the '
|
|
97
|
+
+ 'session lives in memory and is lost on reload. Pass `storage: cookieStorage()` (or '
|
|
98
|
+
+ '`localStorageStorage()`), or use `createBrowserClient` from `@motherbase/ssr`, which '
|
|
99
|
+
+ 'writes the cookie the server needs to read.');
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
this.store = new SessionStore(storageAdapter ?? memoryStorage());
|
|
53
103
|
// auth needs the http client, and http needs auth._refresh for the 401 path,
|
|
54
104
|
// so wire them in two steps with a late-bound refresh callback.
|
|
55
105
|
// prefer-const cannot see the closure above: `auth` is read by the refresh
|
|
@@ -59,12 +109,22 @@ export class MotherbaseClient {
|
|
|
59
109
|
this.http = new HttpClient(url, this.store, { autoRefresh, fetch: fetchImpl, headers }, () => auth._refresh());
|
|
60
110
|
auth = new AuthClient(this.http, this.store);
|
|
61
111
|
this.auth = auth;
|
|
62
|
-
this.storage = new StorageClient(this.http, url);
|
|
112
|
+
this.storage = new StorageClient(this.http, url, fetchImpl);
|
|
63
113
|
this.functions = new FunctionsClient(this.http);
|
|
64
114
|
this.realtime = new RealtimeModule(url, this.store, fetchImpl, options.realtimeIoFactory);
|
|
115
|
+
// supabase-js finishes an OAuth redirect on its own (detectSessionInUrl
|
|
116
|
+
// defaults to true), so ported code never calls anything after the provider
|
|
117
|
+
// sends the browser back. Do the same, and only when there is actually a
|
|
118
|
+
// token in the fragment: on every other page load this is a no-op with no
|
|
119
|
+
// network call. Opt out with `auth: { detectSessionInUrl: false }`.
|
|
120
|
+
if (options.auth?.detectSessionInUrl !== false
|
|
121
|
+
&& typeof window !== 'undefined'
|
|
122
|
+
&& window.location?.hash?.includes('access_token=')) {
|
|
123
|
+
void this.auth.getSessionFromUrl();
|
|
124
|
+
}
|
|
65
125
|
}
|
|
66
126
|
from(table) {
|
|
67
|
-
return new PostgrestQueryBuilder(this.http, table);
|
|
127
|
+
return new PostgrestQueryBuilder(this.http, table, this.compat);
|
|
68
128
|
}
|
|
69
129
|
/**
|
|
70
130
|
* Call a database function, typed from the generated `Functions` map.
|
|
@@ -104,6 +164,93 @@ export class MotherbaseClient {
|
|
|
104
164
|
return { data: null, error: toError(err), count: null };
|
|
105
165
|
}
|
|
106
166
|
}
|
|
167
|
+
/**
|
|
168
|
+
* Watch every HTTP request this client makes.
|
|
169
|
+
*
|
|
170
|
+
* One event per round trip, with method, path, status, duration and the
|
|
171
|
+
* `x-request-id` the server logged it under. That id is the whole point: it
|
|
172
|
+
* is what turns "a query was slow for a user yesterday" into a line in the
|
|
173
|
+
* project's logs.
|
|
174
|
+
*
|
|
175
|
+
* ```ts
|
|
176
|
+
* client.on('request', e => console.log(e.method, e.path, e.status, e.durationMs))
|
|
177
|
+
* ```
|
|
178
|
+
*
|
|
179
|
+
* Returns the unsubscribe function. An observer that throws is ignored: it is
|
|
180
|
+
* a spectator, and a broken logger must not fail the request it was logging.
|
|
181
|
+
*/
|
|
182
|
+
on(event, listener) {
|
|
183
|
+
if (event !== 'request')
|
|
184
|
+
throw new Error(`Unknown client event '${String(event)}'. Only 'request' exists.`);
|
|
185
|
+
this.requestObservers.add(listener);
|
|
186
|
+
this.syncRequestObserver();
|
|
187
|
+
return () => {
|
|
188
|
+
this.requestObservers.delete(listener);
|
|
189
|
+
this.syncRequestObserver();
|
|
190
|
+
};
|
|
191
|
+
}
|
|
192
|
+
syncRequestObserver() {
|
|
193
|
+
this.http.setRequestObserver(this.requestObservers.size
|
|
194
|
+
? (event) => {
|
|
195
|
+
for (const listener of this.requestObservers)
|
|
196
|
+
listener(event);
|
|
197
|
+
}
|
|
198
|
+
: undefined);
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Several writes, applied in one database transaction, all or nothing.
|
|
202
|
+
*
|
|
203
|
+
* supabase-js has no equivalent. What people write instead is a sequence of
|
|
204
|
+
* awaited writes inside a `try`, which is not a rollback: whatever already
|
|
205
|
+
* committed stays committed, and the catch block is left holding half a
|
|
206
|
+
* change it cannot undo.
|
|
207
|
+
*
|
|
208
|
+
* The callback does not await anything. It DESCRIBES the writes; they are
|
|
209
|
+
* sent together and applied together:
|
|
210
|
+
*
|
|
211
|
+
* ```ts
|
|
212
|
+
* const { data, error } = await client.transaction(tx => {
|
|
213
|
+
* tx.from('orders').insert({ id, total })
|
|
214
|
+
* tx.from('stock').update({ count: 4 }).eq('sku', sku)
|
|
215
|
+
* })
|
|
216
|
+
* ```
|
|
217
|
+
*
|
|
218
|
+
* `data` is one result array per operation, in the order they were declared.
|
|
219
|
+
* Reads are refused: a batch exists to make writes atomic, and a read in the
|
|
220
|
+
* middle of one invites expectations about ordering that nothing guarantees.
|
|
221
|
+
*/
|
|
222
|
+
async transaction(build) {
|
|
223
|
+
const recorded = [];
|
|
224
|
+
const tx = {
|
|
225
|
+
from: ((table) => {
|
|
226
|
+
const builder = new PostgrestQueryBuilder(this.http, table, this.compat);
|
|
227
|
+
recorded.push(builder);
|
|
228
|
+
return builder;
|
|
229
|
+
}),
|
|
230
|
+
};
|
|
231
|
+
try {
|
|
232
|
+
build(tx);
|
|
233
|
+
const operations = recorded.map(builder => {
|
|
234
|
+
const request = builder.toRequest();
|
|
235
|
+
if (request.method === 'GET' || request.method === 'HEAD') {
|
|
236
|
+
throw new Error(`transaction(): '${request.model}' was read, not written. A transaction takes writes only `
|
|
237
|
+
+ '(insert, upsert, update, delete).');
|
|
238
|
+
}
|
|
239
|
+
return request;
|
|
240
|
+
});
|
|
241
|
+
if (!operations.length) {
|
|
242
|
+
throw new Error('transaction(): the callback declared no writes.');
|
|
243
|
+
}
|
|
244
|
+
const result = await this.http.request(`${contractPath.rest('batch')}`, {
|
|
245
|
+
method: 'POST',
|
|
246
|
+
body: { operations },
|
|
247
|
+
});
|
|
248
|
+
return { data: result.results, error: null, count: null };
|
|
249
|
+
}
|
|
250
|
+
catch (err) {
|
|
251
|
+
return { data: null, error: toError(err), count: null };
|
|
252
|
+
}
|
|
253
|
+
}
|
|
107
254
|
/** Create (or reuse) a realtime channel. */
|
|
108
255
|
channel(name, opts = {}) {
|
|
109
256
|
const existing = this.channels.get(name);
|
|
@@ -113,6 +260,24 @@ export class MotherbaseClient {
|
|
|
113
260
|
this.channels.set(name, channel);
|
|
114
261
|
return channel;
|
|
115
262
|
}
|
|
263
|
+
/** Every channel this client created, as supabase-js reports them. */
|
|
264
|
+
getChannels() {
|
|
265
|
+
return Array.from(this.channels.values());
|
|
266
|
+
}
|
|
267
|
+
/**
|
|
268
|
+
* supabase-js's schema switcher.
|
|
269
|
+
*
|
|
270
|
+
* The Motherbase REST layer serves `public` and nothing else, so this returns
|
|
271
|
+
* the client for `'public'` and throws for anything else rather than issuing
|
|
272
|
+
* a request that would silently read the wrong tables.
|
|
273
|
+
*/
|
|
274
|
+
schema(name) {
|
|
275
|
+
if (name !== 'public') {
|
|
276
|
+
throw new Error(`schema('${name}') is not supported: the Motherbase REST API exposes the public schema only. `
|
|
277
|
+
+ 'Expose the data through a view or an RPC in public instead.');
|
|
278
|
+
}
|
|
279
|
+
return this;
|
|
280
|
+
}
|
|
116
281
|
/** Unsubscribe and drop a channel. */
|
|
117
282
|
async removeChannel(channel) {
|
|
118
283
|
await channel.unsubscribe();
|
|
@@ -130,9 +295,15 @@ export class MotherbaseClient {
|
|
|
130
295
|
return this.store.hydrate();
|
|
131
296
|
}
|
|
132
297
|
}
|
|
298
|
+
MotherbaseClient.warnedAboutStorage = false;
|
|
133
299
|
/**
|
|
134
300
|
* Create a Supabase-compatible Motherbase client.
|
|
135
301
|
*
|
|
302
|
+
* In a Next.js app, prefer `createBrowserClient` / `createServerClient` from
|
|
303
|
+
* `@motherbase/ssr`: they persist the session to a cookie both halves can read.
|
|
304
|
+
* `createClient()` on its own keeps the session in memory, which the server
|
|
305
|
+
* cannot see, so every server-rendered `getUser()` returns null.
|
|
306
|
+
*
|
|
136
307
|
* @param url Backend API base URL.
|
|
137
308
|
* @param key Anon/publishable key (optional). Sent as an `apikey` header.
|
|
138
309
|
* @param options Session storage, fetch override, extra headers.
|
|
@@ -147,13 +318,14 @@ export function createClient(url, key, options = {}) {
|
|
|
147
318
|
return new MotherbaseClient(url, key, options);
|
|
148
319
|
}
|
|
149
320
|
export { BackendError } from './http.js';
|
|
150
|
-
export { memoryStorage, localStorageStorage };
|
|
151
|
-
export {
|
|
321
|
+
export { memoryStorage, localStorageStorage, keyValueStorage };
|
|
322
|
+
export { normalizeSession, normalizeUser } from './compat.js';
|
|
323
|
+
export { cookieStorage, serverCookieStorage, SESSION_COOKIE_KEY } from './cookie.js';
|
|
152
324
|
export { PostgrestQueryBuilder } from './postgrest.js';
|
|
153
325
|
export { AuthClient } from './auth.js';
|
|
154
326
|
export { MfaClient } from './mfa.js';
|
|
155
327
|
export { AuthAdminClient } from './admin.js';
|
|
156
328
|
export { StorageClient, StorageBucket } from './storage.js';
|
|
157
|
-
export { FunctionsClient } from './functions.js';
|
|
329
|
+
export { FunctionsClient, FunctionsError, FunctionsHttpError, FunctionsRelayError, FunctionsFetchError } from './functions.js';
|
|
158
330
|
export { RealtimeChannel } from './channel.js';
|
|
159
331
|
//# sourceMappingURL=index.js.map
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAEhD,OAAO,EAAE,YAAY,EAAE,MAAM,uBAAuB,CAAC;AACrD,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,mBAAmB,EAAE,eAAe,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACpH,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAC7C,OAAO,EAAE,eAAe,EAAE,MAAM,gBAAgB,CAAC;AACjD,OAAO,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAC/C,OAAO,EAAE,eAAe,EAA+B,MAAM,cAAc,CAAC;AAC5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,gBAAgB,CAAC;AAGvD,OAAO,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAuC3C;;;;;;;;GAQG;AACH,SAAS,cAAc,CAAC,OAAsB;IAC5C,IAAI,OAAO,CAAC,OAAO;QAAE,OAAO,OAAO,CAAC,OAAO,CAAC;IAE5C,MAAM,GAAG,GAAG,OAAO,CAAC,IAAI,EAAE,UAAU,CAAC;IACrC,MAAM,QAAQ,GAAG,OAAO,CAAC,IAAI,EAAE,OAAO,CAAC;IACvC,IAAI,QAAQ,EAAE,CAAC;QACb,OAAO,iBAAiB,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,eAAe,CAAC,QAAQ,EAAE,GAAG,CAAC,CAAC,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AAM,cAAc,CAAC"}
|
package/dist/postgrest.d.ts
CHANGED
|
@@ -43,6 +43,10 @@ export interface OrderOptions extends ReferencedTableOption {
|
|
|
43
43
|
ascending?: boolean;
|
|
44
44
|
nullsFirst?: boolean;
|
|
45
45
|
}
|
|
46
|
+
export interface PaginateOptions {
|
|
47
|
+
/** Rows per request. Capped server side by `api.rest.maxRows`. Default 1000. */
|
|
48
|
+
pageSize?: number;
|
|
49
|
+
}
|
|
46
50
|
export interface SelectOptions {
|
|
47
51
|
count?: PostgrestCount;
|
|
48
52
|
/** Send the request as HEAD: no rows come back, only the count. */
|
|
@@ -87,10 +91,18 @@ export declare function encodeLiteral(value: PostgrestPrimitive): string;
|
|
|
87
91
|
* `/rest/v1/:model` query-param dialect. Awaiting it resolves to
|
|
88
92
|
* `{ data, error, count }` and never rejects for expected API errors (only for
|
|
89
93
|
* programmer misuse).
|
|
94
|
+
*
|
|
95
|
+
* @internal This is the implementation behind `client.from()`, not a surface to
|
|
96
|
+
* construct directly. The public, typed entry point is `client.from(table)`,
|
|
97
|
+
* whose return type (`TypedQuery`, from `database.ts`) is what user code should
|
|
98
|
+
* name. It is exported only so the type can be referenced where inference needs
|
|
99
|
+
* a name for it.
|
|
90
100
|
*/
|
|
91
101
|
export declare class PostgrestQueryBuilder<Row extends object = Record<string, unknown>> implements PromiseLike<PostgrestResponse<Row[]>> {
|
|
92
102
|
private readonly http;
|
|
93
103
|
private readonly model;
|
|
104
|
+
/** supabase-js semantic parity, from `createClient(..., { compat: 'supabase' })`. */
|
|
105
|
+
private readonly compat;
|
|
94
106
|
private method;
|
|
95
107
|
private columns;
|
|
96
108
|
/**
|
|
@@ -114,7 +126,12 @@ export declare class PostgrestQueryBuilder<Row extends object = Record<string, u
|
|
|
114
126
|
private signal?;
|
|
115
127
|
private body?;
|
|
116
128
|
private rowMode;
|
|
117
|
-
|
|
129
|
+
private shouldThrow;
|
|
130
|
+
/** Set by `select()`, so a write can tell "rows asked for" from "rows always returned". */
|
|
131
|
+
private selectCalled;
|
|
132
|
+
constructor(http: HttpClient, model: string,
|
|
133
|
+
/** supabase-js semantic parity, from `createClient(..., { compat: 'supabase' })`. */
|
|
134
|
+
compat?: boolean);
|
|
118
135
|
/**
|
|
119
136
|
* Choose the columns, and optionally ask for a row count.
|
|
120
137
|
*
|
|
@@ -195,6 +212,37 @@ export declare class PostgrestQueryBuilder<Row extends object = Record<string, u
|
|
|
195
212
|
limit(count: number, options?: ReferencedTableOption): this;
|
|
196
213
|
/** Inclusive range -> offset/limit. `range(0, 9)` fetches 10 rows from offset 0. */
|
|
197
214
|
range(from: number, to: number, options?: ReferencedTableOption): this;
|
|
215
|
+
/**
|
|
216
|
+
* Every matching row, one page at a time.
|
|
217
|
+
*
|
|
218
|
+
* An unbounded `select()` stops at the server's `api.rest.maxRows` (1000 by
|
|
219
|
+
* default) and says nothing about it: the caller gets a full-looking array
|
|
220
|
+
* that is missing everything past the cap. This walks the result instead, so
|
|
221
|
+
* "give me all of them" is expressible without knowing the cap exists.
|
|
222
|
+
*
|
|
223
|
+
* ```ts
|
|
224
|
+
* for await (const row of client.from('events').select('*').stream()) { ... }
|
|
225
|
+
* ```
|
|
226
|
+
*
|
|
227
|
+
* The pages are separate requests, so rows inserted while the walk is running
|
|
228
|
+
* may be seen or missed depending on when they land. Order by a stable column
|
|
229
|
+
* if that matters.
|
|
230
|
+
*/
|
|
231
|
+
stream(options?: PaginateOptions): AsyncGenerator<Row, void, undefined>;
|
|
232
|
+
/**
|
|
233
|
+
* Like `stream()`, a page at a time rather than a row at a time, with the
|
|
234
|
+
* total from `Content-Range` when the server sent one.
|
|
235
|
+
*
|
|
236
|
+
* An error ends the walk by throwing, unlike awaiting the builder, which
|
|
237
|
+
* resolves `{ data, error }`. A `for await` loop has nowhere to put an error
|
|
238
|
+
* value, and silently ending the iteration early would look exactly like
|
|
239
|
+
* reaching the last page.
|
|
240
|
+
*/
|
|
241
|
+
paginate(options?: PaginateOptions): AsyncGenerator<{
|
|
242
|
+
rows: Row[];
|
|
243
|
+
from: number;
|
|
244
|
+
count: number | null;
|
|
245
|
+
}, void, undefined>;
|
|
198
246
|
/** Cancel the in-flight request when the signal aborts. */
|
|
199
247
|
abortSignal(signal: AbortSignal): this;
|
|
200
248
|
/**
|
|
@@ -202,6 +250,34 @@ export declare class PostgrestQueryBuilder<Row extends object = Record<string, u
|
|
|
202
250
|
* `Database` cannot express (a computed column, an embedded shape).
|
|
203
251
|
*/
|
|
204
252
|
returns<T extends object>(): PostgrestQueryBuilder<T>;
|
|
253
|
+
/** supabase-js's newer name for `returns()`. Also a compile-time cast only. */
|
|
254
|
+
overrideTypes<T extends object>(): PostgrestQueryBuilder<T>;
|
|
255
|
+
/**
|
|
256
|
+
* Reject the query instead of resolving `{ data: null, error }`.
|
|
257
|
+
*
|
|
258
|
+
* The `{ data, error }` envelope is the default in both SDKs because it makes
|
|
259
|
+
* a failure impossible to skip by accident. `throwOnError()` is the opt-out
|
|
260
|
+
* for code that would rather use try/catch, and ported Supabase code uses it
|
|
261
|
+
* widely enough that its absence is a `TypeError: … is not a function` on the
|
|
262
|
+
* first query.
|
|
263
|
+
*/
|
|
264
|
+
throwOnError(): this;
|
|
265
|
+
/**
|
|
266
|
+
* Fail the write if it would touch more than `count` rows.
|
|
267
|
+
*
|
|
268
|
+
* A guard against the missing-filter class of accident (`update()` with a
|
|
269
|
+
* typo'd `.eq()`), sent as `Prefer: max-affected`. A server that does not
|
|
270
|
+
* implement it ignores the preference, so treat this as a safety net rather
|
|
271
|
+
* than a guarantee, and keep the filter correct.
|
|
272
|
+
*/
|
|
273
|
+
maxAffected(count: number): this;
|
|
274
|
+
/**
|
|
275
|
+
* Roll the transaction back after running the query, so nothing is persisted.
|
|
276
|
+
* Useful for validating a write, or previewing what it would return.
|
|
277
|
+
*/
|
|
278
|
+
rollback(): this;
|
|
279
|
+
/** Ask for GeoJSON instead of rows. The result resolves to the parsed object. */
|
|
280
|
+
geojson(): PostgrestExplainBuilder;
|
|
205
281
|
/** Ask for `text/csv` instead of JSON. The result resolves to a string. */
|
|
206
282
|
csv(): PostgrestTextBuilder;
|
|
207
283
|
/** Ask the server for the query plan. Admin-only, and off by default. */
|
|
@@ -210,9 +286,26 @@ export declare class PostgrestQueryBuilder<Row extends object = Record<string, u
|
|
|
210
286
|
maybeSingle(): PostgrestSingleBuilder<Row>;
|
|
211
287
|
/** The URL path (with query string) this builder targets. Exposed for tests. */
|
|
212
288
|
toPath(): string;
|
|
289
|
+
/**
|
|
290
|
+
* The request this builder would send, as data.
|
|
291
|
+
*
|
|
292
|
+
* `client.transaction()` needs to describe several writes without issuing
|
|
293
|
+
* them, and the method and body are otherwise private. Exposed rather than
|
|
294
|
+
* reached into: a batch built from `(builder as any).method` would break the
|
|
295
|
+
* first time this class was refactored.
|
|
296
|
+
*/
|
|
297
|
+
toRequest(): {
|
|
298
|
+
method: string;
|
|
299
|
+
model: string;
|
|
300
|
+
query: Record<string, string[]>;
|
|
301
|
+
body: unknown;
|
|
302
|
+
};
|
|
213
303
|
/** The headers this builder sends. Exposed for tests alongside `toPath()`. */
|
|
214
304
|
toHeaders(): Record<string, string>;
|
|
215
305
|
private execute;
|
|
306
|
+
private isWrite;
|
|
307
|
+
/** Apply `single()` / `maybeSingle()` to a row list. The one place row mode is read. */
|
|
308
|
+
private finish;
|
|
216
309
|
then<TResult1 = PostgrestResponse<Row[]>, TResult2 = never>(onfulfilled?: ((value: PostgrestResponse<Row[]>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
217
310
|
}
|
|
218
311
|
/** Same builder, typed to resolve a single row (from `.single()` / `.maybeSingle()`). */
|
package/dist/postgrest.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postgrest.d.ts","sourceRoot":"","sources":["../src/postgrest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,WAAW,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