better-supabase 0.1.0 → 0.2.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.
Files changed (115) hide show
  1. package/bin/better-supabase.js +2 -1
  2. package/dist/claims-CoTobNC-.js +25 -0
  3. package/dist/cli/bin.js +1 -1
  4. package/dist/cli/index.d.ts +2 -2
  5. package/dist/cli/index.js +1 -1
  6. package/dist/{cli-CoByWYja.js → cli-DrSgDOQC.js} +333 -159
  7. package/dist/client/index.d.ts +1 -1
  8. package/dist/{compiler-DL18ukPe.d.ts → compiler-CZ9nIuqy.d.ts} +2 -2
  9. package/dist/config/index.d.ts +3 -3
  10. package/dist/config/index.js +2 -2
  11. package/dist/{config-D-aR2ZoN.js → config-ClDXmVtY.js} +11 -10
  12. package/dist/{define-QGkq04oe.js → define-BXMYD9AY.js} +65 -62
  13. package/dist/{define-CTfWw-SS.d.ts → define-e3zI4_4g.d.ts} +27 -10
  14. package/dist/edge/index.d.ts +4 -4
  15. package/dist/edge/index.js +3 -3
  16. package/dist/entitlements-CTEBm7IB.js +20 -0
  17. package/dist/entitlements-Dng-ctuT.d.ts +42 -0
  18. package/dist/events/index.d.ts +1 -1
  19. package/dist/{events-2OJsVG_d.d.ts → events-DOt3nSO-.d.ts} +2 -2
  20. package/dist/{executor-Bje4suQF.d.ts → executor-BYXQ9AGn.d.ts} +1 -1
  21. package/dist/{executor-Bazhgsgq.d.ts → executor-CGdNQ27g.d.ts} +1 -1
  22. package/dist/{executor-Ceq60hPM.js → executor-DeppvirK.js} +1 -1
  23. package/dist/guards-BnzDvFrz.js +10 -0
  24. package/dist/hono/index.d.ts +5 -5
  25. package/dist/hono/index.js +3 -3
  26. package/dist/{index-JXHBuS53.d.ts → index-Bw1bwtC0.d.ts} +3 -3
  27. package/dist/{index-Hf8PP9sP.d.ts → index-CBDufH1M.d.ts} +15 -11
  28. package/dist/{index-cEeweTeM.d.ts → index-CG69s15v.d.ts} +3 -3
  29. package/dist/{index-DQVvHzjW.d.ts → index-Ciu5Xlml.d.ts} +3 -3
  30. package/dist/{index-Sw43J8HG.d.ts → index-D4v7sncu.d.ts} +6 -6
  31. package/dist/{index-BD6wKthp.d.ts → index-DOsjFvMf.d.ts} +28 -7
  32. package/dist/{index-DRid0qIv.d.ts → index-DbxFr7XG.d.ts} +2 -2
  33. package/dist/{index-Nxo3TJcm.d.ts → index-DuP14VHo.d.ts} +11 -3
  34. package/dist/{index-Dup-nSe9.d.ts → index-K-3WM2Hp.d.ts} +2 -2
  35. package/dist/index.d.ts +9 -9
  36. package/dist/index.js +7 -6
  37. package/dist/jobs/index.d.ts +1 -1
  38. package/dist/jobs/index.js +6 -5
  39. package/dist/{json-schema-BbwO2mZg.js → json-schema-BpYqkCKf.js} +2 -1
  40. package/dist/list/index.d.ts +1 -1
  41. package/dist/{live-6b9i72Ux.d.ts → live-DJyZMD6w.d.ts} +14 -3
  42. package/dist/logger-glM28NVN.js +21 -0
  43. package/dist/mcp/index.d.ts +41 -4
  44. package/dist/mcp/index.js +194 -61
  45. package/dist/{mfa-CpogP66z.js → mfa-CpLfJSde.js} +23 -3
  46. package/dist/next/index.d.ts +23 -23
  47. package/dist/next/index.js +9 -8
  48. package/dist/openapi/index.d.ts +1 -1
  49. package/dist/openapi/index.js +3 -3
  50. package/dist/orpc/index.d.ts +4 -4
  51. package/dist/orpc/index.js +2 -2
  52. package/dist/otel/index.d.ts +3 -3
  53. package/dist/otel/index.js +1 -1
  54. package/dist/{template-BeOGnynM.js → permdock-sql-CghlHPuH.js} +25 -1
  55. package/dist/{plugin-HvGqCurB.d.ts → plugin-C4TR9J0Z.d.ts} +2 -2
  56. package/dist/plugins/actor/index.d.ts +1 -1
  57. package/dist/plugins/rules/index.d.ts +4 -3
  58. package/dist/plugins/rules/index.js +4 -11
  59. package/dist/plugins/soft-delete/index.d.ts +2 -2
  60. package/dist/plugins/tenant/index.d.ts +10 -4
  61. package/dist/plugins/tenant/index.js +15 -13
  62. package/dist/plugins/timestamps/index.d.ts +1 -1
  63. package/dist/plugins/validation/index.d.ts +1 -1
  64. package/dist/{pool-BFeqzwQS.d.ts → pool-R2m_DkXi.d.ts} +1 -1
  65. package/dist/postgres/index.d.ts +4 -4
  66. package/dist/postgres/index.js +2 -2
  67. package/dist/{postgrest-Dm-vhY6R.d.ts → postgrest-cAEQ_IQN.d.ts} +1 -1
  68. package/dist/{problem-DPu6Fh-t.js → problem-BTkTtRV9.js} +4 -4
  69. package/dist/query/index.d.ts +1 -1
  70. package/dist/react/index.d.ts +6 -6
  71. package/dist/react/index.js +3 -3
  72. package/dist/react/server.d.ts +5 -5
  73. package/dist/react/server.js +1 -1
  74. package/dist/react/session.d.ts +1 -1
  75. package/dist/react/session.js +1 -1
  76. package/dist/{react-CrOvrnIP.js → react-C83BdBGt.js} +9 -8
  77. package/dist/{read-set-DhX2d04c.js → read-set-4lI3W_gZ.js} +1 -1
  78. package/dist/realtime/index.d.ts +3 -2
  79. package/dist/realtime/index.js +26 -11
  80. package/dist/{resolve-DW8h9NPm.d.ts → resolve-CjHILk2w.d.ts} +21 -6
  81. package/dist/{resource-CYiu6Ygi.js → resource-BHEWmQJK.js} +1 -1
  82. package/dist/{resource-SkPTRJDD.d.ts → resource-CgZa3YG_.d.ts} +4 -4
  83. package/dist/{respond-4-dhoV7x.js → respond-DMcbQwfN.js} +7 -4
  84. package/dist/{respond-PoTpy5DT.d.ts → respond-Dne1ARSa.d.ts} +14 -14
  85. package/dist/server/index.d.ts +7 -7
  86. package/dist/server/index.js +5 -5
  87. package/dist/{session-C3osL21k.d.ts → session-C3LxnQ0e.d.ts} +4 -3
  88. package/dist/{session-CD-3orO_.js → session-CqEwzVup.js} +2 -1
  89. package/dist/{simplify-oHiDKRVQ.js → simplify-bwJpLnaS.js} +12 -12
  90. package/dist/{spec-pins-t6sPaHvl.js → spec-pins-C3oc-Tdp.js} +1 -1
  91. package/dist/{spec-pins-CJPVghHy.d.ts → spec-pins-CqorWDnO.d.ts} +1 -1
  92. package/dist/{sql-M8l3fnS0.js → sql-DTjA1LPj.js} +1 -1
  93. package/dist/ssr/index.d.ts +5 -5
  94. package/dist/ssr/index.js +3 -3
  95. package/dist/{stats-3iy8u3_P.js → stats-C5W-rBfR.js} +1 -1
  96. package/dist/storage/index.d.ts +3 -2
  97. package/dist/storage/index.js +1 -1
  98. package/dist/{storage-BWXVUXGk.js → storage-DuGn38fr.js} +72 -6
  99. package/dist/testing/index.d.ts +46 -15
  100. package/dist/testing/index.js +111 -43
  101. package/dist/{types-C2fslP1z.d.ts → types-C83v5SQz.d.ts} +55 -2
  102. package/dist/{view-B0ltUmTi.d.ts → view-D1s0wa0T.d.ts} +9 -3
  103. package/dist/{view-B6F9QbG-.js → view-aOYizTeE.js} +2 -1
  104. package/dist/webhooks/index.d.ts +3 -3
  105. package/dist/webhooks/index.js +1 -1
  106. package/dist/{webhooks-DbMTJJX2.js → webhooks-DMipjhSP.js} +1 -1
  107. package/package.json +8 -4
  108. package/schemas/config-v1.json +49 -4
  109. package/schemas/doctor-report-v1.json +1 -0
  110. package/schemas/snapshot-v2.json +4 -0
  111. package/skills/better-supabase/references/plugins.md +9 -0
  112. package/skills/better-supabase-api/SKILL.md +2 -2
  113. package/skills/better-supabase-testing/SKILL.md +4 -3
  114. package/dist/entitlements-BBg61DQZ.d.ts +0 -20
  115. package/dist/entitlements-BC_khwRy.js +0 -17
@@ -1,3 +1,4 @@
1
1
  #!/usr/bin/env node
2
2
  // Checked in so pnpm can link the bin on a fresh install, before dist/ is built.
3
- import '../dist/cli/bin.js';
3
+ // oxlint-disable-next-line import/no-unassigned-import -- the CLI module runs on import.
4
+ import "../dist/cli/bin.js";
@@ -0,0 +1,25 @@
1
+ //#region src/core/claims.ts
2
+ const DEFAULT_CLAIMS = {
3
+ tenant: "tenant_id",
4
+ scope: "tenant",
5
+ features: "features"
6
+ };
7
+ /** The configured claim names, with defaults for the ones codegen left out. */
8
+ function claimsOf(meta) {
9
+ return {
10
+ ...DEFAULT_CLAIMS,
11
+ ...meta?.claims
12
+ };
13
+ }
14
+ /** Where the active tenant is read from: the top-level claim, then `app_metadata`. */
15
+ function tenantClaimPaths(tenant = DEFAULT_CLAIMS.tenant) {
16
+ return [tenant, `app_metadata.${tenant}`];
17
+ }
18
+ /** The string at a dotted claim path, if any. */
19
+ function claimAt(claims, path) {
20
+ let value = claims;
21
+ for (const segment of path.split(".")) value = typeof value === "object" && value !== null ? value[segment] : void 0;
22
+ return typeof value === "string" && value.length > 0 ? value : void 0;
23
+ }
24
+ //#endregion
25
+ export { tenantClaimPaths as i, claimAt as n, claimsOf as r, DEFAULT_CLAIMS as t };
package/dist/cli/bin.js CHANGED
@@ -1,5 +1,5 @@
1
1
  #!/usr/bin/env node
2
- import { i as run } from "../cli-CoByWYja.js";
2
+ import { i as run } from "../cli-DrSgDOQC.js";
3
3
  //#region src/cli/bin.ts
4
4
  const controller = new AbortController();
5
5
  process.once("SIGINT", () => controller.abort());
@@ -1,5 +1,5 @@
1
- import { $ as ExtrasHook, B as CatalogCheck, G as CatalogFunctionArg, H as CatalogEnum, J as CatalogPolicy, K as CatalogGrant, Q as ExtrasFunction, U as CatalogForeignKey, V as CatalogColumn, W as CatalogFunction, X as CatalogTrigger, Y as CatalogTable, Z as CatalogUnique, at as SnapshotExtras, et as ExtrasHookFunction, it as SnapshotBucket, l as GeneratedFile, nt as ForeignKeyAction, ot as GeneratorMetadata, q as CatalogIndex, rt as Snapshot, st as Queryable, tt as ExtrasTable, v as ResolvedConfig, z as Catalog } from "../index-BD6wKthp.js";
2
- import { A as TableMeta, E as SchemaMeta, f as FunctionMeta, i as Casing, o as Codec, x as RelationMeta } from "../types-C2fslP1z.js";
1
+ import { $ as ExtrasFunction, B as Catalog, G as CatalogFunction, H as CatalogColumn, J as CatalogIndex, K as CatalogFunctionArg, Q as CatalogUnique, U as CatalogEnum, V as CatalogCheck, W as CatalogForeignKey, X as CatalogTable, Y as CatalogPolicy, Z as CatalogTrigger, at as SnapshotBucket, ct as Queryable, et as ExtrasHook, it as Snapshot, nt as ExtrasTable, ot as SnapshotExtras, q as CatalogGrant, rt as ForeignKeyAction, st as GeneratorMetadata, tt as ExtrasHookFunction, u as GeneratedFile, y as ResolvedConfig } from "../index-DOsjFvMf.js";
2
+ import { A as SchemaMeta, P as TableMeta, T as RelationMeta, a as Casing, c as Codec, m as FunctionMeta } from "../types-C83v5SQz.js";
3
3
  //#region src/cli/args.d.ts
4
4
  type FlagValue = string | boolean | readonly string[];
5
5
  interface ParsedArgs {
package/dist/cli/index.js CHANGED
@@ -1,3 +1,3 @@
1
1
  import { t as VERSION } from "../version-Cqq1m3UY.js";
2
- import { _ as emitModule, a as renderFiles, c as parseSnapshot, d as managementSource, f as pgSource, g as GENERATED_HEADER, h as toCatalog, i as run, l as serializeSnapshot, m as buildModel, n as HELP, o as runGen, p as loadConfig, r as registerCommand, s as loadSnapshot, t as fromCatalog, u as introspect } from "../cli-CoByWYja.js";
2
+ import { _ as emitModule, a as renderFiles, c as parseSnapshot, d as managementSource, f as pgSource, g as GENERATED_HEADER, h as toCatalog, i as run, l as serializeSnapshot, m as buildModel, n as HELP, o as runGen, p as loadConfig, r as registerCommand, s as loadSnapshot, t as fromCatalog, u as introspect } from "../cli-DrSgDOQC.js";
3
3
  export { GENERATED_HEADER, HELP, VERSION, buildModel, emitModule, fromCatalog, introspect, loadConfig, loadSnapshot, managementSource, parseSnapshot, pgSource, registerCommand, renderFiles, run, runGen, serializeSnapshot, toCatalog };