@rebasepro/cli 0.30.0 → 0.31.0-canary.g59cd6fd
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 +8 -7
- package/dist/{agent-setup-0uyfC7VX.js → agent-setup-DqAcoDcn.js} +10 -5
- package/dist/{agent-setup-0uyfC7VX.js.map → agent-setup-DqAcoDcn.js.map} +1 -1
- package/dist/{api-keys-Dfw5-9s1.js → api-keys-eIUjMqWn.js} +8 -7
- package/dist/api-keys-eIUjMqWn.js.map +1 -0
- package/dist/{apps-MKQbgDtN.js → apps-DExO4PEl.js} +8 -7
- package/dist/apps-DExO4PEl.js.map +1 -0
- package/dist/{project-CasK56vN.js → args-CaCcrYE1.js} +2 -351
- package/dist/args-CaCcrYE1.js.map +1 -0
- package/dist/{atlas-dev-database-BODqdCWt.js → atlas-dev-database-DOCKk6ht.js} +2 -2
- package/dist/{atlas-dev-database-BODqdCWt.js.map → atlas-dev-database-DOCKk6ht.js.map} +1 -1
- package/dist/{auth-Bv0rTbQX.js → auth-D96QYgFR.js} +7 -6
- package/dist/{auth-Bv0rTbQX.js.map → auth-D96QYgFR.js.map} +1 -1
- package/dist/backend-guard-C0mVkXBw.js +162 -0
- package/dist/backend-guard-C0mVkXBw.js.map +1 -0
- package/dist/{branch-pointer-BQUF6lYa.js → branch-pointer-DMPyvZoK.js} +1 -1
- package/dist/{build-BuKTnec8.js → build-CA5R07tw.js} +29 -9
- package/dist/build-CA5R07tw.js.map +1 -0
- package/dist/{bundle-BAH4FCju.js → bundle-DgILeA5b.js} +112 -138
- package/dist/bundle-DgILeA5b.js.map +1 -0
- package/dist/bundle.d.ts +35 -12
- package/dist/cli.d.ts +2 -2
- package/dist/{cloud-Cj5ey3l_.js → cloud-CYMk92iG.js} +217 -104
- package/dist/cloud-CYMk92iG.js.map +1 -0
- package/dist/cms-directories-BK3vcswg.js +33 -0
- package/dist/cms-directories-BK3vcswg.js.map +1 -0
- package/dist/codemod/collections-to-tables/ast.d.ts +135 -0
- package/dist/codemod/collections-to-tables/backend.d.ts +38 -0
- package/dist/codemod/collections-to-tables/command.d.ts +35 -0
- package/dist/codemod/collections-to-tables/comments.d.ts +45 -0
- package/dist/codemod/collections-to-tables/customization.d.ts +47 -0
- package/dist/codemod/collections-to-tables/dynamic-props.d.ts +34 -0
- package/dist/codemod/collections-to-tables/export-changes.d.ts +83 -0
- package/dist/codemod/collections-to-tables/firestore.d.ts +11 -0
- package/dist/codemod/collections-to-tables/helper-hooks.d.ts +41 -0
- package/dist/codemod/collections-to-tables/hooks.d.ts +44 -0
- package/dist/codemod/collections-to-tables/journal.d.ts +10 -0
- package/dist/codemod/collections-to-tables/legacy-shims.d.ts +52 -0
- package/dist/codemod/collections-to-tables/load-legacy.d.ts +81 -0
- package/dist/codemod/collections-to-tables/migrate.d.ts +20 -0
- package/dist/codemod/collections-to-tables/modules.d.ts +127 -0
- package/dist/codemod/collections-to-tables/moved-imports.d.ts +70 -0
- package/dist/codemod/collections-to-tables/moved-symbols.generated.d.ts +12 -0
- package/dist/codemod/collections-to-tables/own.d.ts +10 -0
- package/dist/codemod/collections-to-tables/path-aliases.d.ts +26 -0
- package/dist/codemod/collections-to-tables/plan-context.d.ts +49 -0
- package/dist/codemod/collections-to-tables/print-js.d.ts +44 -0
- package/dist/codemod/collections-to-tables/project-files.d.ts +144 -0
- package/dist/codemod/collections-to-tables/repoint.d.ts +50 -0
- package/dist/codemod/collections-to-tables/row-hands.d.ts +7 -0
- package/dist/codemod/collections-to-tables/sdk-calls.d.ts +88 -0
- package/dist/codemod/collections-to-tables/skills-step.d.ts +13 -0
- package/dist/codemod/collections-to-tables/split-constants.d.ts +42 -0
- package/dist/codemod/collections-to-tables/storage-paths.d.ts +28 -0
- package/dist/codemod/collections-to-tables/types.d.ts +164 -0
- package/dist/codemod/collections-to-tables/verify.d.ts +27 -0
- package/dist/codemod/collections-to-tables/vocabulary.d.ts +40 -0
- package/dist/command-D5lhW_-B.js +9984 -0
- package/dist/command-D5lhW_-B.js.map +1 -0
- package/dist/commands/agent-setup.d.ts +6 -2
- package/dist/commands/cloud/auth.d.ts +2 -0
- package/dist/commands/cloud/context.d.ts +1 -1
- package/dist/commands/cloud/init.d.ts +2 -2
- package/dist/commands/cloud/login-flow.d.ts +30 -1
- package/dist/commands/console.d.ts +1 -2
- package/dist/commands/db.d.ts +5 -6
- package/dist/commands/dev.d.ts +18 -17
- package/dist/commands/doctor.d.ts +4 -5
- package/dist/commands/eject.d.ts +17 -13
- package/dist/commands/generate-view.d.ts +20 -9
- package/dist/commands/generate_sdk.d.ts +27 -27
- package/dist/commands/init.d.ts +21 -8
- package/dist/commands/migrate.d.ts +24 -0
- package/dist/commands/schema-reconcile.d.ts +1 -1
- package/dist/commands/skills.d.ts +8 -0
- package/dist/commands/verify-cms.d.ts +28 -0
- package/dist/commands/verify.d.ts +14 -9
- package/dist/{consent-BD7F29T3.js → consent-BXLIrMl8.js} +2 -2
- package/dist/{consent-BD7F29T3.js.map → consent-BXLIrMl8.js.map} +1 -1
- package/dist/{console-CdwIYOMV.js → console-C1d3LwB7.js} +14 -14
- package/dist/console-C1d3LwB7.js.map +1 -0
- package/dist/{context-AXdAh-q8.js → context--JwaHaZp.js} +6 -5
- package/dist/context--JwaHaZp.js.map +1 -0
- package/dist/{daemon-Cp7oNXth.js → daemon-w30PsdwV.js} +2 -2
- package/dist/{daemon-Cp7oNXth.js.map → daemon-w30PsdwV.js.map} +1 -1
- package/dist/{db-DBbKpjYX.js → db-DQZK9n9c.js} +52 -51
- package/dist/db-DQZK9n9c.js.map +1 -0
- package/dist/{derive-ae9UOoOB.js → derive-C3ezmY-p.js} +105 -133
- package/dist/derive-C3ezmY-p.js.map +1 -0
- package/dist/{dev-C93d4QIv.js → dev-PY5h4O6u.js} +142 -84
- package/dist/dev-PY5h4O6u.js.map +1 -0
- package/dist/dev-db/attver.d.ts +32 -0
- package/dist/dev-db/pull.d.ts +15 -1
- package/dist/{dev-preflight-Cxv3TiD1.js → dev-preflight-DjvcV6SK.js} +5 -5
- package/dist/dev-preflight-DjvcV6SK.js.map +1 -0
- package/dist/{dev-server-OJsUGZEB.js → dev-server-BLxCbQEP.js} +2 -2
- package/dist/{dev-server-OJsUGZEB.js.map → dev-server-BLxCbQEP.js.map} +1 -1
- package/dist/{doctor-BBPQUO2g.js → doctor-CnUu8kpM.js} +39 -62
- package/dist/doctor-CnUu8kpM.js.map +1 -0
- package/dist/doctor-environment.d.ts +6 -6
- package/dist/{eject-DABcDnPN.js → eject-Bhzd6hgb.js} +25 -16
- package/dist/eject-Bhzd6hgb.js.map +1 -0
- package/dist/{fold-static-BWzxNn06.js → fold-static-CKewnAPX.js} +5 -3
- package/dist/fold-static-CKewnAPX.js.map +1 -0
- package/dist/{generate-view-IFwCADvb.js → generate-view-CTOluXvH.js} +160 -89
- package/dist/generate-view-CTOluXvH.js.map +1 -0
- package/dist/{generate_sdk-DNmNuFuW.js → generate_sdk-De-aLC1L.js} +120 -137
- package/dist/generate_sdk-De-aLC1L.js.map +1 -0
- package/dist/import-schema-module-Df67TIWj.js +51 -0
- package/dist/import-schema-module-Df67TIWj.js.map +1 -0
- package/dist/index.es.js +64 -51
- package/dist/index.es.js.map +1 -1
- package/dist/{init-vL1DWOeC.js → init-Dtl-IcXf.js} +83 -80
- package/dist/init-Dtl-IcXf.js.map +1 -0
- package/dist/last-dev-database-Dc8cP01o.js +2 -0
- package/dist/{manifest-BtzDy7KQ.js → manifest-C3uLDrrJ.js} +115 -40
- package/dist/manifest-C3uLDrrJ.js.map +1 -0
- package/dist/manifest.d.ts +79 -24
- package/dist/migrate-VrKoi3nB.js +138 -0
- package/dist/migrate-VrKoi3nB.js.map +1 -0
- package/dist/{normalize-imports-Bd5Y4yLp.js → normalize-imports-DwxqEMYq.js} +3 -3
- package/dist/{normalize-imports-Bd5Y4yLp.js.map → normalize-imports-DwxqEMYq.js.map} +1 -1
- package/dist/path-flags-7O5uPBcQ.js +139 -0
- package/dist/path-flags-7O5uPBcQ.js.map +1 -0
- package/dist/{prepare-CTw9NEkh.js → prepare-Ccxspoj-.js} +4 -4
- package/dist/{prepare-CTw9NEkh.js.map → prepare-Ccxspoj-.js.map} +1 -1
- package/dist/project-CLcF5i8c.js +360 -0
- package/dist/project-CLcF5i8c.js.map +1 -0
- package/dist/project-schema-CsSOG2gE.js +30 -0
- package/dist/project-schema-CsSOG2gE.js.map +1 -0
- package/dist/{pull-DDMpsZ5r.js → pull-DRWqBZp5.js} +327 -4
- package/dist/pull-DRWqBZp5.js.map +1 -0
- package/dist/resolve-BY7bSFRT.js +2 -0
- package/dist/resources/derive.d.ts +19 -13
- package/dist/{resources-CPSC5Kcu.js → resources-Dpfs2y8P.js} +5 -4
- package/dist/{resources-CPSC5Kcu.js.map → resources-Dpfs2y8P.js.map} +1 -1
- package/dist/{schema-DtLPsXbT.js → schema-CdDjv5zI.js} +41 -39
- package/dist/schema-CdDjv5zI.js.map +1 -0
- package/dist/schema-dir-Cd1kvYbf.js +98 -0
- package/dist/schema-dir-Cd1kvYbf.js.map +1 -0
- package/dist/schema-reconcile-BAupXfkd.js +2 -0
- package/dist/schema-text-CpNrsuMe.js +73 -0
- package/dist/schema-text-CpNrsuMe.js.map +1 -0
- package/dist/{skills-CbwV6vw_.js → skills-CXjA9TWw.js} +54 -10
- package/dist/skills-CXjA9TWw.js.map +1 -0
- package/dist/{start-YOr3X5Zm.js → start-Bwbtt2W5.js} +7 -10
- package/dist/{start-YOr3X5Zm.js.map → start-Bwbtt2W5.js.map} +1 -1
- package/dist/{status-BREvtzJm.js → status-D7XCGHu2.js} +12 -12
- package/dist/status-D7XCGHu2.js.map +1 -0
- package/dist/{storage-CO9ouK76.js → storage-iTqj5-Av.js} +12 -11
- package/dist/storage-iTqj5-Av.js.map +1 -0
- package/dist/{telemetry-DwK5RQJl.js → telemetry-BP_1Cl9r.js} +4 -4
- package/dist/{telemetry-DwK5RQJl.js.map → telemetry-BP_1Cl9r.js.map} +1 -1
- package/dist/{telemetry-CgwJPVMO.js → telemetry-M3HjlyhZ.js} +2 -2
- package/dist/{telemetry-CgwJPVMO.js.map → telemetry-M3HjlyhZ.js.map} +1 -1
- package/dist/{upgrade-B7sVwL8S.js → upgrade-oZzJ13jM.js} +5 -4
- package/dist/{upgrade-B7sVwL8S.js.map → upgrade-oZzJ13jM.js.map} +1 -1
- package/dist/utils/backend-guard.d.ts +47 -0
- package/dist/utils/cms-directories.d.ts +6 -0
- package/dist/utils/dev-preflight.d.ts +2 -2
- package/dist/utils/import-schema-module.d.ts +16 -0
- package/dist/utils/path-flags.d.ts +35 -16
- package/dist/utils/project-schema.d.ts +40 -0
- package/dist/utils/project.d.ts +8 -2
- package/dist/utils/schema-dir.d.ts +32 -0
- package/dist/utils/schema-drift.d.ts +6 -0
- package/dist/utils/schema-text.d.ts +24 -0
- package/dist/verify-5p_vaUG2.js +1160 -0
- package/dist/verify-5p_vaUG2.js.map +1 -0
- package/package.json +11 -8
- package/runtime/dev-server.mjs +5 -1
- package/templates/eject/Dockerfile +1 -4
- package/templates/eject/backend/src/env.ts +1 -1
- package/templates/eject/backend/src/index.ts +53 -40
- package/templates/eject/docker-compose.custom.yml +1 -1
- package/templates/overlays/baas/README.md +39 -12
- package/templates/overlays/baas/ai-instructions.md +8 -8
- package/templates/overlays/baas/{config → backend}/storage.ts +3 -4
- package/templates/overlays/baas/backend/tsconfig.json +10 -12
- package/templates/overlays/baas/package.json +1 -2
- package/templates/overlays/baas/pnpm-workspace.yaml +0 -1
- package/templates/presets/blank/backend/schema/index.ts +19 -0
- package/templates/presets/blank/frontend/src/App.tsx +56 -0
- package/templates/presets/ecommerce/backend/schema/categories.ts +12 -0
- package/templates/presets/ecommerce/backend/schema/index.ts +23 -0
- package/templates/presets/ecommerce/backend/schema/orders.ts +13 -0
- package/templates/presets/ecommerce/backend/schema/products.ts +18 -0
- package/templates/presets/ecommerce/frontend/src/App.tsx +59 -0
- package/templates/presets/ecommerce/frontend/src/cms/categories.tsx +12 -0
- package/templates/presets/ecommerce/frontend/src/cms/orders.tsx +38 -0
- package/templates/presets/ecommerce/frontend/src/cms/products.tsx +27 -0
- package/templates/resource-graphs/blank.json +2 -2
- package/templates/resource-graphs/blog.json +5 -5
- package/templates/resource-graphs/ecommerce.json +5 -5
- package/templates/resource-graphs/headless.json +1 -1
- package/templates/template/.claude/hooks/post-edit-collection.sh +27 -23
- package/templates/template/.cursorrules +2 -2
- package/templates/template/.env.example +6 -17
- package/templates/template/.github/copilot-instructions.md +2 -2
- package/templates/template/.windsurfrules +2 -2
- package/templates/template/AGENTS.md +2 -2
- package/templates/template/CLAUDE.md +2 -2
- package/templates/template/README.md +47 -13
- package/templates/template/ai-instructions.md +15 -14
- package/templates/template/backend/functions/hello.ts +1 -1
- package/templates/template/backend/package.json +0 -2
- package/templates/template/{config → backend}/resources.ts +3 -3
- package/templates/template/backend/schema/authors.ts +11 -0
- package/templates/template/backend/schema/index.ts +29 -0
- package/templates/template/backend/schema/posts.ts +29 -0
- package/templates/template/backend/schema/tags.ts +9 -0
- package/templates/template/backend/schema/users.ts +32 -0
- package/templates/template/{config → backend}/storage.ts +4 -4
- package/templates/template/backend/tsconfig.json +15 -20
- package/templates/template/docker-compose.yml +3 -3
- package/templates/template/frontend/package.json +0 -2
- package/templates/template/frontend/src/App.tsx +10 -4
- package/templates/template/frontend/src/cms/authors.tsx +7 -0
- package/templates/template/frontend/src/cms/posts.tsx +27 -0
- package/templates/template/frontend/src/cms/tags.tsx +11 -0
- package/templates/template/frontend/src/cms/ui-config.json +3 -0
- package/templates/template/frontend/src/cms/users.tsx +54 -0
- package/templates/template/frontend/src/{virtual.d.ts → vite-env.d.ts} +0 -4
- package/templates/template/frontend/vite.config.ts +6 -2
- package/templates/template/gitignore +1 -1
- package/templates/template/package.json +1 -2
- package/templates/template/pnpm-workspace.yaml +0 -1
- package/templates/template/scripts/example.ts +3 -3
- package/templates/template/tsconfig.json +1 -1
- package/templates/views/AppView.tsx.tmpl +4 -4
- package/templates/views/EntityView.tsx.tmpl +3 -4
- package/dist/api-keys-Dfw5-9s1.js.map +0 -1
- package/dist/apps-MKQbgDtN.js.map +0 -1
- package/dist/build-BuKTnec8.js.map +0 -1
- package/dist/bundle-BAH4FCju.js.map +0 -1
- package/dist/cloud-Cj5ey3l_.js.map +0 -1
- package/dist/collection-drift-BKj_BoMq.js +0 -106
- package/dist/collection-drift-BKj_BoMq.js.map +0 -1
- package/dist/collections-dir-DlvDhime.js +0 -69
- package/dist/collections-dir-DlvDhime.js.map +0 -1
- package/dist/console-CdwIYOMV.js.map +0 -1
- package/dist/context-AXdAh-q8.js.map +0 -1
- package/dist/db-DBbKpjYX.js.map +0 -1
- package/dist/derive-ae9UOoOB.js.map +0 -1
- package/dist/dev-C93d4QIv.js.map +0 -1
- package/dist/dev-preflight-Cxv3TiD1.js.map +0 -1
- package/dist/doctor-BBPQUO2g.js.map +0 -1
- package/dist/eject-DABcDnPN.js.map +0 -1
- package/dist/fold-static-BWzxNn06.js.map +0 -1
- package/dist/generate-view-IFwCADvb.js.map +0 -1
- package/dist/generate_sdk-DNmNuFuW.js.map +0 -1
- package/dist/init-vL1DWOeC.js.map +0 -1
- package/dist/last-dev-database-DpW5dfoX.js +0 -2
- package/dist/manifest-BtzDy7KQ.js.map +0 -1
- package/dist/path-flags-DNvtEi2-.js +0 -92
- package/dist/path-flags-DNvtEi2-.js.map +0 -1
- package/dist/project-CasK56vN.js.map +0 -1
- package/dist/pull-DDMpsZ5r.js.map +0 -1
- package/dist/resolve-D647F1LA.js +0 -2
- package/dist/schema-DtLPsXbT.js.map +0 -1
- package/dist/schema-reconcile-DkArN9jF.js +0 -2
- package/dist/skills-CbwV6vw_.js.map +0 -1
- package/dist/status-BREvtzJm.js.map +0 -1
- package/dist/storage-CO9ouK76.js.map +0 -1
- package/dist/utils/collection-drift.d.ts +0 -27
- package/dist/utils/collections-dir.d.ts +0 -14
- package/dist/verify-Y3rWSgfA.js +0 -730
- package/dist/verify-Y3rWSgfA.js.map +0 -1
- package/templates/overlays/baas/config/index.ts +0 -24
- package/templates/overlays/baas/config/package.json +0 -30
- package/templates/template/config/cms.d.ts +0 -15
- package/templates/template/config/collections/authors.ts +0 -47
- package/templates/template/config/collections/index.ts +0 -44
- package/templates/template/config/collections/posts.ts +0 -94
- package/templates/template/config/collections/presets/blank/index.ts +0 -5
- package/templates/template/config/collections/presets/ecommerce/categories.ts +0 -42
- package/templates/template/config/collections/presets/ecommerce/index.ts +0 -31
- package/templates/template/config/collections/presets/ecommerce/orders.ts +0 -78
- package/templates/template/config/collections/presets/ecommerce/products.ts +0 -73
- package/templates/template/config/collections/tags.ts +0 -27
- package/templates/template/config/collections/users.ts +0 -149
- package/templates/template/config/frontend-assets.d.ts +0 -17
- package/templates/template/config/index.ts +0 -12
- package/templates/template/config/package.json +0 -30
- package/templates/template/config/tsconfig.json +0 -35
- /package/templates/eject/{config → backend}/resources.ts +0 -0
|
@@ -1,12 +1,13 @@
|
|
|
1
|
-
import { i as recordEvent, l as durationBucket } from "./telemetry-
|
|
2
|
-
import {
|
|
1
|
+
import { i as recordEvent, l as durationBucket } from "./telemetry-M3HjlyhZ.js";
|
|
2
|
+
import { c as unknownCommandMessage, i as switchOn } from "./args-CaCcrYE1.js";
|
|
3
|
+
import { c as findProjectRoot, p as requireProjectRoot } from "./project-CLcF5i8c.js";
|
|
4
|
+
import { _ as findBackendApp, b as loadManifest, h as cmsMountOf, w as selectDeployApp, y as formatAppAddress } from "./manifest-C3uLDrrJ.js";
|
|
3
5
|
import { t as cliUserAgent } from "./version-Buyyo1ut.js";
|
|
4
|
-
import {
|
|
5
|
-
import { C as
|
|
6
|
-
import {
|
|
7
|
-
import { n as
|
|
8
|
-
import {
|
|
9
|
-
import { t as buildAssetApp } from "./build-BuKTnec8.js";
|
|
6
|
+
import { C as unvendoredReason, T as toolStdio, c as buildBundle, r as UNVENDORED_COST } from "./bundle-DgILeA5b.js";
|
|
7
|
+
import { $ as resolveCloudUrl, A as lookupProjectId, B as projectLinkPath, C as grantForLink, D as isKnownControlPlane, E as isJsonMode, F as printGroupHelp, G as requireClient, H as refuseDirectLink, I as printJson, J as requireKnownAction, K as requireCloudRow, L as probeToken, M as noteBlank, N as openUrl, O as keyValues, P as parseCloudArgs, Q as resolveCloudTarget, R as projectDotenvSetsAppKey, S as getContextOrg, T as initOutputMode, U as removeLink, V as readLink, W as reportError, X as requireProjectRef, Y as requireProject, Z as requireSessionClient, _ as fail, _t as orgCapabilitiesInScopes, a as billingAccountIdOf, at as storedGrantForLink, b as forgetEphemeralGrant, bt as wantsRawError, c as colorStatus, ct as writeLink, d as displayProjectRef, dt as ORG_CAPABILITY_NAMES, et as resolveProjectRef, f as dotenvSets, ft as TOKEN_CAPABILITIES, g as ephemeralGrantFor, gt as isTokenCapability, h as envToken, ht as isOrgCapability, i as appKeyExpiryNote, it as setCurrentContext, j as note, k as linkedEphemeralGrant, l as confirmDestructive, lt as ALWAYS_SCOPES, m as emitHelp, mt as capabilitiesInScopes, n as GLOBAL_HELP_FLAGS, nt as saveEphemeralGrant, o as cloudRow, ot as success, p as emit, pt as TOKEN_CAPABILITY_NAMES, q as requireInteractive, r as TOKEN_ENV, rt as setContextOrg, s as cloudRows, st as warn, t as GLOBAL_CLOUD_FLAGS, tt as resolveTimeoutMs, u as createCloudClient, ut as ORG_CAPABILITIES, v as fetchDeployTargets, vt as scopesForCapabilities, w as grantProjectOf, x as freshAccessToken, y as fetchTenantBaseDomain, yt as scopesForOrgCapabilities, z as projectHost } from "./context--JwaHaZp.js";
|
|
8
|
+
import { n as foldFrontendIntoBundle, r as foldableApps } from "./fold-static-CKewnAPX.js";
|
|
9
|
+
import { n as deriveOptionsFor, r as deriveResourceGraph } from "./derive-C3ezmY-p.js";
|
|
10
|
+
import { t as buildAssetApp } from "./build-CA5R07tw.js";
|
|
10
11
|
import chalk from "chalk";
|
|
11
12
|
import arg from "arg";
|
|
12
13
|
import fs from "fs";
|
|
@@ -15,10 +16,10 @@ import path from "path";
|
|
|
15
16
|
import { execFileSync, spawn } from "child_process";
|
|
16
17
|
import dotenv from "dotenv";
|
|
17
18
|
import { DEFAULT_STORAGE_SOURCE_KEY } from "@rebasepro/types";
|
|
19
|
+
import fs$1 from "node:fs";
|
|
18
20
|
import inquirer from "inquirer";
|
|
19
21
|
import { RebaseApiError, createRebaseClient } from "@rebasepro/client";
|
|
20
22
|
import net from "node:net";
|
|
21
|
-
import fs$1 from "node:fs";
|
|
22
23
|
import { parse } from "acorn";
|
|
23
24
|
//#region src/commands/cloud/maintenance.ts
|
|
24
25
|
/**
|
|
@@ -268,16 +269,114 @@ function readMfaRequired(error) {
|
|
|
268
269
|
};
|
|
269
270
|
}
|
|
270
271
|
/**
|
|
272
|
+
* The control plane's `/auth/config`, or null when it cannot be read. Read
|
|
273
|
+
* once per login: it says both whether codes are mailed and whether device
|
|
274
|
+
* sign-in is offered.
|
|
275
|
+
*/
|
|
276
|
+
async function readAuthConfig(auth) {
|
|
277
|
+
try {
|
|
278
|
+
return await auth.getAuthConfig();
|
|
279
|
+
} catch {
|
|
280
|
+
return null;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
/**
|
|
271
284
|
* Whether the control plane mails sign-in codes, as its `/auth/config` says.
|
|
272
285
|
* `false` when it cannot be asked: an older control plane has no such door,
|
|
273
286
|
* and offering one that 404s is worse than not offering it.
|
|
274
287
|
*/
|
|
275
|
-
|
|
288
|
+
function offersSignInCodes(config) {
|
|
289
|
+
return config?.emailOtp === true;
|
|
290
|
+
}
|
|
291
|
+
/** Whether the control plane signs a terminal in through a browser, as its `/auth/config` says. */
|
|
292
|
+
function offersBrowserSignIn(config) {
|
|
293
|
+
return config?.deviceLogin === true;
|
|
294
|
+
}
|
|
295
|
+
/** What the browser sign-in does outside this process. An object so tests can replace it. */
|
|
296
|
+
var BROWSER_SIGN_IN_IO = {
|
|
297
|
+
sleep: (ms) => new Promise((resolve) => setTimeout(resolve, ms)),
|
|
298
|
+
open: (url) => openUrl(url, "Opening")
|
|
299
|
+
};
|
|
300
|
+
/** What the approval page calls this terminal. */
|
|
301
|
+
function browserSignInClientName() {
|
|
302
|
+
let host = "";
|
|
303
|
+
try {
|
|
304
|
+
host = os.hostname().replace(/\.local$/, "");
|
|
305
|
+
} catch {}
|
|
306
|
+
return host ? `Rebase CLI on ${host}` : "Rebase CLI";
|
|
307
|
+
}
|
|
308
|
+
/** How long to wait after a poll that could not get an answer, at most. */
|
|
309
|
+
var MAX_RETRY_INTERVAL_SECONDS = 30;
|
|
310
|
+
/**
|
|
311
|
+
* Sign in through a browser: ask for a pending sign-in, show its link and
|
|
312
|
+
* code, open the browser when there is a person at a terminal to look at it,
|
|
313
|
+
* and poll until it is approved, denied or expired.
|
|
314
|
+
*
|
|
315
|
+
* Without a terminal — piped, or `--json` — the link and code still go to
|
|
316
|
+
* stderr and the polling still happens: whoever runs this (an agent, a
|
|
317
|
+
* script with a person nearby) has what to open and is told what it is
|
|
318
|
+
* waiting for.
|
|
319
|
+
*/
|
|
320
|
+
async function signInWithBrowser(auth, options) {
|
|
321
|
+
let started;
|
|
276
322
|
try {
|
|
277
|
-
|
|
278
|
-
} catch {
|
|
279
|
-
|
|
323
|
+
started = await auth.startDeviceLogin({ clientName: browserSignInClientName() });
|
|
324
|
+
} catch (e) {
|
|
325
|
+
if (errorStatus(e) === 404) fail("This control plane does not offer signing in through a browser.", "Run `rebase cloud login --email <address>` to sign in with your password or an emailed code.", "device_login_unavailable");
|
|
326
|
+
throw e;
|
|
327
|
+
}
|
|
328
|
+
const minutes = Math.max(1, Math.round(started.expiresIn / 60));
|
|
329
|
+
if (isJsonMode()) {
|
|
330
|
+
process.stderr.write(`To sign in, open ${started.verificationUriComplete}\n`);
|
|
331
|
+
process.stderr.write(` and check that it shows the code ${started.userCode}.\n`);
|
|
332
|
+
process.stderr.write(`Waiting for the sign-in to be approved in the browser (expires in ${minutes} minutes)...\n`);
|
|
333
|
+
} else {
|
|
334
|
+
noteBlank();
|
|
335
|
+
note(`Your code: ${chalk.bold(started.userCode)}`);
|
|
336
|
+
if (options.openBrowser && atTerminal()) {
|
|
337
|
+
BROWSER_SIGN_IN_IO.open(started.verificationUriComplete);
|
|
338
|
+
note(chalk.gray("If the browser did not open, open the link above yourself."));
|
|
339
|
+
} else {
|
|
340
|
+
noteBlank();
|
|
341
|
+
note(`Open ${chalk.cyan(started.verificationUriComplete)}`);
|
|
342
|
+
}
|
|
343
|
+
note(chalk.gray("Check that the page shows the same code, then approve the sign-in there."));
|
|
344
|
+
noteBlank();
|
|
345
|
+
note(chalk.gray(`Waiting for approval in the browser (expires in ${minutes} minutes, Ctrl-C to cancel)…`));
|
|
346
|
+
}
|
|
347
|
+
const deadline = Date.now() + started.expiresIn * 1e3;
|
|
348
|
+
let interval = started.interval;
|
|
349
|
+
let warnedUnreachable = false;
|
|
350
|
+
while (Date.now() < deadline) {
|
|
351
|
+
await BROWSER_SIGN_IN_IO.sleep(interval * 1e3);
|
|
352
|
+
let result;
|
|
353
|
+
try {
|
|
354
|
+
result = await auth.pollDeviceLogin(started.deviceCode);
|
|
355
|
+
} catch (e) {
|
|
356
|
+
const status = errorStatus(e);
|
|
357
|
+
if (!(typeof status !== "number" || status === 429 || status >= 500)) throw e;
|
|
358
|
+
if (!warnedUnreachable) {
|
|
359
|
+
warn("Could not reach the control plane to check on the sign-in. Still waiting.");
|
|
360
|
+
warnedUnreachable = true;
|
|
361
|
+
}
|
|
362
|
+
interval = Math.min(interval + 5, MAX_RETRY_INTERVAL_SECONDS);
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
switch (result.status) {
|
|
366
|
+
case "approved": return {
|
|
367
|
+
user: result.user,
|
|
368
|
+
accessToken: result.accessToken,
|
|
369
|
+
refreshToken: result.refreshToken
|
|
370
|
+
};
|
|
371
|
+
case "pending":
|
|
372
|
+
case "slow_down":
|
|
373
|
+
interval = result.interval;
|
|
374
|
+
break;
|
|
375
|
+
case "denied": return fail("The sign-in was denied in the browser.", "Nothing was signed in. To sign in, run `rebase cloud login` again.", "access_denied");
|
|
376
|
+
case "expired": return fail("The sign-in link expired before it was approved.", "Run `rebase cloud login` again for a new link.", "expired_token");
|
|
377
|
+
}
|
|
280
378
|
}
|
|
379
|
+
fail("The sign-in link expired before it was approved.", "Run `rebase cloud login` again for a new link.", "expired_token");
|
|
281
380
|
}
|
|
282
381
|
/** Ask "password or code?" at a terminal. */
|
|
283
382
|
async function askSignInMethod() {
|
|
@@ -451,7 +550,7 @@ function parseCapabilities(values) {
|
|
|
451
550
|
/** The organization a project belongs to, or undefined when its row does not say. */
|
|
452
551
|
async function projectOrganization(client, projectId) {
|
|
453
552
|
try {
|
|
454
|
-
const row = await client.data.
|
|
553
|
+
const row = await client.data.table("projects").findById(projectId);
|
|
455
554
|
const raw = row?.organization ?? row?.organizationId ?? row?.organization_id;
|
|
456
555
|
if (raw && typeof raw === "object" && "id" in raw) return String(raw.id);
|
|
457
556
|
return raw == null || raw === "" ? void 0 : String(raw);
|
|
@@ -645,6 +744,8 @@ var LOGIN_FLAGS = {
|
|
|
645
744
|
"--email": String,
|
|
646
745
|
"--password": String,
|
|
647
746
|
"--code": Boolean,
|
|
747
|
+
"--web": Boolean,
|
|
748
|
+
"--no-browser": Boolean,
|
|
648
749
|
"-e": "--email"
|
|
649
750
|
};
|
|
650
751
|
/**
|
|
@@ -687,40 +788,46 @@ async function loginCommand(rawArgs) {
|
|
|
687
788
|
note(`Signing in to ${chalk.cyan(url)}`);
|
|
688
789
|
noteBlank();
|
|
689
790
|
if (args["--code"] && passwordOnTheCommandLine(args)) fail("--code and --password are two ways to sign in. Pass one of them.", void 0, "usage");
|
|
791
|
+
if (args["--web"] && (args["--code"] || args["--email"] || passwordOnTheCommandLine(args))) fail("--web signs in through the browser, with no email, password or code. Pass it on its own.", void 0, "usage");
|
|
690
792
|
if (passwordOnTheCommandLine(args)) warn("--password puts your password in your shell history and in the process table.", `Prefer the prompt, or pass it as ${PASSWORD_ENV} from a secret store.`);
|
|
691
793
|
const envEmail = (process.env["REBASE_CLOUD_EMAIL"] ?? "").trim();
|
|
692
794
|
const envPassword = process.env["REBASE_CLOUD_PASSWORD"] ?? "";
|
|
693
|
-
let method = args["--code"] ? "code" : args["--password"] || envPassword ? "password" : void 0;
|
|
795
|
+
let method = args["--web"] ? "browser" : args["--code"] ? "code" : args["--password"] || envPassword ? "password" : void 0;
|
|
694
796
|
if (method === "code") requireTerminalForCode();
|
|
695
|
-
let email = (args["--email"] || envEmail).trim();
|
|
696
|
-
if (!email || method === void 0) requireInteractive("credentials", `--email and --password, or ${EMAIL_ENV} and ${PASSWORD_ENV}`);
|
|
697
|
-
if (!email) {
|
|
698
|
-
const answers = await inquirer.prompt([{
|
|
699
|
-
type: "input",
|
|
700
|
-
name: "email",
|
|
701
|
-
message: "Email:"
|
|
702
|
-
}]);
|
|
703
|
-
email = String(answers.email ?? "").trim();
|
|
704
|
-
}
|
|
705
|
-
if (!email) fail("An email is required.", void 0, "input_required");
|
|
706
797
|
const client = createCloudClient(url);
|
|
707
|
-
|
|
798
|
+
let authConfig;
|
|
799
|
+
const config = async () => authConfig === void 0 ? authConfig = await readAuthConfig(client.auth) : authConfig;
|
|
800
|
+
if (method === void 0 && !args["--email"] && offersBrowserSignIn(await config())) method = "browser";
|
|
801
|
+
let email = (args["--email"] || envEmail).trim();
|
|
708
802
|
let password = args["--password"] || envPassword;
|
|
709
|
-
if (method
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
803
|
+
if (method !== "browser") {
|
|
804
|
+
if (!email || method === void 0) requireInteractive("credentials", `--email and --password, or ${EMAIL_ENV} and ${PASSWORD_ENV}`);
|
|
805
|
+
if (!email) {
|
|
806
|
+
const answers = await inquirer.prompt([{
|
|
807
|
+
type: "input",
|
|
808
|
+
name: "email",
|
|
809
|
+
message: "Email:"
|
|
810
|
+
}]);
|
|
811
|
+
email = String(answers.email ?? "").trim();
|
|
812
|
+
}
|
|
813
|
+
if (!email) fail("An email is required.", void 0, "input_required");
|
|
814
|
+
if (method === void 0) method = offersSignInCodes(await config()) ? await askSignInMethod() : "password";
|
|
815
|
+
if (method === "password" && !password) {
|
|
816
|
+
const answers = await inquirer.prompt([{
|
|
817
|
+
type: "password",
|
|
818
|
+
name: "password",
|
|
819
|
+
message: "Password:",
|
|
820
|
+
mask: "•"
|
|
821
|
+
}]);
|
|
822
|
+
password = String(answers.password ?? "");
|
|
823
|
+
}
|
|
824
|
+
if (method === "password" && !password) fail("Email and password are required.");
|
|
717
825
|
}
|
|
718
|
-
if (method === "password" && !password) fail("Email and password are required.");
|
|
719
826
|
try {
|
|
720
|
-
const { user } = await withSecondFactor(client.auth, () => method === "code" ? signInWithCode(client.auth, email) : client.auth.signInWithEmail(email, password));
|
|
827
|
+
const { user } = method === "browser" ? await signInWithBrowser(client.auth, { openBrowser: !args["--no-browser"] }) : await withSecondFactor(client.auth, () => method === "code" ? signInWithCode(client.auth, email) : client.auth.signInWithEmail(email, password));
|
|
721
828
|
setCurrentContext(url);
|
|
722
829
|
try {
|
|
723
|
-
const orgs = await client.data.
|
|
830
|
+
const orgs = await client.data.table("organizations").find({ limit: 2 });
|
|
724
831
|
if (orgs.data.length === 1 && !getContextOrg(url)) setContextOrg(url, String(orgs.data[0].id));
|
|
725
832
|
} catch {}
|
|
726
833
|
success(`Logged in as ${chalk.bold(user.email ?? email)}`);
|
|
@@ -1051,12 +1158,12 @@ async function linkCommand(rawArgs) {
|
|
|
1051
1158
|
let project;
|
|
1052
1159
|
if (args["--project"]) {
|
|
1053
1160
|
const projectId = await resolveProjectRef(args["--project"], client);
|
|
1054
|
-
project = await client.data.
|
|
1161
|
+
project = await client.data.table("projects").findById(projectId);
|
|
1055
1162
|
if (!project) fail(`Project ${args["--project"]} not found.`, void 0, "project_not_found");
|
|
1056
1163
|
} else {
|
|
1057
1164
|
requireInteractive("a project to link", "--project <slug>");
|
|
1058
1165
|
const org = getContextOrg(url);
|
|
1059
|
-
const projects = cloudRows((await client.data.
|
|
1166
|
+
const projects = cloudRows((await client.data.table("projects").find({
|
|
1060
1167
|
where: org ? { organization: ["==", org] } : void 0,
|
|
1061
1168
|
limit: 100
|
|
1062
1169
|
})).data);
|
|
@@ -1146,7 +1253,7 @@ async function selectOrgCommand(rawArgs) {
|
|
|
1146
1253
|
const target = positionals[0];
|
|
1147
1254
|
const { client, url } = await requireClient(rawArgs);
|
|
1148
1255
|
try {
|
|
1149
|
-
const orgs = (await client.data.
|
|
1256
|
+
const orgs = (await client.data.table("organizations").find({ limit: 100 })).data;
|
|
1150
1257
|
if (orgs.length === 0) fail("You are not a member of any organization.", void 0, "no_orgs");
|
|
1151
1258
|
let chosen = target ? orgs.find((o) => String(o.id) === target || o.slug === target) : void 0;
|
|
1152
1259
|
if (!chosen && !target) {
|
|
@@ -1417,7 +1524,7 @@ async function statusCommand(rawArgs) {
|
|
|
1417
1524
|
const { client, url } = await requireClient(rawArgs);
|
|
1418
1525
|
const projectId = await requireProject(rawArgs, client);
|
|
1419
1526
|
try {
|
|
1420
|
-
const project = await client.data.
|
|
1527
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
1421
1528
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`, void 0, "not_found");
|
|
1422
1529
|
const [db, storage, deploy, baseDomain, maintenance] = await Promise.all([
|
|
1423
1530
|
firstRow(client, "databases", projectId),
|
|
@@ -1660,7 +1767,7 @@ async function storageCommand(action, rawArgs) {
|
|
|
1660
1767
|
const { client } = await requireClient(rawArgs);
|
|
1661
1768
|
const projectId = await requireProject(rawArgs, client);
|
|
1662
1769
|
try {
|
|
1663
|
-
const stores = (await client.data.
|
|
1770
|
+
const stores = (await client.data.table("storages").find({
|
|
1664
1771
|
where: { project: ["==", projectId] },
|
|
1665
1772
|
limit: 50
|
|
1666
1773
|
})).data;
|
|
@@ -1809,7 +1916,7 @@ async function storageAttachCommand(rawArgs) {
|
|
|
1809
1916
|
const projectId = await requireProject(rawArgs, client);
|
|
1810
1917
|
const sourceKey = (parsed["--source"] ?? "").trim() || DEFAULT_STORAGE_SOURCE_KEY;
|
|
1811
1918
|
try {
|
|
1812
|
-
const existing = (await client.data.
|
|
1919
|
+
const existing = (await client.data.table("storages").find({
|
|
1813
1920
|
where: { project: ["==", projectId] },
|
|
1814
1921
|
limit: 50
|
|
1815
1922
|
})).data.find((r) => {
|
|
@@ -1833,8 +1940,8 @@ async function storageAttachCommand(rawArgs) {
|
|
|
1833
1940
|
}
|
|
1834
1941
|
if (parsed["--force-path-style"]) row.s3ForcePathStyle = true;
|
|
1835
1942
|
const replaced = Boolean(existing?.id);
|
|
1836
|
-
if (existing?.id) await client.data.
|
|
1837
|
-
else await client.data.
|
|
1943
|
+
if (existing?.id) await client.data.table("storages").update(String(existing.id), row);
|
|
1944
|
+
else await client.data.table("storages").create(row);
|
|
1838
1945
|
success(`Storage attached to ${displayProjectRef(rawArgs)}.`);
|
|
1839
1946
|
emit(() => {
|
|
1840
1947
|
keyValues([
|
|
@@ -2026,7 +2133,7 @@ async function clustersAddCommand(rawArgs) {
|
|
|
2026
2133
|
const { kubeconfigPath: _path, ...columns } = args;
|
|
2027
2134
|
let created;
|
|
2028
2135
|
try {
|
|
2029
|
-
created = await client.data.
|
|
2136
|
+
created = await client.data.table("clusters").create({
|
|
2030
2137
|
...columns,
|
|
2031
2138
|
authType: "kubeconfig",
|
|
2032
2139
|
kubeConfigData
|
|
@@ -2152,7 +2259,7 @@ async function clustersRegistryCommand(rawArgs) {
|
|
|
2152
2259
|
}
|
|
2153
2260
|
const { client } = await requireClient(rawArgs);
|
|
2154
2261
|
try {
|
|
2155
|
-
await client.data.
|
|
2262
|
+
await client.data.table("clusters").update(args.id, columns);
|
|
2156
2263
|
} catch (error) {
|
|
2157
2264
|
reportError(error, "Could not record the cluster's registry");
|
|
2158
2265
|
return;
|
|
@@ -2189,7 +2296,7 @@ async function clustersListCommand(rawArgs) {
|
|
|
2189
2296
|
});
|
|
2190
2297
|
const { client } = await requireClient(rawArgs);
|
|
2191
2298
|
try {
|
|
2192
|
-
const clusters = (await client.data.
|
|
2299
|
+
const clusters = (await client.data.table("clusters").find({ limit: 100 })).data;
|
|
2193
2300
|
emit(() => {
|
|
2194
2301
|
console.log("");
|
|
2195
2302
|
console.log(chalk.bold(" ☸ Clusters"));
|
|
@@ -2295,7 +2402,7 @@ async function billingCommand(rawArgs) {
|
|
|
2295
2402
|
}
|
|
2296
2403
|
if (!org) fail("No active organization.", "Run `rebase cloud use` first.", "no_org");
|
|
2297
2404
|
try {
|
|
2298
|
-
const billingId = billingAccountIdOf(await client.data.
|
|
2405
|
+
const billingId = billingAccountIdOf(await client.data.table("organizations").findById(org));
|
|
2299
2406
|
if (!billingId) {
|
|
2300
2407
|
emit(() => {
|
|
2301
2408
|
console.log("");
|
|
@@ -2309,7 +2416,7 @@ async function billingCommand(rawArgs) {
|
|
|
2309
2416
|
});
|
|
2310
2417
|
return;
|
|
2311
2418
|
}
|
|
2312
|
-
const acct = await client.data.
|
|
2419
|
+
const acct = await client.data.table("billing-accounts").findById(billingId);
|
|
2313
2420
|
let card = {};
|
|
2314
2421
|
try {
|
|
2315
2422
|
card = await client.functions.invoke("stripe-billing", void 0, {
|
|
@@ -2328,7 +2435,7 @@ async function billingCommand(rawArgs) {
|
|
|
2328
2435
|
})["--project"] || readLink()?.projectId;
|
|
2329
2436
|
const projectId = ref ? await lookupProjectId(ref, client) : void 0;
|
|
2330
2437
|
if (projectId) {
|
|
2331
|
-
const proj = await client.data.
|
|
2438
|
+
const proj = await client.data.table("projects").findById(projectId);
|
|
2332
2439
|
const hasCluster = proj?.cluster_id != null || proj?.cluster != null;
|
|
2333
2440
|
monthly = `€${(await client.functions.invoke("pricing", proj, {
|
|
2334
2441
|
method: "POST",
|
|
@@ -2468,7 +2575,7 @@ async function computeCommand(action, rawArgs) {
|
|
|
2468
2575
|
});
|
|
2469
2576
|
const { client } = await requireClient(rawArgs);
|
|
2470
2577
|
const projectId = await requireProject(rawArgs, client);
|
|
2471
|
-
const project = await client.data.
|
|
2578
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
2472
2579
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`, void 0, "not_found");
|
|
2473
2580
|
if (action !== "set") {
|
|
2474
2581
|
let quote;
|
|
@@ -2543,7 +2650,7 @@ async function computeCommand(action, rawArgs) {
|
|
|
2543
2650
|
if (built.error) fail(built.error, void 0, "bad_request");
|
|
2544
2651
|
const patch = built.patch;
|
|
2545
2652
|
try {
|
|
2546
|
-
await client.data.
|
|
2653
|
+
await client.data.table("projects").update(projectId, patch);
|
|
2547
2654
|
} catch (error) {
|
|
2548
2655
|
reportError(error, "Could not change resources");
|
|
2549
2656
|
return;
|
|
@@ -3094,7 +3201,7 @@ async function listDatabases(rawArgs) {
|
|
|
3094
3201
|
const projectId = await requireProject(rawArgs, client);
|
|
3095
3202
|
const projectRef = displayProjectRef(rawArgs);
|
|
3096
3203
|
try {
|
|
3097
|
-
const dbs = cloudRows((await client.data.
|
|
3204
|
+
const dbs = cloudRows((await client.data.table("databases").find({
|
|
3098
3205
|
where: { project: ["==", projectId] },
|
|
3099
3206
|
limit: 50
|
|
3100
3207
|
})).data);
|
|
@@ -3134,7 +3241,7 @@ async function listDatabases(rawArgs) {
|
|
|
3134
3241
|
* point, since the answer decides which row a deploy will actually use.
|
|
3135
3242
|
*/
|
|
3136
3243
|
async function firstAttachedDatabase(client, projectId) {
|
|
3137
|
-
return cloudRows((await client.data.
|
|
3244
|
+
return cloudRows((await client.data.table("databases").find({
|
|
3138
3245
|
where: { project: ["==", projectId] },
|
|
3139
3246
|
limit: 1
|
|
3140
3247
|
})).data)[0];
|
|
@@ -3148,7 +3255,7 @@ async function firstAttachedDatabase(client, projectId) {
|
|
|
3148
3255
|
* afterwards".
|
|
3149
3256
|
*/
|
|
3150
3257
|
async function attachDatabaseRow(client, input) {
|
|
3151
|
-
return requireCloudRow(await client.data.
|
|
3258
|
+
return requireCloudRow(await client.data.table("databases").create({
|
|
3152
3259
|
project: input.projectId,
|
|
3153
3260
|
type: input.type,
|
|
3154
3261
|
connectionString: input.type === "byodb" ? input.connectionString : void 0,
|
|
@@ -3756,7 +3863,7 @@ async function listProjects(rawArgs) {
|
|
|
3756
3863
|
const { client, url } = await requireClient(rawArgs);
|
|
3757
3864
|
const org = args["--all-orgs"] ? void 0 : getContextOrg(url);
|
|
3758
3865
|
try {
|
|
3759
|
-
const [projects, baseDomain] = await Promise.all([client.data.
|
|
3866
|
+
const [projects, baseDomain] = await Promise.all([client.data.table("projects").find({
|
|
3760
3867
|
where: org ? { organization: ["==", org] } : void 0,
|
|
3761
3868
|
orderBy: ["name", "asc"],
|
|
3762
3869
|
limit: 100
|
|
@@ -3944,7 +4051,7 @@ async function createProject(rawArgs) {
|
|
|
3944
4051
|
try {
|
|
3945
4052
|
const user = await client.auth.getUser();
|
|
3946
4053
|
if (!user) fail("Session is no longer valid.", "Run `rebase cloud login` again.", "session_invalid");
|
|
3947
|
-
const created = requireCloudRow(await client.data.
|
|
4054
|
+
const created = requireCloudRow(await client.data.table("projects").create({
|
|
3948
4055
|
name,
|
|
3949
4056
|
subdomain,
|
|
3950
4057
|
gitRepoUrl,
|
|
@@ -4101,7 +4208,7 @@ async function projectInfo(rawArgs, projectRef) {
|
|
|
4101
4208
|
const { client, url } = await requireClient(rawArgs);
|
|
4102
4209
|
try {
|
|
4103
4210
|
const projectId = await resolveProjectRef(projectRef, client);
|
|
4104
|
-
const p = await client.data.
|
|
4211
|
+
const p = await client.data.table("projects").findById(projectId);
|
|
4105
4212
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "project_not_found");
|
|
4106
4213
|
const [db, lastDeploy, baseDomain, capacity] = await Promise.all([
|
|
4107
4214
|
firstRow(client, "databases", projectId),
|
|
@@ -4168,14 +4275,14 @@ async function deleteProject(rawArgs, projectRef) {
|
|
|
4168
4275
|
});
|
|
4169
4276
|
const { client } = await requireClient(rawArgs);
|
|
4170
4277
|
const projectId = await resolveProjectRef(projectRef, client);
|
|
4171
|
-
const p = await client.data.
|
|
4278
|
+
const p = await client.data.table("projects").findById(projectId).catch(() => void 0);
|
|
4172
4279
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "project_not_found");
|
|
4173
4280
|
await confirmDestructive({
|
|
4174
4281
|
yes: Boolean(args["--yes"]),
|
|
4175
4282
|
prompt: `Permanently delete project "${p.name ?? projectRef}" (${p.subdomain ?? projectRef})? This tears down its deployment.`
|
|
4176
4283
|
});
|
|
4177
4284
|
try {
|
|
4178
|
-
await client.data.
|
|
4285
|
+
await client.data.table("projects").delete(projectId);
|
|
4179
4286
|
success(`Deleted project ${chalk.bold(p.name ?? projectId)}`);
|
|
4180
4287
|
emit(() => {}, {
|
|
4181
4288
|
success: true,
|
|
@@ -4188,13 +4295,13 @@ async function deleteProject(rawArgs, projectRef) {
|
|
|
4188
4295
|
}
|
|
4189
4296
|
}
|
|
4190
4297
|
async function firstRow(client, collection, projectId) {
|
|
4191
|
-
return (await client.data.
|
|
4298
|
+
return (await client.data.table(collection).find({
|
|
4192
4299
|
where: { project: ["==", projectId] },
|
|
4193
4300
|
limit: 1
|
|
4194
4301
|
})).data[0];
|
|
4195
4302
|
}
|
|
4196
4303
|
async function latestDeployment(client, projectId) {
|
|
4197
|
-
return (await client.data.
|
|
4304
|
+
return (await client.data.table("deployments").find({
|
|
4198
4305
|
where: { project: ["==", projectId] },
|
|
4199
4306
|
orderBy: ["createdAt", "desc"],
|
|
4200
4307
|
limit: 1
|
|
@@ -4350,11 +4457,11 @@ var PROBES = [
|
|
|
4350
4457
|
};
|
|
4351
4458
|
if (status === 200) return {
|
|
4352
4459
|
verdict: "warn",
|
|
4353
|
-
meaning: "this
|
|
4460
|
+
meaning: "this table is readable with NO authentication — correct only if it is deliberately public"
|
|
4354
4461
|
};
|
|
4355
4462
|
if (status === 404) return {
|
|
4356
4463
|
verdict: "warn",
|
|
4357
|
-
meaning: "no such
|
|
4464
|
+
meaning: "no such table on this deployment — check the name, or pass --collection"
|
|
4358
4465
|
};
|
|
4359
4466
|
if (status >= 500) return serverError("the read reached the database and failed — most often an RLS policy naming a column or table that is not there");
|
|
4360
4467
|
return {
|
|
@@ -4762,7 +4869,7 @@ async function resolveOrigin(rawArgs, client, url, projectId) {
|
|
|
4762
4869
|
const h = parsed["--host"].trim().replace(/\/+$/, "");
|
|
4763
4870
|
return /^https?:\/\//.test(h) ? h : `https://${h}`;
|
|
4764
4871
|
}
|
|
4765
|
-
const [project, baseDomain] = await Promise.all([client.data.
|
|
4872
|
+
const [project, baseDomain] = await Promise.all([client.data.table("projects").findById(projectId), fetchTenantBaseDomain(client, url)]);
|
|
4766
4873
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`);
|
|
4767
4874
|
const host = projectHost(project, baseDomain);
|
|
4768
4875
|
if (!host) fail("Could not determine the public URL for this project.", "It may never have been deployed. Pass --host <hostname> to probe an address directly.");
|
|
@@ -5219,7 +5326,7 @@ function printDebugHelp() {
|
|
|
5219
5326
|
description: "Probe the live URL and explain every status code (the default)",
|
|
5220
5327
|
flags: [
|
|
5221
5328
|
["--host <hostname>", "Probe this address instead of the project's own"],
|
|
5222
|
-
["--collection <name>", "
|
|
5329
|
+
["--collection <name>", "Table for the unauth-read probe. Default: users"],
|
|
5223
5330
|
["--function <name>", "Also assert this function loaded, against the listing"]
|
|
5224
5331
|
]
|
|
5225
5332
|
},
|
|
@@ -6126,7 +6233,7 @@ function printEnvHelp() {
|
|
|
6126
6233
|
*
|
|
6127
6234
|
* The command an agent runs when it has built an app and needs somewhere to
|
|
6128
6235
|
* put it. The control plane provisions an ordinary project on Rebase Cloud in
|
|
6129
|
-
* an organization nobody owns yet, this command pushes the local
|
|
6236
|
+
* an organization nobody owns yet, this command pushes the local tables to
|
|
6130
6237
|
* it with a normal managed deploy, and what comes back is the live URL and a
|
|
6131
6238
|
* claim link. The person the agent works for opens the link, signs in, and the
|
|
6132
6239
|
* project is theirs; nobody claims it within 72 hours and it is deleted.
|
|
@@ -6388,7 +6495,7 @@ function adminPanelUrl(projectRoot, projectUrl) {
|
|
|
6388
6495
|
* `REBASE_TOKEN` outranks the stored grant (see `requireClient`), and a shell
|
|
6389
6496
|
* or an MCP server that has one holds it for the person's other projects — it
|
|
6390
6497
|
* has no scope on the project just provisioned, so the deploy was refused and
|
|
6391
|
-
* the project never got its
|
|
6498
|
+
* the project never got its tables. The project is deployed with its own
|
|
6392
6499
|
* token.
|
|
6393
6500
|
*/
|
|
6394
6501
|
function bundleDeployEnv(env) {
|
|
@@ -6400,7 +6507,7 @@ function bundleDeployEnv(env) {
|
|
|
6400
6507
|
return child;
|
|
6401
6508
|
}
|
|
6402
6509
|
/**
|
|
6403
|
-
* Push the local
|
|
6510
|
+
* Push the local tables: `rebase cloud deploy --bundle`, as a child.
|
|
6404
6511
|
*
|
|
6405
6512
|
* A child rather than a call, so this command still prints exactly one
|
|
6406
6513
|
* result — a JSON caller gets the deploy's outcome folded into it — and still
|
|
@@ -6485,7 +6592,7 @@ async function cloudInitCommand(rawArgs, deps = DEFAULT_DEPS) {
|
|
|
6485
6592
|
let deployed;
|
|
6486
6593
|
if (!flags["--no-deploy"]) if (!projectRoot) warn("No rebase.json here, so there is nothing to deploy yet.", "Run `rebase cloud deploy` from the project once it has one.");
|
|
6487
6594
|
else {
|
|
6488
|
-
note("Pushing the local
|
|
6595
|
+
note("Pushing the local tables (rebase cloud deploy --bundle)…");
|
|
6489
6596
|
noteBlank();
|
|
6490
6597
|
deployed = await deps.deploy(root, isJsonMode());
|
|
6491
6598
|
if (!deployed.ok) warn("The deploy did not finish. The project and its claim link are kept.", "Fix what the deploy reported and run `rebase cloud deploy` again.");
|
|
@@ -8022,7 +8129,7 @@ async function previewCost(client, url, projectId) {
|
|
|
8022
8129
|
};
|
|
8023
8130
|
let project;
|
|
8024
8131
|
try {
|
|
8025
|
-
project = await client.data.
|
|
8132
|
+
project = await client.data.table("projects").findById(projectId);
|
|
8026
8133
|
} catch {
|
|
8027
8134
|
return cost;
|
|
8028
8135
|
}
|
|
@@ -9625,7 +9732,7 @@ function warningPayload(warnings) {
|
|
|
9625
9732
|
*/
|
|
9626
9733
|
async function readDeployContext(client, projectId) {
|
|
9627
9734
|
try {
|
|
9628
|
-
const [project, recent] = await Promise.all([client.data.
|
|
9735
|
+
const [project, recent] = await Promise.all([client.data.table("projects").findById(projectId), client.data.table("deployments").find({
|
|
9629
9736
|
where: { project: ["==", projectId] },
|
|
9630
9737
|
orderBy: ["createdAt", "desc"],
|
|
9631
9738
|
limit: 25
|
|
@@ -9676,7 +9783,7 @@ async function readBillingState(client, projectId) {
|
|
|
9676
9783
|
simulated: false
|
|
9677
9784
|
};
|
|
9678
9785
|
try {
|
|
9679
|
-
const project = await client.data.
|
|
9786
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
9680
9787
|
const orgRaw = project?.organization ?? project?.organizationId ?? project?.organization_id;
|
|
9681
9788
|
const org = orgRaw == null ? "" : String(orgRaw);
|
|
9682
9789
|
if (!org) return unknown;
|
|
@@ -9687,9 +9794,9 @@ async function readBillingState(client, projectId) {
|
|
|
9687
9794
|
if (!card) return unknown;
|
|
9688
9795
|
let plan = null;
|
|
9689
9796
|
try {
|
|
9690
|
-
const billingId = billingAccountIdOf(await client.data.
|
|
9797
|
+
const billingId = billingAccountIdOf(await client.data.table("organizations").findById(org));
|
|
9691
9798
|
if (billingId != null) {
|
|
9692
|
-
const acct = await client.data.
|
|
9799
|
+
const acct = await client.data.table("billing-accounts").findById(billingId);
|
|
9693
9800
|
plan = typeof acct?.plan === "string" ? acct.plan : null;
|
|
9694
9801
|
}
|
|
9695
9802
|
} catch {}
|
|
@@ -10044,7 +10151,7 @@ function resolveTriggerFailure(e, fallback = "Failed to trigger deployment") {
|
|
|
10044
10151
|
*/
|
|
10045
10152
|
async function platformRebuildsOff(client, projectId) {
|
|
10046
10153
|
try {
|
|
10047
|
-
const row = await client.data.
|
|
10154
|
+
const row = await client.data.table("projects").findById(projectId);
|
|
10048
10155
|
return typeof row === "object" && row !== null && "platformRebuilds" in row && row.platformRebuilds === false;
|
|
10049
10156
|
} catch {
|
|
10050
10157
|
return false;
|
|
@@ -10104,7 +10211,7 @@ function intakeRefusal(e) {
|
|
|
10104
10211
|
async function deployedUrl(client, opts) {
|
|
10105
10212
|
if (!opts.projectId || !opts.url) return void 0;
|
|
10106
10213
|
try {
|
|
10107
|
-
const [project, baseDomain] = await Promise.all([client.data.
|
|
10214
|
+
const [project, baseDomain] = await Promise.all([client.data.table("projects").findById(opts.projectId), fetchTenantBaseDomain(client, opts.url)]);
|
|
10108
10215
|
if (!project) return void 0;
|
|
10109
10216
|
return projectHost(project, baseDomain);
|
|
10110
10217
|
} catch {
|
|
@@ -10182,7 +10289,7 @@ async function streamBuildLogs(client, deploymentId, opts = {}) {
|
|
|
10182
10289
|
for (;;) {
|
|
10183
10290
|
let dep;
|
|
10184
10291
|
try {
|
|
10185
|
-
dep = await client.data.
|
|
10292
|
+
dep = await client.data.table(opts.collection ?? "deployments").findById(deploymentId);
|
|
10186
10293
|
unreadableSince = void 0;
|
|
10187
10294
|
} catch (e) {
|
|
10188
10295
|
if (!transientReadFailure(e)) reportError(e, "Failed to read deployment status");
|
|
@@ -10449,7 +10556,7 @@ async function previewBuildLogs(client, preview, opts) {
|
|
|
10449
10556
|
if (!preview.deploymentId) fail(`Preview "${preview.name}" has no deployment yet.`, void 0, "not_found");
|
|
10450
10557
|
const deploymentId = preview.deploymentId;
|
|
10451
10558
|
try {
|
|
10452
|
-
const dep = await client.data.
|
|
10559
|
+
const dep = await client.data.table(PREVIEW_DEPLOYMENTS_COLLECTION).findById(deploymentId);
|
|
10453
10560
|
if (!dep) fail(`Preview "${preview.name}"'s deployment ${deploymentId} is gone.`, void 0, "not_found");
|
|
10454
10561
|
const heading = () => {
|
|
10455
10562
|
console.log("");
|
|
@@ -10629,7 +10736,7 @@ async function listOrgs(rawArgs) {
|
|
|
10629
10736
|
});
|
|
10630
10737
|
const { client, url } = await requireClient(rawArgs);
|
|
10631
10738
|
try {
|
|
10632
|
-
const orgs = cloudRows((await client.data.
|
|
10739
|
+
const orgs = cloudRows((await client.data.table("organizations").find({ limit: 100 })).data);
|
|
10633
10740
|
const active = getContextOrg(url);
|
|
10634
10741
|
emit(() => {
|
|
10635
10742
|
console.log("");
|
|
@@ -10689,7 +10796,7 @@ async function createOrg(rawArgs) {
|
|
|
10689
10796
|
if (!name) fail("Organization name is required.", "Pass `--name <name>`.", "input_required");
|
|
10690
10797
|
const slug = (args["--slug"] || slugify(name)).trim();
|
|
10691
10798
|
try {
|
|
10692
|
-
const created = requireCloudRow(await client.data.
|
|
10799
|
+
const created = requireCloudRow(await client.data.table("organizations").create({
|
|
10693
10800
|
name,
|
|
10694
10801
|
slug,
|
|
10695
10802
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -10730,14 +10837,14 @@ function orgFor(flag, url) {
|
|
|
10730
10837
|
return org;
|
|
10731
10838
|
}
|
|
10732
10839
|
async function loadMembers(client, org) {
|
|
10733
|
-
const rows = cloudRows((await client.data.
|
|
10840
|
+
const rows = cloudRows((await client.data.table("organization-members").find({
|
|
10734
10841
|
where: { organization: ["==", org] },
|
|
10735
10842
|
limit: 200
|
|
10736
10843
|
})).data);
|
|
10737
10844
|
const ids = rows.map((m) => m.userId).filter((id) => typeof id === "string" && id !== "");
|
|
10738
10845
|
const emails = /* @__PURE__ */ new Map();
|
|
10739
10846
|
if (ids.length > 0) try {
|
|
10740
|
-
const users = cloudRows((await client.data.
|
|
10847
|
+
const users = cloudRows((await client.data.table("users").find({
|
|
10741
10848
|
where: { id: ["in", ids] },
|
|
10742
10849
|
limit: 200
|
|
10743
10850
|
})).data);
|
|
@@ -10878,7 +10985,7 @@ async function removeMember(rawArgs, orgFlag, ref, yes) {
|
|
|
10878
10985
|
prompt: `Remove ${who} (${target.role ?? "member"}) from org ${org}? They lose access to its projects.`
|
|
10879
10986
|
});
|
|
10880
10987
|
try {
|
|
10881
|
-
await client.data.
|
|
10988
|
+
await client.data.table("organization-members").delete(target.id);
|
|
10882
10989
|
} catch (e) {
|
|
10883
10990
|
reportError(e, `Failed to remove ${who}`);
|
|
10884
10991
|
}
|
|
@@ -10914,7 +11021,7 @@ async function changeRole(rawArgs, orgFlag, ref, role) {
|
|
|
10914
11021
|
return;
|
|
10915
11022
|
}
|
|
10916
11023
|
try {
|
|
10917
|
-
await client.data.
|
|
11024
|
+
await client.data.table("organization-members").update(target.id, { role });
|
|
10918
11025
|
} catch (e) {
|
|
10919
11026
|
reportError(e, `Failed to change ${who}'s role`);
|
|
10920
11027
|
}
|
|
@@ -11309,7 +11416,7 @@ async function addDomain(rawArgs) {
|
|
|
11309
11416
|
try {
|
|
11310
11417
|
const set = await loadDomains(client, projectId);
|
|
11311
11418
|
if (set.model === "column") {
|
|
11312
|
-
await client.data.
|
|
11419
|
+
await client.data.table("projects").update(projectId, { customDomain: domain });
|
|
11313
11420
|
added = columnEntry(await fetchColumnSetup(client, projectId))[0];
|
|
11314
11421
|
} else {
|
|
11315
11422
|
const legacy = set.domains.find((d) => d.id === null);
|
|
@@ -11422,7 +11529,7 @@ async function removeDomain(rawArgs) {
|
|
|
11422
11529
|
});
|
|
11423
11530
|
try {
|
|
11424
11531
|
let removed = true;
|
|
11425
|
-
if (target.id === null) await client.data.
|
|
11532
|
+
if (target.id === null) await client.data.table("projects").update(projectId, { customDomain: "" });
|
|
11426
11533
|
else removed = (await client.functions.invoke("domains", void 0, {
|
|
11427
11534
|
method: "DELETE",
|
|
11428
11535
|
path: `${projectId}/${target.id}`
|
|
@@ -11706,7 +11813,7 @@ async function showSettings(rawArgs) {
|
|
|
11706
11813
|
const projectId = await requireProject(rawArgs, client);
|
|
11707
11814
|
const projectRef = displayProjectRef(rawArgs);
|
|
11708
11815
|
try {
|
|
11709
|
-
const p = await client.data.
|
|
11816
|
+
const p = await client.data.table("projects").findById(projectId);
|
|
11710
11817
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "not_found");
|
|
11711
11818
|
emit(() => {
|
|
11712
11819
|
console.log("");
|
|
@@ -11793,7 +11900,7 @@ async function setSettings(rawArgs) {
|
|
|
11793
11900
|
const check = await client.functions.invoke("check-subdomain", { subdomain: patch.subdomain }).catch(() => void 0);
|
|
11794
11901
|
if (check && !check.available) fail(`Subdomain "${patch.subdomain}" is not available${check.reason ? ` (${check.reason})` : ""}.`, void 0, "subdomain_taken");
|
|
11795
11902
|
}
|
|
11796
|
-
await client.data.
|
|
11903
|
+
await client.data.table("projects").update(projectId, patch);
|
|
11797
11904
|
emit(() => success(`Updated ${Object.keys(patch).join(", ")} for project ${projectRef}`), {
|
|
11798
11905
|
success: true,
|
|
11799
11906
|
projectId,
|
|
@@ -11982,7 +12089,7 @@ function cancelView(res) {
|
|
|
11982
12089
|
};
|
|
11983
12090
|
}
|
|
11984
12091
|
async function fetchDeployments(client, projectId, limit = 100) {
|
|
11985
|
-
return cloudRows((await client.data.
|
|
12092
|
+
return cloudRows((await client.data.table("deployments").find({
|
|
11986
12093
|
where: { project: ["==", projectId] },
|
|
11987
12094
|
orderBy: ["createdAt", "desc"],
|
|
11988
12095
|
limit
|
|
@@ -12078,7 +12185,7 @@ function resolveDeploymentIdArg(rawArgs, command) {
|
|
|
12078
12185
|
async function deploymentOfProject(client, deploymentId, projectId) {
|
|
12079
12186
|
let row;
|
|
12080
12187
|
try {
|
|
12081
|
-
row = await client.data.
|
|
12188
|
+
row = await client.data.table("deployments").findById(deploymentId);
|
|
12082
12189
|
} catch {
|
|
12083
12190
|
return;
|
|
12084
12191
|
}
|
|
@@ -12182,7 +12289,7 @@ async function cancelCommand(rawArgs) {
|
|
|
12182
12289
|
* restart cause downtime, so they require `--yes` in non-interactive use.
|
|
12183
12290
|
*/
|
|
12184
12291
|
async function setStatus(client, projectId, status) {
|
|
12185
|
-
await client.data.
|
|
12292
|
+
await client.data.table("projects").update(projectId, { status });
|
|
12186
12293
|
}
|
|
12187
12294
|
async function powerCommand(action, rawArgs) {
|
|
12188
12295
|
const { flags: args } = parseCloudArgs({
|
|
@@ -13020,7 +13127,7 @@ async function connectToApp(client, origin, projectId) {
|
|
|
13020
13127
|
/**
|
|
13021
13128
|
* Report a failed call to the app. An older runtime has no guest routes, and
|
|
13022
13129
|
* its 404 is about the route, not about a guest; a repository without them (a
|
|
13023
|
-
*
|
|
13130
|
+
* custom auth repository) answers 501.
|
|
13024
13131
|
*/
|
|
13025
13132
|
function reportAppError(error, action, origin) {
|
|
13026
13133
|
if (error instanceof RebaseApiError) {
|
|
@@ -13585,11 +13692,11 @@ var ACTION_HELP = {
|
|
|
13585
13692
|
init: {
|
|
13586
13693
|
command: "cloud init",
|
|
13587
13694
|
usage: "cloud init --claim [--name <name>] [--no-deploy]",
|
|
13588
|
-
summary: "Provision a project on Rebase Cloud with no account, push this project's
|
|
13695
|
+
summary: "Provision a project on Rebase Cloud with no account, push this project's tables to it, and print its live URL and a claim link. Whoever opens the link and signs in owns the project; unclaimed, it is deleted after 72 hours. Sets REBASE_BASE_URL in .env and links this directory to the project; after the deploy, also REBASE_API_TOKEN, a key the app accepts for reading and writing data.",
|
|
13589
13696
|
flags: [
|
|
13590
13697
|
["--claim", "Required: provision an unclaimed project and print the link that claims it"],
|
|
13591
13698
|
["--name, -n <name>", "What to call the app. Default: a generated name"],
|
|
13592
|
-
["--no-deploy", "Provision and link only; push the
|
|
13699
|
+
["--no-deploy", "Provision and link only; push the tables later with `rebase cloud deploy`"]
|
|
13593
13700
|
],
|
|
13594
13701
|
examples: ["rebase cloud init --claim", "rebase cloud init --claim --name \"Todo app\" --json"],
|
|
13595
13702
|
notes: [
|
|
@@ -14258,23 +14365,29 @@ var ACTION_HELP = {
|
|
|
14258
14365
|
},
|
|
14259
14366
|
login: {
|
|
14260
14367
|
command: "cloud login",
|
|
14261
|
-
usage: "cloud login [--email <address>] [--password <password> | --code]",
|
|
14262
|
-
summary: "Sign in to the control plane and write the session to ~/.rebase/credentials.json.
|
|
14368
|
+
usage: "cloud login [--web] [--no-browser] | [--email <address>] [--password <password> | --code]",
|
|
14369
|
+
summary: "Sign in to the control plane and write the session to ~/.rebase/credentials.json. With no flags, signs in through the browser: prints a link and a short code, opens the browser, and waits while you approve the sign-in in the console, where you are signed in already or sign in with any method it offers (password, Google, GitHub, LinkedIn). Nothing is typed into the terminal.",
|
|
14263
14370
|
flags: [
|
|
14264
|
-
["--
|
|
14371
|
+
["--web", "Sign in through the browser. The default when the control plane offers it and no --email, --password or --code is given"],
|
|
14372
|
+
["--no-browser", "Print the link instead of opening the browser, for a terminal on another machine (over SSH)"],
|
|
14373
|
+
["--email, -e <address>", "Sign in with this account's email instead of the browser: its password, or an emailed code. Or REBASE_CLOUD_EMAIL with REBASE_CLOUD_PASSWORD"],
|
|
14265
14374
|
["--password <password>", "Discouraged: a password written here is recorded in your shell history and visible in the process table. Prefer the prompt, or REBASE_CLOUD_PASSWORD"],
|
|
14266
14375
|
["--code", "Sign in with a 6-digit code emailed to you instead of a password: the way in for accounts made with Google, GitHub or LinkedIn. Needs a terminal"]
|
|
14267
14376
|
],
|
|
14268
14377
|
examples: [
|
|
14269
14378
|
"rebase cloud login",
|
|
14379
|
+
"rebase cloud login --no-browser",
|
|
14270
14380
|
"rebase cloud login --email me@example.com",
|
|
14271
14381
|
"rebase cloud login --code --email me@example.com",
|
|
14272
14382
|
"rebase cloud login --url https://cloud.example.com"
|
|
14273
14383
|
],
|
|
14274
14384
|
notes: [
|
|
14275
|
-
"
|
|
14276
|
-
"
|
|
14277
|
-
"Without a terminal,
|
|
14385
|
+
"Check that the code the browser shows is the one the terminal printed before you approve: approving gives this terminal a session for the account signed in to that browser.",
|
|
14386
|
+
"The link expires after 10 minutes and works once. Denying it in the browser ends the login here.",
|
|
14387
|
+
"Without a terminal, or with --json, the link and code are printed on stderr and login keeps waiting for the approval, so an agent or script can hand the link to a person.",
|
|
14388
|
+
"With two-factor authentication on, approve from a console session that used it. With --email, login asks for the code from your authenticator app (or a recovery code) instead.",
|
|
14389
|
+
"A control plane that does not offer browser sign-in gets the email prompts, as before: at a terminal with no password given, login asks whether to use your password or an emailed code, when the control plane sends codes.",
|
|
14390
|
+
"Without a terminal, an email code or a second factor cannot be typed: create an access token in the console (Settings → Access tokens) and set REBASE_TOKEN instead.",
|
|
14278
14391
|
"--password warns, once, before the request: by the time a login succeeds the password is already in the history file.",
|
|
14279
14392
|
"CI should not log in at all: `rebase cloud tokens create` mints a token for REBASE_TOKEN. Where a login is still wanted, REBASE_CLOUD_EMAIL and REBASE_CLOUD_PASSWORD are how a secret store hands the credentials over without them appearing on a command line.",
|
|
14280
14393
|
"In a directory whose .rebase/cloud.json names a control plane you have not signed in to before, login names it and asks first, and refuses without a terminal: a cloned repository does not choose where your password goes. Pass --url <that host> to sign in there on purpose."
|
|
@@ -15179,4 +15292,4 @@ function printCloudHelp() {
|
|
|
15179
15292
|
//#endregion
|
|
15180
15293
|
export { CLOUD_GROUP_NAMES, GROUP_ALIASES, cloudCommand };
|
|
15181
15294
|
|
|
15182
|
-
//# sourceMappingURL=cloud-
|
|
15295
|
+
//# sourceMappingURL=cloud-CYMk92iG.js.map
|