@rebasepro/cli 0.30.1 → 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-DtADfWwn.js → cloud-CYMk92iG.js} +72 -71
- 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/context.d.ts +1 -1
- package/dist/commands/cloud/init.d.ts +2 -2
- 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-DtADfWwn.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
|
/**
|
|
@@ -549,7 +550,7 @@ function parseCapabilities(values) {
|
|
|
549
550
|
/** The organization a project belongs to, or undefined when its row does not say. */
|
|
550
551
|
async function projectOrganization(client, projectId) {
|
|
551
552
|
try {
|
|
552
|
-
const row = await client.data.
|
|
553
|
+
const row = await client.data.table("projects").findById(projectId);
|
|
553
554
|
const raw = row?.organization ?? row?.organizationId ?? row?.organization_id;
|
|
554
555
|
if (raw && typeof raw === "object" && "id" in raw) return String(raw.id);
|
|
555
556
|
return raw == null || raw === "" ? void 0 : String(raw);
|
|
@@ -826,7 +827,7 @@ async function loginCommand(rawArgs) {
|
|
|
826
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));
|
|
827
828
|
setCurrentContext(url);
|
|
828
829
|
try {
|
|
829
|
-
const orgs = await client.data.
|
|
830
|
+
const orgs = await client.data.table("organizations").find({ limit: 2 });
|
|
830
831
|
if (orgs.data.length === 1 && !getContextOrg(url)) setContextOrg(url, String(orgs.data[0].id));
|
|
831
832
|
} catch {}
|
|
832
833
|
success(`Logged in as ${chalk.bold(user.email ?? email)}`);
|
|
@@ -1157,12 +1158,12 @@ async function linkCommand(rawArgs) {
|
|
|
1157
1158
|
let project;
|
|
1158
1159
|
if (args["--project"]) {
|
|
1159
1160
|
const projectId = await resolveProjectRef(args["--project"], client);
|
|
1160
|
-
project = await client.data.
|
|
1161
|
+
project = await client.data.table("projects").findById(projectId);
|
|
1161
1162
|
if (!project) fail(`Project ${args["--project"]} not found.`, void 0, "project_not_found");
|
|
1162
1163
|
} else {
|
|
1163
1164
|
requireInteractive("a project to link", "--project <slug>");
|
|
1164
1165
|
const org = getContextOrg(url);
|
|
1165
|
-
const projects = cloudRows((await client.data.
|
|
1166
|
+
const projects = cloudRows((await client.data.table("projects").find({
|
|
1166
1167
|
where: org ? { organization: ["==", org] } : void 0,
|
|
1167
1168
|
limit: 100
|
|
1168
1169
|
})).data);
|
|
@@ -1252,7 +1253,7 @@ async function selectOrgCommand(rawArgs) {
|
|
|
1252
1253
|
const target = positionals[0];
|
|
1253
1254
|
const { client, url } = await requireClient(rawArgs);
|
|
1254
1255
|
try {
|
|
1255
|
-
const orgs = (await client.data.
|
|
1256
|
+
const orgs = (await client.data.table("organizations").find({ limit: 100 })).data;
|
|
1256
1257
|
if (orgs.length === 0) fail("You are not a member of any organization.", void 0, "no_orgs");
|
|
1257
1258
|
let chosen = target ? orgs.find((o) => String(o.id) === target || o.slug === target) : void 0;
|
|
1258
1259
|
if (!chosen && !target) {
|
|
@@ -1523,7 +1524,7 @@ async function statusCommand(rawArgs) {
|
|
|
1523
1524
|
const { client, url } = await requireClient(rawArgs);
|
|
1524
1525
|
const projectId = await requireProject(rawArgs, client);
|
|
1525
1526
|
try {
|
|
1526
|
-
const project = await client.data.
|
|
1527
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
1527
1528
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`, void 0, "not_found");
|
|
1528
1529
|
const [db, storage, deploy, baseDomain, maintenance] = await Promise.all([
|
|
1529
1530
|
firstRow(client, "databases", projectId),
|
|
@@ -1766,7 +1767,7 @@ async function storageCommand(action, rawArgs) {
|
|
|
1766
1767
|
const { client } = await requireClient(rawArgs);
|
|
1767
1768
|
const projectId = await requireProject(rawArgs, client);
|
|
1768
1769
|
try {
|
|
1769
|
-
const stores = (await client.data.
|
|
1770
|
+
const stores = (await client.data.table("storages").find({
|
|
1770
1771
|
where: { project: ["==", projectId] },
|
|
1771
1772
|
limit: 50
|
|
1772
1773
|
})).data;
|
|
@@ -1915,7 +1916,7 @@ async function storageAttachCommand(rawArgs) {
|
|
|
1915
1916
|
const projectId = await requireProject(rawArgs, client);
|
|
1916
1917
|
const sourceKey = (parsed["--source"] ?? "").trim() || DEFAULT_STORAGE_SOURCE_KEY;
|
|
1917
1918
|
try {
|
|
1918
|
-
const existing = (await client.data.
|
|
1919
|
+
const existing = (await client.data.table("storages").find({
|
|
1919
1920
|
where: { project: ["==", projectId] },
|
|
1920
1921
|
limit: 50
|
|
1921
1922
|
})).data.find((r) => {
|
|
@@ -1939,8 +1940,8 @@ async function storageAttachCommand(rawArgs) {
|
|
|
1939
1940
|
}
|
|
1940
1941
|
if (parsed["--force-path-style"]) row.s3ForcePathStyle = true;
|
|
1941
1942
|
const replaced = Boolean(existing?.id);
|
|
1942
|
-
if (existing?.id) await client.data.
|
|
1943
|
-
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);
|
|
1944
1945
|
success(`Storage attached to ${displayProjectRef(rawArgs)}.`);
|
|
1945
1946
|
emit(() => {
|
|
1946
1947
|
keyValues([
|
|
@@ -2132,7 +2133,7 @@ async function clustersAddCommand(rawArgs) {
|
|
|
2132
2133
|
const { kubeconfigPath: _path, ...columns } = args;
|
|
2133
2134
|
let created;
|
|
2134
2135
|
try {
|
|
2135
|
-
created = await client.data.
|
|
2136
|
+
created = await client.data.table("clusters").create({
|
|
2136
2137
|
...columns,
|
|
2137
2138
|
authType: "kubeconfig",
|
|
2138
2139
|
kubeConfigData
|
|
@@ -2258,7 +2259,7 @@ async function clustersRegistryCommand(rawArgs) {
|
|
|
2258
2259
|
}
|
|
2259
2260
|
const { client } = await requireClient(rawArgs);
|
|
2260
2261
|
try {
|
|
2261
|
-
await client.data.
|
|
2262
|
+
await client.data.table("clusters").update(args.id, columns);
|
|
2262
2263
|
} catch (error) {
|
|
2263
2264
|
reportError(error, "Could not record the cluster's registry");
|
|
2264
2265
|
return;
|
|
@@ -2295,7 +2296,7 @@ async function clustersListCommand(rawArgs) {
|
|
|
2295
2296
|
});
|
|
2296
2297
|
const { client } = await requireClient(rawArgs);
|
|
2297
2298
|
try {
|
|
2298
|
-
const clusters = (await client.data.
|
|
2299
|
+
const clusters = (await client.data.table("clusters").find({ limit: 100 })).data;
|
|
2299
2300
|
emit(() => {
|
|
2300
2301
|
console.log("");
|
|
2301
2302
|
console.log(chalk.bold(" ☸ Clusters"));
|
|
@@ -2401,7 +2402,7 @@ async function billingCommand(rawArgs) {
|
|
|
2401
2402
|
}
|
|
2402
2403
|
if (!org) fail("No active organization.", "Run `rebase cloud use` first.", "no_org");
|
|
2403
2404
|
try {
|
|
2404
|
-
const billingId = billingAccountIdOf(await client.data.
|
|
2405
|
+
const billingId = billingAccountIdOf(await client.data.table("organizations").findById(org));
|
|
2405
2406
|
if (!billingId) {
|
|
2406
2407
|
emit(() => {
|
|
2407
2408
|
console.log("");
|
|
@@ -2415,7 +2416,7 @@ async function billingCommand(rawArgs) {
|
|
|
2415
2416
|
});
|
|
2416
2417
|
return;
|
|
2417
2418
|
}
|
|
2418
|
-
const acct = await client.data.
|
|
2419
|
+
const acct = await client.data.table("billing-accounts").findById(billingId);
|
|
2419
2420
|
let card = {};
|
|
2420
2421
|
try {
|
|
2421
2422
|
card = await client.functions.invoke("stripe-billing", void 0, {
|
|
@@ -2434,7 +2435,7 @@ async function billingCommand(rawArgs) {
|
|
|
2434
2435
|
})["--project"] || readLink()?.projectId;
|
|
2435
2436
|
const projectId = ref ? await lookupProjectId(ref, client) : void 0;
|
|
2436
2437
|
if (projectId) {
|
|
2437
|
-
const proj = await client.data.
|
|
2438
|
+
const proj = await client.data.table("projects").findById(projectId);
|
|
2438
2439
|
const hasCluster = proj?.cluster_id != null || proj?.cluster != null;
|
|
2439
2440
|
monthly = `€${(await client.functions.invoke("pricing", proj, {
|
|
2440
2441
|
method: "POST",
|
|
@@ -2574,7 +2575,7 @@ async function computeCommand(action, rawArgs) {
|
|
|
2574
2575
|
});
|
|
2575
2576
|
const { client } = await requireClient(rawArgs);
|
|
2576
2577
|
const projectId = await requireProject(rawArgs, client);
|
|
2577
|
-
const project = await client.data.
|
|
2578
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
2578
2579
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`, void 0, "not_found");
|
|
2579
2580
|
if (action !== "set") {
|
|
2580
2581
|
let quote;
|
|
@@ -2649,7 +2650,7 @@ async function computeCommand(action, rawArgs) {
|
|
|
2649
2650
|
if (built.error) fail(built.error, void 0, "bad_request");
|
|
2650
2651
|
const patch = built.patch;
|
|
2651
2652
|
try {
|
|
2652
|
-
await client.data.
|
|
2653
|
+
await client.data.table("projects").update(projectId, patch);
|
|
2653
2654
|
} catch (error) {
|
|
2654
2655
|
reportError(error, "Could not change resources");
|
|
2655
2656
|
return;
|
|
@@ -3200,7 +3201,7 @@ async function listDatabases(rawArgs) {
|
|
|
3200
3201
|
const projectId = await requireProject(rawArgs, client);
|
|
3201
3202
|
const projectRef = displayProjectRef(rawArgs);
|
|
3202
3203
|
try {
|
|
3203
|
-
const dbs = cloudRows((await client.data.
|
|
3204
|
+
const dbs = cloudRows((await client.data.table("databases").find({
|
|
3204
3205
|
where: { project: ["==", projectId] },
|
|
3205
3206
|
limit: 50
|
|
3206
3207
|
})).data);
|
|
@@ -3240,7 +3241,7 @@ async function listDatabases(rawArgs) {
|
|
|
3240
3241
|
* point, since the answer decides which row a deploy will actually use.
|
|
3241
3242
|
*/
|
|
3242
3243
|
async function firstAttachedDatabase(client, projectId) {
|
|
3243
|
-
return cloudRows((await client.data.
|
|
3244
|
+
return cloudRows((await client.data.table("databases").find({
|
|
3244
3245
|
where: { project: ["==", projectId] },
|
|
3245
3246
|
limit: 1
|
|
3246
3247
|
})).data)[0];
|
|
@@ -3254,7 +3255,7 @@ async function firstAttachedDatabase(client, projectId) {
|
|
|
3254
3255
|
* afterwards".
|
|
3255
3256
|
*/
|
|
3256
3257
|
async function attachDatabaseRow(client, input) {
|
|
3257
|
-
return requireCloudRow(await client.data.
|
|
3258
|
+
return requireCloudRow(await client.data.table("databases").create({
|
|
3258
3259
|
project: input.projectId,
|
|
3259
3260
|
type: input.type,
|
|
3260
3261
|
connectionString: input.type === "byodb" ? input.connectionString : void 0,
|
|
@@ -3862,7 +3863,7 @@ async function listProjects(rawArgs) {
|
|
|
3862
3863
|
const { client, url } = await requireClient(rawArgs);
|
|
3863
3864
|
const org = args["--all-orgs"] ? void 0 : getContextOrg(url);
|
|
3864
3865
|
try {
|
|
3865
|
-
const [projects, baseDomain] = await Promise.all([client.data.
|
|
3866
|
+
const [projects, baseDomain] = await Promise.all([client.data.table("projects").find({
|
|
3866
3867
|
where: org ? { organization: ["==", org] } : void 0,
|
|
3867
3868
|
orderBy: ["name", "asc"],
|
|
3868
3869
|
limit: 100
|
|
@@ -4050,7 +4051,7 @@ async function createProject(rawArgs) {
|
|
|
4050
4051
|
try {
|
|
4051
4052
|
const user = await client.auth.getUser();
|
|
4052
4053
|
if (!user) fail("Session is no longer valid.", "Run `rebase cloud login` again.", "session_invalid");
|
|
4053
|
-
const created = requireCloudRow(await client.data.
|
|
4054
|
+
const created = requireCloudRow(await client.data.table("projects").create({
|
|
4054
4055
|
name,
|
|
4055
4056
|
subdomain,
|
|
4056
4057
|
gitRepoUrl,
|
|
@@ -4207,7 +4208,7 @@ async function projectInfo(rawArgs, projectRef) {
|
|
|
4207
4208
|
const { client, url } = await requireClient(rawArgs);
|
|
4208
4209
|
try {
|
|
4209
4210
|
const projectId = await resolveProjectRef(projectRef, client);
|
|
4210
|
-
const p = await client.data.
|
|
4211
|
+
const p = await client.data.table("projects").findById(projectId);
|
|
4211
4212
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "project_not_found");
|
|
4212
4213
|
const [db, lastDeploy, baseDomain, capacity] = await Promise.all([
|
|
4213
4214
|
firstRow(client, "databases", projectId),
|
|
@@ -4274,14 +4275,14 @@ async function deleteProject(rawArgs, projectRef) {
|
|
|
4274
4275
|
});
|
|
4275
4276
|
const { client } = await requireClient(rawArgs);
|
|
4276
4277
|
const projectId = await resolveProjectRef(projectRef, client);
|
|
4277
|
-
const p = await client.data.
|
|
4278
|
+
const p = await client.data.table("projects").findById(projectId).catch(() => void 0);
|
|
4278
4279
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "project_not_found");
|
|
4279
4280
|
await confirmDestructive({
|
|
4280
4281
|
yes: Boolean(args["--yes"]),
|
|
4281
4282
|
prompt: `Permanently delete project "${p.name ?? projectRef}" (${p.subdomain ?? projectRef})? This tears down its deployment.`
|
|
4282
4283
|
});
|
|
4283
4284
|
try {
|
|
4284
|
-
await client.data.
|
|
4285
|
+
await client.data.table("projects").delete(projectId);
|
|
4285
4286
|
success(`Deleted project ${chalk.bold(p.name ?? projectId)}`);
|
|
4286
4287
|
emit(() => {}, {
|
|
4287
4288
|
success: true,
|
|
@@ -4294,13 +4295,13 @@ async function deleteProject(rawArgs, projectRef) {
|
|
|
4294
4295
|
}
|
|
4295
4296
|
}
|
|
4296
4297
|
async function firstRow(client, collection, projectId) {
|
|
4297
|
-
return (await client.data.
|
|
4298
|
+
return (await client.data.table(collection).find({
|
|
4298
4299
|
where: { project: ["==", projectId] },
|
|
4299
4300
|
limit: 1
|
|
4300
4301
|
})).data[0];
|
|
4301
4302
|
}
|
|
4302
4303
|
async function latestDeployment(client, projectId) {
|
|
4303
|
-
return (await client.data.
|
|
4304
|
+
return (await client.data.table("deployments").find({
|
|
4304
4305
|
where: { project: ["==", projectId] },
|
|
4305
4306
|
orderBy: ["createdAt", "desc"],
|
|
4306
4307
|
limit: 1
|
|
@@ -4456,11 +4457,11 @@ var PROBES = [
|
|
|
4456
4457
|
};
|
|
4457
4458
|
if (status === 200) return {
|
|
4458
4459
|
verdict: "warn",
|
|
4459
|
-
meaning: "this
|
|
4460
|
+
meaning: "this table is readable with NO authentication — correct only if it is deliberately public"
|
|
4460
4461
|
};
|
|
4461
4462
|
if (status === 404) return {
|
|
4462
4463
|
verdict: "warn",
|
|
4463
|
-
meaning: "no such
|
|
4464
|
+
meaning: "no such table on this deployment — check the name, or pass --collection"
|
|
4464
4465
|
};
|
|
4465
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");
|
|
4466
4467
|
return {
|
|
@@ -4868,7 +4869,7 @@ async function resolveOrigin(rawArgs, client, url, projectId) {
|
|
|
4868
4869
|
const h = parsed["--host"].trim().replace(/\/+$/, "");
|
|
4869
4870
|
return /^https?:\/\//.test(h) ? h : `https://${h}`;
|
|
4870
4871
|
}
|
|
4871
|
-
const [project, baseDomain] = await Promise.all([client.data.
|
|
4872
|
+
const [project, baseDomain] = await Promise.all([client.data.table("projects").findById(projectId), fetchTenantBaseDomain(client, url)]);
|
|
4872
4873
|
if (!project) fail(`Project ${displayProjectRef(rawArgs)} not found.`);
|
|
4873
4874
|
const host = projectHost(project, baseDomain);
|
|
4874
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.");
|
|
@@ -5325,7 +5326,7 @@ function printDebugHelp() {
|
|
|
5325
5326
|
description: "Probe the live URL and explain every status code (the default)",
|
|
5326
5327
|
flags: [
|
|
5327
5328
|
["--host <hostname>", "Probe this address instead of the project's own"],
|
|
5328
|
-
["--collection <name>", "
|
|
5329
|
+
["--collection <name>", "Table for the unauth-read probe. Default: users"],
|
|
5329
5330
|
["--function <name>", "Also assert this function loaded, against the listing"]
|
|
5330
5331
|
]
|
|
5331
5332
|
},
|
|
@@ -6232,7 +6233,7 @@ function printEnvHelp() {
|
|
|
6232
6233
|
*
|
|
6233
6234
|
* The command an agent runs when it has built an app and needs somewhere to
|
|
6234
6235
|
* put it. The control plane provisions an ordinary project on Rebase Cloud in
|
|
6235
|
-
* an organization nobody owns yet, this command pushes the local
|
|
6236
|
+
* an organization nobody owns yet, this command pushes the local tables to
|
|
6236
6237
|
* it with a normal managed deploy, and what comes back is the live URL and a
|
|
6237
6238
|
* claim link. The person the agent works for opens the link, signs in, and the
|
|
6238
6239
|
* project is theirs; nobody claims it within 72 hours and it is deleted.
|
|
@@ -6494,7 +6495,7 @@ function adminPanelUrl(projectRoot, projectUrl) {
|
|
|
6494
6495
|
* `REBASE_TOKEN` outranks the stored grant (see `requireClient`), and a shell
|
|
6495
6496
|
* or an MCP server that has one holds it for the person's other projects — it
|
|
6496
6497
|
* has no scope on the project just provisioned, so the deploy was refused and
|
|
6497
|
-
* the project never got its
|
|
6498
|
+
* the project never got its tables. The project is deployed with its own
|
|
6498
6499
|
* token.
|
|
6499
6500
|
*/
|
|
6500
6501
|
function bundleDeployEnv(env) {
|
|
@@ -6506,7 +6507,7 @@ function bundleDeployEnv(env) {
|
|
|
6506
6507
|
return child;
|
|
6507
6508
|
}
|
|
6508
6509
|
/**
|
|
6509
|
-
* Push the local
|
|
6510
|
+
* Push the local tables: `rebase cloud deploy --bundle`, as a child.
|
|
6510
6511
|
*
|
|
6511
6512
|
* A child rather than a call, so this command still prints exactly one
|
|
6512
6513
|
* result — a JSON caller gets the deploy's outcome folded into it — and still
|
|
@@ -6591,7 +6592,7 @@ async function cloudInitCommand(rawArgs, deps = DEFAULT_DEPS) {
|
|
|
6591
6592
|
let deployed;
|
|
6592
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.");
|
|
6593
6594
|
else {
|
|
6594
|
-
note("Pushing the local
|
|
6595
|
+
note("Pushing the local tables (rebase cloud deploy --bundle)…");
|
|
6595
6596
|
noteBlank();
|
|
6596
6597
|
deployed = await deps.deploy(root, isJsonMode());
|
|
6597
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.");
|
|
@@ -8128,7 +8129,7 @@ async function previewCost(client, url, projectId) {
|
|
|
8128
8129
|
};
|
|
8129
8130
|
let project;
|
|
8130
8131
|
try {
|
|
8131
|
-
project = await client.data.
|
|
8132
|
+
project = await client.data.table("projects").findById(projectId);
|
|
8132
8133
|
} catch {
|
|
8133
8134
|
return cost;
|
|
8134
8135
|
}
|
|
@@ -9731,7 +9732,7 @@ function warningPayload(warnings) {
|
|
|
9731
9732
|
*/
|
|
9732
9733
|
async function readDeployContext(client, projectId) {
|
|
9733
9734
|
try {
|
|
9734
|
-
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({
|
|
9735
9736
|
where: { project: ["==", projectId] },
|
|
9736
9737
|
orderBy: ["createdAt", "desc"],
|
|
9737
9738
|
limit: 25
|
|
@@ -9782,7 +9783,7 @@ async function readBillingState(client, projectId) {
|
|
|
9782
9783
|
simulated: false
|
|
9783
9784
|
};
|
|
9784
9785
|
try {
|
|
9785
|
-
const project = await client.data.
|
|
9786
|
+
const project = await client.data.table("projects").findById(projectId);
|
|
9786
9787
|
const orgRaw = project?.organization ?? project?.organizationId ?? project?.organization_id;
|
|
9787
9788
|
const org = orgRaw == null ? "" : String(orgRaw);
|
|
9788
9789
|
if (!org) return unknown;
|
|
@@ -9793,9 +9794,9 @@ async function readBillingState(client, projectId) {
|
|
|
9793
9794
|
if (!card) return unknown;
|
|
9794
9795
|
let plan = null;
|
|
9795
9796
|
try {
|
|
9796
|
-
const billingId = billingAccountIdOf(await client.data.
|
|
9797
|
+
const billingId = billingAccountIdOf(await client.data.table("organizations").findById(org));
|
|
9797
9798
|
if (billingId != null) {
|
|
9798
|
-
const acct = await client.data.
|
|
9799
|
+
const acct = await client.data.table("billing-accounts").findById(billingId);
|
|
9799
9800
|
plan = typeof acct?.plan === "string" ? acct.plan : null;
|
|
9800
9801
|
}
|
|
9801
9802
|
} catch {}
|
|
@@ -10150,7 +10151,7 @@ function resolveTriggerFailure(e, fallback = "Failed to trigger deployment") {
|
|
|
10150
10151
|
*/
|
|
10151
10152
|
async function platformRebuildsOff(client, projectId) {
|
|
10152
10153
|
try {
|
|
10153
|
-
const row = await client.data.
|
|
10154
|
+
const row = await client.data.table("projects").findById(projectId);
|
|
10154
10155
|
return typeof row === "object" && row !== null && "platformRebuilds" in row && row.platformRebuilds === false;
|
|
10155
10156
|
} catch {
|
|
10156
10157
|
return false;
|
|
@@ -10210,7 +10211,7 @@ function intakeRefusal(e) {
|
|
|
10210
10211
|
async function deployedUrl(client, opts) {
|
|
10211
10212
|
if (!opts.projectId || !opts.url) return void 0;
|
|
10212
10213
|
try {
|
|
10213
|
-
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)]);
|
|
10214
10215
|
if (!project) return void 0;
|
|
10215
10216
|
return projectHost(project, baseDomain);
|
|
10216
10217
|
} catch {
|
|
@@ -10288,7 +10289,7 @@ async function streamBuildLogs(client, deploymentId, opts = {}) {
|
|
|
10288
10289
|
for (;;) {
|
|
10289
10290
|
let dep;
|
|
10290
10291
|
try {
|
|
10291
|
-
dep = await client.data.
|
|
10292
|
+
dep = await client.data.table(opts.collection ?? "deployments").findById(deploymentId);
|
|
10292
10293
|
unreadableSince = void 0;
|
|
10293
10294
|
} catch (e) {
|
|
10294
10295
|
if (!transientReadFailure(e)) reportError(e, "Failed to read deployment status");
|
|
@@ -10555,7 +10556,7 @@ async function previewBuildLogs(client, preview, opts) {
|
|
|
10555
10556
|
if (!preview.deploymentId) fail(`Preview "${preview.name}" has no deployment yet.`, void 0, "not_found");
|
|
10556
10557
|
const deploymentId = preview.deploymentId;
|
|
10557
10558
|
try {
|
|
10558
|
-
const dep = await client.data.
|
|
10559
|
+
const dep = await client.data.table(PREVIEW_DEPLOYMENTS_COLLECTION).findById(deploymentId);
|
|
10559
10560
|
if (!dep) fail(`Preview "${preview.name}"'s deployment ${deploymentId} is gone.`, void 0, "not_found");
|
|
10560
10561
|
const heading = () => {
|
|
10561
10562
|
console.log("");
|
|
@@ -10735,7 +10736,7 @@ async function listOrgs(rawArgs) {
|
|
|
10735
10736
|
});
|
|
10736
10737
|
const { client, url } = await requireClient(rawArgs);
|
|
10737
10738
|
try {
|
|
10738
|
-
const orgs = cloudRows((await client.data.
|
|
10739
|
+
const orgs = cloudRows((await client.data.table("organizations").find({ limit: 100 })).data);
|
|
10739
10740
|
const active = getContextOrg(url);
|
|
10740
10741
|
emit(() => {
|
|
10741
10742
|
console.log("");
|
|
@@ -10795,7 +10796,7 @@ async function createOrg(rawArgs) {
|
|
|
10795
10796
|
if (!name) fail("Organization name is required.", "Pass `--name <name>`.", "input_required");
|
|
10796
10797
|
const slug = (args["--slug"] || slugify(name)).trim();
|
|
10797
10798
|
try {
|
|
10798
|
-
const created = requireCloudRow(await client.data.
|
|
10799
|
+
const created = requireCloudRow(await client.data.table("organizations").create({
|
|
10799
10800
|
name,
|
|
10800
10801
|
slug,
|
|
10801
10802
|
createdAt: (/* @__PURE__ */ new Date()).toISOString()
|
|
@@ -10836,14 +10837,14 @@ function orgFor(flag, url) {
|
|
|
10836
10837
|
return org;
|
|
10837
10838
|
}
|
|
10838
10839
|
async function loadMembers(client, org) {
|
|
10839
|
-
const rows = cloudRows((await client.data.
|
|
10840
|
+
const rows = cloudRows((await client.data.table("organization-members").find({
|
|
10840
10841
|
where: { organization: ["==", org] },
|
|
10841
10842
|
limit: 200
|
|
10842
10843
|
})).data);
|
|
10843
10844
|
const ids = rows.map((m) => m.userId).filter((id) => typeof id === "string" && id !== "");
|
|
10844
10845
|
const emails = /* @__PURE__ */ new Map();
|
|
10845
10846
|
if (ids.length > 0) try {
|
|
10846
|
-
const users = cloudRows((await client.data.
|
|
10847
|
+
const users = cloudRows((await client.data.table("users").find({
|
|
10847
10848
|
where: { id: ["in", ids] },
|
|
10848
10849
|
limit: 200
|
|
10849
10850
|
})).data);
|
|
@@ -10984,7 +10985,7 @@ async function removeMember(rawArgs, orgFlag, ref, yes) {
|
|
|
10984
10985
|
prompt: `Remove ${who} (${target.role ?? "member"}) from org ${org}? They lose access to its projects.`
|
|
10985
10986
|
});
|
|
10986
10987
|
try {
|
|
10987
|
-
await client.data.
|
|
10988
|
+
await client.data.table("organization-members").delete(target.id);
|
|
10988
10989
|
} catch (e) {
|
|
10989
10990
|
reportError(e, `Failed to remove ${who}`);
|
|
10990
10991
|
}
|
|
@@ -11020,7 +11021,7 @@ async function changeRole(rawArgs, orgFlag, ref, role) {
|
|
|
11020
11021
|
return;
|
|
11021
11022
|
}
|
|
11022
11023
|
try {
|
|
11023
|
-
await client.data.
|
|
11024
|
+
await client.data.table("organization-members").update(target.id, { role });
|
|
11024
11025
|
} catch (e) {
|
|
11025
11026
|
reportError(e, `Failed to change ${who}'s role`);
|
|
11026
11027
|
}
|
|
@@ -11415,7 +11416,7 @@ async function addDomain(rawArgs) {
|
|
|
11415
11416
|
try {
|
|
11416
11417
|
const set = await loadDomains(client, projectId);
|
|
11417
11418
|
if (set.model === "column") {
|
|
11418
|
-
await client.data.
|
|
11419
|
+
await client.data.table("projects").update(projectId, { customDomain: domain });
|
|
11419
11420
|
added = columnEntry(await fetchColumnSetup(client, projectId))[0];
|
|
11420
11421
|
} else {
|
|
11421
11422
|
const legacy = set.domains.find((d) => d.id === null);
|
|
@@ -11528,7 +11529,7 @@ async function removeDomain(rawArgs) {
|
|
|
11528
11529
|
});
|
|
11529
11530
|
try {
|
|
11530
11531
|
let removed = true;
|
|
11531
|
-
if (target.id === null) await client.data.
|
|
11532
|
+
if (target.id === null) await client.data.table("projects").update(projectId, { customDomain: "" });
|
|
11532
11533
|
else removed = (await client.functions.invoke("domains", void 0, {
|
|
11533
11534
|
method: "DELETE",
|
|
11534
11535
|
path: `${projectId}/${target.id}`
|
|
@@ -11812,7 +11813,7 @@ async function showSettings(rawArgs) {
|
|
|
11812
11813
|
const projectId = await requireProject(rawArgs, client);
|
|
11813
11814
|
const projectRef = displayProjectRef(rawArgs);
|
|
11814
11815
|
try {
|
|
11815
|
-
const p = await client.data.
|
|
11816
|
+
const p = await client.data.table("projects").findById(projectId);
|
|
11816
11817
|
if (!p) fail(`Project ${projectRef} not found.`, void 0, "not_found");
|
|
11817
11818
|
emit(() => {
|
|
11818
11819
|
console.log("");
|
|
@@ -11899,7 +11900,7 @@ async function setSettings(rawArgs) {
|
|
|
11899
11900
|
const check = await client.functions.invoke("check-subdomain", { subdomain: patch.subdomain }).catch(() => void 0);
|
|
11900
11901
|
if (check && !check.available) fail(`Subdomain "${patch.subdomain}" is not available${check.reason ? ` (${check.reason})` : ""}.`, void 0, "subdomain_taken");
|
|
11901
11902
|
}
|
|
11902
|
-
await client.data.
|
|
11903
|
+
await client.data.table("projects").update(projectId, patch);
|
|
11903
11904
|
emit(() => success(`Updated ${Object.keys(patch).join(", ")} for project ${projectRef}`), {
|
|
11904
11905
|
success: true,
|
|
11905
11906
|
projectId,
|
|
@@ -12088,7 +12089,7 @@ function cancelView(res) {
|
|
|
12088
12089
|
};
|
|
12089
12090
|
}
|
|
12090
12091
|
async function fetchDeployments(client, projectId, limit = 100) {
|
|
12091
|
-
return cloudRows((await client.data.
|
|
12092
|
+
return cloudRows((await client.data.table("deployments").find({
|
|
12092
12093
|
where: { project: ["==", projectId] },
|
|
12093
12094
|
orderBy: ["createdAt", "desc"],
|
|
12094
12095
|
limit
|
|
@@ -12184,7 +12185,7 @@ function resolveDeploymentIdArg(rawArgs, command) {
|
|
|
12184
12185
|
async function deploymentOfProject(client, deploymentId, projectId) {
|
|
12185
12186
|
let row;
|
|
12186
12187
|
try {
|
|
12187
|
-
row = await client.data.
|
|
12188
|
+
row = await client.data.table("deployments").findById(deploymentId);
|
|
12188
12189
|
} catch {
|
|
12189
12190
|
return;
|
|
12190
12191
|
}
|
|
@@ -12288,7 +12289,7 @@ async function cancelCommand(rawArgs) {
|
|
|
12288
12289
|
* restart cause downtime, so they require `--yes` in non-interactive use.
|
|
12289
12290
|
*/
|
|
12290
12291
|
async function setStatus(client, projectId, status) {
|
|
12291
|
-
await client.data.
|
|
12292
|
+
await client.data.table("projects").update(projectId, { status });
|
|
12292
12293
|
}
|
|
12293
12294
|
async function powerCommand(action, rawArgs) {
|
|
12294
12295
|
const { flags: args } = parseCloudArgs({
|
|
@@ -13126,7 +13127,7 @@ async function connectToApp(client, origin, projectId) {
|
|
|
13126
13127
|
/**
|
|
13127
13128
|
* Report a failed call to the app. An older runtime has no guest routes, and
|
|
13128
13129
|
* its 404 is about the route, not about a guest; a repository without them (a
|
|
13129
|
-
*
|
|
13130
|
+
* custom auth repository) answers 501.
|
|
13130
13131
|
*/
|
|
13131
13132
|
function reportAppError(error, action, origin) {
|
|
13132
13133
|
if (error instanceof RebaseApiError) {
|
|
@@ -13691,11 +13692,11 @@ var ACTION_HELP = {
|
|
|
13691
13692
|
init: {
|
|
13692
13693
|
command: "cloud init",
|
|
13693
13694
|
usage: "cloud init --claim [--name <name>] [--no-deploy]",
|
|
13694
|
-
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.",
|
|
13695
13696
|
flags: [
|
|
13696
13697
|
["--claim", "Required: provision an unclaimed project and print the link that claims it"],
|
|
13697
13698
|
["--name, -n <name>", "What to call the app. Default: a generated name"],
|
|
13698
|
-
["--no-deploy", "Provision and link only; push the
|
|
13699
|
+
["--no-deploy", "Provision and link only; push the tables later with `rebase cloud deploy`"]
|
|
13699
13700
|
],
|
|
13700
13701
|
examples: ["rebase cloud init --claim", "rebase cloud init --claim --name \"Todo app\" --json"],
|
|
13701
13702
|
notes: [
|
|
@@ -15291,4 +15292,4 @@ function printCloudHelp() {
|
|
|
15291
15292
|
//#endregion
|
|
15292
15293
|
export { CLOUD_GROUP_NAMES, GROUP_ALIASES, cloudCommand };
|
|
15293
15294
|
|
|
15294
|
-
//# sourceMappingURL=cloud-
|
|
15295
|
+
//# sourceMappingURL=cloud-CYMk92iG.js.map
|