@supatype/cli 0.1.13 → 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.
- package/.turbo/turbo-build.log +1 -1
- package/.turbo/turbo-test.log +151 -143
- package/.turbo/turbo-typecheck.log +1 -1
- package/dist/cli-version-embedded.d.ts.map +1 -1
- package/dist/cli-version-embedded.js +1 -1
- package/dist/cli-version-embedded.js.map +1 -1
- package/dist/commands/admin.d.ts +5 -5
- package/dist/commands/admin.d.ts.map +1 -1
- package/dist/commands/admin.js +10 -10
- package/dist/commands/admin.js.map +1 -1
- package/dist/commands/dev.js +51 -51
- package/dist/commands/dev.js.map +1 -1
- package/dist/commands/init.js +1 -1
- package/dist/commands/logs.d.ts +14 -1
- package/dist/commands/logs.d.ts.map +1 -1
- package/dist/commands/logs.js +33 -37
- package/dist/commands/logs.js.map +1 -1
- package/dist/commands/push.d.ts.map +1 -1
- package/dist/commands/push.js +3 -0
- package/dist/commands/push.js.map +1 -1
- package/dist/commands/status.d.ts +1 -1
- package/dist/commands/status.d.ts.map +1 -1
- package/dist/commands/status.js +33 -64
- package/dist/commands/status.js.map +1 -1
- package/dist/compose-services.d.ts +59 -0
- package/dist/compose-services.d.ts.map +1 -0
- package/dist/compose-services.js +160 -0
- package/dist/compose-services.js.map +1 -0
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/dev-compose.d.ts.map +1 -1
- package/dist/dev-compose.js +123 -20
- package/dist/dev-compose.js.map +1 -1
- package/dist/dev-ports.d.ts +24 -0
- package/dist/dev-ports.d.ts.map +1 -1
- package/dist/dev-ports.js +37 -0
- package/dist/dev-ports.js.map +1 -1
- package/dist/docker-postgres.d.ts +1 -1
- package/dist/docker-postgres.d.ts.map +1 -1
- package/dist/docker-postgres.js +2 -2
- package/dist/docker-postgres.js.map +1 -1
- package/dist/engine-floor.d.ts +50 -0
- package/dist/engine-floor.d.ts.map +1 -0
- package/dist/engine-floor.js +80 -0
- package/dist/engine-floor.js.map +1 -0
- package/dist/link.d.ts +1 -1
- package/dist/link.d.ts.map +1 -1
- package/dist/pgbouncer-userlist.d.ts +1 -1
- package/dist/pgbouncer-userlist.d.ts.map +1 -1
- package/dist/pgbouncer-userlist.js +1 -1
- package/dist/pgbouncer-userlist.js.map +1 -1
- package/dist/postgres-ctl.d.ts +5 -1
- package/dist/postgres-ctl.d.ts.map +1 -1
- package/dist/postgres-ctl.js +43 -4
- package/dist/postgres-ctl.js.map +1 -1
- package/dist/project-config.d.ts +4 -4
- package/dist/resolve-target.d.ts +1 -1
- package/dist/resolve-target.d.ts.map +1 -1
- package/dist/self-host-compose.d.ts.map +1 -1
- package/dist/self-host-compose.js +41 -18
- package/dist/self-host-compose.js.map +1 -1
- package/dist/studio-dev-server.d.ts +8 -1
- package/dist/studio-dev-server.d.ts.map +1 -1
- package/dist/studio-dev-server.js +1 -2
- package/dist/studio-dev-server.js.map +1 -1
- package/package.json +2 -2
- package/src/cli-version-embedded.ts +1 -1
- package/src/commands/admin.ts +10 -10
- package/src/commands/dev.ts +51 -51
- package/src/commands/init.ts +1 -1
- package/src/commands/logs.ts +34 -37
- package/src/commands/push.ts +3 -0
- package/src/commands/status.ts +34 -70
- package/src/compose-services.ts +174 -0
- package/src/config.ts +1 -1
- package/src/dev-compose.ts +130 -20
- package/src/dev-ports.ts +48 -0
- package/src/docker-postgres.ts +2 -2
- package/src/engine-floor.ts +113 -0
- package/src/link.ts +1 -1
- package/src/pgbouncer-userlist.ts +1 -1
- package/src/postgres-ctl.ts +44 -4
- package/src/project-config.ts +4 -4
- package/src/resolve-target.ts +1 -1
- package/src/self-host-compose.ts +41 -18
- package/src/studio-dev-server.ts +9 -3
- package/tests/admin-ensure.test.ts +10 -10
- package/tests/compose-parsable-defaults.test.ts +60 -0
- package/tests/compose-services.test.ts +144 -0
- package/tests/dev-ports-owner.test.ts +40 -0
- package/tests/engine-floor.test.ts +102 -0
- package/tests/external-database-compose.test.ts +3 -3
- package/tests/port-in-use.test.ts +58 -0
- package/tests/readiness-poll.test.ts +84 -0
- package/tests/runtime-contract.test.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/cli@0.
|
|
2
|
+
> @supatype/cli@0.2.0 build /home/runner/work/supatype/supatype/packages/cli
|
|
3
3
|
> tsc --project tsconfig.json && node --input-type=module -e "import{cpSync,mkdirSync}from'node:fs';const a='dist/assets';mkdirSync(a,{recursive:true});cpSync('assets/supatype-logo-wordmark.ascii.txt',a+'/supatype-logo-wordmark.ascii.txt')"
|
|
4
4
|
|
package/.turbo/turbo-test.log
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
|
|
2
|
-
> @supatype/cli@0.
|
|
2
|
+
> @supatype/cli@0.2.0 test /home/runner/work/supatype/supatype/packages/cli
|
|
3
3
|
> vitest run
|
|
4
4
|
|
|
5
5
|
|
|
6
6
|
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/supatype/supatype/packages/cli[39m
|
|
7
7
|
|
|
8
|
-
[32m✓[39m tests/access-composition.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m
|
|
9
|
-
[32m✓[39m tests/type-extractor.test.ts [2m([22m[2m44 tests[22m[2m)[22m[32m
|
|
10
|
-
[32m✓[39m tests/model-hooks.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
8
|
+
[32m✓[39m tests/access-composition.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 90[2mms[22m[39m
|
|
9
|
+
[32m✓[39m tests/type-extractor.test.ts [2m([22m[2m44 tests[22m[2m)[22m[32m 117[2mms[22m[39m
|
|
10
|
+
[32m✓[39m tests/model-hooks.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 66[2mms[22m[39m
|
|
11
|
+
[32m✓[39m tests/runtime-contract.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m 142[2mms[22m[39m
|
|
11
12
|
[90mstdout[2m | tests/init.test.ts[2m > [22m[2mscaffold()[2m > [22m[2mcreates all expected files
|
|
12
13
|
[22m[39m created package.json
|
|
13
14
|
created supatype.config.ts
|
|
@@ -294,13 +295,12 @@
|
|
|
294
295
|
created public/.gitkeep
|
|
295
296
|
created .gitignore
|
|
296
297
|
|
|
297
|
-
[32m✓[39m tests/init.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m
|
|
298
|
-
[32m✓[39m tests/
|
|
299
|
-
[32m✓[39m tests/
|
|
300
|
-
[32m✓[39m tests/
|
|
301
|
-
[32m✓[39m tests/field-masking-tier.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 34[2mms[22m[39m
|
|
298
|
+
[32m✓[39m tests/init.test.ts [2m([22m[2m26 tests[22m[2m)[22m[32m 44[2mms[22m[39m
|
|
299
|
+
[32m✓[39m tests/model-constraints.test.ts [2m([22m[2m18 tests[22m[2m)[22m[32m 76[2mms[22m[39m
|
|
300
|
+
[32m✓[39m tests/external-database-compose.test.ts [2m([22m[2m17 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
301
|
+
[32m✓[39m tests/field-masking-tier.test.ts [2m([22m[2m16 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
302
302
|
|
|
303
|
-
[32m✓[39m tests/dev-ui.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m
|
|
303
|
+
[32m✓[39m tests/dev-ui.test.ts [2m([22m[2m21 tests[22m[2m)[22m[32m 117[2mms[22m[39m
|
|
304
304
|
|
|
305
305
|
[supatype] Shutting down…
|
|
306
306
|
[90mstdout[2m | tests/docker-runtime.test.ts[2m > [22m[2mrequireDockerDaemon[2m > [22m[2mexits when the daemon is unavailable
|
|
@@ -311,40 +311,39 @@
|
|
|
311
311
|
|
|
312
312
|
docker: daemon down
|
|
313
313
|
|
|
314
|
-
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
315
|
-
[32m✓[39m tests/hooks-generator.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m
|
|
316
|
-
[33m[2m✓[22m[39m typechecks under strict mode, together with a handler that uses it [33m
|
|
317
|
-
[33m[2m✓[22m[39m rejects a handler for a table that declares no hook [33m
|
|
318
|
-
[33m[2m✓[22m[39m typechecks with a validator written the way the docs will show it [33m
|
|
319
|
-
[32m✓[39m tests/config.test.ts [2m([22m[2m19 tests[22m[2m)[22m[33m
|
|
320
|
-
[33m[2m✓[22m[39m loads a valid supatype.config.ts (plain export default, no package imports) [33m
|
|
321
|
-
[33m[2m✓[22m[39m normalizes shorthand schema string to { path, pg_schema } [33m
|
|
322
|
-
[33m[2m✓[22m[39m loads a supatype.config.js (plain ESM) [33m
|
|
323
|
-
[33m[2m✓[22m[39m loads config without a versions section (latest by default) [33m
|
|
324
|
-
[33m[2m✓[22m[39m prefers supatype.config.ts over supatype.config.js when both exist [33m
|
|
325
|
-
[33m[2m✓[22m[39m supports optional output field in config [33m
|
|
326
|
-
[33m[2m✓[22m[39m merges supatype.local.config.ts over base [33m
|
|
327
|
-
[33m[2m✓[22m[39m loads defineConfig import before @supatype/cli is installed (init scaffold) [33m
|
|
328
|
-
[32m✓[39m tests/db-preflight.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m
|
|
329
|
-
[32m✓[39m tests/field-bounds.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m
|
|
330
|
-
[32m✓[39m tests/cache-clean.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m
|
|
331
|
-
[33m[2m✓[22m[39m keeps pinned versions and removes the rest [33m
|
|
332
|
-
[33m[2m✓[22m[39m --force removes pinned versions [33m
|
|
333
|
-
[33m[2m✓[22m[39m explicit version removes even when pinned (with warning) [33m
|
|
334
|
-
[32m✓[39m tests/
|
|
335
|
-
|
|
336
|
-
[33m[2m✓[22m[39m tsc fails with Cannot find name Deno without ambient types [33m
|
|
337
|
-
[33m[2m✓[22m[39m tsc passes for Deno.env after ensureFunctionsDenoTypes [33m
|
|
338
|
-
[32m✓[39m tests/
|
|
339
|
-
[32m✓[39m tests/
|
|
340
|
-
[32m✓[39m tests/
|
|
341
|
-
[32m✓[39m tests/
|
|
342
|
-
[32m✓[39m tests/
|
|
314
|
+
[32m✓[39m tests/docker-runtime.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
315
|
+
[32m✓[39m tests/hooks-generator.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 5380[2mms[22m[39m
|
|
316
|
+
[33m[2m✓[22m[39m typechecks under strict mode, together with a handler that uses it [33m 1784[2mms[22m[39m
|
|
317
|
+
[33m[2m✓[22m[39m rejects a handler for a table that declares no hook [33m 1801[2mms[22m[39m
|
|
318
|
+
[33m[2m✓[22m[39m typechecks with a validator written the way the docs will show it [33m 1768[2mms[22m[39m
|
|
319
|
+
[32m✓[39m tests/config.test.ts [2m([22m[2m19 tests[22m[2m)[22m[33m 5148[2mms[22m[39m
|
|
320
|
+
[33m[2m✓[22m[39m loads a valid supatype.config.ts (plain export default, no package imports) [33m 529[2mms[22m[39m
|
|
321
|
+
[33m[2m✓[22m[39m normalizes shorthand schema string to { path, pg_schema } [33m 520[2mms[22m[39m
|
|
322
|
+
[33m[2m✓[22m[39m loads a supatype.config.js (plain ESM) [33m 485[2mms[22m[39m
|
|
323
|
+
[33m[2m✓[22m[39m loads config without a versions section (latest by default) [33m 533[2mms[22m[39m
|
|
324
|
+
[33m[2m✓[22m[39m prefers supatype.config.ts over supatype.config.js when both exist [33m 588[2mms[22m[39m
|
|
325
|
+
[33m[2m✓[22m[39m supports optional output field in config [33m 581[2mms[22m[39m
|
|
326
|
+
[33m[2m✓[22m[39m merges supatype.local.config.ts over base [33m 1021[2mms[22m[39m
|
|
327
|
+
[33m[2m✓[22m[39m loads defineConfig import before @supatype/cli is installed (init scaffold) [33m 880[2mms[22m[39m
|
|
328
|
+
[32m✓[39m tests/db-preflight.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
329
|
+
[32m✓[39m tests/field-bounds.test.ts [2m([22m[2m23 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
330
|
+
[32m✓[39m tests/cache-clean.test.ts [2m([22m[2m8 tests[22m[2m)[22m[33m 1667[2mms[22m[39m
|
|
331
|
+
[33m[2m✓[22m[39m keeps pinned versions and removes the rest [33m 551[2mms[22m[39m
|
|
332
|
+
[33m[2m✓[22m[39m --force removes pinned versions [33m 514[2mms[22m[39m
|
|
333
|
+
[33m[2m✓[22m[39m explicit version removes even when pinned (with warning) [33m 590[2mms[22m[39m
|
|
334
|
+
[32m✓[39m tests/functions-deno-types.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 2732[2mms[22m[39m
|
|
335
|
+
[33m[2m✓[22m[39m adds functions to root tsconfig exclude when possible [33m 510[2mms[22m[39m
|
|
336
|
+
[33m[2m✓[22m[39m tsc fails with Cannot find name Deno without ambient types [33m 1604[2mms[22m[39m
|
|
337
|
+
[33m[2m✓[22m[39m tsc passes for Deno.env after ensureFunctionsDenoTypes [33m 612[2mms[22m[39m
|
|
338
|
+
[32m✓[39m tests/field-bounds-matrix.test.ts [2m([22m[2m124 tests[22m[2m)[22m[32m 24[2mms[22m[39m
|
|
339
|
+
[32m✓[39m tests/external-database-config.test.ts [2m([22m[2m14 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
340
|
+
[32m✓[39m tests/compose-services.test.ts [2m([22m[2m12 tests[22m[2m)[22m[32m 19[2mms[22m[39m
|
|
341
|
+
[32m✓[39m tests/field-validators.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 38[2mms[22m[39m
|
|
342
|
+
[32m✓[39m tests/command-chrome-coverage.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
343
|
+
[32m✓[39m tests/hook-upload.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
344
|
+
[32m✓[39m tests/env-file.test.ts [2m([22m[2m9 tests[22m[2m)[22m[32m 14[2mms[22m[39m
|
|
343
345
|
[90mstdout[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
344
346
|
[22m[39m created package.json
|
|
345
|
-
[90mstderr[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
346
|
-
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
347
|
-
|
|
348
347
|
created supatype.config.ts
|
|
349
348
|
created schema/index.ts
|
|
350
349
|
created .env
|
|
@@ -353,10 +352,13 @@
|
|
|
353
352
|
created public/.gitkeep
|
|
354
353
|
created .gitignore
|
|
355
354
|
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
355
|
+
[90mstderr[2m | tests/link.test.ts[2m > [22m[2mlink model[2m > [22m[2mmigrates cloud.json into link.json
|
|
356
|
+
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
357
|
+
|
|
358
|
+
[32m✓[39m tests/link.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 2564[2mms[22m[39m
|
|
359
|
+
[33m[2m✓[22m[39m resolveTarget returns cloud mode with /api/v1 prefix [33m 899[2mms[22m[39m
|
|
360
|
+
[33m[2m✓[22m[39m resolveTarget returns self-host mode with /platform/v1 prefix [33m 789[2mms[22m[39m
|
|
361
|
+
[33m[2m✓[22m[39m targetSchemaRollback posts to /platform/v1 when linked [33m 867[2mms[22m[39m
|
|
360
362
|
[90mstdout[2m | tests/admin-ensure.test.ts[2m > [22m[2minit admin seed in .env[2m > [22m[2mwrites SUPATYPE_ADMIN_* when scaffold options include credentials
|
|
361
363
|
[22m[39m created package.json
|
|
362
364
|
created supatype.config.ts
|
|
@@ -367,8 +369,8 @@
|
|
|
367
369
|
created public/.gitkeep
|
|
368
370
|
created .gitignore
|
|
369
371
|
|
|
370
|
-
[32m✓[39m tests/admin-ensure.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
371
|
-
[32m✓[39m tests/service-role-check.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m
|
|
372
|
+
[32m✓[39m tests/admin-ensure.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 144[2mms[22m[39m
|
|
373
|
+
[32m✓[39m tests/service-role-check.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
372
374
|
[90mstdout[2m | tests/admin-studio-membership.test.ts[2m > [22m[2mfirst admin user creation[2m > [22m[2mdoes not write a role into app_metadata
|
|
373
375
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
374
376
|
[supatype] Log in at /admin after starting the dev server.
|
|
@@ -385,43 +387,46 @@
|
|
|
385
387
|
[22m[39m[supatype] Admin user "admin@example.com" created (role: admin).
|
|
386
388
|
[supatype] Log in at /admin after starting the dev server.
|
|
387
389
|
|
|
388
|
-
[32m✓[39m tests/admin-studio-membership.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m
|
|
389
|
-
[32m✓[39m tests/augmentation-generator.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
390
|
-
[32m✓[39m tests/pull-utils.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m
|
|
391
|
-
[32m✓[39m tests/
|
|
392
|
-
[33m[2m✓[22m[39m
|
|
393
|
-
[33m[2m✓[22m[39m
|
|
394
|
-
|
|
395
|
-
[33m[2m✓[22m[39m
|
|
396
|
-
[33m[2m✓[22m[39m
|
|
397
|
-
[33m[2m✓[22m[39m
|
|
398
|
-
[33m[2m✓[22m[39m
|
|
399
|
-
[33m[2m✓[22m[39m
|
|
400
|
-
[33m[2m✓[22m[39m
|
|
401
|
-
[33m[2m✓[22m[39m
|
|
402
|
-
[33m[2m✓[22m[39m
|
|
403
|
-
|
|
404
|
-
[33m[2m✓[22m[39m
|
|
405
|
-
[33m[2m✓[22m[39m
|
|
406
|
-
[32m✓[39m tests/local-server-image-env.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 11[2mms[22m[39m
|
|
390
|
+
[32m✓[39m tests/admin-studio-membership.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 385[2mms[22m[39m
|
|
391
|
+
[32m✓[39m tests/augmentation-generator.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 16[2mms[22m[39m
|
|
392
|
+
[32m✓[39m tests/pull-utils.test.ts [2m([22m[2m49 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
393
|
+
[32m✓[39m tests/keys.test.ts [2m([22m[2m11 tests[22m[2m)[22m[33m 13237[2mms[22m[39m
|
|
394
|
+
[33m[2m✓[22m[39m exits 0 with --secret [33m 1193[2mms[22m[39m
|
|
395
|
+
[33m[2m✓[22m[39m outputs ANON_KEY= line [33m 1194[2mms[22m[39m
|
|
396
|
+
[33m[2m✓[22m[39m outputs SERVICE_ROLE_KEY= line [33m 1074[2mms[22m[39m
|
|
397
|
+
[33m[2m✓[22m[39m ANON_KEY is a valid three-part JWT [33m 1092[2mms[22m[39m
|
|
398
|
+
[33m[2m✓[22m[39m SERVICE_ROLE_KEY payload has role: service_role [33m 1053[2mms[22m[39m
|
|
399
|
+
[33m[2m✓[22m[39m JWT has exp in the future [33m 1047[2mms[22m[39m
|
|
400
|
+
[33m[2m✓[22m[39m --exp-years changes the expiry window [33m 2168[2mms[22m[39m
|
|
401
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from environment variable [33m 1063[2mms[22m[39m
|
|
402
|
+
[33m[2m✓[22m[39m reads JWT_SECRET from .env file [33m 1105[2mms[22m[39m
|
|
403
|
+
[33m[2m✓[22m[39m exits non-zero when no secret is available [33m 1134[2mms[22m[39m
|
|
404
|
+
[33m[2m✓[22m[39m keys --help shows --secret and --exp-years options [33m 1108[2mms[22m[39m
|
|
405
|
+
[32m✓[39m tests/schema-sources.test.ts [2m([22m[2m5 tests[22m[2m)[22m[33m 1099[2mms[22m[39m
|
|
406
|
+
[33m[2m✓[22m[39m buildSchemaSourcesPayload includes manifest metadata [33m 459[2mms[22m[39m
|
|
407
|
+
[33m[2m✓[22m[39m restore overwrites modified local files [33m 604[2mms[22m[39m
|
|
407
408
|
[90mstderr[2m | tests/binary-cache-cloud-overrides.test.ts[2m > [22m[2misLinkedToCloudProject[2m > [22m[2mis true when .supatype/cloud.json has projectSlug
|
|
408
409
|
[22m[39m[supatype] Migrated .supatype/cloud.json → .supatype/link.json (legacy files kept; remove manually when ready).
|
|
409
410
|
|
|
410
|
-
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m
|
|
411
|
-
[32m✓[39m tests/homebrew-formula.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m
|
|
412
|
-
[32m✓[39m tests/
|
|
413
|
-
[32m✓[39m tests/
|
|
414
|
-
[32m✓[39m tests/
|
|
411
|
+
[32m✓[39m tests/binary-cache-cloud-overrides.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 17[2mms[22m[39m
|
|
412
|
+
[32m✓[39m tests/homebrew-formula.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 110[2mms[22m[39m
|
|
413
|
+
[32m✓[39m tests/local-server-image-env.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 218[2mms[22m[39m
|
|
414
|
+
[32m✓[39m tests/minisign.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
415
|
+
[32m✓[39m tests/engine-floor.test.ts [2m([22m[2m11 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
416
|
+
[32m✓[39m tests/local-secrets.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
417
|
+
[32m✓[39m tests/api-schemas.test.ts [2m([22m[2m10 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
415
418
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
416
419
|
[22m[39m[supatype] Storage bucket "photos" ready.
|
|
417
420
|
|
|
418
421
|
[90mstdout[2m | tests/storage-provision.test.ts[2m > [22m[2mprovisionBuckets[2m > [22m[2mPOSTs each bucket to the storage API
|
|
419
422
|
[22m[39m[supatype] Storage bucket "avatars" ready.
|
|
420
423
|
|
|
421
|
-
[32m✓[39m tests/storage-provision.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m
|
|
422
|
-
[32m✓[39m tests/cached-artifact-format.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m
|
|
423
|
-
[32m✓[39m tests/
|
|
424
|
-
|
|
424
|
+
[32m✓[39m tests/storage-provision.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
425
|
+
[32m✓[39m tests/cached-artifact-format.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 7[2mms[22m[39m
|
|
426
|
+
[32m✓[39m tests/readiness-poll.test.ts [2m([22m[2m3 tests[22m[2m)[22m[33m 320[2mms[22m[39m
|
|
427
|
+
[33m[2m✓[22m[39m ends promptly when it carries a deadline [33m 317[2mms[22m[39m
|
|
428
|
+
[32m✓[39m tests/target-client-refresh.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
429
|
+
[32m✓[39m tests/proxy-dev-app.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
425
430
|
[90mstdout[2m | tests/app-command.test.ts[2m > [22m[2msupatype app add --static[2m > [22m[2msets app.mode=static and static_dir in supatype.config.ts
|
|
426
431
|
[22m[39m created package.json
|
|
427
432
|
created supatype.config.ts
|
|
@@ -442,77 +447,80 @@
|
|
|
442
447
|
created public/.gitkeep
|
|
443
448
|
created .gitignore
|
|
444
449
|
|
|
445
|
-
[32m✓[39m tests/service-role-routes.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m
|
|
446
|
-
[33m[2m✓[22m[39m reads the declared list [33m
|
|
447
|
-
[33m[2m✓[22m[39m is an empty list when a project declares none [33m
|
|
448
|
-
[33m[2m✓[22m[39m sends what the project declared, hook entries included [33m
|
|
449
|
-
[32m✓[39m tests/
|
|
450
|
-
|
|
451
|
-
[33m[2m✓[22m[39m
|
|
452
|
-
|
|
453
|
-
[32m✓[39m tests/
|
|
450
|
+
[32m✓[39m tests/service-role-routes.test.ts [2m([22m[2m4 tests[22m[2m)[22m[33m 1404[2mms[22m[39m
|
|
451
|
+
[33m[2m✓[22m[39m reads the declared list [33m 465[2mms[22m[39m
|
|
452
|
+
[33m[2m✓[22m[39m is an empty list when a project declares none [33m 458[2mms[22m[39m
|
|
453
|
+
[33m[2m✓[22m[39m sends what the project declared, hook entries included [33m 479[2mms[22m[39m
|
|
454
|
+
[32m✓[39m tests/app-command.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 2281[2mms[22m[39m
|
|
455
|
+
[33m[2m✓[22m[39m sets app.mode=static and static_dir in supatype.config.ts [33m 1088[2mms[22m[39m
|
|
456
|
+
[33m[2m✓[22m[39m creates the static directory when missing [33m 1191[2mms[22m[39m
|
|
457
|
+
[32m✓[39m tests/init-dependency-versions.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 28[2mms[22m[39m
|
|
458
|
+
[32m✓[39m tests/compose-parsable-defaults.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
459
|
+
[32m✓[39m tests/type-resolver.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 13[2mms[22m[39m
|
|
454
460
|
[32m✓[39m tests/engine-push-output.test.ts [2m([22m[2m7 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
455
|
-
[32m✓[39m tests/
|
|
456
|
-
|
|
457
|
-
[33m[2m✓[22m[39m --
|
|
458
|
-
[33m[2m✓[22m[39m --
|
|
459
|
-
[33m[2m✓[22m[39m
|
|
460
|
-
[33m[2m✓[22m[39m
|
|
461
|
-
[33m[2m✓[22m[39m
|
|
462
|
-
[33m[2m✓[22m[39m
|
|
463
|
-
[33m[2m✓[22m[39m
|
|
464
|
-
[33m[2m✓[22m[39m
|
|
465
|
-
[33m[2m✓[22m[39m
|
|
466
|
-
[33m[2m✓[22m[39m
|
|
467
|
-
[33m[2m✓[22m[39m
|
|
468
|
-
[33m[2m✓[22m[39m app --help
|
|
469
|
-
[33m[2m✓[22m[39m
|
|
470
|
-
[33m[2m✓[22m[39m self-host --help shows compose
|
|
471
|
-
[33m[2m✓[22m[39m
|
|
472
|
-
|
|
473
|
-
[32m✓[39m tests/cli-install-method.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m
|
|
474
|
-
[32m✓[39m tests/
|
|
475
|
-
[32m✓[39m tests/
|
|
476
|
-
[32m✓[39m tests/
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
[33m[2m✓[22m[39m
|
|
481
|
-
[33m[2m✓[22m[39m
|
|
482
|
-
[33m[2m✓[22m[39m
|
|
483
|
-
[33m[2m✓[22m[39m
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
[32m✓[39m tests/
|
|
488
|
-
[32m✓[39m tests/
|
|
489
|
-
[32m✓[39m tests/
|
|
490
|
-
[32m✓[39m tests/ui-
|
|
461
|
+
[32m✓[39m tests/cli-help.test.ts [2m([22m[2m16 tests[22m[2m)[22m[33m 17072[2mms[22m[39m
|
|
462
|
+
[33m[2m✓[22m[39m --help lists all top-level commands [33m 1059[2mms[22m[39m
|
|
463
|
+
[33m[2m✓[22m[39m --version prints package.json version [33m 1058[2mms[22m[39m
|
|
464
|
+
[33m[2m✓[22m[39m self-update --help describes the command [33m 975[2mms[22m[39m
|
|
465
|
+
[33m[2m✓[22m[39m init --help describes the init command [33m 1062[2mms[22m[39m
|
|
466
|
+
[33m[2m✓[22m[39m push --help describes the push command and --yes flag [33m 1091[2mms[22m[39m
|
|
467
|
+
[33m[2m✓[22m[39m diff --help describes the diff command [33m 1054[2mms[22m[39m
|
|
468
|
+
[33m[2m✓[22m[39m pull --help describes scaffold pull command [33m 1091[2mms[22m[39m
|
|
469
|
+
[33m[2m✓[22m[39m doctor --help describes drift report command [33m 1142[2mms[22m[39m
|
|
470
|
+
[33m[2m✓[22m[39m introspect --help describes database introspection command [33m 1060[2mms[22m[39m
|
|
471
|
+
[33m[2m✓[22m[39m adopt --help describes adoption ceremony command [33m 1025[2mms[22m[39m
|
|
472
|
+
[33m[2m✓[22m[39m reset --help shows --yes flag [33m 987[2mms[22m[39m
|
|
473
|
+
[33m[2m✓[22m[39m app --help describes the app command with add/remove subcommands [33m 1006[2mms[22m[39m
|
|
474
|
+
[33m[2m✓[22m[39m app add --help shows --static and --port options [33m 1046[2mms[22m[39m
|
|
475
|
+
[33m[2m✓[22m[39m self-host --help shows compose only (legacy commands hidden) [33m 1161[2mms[22m[39m
|
|
476
|
+
[33m[2m✓[22m[39m self-host compose --help shows compose subcommands [33m 1139[2mms[22m[39m
|
|
477
|
+
[33m[2m✓[22m[39m unknown command exits non-zero [33m 1108[2mms[22m[39m
|
|
478
|
+
[32m✓[39m tests/command-chrome-wrap.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
479
|
+
[32m✓[39m tests/cli-install-method.test.ts [2m([22m[2m8 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
480
|
+
[32m✓[39m tests/doctor-render.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
481
|
+
[32m✓[39m tests/port-in-use.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 26[2mms[22m[39m
|
|
482
|
+
[32m✓[39m tests/archive-name-alias.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
483
|
+
[32m✓[39m tests/ensure-binary.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 8[2mms[22m[39m
|
|
484
|
+
[32m✓[39m tests/init-project-detect.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 9[2mms[22m[39m
|
|
485
|
+
[32m✓[39m tests/tsx-runner.test.ts [2m([22m[2m7 tests[22m[2m)[22m[33m 2520[2mms[22m[39m
|
|
486
|
+
[33m[2m✓[22m[39m evaluates a simple expression and returns stdout [33m 329[2mms[22m[39m
|
|
487
|
+
[33m[2m✓[22m[39m evaluates TypeScript syntax (type annotations) [33m 343[2mms[22m[39m
|
|
488
|
+
[33m[2m✓[22m[39m can serialize a JSON object to stdout [33m 339[2mms[22m[39m
|
|
489
|
+
[33m[2m✓[22m[39m returns non-zero exit code on syntax error [33m 350[2mms[22m[39m
|
|
490
|
+
[33m[2m✓[22m[39m returns non-zero exit code on runtime error [33m 360[2mms[22m[39m
|
|
491
|
+
[33m[2m✓[22m[39m captures stderr separately from stdout [33m 344[2mms[22m[39m
|
|
492
|
+
[33m[2m✓[22m[39m runs a .ts file and returns its stdout [33m 448[2mms[22m[39m
|
|
493
|
+
[32m✓[39m tests/doctor-service-role.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
494
|
+
[32m✓[39m tests/required-host-components.test.ts [2m([22m[2m4 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
495
|
+
[32m✓[39m tests/dev-ports-owner.test.ts [2m([22m[2m6 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
496
|
+
[32m✓[39m tests/ui-messages.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
497
|
+
[32m✓[39m tests/normalize-admin-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
498
|
+
[32m✓[39m tests/ui-confirm.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 6[2mms[22m[39m
|
|
491
499
|
[32m✓[39m tests/docker-postgres.test.ts [2m([22m[2m5 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
492
|
-
[32m✓[39m tests/binary-download-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
493
|
-
[32m✓[39m tests/dev-session-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m
|
|
494
|
-
[32m✓[39m tests/dev-ports.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m
|
|
495
|
-
[32m✓[39m tests/
|
|
496
|
-
|
|
500
|
+
[32m✓[39m tests/binary-download-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
501
|
+
[32m✓[39m tests/dev-session-lock.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
502
|
+
[32m✓[39m tests/dev-ports.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
503
|
+
[32m✓[39m tests/config-load-failure.test.ts [2m([22m[2m2 tests[22m[2m)[22m[33m 2836[2mms[22m[39m
|
|
504
|
+
[33m[2m✓[22m[39m is reported, rather than treated as absent [33m 1611[2mms[22m[39m
|
|
505
|
+
[33m[2m✓[22m[39m does not stop the CLI working with no config at all [33m 1223[2mms[22m[39m
|
|
506
|
+
[32m✓[39m tests/route-manifest.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
507
|
+
[32m✓[39m tests/dev-ready-panel.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
497
508
|
[32m✓[39m tests/studio-admin-roles.test.ts [2m([22m[2m3 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
498
|
-
[32m✓[39m tests/
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
[32m✓[39m tests/
|
|
502
|
-
[32m✓[39m tests/
|
|
503
|
-
[32m✓[39m tests/
|
|
504
|
-
[32m✓[39m tests/
|
|
505
|
-
[32m✓[39m tests/rest-cache-admin.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 30[2mms[22m[39m
|
|
506
|
-
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
509
|
+
[32m✓[39m tests/release-pins.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
510
|
+
[32m✓[39m tests/realtime-launch.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
511
|
+
[32m✓[39m tests/ensure-dev-api-config.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
512
|
+
[32m✓[39m tests/seed-discover.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 10[2mms[22m[39m
|
|
513
|
+
[32m✓[39m tests/rest-cache-admin.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 40[2mms[22m[39m
|
|
514
|
+
[32m✓[39m tests/init-package-json.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
515
|
+
[32m✓[39m tests/resolve-api-url.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 5[2mms[22m[39m
|
|
507
516
|
[32m✓[39m tests/pg-spawn-env.test.ts [2m([22m[2m2 tests[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
508
|
-
[32m✓[39m tests/
|
|
509
|
-
[32m✓[39m tests/
|
|
510
|
-
[32m✓[39m tests/cli-package-version.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 4[2mms[22m[39m
|
|
517
|
+
[32m✓[39m tests/migrate-from-v1.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 12[2mms[22m[39m
|
|
518
|
+
[32m✓[39m tests/cli-package-version.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 3[2mms[22m[39m
|
|
511
519
|
[32m✓[39m tests/postgres-archive-tag.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
512
|
-
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m
|
|
520
|
+
[32m✓[39m tests/stdin-after-ink.test.ts [2m([22m[2m1 test[22m[2m)[22m[32m 2[2mms[22m[39m
|
|
513
521
|
|
|
514
|
-
[2m Test Files [22m [1m[
|
|
515
|
-
[2m Tests [22m [1m[
|
|
516
|
-
[2m Start at [22m
|
|
517
|
-
[2m Duration [22m
|
|
522
|
+
[2m Test Files [22m [1m[32m84 passed[39m[22m[90m (84)[39m
|
|
523
|
+
[2m Tests [22m [1m[32m812 passed[39m[22m[90m (812)[39m
|
|
524
|
+
[2m Start at [22m 07:11:48
|
|
525
|
+
[2m Duration [22m 35.25s[2m (transform 4.64s, setup 0ms, import 33.01s, tests 60.32s, environment 10ms)[22m
|
|
518
526
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-version-embedded.d.ts","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,oBAAoB,EAAE,
|
|
1
|
+
{"version":3,"file":"cli-version-embedded.d.ts","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAIH,eAAO,MAAM,oBAAoB,EAAE,MAAgB,CAAA"}
|
|
@@ -9,5 +9,5 @@
|
|
|
9
9
|
// Annotated `string`, not left to inference: once a release stamps a value here, the
|
|
10
10
|
// inferred literal type makes the `!== ""` test in cliPackageVersion() a compile error
|
|
11
11
|
// (TS2367, no overlap), so the build would only fail during a release.
|
|
12
|
-
export const EMBEDDED_CLI_VERSION = "0.
|
|
12
|
+
export const EMBEDDED_CLI_VERSION = "0.2.0";
|
|
13
13
|
//# sourceMappingURL=cli-version-embedded.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli-version-embedded.js","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qFAAqF;AACrF,uFAAuF;AACvF,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAW,
|
|
1
|
+
{"version":3,"file":"cli-version-embedded.js","sourceRoot":"","sources":["../src/cli-version-embedded.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,qFAAqF;AACrF,uFAAuF;AACvF,uEAAuE;AACvE,MAAM,CAAC,MAAM,oBAAoB,GAAW,OAAO,CAAA"}
|
package/dist/commands/admin.d.ts
CHANGED
|
@@ -12,13 +12,13 @@ export declare const ADMIN_PASSWORD_ENV = "SUPATYPE_ADMIN_PASSWORD";
|
|
|
12
12
|
* is locked out of the very panel they were made for.
|
|
13
13
|
*/
|
|
14
14
|
export declare const STUDIO_ROLES: readonly ["admin", "developer", "editor"];
|
|
15
|
-
/**
|
|
16
|
-
export declare const
|
|
17
|
-
/** Audience claim used
|
|
18
|
-
export declare function
|
|
15
|
+
/** The auth service scopes users to the nil instance id in single-tenant/self-host mode. */
|
|
16
|
+
export declare const SUPATYPE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
|
|
17
|
+
/** Audience claim used when looking up users (matches SUPATYPE_JWT_AUD in compose). */
|
|
18
|
+
export declare function authJwtAud(cwd: string): string;
|
|
19
19
|
type DbQuery = (sql: string, params?: unknown[]) => Promise<QueryResult>;
|
|
20
20
|
type AuthConfirmedColumn = "email_confirmed_at" | "confirmed_at";
|
|
21
|
-
/** Prefer
|
|
21
|
+
/** Prefer the migrated column when present; fall back to postgres init `confirmed_at`. */
|
|
22
22
|
export declare function resolveAuthConfirmedAtColumn(query: DbQuery): Promise<AuthConfirmedColumn>;
|
|
23
23
|
export interface EnsureFirstAdminOptions {
|
|
24
24
|
email?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/commands/admin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,KAAK,EAAQ,WAAW,EAAE,MAAM,IAAI,CAAA;AAE3C,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AAa7B,eAAO,MAAM,eAAe,yBAAyB,CAAA;AACrD,eAAO,MAAM,kBAAkB,4BAA4B,CAAA;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,2CAA4C,CAAA;AAYrE,
|
|
1
|
+
{"version":3,"file":"admin.d.ts","sourceRoot":"","sources":["../../src/commands/admin.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,WAAW,CAAA;AAKxC,OAAO,KAAK,EAAQ,WAAW,EAAE,MAAM,IAAI,CAAA;AAE3C,OAAO,EAGL,KAAK,qBAAqB,EAC3B,MAAM,sBAAsB,CAAA;AAa7B,eAAO,MAAM,eAAe,yBAAyB,CAAA;AACrD,eAAO,MAAM,kBAAkB,4BAA4B,CAAA;AAI3D;;;;;;;GAOG;AACH,eAAO,MAAM,YAAY,2CAA4C,CAAA;AAYrE,4FAA4F;AAC5F,eAAO,MAAM,wBAAwB,yCAAyC,CAAA;AAE9E,uFAAuF;AACvF,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE9C;AAED,KAAK,OAAO,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,EAAE,KAAK,OAAO,CAAC,WAAW,CAAC,CAAA;AACxE,KAAK,mBAAmB,GAAG,oBAAoB,GAAG,cAAc,CAAA;AAEhE,0FAA0F;AAC1F,wBAAsB,4BAA4B,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAAC,mBAAmB,CAAC,CAc/F;AAED,MAAM,WAAW,uBAAuB;IACtC,KAAK,CAAC,EAAE,MAAM,CAAA;IACd,QAAQ,CAAC,EAAE,MAAM,CAAA;IACjB,GAAG,CAAC,EAAE,MAAM,CAAA;IACZ,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,OAAO,CAAC,EAAE;QAAE,OAAO,EAAE,MAAM,CAAC;QAAC,WAAW,EAAE,MAAM,CAAA;KAAE,CAAA;CACnD;AAYD,wBAAgB,aAAa,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CA4LpD;AAED,2CAA2C;AAC3C,eAAO,MAAM,oBAAoB,6BAAuB,CAAA;AAExD;;;GAGG;AACH,wBAAsB,oBAAoB,CACxC,UAAU,EAAE,MAAM,EAClB,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CAaf;AAED;;;GAGG;AACH,wBAAsB,8BAA8B,CAClD,GAAG,EAAE,MAAM,EACX,MAAM,EAAE,qBAAqB,EAC7B,OAAO,GAAE,uBAA4B,GACpC,OAAO,CAAC,IAAI,CAAC,CA2Bf;AAED,6EAA6E;AAC7E,wBAAsB,yBAAyB,CAC7C,KAAK,EAAE,OAAO,EACd,OAAO,EAAE,uBAAuB,GAC/B,OAAO,CAAC,IAAI,CAAC,CA8Bf;AAwDD,wBAAgB,sBAAsB,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,CAIxD;AAED,wBAAsB,mBAAmB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAE3E;AAqMD,mFAAmF;AACnF,wBAAgB,uBAAuB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAE3D"}
|
package/dist/commands/admin.js
CHANGED
|
@@ -37,13 +37,13 @@ function assertStudioRole(role) {
|
|
|
37
37
|
"and belong in your access rules.");
|
|
38
38
|
process.exit(1);
|
|
39
39
|
}
|
|
40
|
-
/**
|
|
41
|
-
export const
|
|
42
|
-
/** Audience claim used
|
|
43
|
-
export function
|
|
44
|
-
return readEnvValue(cwd, "
|
|
40
|
+
/** The auth service scopes users to the nil instance id in single-tenant/self-host mode. */
|
|
41
|
+
export const SUPATYPE_NIL_INSTANCE_ID = "00000000-0000-0000-0000-000000000000";
|
|
42
|
+
/** Audience claim used when looking up users (matches SUPATYPE_JWT_AUD in compose). */
|
|
43
|
+
export function authJwtAud(cwd) {
|
|
44
|
+
return readEnvValue(cwd, "SUPATYPE_JWT_AUD", "authenticated");
|
|
45
45
|
}
|
|
46
|
-
/** Prefer
|
|
46
|
+
/** Prefer the migrated column when present; fall back to postgres init `confirmed_at`. */
|
|
47
47
|
export async function resolveAuthConfirmedAtColumn(query) {
|
|
48
48
|
const result = await query(`SELECT column_name
|
|
49
49
|
FROM information_schema.columns
|
|
@@ -339,12 +339,12 @@ async function createAdminUser(db, email, password, role, opts = {}) {
|
|
|
339
339
|
? (sql, params) => db.query(sql, params)
|
|
340
340
|
: db;
|
|
341
341
|
const normalized = email.toLowerCase();
|
|
342
|
-
const aud = opts.aud ?? (opts.cwd ?
|
|
342
|
+
const aud = opts.aud ?? (opts.cwd ? authJwtAud(opts.cwd) : "authenticated");
|
|
343
343
|
const existing = await query(`SELECT id FROM auth.users
|
|
344
344
|
WHERE instance_id = $1::uuid
|
|
345
345
|
AND LOWER(email) = $2
|
|
346
346
|
AND aud = $3
|
|
347
|
-
AND is_sso_user = false`, [
|
|
347
|
+
AND is_sso_user = false`, [SUPATYPE_NIL_INSTANCE_ID, normalized, aud]);
|
|
348
348
|
if (existing.rows.length > 0) {
|
|
349
349
|
throw new Error(`User with email "${email}" already exists.`);
|
|
350
350
|
}
|
|
@@ -375,7 +375,7 @@ async function createAdminUser(db, email, password, role, opts = {}) {
|
|
|
375
375
|
'', '', '', '', '', '', '', '',
|
|
376
376
|
false, false,
|
|
377
377
|
now(), now()
|
|
378
|
-
) RETURNING id, email`, [
|
|
378
|
+
) RETURNING id, email`, [SUPATYPE_NIL_INSTANCE_ID, aud, normalized, passwordHash, appMetadata, userMetadata]);
|
|
379
379
|
const user = result.rows[0];
|
|
380
380
|
await recordStudioMembership(query, user.id, role);
|
|
381
381
|
if (!opts.quiet) {
|
|
@@ -454,7 +454,7 @@ async function hasAdminUsers(query) {
|
|
|
454
454
|
if (!(await studioMembersTableExists(query)))
|
|
455
455
|
return false;
|
|
456
456
|
// Inner JOIN on purpose, unlike `list-users`: a membership held by a cloud
|
|
457
|
-
// account cannot log in to a self-hosted
|
|
457
|
+
// account cannot log in to a self-hosted auth service, so a project exported from
|
|
458
458
|
// cloud with only those grants genuinely still needs a first admin.
|
|
459
459
|
const adminCount = await query(`SELECT COUNT(*)::int as count
|
|
460
460
|
FROM _supatype.studio_members m
|