better-supabase 0.0.0 → 0.1.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 (154) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +88 -1
  3. package/bin/better-supabase.js +3 -0
  4. package/dist/casing-da0uRTqt.js +14 -0
  5. package/dist/cli/bin.d.ts +1 -0
  6. package/dist/cli/bin.js +15 -0
  7. package/dist/cli/index.d.ts +226 -0
  8. package/dist/cli/index.js +3 -0
  9. package/dist/cli-CoByWYja.js +6472 -0
  10. package/dist/client/index.d.ts +2 -0
  11. package/dist/client/index.js +112 -0
  12. package/dist/compiler-DL18ukPe.d.ts +14 -0
  13. package/dist/config/index.d.ts +3 -0
  14. package/dist/config/index.js +3 -0
  15. package/dist/config-D-aR2ZoN.js +276 -0
  16. package/dist/define-CTfWw-SS.d.ts +662 -0
  17. package/dist/define-QGkq04oe.js +1068 -0
  18. package/dist/edge/index.d.ts +43 -0
  19. package/dist/edge/index.js +103 -0
  20. package/dist/entitlements-BBg61DQZ.d.ts +20 -0
  21. package/dist/entitlements-BC_khwRy.js +17 -0
  22. package/dist/env/index.d.ts +2 -0
  23. package/dist/env/index.js +2 -0
  24. package/dist/env-BEToab0I.js +204 -0
  25. package/dist/errors-Bl3rkOzo.js +196 -0
  26. package/dist/events/index.d.ts +2 -0
  27. package/dist/events/index.js +2 -0
  28. package/dist/events-2OJsVG_d.d.ts +84 -0
  29. package/dist/events-BuzTgn2D.js +135 -0
  30. package/dist/executor-Bazhgsgq.d.ts +195 -0
  31. package/dist/executor-Bje4suQF.d.ts +25 -0
  32. package/dist/executor-Ceq60hPM.js +89 -0
  33. package/dist/hono/index.d.ts +45 -0
  34. package/dist/hono/index.js +70 -0
  35. package/dist/index-BD6wKthp.d.ts +597 -0
  36. package/dist/index-DQVvHzjW.d.ts +74 -0
  37. package/dist/index-DRid0qIv.d.ts +76 -0
  38. package/dist/index-Dup-nSe9.d.ts +117 -0
  39. package/dist/index-Dy6kuF0P.d.ts +71 -0
  40. package/dist/index-Hf8PP9sP.d.ts +116 -0
  41. package/dist/index-JXHBuS53.d.ts +144 -0
  42. package/dist/index-Nxo3TJcm.d.ts +208 -0
  43. package/dist/index-Sw43J8HG.d.ts +62 -0
  44. package/dist/index-cEeweTeM.d.ts +38 -0
  45. package/dist/index.d.ts +110 -0
  46. package/dist/index.js +42 -0
  47. package/dist/invalidate-DbxuL2jL.js +18 -0
  48. package/dist/jobs/index.d.ts +173 -0
  49. package/dist/jobs/index.js +477 -0
  50. package/dist/json-schema-BbwO2mZg.js +181 -0
  51. package/dist/lint/index.d.ts +75 -0
  52. package/dist/lint/index.js +167 -0
  53. package/dist/list/index.d.ts +2 -0
  54. package/dist/list/index.js +410 -0
  55. package/dist/live-6b9i72Ux.d.ts +180 -0
  56. package/dist/live-D8rV1Ldw.js +168 -0
  57. package/dist/mcp/index.d.ts +105 -0
  58. package/dist/mcp/index.js +330 -0
  59. package/dist/mfa-CpogP66z.js +521 -0
  60. package/dist/mfa-TVia554c.d.ts +44 -0
  61. package/dist/next/image/index.d.ts +34 -0
  62. package/dist/next/image/index.js +40 -0
  63. package/dist/next/index.d.ts +210 -0
  64. package/dist/next/index.js +426 -0
  65. package/dist/openapi/index.d.ts +2 -0
  66. package/dist/openapi/index.js +332 -0
  67. package/dist/orpc/index.d.ts +46 -0
  68. package/dist/orpc/index.js +50 -0
  69. package/dist/otel/index.d.ts +40 -0
  70. package/dist/otel/index.js +168 -0
  71. package/dist/path-Cv__-OTj.d.ts +17 -0
  72. package/dist/plugin-BqR6wKMB.js +23 -0
  73. package/dist/plugin-HvGqCurB.d.ts +118 -0
  74. package/dist/plugins/actor/index.d.ts +13 -0
  75. package/dist/plugins/actor/index.js +43 -0
  76. package/dist/plugins/rules/index.d.ts +88 -0
  77. package/dist/plugins/rules/index.js +174 -0
  78. package/dist/plugins/soft-delete/index.d.ts +38 -0
  79. package/dist/plugins/soft-delete/index.js +69 -0
  80. package/dist/plugins/tenant/index.d.ts +43 -0
  81. package/dist/plugins/tenant/index.js +73 -0
  82. package/dist/plugins/timestamps/index.d.ts +9 -0
  83. package/dist/plugins/timestamps/index.js +37 -0
  84. package/dist/plugins/validation/index.d.ts +24 -0
  85. package/dist/plugins/validation/index.js +59 -0
  86. package/dist/pool-BFeqzwQS.d.ts +37 -0
  87. package/dist/postgres/index.d.ts +28 -0
  88. package/dist/postgres/index.js +79 -0
  89. package/dist/postgrest-Dm-vhY6R.d.ts +43 -0
  90. package/dist/problem-DPu6Fh-t.js +97 -0
  91. package/dist/problem-DlgB0lYl.d.ts +47 -0
  92. package/dist/query/index.d.ts +2 -0
  93. package/dist/query/index.js +3 -0
  94. package/dist/query-ChvDbsDE.js +186 -0
  95. package/dist/react/index.d.ts +7 -0
  96. package/dist/react/index.js +5 -0
  97. package/dist/react/server.d.ts +13 -0
  98. package/dist/react/server.js +25 -0
  99. package/dist/react/session.d.ts +2 -0
  100. package/dist/react/session.js +3 -0
  101. package/dist/react-CrOvrnIP.js +241 -0
  102. package/dist/read-set-DhX2d04c.js +216 -0
  103. package/dist/realtime/index.d.ts +3 -0
  104. package/dist/realtime/index.js +253 -0
  105. package/dist/resolve-DW8h9NPm.d.ts +155 -0
  106. package/dist/resource-CYiu6Ygi.js +175 -0
  107. package/dist/resource-SkPTRJDD.d.ts +65 -0
  108. package/dist/respond-4-dhoV7x.js +380 -0
  109. package/dist/respond-PoTpy5DT.d.ts +169 -0
  110. package/dist/result-CTkCZ6JA.d.ts +198 -0
  111. package/dist/result-DWXatkd6.js +103 -0
  112. package/dist/scope-CDHcS7dE.js +90 -0
  113. package/dist/seed-CzecODcJ.js +101 -0
  114. package/dist/server/index.d.ts +42 -0
  115. package/dist/server/index.js +68 -0
  116. package/dist/session-C3osL21k.d.ts +21 -0
  117. package/dist/session-CD-3orO_.js +19 -0
  118. package/dist/shared-_6-uPL7E.js +57 -0
  119. package/dist/simplify-oHiDKRVQ.js +665 -0
  120. package/dist/spec-pins-CJPVghHy.d.ts +20 -0
  121. package/dist/spec-pins-t6sPaHvl.js +20 -0
  122. package/dist/sql-M8l3fnS0.js +260 -0
  123. package/dist/ssr/index.d.ts +5 -0
  124. package/dist/ssr/index.js +4 -0
  125. package/dist/standard-CyhRzctb.d.ts +7 -0
  126. package/dist/standard-FUi3Z3-7.js +21 -0
  127. package/dist/stats-3iy8u3_P.js +566 -0
  128. package/dist/storage/index.d.ts +4 -0
  129. package/dist/storage/index.js +2 -0
  130. package/dist/storage-BWXVUXGk.js +461 -0
  131. package/dist/tables-rZxRxNPW.js +59 -0
  132. package/dist/template-BeOGnynM.js +93 -0
  133. package/dist/template-mbvlysOo.d.ts +6 -0
  134. package/dist/testing/index.d.ts +294 -0
  135. package/dist/testing/index.js +751 -0
  136. package/dist/types-6cYK9pbJ.js +29 -0
  137. package/dist/types-C2fslP1z.d.ts +195 -0
  138. package/dist/version-Cqq1m3UY.js +4 -0
  139. package/dist/view-B0ltUmTi.d.ts +43 -0
  140. package/dist/view-B6F9QbG-.js +35 -0
  141. package/dist/webhooks/index.d.ts +152 -0
  142. package/dist/webhooks/index.js +2 -0
  143. package/dist/webhooks-DbMTJJX2.js +139 -0
  144. package/package.json +246 -17
  145. package/schemas/config-v1.json +328 -0
  146. package/schemas/doctor-report-v1.json +105 -0
  147. package/schemas/snapshot-v2.json +1002 -0
  148. package/skills/better-supabase/SKILL.md +84 -0
  149. package/skills/better-supabase/references/plugins.md +56 -0
  150. package/skills/better-supabase/references/troubleshooting.md +39 -0
  151. package/skills/better-supabase-api/SKILL.md +67 -0
  152. package/skills/better-supabase-api/references/adapters.md +108 -0
  153. package/skills/better-supabase-testing/SKILL.md +65 -0
  154. package/index.js +0 -1
package/package.json CHANGED
@@ -1,21 +1,7 @@
1
1
  {
2
2
  "name": "better-supabase",
3
- "version": "0.0.0",
4
- "main": "index.js",
3
+ "version": "0.1.0",
5
4
  "description": "Strongly typed Supabase: generated schema, typed repositories, plugins, auth glue and framework integrations, with a CLI from day one.",
6
- "publishConfig": {
7
- "access": "public"
8
- },
9
- "license": "MIT",
10
- "homepage": "https://bettersupabase.com",
11
- "repository": {
12
- "type": "git",
13
- "url": "git+https://github.com/ScaleDockHQ/better-supabase.git",
14
- "directory": "packages/better-supabase"
15
- },
16
- "bugs": {
17
- "url": "https://github.com/ScaleDockHQ/better-supabase/issues"
18
- },
19
5
  "keywords": [
20
6
  "hono",
21
7
  "mcp",
@@ -28,5 +14,248 @@
28
14
  "supabase",
29
15
  "tanstack-query",
30
16
  "typescript"
31
- ]
32
- }
17
+ ],
18
+ "homepage": "https://bettersupabase.com",
19
+ "bugs": {
20
+ "url": "https://github.com/ScaleDockHQ/better-supabase/issues"
21
+ },
22
+ "license": "MIT",
23
+ "repository": {
24
+ "type": "git",
25
+ "url": "git+https://github.com/ScaleDockHQ/better-supabase.git",
26
+ "directory": "packages/better-supabase"
27
+ },
28
+ "bin": {
29
+ "better-supabase": "./bin/better-supabase.js"
30
+ },
31
+ "files": [
32
+ "bin",
33
+ "dist",
34
+ "schemas",
35
+ "skills",
36
+ "LICENSE",
37
+ "README.md"
38
+ ],
39
+ "type": "module",
40
+ "sideEffects": false,
41
+ "exports": {
42
+ ".": {
43
+ "types": "./dist/index.d.ts",
44
+ "default": "./dist/index.js"
45
+ },
46
+ "./config": {
47
+ "types": "./dist/config/index.d.ts",
48
+ "default": "./dist/config/index.js"
49
+ },
50
+ "./client": {
51
+ "types": "./dist/client/index.d.ts",
52
+ "default": "./dist/client/index.js"
53
+ },
54
+ "./react": {
55
+ "types": "./dist/react/index.d.ts",
56
+ "react-server": "./dist/react/server.js",
57
+ "default": "./dist/react/index.js"
58
+ },
59
+ "./query": {
60
+ "types": "./dist/query/index.d.ts",
61
+ "default": "./dist/query/index.js"
62
+ },
63
+ "./server": {
64
+ "types": "./dist/server/index.d.ts",
65
+ "default": "./dist/server/index.js"
66
+ },
67
+ "./postgres": {
68
+ "types": "./dist/postgres/index.d.ts",
69
+ "default": "./dist/postgres/index.js"
70
+ },
71
+ "./ssr": {
72
+ "types": "./dist/ssr/index.d.ts",
73
+ "default": "./dist/ssr/index.js"
74
+ },
75
+ "./next": {
76
+ "types": "./dist/next/index.d.ts",
77
+ "default": "./dist/next/index.js"
78
+ },
79
+ "./next/image": {
80
+ "types": "./dist/next/image/index.d.ts",
81
+ "default": "./dist/next/image/index.js"
82
+ },
83
+ "./hono": {
84
+ "types": "./dist/hono/index.d.ts",
85
+ "default": "./dist/hono/index.js"
86
+ },
87
+ "./orpc": {
88
+ "types": "./dist/orpc/index.d.ts",
89
+ "default": "./dist/orpc/index.js"
90
+ },
91
+ "./edge": {
92
+ "types": "./dist/edge/index.d.ts",
93
+ "default": "./dist/edge/index.js"
94
+ },
95
+ "./mcp": {
96
+ "types": "./dist/mcp/index.d.ts",
97
+ "default": "./dist/mcp/index.js"
98
+ },
99
+ "./jobs": {
100
+ "types": "./dist/jobs/index.d.ts",
101
+ "default": "./dist/jobs/index.js"
102
+ },
103
+ "./env": {
104
+ "types": "./dist/env/index.d.ts",
105
+ "default": "./dist/env/index.js"
106
+ },
107
+ "./list": {
108
+ "types": "./dist/list/index.d.ts",
109
+ "default": "./dist/list/index.js"
110
+ },
111
+ "./storage": {
112
+ "types": "./dist/storage/index.d.ts",
113
+ "default": "./dist/storage/index.js"
114
+ },
115
+ "./realtime": {
116
+ "types": "./dist/realtime/index.d.ts",
117
+ "default": "./dist/realtime/index.js"
118
+ },
119
+ "./events": {
120
+ "types": "./dist/events/index.d.ts",
121
+ "default": "./dist/events/index.js"
122
+ },
123
+ "./webhooks": {
124
+ "types": "./dist/webhooks/index.d.ts",
125
+ "default": "./dist/webhooks/index.js"
126
+ },
127
+ "./openapi": {
128
+ "types": "./dist/openapi/index.d.ts",
129
+ "default": "./dist/openapi/index.js"
130
+ },
131
+ "./otel": {
132
+ "types": "./dist/otel/index.d.ts",
133
+ "default": "./dist/otel/index.js"
134
+ },
135
+ "./plugins/timestamps": {
136
+ "types": "./dist/plugins/timestamps/index.d.ts",
137
+ "default": "./dist/plugins/timestamps/index.js"
138
+ },
139
+ "./lint": {
140
+ "types": "./dist/lint/index.d.ts",
141
+ "default": "./dist/lint/index.js"
142
+ },
143
+ "./plugins/rules": {
144
+ "types": "./dist/plugins/rules/index.d.ts",
145
+ "default": "./dist/plugins/rules/index.js"
146
+ },
147
+ "./plugins/soft-delete": {
148
+ "types": "./dist/plugins/soft-delete/index.d.ts",
149
+ "default": "./dist/plugins/soft-delete/index.js"
150
+ },
151
+ "./plugins/tenant": {
152
+ "types": "./dist/plugins/tenant/index.d.ts",
153
+ "default": "./dist/plugins/tenant/index.js"
154
+ },
155
+ "./plugins/actor": {
156
+ "types": "./dist/plugins/actor/index.d.ts",
157
+ "default": "./dist/plugins/actor/index.js"
158
+ },
159
+ "./plugins/validation": {
160
+ "types": "./dist/plugins/validation/index.d.ts",
161
+ "default": "./dist/plugins/validation/index.js"
162
+ },
163
+ "./testing": {
164
+ "types": "./dist/testing/index.d.ts",
165
+ "default": "./dist/testing/index.js"
166
+ },
167
+ "./cli": {
168
+ "types": "./dist/cli/index.d.ts",
169
+ "default": "./dist/cli/index.js"
170
+ },
171
+ "./schemas/*.json": "./schemas/*.json",
172
+ "./package.json": "./package.json"
173
+ },
174
+ "publishConfig": {
175
+ "access": "public",
176
+ "provenance": true
177
+ },
178
+ "dependencies": {
179
+ "@standard-schema/spec": "1.1.0",
180
+ "@supabase/middleware": "0.6.0",
181
+ "@supabase/postgrest-typegen": "0.2.2",
182
+ "@supabase/server": "1.8.1",
183
+ "@supabase/ssr": "0.12.7"
184
+ },
185
+ "devDependencies": {
186
+ "@arethetypeswrong/cli": "0.18.5",
187
+ "@better-supabase/typescript-config": "0.0.0",
188
+ "@effect/platform-node": "4.0.0-rc.117",
189
+ "@opentelemetry/api": "1.9.1",
190
+ "@orpc/server": "2.0.0-beta.40",
191
+ "@supabase/config": "0.10.0",
192
+ "@supabase/supabase-js": "2.117.2",
193
+ "@tanstack/query-core": "5.104.0",
194
+ "@tanstack/react-query": "5.104.0",
195
+ "@types/node": "26.6.3",
196
+ "@types/pg": "8.23.1",
197
+ "@types/react": "19.3.0",
198
+ "@types/react-dom": "19.3.0",
199
+ "@vitest/coverage-v8": "5.0.2",
200
+ "effect": "4.0.0-rc.117",
201
+ "hono": "4.13.10",
202
+ "next": "16.3.6",
203
+ "oxfmt": "0.71.0",
204
+ "pg": "8.23.0",
205
+ "publint": "0.3.24",
206
+ "react": "19.3.0",
207
+ "react-dom": "19.3.0",
208
+ "tsdown": "0.23.0",
209
+ "typescript": "7.0.2",
210
+ "valibot": "1.5.0",
211
+ "vitest": "5.0.2",
212
+ "zod": "4.6.5"
213
+ },
214
+ "peerDependencies": {
215
+ "@opentelemetry/api": ">=1.9",
216
+ "@orpc/server": ">=2.0.0-0",
217
+ "@supabase/config": ">=0.9.0 <0.11",
218
+ "@supabase/supabase-js": "^2.116.0",
219
+ "@tanstack/query-core": "^5",
220
+ "hono": ">=4",
221
+ "next": ">=16",
222
+ "pg": ">=8",
223
+ "react": "^19"
224
+ },
225
+ "peerDependenciesMeta": {
226
+ "@opentelemetry/api": {
227
+ "optional": true
228
+ },
229
+ "@orpc/server": {
230
+ "optional": true
231
+ },
232
+ "@supabase/config": {
233
+ "optional": true
234
+ },
235
+ "@tanstack/query-core": {
236
+ "optional": true
237
+ },
238
+ "hono": {
239
+ "optional": true
240
+ },
241
+ "next": {
242
+ "optional": true
243
+ },
244
+ "pg": {
245
+ "optional": true
246
+ },
247
+ "react": {
248
+ "optional": true
249
+ }
250
+ },
251
+ "engines": {
252
+ "node": ">=24"
253
+ },
254
+ "scripts": {
255
+ "bench": "node src/next/next.bench.ts",
256
+ "build": "tsdown",
257
+ "check:publish": "publint && pnpm pack --out pack.tgz && attw --profile esm-only pack.tgz && rm -f pack.tgz",
258
+ "test": "vitest run --coverage",
259
+ "typecheck": "tsc --noEmit --checkers 4"
260
+ }
261
+ }
@@ -0,0 +1,328 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://unpkg.com/better-supabase/schemas/config-v1.json",
4
+ "title": "better-supabase config",
5
+ "description": "Configuration for better-supabase.config.ts (or .json).",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "properties": {
9
+ "$schema": { "type": "string" },
10
+ "source": {
11
+ "description": "Where codegen reads the database from. Without any of these, $DATABASE_URL and then the local stack are used.",
12
+ "type": "object",
13
+ "additionalProperties": false,
14
+ "properties": {
15
+ "dbUrl": {
16
+ "type": "string",
17
+ "description": "Postgres connection string."
18
+ },
19
+ "projectRef": {
20
+ "type": "string",
21
+ "description": "Hosted project ref, read through the Management API read-only SQL endpoint."
22
+ },
23
+ "accessToken": {
24
+ "type": "string",
25
+ "description": "Management API token for projectRef. Defaults to $SUPABASE_ACCESS_TOKEN."
26
+ },
27
+ "snapshot": {
28
+ "type": "string",
29
+ "description": "Read a saved introspection snapshot instead of connecting."
30
+ }
31
+ }
32
+ },
33
+ "schemas": {
34
+ "description": "Postgres schemas to generate.",
35
+ "type": "array",
36
+ "items": { "type": "string" },
37
+ "default": ["public"]
38
+ },
39
+ "casing": { "$ref": "#/$defs/casing", "default": "snake" },
40
+ "tables": {
41
+ "type": "object",
42
+ "additionalProperties": {
43
+ "type": "object",
44
+ "additionalProperties": false,
45
+ "properties": {
46
+ "casing": { "$ref": "#/$defs/casing" },
47
+ "exclude": { "type": "boolean" },
48
+ "relations": {
49
+ "type": "object",
50
+ "additionalProperties": { "type": "string" }
51
+ }
52
+ }
53
+ }
54
+ },
55
+ "output": {
56
+ "type": "string",
57
+ "description": "Main generated module.",
58
+ "default": "src/lib/supabase/generated.ts"
59
+ },
60
+ "postgrestVersion": {
61
+ "type": "string",
62
+ "description": "PostgREST major version written to database.types.ts.",
63
+ "default": "13"
64
+ },
65
+ "codecs": {
66
+ "description": "Runtime types for timestamps, int8 and numeric columns.",
67
+ "type": "object",
68
+ "additionalProperties": false,
69
+ "properties": {
70
+ "timestamptz": { "enum": ["string", "date"], "default": "string" },
71
+ "int8": { "enum": ["number", "string", "bigint"], "default": "number" },
72
+ "numeric": { "enum": ["number", "string"], "default": "number" }
73
+ }
74
+ },
75
+ "json": {
76
+ "description": "Types for jsonb columns, keyed by `table.column`.",
77
+ "type": "object",
78
+ "additionalProperties": {
79
+ "oneOf": [
80
+ {
81
+ "type": "object",
82
+ "required": ["import"],
83
+ "additionalProperties": false,
84
+ "properties": {
85
+ "import": {
86
+ "type": "string",
87
+ "description": "`./path.ts#TypeName`"
88
+ },
89
+ "schema": {
90
+ "type": "object",
91
+ "description": "JSON Schema enforced by `sql add jsonb-schemas` (pg_jsonschema)."
92
+ }
93
+ }
94
+ },
95
+ {
96
+ "type": "object",
97
+ "required": ["type"],
98
+ "additionalProperties": false,
99
+ "properties": {
100
+ "type": {
101
+ "type": "string",
102
+ "description": "Inline TypeScript type."
103
+ },
104
+ "schema": {
105
+ "type": "object",
106
+ "description": "JSON Schema enforced by `sql add jsonb-schemas` (pg_jsonschema)."
107
+ }
108
+ }
109
+ }
110
+ ]
111
+ }
112
+ },
113
+ "generators": {
114
+ "description": "Generator plugins. Only available in better-supabase.config.ts.",
115
+ "type": "array"
116
+ },
117
+ "plugins": {
118
+ "type": "object",
119
+ "additionalProperties": false,
120
+ "properties": {
121
+ "timestamps": {
122
+ "oneOf": [
123
+ { "type": "boolean" },
124
+ {
125
+ "type": "object",
126
+ "additionalProperties": false,
127
+ "properties": {
128
+ "createdAt": { "type": "string" },
129
+ "updatedAt": { "type": "string" }
130
+ }
131
+ }
132
+ ]
133
+ },
134
+ "softDelete": {
135
+ "oneOf": [
136
+ { "type": "boolean" },
137
+ {
138
+ "type": "object",
139
+ "additionalProperties": false,
140
+ "properties": { "column": { "type": "string" } }
141
+ }
142
+ ]
143
+ },
144
+ "tenant": {
145
+ "oneOf": [
146
+ { "type": "boolean" },
147
+ {
148
+ "type": "object",
149
+ "additionalProperties": false,
150
+ "properties": {
151
+ "column": { "type": "string" },
152
+ "claim": { "type": "string" }
153
+ }
154
+ }
155
+ ]
156
+ },
157
+ "actor": {
158
+ "oneOf": [
159
+ { "type": "boolean" },
160
+ {
161
+ "type": "object",
162
+ "additionalProperties": false,
163
+ "properties": {
164
+ "createdBy": { "type": "string" },
165
+ "updatedBy": { "type": "string" }
166
+ }
167
+ }
168
+ ]
169
+ }
170
+ }
171
+ },
172
+ "buckets": {
173
+ "type": "object",
174
+ "additionalProperties": {
175
+ "type": "object",
176
+ "required": ["path"],
177
+ "additionalProperties": false,
178
+ "properties": {
179
+ "id": { "type": "string" },
180
+ "public": { "type": "boolean" },
181
+ "path": {
182
+ "type": "string",
183
+ "description": "Path template, e.g. `{orgId}/{customerId}/logo.webp`."
184
+ },
185
+ "policy": { "enum": ["tenant", "owner", "public", "none"] },
186
+ "fileSizeLimit": { "type": "string" },
187
+ "allowedMimeTypes": { "type": "array", "items": { "type": "string" } }
188
+ }
189
+ }
190
+ },
191
+ "topics": {
192
+ "description": "Realtime topic templates.",
193
+ "type": "object",
194
+ "additionalProperties": { "type": "string" }
195
+ },
196
+ "sensitive": {
197
+ "description": "Columns guarded by the noSensitiveSelect rule (`table.column` or `schema.table.column`).",
198
+ "type": "array",
199
+ "items": { "type": "string" }
200
+ },
201
+ "storagePaths": {
202
+ "description": "Text columns holding a storage object path (`table.column` or `schema.table.column`), mapped to a `buckets` key or bucket id. Typed as `StoragePath<'bucket-id'>`.",
203
+ "type": "object",
204
+ "additionalProperties": { "type": "string" }
205
+ },
206
+ "expose": {
207
+ "description": "Data API grants keyed by `table` or `schema.table`: privileges for authenticated, or per role. Written by the `grants` SQL kit module and checked by doctor (BS106).",
208
+ "type": "object",
209
+ "additionalProperties": {
210
+ "oneOf": [
211
+ { "$ref": "#/$defs/privileges" },
212
+ {
213
+ "type": "object",
214
+ "additionalProperties": false,
215
+ "properties": {
216
+ "anon": { "$ref": "#/$defs/privileges" },
217
+ "authenticated": { "$ref": "#/$defs/privileges" }
218
+ }
219
+ }
220
+ ]
221
+ }
222
+ },
223
+ "readSets": {
224
+ "description": "Modules exporting `defineReadSet` results. `gen` compiles them into the `read-sets` SQL kit module.",
225
+ "type": "array",
226
+ "items": { "type": "string" }
227
+ },
228
+ "entitlements": {
229
+ "description": "Where the `entitlements` SQL kit module finds each tenant's Stripe customer.",
230
+ "type": "object",
231
+ "additionalProperties": false,
232
+ "properties": {
233
+ "customer": {
234
+ "description": "`table.column` or `schema.table.column` holding the Stripe customer id.",
235
+ "type": "string",
236
+ "default": "organizations.stripe_customer_id"
237
+ },
238
+ "key": {
239
+ "description": "The tenant id column of that table.",
240
+ "type": "string",
241
+ "default": "id"
242
+ }
243
+ }
244
+ },
245
+ "vectorSearch": {
246
+ "description": "Embedding columns keyed by `table` or `schema.table`. The `vector-search` SQL kit module writes `search_<table>(query, k)` for each.",
247
+ "type": "object",
248
+ "additionalProperties": {
249
+ "oneOf": [
250
+ { "type": "string", "description": "The embedding column." },
251
+ {
252
+ "type": "object",
253
+ "additionalProperties": false,
254
+ "required": ["column"],
255
+ "properties": {
256
+ "column": { "type": "string" },
257
+ "distance": {
258
+ "enum": ["cosine", "l2", "inner_product"],
259
+ "default": "cosine"
260
+ }
261
+ }
262
+ }
263
+ ]
264
+ }
265
+ },
266
+ "realtime": {
267
+ "description": "Live query change broadcasts.",
268
+ "type": "object",
269
+ "additionalProperties": false,
270
+ "properties": {
271
+ "tables": {
272
+ "description": "Tables that broadcast change signals (`table` or `schema.table`). Install with `better-supabase sql add realtime-tables`.",
273
+ "type": "array",
274
+ "items": { "type": "string" }
275
+ }
276
+ }
277
+ },
278
+ "sql": {
279
+ "type": "object",
280
+ "additionalProperties": false,
281
+ "properties": {
282
+ "dir": { "type": "string", "default": "supabase/schemas" },
283
+ "prefix": { "type": "string", "default": "900_better_supabase" },
284
+ "testsDir": { "type": "string", "default": "supabase/tests" },
285
+ "kit": { "type": "array", "items": { "type": "string" } }
286
+ }
287
+ },
288
+ "seed": {
289
+ "type": "object",
290
+ "additionalProperties": false,
291
+ "properties": {
292
+ "entry": { "type": "string", "default": "supabase/seed.ts" },
293
+ "output": {
294
+ "type": "string",
295
+ "default": "supabase/seeds/000_better_supabase.sql"
296
+ }
297
+ }
298
+ },
299
+ "openapi": {
300
+ "type": "object",
301
+ "additionalProperties": false,
302
+ "properties": {
303
+ "entry": { "type": "string", "default": "src/lib/openapi.ts" },
304
+ "output": { "type": "string", "default": "openapi.json" }
305
+ }
306
+ },
307
+ "doctor": {
308
+ "type": "object",
309
+ "additionalProperties": false,
310
+ "properties": {
311
+ "ignore": {
312
+ "type": "array",
313
+ "items": { "type": "string", "pattern": "^BS\\d{3}$" }
314
+ },
315
+ "strict": { "type": "boolean" },
316
+ "sources": { "type": "array", "items": { "type": "string" } },
317
+ "policyHelperLimit": { "type": "integer", "minimum": 1 }
318
+ }
319
+ }
320
+ },
321
+ "$defs": {
322
+ "casing": { "enum": ["snake", "camel"] },
323
+ "privileges": {
324
+ "type": "array",
325
+ "items": { "enum": ["select", "insert", "update", "delete"] }
326
+ }
327
+ }
328
+ }