@freehour/supabase-core 2.2.1 → 2.3.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/LICENSE +1 -1
- package/dist/index.js +81 -388
- package/dist/postgrest/filter.d.ts +1 -46
- package/dist/postgrest/filter.d.ts.map +1 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
package/dist/index.js
CHANGED
|
@@ -1,369 +1,68 @@
|
|
|
1
1
|
import { assert as e } from "@freehour/assert";
|
|
2
2
|
import t from "zod";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
], o = class extends Error {
|
|
9
|
-
constructor(e) {
|
|
10
|
-
super(e.message), this.name = "PostgrestError", this.details = e.details, this.hint = e.hint, this.code = e.code;
|
|
11
|
-
}
|
|
12
|
-
toJSON() {
|
|
13
|
-
return {
|
|
14
|
-
name: this.name,
|
|
15
|
-
message: this.message,
|
|
16
|
-
details: this.details,
|
|
17
|
-
hint: this.hint,
|
|
18
|
-
code: this.code
|
|
19
|
-
};
|
|
20
|
-
}
|
|
21
|
-
};
|
|
22
|
-
function s(e, t) {
|
|
23
|
-
return new Promise((n) => {
|
|
24
|
-
if (t?.aborted) {
|
|
25
|
-
n();
|
|
26
|
-
return;
|
|
27
|
-
}
|
|
28
|
-
let r = setTimeout(() => {
|
|
29
|
-
t?.removeEventListener("abort", i), n();
|
|
30
|
-
}, e);
|
|
31
|
-
function i() {
|
|
32
|
-
clearTimeout(r), n();
|
|
33
|
-
}
|
|
34
|
-
t?.addEventListener("abort", i);
|
|
35
|
-
});
|
|
36
|
-
}
|
|
37
|
-
function c(e, t, r, o) {
|
|
38
|
-
return !(!o || r >= n || !a.includes(e) || !i.includes(t));
|
|
39
|
-
}
|
|
40
|
-
var l = class {
|
|
41
|
-
constructor(e) {
|
|
42
|
-
this.shouldThrowOnError = !1, this.retryEnabled = !0, this.method = e.method, this.url = e.url, this.headers = new Headers(e.headers), this.schema = e.schema, this.body = e.body, this.shouldThrowOnError = e.shouldThrowOnError ?? !1, this.signal = e.signal, this.isMaybeSingle = e.isMaybeSingle ?? !1, this.shouldStripNulls = e.shouldStripNulls ?? !1, this.urlLengthLimit = e.urlLengthLimit ?? 8e3, this.retryEnabled = e.retry ?? !0, e.fetch ? this.fetch = e.fetch : this.fetch = fetch;
|
|
43
|
-
}
|
|
44
|
-
throwOnError() {
|
|
45
|
-
return this.shouldThrowOnError = !0, this;
|
|
46
|
-
}
|
|
47
|
-
stripNulls() {
|
|
48
|
-
if (this.headers.get("Accept") === "text/csv") throw Error("stripNulls() cannot be used with csv()");
|
|
49
|
-
return this.shouldStripNulls = !0, this;
|
|
50
|
-
}
|
|
51
|
-
setHeader(e, t) {
|
|
52
|
-
return this.headers = new Headers(this.headers), this.headers.set(e, t), this;
|
|
53
|
-
}
|
|
54
|
-
retry(e) {
|
|
55
|
-
return this.retryEnabled = e, this;
|
|
56
|
-
}
|
|
57
|
-
then(e, t) {
|
|
58
|
-
var i = this;
|
|
59
|
-
if (this.schema === void 0 || (["GET", "HEAD"].includes(this.method) ? this.headers.set("Accept-Profile", this.schema) : this.headers.set("Content-Profile", this.schema)), this.method !== "GET" && this.method !== "HEAD" && this.headers.set("Content-Type", "application/json"), this.shouldStripNulls) {
|
|
60
|
-
let e = this.headers.get("Accept");
|
|
61
|
-
e === "application/vnd.pgrst.object+json" ? this.headers.set("Accept", "application/vnd.pgrst.object+json;nulls=stripped") : (!e || e === "application/json") && this.headers.set("Accept", "application/vnd.pgrst.array+json;nulls=stripped");
|
|
62
|
-
}
|
|
63
|
-
let o = this.fetch, l = (async () => {
|
|
64
|
-
let e = 0;
|
|
65
|
-
for (;;) {
|
|
66
|
-
let t = new Headers(i.headers);
|
|
67
|
-
e > 0 && t.set("X-Retry-Count", String(e));
|
|
68
|
-
let l;
|
|
69
|
-
try {
|
|
70
|
-
l = await o(i.url.toString(), {
|
|
71
|
-
method: i.method,
|
|
72
|
-
headers: t,
|
|
73
|
-
body: JSON.stringify(i.body, (e, t) => typeof t == "bigint" ? t.toString() : t),
|
|
74
|
-
signal: i.signal
|
|
75
|
-
});
|
|
76
|
-
} catch (t) {
|
|
77
|
-
if (t?.name === "AbortError" || t?.code === "ABORT_ERR" || !a.includes(i.method)) throw t;
|
|
78
|
-
if (i.retryEnabled && e < n) {
|
|
79
|
-
let t = r(e);
|
|
80
|
-
e++, await s(t, i.signal);
|
|
81
|
-
continue;
|
|
82
|
-
}
|
|
83
|
-
throw t;
|
|
84
|
-
}
|
|
85
|
-
if (c(i.method, l.status, e, i.retryEnabled)) {
|
|
86
|
-
let t = l.headers?.get("Retry-After") ?? null, n = t === null ? r(e) : Math.max(0, parseInt(t, 10) || 0) * 1e3;
|
|
87
|
-
await l.text(), e++, await s(n, i.signal);
|
|
88
|
-
continue;
|
|
89
|
-
}
|
|
90
|
-
return await i.processResponse(l);
|
|
91
|
-
}
|
|
92
|
-
})();
|
|
93
|
-
return this.shouldThrowOnError || (l = l.catch((e) => {
|
|
94
|
-
let t = "", n = "", r = "", i = e?.cause;
|
|
95
|
-
if (i) {
|
|
96
|
-
let n = i?.message ?? "", r = i?.code ?? "";
|
|
97
|
-
t = `${e?.name ?? "FetchError"}: ${e?.message}`, t += `\n\nCaused by: ${i?.name ?? "Error"}: ${n}`, r && (t += ` (${r})`), i?.stack && (t += `\n${i.stack}`);
|
|
98
|
-
} else t = e?.stack ?? "";
|
|
99
|
-
let a = this.url.toString().length;
|
|
100
|
-
return e?.name === "AbortError" || e?.code === "ABORT_ERR" ? (r = "", n = "Request was aborted (timeout or manual cancellation)", a > this.urlLengthLimit && (n += `. Note: Your request URL is ${a} characters, which may exceed server limits. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [many IDs])), consider using an RPC function to pass values server-side.`)) : (i?.name === "HeadersOverflowError" || i?.code === "UND_ERR_HEADERS_OVERFLOW") && (r = "", n = "HTTP headers exceeded server limits (typically 16KB)", a > this.urlLengthLimit && (n += `. Your request URL is ${a} characters. If selecting many fields, consider using views. If filtering with large arrays (e.g., .in('id', [200+ IDs])), consider using an RPC function instead.`)), {
|
|
101
|
-
success: !1,
|
|
102
|
-
error: {
|
|
103
|
-
message: `${e?.name ?? "FetchError"}: ${e?.message}`,
|
|
104
|
-
details: t,
|
|
105
|
-
hint: n,
|
|
106
|
-
code: r
|
|
107
|
-
},
|
|
108
|
-
data: null,
|
|
109
|
-
count: null,
|
|
110
|
-
status: 0,
|
|
111
|
-
statusText: ""
|
|
112
|
-
};
|
|
113
|
-
})), l.then(e, t);
|
|
114
|
-
}
|
|
115
|
-
async processResponse(e) {
|
|
116
|
-
var t = this;
|
|
117
|
-
let n = null, r = null, i = null, a = e.status, s = e.statusText;
|
|
118
|
-
if (e.ok) {
|
|
119
|
-
if (t.method !== "HEAD") {
|
|
120
|
-
let n = await e.text();
|
|
121
|
-
n === "" || (r = t.headers.get("Accept") === "text/csv" || t.headers.get("Accept") && t.headers.get("Accept")?.includes("application/vnd.pgrst.plan+text") ? n : JSON.parse(n));
|
|
122
|
-
}
|
|
123
|
-
let o = t.headers.get("Prefer")?.match(/count=(exact|planned|estimated)/), c = e.headers.get("content-range")?.split("/");
|
|
124
|
-
o && c && c.length > 1 && (i = parseInt(c[1])), t.isMaybeSingle && Array.isArray(r) && (r.length > 1 ? (n = {
|
|
125
|
-
code: "PGRST116",
|
|
126
|
-
details: `Results contain ${r.length} rows, application/vnd.pgrst.object+json requires 1 row`,
|
|
127
|
-
hint: null,
|
|
128
|
-
message: "JSON object requested, multiple (or no) rows returned"
|
|
129
|
-
}, r = null, i = null, a = 406, s = "Not Acceptable") : r = r.length === 1 ? r[0] : null);
|
|
130
|
-
} else {
|
|
131
|
-
let i = await e.text();
|
|
132
|
-
try {
|
|
133
|
-
n = JSON.parse(i), Array.isArray(n) && e.status === 404 && (r = [], n = null, a = 200, s = "OK");
|
|
134
|
-
} catch {
|
|
135
|
-
e.status === 404 && i === "" ? (a = 204, s = "No Content") : n = { message: i };
|
|
136
|
-
}
|
|
137
|
-
if (n && t.shouldThrowOnError) throw new o(n);
|
|
138
|
-
}
|
|
139
|
-
return {
|
|
140
|
-
success: n === null,
|
|
141
|
-
error: n,
|
|
142
|
-
data: r,
|
|
143
|
-
count: i,
|
|
144
|
-
status: a,
|
|
145
|
-
statusText: s
|
|
146
|
-
};
|
|
147
|
-
}
|
|
148
|
-
returns() {
|
|
149
|
-
/* istanbul ignore next */
|
|
150
|
-
return this;
|
|
151
|
-
}
|
|
152
|
-
overrideTypes() {
|
|
153
|
-
return this;
|
|
154
|
-
}
|
|
155
|
-
}, u = class extends l {
|
|
156
|
-
select(e) {
|
|
157
|
-
let t = !1, n = (e ?? "*").split("").map((e) => /\s/.test(e) && !t ? "" : (e === "\"" && (t = !t), e)).join("");
|
|
158
|
-
return this.url.searchParams.set("select", n), this.headers.append("Prefer", "return=representation"), this;
|
|
159
|
-
}
|
|
160
|
-
order(e, { ascending: t = !0, nullsFirst: n, foreignTable: r, referencedTable: i = r } = {}) {
|
|
161
|
-
let a = i ? `${i}.order` : "order", o = this.url.searchParams.get(a);
|
|
162
|
-
return this.url.searchParams.set(a, `${o ? `${o},` : ""}${e}.${t ? "asc" : "desc"}${n === void 0 ? "" : n ? ".nullsfirst" : ".nullslast"}`), this;
|
|
163
|
-
}
|
|
164
|
-
limit(e, { foreignTable: t, referencedTable: n = t } = {}) {
|
|
165
|
-
let r = n === void 0 ? "limit" : `${n}.limit`;
|
|
166
|
-
return this.url.searchParams.set(r, `${e}`), this;
|
|
167
|
-
}
|
|
168
|
-
range(e, t, { foreignTable: n, referencedTable: r = n } = {}) {
|
|
169
|
-
let i = r === void 0 ? "offset" : `${r}.offset`, a = r === void 0 ? "limit" : `${r}.limit`;
|
|
170
|
-
return this.url.searchParams.set(i, `${e}`), this.url.searchParams.set(a, `${t - e + 1}`), this;
|
|
171
|
-
}
|
|
172
|
-
abortSignal(e) {
|
|
173
|
-
return this.signal = e, this;
|
|
174
|
-
}
|
|
175
|
-
single() {
|
|
176
|
-
return this.headers.set("Accept", "application/vnd.pgrst.object+json"), this;
|
|
177
|
-
}
|
|
178
|
-
maybeSingle() {
|
|
179
|
-
return this.isMaybeSingle = !0, this;
|
|
180
|
-
}
|
|
181
|
-
csv() {
|
|
182
|
-
return this.headers.set("Accept", "text/csv"), this;
|
|
183
|
-
}
|
|
184
|
-
geojson() {
|
|
185
|
-
return this.headers.set("Accept", "application/geo+json"), this;
|
|
186
|
-
}
|
|
187
|
-
explain({ analyze: e = !1, verbose: t = !1, settings: n = !1, buffers: r = !1, wal: i = !1, format: a = "text" } = {}) {
|
|
188
|
-
let o = [
|
|
189
|
-
e ? "analyze" : null,
|
|
190
|
-
t ? "verbose" : null,
|
|
191
|
-
n ? "settings" : null,
|
|
192
|
-
r ? "buffers" : null,
|
|
193
|
-
i ? "wal" : null
|
|
194
|
-
].filter(Boolean).join("|"), s = this.headers.get("Accept") ?? "application/json";
|
|
195
|
-
return this.headers.set("Accept", `application/vnd.pgrst.plan+${a}; for="${s}"; options=${o};`), this;
|
|
196
|
-
}
|
|
197
|
-
rollback() {
|
|
198
|
-
return this.headers.append("Prefer", "tx=rollback"), this;
|
|
199
|
-
}
|
|
200
|
-
returns() {
|
|
201
|
-
return this;
|
|
202
|
-
}
|
|
203
|
-
maxAffected(e) {
|
|
204
|
-
return this.headers.append("Prefer", "handling=strict"), this.headers.append("Prefer", `max-affected=${e}`), this;
|
|
205
|
-
}
|
|
206
|
-
}, d = /* @__PURE__ */ RegExp("[,()]"), f = class extends u {
|
|
207
|
-
eq(e, t) {
|
|
208
|
-
return this.url.searchParams.append(e, `eq.${t}`), this;
|
|
209
|
-
}
|
|
210
|
-
neq(e, t) {
|
|
211
|
-
return this.url.searchParams.append(e, `neq.${t}`), this;
|
|
212
|
-
}
|
|
213
|
-
gt(e, t) {
|
|
214
|
-
return this.url.searchParams.append(e, `gt.${t}`), this;
|
|
215
|
-
}
|
|
216
|
-
gte(e, t) {
|
|
217
|
-
return this.url.searchParams.append(e, `gte.${t}`), this;
|
|
218
|
-
}
|
|
219
|
-
lt(e, t) {
|
|
220
|
-
return this.url.searchParams.append(e, `lt.${t}`), this;
|
|
221
|
-
}
|
|
222
|
-
lte(e, t) {
|
|
223
|
-
return this.url.searchParams.append(e, `lte.${t}`), this;
|
|
224
|
-
}
|
|
225
|
-
like(e, t) {
|
|
226
|
-
return this.url.searchParams.append(e, `like.${t}`), this;
|
|
227
|
-
}
|
|
228
|
-
likeAllOf(e, t) {
|
|
229
|
-
return this.url.searchParams.append(e, `like(all).{${t.join(",")}}`), this;
|
|
230
|
-
}
|
|
231
|
-
likeAnyOf(e, t) {
|
|
232
|
-
return this.url.searchParams.append(e, `like(any).{${t.join(",")}}`), this;
|
|
233
|
-
}
|
|
234
|
-
ilike(e, t) {
|
|
235
|
-
return this.url.searchParams.append(e, `ilike.${t}`), this;
|
|
236
|
-
}
|
|
237
|
-
ilikeAllOf(e, t) {
|
|
238
|
-
return this.url.searchParams.append(e, `ilike(all).{${t.join(",")}}`), this;
|
|
239
|
-
}
|
|
240
|
-
ilikeAnyOf(e, t) {
|
|
241
|
-
return this.url.searchParams.append(e, `ilike(any).{${t.join(",")}}`), this;
|
|
242
|
-
}
|
|
243
|
-
regexMatch(e, t) {
|
|
244
|
-
return this.url.searchParams.append(e, `match.${t}`), this;
|
|
245
|
-
}
|
|
246
|
-
regexIMatch(e, t) {
|
|
247
|
-
return this.url.searchParams.append(e, `imatch.${t}`), this;
|
|
248
|
-
}
|
|
249
|
-
is(e, t) {
|
|
250
|
-
return this.url.searchParams.append(e, `is.${t}`), this;
|
|
251
|
-
}
|
|
252
|
-
isDistinct(e, t) {
|
|
253
|
-
return this.url.searchParams.append(e, `isdistinct.${t}`), this;
|
|
254
|
-
}
|
|
255
|
-
in(e, t) {
|
|
256
|
-
let n = Array.from(new Set(t)).map((e) => typeof e == "string" && d.test(e) ? `"${e}"` : `${e}`).join(",");
|
|
257
|
-
return this.url.searchParams.append(e, `in.(${n})`), this;
|
|
258
|
-
}
|
|
259
|
-
notIn(e, t) {
|
|
260
|
-
let n = Array.from(new Set(t)).map((e) => typeof e == "string" && d.test(e) ? `"${e}"` : `${e}`).join(",");
|
|
261
|
-
return this.url.searchParams.append(e, `not.in.(${n})`), this;
|
|
262
|
-
}
|
|
263
|
-
contains(e, t) {
|
|
264
|
-
return typeof t == "string" ? this.url.searchParams.append(e, `cs.${t}`) : Array.isArray(t) ? this.url.searchParams.append(e, `cs.{${t.join(",")}}`) : this.url.searchParams.append(e, `cs.${JSON.stringify(t)}`), this;
|
|
265
|
-
}
|
|
266
|
-
containedBy(e, t) {
|
|
267
|
-
return typeof t == "string" ? this.url.searchParams.append(e, `cd.${t}`) : Array.isArray(t) ? this.url.searchParams.append(e, `cd.{${t.join(",")}}`) : this.url.searchParams.append(e, `cd.${JSON.stringify(t)}`), this;
|
|
268
|
-
}
|
|
269
|
-
rangeGt(e, t) {
|
|
270
|
-
return this.url.searchParams.append(e, `sr.${t}`), this;
|
|
271
|
-
}
|
|
272
|
-
rangeGte(e, t) {
|
|
273
|
-
return this.url.searchParams.append(e, `nxl.${t}`), this;
|
|
274
|
-
}
|
|
275
|
-
rangeLt(e, t) {
|
|
276
|
-
return this.url.searchParams.append(e, `sl.${t}`), this;
|
|
277
|
-
}
|
|
278
|
-
rangeLte(e, t) {
|
|
279
|
-
return this.url.searchParams.append(e, `nxr.${t}`), this;
|
|
280
|
-
}
|
|
281
|
-
rangeAdjacent(e, t) {
|
|
282
|
-
return this.url.searchParams.append(e, `adj.${t}`), this;
|
|
283
|
-
}
|
|
284
|
-
overlaps(e, t) {
|
|
285
|
-
return typeof t == "string" ? this.url.searchParams.append(e, `ov.${t}`) : this.url.searchParams.append(e, `ov.{${t.join(",")}}`), this;
|
|
286
|
-
}
|
|
287
|
-
textSearch(e, t, { config: n, type: r } = {}) {
|
|
288
|
-
let i = "";
|
|
289
|
-
r === "plain" ? i = "pl" : r === "phrase" ? i = "ph" : r === "websearch" && (i = "w");
|
|
290
|
-
let a = n === void 0 ? "" : `(${n})`;
|
|
291
|
-
return this.url.searchParams.append(e, `${i}fts${a}.${t}`), this;
|
|
292
|
-
}
|
|
293
|
-
match(e) {
|
|
294
|
-
return Object.entries(e).filter(([e, t]) => t !== void 0).forEach(([e, t]) => {
|
|
295
|
-
this.url.searchParams.append(e, `eq.${t}`);
|
|
296
|
-
}), this;
|
|
297
|
-
}
|
|
298
|
-
not(e, t, n) {
|
|
299
|
-
return this.url.searchParams.append(e, `not.${t}.${n}`), this;
|
|
300
|
-
}
|
|
301
|
-
or(e, { foreignTable: t, referencedTable: n = t } = {}) {
|
|
302
|
-
let r = n ? `${n}.or` : "or";
|
|
303
|
-
return this.url.searchParams.append(r, `(${e})`), this;
|
|
304
|
-
}
|
|
305
|
-
filter(e, t, n) {
|
|
306
|
-
return this.url.searchParams.append(e, `${t}.${n}`), this;
|
|
307
|
-
}
|
|
308
|
-
}, p = class extends Error {
|
|
3
|
+
import { PostgrestError as n } from "@supabase/supabase-js";
|
|
4
|
+
import * as r from "@supabase/postgrest-js";
|
|
5
|
+
import "@supabase/storage-js";
|
|
6
|
+
//#region lib/errors.ts
|
|
7
|
+
var i = class extends Error {
|
|
309
8
|
constructor(e, t = {}) {
|
|
310
9
|
super(e, t), this.name = this.constructor.name, Error.captureStackTrace(this, this.constructor);
|
|
311
10
|
}
|
|
312
|
-
},
|
|
11
|
+
}, a = class extends i {
|
|
313
12
|
fileId;
|
|
314
13
|
bucket;
|
|
315
14
|
path;
|
|
316
15
|
constructor(e, { fileId: t, bucket: n, path: r } = {}) {
|
|
317
16
|
super(e), this.fileId = t, this.bucket = n, this.path = r;
|
|
318
17
|
}
|
|
319
|
-
},
|
|
18
|
+
}, o = class extends i {
|
|
320
19
|
expression;
|
|
321
20
|
format;
|
|
322
21
|
constructor(e, { expression: t, format: n, ...r } = {}) {
|
|
323
22
|
super(e, r), this.expression = t, this.format = n;
|
|
324
23
|
}
|
|
325
|
-
},
|
|
24
|
+
}, s = class extends i {
|
|
326
25
|
schema;
|
|
327
26
|
relation;
|
|
328
27
|
id;
|
|
329
28
|
constructor(e, { schema: t, relation: n, id: r } = {}) {
|
|
330
29
|
super(e), this.schema = t, this.relation = n, this.id = r;
|
|
331
30
|
}
|
|
332
|
-
},
|
|
31
|
+
}, c = t.object({
|
|
333
32
|
code: t.string(),
|
|
334
33
|
details: t.string().nullable(),
|
|
335
34
|
hint: t.string().nullable(),
|
|
336
35
|
name: t.string().optional(),
|
|
337
36
|
message: t.string().optional()
|
|
338
37
|
});
|
|
339
|
-
function
|
|
340
|
-
return e instanceof
|
|
38
|
+
function l(e) {
|
|
39
|
+
return e instanceof n || c.safeParse(e).success;
|
|
341
40
|
}
|
|
342
41
|
//#endregion
|
|
343
42
|
//#region lib/utils.ts
|
|
344
|
-
function
|
|
43
|
+
function u(e, t = "/") {
|
|
345
44
|
let n = e.lastIndexOf(t);
|
|
346
45
|
return n === -1 ? ["", e] : [e.substring(0, n), e.substring(n + 1)];
|
|
347
46
|
}
|
|
348
|
-
function
|
|
47
|
+
function d(e) {
|
|
349
48
|
return Array.isArray(e) ? e : [e];
|
|
350
49
|
}
|
|
351
|
-
function
|
|
50
|
+
function f(e, t) {
|
|
352
51
|
return e.reduce((e, n) => {
|
|
353
52
|
let r = t(n);
|
|
354
53
|
return (e[r] ??= []).push(n), e;
|
|
355
54
|
}, {});
|
|
356
55
|
}
|
|
357
|
-
function
|
|
56
|
+
function p(e, t) {
|
|
358
57
|
let n = e.findIndex(t);
|
|
359
58
|
return n !== -1 && e.splice(n, 1), e;
|
|
360
59
|
}
|
|
361
|
-
function
|
|
60
|
+
function m(e) {
|
|
362
61
|
return Object.entries(e);
|
|
363
62
|
}
|
|
364
63
|
//#endregion
|
|
365
64
|
//#region lib/data-service.ts
|
|
366
|
-
var
|
|
65
|
+
var h = class {
|
|
367
66
|
database;
|
|
368
67
|
schema;
|
|
369
68
|
relation;
|
|
@@ -371,7 +70,7 @@ var w = class {
|
|
|
371
70
|
this.database = e, this.schema = t, this.relation = n;
|
|
372
71
|
}
|
|
373
72
|
recordNotFoundError(e) {
|
|
374
|
-
return new
|
|
73
|
+
return new s(`Record with id ${e} not found in ${this.schema}.${this.relation}`, {
|
|
375
74
|
schema: this.schema,
|
|
376
75
|
relation: this.relation,
|
|
377
76
|
id: e
|
|
@@ -419,7 +118,7 @@ var w = class {
|
|
|
419
118
|
}
|
|
420
119
|
async upsert(e, { onConflict: t, ...n } = {}) {
|
|
421
120
|
let { data: r } = await this.query.upsert(e, {
|
|
422
|
-
onConflict: t === void 0 ? void 0 :
|
|
121
|
+
onConflict: t === void 0 ? void 0 : d(t).join(","),
|
|
423
122
|
...n
|
|
424
123
|
}).select().single().throwOnError();
|
|
425
124
|
return r;
|
|
@@ -428,7 +127,7 @@ var w = class {
|
|
|
428
127
|
let { data: n } = await this.query.update(t).eq("id", e).select().single().throwOnError();
|
|
429
128
|
return n;
|
|
430
129
|
}
|
|
431
|
-
},
|
|
130
|
+
}, g = class extends h {
|
|
432
131
|
constructor({ database: e, schema: t, table: n }) {
|
|
433
132
|
super({
|
|
434
133
|
database: e,
|
|
@@ -436,7 +135,7 @@ var w = class {
|
|
|
436
135
|
relation: n
|
|
437
136
|
});
|
|
438
137
|
}
|
|
439
|
-
},
|
|
138
|
+
}, _ = class extends h {
|
|
440
139
|
constructor({ database: e, schema: t, view: n }) {
|
|
441
140
|
super({
|
|
442
141
|
database: e,
|
|
@@ -445,13 +144,13 @@ var w = class {
|
|
|
445
144
|
});
|
|
446
145
|
}
|
|
447
146
|
};
|
|
448
|
-
function
|
|
147
|
+
function v(t) {
|
|
449
148
|
if (t.error) throw t.error;
|
|
450
149
|
return e(t.count !== null, "Response does not contain a count. Make sure to set the `count` option in the request."), t;
|
|
451
150
|
}
|
|
452
151
|
//#endregion
|
|
453
152
|
//#region lib/postgrest/filter.ts
|
|
454
|
-
var
|
|
153
|
+
var y = [
|
|
455
154
|
"eq",
|
|
456
155
|
"neq",
|
|
457
156
|
"gt",
|
|
@@ -477,44 +176,41 @@ var O = [
|
|
|
477
176
|
"nxr",
|
|
478
177
|
"nxl",
|
|
479
178
|
"adj"
|
|
480
|
-
],
|
|
179
|
+
], b = ["and", "or"], x = (e) => (n = {}) => {
|
|
481
180
|
let r = (e) => n[e] ?? e, i = Object.keys(e.shape);
|
|
482
|
-
return t.string().transform((e,
|
|
181
|
+
return t.string().transform((e, n) => {
|
|
483
182
|
try {
|
|
484
|
-
return
|
|
485
|
-
} catch (
|
|
486
|
-
return
|
|
183
|
+
return T(e, i, r);
|
|
184
|
+
} catch (r) {
|
|
185
|
+
return n.addIssue({
|
|
487
186
|
code: "custom",
|
|
488
187
|
input: e,
|
|
489
|
-
message:
|
|
490
|
-
params:
|
|
491
|
-
expression:
|
|
492
|
-
format:
|
|
188
|
+
message: r instanceof Error ? r.message : void 0,
|
|
189
|
+
params: r instanceof o ? {
|
|
190
|
+
expression: r.expression,
|
|
191
|
+
format: r.format
|
|
493
192
|
} : void 0
|
|
494
|
-
}),
|
|
193
|
+
}), t.NEVER;
|
|
495
194
|
}
|
|
496
195
|
});
|
|
497
196
|
};
|
|
498
|
-
function
|
|
197
|
+
function S(e) {
|
|
499
198
|
return e.startsWith("not.") ? e.slice(4) : `not.${e}`;
|
|
500
199
|
}
|
|
501
|
-
function
|
|
200
|
+
function C(e) {
|
|
502
201
|
return {
|
|
503
202
|
...e,
|
|
504
|
-
op:
|
|
203
|
+
op: S(e.op)
|
|
505
204
|
};
|
|
506
205
|
}
|
|
507
|
-
function
|
|
206
|
+
function w(e, t = (e) => e) {
|
|
508
207
|
if (e.type === "logical") {
|
|
509
|
-
let n = e.args.map((e) =>
|
|
208
|
+
let n = e.args.map((e) => w(e, t));
|
|
510
209
|
return `${e.op}(${n})`;
|
|
511
210
|
}
|
|
512
211
|
return `${t(e.key)}.${e.op}.${e.value}`;
|
|
513
212
|
}
|
|
514
|
-
function
|
|
515
|
-
return e.map((e) => F(e, t)).join(n);
|
|
516
|
-
}
|
|
517
|
-
function L(t, n = [], r = (e) => e) {
|
|
213
|
+
function T(t, n = [], r = (e) => e) {
|
|
518
214
|
function i(e) {
|
|
519
215
|
let t = [], n = 0, r = "", i = !1;
|
|
520
216
|
for (let a of e) a === "\"" ? (i = !i, r += a) : a === "(" && !i ? (n++, r += a) : a === ")" && !i ? (n--, r += a) : a === "," && n === 0 && !i ? (t.push(r.trim()), r = "") : r += a;
|
|
@@ -524,47 +220,44 @@ function L(t, n = [], r = (e) => e) {
|
|
|
524
220
|
if (t.startsWith("and(")) return {
|
|
525
221
|
type: "logical",
|
|
526
222
|
op: "and",
|
|
527
|
-
args: i(t.slice(4, -1)).map((e) =>
|
|
223
|
+
args: i(t.slice(4, -1)).map((e) => T(e, n, r))
|
|
528
224
|
};
|
|
529
225
|
if (t.startsWith("or(")) return {
|
|
530
226
|
type: "logical",
|
|
531
227
|
op: "or",
|
|
532
|
-
args: i(t.slice(3, -1)).map((e) =>
|
|
228
|
+
args: i(t.slice(3, -1)).map((e) => T(e, n, r))
|
|
533
229
|
};
|
|
534
230
|
if (t.startsWith("not.and(")) return {
|
|
535
231
|
type: "logical",
|
|
536
232
|
op: "not.and",
|
|
537
|
-
args: i(t.slice(8, -1)).map((e) =>
|
|
233
|
+
args: i(t.slice(8, -1)).map((e) => T(e, n, r))
|
|
538
234
|
};
|
|
539
235
|
if (t.startsWith("not.or(")) return {
|
|
540
236
|
type: "logical",
|
|
541
237
|
op: "not.or",
|
|
542
|
-
args: i(t.slice(7, -1)).map((e) =>
|
|
238
|
+
args: i(t.slice(7, -1)).map((e) => T(e, n, r))
|
|
543
239
|
};
|
|
544
240
|
}
|
|
545
|
-
let a = `^(${n.length === 0 ? "[a-zA-Z_][a-zA-Z0-9_]*" : n.join("|")})\\.((?:not\\.)?(?:${
|
|
546
|
-
if (!
|
|
241
|
+
let a = `^(${n.length === 0 ? "[a-zA-Z_][a-zA-Z0-9_]*" : n.join("|")})\\.((?:not\\.)?(?:${y.join("|")}))\\.(.+)$`, s = new RegExp(a).exec(t);
|
|
242
|
+
if (!s) throw new o(`Invalid filter expression '${t}'`, {
|
|
547
243
|
expression: t,
|
|
548
244
|
format: {
|
|
549
245
|
syntax: "key.(not.)op.value",
|
|
550
246
|
keys: n.length === 0 ? "*" : n,
|
|
551
|
-
operators:
|
|
247
|
+
operators: y
|
|
552
248
|
}
|
|
553
249
|
});
|
|
554
|
-
let [,
|
|
250
|
+
let [, c, l, u] = s;
|
|
555
251
|
return {
|
|
556
252
|
type: "condition",
|
|
557
|
-
key: r(
|
|
558
|
-
op:
|
|
559
|
-
value: e.defined(
|
|
253
|
+
key: r(c),
|
|
254
|
+
op: l,
|
|
255
|
+
value: e.defined(u)
|
|
560
256
|
};
|
|
561
257
|
}
|
|
562
|
-
function R(e, t = [], n = (e) => e, r = "~") {
|
|
563
|
-
return e.length === 0 ? [] : e.split(r).map((e) => L(e, t, n));
|
|
564
|
-
}
|
|
565
258
|
//#endregion
|
|
566
259
|
//#region lib/postgrest/pagination-builder.ts
|
|
567
|
-
var
|
|
260
|
+
var E = class t extends D {
|
|
568
261
|
pagination;
|
|
569
262
|
constructor(e, t) {
|
|
570
263
|
super(e), this.pagination = t;
|
|
@@ -593,16 +286,16 @@ var z = class t extends B {
|
|
|
593
286
|
return t;
|
|
594
287
|
});
|
|
595
288
|
}
|
|
596
|
-
},
|
|
289
|
+
}, D = class t extends r.PostgrestFilterBuilder {
|
|
597
290
|
constructor(e) {
|
|
598
291
|
super(e);
|
|
599
292
|
}
|
|
600
293
|
select(e = "*") {
|
|
601
|
-
return new t(super.select(
|
|
294
|
+
return new t(super.select(d(e).join(",")));
|
|
602
295
|
}
|
|
603
296
|
where(e) {
|
|
604
297
|
if (e.type === "logical") {
|
|
605
|
-
let t = e.args.map((e) =>
|
|
298
|
+
let t = e.args.map((e) => w(e)).join(",");
|
|
606
299
|
return this.url.searchParams.append(e.op, `(${t})`), this;
|
|
607
300
|
}
|
|
608
301
|
return this.filter(e.key, e.op, e.value);
|
|
@@ -610,75 +303,75 @@ var z = class t extends B {
|
|
|
610
303
|
paginate(t, n) {
|
|
611
304
|
e(t >= 0, "Page index must be ≥ 0"), e(n >= 0, "Page limit must be ≥ 0");
|
|
612
305
|
let r = t * n, i = r + n - 1;
|
|
613
|
-
return new
|
|
306
|
+
return new E(this.range(r, i), {
|
|
614
307
|
page: t,
|
|
615
308
|
limit: n
|
|
616
309
|
});
|
|
617
310
|
}
|
|
618
|
-
},
|
|
311
|
+
}, O = class {
|
|
619
312
|
builder;
|
|
620
313
|
constructor(e) {
|
|
621
314
|
this.builder = e;
|
|
622
315
|
}
|
|
623
316
|
select(e = "*", t) {
|
|
624
|
-
return new
|
|
317
|
+
return new D(this.builder.select(d(e).join(","), t));
|
|
625
318
|
}
|
|
626
319
|
count(e = "exact") {
|
|
627
|
-
return new
|
|
320
|
+
return new D(this.select("*", {
|
|
628
321
|
count: e,
|
|
629
322
|
head: !0
|
|
630
323
|
}));
|
|
631
324
|
}
|
|
632
325
|
insert(e, t) {
|
|
633
|
-
return new
|
|
326
|
+
return new D(this.builder.insert(e, t));
|
|
634
327
|
}
|
|
635
328
|
upsert(e, { onConflict: t, ...n } = {}) {
|
|
636
|
-
return new
|
|
637
|
-
onConflict:
|
|
329
|
+
return new D(this.builder.upsert(e, {
|
|
330
|
+
onConflict: d(t).join(","),
|
|
638
331
|
...n
|
|
639
332
|
}));
|
|
640
333
|
}
|
|
641
334
|
update(e, t) {
|
|
642
|
-
return new
|
|
335
|
+
return new D(this.builder.update(e, t));
|
|
643
336
|
}
|
|
644
337
|
delete() {
|
|
645
|
-
return new
|
|
338
|
+
return new D(this.builder.delete());
|
|
646
339
|
}
|
|
647
|
-
},
|
|
340
|
+
}, k = class {
|
|
648
341
|
client;
|
|
649
342
|
constructor(e) {
|
|
650
343
|
this.client = e;
|
|
651
344
|
}
|
|
652
345
|
from(e) {
|
|
653
|
-
return new
|
|
346
|
+
return new O(this.client.from(e));
|
|
654
347
|
}
|
|
655
348
|
rpc(e, t, n) {
|
|
656
|
-
return new
|
|
349
|
+
return new D(this.client.rpc(e, t, n));
|
|
657
350
|
}
|
|
658
|
-
},
|
|
351
|
+
}, A = class {
|
|
659
352
|
supabase;
|
|
660
353
|
constructor({ supabase: e }) {
|
|
661
354
|
this.supabase = e;
|
|
662
355
|
}
|
|
663
356
|
schema(e) {
|
|
664
|
-
return new
|
|
357
|
+
return new k(this.supabase.schema(e));
|
|
665
358
|
}
|
|
666
359
|
relation(e, t) {
|
|
667
|
-
return new
|
|
360
|
+
return new h({
|
|
668
361
|
database: this,
|
|
669
362
|
schema: e,
|
|
670
363
|
relation: t
|
|
671
364
|
});
|
|
672
365
|
}
|
|
673
366
|
table(e, t) {
|
|
674
|
-
return new
|
|
367
|
+
return new g({
|
|
675
368
|
database: this,
|
|
676
369
|
schema: e,
|
|
677
370
|
table: t
|
|
678
371
|
});
|
|
679
372
|
}
|
|
680
373
|
view(e, t) {
|
|
681
|
-
return new
|
|
374
|
+
return new _({
|
|
682
375
|
database: this,
|
|
683
376
|
schema: e,
|
|
684
377
|
view: t
|
|
@@ -687,15 +380,15 @@ var z = class t extends B {
|
|
|
687
380
|
};
|
|
688
381
|
//#endregion
|
|
689
382
|
//#region lib/storage.ts
|
|
690
|
-
function
|
|
383
|
+
function j(e) {
|
|
691
384
|
return e.bucket !== void 0 && e.path !== void 0;
|
|
692
385
|
}
|
|
693
|
-
function
|
|
386
|
+
function M(e) {
|
|
694
387
|
return e.fileId !== void 0 && e.bucket !== void 0;
|
|
695
388
|
}
|
|
696
389
|
//#endregion
|
|
697
390
|
//#region lib/storage-service.ts
|
|
698
|
-
var
|
|
391
|
+
var N = class {
|
|
699
392
|
client;
|
|
700
393
|
database;
|
|
701
394
|
constructor({ client: e, database: t }) {
|
|
@@ -715,8 +408,8 @@ var K = class {
|
|
|
715
408
|
return n;
|
|
716
409
|
}
|
|
717
410
|
async getFileStorageLocation(t) {
|
|
718
|
-
if (
|
|
719
|
-
if (
|
|
411
|
+
if (M(t)) return t;
|
|
412
|
+
if (j(t)) {
|
|
720
413
|
let { id: e } = await this.getFileObject(t);
|
|
721
414
|
return {
|
|
722
415
|
fileId: e,
|
|
@@ -724,7 +417,7 @@ var K = class {
|
|
|
724
417
|
};
|
|
725
418
|
}
|
|
726
419
|
let { fileId: n } = t, r = await this.files.get(n, ["bucket_id", "path_tokens"]);
|
|
727
|
-
if (r === void 0) throw new
|
|
420
|
+
if (r === void 0) throw new a(`File with ID ${n} not found`, { fileId: n });
|
|
728
421
|
return {
|
|
729
422
|
fileId: n,
|
|
730
423
|
bucket: e.notNull(r.bucket_id, "bucket_id must not be null"),
|
|
@@ -755,7 +448,7 @@ var K = class {
|
|
|
755
448
|
async assertExistsFile(e) {
|
|
756
449
|
let { bucket: t, path: n } = await this.getFileStorageLocation(e), { data: r, error: i } = await this.client.from(t).exists(n);
|
|
757
450
|
if (i) throw i;
|
|
758
|
-
if (!r) throw new
|
|
451
|
+
if (!r) throw new a(`File not found in bucket '${t}' at path '${n}'`, {
|
|
759
452
|
bucket: t,
|
|
760
453
|
path: n
|
|
761
454
|
});
|
|
@@ -772,7 +465,7 @@ var K = class {
|
|
|
772
465
|
async downloadFile(e) {
|
|
773
466
|
let { fileId: t, bucket: n, path: r, properties: i } = await this.getFileInfo(e), { data: a, error: o } = await this.client.from(n).download(r);
|
|
774
467
|
if (o) throw o;
|
|
775
|
-
let [, s] =
|
|
468
|
+
let [, s] = u(r);
|
|
776
469
|
return {
|
|
777
470
|
fileId: t,
|
|
778
471
|
bucket: n,
|
|
@@ -784,7 +477,7 @@ var K = class {
|
|
|
784
477
|
let n = t.filter((e) => "fileId" in e).map((e) => e.fileId), r = (await this.files.query.select(["bucket_id", "path_tokens"]).containedBy("id", n).throwOnError()).data.map(({ bucket_id: t, path_tokens: n }) => ({
|
|
785
478
|
bucket: e.notNull(t, "bucket_id must not be null"),
|
|
786
479
|
path: e.notNull(n, "path_tokens must not be null").join("/")
|
|
787
|
-
})), i =
|
|
480
|
+
})), i = m(f(t.filter((e) => j(e)).concat(r), (e) => e.bucket)).map(([e, t]) => ({
|
|
788
481
|
bucket: e,
|
|
789
482
|
paths: t.map((e) => e.path)
|
|
790
483
|
}));
|
|
@@ -799,4 +492,4 @@ var K = class {
|
|
|
799
492
|
}
|
|
800
493
|
};
|
|
801
494
|
//#endregion
|
|
802
|
-
export {
|
|
495
|
+
export { h as DataService, A as DatabaseService, a as FileNotFoundError, x as FilterNode, y as FilterOp, b as LogicalOp, o as ParseError, k as PostgrestClient, c as PostgrestErrorInterface, D as PostgrestFilterBuilder, E as PostgrestPaginationBuilder, O as PostgrestQueryBuilder, s as RecordNotFoundError, N as StorageService, g as TableDataService, i as TracedError, _ as ViewDataService, v as assertCounted, d as coerceArray, w as encodeFilterNode, m as entries, f as groupBy, l as isDatabaseApiError, C as negateFilterNode, S as negateOp, T as parseFilterExpression, p as removeElement, u as splitPath };
|
|
@@ -18,23 +18,6 @@ export type FilterOp = `${'' | 'not.'}${typeof FilterOp[number]}`;
|
|
|
18
18
|
*/
|
|
19
19
|
export declare const LogicalOp: readonly ["and", "or"];
|
|
20
20
|
export type LogicalOp = `${'' | 'not.'}${typeof LogicalOp[number]}`;
|
|
21
|
-
/**
|
|
22
|
-
* The separator used to split multiple filter expressions in a logical operator (e.g. `and`, `or`).
|
|
23
|
-
*/
|
|
24
|
-
export declare const LogicalOpSeparator = ",";
|
|
25
|
-
/**
|
|
26
|
-
* The operator for chaining multiple filters.
|
|
27
|
-
* This is a short notation for cascading filters with and().
|
|
28
|
-
*
|
|
29
|
-
* ***NOTE:*** PostgREST uses `&` to separate filters, but we use `~` as `&` is reserved for top-level query parameters.
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* // The following filter expressions are equivalent:
|
|
33
|
-
* 'name.cs.John~age.gt.30~createdAt.gte.2023-01-01'
|
|
34
|
-
* 'and(name.cs.John,and(age.gt.30,createdAt.gte.2023-01-01))'.
|
|
35
|
-
* @see https://docs.postgrest.org/en/stable/api.html#horizontal-filtering
|
|
36
|
-
*/
|
|
37
|
-
export declare const FilterChainSeparator = "~";
|
|
38
21
|
/**
|
|
39
22
|
* A single filter condition in an abstract syntax tree (AST) of filter nodes.
|
|
40
23
|
* @param K The type of keys in the filter expression.
|
|
@@ -80,7 +63,7 @@ export type FilterKey<Item extends object> = KeyOfString<Item>;
|
|
|
80
63
|
* An array of filter AST nodes, representing a chain of filter expressions joined by a logical `and`.
|
|
81
64
|
* It can be decoded from a string containing one or more filter expressions, chained with the {@link FilterChainSeparator chain separator `~`} .
|
|
82
65
|
*/
|
|
83
|
-
export declare const
|
|
66
|
+
export declare const FilterNode: <Item extends ZodObject>(item: Item) => <DecodeKey extends string = string>(mapping?: Partial<Record<FilterKey<z.infer<Item>>, DecodeKey>>) => z.ZodPipe<z.ZodString, z.ZodTransform<FilterNode<DecodeKey>, string>>;
|
|
84
67
|
export type Filter<K extends string = string> = FilterNode<K>[];
|
|
85
68
|
/**
|
|
86
69
|
* Negates a filter or logical operator.
|
|
@@ -111,18 +94,6 @@ export declare function negateFilterNode<K extends string = string, F extends Fi
|
|
|
111
94
|
* @see https://docs.postgrest.org/en/stable/api.html#horizontal-filtering
|
|
112
95
|
*/
|
|
113
96
|
export declare function encodeFilterNode<K extends string = string>(node: FilterNode<K>, transformKey?: (key: K) => string): string;
|
|
114
|
-
/**
|
|
115
|
-
* Encodes a filter (an array of filter AST nodes) into a filter string
|
|
116
|
-
* containing one or more filter expressions separated by a filter separator.
|
|
117
|
-
*
|
|
118
|
-
* @template InputKey - The type of keys in the filter AST nodes.
|
|
119
|
-
* @template OutputKey - The type of keys in the filter string.
|
|
120
|
-
* @param filter The filter to encode.
|
|
121
|
-
* @param transformKey An optional function to transform keys from InputKey to OutputKey.
|
|
122
|
-
* @param separator The separator used to join multiple filter expressions. Default is the {@link FilterChainSeparator chain separator `~`} .
|
|
123
|
-
* @returns The encoded filter string.
|
|
124
|
-
*/
|
|
125
|
-
export declare function encodeFilter<K extends string = string>(filter: Filter<K>, transformKey?: (key: K) => string, separator?: string): string;
|
|
126
97
|
/**
|
|
127
98
|
* Parses a filter expression into a filter AST node.
|
|
128
99
|
* The expression must follow the dot notation of [PostgREST](https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering).
|
|
@@ -138,20 +109,4 @@ export declare function encodeFilter<K extends string = string>(filter: Filter<K
|
|
|
138
109
|
* @throws ParseError if any expression in the filter string can not be parsed, e.g. has invalid syntax, unsupported operators or unsupported keys.
|
|
139
110
|
*/
|
|
140
111
|
export declare function parseFilterExpression<InputKey extends string = string, OutputKey extends string = InputKey>(expression: string, inputKeys?: InputKey[], transformKey?: (key: InputKey) => OutputKey): FilterNode<OutputKey>;
|
|
141
|
-
/**
|
|
142
|
-
* Parses a chain of filter expressions into a filter (an array of filter AST nodes).
|
|
143
|
-
* Filter expressions are chained together using a filter separator.
|
|
144
|
-
* Each expression in the chain must follow the dot notation of [PostgREST](https://docs.postgrest.org/en/v13/references/api/tables_views.html#horizontal-filtering).
|
|
145
|
-
*
|
|
146
|
-
* @template InputKey - The type of keys in the filter expressions.
|
|
147
|
-
* @template OutputKey - The type of keys in the filter AST nodes.
|
|
148
|
-
* @param expressions The filter string containing one or more filter expressions, chained together by the {@link separator}.
|
|
149
|
-
* @param inputKeys The list of valid keys in the filter expressions.
|
|
150
|
-
* This is used to validate the keys in the expressions. If not provided, any key is valid.
|
|
151
|
-
* @param transformKey An optional function to transform keys from InputKey to OutputKey.
|
|
152
|
-
* @param separator - The separator used to split multiple filter expressions. Default is the {@link FilterChainSeparator chain separator `~`} .
|
|
153
|
-
* @returns An array of filter AST nodes parsed from the filter string. An empty string will resolve to an empty array.
|
|
154
|
-
* @throws ParseError if any expression in the filter string can not be parsed, e.g. has invalid syntax, unsupported operators or unsupported keys.
|
|
155
|
-
*/
|
|
156
|
-
export declare function parseFilterExpressionChain<InputKey extends string = string, OutputKey extends string = InputKey>(expressions: string, inputKeys?: InputKey[], transformKey?: (key: InputKey) => OutputKey, separator?: string): FilterNode<OutputKey>[];
|
|
157
112
|
//# sourceMappingURL=filter.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../lib/postgrest/filter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,KAAK,CAAC;AACrC,OAAO,CAAC,MAAM,KAAK,CAAC;AAKpB,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"filter.d.ts","sourceRoot":"","sources":["../../lib/postgrest/filter.ts"],"names":[],"mappings":"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"}
|
package/package.json
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
"private": false,
|
|
4
4
|
"displayName": "Supabase-Core",
|
|
5
5
|
"description": "Lightweight services for supabase to make it easier to work with databases, tables and storage buckets",
|
|
6
|
-
"version": "2.
|
|
6
|
+
"version": "2.3.0",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"repository": {
|
|
9
9
|
"type": "git",
|