better-supabase 0.3.0 → 0.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 +9 -6
- package/bin/better-supabase.js +4 -0
- package/dist/{base64-CQeB1eSf.js → base64-D2gsioCY.js} +2 -2
- package/dist/channel-FQW-CnGR.d.ts +70 -0
- package/dist/claims-BAf6c7is.js +48 -0
- package/dist/cli/_format-Cax5EsM9.js +101 -0
- package/dist/cli/bin.d.ts +1 -0
- package/dist/cli/bin.js +48 -0
- package/dist/cli/codemod-DqV7612m.js +388 -0
- package/dist/cli/command-CK14fP91.js +502 -0
- package/dist/cli/compare-BmIWVEui.js +9 -0
- package/dist/cli/config-CPVpXP5I.js +1965 -0
- package/dist/cli/config-dtoekM0v.js +2 -0
- package/dist/cli/db-DOBPt660.js +52 -0
- package/dist/cli/diff-SjkO5rNr.js +752 -0
- package/dist/cli/dist-DBPdlPYK.js +1112 -0
- package/dist/cli/dist-DreZ24Sz.js +129 -0
- package/dist/cli/dist-xn4wlboc.js +732 -0
- package/dist/cli/doctor-L7Z8mYTx.js +2863 -0
- package/dist/cli/env-DmKv_G4A.js +108 -0
- package/dist/cli/env-jIFUADLY.js +511 -0
- package/dist/cli/errors-4v4DTtda.js +56 -0
- package/dist/cli/fastest-levenshtein-CFN-lNDv.js +120 -0
- package/dist/cli/gen-BJc9vdyu.js +2 -0
- package/dist/cli/gen-C2osRcr5.js +2204 -0
- package/dist/cli/index.d.ts +493 -0
- package/dist/cli/index.js +184 -0
- package/dist/cli/init-Saf5-R9T.js +550 -0
- package/dist/cli/introspect--H7oGmcd.js +81 -0
- package/dist/cli/io-k41_z-jT.js +24 -0
- package/dist/cli/json5-ChRycquj.js +787 -0
- package/dist/cli/jsonc-BUniUpOk.js +2 -0
- package/dist/cli/jsonc-D5Fu67jw.js +45 -0
- package/dist/cli/keys-ByKHnvP9.js +83 -0
- package/dist/cli/ohash-D7bG_EOb.js +277 -0
- package/dist/cli/openapi-Cp5Fyta-.js +66 -0
- package/dist/cli/project-B_GeXyHh.js +70 -0
- package/dist/cli/prompts-BNcNfAve.js +1142 -0
- package/dist/cli/prompts-BTYQGunc.js +2 -0
- package/dist/cli/read-sets-BfMQcKy8.js +289 -0
- package/dist/cli/rolldown-runtime-BPOCksWG.js +24 -0
- package/dist/cli/run-BKR2W_79.js +351 -0
- package/dist/cli/seed-CUlqWh-8.js +98 -0
- package/dist/cli/skills-LJJIhLFR.js +137 -0
- package/dist/cli/sql-DzPbfngx.js +348 -0
- package/dist/cli/style-C0NFdJRL.js +29 -0
- package/dist/cli/toml-DB-MNnFs.js +424 -0
- package/dist/cli/version-BDJuO0UR.js +4 -0
- package/dist/cli/yaml-CYCbJ6et.js +2252 -0
- package/dist/client/index.d.ts +2 -2
- package/dist/client/index.js +15 -22
- package/dist/clone-BfgmLU90.js +21 -0
- package/dist/{compiler-2zqGzxVZ.d.ts → compiler-BXH_aZ7N.d.ts} +2 -2
- package/dist/config/index.d.ts +4 -4
- package/dist/config/index.js +5 -5
- package/dist/{config-DOsGYSiT.js → config-DreERlKo.js} +1 -1
- package/dist/{config-C1CYcm6o.d.ts → config-T_ejwyd3.d.ts} +176 -11
- package/dist/{define-DUbydmJa.d.ts → define-Bp_BZa5h.d.ts} +37 -29
- package/dist/{define-DF341GDj.js → define-cNKzqwL_.js} +356 -89
- package/dist/edge/index.d.ts +20 -13
- package/dist/edge/index.js +55 -26
- package/dist/{entitlements-DvJXoI02.d.ts → entitlements-DUxU4oHe.d.ts} +2 -2
- package/dist/env/index.d.ts +2 -2
- package/dist/env/index.js +34 -1
- package/dist/{errors-Bl3rkOzo.js → errors-DtwXa6b8.js} +2 -1
- package/dist/events/index.d.ts +3 -2
- package/dist/events/index.js +69 -16
- package/dist/events-aIO7vsIk.d.ts +230 -0
- package/dist/executor-BunPOO-k.d.ts +402 -0
- package/dist/{executor-B26lgbHD.d.ts → executor-Cghdstwu.d.ts} +1 -2
- package/dist/{executor-C57jx2pn.js → executor-XycESQPH.js} +3 -3
- package/dist/hono/index.d.ts +27 -23
- package/dist/hono/index.js +46 -11
- package/dist/impersonation-VfaGc4Q_.js +41 -0
- package/dist/{index-BNsABq7P.d.ts → index-BGdgBPdf.d.ts} +66 -25
- package/dist/{index-qriRM9cZ.d.ts → index-C7f8cOBM.d.ts} +4 -4
- package/dist/{index-Dy6kuF0P.d.ts → index-CLg87OBW.d.ts} +6 -1
- package/dist/{index-GV77NpRP.d.ts → index-DOESKG27.d.ts} +34 -9
- package/dist/{index-CriFFJ_p.d.ts → index-DgILJRXj.d.ts} +43 -17
- package/dist/{index-UJ-LUxtI.d.ts → index-DmXSxbLi.d.ts} +14 -14
- package/dist/{index-Cf-D2jk1.d.ts → index-Dxn2a5cw.d.ts} +2 -2
- package/dist/{index-CTTMS6_1.d.ts → index-SaTsEfGP.d.ts} +86 -9
- package/dist/{index-CADlNHK-.d.ts → index-fag8VJZ2.d.ts} +5 -6
- package/dist/index.d.ts +34 -17
- package/dist/index.js +15 -14
- package/dist/jobs/index.d.ts +147 -95
- package/dist/jobs/index.js +773 -250
- package/dist/{json-schema--aOXAGfU.js → json-schema-m1fiwKgN.js} +23 -2
- package/dist/kit-events-CTFDfSwb.js +60 -0
- package/dist/kit-transport-B82k1djG.d.ts +33 -0
- package/dist/kit-transport-DJlHQUBU.js +55 -0
- package/dist/{config-Be4GwsqI.js → kits-CGLLrNPd.js} +38 -10
- package/dist/list/index.d.ts +1 -1
- package/dist/list/index.js +3 -3
- package/dist/{live-D8rV1Ldw.js → live-CdJBOc4f.js} +13 -9
- package/dist/{live-QE3UPbGm.d.ts → live-D9W2M5aO.d.ts} +16 -15
- package/dist/lookup-BaP5bI27.js +18 -0
- package/dist/mcp/index.d.ts +39 -22
- package/dist/mcp/index.js +39 -25
- package/dist/{mfa-x3V3vGh-.d.ts → mfa-CusDgPaD.d.ts} +5 -1
- package/dist/next/image/index.js +6 -3
- package/dist/next/index.d.ts +60 -36
- package/dist/next/index.js +167 -50
- package/dist/notifications/index.d.ts +162 -0
- package/dist/notifications/index.js +264 -0
- package/dist/openapi/index.d.ts +1 -1
- package/dist/openapi/index.js +6 -6
- package/dist/orgs/index.d.ts +132 -0
- package/dist/orgs/index.js +245 -0
- package/dist/orpc/index.d.ts +37 -20
- package/dist/orpc/index.js +24 -11
- package/dist/otel/index.d.ts +24 -5
- package/dist/otel/index.js +124 -64
- package/dist/permdock-sql-C2Inc6Xc.d.ts +29 -0
- package/dist/permdock-sql-DgOfeixi.js +51 -0
- package/dist/plugin-DwARMuQp.js +59 -0
- package/dist/{plugin-DVRB8qNE.d.ts → plugin-o144f322.d.ts} +17 -5
- package/dist/plugins/actor/index.d.ts +5 -2
- package/dist/plugins/actor/index.js +22 -8
- package/dist/plugins/rules/index.d.ts +2 -2
- package/dist/plugins/rules/index.js +52 -17
- package/dist/plugins/soft-delete/index.d.ts +3 -3
- package/dist/plugins/soft-delete/index.js +14 -5
- package/dist/plugins/tenant/index.d.ts +3 -3
- package/dist/plugins/tenant/index.js +45 -21
- package/dist/plugins/timestamps/index.d.ts +1 -1
- package/dist/plugins/timestamps/index.js +4 -3
- package/dist/plugins/validation/index.d.ts +2 -2
- package/dist/plugins/validation/index.js +26 -6
- package/dist/{pool-B9qsLyFR.d.ts → pool-C9voM4Kw.d.ts} +24 -6
- package/dist/postgres/index.d.ts +5 -5
- package/dist/postgres/index.js +20 -10
- package/dist/{postgrest-DmBlevh-.d.ts → postgrest-CruYKAvV.d.ts} +1 -1
- package/dist/{problem-CGt1ADix.js → problem-BW1KhzSG.js} +2 -1
- package/dist/{problem-Z2RTQjZD.d.ts → problem-Blxe8S31.d.ts} +1 -1
- package/dist/query/index.d.ts +2 -2
- package/dist/query/index.js +3 -3
- package/dist/{query-BdKLTPlj.js → query-CCbo44lG.js} +18 -18
- package/dist/queue-BYUCjr59.d.ts +252 -0
- package/dist/react/index.d.ts +8 -7
- package/dist/react/index.js +4 -3
- package/dist/react/server.d.ts +16 -5
- package/dist/react/server.js +12 -4
- package/dist/react/session.d.ts +10 -4
- package/dist/react/session.js +11 -3
- package/dist/{react-DNBYNazu.js → react-C_s7kiNz.js} +138 -46
- package/dist/{read-set-D0qBcboM.js → read-set-DQFt1N_Y.js} +71 -15
- package/dist/realtime/index.d.ts +3 -3
- package/dist/realtime/index.js +14 -12
- package/dist/{index-kpgopLNv.d.ts → refresh-BTrQ_ZTp.d.ts} +6 -3
- package/dist/{resolve-BRciX2jK.d.ts → resolve-C15TJq77.d.ts} +22 -11
- package/dist/{resource-D30rp0GN.js → resource-CRxxwkQq.js} +24 -9
- package/dist/{resource-CwVgiI5q.d.ts → resource-D8iqWMr-.d.ts} +6 -6
- package/dist/respond-D2OQl62-.d.ts +371 -0
- package/dist/{result-DWXatkd6.js → result-BKiliPY7.js} +2 -2
- package/dist/server/index.d.ts +17 -15
- package/dist/server/index.js +16 -22
- package/dist/server-Csx2sRjg.js +655 -0
- package/dist/{shared-_6-uPL7E.js → shared-D1dRUrAg.js} +19 -4
- package/dist/signers-Cc6r98SW.d.ts +162 -0
- package/dist/{simplify-LakqK1vH.js → simplify-_0oUKqCd.js} +27 -95
- package/dist/sql/index.d.ts +247 -10
- package/dist/sql/index.js +8591 -780
- package/dist/{sql-BIgk12ew.js → sql-Coh6n4cC.js} +11 -3
- package/dist/ssr/index.d.ts +4 -4
- package/dist/ssr/index.js +1 -2
- package/dist/{standard-FUi3Z3-7.js → standard-D7r6dMUu.js} +6 -3
- package/dist/{standard-eudBiRk1.d.ts → standard-J4YgMOLm.d.ts} +1 -1
- package/dist/{stats-D78UQ8Yu.js → stats-Bqob3WqT.js} +34 -9
- package/dist/storage/index.d.ts +4 -4
- package/dist/storage/index.js +174 -27
- package/dist/support-DT-OhSxD.d.ts +88 -0
- package/dist/support-Dk6vdmEw.js +291 -0
- package/dist/support-view-Da5peKFg.d.ts +17 -0
- package/dist/support-view-g4YLBeqX.js +18 -0
- package/dist/{tables-Dhha3BXM.js → tables-Cb-3_VWc.js} +14 -0
- package/dist/{permdock-sql-Bta_G0v-.js → template-TxrGI5jR.js} +2 -31
- package/dist/{temporal-BwshQk0W.js → temporal-CVlIV2DZ.js} +17 -4
- package/dist/{temporal-required-CMxeSVPo.js → temporal-required-CAt4Dc9Z.js} +2 -2
- package/dist/testing/index.d.ts +113 -24
- package/dist/testing/index.js +375 -47
- package/dist/{types-DONv9SHN.d.ts → types-Dnf_wRDz.d.ts} +26 -3
- package/dist/user-change-CHFEUro1.js +49 -0
- package/dist/{webhooks-CAIFQSTM.js → verify-Ce49ETPz.js} +38 -19
- package/dist/{version-BfpG2gks.js → version-DM_Roffb.js} +1 -1
- package/dist/{view-3Po_PVlr.d.ts → view-BEf0diC5.d.ts} +10 -5
- package/dist/{mfa-BxoR1RkN.js → view-Bq64ki8-.js} +210 -64
- package/dist/webhooks/index.d.ts +136 -5
- package/dist/webhooks/index.js +588 -2
- package/dist/wire-D2dT86vi.js +35 -0
- package/package.json +50 -10
- package/schemas/config-v1.json +131 -1
- package/schemas/doctor-report-v1.json +10 -0
- package/skills/better-supabase/SKILL.md +60 -10
- package/skills/better-supabase/references/plugins.md +13 -14
- package/skills/better-supabase/references/troubleshooting.md +25 -4
- package/skills/better-supabase-api/SKILL.md +74 -19
- package/skills/better-supabase-api/references/adapters.md +48 -27
- package/skills/better-supabase-auth/SKILL.md +149 -0
- package/skills/better-supabase-auth/references/permdock.md +100 -0
- package/skills/better-supabase-testing/SKILL.md +58 -4
- package/dist/claims-CoTobNC-.js +0 -25
- package/dist/events-Do8jXh4D.d.ts +0 -84
- package/dist/executor-DynmIWhq.d.ts +0 -195
- package/dist/invalidate-DbxuL2jL.js +0 -18
- package/dist/permdock-sql-DImJULY-.d.ts +0 -17
- package/dist/plugin-BqR6wKMB.js +0 -23
- package/dist/respond-C44EZAJo.js +0 -399
- package/dist/respond-DAkPIdTH.d.ts +0 -175
- package/dist/result-c2OYgCV2.d.ts +0 -203
- package/dist/view-wZ-9qIUz.js +0 -45
|
@@ -0,0 +1,424 @@
|
|
|
1
|
+
import { n as o$1, t as i$1 } from "./_format-Cax5EsM9.js";
|
|
2
|
+
//#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/_chunks/libs/smol-toml.mjs
|
|
3
|
+
let e = /^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;
|
|
4
|
+
var t = class t extends Date {
|
|
5
|
+
#e = !1;
|
|
6
|
+
#t = !1;
|
|
7
|
+
#n = null;
|
|
8
|
+
constructor(t) {
|
|
9
|
+
let n = !0, r = !0, i = `Z`;
|
|
10
|
+
if (typeof t == `string`) {
|
|
11
|
+
let a = t.match(e);
|
|
12
|
+
a ? (a[1] || (n = !1, t = `0000-01-01T${t}`), r = !!a[2], r && t[10] === ` ` && (t = t.replace(` `, `T`)), a[2] && +a[2] > 23 ? t = `` : (i = a[3] || null, t = t.toUpperCase(), !i && r && (t += `Z`))) : t = ``;
|
|
13
|
+
}
|
|
14
|
+
super(t), isNaN(this.getTime()) || (this.#e = n, this.#t = r, this.#n = i);
|
|
15
|
+
}
|
|
16
|
+
isDateTime() {
|
|
17
|
+
return this.#e && this.#t;
|
|
18
|
+
}
|
|
19
|
+
isLocal() {
|
|
20
|
+
return !this.#e || !this.#t || !this.#n;
|
|
21
|
+
}
|
|
22
|
+
isDate() {
|
|
23
|
+
return this.#e && !this.#t;
|
|
24
|
+
}
|
|
25
|
+
isTime() {
|
|
26
|
+
return this.#t && !this.#e;
|
|
27
|
+
}
|
|
28
|
+
isValid() {
|
|
29
|
+
return this.#e || this.#t;
|
|
30
|
+
}
|
|
31
|
+
toISOString() {
|
|
32
|
+
let e = super.toISOString();
|
|
33
|
+
if (this.isDate()) return e.slice(0, 10);
|
|
34
|
+
if (this.isTime()) return e.slice(11, 23);
|
|
35
|
+
if (this.#n === null) return e.slice(0, -1);
|
|
36
|
+
if (this.#n === `Z`) return e;
|
|
37
|
+
let t = this.#n.slice(1, 3) * 60 + +this.#n.slice(4, 6);
|
|
38
|
+
return t = this.#n[0] === `-` ? t : -t, (/* @__PURE__ */ new Date(this.getTime() - t * 6e4)).toISOString().slice(0, -1) + this.#n;
|
|
39
|
+
}
|
|
40
|
+
static wrapAsOffsetDateTime(e, n = `Z`) {
|
|
41
|
+
let r = new t(e);
|
|
42
|
+
return r.#n = n, r;
|
|
43
|
+
}
|
|
44
|
+
static wrapAsLocalDateTime(e) {
|
|
45
|
+
let n = new t(e);
|
|
46
|
+
return n.#n = null, n;
|
|
47
|
+
}
|
|
48
|
+
static wrapAsLocalDate(e) {
|
|
49
|
+
let n = new t(e);
|
|
50
|
+
return n.#t = !1, n.#n = null, n;
|
|
51
|
+
}
|
|
52
|
+
static wrapAsLocalTime(e) {
|
|
53
|
+
let n = new t(e);
|
|
54
|
+
return n.#e = !1, n.#n = null, n;
|
|
55
|
+
}
|
|
56
|
+
};
|
|
57
|
+
function n(e, t) {
|
|
58
|
+
let n = e.slice(0, t).split(/\r\n|\n|\r/g);
|
|
59
|
+
return [n.length, n.pop().length + 1];
|
|
60
|
+
}
|
|
61
|
+
function r(e, t, n) {
|
|
62
|
+
let r = e.split(/\r\n|\n|\r/g), i = ``, a = (Math.log10(t + 1) | 0) + 1;
|
|
63
|
+
for (let e = t - 1; e <= t + 1; e++) {
|
|
64
|
+
let o = r[e - 1];
|
|
65
|
+
o && (i += e.toString().padEnd(a, ` `), i += `: `, i += o, i += `
|
|
66
|
+
`, e === t && (i += ` `.repeat(a + n + 2), i += `^
|
|
67
|
+
`));
|
|
68
|
+
}
|
|
69
|
+
return i;
|
|
70
|
+
}
|
|
71
|
+
var i = class extends Error {
|
|
72
|
+
line;
|
|
73
|
+
column;
|
|
74
|
+
codeblock;
|
|
75
|
+
constructor(e, t) {
|
|
76
|
+
let [i, a] = n(t.toml, t.ptr), o = r(t.toml, i, a);
|
|
77
|
+
super(`Invalid TOML document: ${e}\n\n${o}`, t), this.line = i, this.column = a, this.codeblock = o;
|
|
78
|
+
}
|
|
79
|
+
};
|
|
80
|
+
function a$1(e, t = 0) {
|
|
81
|
+
let n = e.indexOf(`
|
|
82
|
+
`, t);
|
|
83
|
+
return e.charCodeAt(n - 1) === 13 && n--, n;
|
|
84
|
+
}
|
|
85
|
+
function o(e) {
|
|
86
|
+
for (; e.p < e.s.length; e.p++) {
|
|
87
|
+
let t = e.s.charCodeAt(e.p);
|
|
88
|
+
if (t === 10) break;
|
|
89
|
+
if (t === 13 && e.s.charCodeAt(e.p + 1) === 10) {
|
|
90
|
+
e.p++;
|
|
91
|
+
break;
|
|
92
|
+
}
|
|
93
|
+
if (t < 32 && t !== 9 || t === 127) throw new i(`control characters are not allowed in comments`, {
|
|
94
|
+
toml: e.s,
|
|
95
|
+
ptr: e.p
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
}
|
|
99
|
+
function s(e, t, n) {
|
|
100
|
+
let r;
|
|
101
|
+
for (;;) {
|
|
102
|
+
for (; (r = e.s.charCodeAt(e.p)) === 32 || r === 9 || !t && (r === 10 || r === 13 && e.s.charCodeAt(e.p + 1) === 10);) e.p++;
|
|
103
|
+
if (n || r !== 35) break;
|
|
104
|
+
o(e);
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
function c(e, t, n) {
|
|
108
|
+
let r = e.p;
|
|
109
|
+
if (!n) {
|
|
110
|
+
r = a$1(e.s, r), e.p = r < 0 ? e.s.length : r;
|
|
111
|
+
return;
|
|
112
|
+
}
|
|
113
|
+
for (; e.p < e.s.length; e.p++) {
|
|
114
|
+
let r = e.s.charCodeAt(e.p);
|
|
115
|
+
if (r === 35) o(e);
|
|
116
|
+
else if (r === n || r === t) return;
|
|
117
|
+
}
|
|
118
|
+
throw new i(`cannot find end of structure`, {
|
|
119
|
+
toml: e.s,
|
|
120
|
+
ptr: r
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
let l = /^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/;
|
|
124
|
+
let u = /^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/;
|
|
125
|
+
let d = /^[+-]?0[0-9_]/;
|
|
126
|
+
function f(e) {
|
|
127
|
+
let t = e.p, n = e.s.charCodeAt(e.p++), r = n, a = n === 39, o = n === e.s.charCodeAt(e.p) && n === e.s.charCodeAt(e.p + 1);
|
|
128
|
+
o && ((n = e.s.charCodeAt(e.p += 2)) === 10 ? e.p++ : n === 13 && e.s.charCodeAt(e.p + 1) === 10 && (e.p += 2));
|
|
129
|
+
let s = ``, c = e.p, l = 0;
|
|
130
|
+
for (; e.p < e.s.length; e.p++) if (n = e.s.charCodeAt(e.p), o && (n === 10 || n === 13 && e.s.charCodeAt(e.p + 1) === 10)) l &&= 3;
|
|
131
|
+
else if (n < 32 && n !== 9 || n === 127) throw new i(`control characters are not allowed in strings`, {
|
|
132
|
+
toml: e.s,
|
|
133
|
+
ptr: e.p
|
|
134
|
+
});
|
|
135
|
+
else if ((!l || l === 3) && n === r && (!o || e.s.charCodeAt(e.p + 1) === r && e.s.charCodeAt(e.p + 2) === r)) return o && (e.s.charCodeAt(e.p + 3) === r && e.p++, e.s.charCodeAt(e.p + 3) === r && e.p++), l || (s += e.s.slice(c, e.p)), e.p += o ? 3 : 1, s;
|
|
136
|
+
else if (!l) !a && n === 92 && (s += e.s.slice(c, c = e.p), l = 1);
|
|
137
|
+
else if (l === 1) {
|
|
138
|
+
if (n === 120 || n === 117 || n === 85) {
|
|
139
|
+
let t = 0, r = n === 120 ? 2 : n === 117 ? 4 : 8;
|
|
140
|
+
for (let n = 0; n < r; n++, e.p++) {
|
|
141
|
+
let n = e.s.charCodeAt(e.p + 1), r = n >= 48 && n <= 57 ? n - 48 : n >= 65 && n <= 70 ? n - 65 + 10 : n >= 97 && n <= 102 ? n - 97 + 10 : -1;
|
|
142
|
+
if (r < 0) throw new i(`invalid non-hex character in unicode escape`, {
|
|
143
|
+
toml: e.s,
|
|
144
|
+
ptr: e.p + 1
|
|
145
|
+
});
|
|
146
|
+
t = t << 4 | r;
|
|
147
|
+
}
|
|
148
|
+
if (t < 0 || t > 1114111 || t >= 55296 && t <= 57343) throw new i(`invalid unicode escape`, {
|
|
149
|
+
toml: e.s,
|
|
150
|
+
ptr: e.p
|
|
151
|
+
});
|
|
152
|
+
s += String.fromCodePoint(t), c = e.p + 1, l = 0;
|
|
153
|
+
} else if (n === 32 || n === 9) l = 2;
|
|
154
|
+
else {
|
|
155
|
+
if (n === 98) s += `\b`;
|
|
156
|
+
else if (n === 116) s += ` `;
|
|
157
|
+
else if (n === 110) s += `
|
|
158
|
+
`;
|
|
159
|
+
else if (n === 102) s += `\f`;
|
|
160
|
+
else if (n === 114) s += `\r`;
|
|
161
|
+
else if (n === 101) s += `\x1B`;
|
|
162
|
+
else if (n === 34) s += `"`;
|
|
163
|
+
else if (n === 92) s += `\\`;
|
|
164
|
+
else throw new i(`unrecognized escape sequence`, {
|
|
165
|
+
toml: e.s,
|
|
166
|
+
ptr: e.p
|
|
167
|
+
});
|
|
168
|
+
c = e.p + 1, l = 0;
|
|
169
|
+
}
|
|
170
|
+
} else if (n !== 32 && n !== 9) {
|
|
171
|
+
if (l === 2) throw new i(`invalid escape: only line-ending whitespace may be escaped`, {
|
|
172
|
+
toml: e.s,
|
|
173
|
+
ptr: c
|
|
174
|
+
});
|
|
175
|
+
l = +(!a && n === 92), c = e.p;
|
|
176
|
+
}
|
|
177
|
+
throw new i(`unfinished string`, {
|
|
178
|
+
toml: e.s,
|
|
179
|
+
ptr: t
|
|
180
|
+
});
|
|
181
|
+
}
|
|
182
|
+
function p(e, t, n) {
|
|
183
|
+
let r = e.s.slice(t, n), i = r.indexOf(`#`);
|
|
184
|
+
return i > 0 && (o({
|
|
185
|
+
s: r,
|
|
186
|
+
p: i,
|
|
187
|
+
d: 0
|
|
188
|
+
}), r = r.slice(0, i)), r.trimEnd();
|
|
189
|
+
}
|
|
190
|
+
function m(e, n, r) {
|
|
191
|
+
let a = e.p, o = {
|
|
192
|
+
toml: e.s,
|
|
193
|
+
ptr: a
|
|
194
|
+
};
|
|
195
|
+
c(e, 44, r);
|
|
196
|
+
let s = p(e, a, e.p);
|
|
197
|
+
if (!s) throw new i(`incomplete declaration: value expected`, o);
|
|
198
|
+
if (s === `-inf`) return -1 / 0;
|
|
199
|
+
if (s === `inf` || s === `+inf`) return 1 / 0;
|
|
200
|
+
if (s === `nan` || s === `+nan` || s === `-nan`) return NaN;
|
|
201
|
+
if (s === `-0`) return n ? 0n : 0;
|
|
202
|
+
let f = l.test(s);
|
|
203
|
+
if (f || u.test(s)) {
|
|
204
|
+
if (d.test(s)) throw new i(`leading zeroes are not allowed`, o);
|
|
205
|
+
s = s.replace(/_/g, ``);
|
|
206
|
+
let e = +s;
|
|
207
|
+
if (isNaN(e)) throw new i(`invalid number`, o);
|
|
208
|
+
if (f) {
|
|
209
|
+
if ((f = !Number.isSafeInteger(e)) && !n) throw new i(`integer value cannot be represented losslessly`, o);
|
|
210
|
+
(f || n === !0) && (e = BigInt(s));
|
|
211
|
+
}
|
|
212
|
+
return e;
|
|
213
|
+
}
|
|
214
|
+
let m = new t(s);
|
|
215
|
+
if (!m.isValid()) throw new i(`invalid value`, o);
|
|
216
|
+
return m;
|
|
217
|
+
}
|
|
218
|
+
function h(e, t, n) {
|
|
219
|
+
let r = e.p, a = e.s.charCodeAt(r);
|
|
220
|
+
if (a === 91 || a === 123) {
|
|
221
|
+
if (!e.d--) throw new i(`document contains excessively nested structures. aborting.`, {
|
|
222
|
+
toml: e.s,
|
|
223
|
+
ptr: r
|
|
224
|
+
});
|
|
225
|
+
let t = a === 91 ? y(e, n) : v(e, n);
|
|
226
|
+
return e.d++, t;
|
|
227
|
+
}
|
|
228
|
+
if (a === 34 || a === 39) return f(e);
|
|
229
|
+
if (a === 116) {
|
|
230
|
+
if (e.s.charCodeAt(++e.p) !== 114 || e.s.charCodeAt(++e.p) !== 117 || e.s.charCodeAt(++e.p) !== 101) throw new i(`invalid value`, {
|
|
231
|
+
toml: e.s,
|
|
232
|
+
ptr: r
|
|
233
|
+
});
|
|
234
|
+
return e.p++, !0;
|
|
235
|
+
}
|
|
236
|
+
if (a === 102) {
|
|
237
|
+
if (e.s.charCodeAt(++e.p) !== 97 || e.s.charCodeAt(++e.p) !== 108 || e.s.charCodeAt(++e.p) !== 115 || e.s.charCodeAt(++e.p) !== 101) throw new i(`invalid value`, {
|
|
238
|
+
toml: e.s,
|
|
239
|
+
ptr: r
|
|
240
|
+
});
|
|
241
|
+
return e.p++, !1;
|
|
242
|
+
}
|
|
243
|
+
return m(e, n, t);
|
|
244
|
+
}
|
|
245
|
+
let g = /^[a-zA-Z0-9-_]+[ \t]*$/;
|
|
246
|
+
function _(e, t = `=`) {
|
|
247
|
+
let n = e.p, r = n - 1, o = [], c = e.s.indexOf(t, n);
|
|
248
|
+
if (c < 0) throw new i(`incomplete key-value: cannot find end of key`, {
|
|
249
|
+
toml: e.s,
|
|
250
|
+
ptr: n
|
|
251
|
+
});
|
|
252
|
+
do {
|
|
253
|
+
let s = e.s.charCodeAt(e.p = ++r);
|
|
254
|
+
if (s !== 32 && s !== 9) {
|
|
255
|
+
if (s === 34 || s === 39) {
|
|
256
|
+
if (s === e.s.charCodeAt(e.p + 1) && s === e.s.charCodeAt(e.p + 2)) throw new i(`multiline strings are not allowed in keys`, {
|
|
257
|
+
toml: e.s,
|
|
258
|
+
ptr: e.p
|
|
259
|
+
});
|
|
260
|
+
let l = f(e);
|
|
261
|
+
r = e.s.indexOf(`.`, e.p);
|
|
262
|
+
let u = e.s.slice(e.p, r < 0 || r > c ? c : r), d = a$1(u);
|
|
263
|
+
if (d > -1) throw new i(`newlines are not allowed in keys`, {
|
|
264
|
+
toml: e.s,
|
|
265
|
+
ptr: d
|
|
266
|
+
});
|
|
267
|
+
if (u.trimStart()) throw new i(`found extra tokens after the string part`, {
|
|
268
|
+
toml: e.s,
|
|
269
|
+
ptr: e.p
|
|
270
|
+
});
|
|
271
|
+
if (c < e.p && (c = e.s.indexOf(t, e.p), c < 0)) throw new i(`incomplete key-value: cannot find end of key`, {
|
|
272
|
+
toml: e.s,
|
|
273
|
+
ptr: n
|
|
274
|
+
});
|
|
275
|
+
o.push(l);
|
|
276
|
+
} else {
|
|
277
|
+
r = e.s.indexOf(`.`, e.p);
|
|
278
|
+
let t = e.s.slice(e.p, r < 0 || r > c ? c : r);
|
|
279
|
+
if (!g.test(t)) throw new i(`only letter, numbers, dashes and underscores are allowed in keys`, {
|
|
280
|
+
toml: e.s,
|
|
281
|
+
ptr: e.p
|
|
282
|
+
});
|
|
283
|
+
o.push(t.trimEnd());
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
} while (r + 1 && r < c);
|
|
287
|
+
return e.p = c + 1, s(e, !0, !0), o;
|
|
288
|
+
}
|
|
289
|
+
function v(e, t) {
|
|
290
|
+
let n = {}, r = /* @__PURE__ */ new Set(), a;
|
|
291
|
+
for (e.p++; e.p < e.s.length;) {
|
|
292
|
+
if (s(e), (a = e.s.charCodeAt(e.p)) === 125) return e.p++, n;
|
|
293
|
+
let o, c = n, l = !1, u = e.p, d = _(e);
|
|
294
|
+
for (let t = 0; t < d.length; t++) {
|
|
295
|
+
if (t && (c = l ? c[o] : c[o] = {}), o = d[t], (l = Object.hasOwn(c, o)) && (typeof c[o] != `object` || r.has(c[o]))) throw new i(`trying to redefine an already defined value`, {
|
|
296
|
+
toml: e.s,
|
|
297
|
+
ptr: u
|
|
298
|
+
});
|
|
299
|
+
!l && o === `__proto__` && Object.defineProperty(c, o, {
|
|
300
|
+
enumerable: !0,
|
|
301
|
+
configurable: !0,
|
|
302
|
+
writable: !0
|
|
303
|
+
});
|
|
304
|
+
}
|
|
305
|
+
if (l) throw new i(`trying to redefine an already defined value`, {
|
|
306
|
+
toml: e.s,
|
|
307
|
+
ptr: e.p
|
|
308
|
+
});
|
|
309
|
+
let f = h(e, 125, t);
|
|
310
|
+
if (r.add(c[o] = f), s(e), (a = e.s.charCodeAt(e.p++)) === 125) return n;
|
|
311
|
+
if (a !== 44) throw new i(`expected comma or end of structure`, {
|
|
312
|
+
toml: e.s,
|
|
313
|
+
ptr: e.p - 1
|
|
314
|
+
});
|
|
315
|
+
}
|
|
316
|
+
throw new i(`unfinished table encountered`, {
|
|
317
|
+
toml: e.s,
|
|
318
|
+
ptr: e.p
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
function y(e, t) {
|
|
322
|
+
let n = [], r;
|
|
323
|
+
for (e.p++; e.p < e.s.length;) {
|
|
324
|
+
if (s(e), (r = e.s.charCodeAt(e.p)) === 93) return e.p++, n;
|
|
325
|
+
if (n.push(h(e, 93, t)), s(e), (r = e.s.charCodeAt(e.p++)) === 93) return n;
|
|
326
|
+
if (r !== 44) throw new i(`expected comma or end of structure`, {
|
|
327
|
+
toml: e.s,
|
|
328
|
+
ptr: e.p - 1
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
throw new i(`unfinished array encountered`, {
|
|
332
|
+
toml: e.s,
|
|
333
|
+
ptr: e.p
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
function b(e, t, n, r) {
|
|
337
|
+
let i = t, a = n, o, s = !1, c;
|
|
338
|
+
for (let t = 0; t < e.length; t++) {
|
|
339
|
+
if (t) {
|
|
340
|
+
if (i = s ? i[o] : i[o] = {}, a = (c = a[o]).c, r === 0 && (c.t === 1 || c.t === 2)) return null;
|
|
341
|
+
if (c.t === 2) {
|
|
342
|
+
let e = i.length - 1;
|
|
343
|
+
i = i[e], a = a[e].c;
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
if (o = e[t], (s = Object.hasOwn(i, o)) && a[o]?.t === 0 && a[o]?.d) return null;
|
|
347
|
+
s || (o === `__proto__` && (Object.defineProperty(i, o, {
|
|
348
|
+
enumerable: !0,
|
|
349
|
+
configurable: !0,
|
|
350
|
+
writable: !0
|
|
351
|
+
}), Object.defineProperty(a, o, {
|
|
352
|
+
enumerable: !0,
|
|
353
|
+
configurable: !0,
|
|
354
|
+
writable: !0
|
|
355
|
+
})), a[o] = {
|
|
356
|
+
t: t < e.length - 1 && r === 2 ? 3 : r,
|
|
357
|
+
d: !1,
|
|
358
|
+
i: 0,
|
|
359
|
+
c: {}
|
|
360
|
+
});
|
|
361
|
+
}
|
|
362
|
+
if (c = a[o], c.t !== r && (r !== 1 || c.t !== 3) || (r === 2 && (c.d || (c.d = !0, i[o] = []), i[o].push(i = {}), c.c[c.i++] = c = {
|
|
363
|
+
t: 1,
|
|
364
|
+
d: !1,
|
|
365
|
+
i: 0,
|
|
366
|
+
c: {}
|
|
367
|
+
}), c.d)) return null;
|
|
368
|
+
if (c.d = !0, r === 1) i = s ? i[o] : i[o] = {};
|
|
369
|
+
else if (r === 0 && s) return null;
|
|
370
|
+
return [
|
|
371
|
+
o,
|
|
372
|
+
i,
|
|
373
|
+
c.c
|
|
374
|
+
];
|
|
375
|
+
}
|
|
376
|
+
function x(e, { maxDepth: t = 1e3, integersAsBigInt: n } = {}) {
|
|
377
|
+
let r = {
|
|
378
|
+
s: e,
|
|
379
|
+
p: 0,
|
|
380
|
+
d: t
|
|
381
|
+
}, a = {}, o = {}, c, l = a, u = o;
|
|
382
|
+
for (s(r); r.p < e.length;) {
|
|
383
|
+
if (e.charCodeAt(r.p) === 91) {
|
|
384
|
+
let t = e.charCodeAt(++r.p) === 91;
|
|
385
|
+
c = r.p += +t;
|
|
386
|
+
let n = _(r, `]`);
|
|
387
|
+
if (t) {
|
|
388
|
+
if (e.charCodeAt(r.p - 1) !== 93) throw new i(`expected end of table declaration`, {
|
|
389
|
+
toml: e,
|
|
390
|
+
ptr: r.p - 1
|
|
391
|
+
});
|
|
392
|
+
r.p++;
|
|
393
|
+
}
|
|
394
|
+
let s = b(n, a, o, t ? 2 : 1);
|
|
395
|
+
if (!s) throw new i(`trying to redefine an already defined table or value`, {
|
|
396
|
+
toml: e,
|
|
397
|
+
ptr: c
|
|
398
|
+
});
|
|
399
|
+
u = s[2], l = s[1];
|
|
400
|
+
} else {
|
|
401
|
+
c = r.p;
|
|
402
|
+
let t = b(_(r), l, u, 0);
|
|
403
|
+
if (!t) throw new i(`trying to redefine an already defined table or value`, {
|
|
404
|
+
toml: e,
|
|
405
|
+
ptr: c
|
|
406
|
+
});
|
|
407
|
+
t[1][t[0]] = h(r, void 0, n);
|
|
408
|
+
}
|
|
409
|
+
if (s(r, !0), r.p < e.length && (c = e.charCodeAt(r.p)) !== 10 && c !== 13) throw new i(`each key-value declaration must be followed by an end-of-line`, {
|
|
410
|
+
toml: e,
|
|
411
|
+
ptr: r.p
|
|
412
|
+
});
|
|
413
|
+
s(r);
|
|
414
|
+
}
|
|
415
|
+
return a;
|
|
416
|
+
}
|
|
417
|
+
//#endregion
|
|
418
|
+
//#region ../../node_modules/.pnpm/confbox@0.3.1/node_modules/confbox/dist/toml.mjs
|
|
419
|
+
function a(e) {
|
|
420
|
+
let i = x(i$1(e));
|
|
421
|
+
return o$1(e, i, { preserveIndentation: !1 }), i;
|
|
422
|
+
}
|
|
423
|
+
//#endregion
|
|
424
|
+
export { a as parseTOML };
|