@rebasepro/cli 0.33.2 → 0.34.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (95) hide show
  1. package/dist/{agent-setup-Cg_zBWoW.js → agent-setup-CGeAuP0Q.js} +2 -2
  2. package/dist/{agent-setup-Cg_zBWoW.js.map → agent-setup-CGeAuP0Q.js.map} +1 -1
  3. package/dist/{api-keys-fPQ55DCm.js → api-keys-DaWN8dyI.js} +3 -3
  4. package/dist/{api-keys-fPQ55DCm.js.map → api-keys-DaWN8dyI.js.map} +1 -1
  5. package/dist/{api-TbmW33D7.js → api-zx1wSK5a.js} +2 -2
  6. package/dist/{api-TbmW33D7.js.map → api-zx1wSK5a.js.map} +1 -1
  7. package/dist/{apps-DBTRoOeP.js → apps-D6vtDrkJ.js} +3 -3
  8. package/dist/{apps-DBTRoOeP.js.map → apps-D6vtDrkJ.js.map} +1 -1
  9. package/dist/{auth-BpyYLEFY.js → auth-DY7kU0z-.js} +8 -8
  10. package/dist/{auth-BpyYLEFY.js.map → auth-DY7kU0z-.js.map} +1 -1
  11. package/dist/{auth-session-B6aT0Dyj.js → auth-session-DCG96UGH.js} +4 -4
  12. package/dist/{auth-session-B6aT0Dyj.js.map → auth-session-DCG96UGH.js.map} +1 -1
  13. package/dist/{build-E5hfEWKj.js → build-D0egCUfU.js} +4 -4
  14. package/dist/{build-E5hfEWKj.js.map → build-D0egCUfU.js.map} +1 -1
  15. package/dist/{bundle-CIiKGrte.js → bundle-DhdhtD8K.js} +3 -3
  16. package/dist/{bundle-CIiKGrte.js.map → bundle-DhdhtD8K.js.map} +1 -1
  17. package/dist/{cloud-DNJyUU0T.js → cloud-DOR7bxDw.js} +218 -27
  18. package/dist/cloud-DOR7bxDw.js.map +1 -0
  19. package/dist/{command-Bks5xkrQ.js → command-BzSP5gBh.js} +2 -2
  20. package/dist/{command-Bks5xkrQ.js.map → command-BzSP5gBh.js.map} +1 -1
  21. package/dist/commands/cloud/db-connect.d.ts +31 -1
  22. package/dist/commands/cloud/db-query.d.ts +16 -0
  23. package/dist/commands/cloud/index.d.ts +1 -0
  24. package/dist/commands/cloud/resources.d.ts +19 -1
  25. package/dist/commands/dev.d.ts +15 -0
  26. package/dist/commands/users.d.ts +1 -0
  27. package/dist/{context-BOMEoKxn.js → context-xt20FMFA.js} +5 -1
  28. package/dist/{context-BOMEoKxn.js.map → context-xt20FMFA.js.map} +1 -1
  29. package/dist/{cron-CpUsQ739.js → cron-BGkXIB1N.js} +4 -4
  30. package/dist/{cron-CpUsQ739.js.map → cron-BGkXIB1N.js.map} +1 -1
  31. package/dist/{cron-ZRXsla0v.js → cron-CJ6Xk42E.js} +3 -3
  32. package/dist/{cron-ZRXsla0v.js.map → cron-CJ6Xk42E.js.map} +1 -1
  33. package/dist/{data-BJ9AZFUC.js → data-BpkvtCUe.js} +3 -3
  34. package/dist/{data-BJ9AZFUC.js.map → data-BpkvtCUe.js.map} +1 -1
  35. package/dist/{debug-nNbbxAeo.js → debug-C7Ss34XB.js} +2 -2
  36. package/dist/{debug-nNbbxAeo.js.map → debug-C7Ss34XB.js.map} +1 -1
  37. package/dist/{derive-Mky_u59_.js → derive-ChP6vgfi.js} +2 -2
  38. package/dist/{derive-Mky_u59_.js.map → derive-ChP6vgfi.js.map} +1 -1
  39. package/dist/{dev-bj6dEeSQ.js → dev-C7n36E6f.js} +23 -2
  40. package/dist/dev-C7n36E6f.js.map +1 -0
  41. package/dist/{doctor-FaBObSlb.js → doctor-D0o54XSQ.js} +2 -2
  42. package/dist/{doctor-FaBObSlb.js.map → doctor-D0o54XSQ.js.map} +1 -1
  43. package/dist/{fold-static-2t3UUX4z.js → fold-static-DTpaqbB0.js} +2 -2
  44. package/dist/{fold-static-2t3UUX4z.js.map → fold-static-DTpaqbB0.js.map} +1 -1
  45. package/dist/{function-portability-BIvlvR9q.js → function-portability-Dppl6uqg.js} +24 -5
  46. package/dist/{function-portability-BIvlvR9q.js.map → function-portability-Dppl6uqg.js.map} +1 -1
  47. package/dist/function-portability.d.ts +9 -0
  48. package/dist/{functions-B4JR6EZL.js → functions-DLuuldt2.js} +4 -4
  49. package/dist/{functions-B4JR6EZL.js.map → functions-DLuuldt2.js.map} +1 -1
  50. package/dist/{generate_sdk-ByD-gTsK.js → generate_sdk-UT1lwwRT.js} +2 -2
  51. package/dist/{generate_sdk-ByD-gTsK.js.map → generate_sdk-UT1lwwRT.js.map} +1 -1
  52. package/dist/index.es.js +39 -39
  53. package/dist/{init-DHCe5mJ5.js → init-u5Xmr1Ct.js} +4 -4
  54. package/dist/{init-DHCe5mJ5.js.map → init-u5Xmr1Ct.js.map} +1 -1
  55. package/dist/{logs-DpuMukJe.js → logs-DBYRSs6W.js} +4 -4
  56. package/dist/{logs-DpuMukJe.js.map → logs-DBYRSs6W.js.map} +1 -1
  57. package/dist/{migrate-CSY9ZDKy.js → migrate-Cw1FkvUK.js} +3 -3
  58. package/dist/{migrate-CSY9ZDKy.js.map → migrate-Cw1FkvUK.js.map} +1 -1
  59. package/dist/{normalize-imports-P86NVfpo.js → normalize-imports-E4yA1HfW.js} +2 -2
  60. package/dist/{normalize-imports-P86NVfpo.js.map → normalize-imports-E4yA1HfW.js.map} +1 -1
  61. package/dist/{project-command-Cl9EZzjr.js → project-command-7EGMemEy.js} +5 -5
  62. package/dist/{project-command-Cl9EZzjr.js.map → project-command-7EGMemEy.js.map} +1 -1
  63. package/dist/{resources-Db3USuPO.js → resources-CE6BeL94.js} +2 -2
  64. package/dist/{resources-Db3USuPO.js.map → resources-CE6BeL94.js.map} +1 -1
  65. package/dist/{rls-BxrQ0P50.js → rls-BxWLfEKl.js} +3 -3
  66. package/dist/{rls-BxrQ0P50.js.map → rls-BxWLfEKl.js.map} +1 -1
  67. package/dist/{schema-_FzZEoB8.js → schema-D8xFSBbN.js} +7 -6
  68. package/dist/{schema-_FzZEoB8.js.map → schema-D8xFSBbN.js.map} +1 -1
  69. package/dist/schema-reconcile-D_wvZY91.js +2 -0
  70. package/dist/{schema-show-h72UJ9zH.js → schema-show-C7bY7SgE.js} +3 -3
  71. package/dist/{schema-show-h72UJ9zH.js.map → schema-show-C7bY7SgE.js.map} +1 -1
  72. package/dist/{skills-DQ2bZGkj.js → skills-C8WdRTFg.js} +4 -4
  73. package/dist/{skills-DQ2bZGkj.js.map → skills-C8WdRTFg.js.map} +1 -1
  74. package/dist/{start-Cjx4W0bJ.js → start-CN_9C205.js} +2 -2
  75. package/dist/{start-Cjx4W0bJ.js.map → start-CN_9C205.js.map} +1 -1
  76. package/dist/{status-CDBk25VO.js → status-HWlZbY1E.js} +2 -2
  77. package/dist/{status-CDBk25VO.js.map → status-HWlZbY1E.js.map} +1 -1
  78. package/dist/{storage-Clc8dLG8.js → storage-DBE8lgH-.js} +9 -9
  79. package/dist/{storage-Clc8dLG8.js.map → storage-DBE8lgH-.js.map} +1 -1
  80. package/dist/{storage-objects-CfRKlTDe.js → storage-objects-ljDmtuH7.js} +3 -3
  81. package/dist/{storage-objects-CfRKlTDe.js.map → storage-objects-ljDmtuH7.js.map} +1 -1
  82. package/dist/{users-5PkqBY6R.js → users-DrJEtL9k.js} +9 -6
  83. package/dist/users-DrJEtL9k.js.map +1 -0
  84. package/package.json +10 -10
  85. package/templates/template/.cursorrules +2 -1
  86. package/templates/template/.github/copilot-instructions.md +2 -1
  87. package/templates/template/.windsurfrules +2 -1
  88. package/templates/template/AGENTS.md +2 -1
  89. package/templates/template/CLAUDE.md +2 -1
  90. package/templates/template/ai-instructions.md +5 -2
  91. package/templates/template/frontend/src/index.css +13 -0
  92. package/dist/cloud-DNJyUU0T.js.map +0 -1
  93. package/dist/dev-bj6dEeSQ.js.map +0 -1
  94. package/dist/schema-reconcile-DV14XY4o.js +0 -2
  95. package/dist/users-5PkqBY6R.js.map +0 -1
@@ -32,12 +32,31 @@
32
32
  * unreachable from a browser too.
33
33
  */
34
34
  import net from "node:net";
35
- import { type SessionHolder } from "./context.js";
35
+ import { type SessionHolder, type CloudClient } from "./context.js";
36
36
  /** Documented in `action-help.ts`, and paired with it by `action-help.test.ts`. */
37
37
  export declare const DB_CONNECT_FLAGS: {
38
38
  readonly "--port": NumberConstructor;
39
39
  readonly "--reveal": BooleanConstructor;
40
40
  };
41
+ /** What `db-info` answers. Mirrors `saas/backend/functions/db-info.ts`. */
42
+ interface DbInfoResponse {
43
+ type: "managed" | "byodb";
44
+ host: string | null;
45
+ port: string | null;
46
+ database: string | null;
47
+ username: string | null;
48
+ passwordAvailable: boolean;
49
+ directAccess: {
50
+ via: "tunnel";
51
+ kubectl?: {
52
+ namespace: string;
53
+ service: string;
54
+ localPort: number;
55
+ remotePort: number;
56
+ };
57
+ } | null;
58
+ unavailableReason: string | null;
59
+ }
41
60
  /** `https://app.rebase.pro` → `wss://app.rebase.pro/api/db-tunnel/p1`. */
42
61
  export declare function tunnelUrl(cloudUrl: string, projectId: string): string;
43
62
  /**
@@ -53,6 +72,16 @@ export declare function localDsn(opts: {
53
72
  database: string | null;
54
73
  password?: string;
55
74
  }): string;
75
+ /**
76
+ * What a tunnel needs from the control plane: the database's name and user,
77
+ * and its password when `reveal` asks for it (owner or admin only, as the
78
+ * console's SQL console). Refuses, by `fail`, a project with nothing to tunnel.
79
+ * Shared by `db connect` and `db query`.
80
+ */
81
+ export declare function loadTunnelAccess(client: CloudClient, projectId: string, reveal: boolean): Promise<{
82
+ info: DbInfoResponse;
83
+ password?: string;
84
+ }>;
56
85
  export declare function dbConnect(rawArgs: string[]): Promise<void>;
57
86
  /**
58
87
  * The local listener: each connection it accepts gets its own tunnel, signed in
@@ -83,3 +112,4 @@ export declare function tunnelListener(client: SessionHolder, endpoint: string):
83
112
  * surfaces as a protocol error nowhere near here.
84
113
  */
85
114
  export declare function pipeThroughTunnel(socket: net.Socket, endpoint: string, token: string): void;
115
+ export {};
@@ -0,0 +1,16 @@
1
+ import type { QueryResult } from "pg";
2
+ /** Documented in `action-help.ts`, and paired with it by `action-help.test.ts`. */
3
+ export declare const DB_QUERY_FLAGS: {
4
+ readonly "--file": StringConstructor;
5
+ };
6
+ /** One statement's result, as the JSON form reports it. */
7
+ export interface QueryResultSummary {
8
+ command: string | null;
9
+ rowCount: number | null;
10
+ rows: Record<string, unknown>[];
11
+ }
12
+ /** The SQL to run: the file, or the one positional. Exactly one of them. */
13
+ export declare function querySql(file: string | undefined, positional: string | undefined, read?: (path: string) => string): string;
14
+ /** `pg` answers one result for one statement and an array for several. */
15
+ export declare function summarizeResults(result: QueryResult | QueryResult[]): QueryResultSummary[];
16
+ export declare function dbQuery(rawArgs: string[]): Promise<void>;
@@ -50,6 +50,7 @@ export declare const CLOUD_VALUE_FLAGS: {
50
50
  readonly "--endpoint": StringConstructor;
51
51
  readonly "--events": StringConstructor;
52
52
  readonly "--expires-in": StringConstructor;
53
+ readonly "--file": StringConstructor;
53
54
  readonly "--format": StringConstructor;
54
55
  readonly "--function": StringConstructor;
55
56
  readonly "--grep": StringConstructor;
@@ -60,6 +60,17 @@ export interface BlockedState {
60
60
  /** The exact command that unblocks it. `null` when nothing is blocked. */
61
61
  nextAction: string | null;
62
62
  }
63
+ /**
64
+ * The live app's public `GET /api/auth/config`, or `undefined` when it does
65
+ * not answer in time or is not a Rebase backend. Read by `status` for the
66
+ * sign-in methods the app switched on and cannot offer (`unavailable`).
67
+ */
68
+ export declare function readAuthConfig(appUrl: string, fetchImpl?: typeof fetch): Promise<{
69
+ unavailable?: {
70
+ magicLink?: string;
71
+ emailOtp?: string;
72
+ };
73
+ } | undefined>;
63
74
  export declare function resolveBlockedState(input: {
64
75
  projectStatus?: string | null;
65
76
  /** The project's database row, or undefined when none is attached. */
@@ -70,6 +81,13 @@ export declare function resolveBlockedState(input: {
70
81
  status?: string | null;
71
82
  logs?: string | null;
72
83
  } | undefined;
84
+ /** What the live app's `GET /api/auth/config` answered, when it answered. */
85
+ authConfig?: {
86
+ unavailable?: {
87
+ magicLink?: string;
88
+ emailOtp?: string;
89
+ };
90
+ } | undefined;
73
91
  }): BlockedState;
74
92
  /**
75
93
  * One line describing what engine is serving this project.
@@ -128,7 +146,7 @@ export declare const METRICS_FLAGS: {
128
146
  * `packages/server/src/metrics/history-store.ts`), which is not exported;
129
147
  * `cloud-api-commands.test.ts` holds the two together.
130
148
  */
131
- export declare const HISTORY_SERIES: readonly ["cpu_millicores", "memory_bytes", "event_loop_delay_ms"];
149
+ export declare const HISTORY_SERIES: readonly ["cpu_millicores", "memory_bytes", "event_loop_delay_ms", "requests_data", "errors_data", "requests_auth", "errors_auth", "requests_storage", "errors_storage", "requests_functions", "errors_functions", "requests_app", "errors_app"];
132
150
  /** The longest window the runtime keeps: fourteen days, in minutes. */
133
151
  export declare const HISTORY_MAX_MINUTES = 20160;
134
152
  /** What `/api/functions/metrics/:projectId/runtime` returns. Mirrors saas metrics.ts. */
@@ -238,6 +238,15 @@ export declare function databaseEndpoint(url: string | null | undefined): string
238
238
  */
239
239
  export interface DevStaticShape {
240
240
  declaresStaticApp: boolean;
241
+ /**
242
+ * The declared apps with no build step (`output` is `root`, no `build`):
243
+ * the dev backend serves them from their directory, at their path, as
244
+ * `rebase start` serves them from the bundle.
245
+ */
246
+ servedByBackend?: Array<{
247
+ appName: string;
248
+ path: string;
249
+ }>;
241
250
  /** The declared app whose `root` is the `frontend/` that `rebase dev` runs, if one is. */
242
251
  served?: {
243
252
  appName: string;
@@ -254,6 +263,12 @@ export interface DevStaticShape {
254
263
  servedLocally: boolean;
255
264
  };
256
265
  }
266
+ /**
267
+ * Where the site the dev backend serves itself is, for `FRONTEND_URL`, or
268
+ * `undefined` when it serves none: the app at `/` when there is one, else the
269
+ * first. Exported for its test.
270
+ */
271
+ export declare function devServedSiteUrl(shape: DevStaticShape, backendPort: number): string | undefined;
257
272
  /**
258
273
  * Read {@link DevStaticShape} out of a loaded manifest. Exported for its test.
259
274
  *
@@ -39,6 +39,7 @@ export declare const CREATE_USER_FLAGS: {
39
39
  "--role": [StringConstructor];
40
40
  "--password": StringConstructor;
41
41
  "--skip-password-policy": BooleanConstructor;
42
+ "--no-invite": BooleanConstructor;
42
43
  "--project": StringConstructor;
43
44
  "-p": "--project";
44
45
  "--cloud": BooleanConstructor;
@@ -1379,6 +1379,10 @@ function printGroupHelp(page) {
1379
1379
  }, {
1380
1380
  usage: `rebase ${page.command} ${page.usage ?? "<action>"} [options]`,
1381
1381
  summary: page.title,
1382
+ flags: [...page.options ?? [], ...page.globalFlags ?? GLOBAL_HELP_FLAGS].map(([flag, description]) => ({
1383
+ flag,
1384
+ description
1385
+ })),
1382
1386
  options: (page.options ?? []).map(([flag, description]) => ({
1383
1387
  flag,
1384
1388
  description
@@ -1794,4 +1798,4 @@ function requireCloudRow(row, what) {
1794
1798
  //#endregion
1795
1799
  export { resolveCloudTarget as $, linkedEphemeralGrant as A, projectHost as B, getContextOrg as C, isJsonMode as D, initOutputMode as E, parseCloudArgs as F, reportError as G, readLink as H, printGroupHelp as I, requireInteractive as J, requireClient as K, printJson as L, note as M, noteBlank as N, isKnownControlPlane as O, openUrl as P, requireSessionClient as Q, probeToken as R, freshAccessToken as S, grantProjectOf as T, refuseDirectLink as U, projectLinkPath as V, removeLink as W, requireProject as X, requireKnownAction as Y, requireProjectRef as Z, ephemeralGrantFor as _, isTokenCapability as _t, billingAccountIdOf as a, setCurrentContext as at, fetchTenantBaseDomain as b, scopesForOrgCapabilities as bt, colorStatus as c, warn as ct, createCloudClient as d, ORG_CAPABILITIES as dt, resolveCloudUrl as et, displayProjectRef as f, ORG_CAPABILITY_NAMES as ft, envToken as g, isOrgCapability as gt, emitHelp as h, capabilitiesInScopes as ht, appKeyExpiryNote as i, setContextOrg as it, lookupProjectId as j, keyValues as k, confirmDestructive as l, writeLink as lt, emit as m, TOKEN_CAPABILITY_NAMES as mt, GLOBAL_HELP_FLAGS as n, resolveTimeoutMs as nt, cloudRow as o, storedGrantForLink as ot, dotenvSets as p, TOKEN_CAPABILITIES as pt, requireCloudRow as q, TOKEN_ENV as r, saveEphemeralGrant as rt, cloudRows as s, success as st, GLOBAL_CLOUD_FLAGS as t, resolveProjectRef as tt, context_exports as u, ALWAYS_SCOPES as ut, fail as v, orgCapabilitiesInScopes as vt, grantForLink as w, forgetEphemeralGrant as x, wantsRawError as xt, fetchDeployTargets as y, scopesForCapabilities as yt, projectDotenvSetsAppKey as z };
1796
1800
 
1797
- //# sourceMappingURL=context-BOMEoKxn.js.map
1801
+ //# sourceMappingURL=context-xt20FMFA.js.map