@motherbase/client 1.4.0 → 1.5.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 +379 -284
- package/package.json +1 -1
- package/dist/admin.d.ts +0 -81
- package/dist/admin.d.ts.map +0 -1
- package/dist/admin.js +0 -85
- package/dist/admin.js.map +0 -1
- package/dist/auth.d.ts +0 -362
- package/dist/auth.d.ts.map +0 -1
- package/dist/auth.js +0 -721
- package/dist/auth.js.map +0 -1
- package/dist/channel.d.ts +0 -122
- package/dist/channel.d.ts.map +0 -1
- package/dist/channel.js +0 -213
- package/dist/channel.js.map +0 -1
- package/dist/compat.d.ts +0 -40
- package/dist/compat.d.ts.map +0 -1
- package/dist/compat.js +0 -98
- package/dist/compat.js.map +0 -1
- package/dist/cookie.d.ts +0 -68
- package/dist/cookie.d.ts.map +0 -1
- package/dist/cookie.js +0 -152
- package/dist/cookie.js.map +0 -1
- package/dist/database.d.ts +0 -188
- package/dist/database.d.ts.map +0 -1
- package/dist/database.js +0 -2
- package/dist/database.js.map +0 -1
- package/dist/devices.d.ts +0 -13
- package/dist/devices.d.ts.map +0 -1
- package/dist/devices.js +0 -13
- package/dist/devices.js.map +0 -1
- package/dist/edge.d.ts +0 -7
- package/dist/edge.d.ts.map +0 -1
- package/dist/edge.js +0 -13
- package/dist/edge.js.map +0 -1
- package/dist/functions.d.ts +0 -60
- package/dist/functions.d.ts.map +0 -1
- package/dist/functions.js +0 -75
- package/dist/functions.js.map +0 -1
- package/dist/http.d.ts +0 -123
- package/dist/http.d.ts.map +0 -1
- package/dist/http.js +0 -205
- package/dist/http.js.map +0 -1
- package/dist/index.d.ts +0 -185
- package/dist/index.d.ts.map +0 -1
- package/dist/index.js +0 -331
- package/dist/index.js.map +0 -1
- package/dist/mfa.d.ts +0 -109
- package/dist/mfa.d.ts.map +0 -1
- package/dist/mfa.js +0 -134
- package/dist/mfa.js.map +0 -1
- package/dist/postgrest.d.ts +0 -326
- package/dist/postgrest.d.ts.map +0 -1
- package/dist/postgrest.js +0 -629
- package/dist/postgrest.js.map +0 -1
- package/dist/profile.d.ts +0 -16
- package/dist/profile.d.ts.map +0 -1
- package/dist/profile.js +0 -26
- package/dist/profile.js.map +0 -1
- package/dist/query.d.ts +0 -97
- package/dist/query.d.ts.map +0 -1
- package/dist/query.js +0 -94
- package/dist/query.js.map +0 -1
- package/dist/realtime.d.ts +0 -114
- package/dist/realtime.d.ts.map +0 -1
- package/dist/realtime.js +0 -372
- package/dist/realtime.js.map +0 -1
- package/dist/rest.d.ts +0 -50
- package/dist/rest.d.ts.map +0 -1
- package/dist/rest.js +0 -75
- package/dist/rest.js.map +0 -1
- package/dist/session.d.ts +0 -47
- package/dist/session.d.ts.map +0 -1
- package/dist/session.js +0 -136
- package/dist/session.js.map +0 -1
- package/dist/storage.d.ts +0 -239
- package/dist/storage.d.ts.map +0 -1
- package/dist/storage.js +0 -391
- package/dist/storage.js.map +0 -1
- package/dist/testing.d.ts +0 -38
- package/dist/testing.d.ts.map +0 -1
- package/dist/testing.js +0 -50
- package/dist/testing.js.map +0 -1
- package/dist/types.d.ts +0 -343
- package/dist/types.d.ts.map +0 -1
- package/dist/types.js +0 -2
- package/dist/types.js.map +0 -1
- package/dist/warn.d.ts +0 -4
- package/dist/warn.d.ts.map +0 -1
- package/dist/warn.js +0 -27
- package/dist/warn.js.map +0 -1
package/dist/postgrest.d.ts
DELETED
|
@@ -1,326 +0,0 @@
|
|
|
1
|
-
import { HttpClient } from './http.js';
|
|
2
|
-
import type { MotherbaseResponse } from './types.js';
|
|
3
|
-
/**
|
|
4
|
-
* PostgREST query builder, supabase-js shaped.
|
|
5
|
-
*
|
|
6
|
-
* Everything in this file is about ONE thing: emitting the query string
|
|
7
|
-
* PostgREST (and the Motherbase REST dialect that mirrors it) reads. The
|
|
8
|
-
* builder is awaitable, resolves `{ data, error, count }` and never rejects for
|
|
9
|
-
* an expected API error. It has no runtime dependencies.
|
|
10
|
-
*
|
|
11
|
-
* Value encoding is the part that is easy to get wrong, so it lives in one
|
|
12
|
-
* place (`encodeLiteral` / `encodeArrayLiteral`) and every method routes
|
|
13
|
-
* through it:
|
|
14
|
-
*
|
|
15
|
-
* - A string value containing `,` `.` `:` `(` `)` `{` `}` `"` `\` or
|
|
16
|
-
* whitespace, or the empty string, is double quoted, with inner `"` and `\`
|
|
17
|
-
* backslash escaped. That is what makes `in.("a,b",c)` a two element list
|
|
18
|
-
* instead of three, and it is why a value containing a double quote is
|
|
19
|
-
* expressible at all.
|
|
20
|
-
* - Numbers and booleans are never quoted: their string form cannot contain a
|
|
21
|
-
* reserved character, and quoting them would make every `eq.3.14` read as a
|
|
22
|
-
* quoted literal for no gain.
|
|
23
|
-
* - `not()` and `filter()` take their value verbatim when it is a string.
|
|
24
|
-
* They are the escape hatches, so `not('id', 'in', '(1,2)')` has to reach
|
|
25
|
-
* the server as written, exactly as in supabase-js.
|
|
26
|
-
*/
|
|
27
|
-
export type PostgrestPrimitive = string | number | boolean | null;
|
|
28
|
-
/** Value accepted by the array/range operators (`cs`, `cd`, `ov`). */
|
|
29
|
-
export type PostgrestArrayOperand = string | readonly PostgrestPrimitive[] | Record<string, unknown>;
|
|
30
|
-
/** PostgREST's operator names. `filter()` also accepts modifier forms like `like(any)`. */
|
|
31
|
-
export type PostgrestFilterOperator = 'eq' | 'neq' | 'gt' | 'gte' | 'lt' | 'lte' | 'like' | 'ilike' | 'match' | 'imatch' | 'in' | 'is' | 'isdistinct' | 'fts' | 'plfts' | 'phfts' | 'wfts' | 'cs' | 'cd' | 'ov' | 'sl' | 'sr' | 'nxr' | 'nxl' | 'adj';
|
|
32
|
-
/** `is` reaches SQL NULL and the three-valued booleans, and nothing else. */
|
|
33
|
-
export type PostgrestIsValue = null | boolean | 'null' | 'true' | 'false' | 'unknown';
|
|
34
|
-
export type PostgrestCount = 'exact' | 'planned' | 'estimated';
|
|
35
|
-
export type TextSearchType = 'plain' | 'phrase' | 'websearch';
|
|
36
|
-
export interface ReferencedTableOption {
|
|
37
|
-
/** Scope the modifier to an embedded resource: `comments.limit=5`. */
|
|
38
|
-
referencedTable?: string;
|
|
39
|
-
/** supabase-js's pre-2.x name for `referencedTable`. Accepted for parity. */
|
|
40
|
-
foreignTable?: string;
|
|
41
|
-
}
|
|
42
|
-
export interface OrderOptions extends ReferencedTableOption {
|
|
43
|
-
ascending?: boolean;
|
|
44
|
-
nullsFirst?: boolean;
|
|
45
|
-
}
|
|
46
|
-
export interface PaginateOptions {
|
|
47
|
-
/** Rows per request. Capped server side by `api.rest.maxRows`. Default 1000. */
|
|
48
|
-
pageSize?: number;
|
|
49
|
-
}
|
|
50
|
-
export interface SelectOptions {
|
|
51
|
-
count?: PostgrestCount;
|
|
52
|
-
/** Send the request as HEAD: no rows come back, only the count. */
|
|
53
|
-
head?: boolean;
|
|
54
|
-
}
|
|
55
|
-
export interface InsertOptions {
|
|
56
|
-
count?: PostgrestCount;
|
|
57
|
-
/**
|
|
58
|
-
* `false` sends `Prefer: missing=default`, so columns absent from a row take
|
|
59
|
-
* their column default instead of NULL.
|
|
60
|
-
*/
|
|
61
|
-
defaultToNull?: boolean;
|
|
62
|
-
}
|
|
63
|
-
export interface UpsertOptions extends InsertOptions {
|
|
64
|
-
/** Conflict target, defaulting server side to the primary key. */
|
|
65
|
-
onConflict?: string;
|
|
66
|
-
/** `true` sends `Prefer: resolution=ignore-duplicates`. */
|
|
67
|
-
ignoreDuplicates?: boolean;
|
|
68
|
-
}
|
|
69
|
-
export interface MutateOptions {
|
|
70
|
-
count?: PostgrestCount;
|
|
71
|
-
}
|
|
72
|
-
export interface ExplainOptions {
|
|
73
|
-
analyze?: boolean;
|
|
74
|
-
verbose?: boolean;
|
|
75
|
-
settings?: boolean;
|
|
76
|
-
buffers?: boolean;
|
|
77
|
-
wal?: boolean;
|
|
78
|
-
format?: 'text' | 'json';
|
|
79
|
-
}
|
|
80
|
-
/**
|
|
81
|
-
* The result a query resolves to. `count` is `null` unless `{ count }` was
|
|
82
|
-
* requested and the server answered with a `Content-Range` total.
|
|
83
|
-
*/
|
|
84
|
-
export interface PostgrestResponse<T> extends MotherbaseResponse<T> {
|
|
85
|
-
count: number | null;
|
|
86
|
-
}
|
|
87
|
-
/** One scalar value: quoted only when it has to be. */
|
|
88
|
-
export declare function encodeLiteral(value: PostgrestPrimitive): string;
|
|
89
|
-
/**
|
|
90
|
-
* PostgREST-style, chainable, thenable query builder mapping onto the backend's
|
|
91
|
-
* `/rest/v1/:model` query-param dialect. Awaiting it resolves to
|
|
92
|
-
* `{ data, error, count }` and never rejects for expected API errors (only for
|
|
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.
|
|
100
|
-
*/
|
|
101
|
-
export declare class PostgrestQueryBuilder<Row extends object = Record<string, unknown>> implements PromiseLike<PostgrestResponse<Row[]>> {
|
|
102
|
-
private readonly http;
|
|
103
|
-
private readonly model;
|
|
104
|
-
/** supabase-js semantic parity, from `createClient(..., { compat: 'supabase' })`. */
|
|
105
|
-
private readonly compat;
|
|
106
|
-
private method;
|
|
107
|
-
private columns;
|
|
108
|
-
/**
|
|
109
|
-
* Repeated filters on one column must all survive: `?price=gt.10&price=lt.20`
|
|
110
|
-
* is two conditions ANDed together, which is why every filter is `append`ed
|
|
111
|
-
* and never `set`. Using `set` here (as this builder once did) silently
|
|
112
|
-
* dropped the first of the two.
|
|
113
|
-
*/
|
|
114
|
-
private readonly filters;
|
|
115
|
-
/** Reserved params that are replaced rather than repeated (`columns`, `on_conflict`). */
|
|
116
|
-
private readonly extras;
|
|
117
|
-
/** Keyed by referenced table (`''` for the base relation). */
|
|
118
|
-
private readonly orderParts;
|
|
119
|
-
private readonly limits;
|
|
120
|
-
private readonly offsets;
|
|
121
|
-
private readonly prefer;
|
|
122
|
-
private accept?;
|
|
123
|
-
private responseKind;
|
|
124
|
-
private countOption?;
|
|
125
|
-
private headOnly;
|
|
126
|
-
private signal?;
|
|
127
|
-
private body?;
|
|
128
|
-
private rowMode;
|
|
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);
|
|
135
|
-
/**
|
|
136
|
-
* Choose the columns, and optionally ask for a row count.
|
|
137
|
-
*
|
|
138
|
-
* After a write, `.select()` is the supabase-js way of asking for the rows
|
|
139
|
-
* back, so it also sends `Prefer: return=representation`.
|
|
140
|
-
*/
|
|
141
|
-
select(columns?: string, options?: SelectOptions): this;
|
|
142
|
-
insert(values: Partial<Row> | Array<Partial<Row>>, options?: InsertOptions): this;
|
|
143
|
-
/**
|
|
144
|
-
* `INSERT .. ON CONFLICT DO UPDATE`. The conflict target defaults to the
|
|
145
|
-
* primary key server side; `onConflict` names another unique constraint.
|
|
146
|
-
*/
|
|
147
|
-
upsert(values: Partial<Row> | Array<Partial<Row>>, options?: UpsertOptions): this;
|
|
148
|
-
update(values: Partial<Row>, options?: MutateOptions): this;
|
|
149
|
-
delete(options?: MutateOptions): this;
|
|
150
|
-
/**
|
|
151
|
-
* A bulk write states its column set explicitly, so a key missing from one
|
|
152
|
-
* row is still written (as NULL, or as the column default under
|
|
153
|
-
* `missing=default`) instead of being inferred from the first row alone.
|
|
154
|
-
*/
|
|
155
|
-
private applyColumns;
|
|
156
|
-
eq(column: string, value: PostgrestPrimitive): this;
|
|
157
|
-
neq(column: string, value: PostgrestPrimitive): this;
|
|
158
|
-
gt(column: string, value: PostgrestPrimitive): this;
|
|
159
|
-
gte(column: string, value: PostgrestPrimitive): this;
|
|
160
|
-
lt(column: string, value: PostgrestPrimitive): this;
|
|
161
|
-
lte(column: string, value: PostgrestPrimitive): this;
|
|
162
|
-
/** Case-sensitive LIKE. `*` is PostgREST's URL-friendly `%`. */
|
|
163
|
-
like(column: string, pattern: string): this;
|
|
164
|
-
ilike(column: string, pattern: string): this;
|
|
165
|
-
likeAllOf(column: string, patterns: readonly string[]): this;
|
|
166
|
-
likeAnyOf(column: string, patterns: readonly string[]): this;
|
|
167
|
-
ilikeAllOf(column: string, patterns: readonly string[]): this;
|
|
168
|
-
ilikeAnyOf(column: string, patterns: readonly string[]): this;
|
|
169
|
-
in(column: string, values: readonly PostgrestPrimitive[]): this;
|
|
170
|
-
is(column: string, value: PostgrestIsValue): this;
|
|
171
|
-
/** Every key equal to its value, ANDed together. */
|
|
172
|
-
match(query: Record<string, PostgrestPrimitive>): this;
|
|
173
|
-
/**
|
|
174
|
-
* Negate any operator: `not('status', 'eq', 'live')` emits
|
|
175
|
-
* `status=not.eq.live`. The value is passed through verbatim for a string, so
|
|
176
|
-
* composite operands (`not('id', 'in', '(1,2)')`) reach the server as written.
|
|
177
|
-
*/
|
|
178
|
-
not(column: string, operator: PostgrestFilterOperator | (string & {}), value: PostgrestPrimitive | readonly PostgrestPrimitive[]): this;
|
|
179
|
-
/**
|
|
180
|
-
* The escape hatch: any operator, including the ones with no dedicated method
|
|
181
|
-
* (`match`, `imatch`, `isdistinct`) and the modifier forms (`like(any)`).
|
|
182
|
-
*/
|
|
183
|
-
filter(column: string, operator: PostgrestFilterOperator | (string & {}), value: PostgrestPrimitive | readonly PostgrestPrimitive[]): this;
|
|
184
|
-
/**
|
|
185
|
-
* A disjunction, written in PostgREST's own syntax and nestable:
|
|
186
|
-
* `or('status.eq.live,and(price.gt.10,price.lt.20)')`.
|
|
187
|
-
*/
|
|
188
|
-
or(filters: string, options?: ReferencedTableOption): this;
|
|
189
|
-
/** Full-text search. `type` picks the tsquery parser, `config` the dictionary. */
|
|
190
|
-
textSearch(column: string, query: string, options?: {
|
|
191
|
-
type?: TextSearchType;
|
|
192
|
-
config?: string;
|
|
193
|
-
}): this;
|
|
194
|
-
/** `@>`: the column contains the operand (array, range or jsonb). */
|
|
195
|
-
contains(column: string, value: PostgrestArrayOperand): this;
|
|
196
|
-
/** `<@`: the column is contained by the operand. */
|
|
197
|
-
containedBy(column: string, value: PostgrestArrayOperand): this;
|
|
198
|
-
/** `&&`: the column and the operand have an element (or a point) in common. */
|
|
199
|
-
overlaps(column: string, value: PostgrestArrayOperand): this;
|
|
200
|
-
/** `>>`: strictly right of the range. */
|
|
201
|
-
rangeGt(column: string, range: string): this;
|
|
202
|
-
/** `&>`: does not extend to the left of the range. */
|
|
203
|
-
rangeGte(column: string, range: string): this;
|
|
204
|
-
/** `<<`: strictly left of the range. */
|
|
205
|
-
rangeLt(column: string, range: string): this;
|
|
206
|
-
/** `&<`: does not extend to the right of the range. */
|
|
207
|
-
rangeLte(column: string, range: string): this;
|
|
208
|
-
/** `-|-`: adjacent to the range. */
|
|
209
|
-
rangeAdjacent(column: string, range: string): this;
|
|
210
|
-
private push;
|
|
211
|
-
order(column: string, options?: OrderOptions): this;
|
|
212
|
-
limit(count: number, options?: ReferencedTableOption): this;
|
|
213
|
-
/** Inclusive range -> offset/limit. `range(0, 9)` fetches 10 rows from offset 0. */
|
|
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>;
|
|
246
|
-
/** Cancel the in-flight request when the signal aborts. */
|
|
247
|
-
abortSignal(signal: AbortSignal): this;
|
|
248
|
-
/**
|
|
249
|
-
* Re-type the rows. Purely a compile-time cast, for cases the generated
|
|
250
|
-
* `Database` cannot express (a computed column, an embedded shape).
|
|
251
|
-
*/
|
|
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;
|
|
281
|
-
/** Ask for `text/csv` instead of JSON. The result resolves to a string. */
|
|
282
|
-
csv(): PostgrestTextBuilder;
|
|
283
|
-
/** Ask the server for the query plan. Admin-only, and off by default. */
|
|
284
|
-
explain(options?: ExplainOptions): PostgrestExplainBuilder;
|
|
285
|
-
single(): PostgrestSingleBuilder<Row>;
|
|
286
|
-
maybeSingle(): PostgrestSingleBuilder<Row>;
|
|
287
|
-
/** The URL path (with query string) this builder targets. Exposed for tests. */
|
|
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
|
-
};
|
|
303
|
-
/** The headers this builder sends. Exposed for tests alongside `toPath()`. */
|
|
304
|
-
toHeaders(): Record<string, string>;
|
|
305
|
-
private execute;
|
|
306
|
-
private isWrite;
|
|
307
|
-
/** Apply `single()` / `maybeSingle()` to a row list. The one place row mode is read. */
|
|
308
|
-
private finish;
|
|
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>;
|
|
310
|
-
}
|
|
311
|
-
/** Same builder, typed to resolve a single row (from `.single()` / `.maybeSingle()`). */
|
|
312
|
-
export interface PostgrestSingleBuilder<Row extends object> extends Omit<PostgrestQueryBuilder<Row>, 'then' | 'single' | 'maybeSingle' | 'returns'>, PromiseLike<PostgrestResponse<Row>> {
|
|
313
|
-
returns<T extends object>(): PostgrestSingleBuilder<T>;
|
|
314
|
-
then<TResult1 = PostgrestResponse<Row>, TResult2 = never>(onfulfilled?: ((value: PostgrestResponse<Row>) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
315
|
-
}
|
|
316
|
-
/** The builder after `.csv()`: the body is text, not rows. */
|
|
317
|
-
export interface PostgrestTextBuilder extends PromiseLike<PostgrestResponse<string>> {
|
|
318
|
-
toPath(): string;
|
|
319
|
-
toHeaders(): Record<string, string>;
|
|
320
|
-
}
|
|
321
|
-
/** The builder after `.explain()`: text, or the parsed plan for `format: 'json'`. */
|
|
322
|
-
export interface PostgrestExplainBuilder extends PromiseLike<PostgrestResponse<unknown>> {
|
|
323
|
-
toPath(): string;
|
|
324
|
-
toHeaders(): Record<string, string>;
|
|
325
|
-
}
|
|
326
|
-
//# sourceMappingURL=postgrest.d.ts.map
|
package/dist/postgrest.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"postgrest.d.ts","sourceRoot":"","sources":["../src/postgrest.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAW,MAAM,WAAW,CAAC;AAEhD,OAAO,KAAK,EAAmB,kBAAkB,EAAE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