@rebasepro/cli 0.31.0 → 0.32.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 (187) hide show
  1. package/dist/{agent-setup-DqAcoDcn.js → agent-setup-Cg_zBWoW.js} +3 -3
  2. package/dist/{agent-setup-DqAcoDcn.js.map → agent-setup-Cg_zBWoW.js.map} +1 -1
  3. package/dist/api-TbmW33D7.js +275 -0
  4. package/dist/api-TbmW33D7.js.map +1 -0
  5. package/dist/{api-keys-eIUjMqWn.js → api-keys-fPQ55DCm.js} +151 -158
  6. package/dist/api-keys-fPQ55DCm.js.map +1 -0
  7. package/dist/{apps-DExO4PEl.js → apps-DBTRoOeP.js} +18 -13
  8. package/dist/apps-DBTRoOeP.js.map +1 -0
  9. package/dist/{args-CaCcrYE1.js → args-DHyrshtI.js} +3 -132
  10. package/dist/args-DHyrshtI.js.map +1 -0
  11. package/dist/{atlas-dev-database-DOCKk6ht.js → atlas-dev-database-D6h65f2x.js} +3 -3
  12. package/dist/{atlas-dev-database-DOCKk6ht.js.map → atlas-dev-database-D6h65f2x.js.map} +1 -1
  13. package/dist/{auth-ofQETpM5.js → auth-BpyYLEFY.js} +93 -12
  14. package/dist/auth-BpyYLEFY.js.map +1 -0
  15. package/dist/auth-session-B6aT0Dyj.js +371 -0
  16. package/dist/auth-session-B6aT0Dyj.js.map +1 -0
  17. package/dist/{backend-guard-C0mVkXBw.js → backend-guard-Cf8eMK_f.js} +2 -2
  18. package/dist/{backend-guard-C0mVkXBw.js.map → backend-guard-Cf8eMK_f.js.map} +1 -1
  19. package/dist/{branch-pointer-DMPyvZoK.js → branch-pointer-BJOF2Ubv.js} +1 -1
  20. package/dist/{build-CA5R07tw.js → build-BfdT-AUR.js} +12 -10
  21. package/dist/{build-CA5R07tw.js.map → build-BfdT-AUR.js.map} +1 -1
  22. package/dist/{bundle-DgILeA5b.js → bundle-CIiKGrte.js} +78 -12
  23. package/dist/bundle-CIiKGrte.js.map +1 -0
  24. package/dist/bundle.d.ts +31 -1
  25. package/dist/{cloud-CYMk92iG.js → cloud-MqnyPnmX.js} +1540 -1531
  26. package/dist/cloud-MqnyPnmX.js.map +1 -0
  27. package/dist/{cms-directories-BK3vcswg.js → cms-directories-BaV-Is9a.js} +2 -2
  28. package/dist/{cms-directories-BK3vcswg.js.map → cms-directories-BaV-Is9a.js.map} +1 -1
  29. package/dist/codemod/collections-to-tables/backend.d.ts +0 -2
  30. package/dist/codemod/collections-to-tables/customization.d.ts +2 -1
  31. package/dist/codemod/collections-to-tables/modules.d.ts +32 -0
  32. package/dist/codemod/collections-to-tables/plan-context.d.ts +7 -1
  33. package/dist/{command-D5lhW_-B.js → command-D9g46gg9.js} +68 -42
  34. package/dist/command-D9g46gg9.js.map +1 -0
  35. package/dist/commands/api-keys.d.ts +89 -52
  36. package/dist/commands/api.d.ts +114 -0
  37. package/dist/commands/auth-session.d.ts +94 -0
  38. package/dist/commands/auth.d.ts +1 -1
  39. package/dist/commands/cloud/alerts.d.ts +29 -0
  40. package/dist/commands/cloud/context.d.ts +8 -0
  41. package/dist/commands/cloud/debug.d.ts +16 -1
  42. package/dist/commands/cloud/deploy-hooks.d.ts +19 -0
  43. package/dist/commands/cloud/deploy.d.ts +25 -0
  44. package/dist/commands/cloud/env.d.ts +1 -0
  45. package/dist/commands/cloud/index.d.ts +5 -0
  46. package/dist/commands/cloud/maintenance.d.ts +26 -1
  47. package/dist/commands/cloud/not-served.d.ts +27 -0
  48. package/dist/commands/cloud/orgs.d.ts +5 -0
  49. package/dist/commands/cloud/resources.d.ts +82 -2
  50. package/dist/commands/cloud/runtime-logs.d.ts +57 -0
  51. package/dist/commands/cloud/settings.d.ts +3 -0
  52. package/dist/commands/cron.d.ts +68 -0
  53. package/dist/commands/data.d.ts +197 -0
  54. package/dist/commands/functions.d.ts +38 -0
  55. package/dist/commands/logs.d.ts +22 -0
  56. package/dist/commands/rls.d.ts +31 -0
  57. package/dist/commands/schema-reconcile.d.ts +2 -1
  58. package/dist/commands/schema-show.d.ts +38 -0
  59. package/dist/commands/storage-objects.d.ts +88 -0
  60. package/dist/commands/storage.d.ts +18 -2
  61. package/dist/commands/users.d.ts +147 -0
  62. package/dist/{consent-BXLIrMl8.js → consent-UV6ObCME.js} +2 -2
  63. package/dist/{consent-BXLIrMl8.js.map → consent-UV6ObCME.js.map} +1 -1
  64. package/dist/{console-DjThnr3f.js → console-BVoYOLAO.js} +6 -6
  65. package/dist/{console-DjThnr3f.js.map → console-BVoYOLAO.js.map} +1 -1
  66. package/dist/{context--JwaHaZp.js → context-BOMEoKxn.js} +80 -9
  67. package/dist/{context--JwaHaZp.js.map → context-BOMEoKxn.js.map} +1 -1
  68. package/dist/cron-CpUsQ739.js +298 -0
  69. package/dist/cron-CpUsQ739.js.map +1 -0
  70. package/dist/cron-ZRXsla0v.js +259 -0
  71. package/dist/cron-ZRXsla0v.js.map +1 -0
  72. package/dist/{daemon-w30PsdwV.js → daemon-D5gdG7gx.js} +3 -3
  73. package/dist/{daemon-w30PsdwV.js.map → daemon-D5gdG7gx.js.map} +1 -1
  74. package/dist/{daemon-entry-zOC1revO.js → daemon-entry--ummUJnk.js} +2 -2
  75. package/dist/{daemon-entry-zOC1revO.js.map → daemon-entry--ummUJnk.js.map} +1 -1
  76. package/dist/data-BJ9AZFUC.js +947 -0
  77. package/dist/data-BJ9AZFUC.js.map +1 -0
  78. package/dist/{db-Bz2RFGJj.js → db-D_iF4E-v.js} +38 -34
  79. package/dist/{db-Bz2RFGJj.js.map → db-D_iF4E-v.js.map} +1 -1
  80. package/dist/debug-nNbbxAeo.js +1114 -0
  81. package/dist/debug-nNbbxAeo.js.map +1 -0
  82. package/dist/{derive-C3ezmY-p.js → derive-Mky_u59_.js} +3 -3
  83. package/dist/{derive-C3ezmY-p.js.map → derive-Mky_u59_.js.map} +1 -1
  84. package/dist/{dev-D8TxrE_I.js → dev-bj6dEeSQ.js} +13 -13
  85. package/dist/{dev-D8TxrE_I.js.map → dev-bj6dEeSQ.js.map} +1 -1
  86. package/dist/dev-db/pull.d.ts +13 -3
  87. package/dist/{dev-preflight-DjvcV6SK.js → dev-preflight-BMOf2N6r.js} +2 -2
  88. package/dist/{dev-preflight-DjvcV6SK.js.map → dev-preflight-BMOf2N6r.js.map} +1 -1
  89. package/dist/{dev-server-BLxCbQEP.js → dev-server-2XHSHM_q.js} +2 -2
  90. package/dist/{dev-server-BLxCbQEP.js.map → dev-server-2XHSHM_q.js.map} +1 -1
  91. package/dist/{doctor-Du-mSxoE.js → doctor-2Jlau0Rm.js} +9 -8
  92. package/dist/{doctor-Du-mSxoE.js.map → doctor-2Jlau0Rm.js.map} +1 -1
  93. package/dist/{eject-Bhzd6hgb.js → eject-DK_M9kor.js} +4 -4
  94. package/dist/{eject-Bhzd6hgb.js.map → eject-DK_M9kor.js.map} +1 -1
  95. package/dist/{fold-static-CKewnAPX.js → fold-static-2t3UUX4z.js} +10 -6
  96. package/dist/fold-static-2t3UUX4z.js.map +1 -0
  97. package/dist/fold-static.d.ts +7 -0
  98. package/dist/functions-B4JR6EZL.js +120 -0
  99. package/dist/functions-B4JR6EZL.js.map +1 -0
  100. package/dist/{generate-view-CTOluXvH.js → generate-view-BMaLQm8H.js} +5 -5
  101. package/dist/{generate-view-CTOluXvH.js.map → generate-view-BMaLQm8H.js.map} +1 -1
  102. package/dist/{generate_sdk-De-aLC1L.js → generate_sdk-ByD-gTsK.js} +7 -7
  103. package/dist/{generate_sdk-De-aLC1L.js.map → generate_sdk-ByD-gTsK.js.map} +1 -1
  104. package/dist/index.es.js +123 -47
  105. package/dist/index.es.js.map +1 -1
  106. package/dist/{init-Dtl-IcXf.js → init-DHCe5mJ5.js} +59 -11
  107. package/dist/init-DHCe5mJ5.js.map +1 -0
  108. package/dist/{invoked-command-CG_rIa_o.js → invoked-command-FBeIBS8o.js} +2 -2
  109. package/dist/{invoked-command-CG_rIa_o.js.map → invoked-command-FBeIBS8o.js.map} +1 -1
  110. package/dist/last-dev-database-CBVkEUEl.js +2 -0
  111. package/dist/logs-CIgfLBsu.js +192 -0
  112. package/dist/logs-CIgfLBsu.js.map +1 -0
  113. package/dist/{manifest-C3uLDrrJ.js → manifest-RjqxfCpb.js} +114 -5
  114. package/dist/manifest-RjqxfCpb.js.map +1 -0
  115. package/dist/{migrate-VrKoi3nB.js → migrate-Cx8-Y4TG.js} +5 -4
  116. package/dist/{migrate-VrKoi3nB.js.map → migrate-Cx8-Y4TG.js.map} +1 -1
  117. package/dist/{normalize-imports-DwxqEMYq.js → normalize-imports-P86NVfpo.js} +3 -3
  118. package/dist/{normalize-imports-DwxqEMYq.js.map → normalize-imports-P86NVfpo.js.map} +1 -1
  119. package/dist/{path-flags-7O5uPBcQ.js → path-flags-ekLdkbra.js} +3 -3
  120. package/dist/{path-flags-7O5uPBcQ.js.map → path-flags-ekLdkbra.js.map} +1 -1
  121. package/dist/{prepare-Ccxspoj-.js → prepare-BaJe0Zik.js} +4 -4
  122. package/dist/{prepare-Ccxspoj-.js.map → prepare-BaJe0Zik.js.map} +1 -1
  123. package/dist/{project-CLcF5i8c.js → project-DALmhb5R.js} +2 -2
  124. package/dist/{project-CLcF5i8c.js.map → project-DALmhb5R.js.map} +1 -1
  125. package/dist/project-command-Cl9EZzjr.js +662 -0
  126. package/dist/project-command-Cl9EZzjr.js.map +1 -0
  127. package/dist/{project-schema-CsSOG2gE.js → project-schema-Dm6Jk0Y_.js} +4 -2
  128. package/dist/{project-schema-CsSOG2gE.js.map → project-schema-Dm6Jk0Y_.js.map} +1 -1
  129. package/dist/{pull-BMuiUyjb.js → pull-CTIsST6T.js} +66 -5
  130. package/dist/pull-CTIsST6T.js.map +1 -0
  131. package/dist/resolve-C36px9tR.js +2 -0
  132. package/dist/{resources-Dpfs2y8P.js → resources-Db3USuPO.js} +5 -5
  133. package/dist/{resources-Dpfs2y8P.js.map → resources-Db3USuPO.js.map} +1 -1
  134. package/dist/rls-BxrQ0P50.js +133 -0
  135. package/dist/rls-BxrQ0P50.js.map +1 -0
  136. package/dist/{schema-Dv6nHkb0.js → schema-_FzZEoB8.js} +54 -40
  137. package/dist/schema-_FzZEoB8.js.map +1 -0
  138. package/dist/{schema-dir-Cd1kvYbf.js → schema-dir-ChcYfWjP.js} +2 -2
  139. package/dist/{schema-dir-Cd1kvYbf.js.map → schema-dir-ChcYfWjP.js.map} +1 -1
  140. package/dist/schema-reconcile-DV14XY4o.js +2 -0
  141. package/dist/schema-show-h72UJ9zH.js +127 -0
  142. package/dist/schema-show-h72UJ9zH.js.map +1 -0
  143. package/dist/{skills-CXjA9TWw.js → skills-DQ2bZGkj.js} +6 -5
  144. package/dist/{skills-CXjA9TWw.js.map → skills-DQ2bZGkj.js.map} +1 -1
  145. package/dist/star-nudge.d.ts +28 -0
  146. package/dist/{start-Bwbtt2W5.js → start-Cjx4W0bJ.js} +7 -7
  147. package/dist/{start-Bwbtt2W5.js.map → start-Cjx4W0bJ.js.map} +1 -1
  148. package/dist/{status-BTgTWzlQ.js → status-CDBk25VO.js} +9 -9
  149. package/dist/{status-BTgTWzlQ.js.map → status-CDBk25VO.js.map} +1 -1
  150. package/dist/{storage-iTqj5-Av.js → storage-Clc8dLG8.js} +79 -36
  151. package/dist/storage-Clc8dLG8.js.map +1 -0
  152. package/dist/storage-objects-CfRKlTDe.js +279 -0
  153. package/dist/storage-objects-CfRKlTDe.js.map +1 -0
  154. package/dist/{telemetry-BP_1Cl9r.js → telemetry-DZU2-NCm.js} +5 -4
  155. package/dist/{telemetry-BP_1Cl9r.js.map → telemetry-DZU2-NCm.js.map} +1 -1
  156. package/dist/{telemetry-M3HjlyhZ.js → telemetry-EVtASbKb.js} +2 -2
  157. package/dist/{telemetry-M3HjlyhZ.js.map → telemetry-EVtASbKb.js.map} +1 -1
  158. package/dist/unknown-command-DnZ2uhGs.js +139 -0
  159. package/dist/unknown-command-DnZ2uhGs.js.map +1 -0
  160. package/dist/{upgrade-oZzJ13jM.js → upgrade-DhpUFb6p.js} +5 -5
  161. package/dist/{upgrade-oZzJ13jM.js.map → upgrade-DhpUFb6p.js.map} +1 -1
  162. package/dist/users-5PkqBY6R.js +561 -0
  163. package/dist/users-5PkqBY6R.js.map +1 -0
  164. package/dist/utils/project-command.d.ts +38 -0
  165. package/dist/utils/project-target.d.ts +193 -0
  166. package/dist/{verify-BkUVGLqo.js → verify-BdeqNb-V.js} +138 -12
  167. package/dist/verify-BdeqNb-V.js.map +1 -0
  168. package/dist/{version-Buyyo1ut.js → version-ONIeo7jl.js} +7 -2
  169. package/dist/{version-Buyyo1ut.js.map → version-ONIeo7jl.js.map} +1 -1
  170. package/package.json +10 -10
  171. package/dist/api-keys-eIUjMqWn.js.map +0 -1
  172. package/dist/apps-DExO4PEl.js.map +0 -1
  173. package/dist/args-CaCcrYE1.js.map +0 -1
  174. package/dist/auth-ofQETpM5.js.map +0 -1
  175. package/dist/bundle-DgILeA5b.js.map +0 -1
  176. package/dist/cloud-CYMk92iG.js.map +0 -1
  177. package/dist/command-D5lhW_-B.js.map +0 -1
  178. package/dist/fold-static-CKewnAPX.js.map +0 -1
  179. package/dist/init-Dtl-IcXf.js.map +0 -1
  180. package/dist/last-dev-database-Dc8cP01o.js +0 -2
  181. package/dist/manifest-C3uLDrrJ.js.map +0 -1
  182. package/dist/pull-BMuiUyjb.js.map +0 -1
  183. package/dist/resolve-BY7bSFRT.js +0 -2
  184. package/dist/schema-Dv6nHkb0.js.map +0 -1
  185. package/dist/schema-reconcile-CjxLaRHB.js +0 -2
  186. package/dist/storage-iTqj5-Av.js.map +0 -1
  187. package/dist/verify-BkUVGLqo.js.map +0 -1
@@ -1,53 +1,7 @@
1
- import { type ApiKeyMasked, type ScopeSummary } from "@rebasepro/types";
1
+ import { type ApiKeyMasked, type UpdateApiKeyRequest, type ScopeSummary } from "@rebasepro/types";
2
2
  /** Everything the switch below dispatches, for the did-you-mean. */
3
- export declare const API_KEYS_SUBCOMMANDS: readonly ["list", "get", "create", "revoke", "scopes"];
4
- /**
5
- * Where this project's backend is — or why the CLI will not say.
6
- *
7
- * `configured` is an address the developer named; `running` is the one this
8
- * project's backend recorded when it bound, and is still serving on. There is
9
- * no third, guessed, answer: the request carries the project's service key —
10
- * the `admin` role, every scope — and an address the CLI only guessed is one it
11
- * would hand that key to without knowing whose server answers.
12
- */
13
- export type BackendAddress = {
14
- url: string;
15
- source: "configured" | "running";
16
- /**
17
- * Set when the address came from `.env` and is the cloud project this
18
- * directory is linked to — which `rebase cloud init --claim` writes
19
- * there for the app and the SDK, not as a choice of where local
20
- * commands go. The command still goes there; {@link cloudTargetNote}
21
- * says so.
22
- */
23
- cloudProject?: string;
24
- } | {
25
- url: null;
26
- reason: string;
27
- };
28
- /**
29
- * The address the service key may be sent to. Shared with `rebase storage`.
30
- *
31
- * In order:
32
- *
33
- * 1. `REBASE_BASE_URL`, in the shell or in `.env` — the developer said where.
34
- * 2. `.rebase/state.json`, which this project's backend writes when it binds
35
- * and removes when it stops — and only while the pid it names is alive,
36
- * because a backend that was killed leaves the file behind.
37
- *
38
- * Nothing else. `.env`'s `PORT` was the fallback, and every scaffold writes
39
- * `PORT=3001`: with `rebase dev` stopped, `rebase api-keys list` sent this
40
- * project's service key to whatever listened on 3001 — on the tester's machine,
41
- * another project's server. `.rebase-dev-url` is not enough on its own either:
42
- * a `rebase dev` that was killed leaves it behind, pointing at a port some
43
- * other server may have taken since.
44
- */
45
- export declare function resolveBackendAddress(env: Record<string, string>, projectRoot: string): BackendAddress;
46
- /**
47
- * What a local command says before it sends the service key to the cloud
48
- * project `.env` names (see `BackendAddress.cloudProject`), or undefined.
49
- */
50
- export declare function cloudTargetNote(address: BackendAddress): string | undefined;
3
+ export declare const API_KEYS_SUBCOMMANDS: readonly ["list", "get", "create", "update", "revoke", "scopes"];
4
+ export { cloudTargetNote, resolveBackendAddress, type BackendAddress } from "../utils/project-target.js";
51
5
  /**
52
6
  * The address to send the service key to, or the end of the command.
53
7
  *
@@ -77,10 +31,31 @@ export declare function apiKeysCommand(subcommand: string | undefined, rawArgs:
77
31
  */
78
32
  export declare function describeKey(key: ApiKeyMasked, now?: Date): string[];
79
33
  /** The flags `rebase api-keys list` takes: none of its own. */
80
- export declare const LIST_KEYS_FLAGS: {};
34
+ export declare const LIST_KEYS_FLAGS: {
35
+ readonly "--project": StringConstructor;
36
+ readonly "-p": "--project";
37
+ readonly "--cloud": BooleanConstructor;
38
+ readonly "--url": StringConstructor;
39
+ readonly "--token": StringConstructor;
40
+ readonly "--session": BooleanConstructor;
41
+ readonly "--anon": BooleanConstructor;
42
+ readonly "--json": BooleanConstructor;
43
+ readonly "--yes": BooleanConstructor;
44
+ readonly "-y": "--yes";
45
+ };
81
46
  /** The flags `rebase api-keys get` takes. */
82
47
  export declare const GET_KEY_FLAGS: {
83
48
  readonly "--id": StringConstructor;
49
+ readonly "--project": StringConstructor;
50
+ readonly "-p": "--project";
51
+ readonly "--cloud": BooleanConstructor;
52
+ readonly "--url": StringConstructor;
53
+ readonly "--token": StringConstructor;
54
+ readonly "--session": BooleanConstructor;
55
+ readonly "--anon": BooleanConstructor;
56
+ readonly "--json": BooleanConstructor;
57
+ readonly "--yes": BooleanConstructor;
58
+ readonly "-y": "--yes";
84
59
  };
85
60
  /**
86
61
  * Which key this invocation names, as a positional or as `--id`.
@@ -100,6 +75,16 @@ export declare const CREATE_KEY_FLAGS: {
100
75
  "--expires-in": StringConstructor;
101
76
  "--expires-at": StringConstructor;
102
77
  "-n": string;
78
+ "--project": StringConstructor;
79
+ "-p": "--project";
80
+ "--cloud": BooleanConstructor;
81
+ "--url": StringConstructor;
82
+ "--token": StringConstructor;
83
+ "--session": BooleanConstructor;
84
+ "--anon": BooleanConstructor;
85
+ "--json": BooleanConstructor;
86
+ "--yes": BooleanConstructor;
87
+ "-y": "--yes";
103
88
  };
104
89
  /**
105
90
  * Options `create` refuses by name, each with the flag that does that job.
@@ -142,9 +127,50 @@ export declare function resolveCreateKeyArgs(rawArgs: string[], now?: Date): Cre
142
127
  * Exported so its tests can check the subtraction without a server.
143
128
  */
144
129
  export declare function grantableScopes(held: readonly string[]): string[];
130
+ /** The flags `rebase api-keys update` takes. */
131
+ export declare const UPDATE_KEY_FLAGS: {
132
+ "--id": StringConstructor;
133
+ "--name": StringConstructor;
134
+ "--scopes": [StringConstructor];
135
+ "--roles": [StringConstructor];
136
+ "--rate-limit": NumberConstructor;
137
+ "--no-rate-limit": BooleanConstructor;
138
+ "--expires-in": StringConstructor;
139
+ "--expires-at": StringConstructor;
140
+ "--no-expiry": BooleanConstructor;
141
+ "-n": string;
142
+ "--project": StringConstructor;
143
+ "-p": "--project";
144
+ "--cloud": BooleanConstructor;
145
+ "--url": StringConstructor;
146
+ "--token": StringConstructor;
147
+ "--session": BooleanConstructor;
148
+ "--anon": BooleanConstructor;
149
+ "--json": BooleanConstructor;
150
+ "--yes": BooleanConstructor;
151
+ "-y": "--yes";
152
+ };
153
+ /**
154
+ * Which key, and what to change on it: only what the line names is sent, so
155
+ * an update never resets a field it did not mention. Exported for its tests.
156
+ */
157
+ export declare function resolveUpdateKeyArgs(rawArgs: string[], now?: Date): {
158
+ id?: string;
159
+ change: UpdateApiKeyRequest;
160
+ };
145
161
  /** The flags `rebase api-keys revoke` takes. */
146
162
  export declare const REVOKE_KEY_FLAGS: {
147
163
  readonly "--id": StringConstructor;
164
+ readonly "--project": StringConstructor;
165
+ readonly "-p": "--project";
166
+ readonly "--cloud": BooleanConstructor;
167
+ readonly "--url": StringConstructor;
168
+ readonly "--token": StringConstructor;
169
+ readonly "--session": BooleanConstructor;
170
+ readonly "--anon": BooleanConstructor;
171
+ readonly "--json": BooleanConstructor;
172
+ readonly "--yes": BooleanConstructor;
173
+ readonly "-y": "--yes";
148
174
  };
149
175
  /**
150
176
  * Which key this invocation names.
@@ -158,9 +184,21 @@ export declare const REVOKE_KEY_FLAGS: {
158
184
  */
159
185
  export declare function resolveRevokeKeyArgs(rawArgs: string[]): {
160
186
  id?: string;
187
+ yes: boolean;
161
188
  };
162
189
  /** The flags `rebase api-keys scopes` takes: none of its own. */
163
- export declare const SCOPES_LIST_FLAGS: {};
190
+ export declare const SCOPES_LIST_FLAGS: {
191
+ readonly "--project": StringConstructor;
192
+ readonly "-p": "--project";
193
+ readonly "--cloud": BooleanConstructor;
194
+ readonly "--url": StringConstructor;
195
+ readonly "--token": StringConstructor;
196
+ readonly "--session": BooleanConstructor;
197
+ readonly "--anon": BooleanConstructor;
198
+ readonly "--json": BooleanConstructor;
199
+ readonly "--yes": BooleanConstructor;
200
+ readonly "-y": "--yes";
201
+ };
164
202
  /**
165
203
  * The scope catalogue as printed lines: one section per plane, each scope with
166
204
  * its label and what its target names, marked when the caller holds it.
@@ -168,4 +206,3 @@ export declare const SCOPES_LIST_FLAGS: {};
168
206
  * Exported so its tests can read the lines without a server.
169
207
  */
170
208
  export declare function describeScopes(scopes: readonly ScopeSummary[], held: readonly string[]): string[];
171
- export {};
@@ -0,0 +1,114 @@
1
+ import { type ProjectTarget } from "../utils/project-target.js";
2
+ /** The flags `rebase api` takes, on top of the target flags. */
3
+ export declare const API_FLAGS: {
4
+ "--method": StringConstructor;
5
+ "-X": string;
6
+ "--field": [StringConstructor];
7
+ "-f": string;
8
+ "--raw-field": [StringConstructor];
9
+ "-F": string;
10
+ "--input": StringConstructor;
11
+ "--header": [StringConstructor];
12
+ "-H": string;
13
+ "--include": BooleanConstructor;
14
+ "-i": string;
15
+ "--silent": BooleanConstructor;
16
+ "--project": StringConstructor;
17
+ "-p": "--project";
18
+ "--cloud": BooleanConstructor;
19
+ "--url": StringConstructor;
20
+ "--token": StringConstructor;
21
+ "--session": BooleanConstructor;
22
+ "--anon": BooleanConstructor;
23
+ "--json": BooleanConstructor;
24
+ "--yes": BooleanConstructor;
25
+ "-y": "--yes";
26
+ };
27
+ /** What one `rebase api` line asks for. Exported for its tests. */
28
+ export interface ApiRequestPlan {
29
+ method: string;
30
+ path: string;
31
+ query: Record<string, string[]>;
32
+ body?: string;
33
+ contentType?: string;
34
+ headers: Record<string, string>;
35
+ }
36
+ /**
37
+ * The path a request goes to: `/…` as written, anything else under `/api/`
38
+ * — `data/posts` is `/api/data/posts`, as `gh api repos/x` is relative to its
39
+ * API root. A full URL is refused: the target flags say where requests go, so
40
+ * a URL in the path would send the credential somewhere they did not choose.
41
+ */
42
+ export declare function resolveApiPath(raw: string): string;
43
+ /**
44
+ * A typed field's value, as `gh api -F` reads one: `true`, `false` and `null`
45
+ * as themselves, a number as a number, `@file` as that file's text, a JSON
46
+ * array or object as JSON, anything else as the string.
47
+ */
48
+ export declare function typedFieldValue(raw: string): unknown;
49
+ /**
50
+ * Resolve a line into the request it describes. Exported for its tests.
51
+ *
52
+ * The method is the first argument when it is one (`rebase api DELETE
53
+ * data/posts/1`), `--method`, or GET — POST when the line carries a body.
54
+ * Fields go into the query string of a GET, HEAD or DELETE and into a JSON
55
+ * body otherwise, as with `gh api`.
56
+ */
57
+ export declare function resolveApiRequest(rawArgs: string[]): {
58
+ plan: ApiRequestPlan;
59
+ flags: ReturnType<typeof parseApiLine>["flags"];
60
+ };
61
+ /** What a line says about a request, before it is resolved into one. */
62
+ export interface ApiRequestParts {
63
+ method?: string;
64
+ /** The path, `/api/…` already resolved, optionally with a query string. */
65
+ path: string;
66
+ fields?: readonly string[];
67
+ rawFields?: readonly string[];
68
+ input?: string;
69
+ headers?: readonly string[];
70
+ }
71
+ /**
72
+ * Resolve the parts of a line into the request they describe. Shared by
73
+ * `rebase api` and `rebase functions invoke`. Exported for tests.
74
+ *
75
+ * The method is the one given, or GET — POST with `--input`. Fields go into
76
+ * the query string of a GET, HEAD or DELETE and into a JSON body otherwise.
77
+ * Unlike `gh api`, a field alone never makes the request a POST.
78
+ */
79
+ export declare function buildApiPlan(parts: ApiRequestParts): ApiRequestPlan;
80
+ declare function parseApiLine(rawArgs: string[]): import("../utils/args.js").ParsedCommand<{
81
+ "--method": StringConstructor;
82
+ "-X": string;
83
+ "--field": [StringConstructor];
84
+ "-f": string;
85
+ "--raw-field": [StringConstructor];
86
+ "-F": string;
87
+ "--input": StringConstructor;
88
+ "--header": [StringConstructor];
89
+ "-H": string;
90
+ "--include": BooleanConstructor;
91
+ "-i": string;
92
+ "--silent": BooleanConstructor;
93
+ "--project": StringConstructor;
94
+ "-p": "--project";
95
+ "--cloud": BooleanConstructor;
96
+ "--url": StringConstructor;
97
+ "--token": StringConstructor;
98
+ "--session": BooleanConstructor;
99
+ "--anon": BooleanConstructor;
100
+ "--json": BooleanConstructor;
101
+ "--yes": BooleanConstructor;
102
+ "-y": "--yes";
103
+ }>;
104
+ export declare function apiCommand(rawArgs: string[]): Promise<void>;
105
+ /**
106
+ * Send a resolved request and print the answer as it came: JSON
107
+ * pretty-printed, anything else as text, the status line and headers first
108
+ * with `include`. A non-2xx answer is printed too, and exits 1.
109
+ */
110
+ export declare function sendApiPlan(target: ProjectTarget, plan: ApiRequestPlan, options?: {
111
+ include?: boolean;
112
+ silent?: boolean;
113
+ }): Promise<void>;
114
+ export {};
@@ -0,0 +1,94 @@
1
+ /** The subcommands this module answers, beside `reset-password` in `auth.ts`. */
2
+ export declare const AUTH_SESSION_SUBCOMMANDS: readonly ["login", "logout", "whoami", "emails", "keys"];
3
+ /** The access token's expiry, from its `exp` claim, in epoch milliseconds. */
4
+ export declare function tokenExpiry(token: string): number;
5
+ export declare const AUTH_LOGIN_FLAGS: {
6
+ "--email": StringConstructor;
7
+ "-e": string;
8
+ "--password": StringConstructor;
9
+ "--code": StringConstructor;
10
+ "--web": BooleanConstructor;
11
+ "--no-browser": BooleanConstructor;
12
+ "--project": StringConstructor;
13
+ "-p": "--project";
14
+ "--cloud": BooleanConstructor;
15
+ "--url": StringConstructor;
16
+ "--token": StringConstructor;
17
+ "--session": BooleanConstructor;
18
+ "--anon": BooleanConstructor;
19
+ "--json": BooleanConstructor;
20
+ "--yes": BooleanConstructor;
21
+ "-y": "--yes";
22
+ };
23
+ export declare function authLogin(rawArgs: string[]): Promise<void>;
24
+ export declare const AUTH_LOGOUT_FLAGS: {
25
+ "--project": StringConstructor;
26
+ "-p": "--project";
27
+ "--cloud": BooleanConstructor;
28
+ "--url": StringConstructor;
29
+ "--token": StringConstructor;
30
+ "--session": BooleanConstructor;
31
+ "--anon": BooleanConstructor;
32
+ "--json": BooleanConstructor;
33
+ "--yes": BooleanConstructor;
34
+ "-y": "--yes";
35
+ };
36
+ export declare function authLogout(rawArgs: string[]): Promise<void>;
37
+ export declare const AUTH_WHOAMI_FLAGS: {
38
+ "--project": StringConstructor;
39
+ "-p": "--project";
40
+ "--cloud": BooleanConstructor;
41
+ "--url": StringConstructor;
42
+ "--token": StringConstructor;
43
+ "--session": BooleanConstructor;
44
+ "--anon": BooleanConstructor;
45
+ "--json": BooleanConstructor;
46
+ "--yes": BooleanConstructor;
47
+ "-y": "--yes";
48
+ };
49
+ /**
50
+ * Who the server takes this command to be: `/api/auth/me` for a person's
51
+ * session or token, and the scopes the credential holds (`/api/auth/scopes`),
52
+ * which answers keys and the service key too.
53
+ */
54
+ export declare function authWhoami(rawArgs: string[]): Promise<void>;
55
+ export declare const AUTH_EMAILS_FLAGS: {
56
+ "--latest": BooleanConstructor;
57
+ "--to": StringConstructor;
58
+ "--clear": BooleanConstructor;
59
+ "--links": BooleanConstructor;
60
+ "--project": StringConstructor;
61
+ "-p": "--project";
62
+ "--cloud": BooleanConstructor;
63
+ "--url": StringConstructor;
64
+ "--token": StringConstructor;
65
+ "--session": BooleanConstructor;
66
+ "--anon": BooleanConstructor;
67
+ "--json": BooleanConstructor;
68
+ "--yes": BooleanConstructor;
69
+ "-y": "--yes";
70
+ };
71
+ export declare function authEmails(rawArgs: string[]): Promise<void>;
72
+ export declare const AUTH_KEYS_FLAGS: {
73
+ "--name": StringConstructor;
74
+ "-n": string;
75
+ "--scopes": [StringConstructor];
76
+ "--expires-in": StringConstructor;
77
+ "--project": StringConstructor;
78
+ "-p": "--project";
79
+ "--cloud": BooleanConstructor;
80
+ "--url": StringConstructor;
81
+ "--token": StringConstructor;
82
+ "--session": BooleanConstructor;
83
+ "--anon": BooleanConstructor;
84
+ "--json": BooleanConstructor;
85
+ "--yes": BooleanConstructor;
86
+ "-y": "--yes";
87
+ };
88
+ /**
89
+ * A person's own `rk_` keys (`/api/auth/keys`): list, create, revoke. They act
90
+ * as their owner, with the owner's live roles, narrowed to the scopes named.
91
+ * The server answers a person's session only, and only when the auth table
92
+ * sets `auth.personalKeys: true`. Service keys are `rebase api-keys`.
93
+ */
94
+ export declare function authKeys(rawArgs: string[]): Promise<void>;
@@ -1,5 +1,5 @@
1
1
  /** Everything the switch below dispatches, for the did-you-mean. */
2
- export declare const AUTH_SUBCOMMANDS: readonly ["reset-password"];
2
+ export declare const AUTH_SUBCOMMANDS: readonly ["reset-password", "login", "logout", "whoami", "emails", "keys"];
3
3
  /** A user as the admin API returns it, reduced to what this command needs. */
4
4
  export interface ResolvedUser {
5
5
  id: string;
@@ -0,0 +1,29 @@
1
+ /** The action words `rebase cloud alerts` dispatches. No word means `list`. */
2
+ export declare const ALERTS_ACTIONS: readonly ["list", "ack", "snooze"];
3
+ /** What `alerts` parses: `--all` for `list`, `--hours` for `snooze`. */
4
+ export declare const ALERTS_FLAGS: {
5
+ readonly "--all": BooleanConstructor;
6
+ readonly "--hours": StringConstructor;
7
+ };
8
+ /** The longest snooze the control plane allows: a week, in hours. */
9
+ export declare const MAX_SNOOZE_HOURS = 168;
10
+ /** An incident as these commands show it. Mirrors the console's reader. */
11
+ export interface CliIncident {
12
+ id: string;
13
+ rule: string;
14
+ title: string;
15
+ summary: string;
16
+ severity: string;
17
+ state: string;
18
+ category: string | null;
19
+ openedAt: string | null;
20
+ lastSeenAt: string | null;
21
+ resolvedAt: string | null;
22
+ acknowledgedAt: string | null;
23
+ snoozedUntil: string | null;
24
+ }
25
+ /** One incident from the data API, or null for a row that is not one. */
26
+ export declare function readIncident(row: Record<string, unknown>): CliIncident | null;
27
+ /** `--hours`, checked: a whole number from 1 to a week. */
28
+ export declare function resolveSnoozeHours(value: string | undefined): number;
29
+ export declare function alertsCommand(action: string | undefined, rawArgs: string[]): Promise<void>;
@@ -476,6 +476,14 @@ export interface GroupHelp {
476
476
  options?: Array<[string, string]>;
477
477
  /** Closing paragraphs — the things a reader gets wrong more than once. */
478
478
  notes?: string[];
479
+ /**
480
+ * The options every command of this family takes, under "Global options".
481
+ * Defaults to the cloud family's ({@link GLOBAL_HELP_FLAGS}); the project
482
+ * commands (`rebase data`, `users`, …) pass their target flags.
483
+ */
484
+ globalFlags?: Array<[string, string]>;
485
+ /** The usage line's tail, for a command that is not a group of actions: `[METHOD] <path>`. */
486
+ usage?: string;
479
487
  }
480
488
  /**
481
489
  * Flags every cloud command accepts, documented once.
@@ -37,7 +37,7 @@ export interface ProbeSpec {
37
37
  refine?: (body: unknown, targets: ProbeTargets) => ProbeReading | null;
38
38
  }
39
39
  export interface ProbeTargets {
40
- /** Collection used for the unauthenticated-read probe. */
40
+ /** Table used for the unauthenticated-read probe. */
41
41
  collection: string;
42
42
  /** Function to confirm exists, if the caller named one. */
43
43
  fn?: string;
@@ -230,10 +230,25 @@ export declare const REQUESTS_FLAGS: {
230
230
  };
231
231
  /** What `debug health` parses. */
232
232
  export declare const HEALTH_FLAGS: {
233
+ readonly "--table": StringConstructor;
234
+ /** @deprecated Use `--table` instead. Accepted, with a warning, until a later release. */
233
235
  readonly "--collection": StringConstructor;
234
236
  readonly "--function": StringConstructor;
235
237
  readonly "--host": StringConstructor;
236
238
  };
239
+ /**
240
+ * The table `debug health` probes, from `--table` or its deprecated spelling
241
+ * `--collection`, which still works and warns once. Undefined when neither was
242
+ * given.
243
+ *
244
+ * "Table" is the word for the app's data; "collection" is the CMS's. Both
245
+ * spellings at once is refused unless they agree, since one of them would be
246
+ * ignored.
247
+ */
248
+ export declare function resolveProbeTable(flags: {
249
+ "--table"?: string;
250
+ "--collection"?: string;
251
+ }): string | undefined;
237
252
  /**
238
253
  * Whether a boot read reached each pod's start, which is where its startup
239
254
  * lines are. A pod whose read was cut has not been looked at there, so finding
@@ -0,0 +1,19 @@
1
+ /** The action words `rebase cloud deploy-hooks` dispatches. No word means `list`. */
2
+ export declare const DEPLOY_HOOKS_ACTIONS: readonly ["list", "create", "revoke"];
3
+ /** What `deploy-hooks` parses. `--name` and `--branch` belong to `create`. */
4
+ export declare const DEPLOY_HOOKS_FLAGS: {
5
+ readonly "--name": StringConstructor;
6
+ readonly "--branch": StringConstructor;
7
+ };
8
+ /** A hook as the control plane lists it. Never its token. */
9
+ export interface CliDeployHook {
10
+ id: string;
11
+ name: string;
12
+ /** The branch it builds; empty for the project's configured branch. */
13
+ branch: string;
14
+ createdAt: string | null;
15
+ lastUsedAt: string | null;
16
+ }
17
+ /** One hook from the wire, or null for one with no id. */
18
+ export declare function readHook(value: unknown): CliDeployHook | null;
19
+ export declare function deployHooksCommand(action: string | undefined, rawArgs: string[]): Promise<void>;
@@ -17,6 +17,7 @@
17
17
  */
18
18
  import arg from "arg";
19
19
  import { type CloudClient } from "./context.js";
20
+ import type { RebaseStaticAppConfig } from "@rebasepro/types";
20
21
  /** Printed under a successful deploy: the way back, where it is needed. */
21
22
  export declare const ROLLBACK_HINT = "Something wrong? `rebase cloud rollback` puts the previous deployment back.";
22
23
  /**
@@ -36,6 +37,19 @@ export declare const STATIC_UNDO_HINT = "Something wrong? A static app deployed
36
37
  * by uploading it. `--no-verify` is the way past for a file the check gets
37
38
  * wrong.
38
39
  */
40
+ /**
41
+ * Why a static app cannot be deployed on its own, or `undefined` when it can.
42
+ *
43
+ * A static app deployed alone is served by a process with no functions, so
44
+ * routes to custom functions would have nothing to call: the runtime refuses
45
+ * to boot such a bundle, and an older one would answer every routed path with
46
+ * the app's index.html. Deploying the backend folds the app in, and that one
47
+ * process serves the app, its routes and the functions together.
48
+ */
49
+ export declare function standaloneStaticRefusal(name: string, app: RebaseStaticAppConfig): {
50
+ message: string;
51
+ hint: string;
52
+ } | undefined;
39
53
  export declare function verifyStaticOutput(projectRoot: string, apps: {
40
54
  name: string;
41
55
  output?: string;
@@ -139,6 +153,8 @@ export interface EjectContext {
139
153
  source: boolean;
140
154
  /** `--eject` was passed: leave the managed runtime on purpose. */
141
155
  eject: boolean;
156
+ /** `--git` was passed: the control plane builds the connected repository. */
157
+ git?: boolean;
142
158
  }
143
159
  /**
144
160
  * Why a container-image deploy of a managed project is refused — or `undefined`
@@ -250,8 +266,16 @@ export declare const DEPLOY_FLAGS: {
250
266
  readonly "--allow-downgrade": BooleanConstructor;
251
267
  readonly "--preview": BooleanConstructor;
252
268
  readonly "--preview-name": StringConstructor;
269
+ readonly "--git": BooleanConstructor;
253
270
  readonly "-m": "--message";
254
271
  };
272
+ /**
273
+ * The flags that describe a build made on this machine, which `--git` — a
274
+ * build the control plane makes from the repository — cannot honour. Refused
275
+ * rather than ignored: either reading would ship something other than what the
276
+ * line asked for.
277
+ */
278
+ export declare const LOCAL_BUILD_FLAGS: readonly ["--source", "--bundle", "--bundle-dir", "--skip-type-check", "--skip-schema", "--no-static", "--no-source", "--no-verify", "--allow-downgrade", "--preview", "--preview-name"];
255
279
  /**
256
280
  * `rebase cloud deploy [app]` — its flags, and which app of this repository the
257
281
  * line named.
@@ -293,6 +317,7 @@ export declare function resolveDeployArgs(rawArgs: string[]): {
293
317
  readonly "--allow-downgrade": BooleanConstructor;
294
318
  readonly "--preview": BooleanConstructor;
295
319
  readonly "--preview-name": StringConstructor;
320
+ readonly "--git": BooleanConstructor;
296
321
  readonly "-m": "--message";
297
322
  } & {
298
323
  readonly "--json": BooleanConstructor;
@@ -80,6 +80,7 @@ export declare function resolveEnvKeyArg(rawArgs: string[], action: string): str
80
80
  export declare function resolveEnvKeyArgs(rawArgs: string[], action: string): {
81
81
  key: string | undefined;
82
82
  preview: boolean;
83
+ yes: boolean;
83
84
  };
84
85
  /**
85
86
  * One `KEY=value` line that dotenv reads back as exactly `value`, or null when
@@ -55,6 +55,7 @@ export declare const CLOUD_VALUE_FLAGS: {
55
55
  readonly "--grep": StringConstructor;
56
56
  readonly "--host": StringConstructor;
57
57
  readonly "--hour": StringConstructor;
58
+ readonly "--hours": StringConstructor;
58
59
  readonly "--ingress-address": StringConstructor;
59
60
  readonly "--kubeconfig": StringConstructor;
60
61
  readonly "--level": StringConstructor;
@@ -62,6 +63,7 @@ export declare const CLOUD_VALUE_FLAGS: {
62
63
  readonly "--live-timeout": StringConstructor;
63
64
  readonly "--memory": StringConstructor;
64
65
  readonly "--message": StringConstructor;
66
+ readonly "--minutes": StringConstructor;
65
67
  readonly "--month": StringConstructor;
66
68
  readonly "--name": StringConstructor;
67
69
  readonly "--older-than": StringConstructor;
@@ -83,12 +85,15 @@ export declare const CLOUD_VALUE_FLAGS: {
83
85
  readonly "--scale-to-zero": StringConstructor;
84
86
  readonly "--schemas": StringConstructor;
85
87
  readonly "--secret-access-key": StringConstructor;
88
+ readonly "--series": StringConstructor;
86
89
  readonly "--since": StringConstructor;
87
90
  readonly "--slug": StringConstructor;
88
91
  readonly "--source": StringConstructor;
89
92
  readonly "--spot": StringConstructor;
90
93
  readonly "--storage": StringConstructor;
94
+ readonly "--studio": StringConstructor;
91
95
  readonly "--subdomain": StringConstructor;
96
+ readonly "--table": StringConstructor;
92
97
  readonly "--tail": StringConstructor;
93
98
  readonly "--tables": StringConstructor;
94
99
  readonly "--target": StringConstructor;
@@ -1,4 +1,5 @@
1
1
  import { type CloudClient } from "./context.js";
2
+ import { type Unserved } from "./not-served.js";
2
3
  export interface MaintenanceBatch {
3
4
  id: string;
4
5
  state: string;
@@ -35,8 +36,32 @@ export declare const EVENTS_FLAGS: {
35
36
  };
36
37
  /** `sun`, `sunday`, `0` → 0. Undefined for anything else, including the ambiguous `t` and `s`. */
37
38
  export declare function parseDay(value: string): number | undefined;
38
- /** The project's maintenance status, or undefined from a control plane that has no maintenance function yet. */
39
+ /** What a command says on a control plane that has no `maintenance` function yet. */
40
+ export declare const MAINTENANCE_UNSERVED: Unserved;
41
+ /** What `events` says on a control plane that has no `maintenance` function yet. */
42
+ export declare const EVENTS_UNSERVED: Unserved;
43
+ /**
44
+ * What a read of the maintenance status came back with.
45
+ *
46
+ * Three outcomes rather than `undefined`, because the commands that show it as
47
+ * one section of a larger page say different things for them: a control plane
48
+ * without the function is noted as such, a failed read is left out quietly, as
49
+ * it always was.
50
+ */
51
+ export type MaintenanceRead = {
52
+ kind: "ok";
53
+ status: MaintenanceStatus;
54
+ } | {
55
+ kind: "not_served";
56
+ } | {
57
+ kind: "failed";
58
+ };
59
+ /** The project's maintenance status, and whether the control plane serves it at all. */
60
+ export declare function readMaintenance(client: CloudClient, projectId: string): Promise<MaintenanceRead>;
61
+ /** The project's maintenance status, or undefined when it could not be read. */
39
62
  export declare function fetchMaintenance(client: CloudClient, projectId: string): Promise<MaintenanceStatus | undefined>;
63
+ /** The line a page prints in place of its maintenance section on a control plane without it. */
64
+ export declare const MAINTENANCE_NOT_SERVED_NOTE = "This control plane does not report maintenance windows yet, so none is shown.";
40
65
  /** One line for a waiting batch: "Database 0.16 → 0.5 vCPU — applies Sunday 9 November, 03:00 UTC". */
41
66
  export declare function describePending(open: MaintenanceBatch | null | undefined): string | undefined;
42
67
  export declare function computeApplyCommand(rawArgs: string[]): Promise<void>;