@authhero/kysely-adapter 10.46.0 → 10.47.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/dist/kysely-adapter.cjs +1 -1
- package/dist/kysely-adapter.mjs +92 -88
- package/package.json +1 -1
package/dist/kysely-adapter.mjs
CHANGED
|
@@ -4,7 +4,7 @@ var wn = (t) => {
|
|
|
4
4
|
};
|
|
5
5
|
var Rr = (t, e, n) => e in t ? Dr(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n;
|
|
6
6
|
var oe = (t, e, n) => Rr(t, typeof e != "symbol" ? e + "" : e, n), Bt = (t, e, n) => e.has(t) || wn("Cannot " + n);
|
|
7
|
-
var i = (t, e, n) => (Bt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? wn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Bt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n),
|
|
7
|
+
var i = (t, e, n) => (Bt(t, e, "read from private field"), n ? n.call(t) : e.get(t)), C = (t, e, n) => e.has(t) ? wn("Cannot add the same private member more than once") : e instanceof WeakSet ? e.add(t) : e.set(t, n), O = (t, e, n, r) => (Bt(t, e, "write to private field"), r ? r.call(t, n) : e.set(t, n), n), w = (t, e, n) => (Bt(t, e, "access private method"), n);
|
|
8
8
|
import { parseUserId as ln, codeSchema as zr, connectionSchema as Fr, loginSessionSchema as qr, promptSettingSchema as jr, formSchema as bt, resourceServerSchema as Lr } from "@authhero/adapter-interfaces";
|
|
9
9
|
import "@hono/zod-openapi";
|
|
10
10
|
var lt = class extends Error {
|
|
@@ -124,23 +124,23 @@ function L(t, e, n, r) {
|
|
|
124
124
|
h === '"' ? (u = !u, o += h) : h === " " && !u ? o.trim() && (a.push(o.trim()), o = "") : o += h;
|
|
125
125
|
}
|
|
126
126
|
return o.trim() && a.push(o.trim()), a.map((c) => c.replace(/^([^:]+)=/g, "$1:")).map((c) => {
|
|
127
|
-
let h = c.startsWith("-"), p = null, l = "",
|
|
127
|
+
let h = c.startsWith("-"), p = null, l = "", y = !1, f;
|
|
128
128
|
if (c.startsWith("-_exists_:"))
|
|
129
|
-
p = c.substring(10),
|
|
129
|
+
p = c.substring(10), y = !0, h = !0;
|
|
130
130
|
else if (c.startsWith("_exists_:"))
|
|
131
|
-
p = c.substring(9),
|
|
131
|
+
p = c.substring(9), y = !0, h = !1;
|
|
132
132
|
else if (c.includes(":")) {
|
|
133
133
|
const v = h ? c.substring(1) : c, b = v.indexOf(":");
|
|
134
|
-
p = v.substring(0, b), l = v.substring(b + 1),
|
|
134
|
+
p = v.substring(0, b), l = v.substring(b + 1), y = !1, l.startsWith(">=") ? (f = ">=", l = l.substring(2)) : l.startsWith(">") ? (f = ">", l = l.substring(1)) : l.startsWith("<=") ? (f = "<=", l = l.substring(2)) : l.startsWith("<") ? (f = "<", l = l.substring(1)) : f = "=", l.startsWith('"') && l.endsWith('"') && l.length > 1 && (l = l.slice(1, -1));
|
|
135
135
|
} else
|
|
136
|
-
p = null, l = c,
|
|
137
|
-
return { key: p, value: l, isNegation: h, isExistsQuery:
|
|
138
|
-
}).forEach(({ key: c, value: h, isNegation: p, isExistsQuery: l, operator:
|
|
136
|
+
p = null, l = c, y = !1;
|
|
137
|
+
return { key: p, value: l, isNegation: h, isExistsQuery: y, operator: f };
|
|
138
|
+
}).forEach(({ key: c, value: h, isNegation: p, isExistsQuery: l, operator: y }) => {
|
|
139
139
|
if (c)
|
|
140
140
|
if (l)
|
|
141
141
|
p ? e = e.where(c, "is", null) : e = e.where(c, "is not", null);
|
|
142
142
|
else if (p)
|
|
143
|
-
switch (
|
|
143
|
+
switch (y) {
|
|
144
144
|
case ">":
|
|
145
145
|
e = e.where(c, "<=", h);
|
|
146
146
|
break;
|
|
@@ -157,7 +157,7 @@ function L(t, e, n, r) {
|
|
|
157
157
|
e = e.where(c, "!=", h);
|
|
158
158
|
}
|
|
159
159
|
else
|
|
160
|
-
e = e.where(c,
|
|
160
|
+
e = e.where(c, y, h);
|
|
161
161
|
else if (h) {
|
|
162
162
|
const { ref: f } = t.dynamic;
|
|
163
163
|
e = e.where(
|
|
@@ -179,8 +179,8 @@ function Wr(t) {
|
|
|
179
179
|
const { ref: b } = t.dynamic;
|
|
180
180
|
c = c.orderBy(b(u.sort_by), u.sort_order);
|
|
181
181
|
}
|
|
182
|
-
const p = await c.offset(r * a).limit(a).selectAll().execute(), l = p.map((b) => b.user_id),
|
|
183
|
-
const E =
|
|
182
|
+
const p = await c.offset(r * a).limit(a).selectAll().execute(), l = p.map((b) => b.user_id), y = l.length ? await t.selectFrom("users").selectAll().where("users.tenant_id", "=", e).where("users.linked_to", "in", l).execute() : [], f = p.map((b) => {
|
|
183
|
+
const E = y.filter(
|
|
184
184
|
(D) => D.linked_to === b.user_id
|
|
185
185
|
);
|
|
186
186
|
return S({
|
|
@@ -321,12 +321,12 @@ function ea(t) {
|
|
|
321
321
|
return {
|
|
322
322
|
tenants: p
|
|
323
323
|
};
|
|
324
|
-
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(),
|
|
324
|
+
const { count: l } = await n.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow(), y = F(l);
|
|
325
325
|
return {
|
|
326
326
|
tenants: p,
|
|
327
327
|
start: r * a,
|
|
328
328
|
limit: a,
|
|
329
|
-
length:
|
|
329
|
+
length: y
|
|
330
330
|
};
|
|
331
331
|
};
|
|
332
332
|
}
|
|
@@ -417,12 +417,12 @@ function ia(t) {
|
|
|
417
417
|
limit: 0,
|
|
418
418
|
length: 0
|
|
419
419
|
};
|
|
420
|
-
const { count:
|
|
420
|
+
const { count: y } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
421
421
|
return {
|
|
422
422
|
logs: l,
|
|
423
423
|
start: r * a,
|
|
424
424
|
limit: a,
|
|
425
|
-
length: F(
|
|
425
|
+
length: F(y)
|
|
426
426
|
};
|
|
427
427
|
};
|
|
428
428
|
}
|
|
@@ -506,7 +506,7 @@ function ma(t) {
|
|
|
506
506
|
limit: 0,
|
|
507
507
|
length: 0
|
|
508
508
|
};
|
|
509
|
-
const { count:
|
|
509
|
+
const { count: y } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = F(y);
|
|
510
510
|
return {
|
|
511
511
|
sessions: l,
|
|
512
512
|
start: r * a,
|
|
@@ -564,8 +564,8 @@ function wa(t) {
|
|
|
564
564
|
const { page: r = 0, per_page: a = 50, include_totals: o = !1, q: u } = n;
|
|
565
565
|
let d = t.selectFrom("codes").where("codes.tenant_id", "=", e);
|
|
566
566
|
u && (d = L(t, d, u, ["code", "login_id"]));
|
|
567
|
-
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((
|
|
568
|
-
const { tenant_id: f, ...v } =
|
|
567
|
+
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((y) => {
|
|
568
|
+
const { tenant_id: f, ...v } = y;
|
|
569
569
|
return zr.parse(S(v));
|
|
570
570
|
});
|
|
571
571
|
if (!o)
|
|
@@ -575,7 +575,7 @@ function wa(t) {
|
|
|
575
575
|
limit: 0,
|
|
576
576
|
length: 0
|
|
577
577
|
};
|
|
578
|
-
const { count: l } = await d.select((
|
|
578
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
579
579
|
return {
|
|
580
580
|
codes: p,
|
|
581
581
|
start: r * a,
|
|
@@ -666,9 +666,9 @@ function Pa(t) {
|
|
|
666
666
|
let d = t.selectFrom("connections").where("connections.tenant_id", "=", e);
|
|
667
667
|
u && (d = L(t, d, u, ["user_id", "ip"]));
|
|
668
668
|
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map(
|
|
669
|
-
(
|
|
670
|
-
...
|
|
671
|
-
options: JSON.parse(
|
|
669
|
+
(y) => S({
|
|
670
|
+
...y,
|
|
671
|
+
options: JSON.parse(y.options)
|
|
672
672
|
})
|
|
673
673
|
);
|
|
674
674
|
if (!o)
|
|
@@ -678,7 +678,7 @@ function Pa(t) {
|
|
|
678
678
|
limit: 0,
|
|
679
679
|
length: 0
|
|
680
680
|
};
|
|
681
|
-
const { count: l } = await d.select((
|
|
681
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
682
682
|
return {
|
|
683
683
|
connections: p,
|
|
684
684
|
start: r * a,
|
|
@@ -996,12 +996,12 @@ function Ka(t) {
|
|
|
996
996
|
limit: 0,
|
|
997
997
|
length: 0
|
|
998
998
|
};
|
|
999
|
-
const { count:
|
|
999
|
+
const { count: y } = await c.select((f) => f.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1000
1000
|
return {
|
|
1001
1001
|
client_grants: l,
|
|
1002
1002
|
start: r * a,
|
|
1003
1003
|
limit: a,
|
|
1004
|
-
length: F(
|
|
1004
|
+
length: F(y)
|
|
1005
1005
|
};
|
|
1006
1006
|
};
|
|
1007
1007
|
}
|
|
@@ -1121,12 +1121,12 @@ function Ya(t) {
|
|
|
1121
1121
|
limit: 0,
|
|
1122
1122
|
length: 0
|
|
1123
1123
|
};
|
|
1124
|
-
const l = await c.executeTakeFirst(),
|
|
1124
|
+
const l = await c.executeTakeFirst(), y = F((l == null ? void 0 : l.count) ?? 0);
|
|
1125
1125
|
return {
|
|
1126
1126
|
signingKeys: p,
|
|
1127
1127
|
start: h,
|
|
1128
1128
|
limit: r,
|
|
1129
|
-
length:
|
|
1129
|
+
length: y
|
|
1130
1130
|
};
|
|
1131
1131
|
};
|
|
1132
1132
|
}
|
|
@@ -1241,7 +1241,7 @@ function so(t) {
|
|
|
1241
1241
|
}
|
|
1242
1242
|
function uo(t) {
|
|
1243
1243
|
return async (e, n) => {
|
|
1244
|
-
var u, d, c, h, p, l,
|
|
1244
|
+
var u, d, c, h, p, l, y, f, v, b, E, D, ae, U, pe, Nt, ge, nt;
|
|
1245
1245
|
const { colors: r, font: a, ...o } = n;
|
|
1246
1246
|
try {
|
|
1247
1247
|
await t.insertInto("branding").values({
|
|
@@ -1250,7 +1250,7 @@ function uo(t) {
|
|
|
1250
1250
|
colors_page_background_type: (d = (u = n.colors) == null ? void 0 : u.page_background) == null ? void 0 : d.type,
|
|
1251
1251
|
colors_page_background_start: (h = (c = n.colors) == null ? void 0 : c.page_background) == null ? void 0 : h.start,
|
|
1252
1252
|
colors_page_background_end: (l = (p = n.colors) == null ? void 0 : p.page_background) == null ? void 0 : l.end,
|
|
1253
|
-
colors_page_background_angle_dev: (f = (
|
|
1253
|
+
colors_page_background_angle_dev: (f = (y = n.colors) == null ? void 0 : y.page_background) == null ? void 0 : f.angle_deg,
|
|
1254
1254
|
font_url: (v = n.font) == null ? void 0 : v.url,
|
|
1255
1255
|
tenant_id: e
|
|
1256
1256
|
}).execute();
|
|
@@ -1278,8 +1278,8 @@ function lo(t) {
|
|
|
1278
1278
|
const { page: r = 0, per_page: a = 50, include_totals: o = !1, q: u } = n;
|
|
1279
1279
|
let d = t.selectFrom("hooks").where("hooks.tenant_id", "=", e);
|
|
1280
1280
|
u && (d = L(t, d, u, ["url", "form_id"]));
|
|
1281
|
-
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((
|
|
1282
|
-
const { tenant_id: f, enabled: v, synchronous: b, ...E } =
|
|
1281
|
+
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((y) => {
|
|
1282
|
+
const { tenant_id: f, enabled: v, synchronous: b, ...E } = y;
|
|
1283
1283
|
return S({
|
|
1284
1284
|
...E,
|
|
1285
1285
|
enabled: !!v,
|
|
@@ -1293,7 +1293,7 @@ function lo(t) {
|
|
|
1293
1293
|
limit: 0,
|
|
1294
1294
|
length: 0
|
|
1295
1295
|
};
|
|
1296
|
-
const { count: l } = await d.select((
|
|
1296
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1297
1297
|
return {
|
|
1298
1298
|
hooks: p,
|
|
1299
1299
|
start: r * a,
|
|
@@ -1615,7 +1615,7 @@ function qo(t) {
|
|
|
1615
1615
|
limit: 0,
|
|
1616
1616
|
length: 0
|
|
1617
1617
|
};
|
|
1618
|
-
const { count:
|
|
1618
|
+
const { count: y } = await c.select((v) => v.fn.countAll().as("count")).executeTakeFirstOrThrow(), f = F(y);
|
|
1619
1619
|
return {
|
|
1620
1620
|
refresh_tokens: l,
|
|
1621
1621
|
start: r * a,
|
|
@@ -1686,8 +1686,8 @@ function Mo(t) {
|
|
|
1686
1686
|
const { page: r = 0, per_page: a = 50, include_totals: o = !1, q: u } = n;
|
|
1687
1687
|
let d = t.selectFrom("forms").where("tenant_id", "=", e);
|
|
1688
1688
|
u && (d = L(t, d, u, []));
|
|
1689
|
-
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((
|
|
1690
|
-
const f = { ...
|
|
1689
|
+
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((y) => {
|
|
1690
|
+
const f = { ...y };
|
|
1691
1691
|
if (typeof f.nodes == "string")
|
|
1692
1692
|
try {
|
|
1693
1693
|
f.nodes = JSON.parse(f.nodes);
|
|
@@ -1712,7 +1712,7 @@ function Mo(t) {
|
|
|
1712
1712
|
limit: 0,
|
|
1713
1713
|
length: 0
|
|
1714
1714
|
};
|
|
1715
|
-
const { count: l } = await d.select((
|
|
1715
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1716
1716
|
return {
|
|
1717
1717
|
forms: p,
|
|
1718
1718
|
start: r * a,
|
|
@@ -1784,7 +1784,7 @@ function Qo(t) {
|
|
|
1784
1784
|
skip_consent_for_verifiable_first_party_clients: h,
|
|
1785
1785
|
allow_offline_access: p,
|
|
1786
1786
|
...l
|
|
1787
|
-
} = o,
|
|
1787
|
+
} = o, y = {
|
|
1788
1788
|
...l,
|
|
1789
1789
|
tenant_id: e,
|
|
1790
1790
|
scopes: d ? JSON.stringify(d) : "[]",
|
|
@@ -1795,7 +1795,7 @@ function Qo(t) {
|
|
|
1795
1795
|
created_at: r,
|
|
1796
1796
|
updated_at: r
|
|
1797
1797
|
};
|
|
1798
|
-
return await t.insertInto("resource_servers").values(
|
|
1798
|
+
return await t.insertInto("resource_servers").values(y).execute(), S(o);
|
|
1799
1799
|
};
|
|
1800
1800
|
}
|
|
1801
1801
|
function Vo(t) {
|
|
@@ -1826,18 +1826,18 @@ function Go(t) {
|
|
|
1826
1826
|
const { page: r = 0, per_page: a = 50, include_totals: o = !1, q: u } = n;
|
|
1827
1827
|
let d = t.selectFrom("resource_servers").where("resource_servers.tenant_id", "=", e);
|
|
1828
1828
|
if (u) {
|
|
1829
|
-
const
|
|
1829
|
+
const y = u.trim(), f = y.split(/\s+/), v = f.length === 1 ? f[0] : void 0, b = v ? v.match(/^(-)?(name|identifier):(.*)$/) : null, E = b ? b[3] : "", D = /^(>=|>|<=|<)/.test(E || "");
|
|
1830
1830
|
if (b && !D) {
|
|
1831
1831
|
const ae = !!b[1], U = b[2] === "name" ? "resource_servers.name" : "resource_servers.identifier";
|
|
1832
1832
|
d = ae ? d.where(U, "not like", `%${E}%`) : d.where(U, "like", `%${E}%`);
|
|
1833
1833
|
} else
|
|
1834
|
-
d = L(t, d,
|
|
1834
|
+
d = L(t, d, y, [
|
|
1835
1835
|
"resource_servers.name",
|
|
1836
1836
|
"resource_servers.identifier"
|
|
1837
1837
|
]);
|
|
1838
1838
|
}
|
|
1839
|
-
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((
|
|
1840
|
-
const f =
|
|
1839
|
+
const p = (await d.offset(r * a).limit(a).selectAll().execute()).map((y) => {
|
|
1840
|
+
const f = y, {
|
|
1841
1841
|
verification_key: v,
|
|
1842
1842
|
scopes: b,
|
|
1843
1843
|
options: E,
|
|
@@ -1862,7 +1862,7 @@ function Go(t) {
|
|
|
1862
1862
|
limit: 0,
|
|
1863
1863
|
length: 0
|
|
1864
1864
|
};
|
|
1865
|
-
const { count: l } = await d.select((
|
|
1865
|
+
const { count: l } = await d.select((y) => y.fn.countAll().as("count")).executeTakeFirstOrThrow();
|
|
1866
1866
|
return {
|
|
1867
1867
|
resource_servers: p,
|
|
1868
1868
|
start: r * a,
|
|
@@ -1890,7 +1890,11 @@ function Ho(t) {
|
|
|
1890
1890
|
...h,
|
|
1891
1891
|
updated_at: (/* @__PURE__ */ new Date()).toISOString()
|
|
1892
1892
|
};
|
|
1893
|
-
a !== void 0 && (p.verification_key = a), o !== void 0 && (p.scopes = JSON.stringify(o)), u !== void 0
|
|
1893
|
+
if (a !== void 0 && (p.verification_key = a), o !== void 0 && (p.scopes = JSON.stringify(o)), u !== void 0) {
|
|
1894
|
+
const y = await t.selectFrom("resource_servers").select("options").where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst(), v = { ...y != null && y.options ? JSON.parse(y.options) : {}, ...u };
|
|
1895
|
+
p.options = JSON.stringify(v);
|
|
1896
|
+
}
|
|
1897
|
+
d !== void 0 && (p.skip_consent_for_verifiable_first_party_clients = d ? 1 : 0), c !== void 0 && (p.allow_offline_access = c ? 1 : 0);
|
|
1894
1898
|
const l = await t.updateTable("resource_servers").set(p).where("tenant_id", "=", e).where("id", "=", n).executeTakeFirst();
|
|
1895
1899
|
return Number(l.numUpdatedRows) > 0;
|
|
1896
1900
|
};
|
|
@@ -4666,12 +4670,12 @@ class gs extends fs {
|
|
|
4666
4670
|
O(this, Le, n);
|
|
4667
4671
|
}
|
|
4668
4672
|
transformNodeImpl(n) {
|
|
4669
|
-
if (!
|
|
4673
|
+
if (!w(this, I, or).call(this, n))
|
|
4670
4674
|
return super.transformNodeImpl(n);
|
|
4671
|
-
const r =
|
|
4675
|
+
const r = w(this, I, sr).call(this, n);
|
|
4672
4676
|
for (const u of r)
|
|
4673
4677
|
i(this, ve).add(u);
|
|
4674
|
-
const a =
|
|
4678
|
+
const a = w(this, I, ir).call(this, n);
|
|
4675
4679
|
for (const u of a)
|
|
4676
4680
|
i(this, Ne).add(u);
|
|
4677
4681
|
const o = super.transformNodeImpl(n);
|
|
@@ -4700,19 +4704,19 @@ Le = new WeakMap(), Ne = new WeakMap(), ve = new WeakMap(), I = new WeakSet(), o
|
|
|
4700
4704
|
return n.kind in ps;
|
|
4701
4705
|
}, ir = function(n) {
|
|
4702
4706
|
const r = /* @__PURE__ */ new Set();
|
|
4703
|
-
if ("name" in n && n.name && Gt.is(n.name) &&
|
|
4707
|
+
if ("name" in n && n.name && Gt.is(n.name) && w(this, I, en).call(this, n.name, r), "from" in n && n.from)
|
|
4704
4708
|
for (const a of n.from.froms)
|
|
4705
|
-
|
|
4706
|
-
if ("into" in n && n.into &&
|
|
4709
|
+
w(this, I, $e).call(this, a, r);
|
|
4710
|
+
if ("into" in n && n.into && w(this, I, $e).call(this, n.into, r), "table" in n && n.table && w(this, I, $e).call(this, n.table, r), "joins" in n && n.joins)
|
|
4707
4711
|
for (const a of n.joins)
|
|
4708
|
-
|
|
4709
|
-
return "using" in n && n.using &&
|
|
4712
|
+
w(this, I, $e).call(this, a.table, r);
|
|
4713
|
+
return "using" in n && n.using && w(this, I, $e).call(this, n.using, r), r;
|
|
4710
4714
|
}, sr = function(n) {
|
|
4711
4715
|
const r = /* @__PURE__ */ new Set();
|
|
4712
|
-
return "with" in n && n.with &&
|
|
4716
|
+
return "with" in n && n.with && w(this, I, ur).call(this, n.with, r), r;
|
|
4713
4717
|
}, $e = function(n, r) {
|
|
4714
4718
|
const a = xe.is(n) ? n : fe.is(n) && xe.is(n.node) ? n.node : null;
|
|
4715
|
-
a &&
|
|
4719
|
+
a && w(this, I, en).call(this, a.table, r);
|
|
4716
4720
|
}, en = function(n, r) {
|
|
4717
4721
|
const a = n.identifier.name;
|
|
4718
4722
|
!i(this, Ne).has(a) && !i(this, ve).has(a) && r.add(a);
|
|
@@ -4789,7 +4793,7 @@ class Ns {
|
|
|
4789
4793
|
}
|
|
4790
4794
|
async executeQuery(e, n) {
|
|
4791
4795
|
return await this.provideConnection(async (r) => {
|
|
4792
|
-
const a = await r.executeQuery(e), o = await
|
|
4796
|
+
const a = await r.executeQuery(e), o = await w(this, gt, tn).call(this, a, n);
|
|
4793
4797
|
return vs(a, o), o;
|
|
4794
4798
|
});
|
|
4795
4799
|
}
|
|
@@ -4799,7 +4803,7 @@ class Ns {
|
|
|
4799
4803
|
const u = await a.promise;
|
|
4800
4804
|
try {
|
|
4801
4805
|
for await (const d of u.streamQuery(e, n))
|
|
4802
|
-
yield await
|
|
4806
|
+
yield await w(this, gt, tn).call(this, d, r);
|
|
4803
4807
|
} finally {
|
|
4804
4808
|
o.resolve();
|
|
4805
4809
|
}
|
|
@@ -5897,7 +5901,7 @@ class ut {
|
|
|
5897
5901
|
* ```
|
|
5898
5902
|
*/
|
|
5899
5903
|
at(e) {
|
|
5900
|
-
return
|
|
5904
|
+
return w(this, yt, an).call(this, "ArrayLocation", e);
|
|
5901
5905
|
}
|
|
5902
5906
|
/**
|
|
5903
5907
|
* Access a property of a JSON object.
|
|
@@ -5949,7 +5953,7 @@ class ut {
|
|
|
5949
5953
|
* ```
|
|
5950
5954
|
*/
|
|
5951
5955
|
key(e) {
|
|
5952
|
-
return
|
|
5956
|
+
return w(this, yt, an).call(this, "Member", e);
|
|
5953
5957
|
}
|
|
5954
5958
|
}
|
|
5955
5959
|
V = new WeakMap(), yt = new WeakSet(), an = function(e, n) {
|
|
@@ -6243,14 +6247,14 @@ const ct = class ct {
|
|
|
6243
6247
|
});
|
|
6244
6248
|
}
|
|
6245
6249
|
toOperationNode() {
|
|
6246
|
-
return
|
|
6250
|
+
return w(this, j, on).call(this, w(this, j, Ct).call(this));
|
|
6247
6251
|
}
|
|
6248
6252
|
compile(e) {
|
|
6249
|
-
return
|
|
6253
|
+
return w(this, j, sn).call(this, w(this, j, Ct).call(this, e));
|
|
6250
6254
|
}
|
|
6251
6255
|
async execute(e) {
|
|
6252
|
-
const n =
|
|
6253
|
-
return n.executeQuery(
|
|
6256
|
+
const n = w(this, j, Ct).call(this, e);
|
|
6257
|
+
return n.executeQuery(w(this, j, sn).call(this, n), i(this, P).queryId);
|
|
6254
6258
|
}
|
|
6255
6259
|
};
|
|
6256
6260
|
P = new WeakMap(), j = new WeakSet(), Ct = function(e) {
|
|
@@ -6259,7 +6263,7 @@ P = new WeakMap(), j = new WeakSet(), Ct = function(e) {
|
|
|
6259
6263
|
}, on = function(e) {
|
|
6260
6264
|
return e.transformQuery(i(this, P).rawNode, i(this, P).queryId);
|
|
6261
6265
|
}, sn = function(e) {
|
|
6262
|
-
return e.compileQuery(
|
|
6266
|
+
return e.compileQuery(w(this, j, on).call(this, e), i(this, P).queryId);
|
|
6263
6267
|
};
|
|
6264
6268
|
let At = ct;
|
|
6265
6269
|
function ie(t) {
|
|
@@ -6370,8 +6374,8 @@ class pr {
|
|
|
6370
6374
|
* The returned array is sorted by migration name.
|
|
6371
6375
|
*/
|
|
6372
6376
|
async getMigrations() {
|
|
6373
|
-
const e = await
|
|
6374
|
-
return (await
|
|
6377
|
+
const e = await w(this, m, Re).call(this, i(this, m, Z)) ? await i(this, k).db.withPlugin(i(this, m, ee)).selectFrom(i(this, m, Z)).select(["name", "timestamp"]).execute() : [];
|
|
6378
|
+
return (await w(this, m, cn).call(this)).map(({ name: r, ...a }) => {
|
|
6375
6379
|
const o = e.find((u) => u.name === r);
|
|
6376
6380
|
return {
|
|
6377
6381
|
name: r,
|
|
@@ -6428,7 +6432,7 @@ class pr {
|
|
|
6428
6432
|
* ```
|
|
6429
6433
|
*/
|
|
6430
6434
|
async migrateToLatest() {
|
|
6431
|
-
return
|
|
6435
|
+
return w(this, m, rt).call(this, () => ({ direction: "Up", step: 1 / 0 }));
|
|
6432
6436
|
}
|
|
6433
6437
|
/**
|
|
6434
6438
|
* Migrate up/down to a specific migration.
|
|
@@ -6454,7 +6458,7 @@ class pr {
|
|
|
6454
6458
|
* ```
|
|
6455
6459
|
*/
|
|
6456
6460
|
async migrateTo(e) {
|
|
6457
|
-
return
|
|
6461
|
+
return w(this, m, rt).call(this, ({ migrations: n, executedMigrations: r, pendingMigrations: a }) => {
|
|
6458
6462
|
if (e === Zs)
|
|
6459
6463
|
return { direction: "Down", step: 1 / 0 };
|
|
6460
6464
|
if (!n.find((d) => d.name === e))
|
|
@@ -6485,7 +6489,7 @@ class pr {
|
|
|
6485
6489
|
* ```
|
|
6486
6490
|
*/
|
|
6487
6491
|
async migrateUp() {
|
|
6488
|
-
return
|
|
6492
|
+
return w(this, m, rt).call(this, () => ({ direction: "Up", step: 1 }));
|
|
6489
6493
|
}
|
|
6490
6494
|
/**
|
|
6491
6495
|
* Migrate one step down.
|
|
@@ -6502,12 +6506,12 @@ class pr {
|
|
|
6502
6506
|
* ```
|
|
6503
6507
|
*/
|
|
6504
6508
|
async migrateDown() {
|
|
6505
|
-
return
|
|
6509
|
+
return w(this, m, rt).call(this, () => ({ direction: "Down", step: 1 }));
|
|
6506
6510
|
}
|
|
6507
6511
|
}
|
|
6508
6512
|
k = new WeakMap(), m = new WeakSet(), rt = async function(e) {
|
|
6509
6513
|
try {
|
|
6510
|
-
return await
|
|
6514
|
+
return await w(this, m, yr).call(this), await w(this, m, br).call(this, e);
|
|
6511
6515
|
} catch (n) {
|
|
6512
6516
|
return n instanceof Vt ? n.resultSet : { error: n };
|
|
6513
6517
|
}
|
|
@@ -6522,37 +6526,37 @@ k = new WeakMap(), m = new WeakSet(), rt = async function(e) {
|
|
|
6522
6526
|
}, ee = function() {
|
|
6523
6527
|
return i(this, m, X) ? new dr(i(this, m, X)) : new Ys();
|
|
6524
6528
|
}, yr = async function() {
|
|
6525
|
-
await
|
|
6529
|
+
await w(this, m, wr).call(this), await w(this, m, Nr).call(this), await w(this, m, vr).call(this), await w(this, m, Cr).call(this);
|
|
6526
6530
|
}, wr = async function() {
|
|
6527
|
-
if (i(this, m, X) && !await
|
|
6531
|
+
if (i(this, m, X) && !await w(this, m, un).call(this))
|
|
6528
6532
|
try {
|
|
6529
|
-
await
|
|
6533
|
+
await w(this, m, at).call(this, i(this, k).db.schema.createSchema(i(this, m, X)));
|
|
6530
6534
|
} catch (e) {
|
|
6531
|
-
if (!await
|
|
6535
|
+
if (!await w(this, m, un).call(this))
|
|
6532
6536
|
throw e;
|
|
6533
6537
|
}
|
|
6534
6538
|
}, Nr = async function() {
|
|
6535
|
-
if (!await
|
|
6539
|
+
if (!await w(this, m, Re).call(this, i(this, m, Z)))
|
|
6536
6540
|
try {
|
|
6537
|
-
i(this, m, X) && await
|
|
6541
|
+
i(this, m, X) && await w(this, m, at).call(this, i(this, k).db.schema.createSchema(i(this, m, X))), await w(this, m, at).call(this, i(this, k).db.schema.withPlugin(i(this, m, ee)).createTable(i(this, m, Z)).addColumn("name", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("timestamp", "varchar(255)", (e) => e.notNull()));
|
|
6538
6542
|
} catch (e) {
|
|
6539
|
-
if (!await
|
|
6543
|
+
if (!await w(this, m, Re).call(this, i(this, m, Z)))
|
|
6540
6544
|
throw e;
|
|
6541
6545
|
}
|
|
6542
6546
|
}, vr = async function() {
|
|
6543
|
-
if (!await
|
|
6547
|
+
if (!await w(this, m, Re).call(this, i(this, m, De)))
|
|
6544
6548
|
try {
|
|
6545
|
-
await
|
|
6549
|
+
await w(this, m, at).call(this, i(this, k).db.schema.withPlugin(i(this, m, ee)).createTable(i(this, m, De)).addColumn("id", "varchar(255)", (e) => e.notNull().primaryKey()).addColumn("is_locked", "integer", (e) => e.notNull().defaultTo(0)));
|
|
6546
6550
|
} catch (e) {
|
|
6547
|
-
if (!await
|
|
6551
|
+
if (!await w(this, m, Re).call(this, i(this, m, De)))
|
|
6548
6552
|
throw e;
|
|
6549
6553
|
}
|
|
6550
6554
|
}, Cr = async function() {
|
|
6551
|
-
if (!await
|
|
6555
|
+
if (!await w(this, m, dn).call(this))
|
|
6552
6556
|
try {
|
|
6553
6557
|
await i(this, k).db.withPlugin(i(this, m, ee)).insertInto(i(this, m, De)).values({ id: Qt, is_locked: 0 }).execute();
|
|
6554
6558
|
} catch (e) {
|
|
6555
|
-
if (!await
|
|
6559
|
+
if (!await w(this, m, dn).call(this))
|
|
6556
6560
|
throw e;
|
|
6557
6561
|
}
|
|
6558
6562
|
}, un = async function() {
|
|
@@ -6572,20 +6576,20 @@ k = new WeakMap(), m = new WeakSet(), rt = async function(e) {
|
|
|
6572
6576
|
}), a = async (o) => {
|
|
6573
6577
|
try {
|
|
6574
6578
|
await n.acquireMigrationLock(o, r);
|
|
6575
|
-
const u = await
|
|
6579
|
+
const u = await w(this, m, Or).call(this, o);
|
|
6576
6580
|
if (u.migrations.length === 0)
|
|
6577
6581
|
return { results: [] };
|
|
6578
6582
|
const { direction: d, step: c } = e(u);
|
|
6579
|
-
return c <= 0 ? { results: [] } : d === "Down" ? await
|
|
6583
|
+
return c <= 0 ? { results: [] } : d === "Down" ? await w(this, m, Er).call(this, o, u, c) : d === "Up" ? await w(this, m, Ir).call(this, o, u, c) : { results: [] };
|
|
6580
6584
|
} finally {
|
|
6581
6585
|
await n.releaseMigrationLock(o, r);
|
|
6582
6586
|
}
|
|
6583
6587
|
};
|
|
6584
6588
|
return n.supportsTransactionalDdl ? i(this, k).db.transaction().execute(a) : i(this, k).db.connection().execute(a);
|
|
6585
6589
|
}, Or = async function(e) {
|
|
6586
|
-
const n = await
|
|
6587
|
-
|
|
6588
|
-
const a =
|
|
6590
|
+
const n = await w(this, m, cn).call(this), r = await w(this, m, Sr).call(this, e);
|
|
6591
|
+
w(this, m, xr).call(this, n, r), i(this, m, gr) || w(this, m, kr).call(this, n, r);
|
|
6592
|
+
const a = w(this, m, Tr).call(this, n, r);
|
|
6589
6593
|
return s({
|
|
6590
6594
|
migrations: n,
|
|
6591
6595
|
executedMigrations: r,
|