@rebasepro/types 0.10.0 → 0.10.1-canary.0a881d4

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 (96) hide show
  1. package/dist/call_context.d.ts +51 -0
  2. package/dist/controllers/auth_state.d.ts +23 -0
  3. package/dist/controllers/client.d.ts +3 -1
  4. package/dist/controllers/collection_registry.d.ts +5 -1
  5. package/dist/controllers/data_driver.d.ts +31 -2
  6. package/dist/controllers/index.d.ts +1 -10
  7. package/dist/index.d.ts +1 -1
  8. package/dist/index.es.js +374 -1
  9. package/dist/index.es.js.map +1 -1
  10. package/dist/types/admin_block.d.ts +34 -0
  11. package/dist/types/backend.d.ts +30 -1
  12. package/dist/types/channel_bus.d.ts +192 -0
  13. package/dist/types/collection_contract.d.ts +43 -0
  14. package/dist/types/collections.d.ts +17 -789
  15. package/dist/types/component_ref.d.ts +39 -6
  16. package/dist/types/entity_callbacks.d.ts +1 -1
  17. package/dist/types/index.d.ts +7 -15
  18. package/dist/types/project_manifest.d.ts +336 -0
  19. package/dist/types/properties.d.ts +12 -157
  20. package/dist/types/schema_version.d.ts +18 -0
  21. package/dist/types/security_rules.d.ts +320 -0
  22. package/dist/types/storage_authorize.d.ts +74 -0
  23. package/package.json +3 -6
  24. package/src/call_context.ts +56 -0
  25. package/src/controllers/auth_state.ts +24 -0
  26. package/src/controllers/client.ts +3 -2
  27. package/src/controllers/collection_registry.ts +5 -1
  28. package/src/controllers/data_driver.ts +58 -2
  29. package/src/controllers/index.ts +1 -10
  30. package/src/index.ts +1 -1
  31. package/src/types/admin_block.ts +75 -0
  32. package/src/types/backend.ts +33 -1
  33. package/src/types/channel_bus.ts +202 -0
  34. package/src/types/collection_contract.ts +278 -0
  35. package/src/types/collections.ts +25 -848
  36. package/src/types/component_ref.ts +40 -6
  37. package/src/types/entity_callbacks.ts +1 -1
  38. package/src/types/index.ts +7 -15
  39. package/src/types/policy.ts +25 -11
  40. package/src/types/project_manifest.ts +362 -0
  41. package/src/types/properties.ts +11 -169
  42. package/src/types/schema_version.ts +112 -0
  43. package/src/types/security_rules.ts +344 -0
  44. package/src/types/storage_authorize.ts +77 -0
  45. package/dist/controllers/analytics_controller.d.ts +0 -7
  46. package/dist/controllers/auth.d.ts +0 -110
  47. package/dist/controllers/customization_controller.d.ts +0 -61
  48. package/dist/controllers/dialogs_controller.d.ts +0 -36
  49. package/dist/controllers/local_config_persistence.d.ts +0 -20
  50. package/dist/controllers/navigation.d.ts +0 -225
  51. package/dist/controllers/registry.d.ts +0 -80
  52. package/dist/controllers/side_dialogs_controller.d.ts +0 -67
  53. package/dist/controllers/side_panel_controller.d.ts +0 -97
  54. package/dist/controllers/snackbar.d.ts +0 -24
  55. package/dist/rebase_context.d.ts +0 -110
  56. package/dist/types/breadcrumbs.d.ts +0 -26
  57. package/dist/types/builders.d.ts +0 -15
  58. package/dist/types/component_overrides.d.ts +0 -196
  59. package/dist/types/entity_actions.d.ts +0 -104
  60. package/dist/types/entity_link_builder.d.ts +0 -7
  61. package/dist/types/entity_views.d.ts +0 -95
  62. package/dist/types/export_import.d.ts +0 -21
  63. package/dist/types/formex.d.ts +0 -40
  64. package/dist/types/locales.d.ts +0 -4
  65. package/dist/types/modify_collections.d.ts +0 -5
  66. package/dist/types/plugins.d.ts +0 -277
  67. package/dist/types/property_config.d.ts +0 -74
  68. package/dist/types/slots.d.ts +0 -262
  69. package/dist/types/translations.d.ts +0 -915
  70. package/dist/types/user_management_delegate.d.ts +0 -22
  71. package/src/controllers/analytics_controller.tsx +0 -57
  72. package/src/controllers/auth.tsx +0 -121
  73. package/src/controllers/customization_controller.tsx +0 -72
  74. package/src/controllers/dialogs_controller.tsx +0 -37
  75. package/src/controllers/local_config_persistence.tsx +0 -22
  76. package/src/controllers/navigation.ts +0 -267
  77. package/src/controllers/registry.ts +0 -95
  78. package/src/controllers/side_dialogs_controller.tsx +0 -82
  79. package/src/controllers/side_panel_controller.tsx +0 -112
  80. package/src/controllers/snackbar.ts +0 -29
  81. package/src/rebase_context.tsx +0 -130
  82. package/src/types/breadcrumbs.ts +0 -27
  83. package/src/types/builders.ts +0 -17
  84. package/src/types/component_overrides.ts +0 -244
  85. package/src/types/entity_actions.tsx +0 -125
  86. package/src/types/entity_link_builder.ts +0 -8
  87. package/src/types/entity_views.tsx +0 -114
  88. package/src/types/export_import.ts +0 -26
  89. package/src/types/formex.ts +0 -45
  90. package/src/types/locales.ts +0 -81
  91. package/src/types/modify_collections.tsx +0 -6
  92. package/src/types/plugins.tsx +0 -346
  93. package/src/types/property_config.tsx +0 -95
  94. package/src/types/slots.tsx +0 -307
  95. package/src/types/translations.ts +0 -1026
  96. package/src/types/user_management_delegate.ts +0 -23
@@ -1,4 +1,36 @@
1
- import type React from "react";
1
+ /**
2
+ * How a collection points at a UI component without the backend learning about React.
3
+ *
4
+ * This file is the hinge the BaaS/admin split turns on. `ComponentRef` is named
5
+ * by `properties.ts` (`ui.Field`, `ui.Preview`, `ui.Filter`), and `properties.ts`
6
+ * must stay in the React-free core because every backend subsystem — validation,
7
+ * the drizzle schema generator, the OpenAPI generator, the SDK codegen — reads
8
+ * property definitions. If `ComponentRef` needed `React.ComponentType`, the whole
9
+ * property model would have to move to the admin layer with it.
10
+ *
11
+ * So the React types are described structurally instead of imported. Every form
12
+ * a React component takes is assignable to {@link ComponentLike}:
13
+ *
14
+ * - a function component is `(props: P) => ReactNode`
15
+ * - a class component satisfies the construct signature (`Component` has `render`)
16
+ * - `memo` and `forwardRef` return exotic components, which are callable
17
+ *
18
+ * The cost is that the return type is `unknown` rather than `ReactNode`, so a
19
+ * function that returns something React could not render is accepted here.
20
+ * `@rebasepro/admin-types` re-exports a `ReactComponentRef<P>` narrowed against
21
+ * the real `React.ComponentType` for authoring and for the admin's internals,
22
+ * which restores that check where it can be enforced.
23
+ */
24
+ /**
25
+ * Structural stand-in for `React.ComponentType<P>`.
26
+ *
27
+ * Deliberately not `Function` or `unknown`: those would accept anything and the
28
+ * resolver's runtime heuristics ({@link ComponentRef} form 3) would be all that
29
+ * stood between a typo and a blank screen.
30
+ */
31
+ export type ComponentLike<P = any> = ((props: P) => unknown) | (new (props: P, context?: unknown) => {
32
+ render(): unknown;
33
+ });
2
34
  /**
3
35
  * Internal marker for a lazily-loaded component reference.
4
36
  * Created by the Vite transform plugin when converting string paths
@@ -9,11 +41,11 @@ import type React from "react";
9
41
  export interface LazyComponentRef<P = unknown> {
10
42
  readonly __rebaseLazy: true;
11
43
  readonly load: () => Promise<{
12
- default: React.ComponentType<P>;
44
+ default: ComponentLike<P>;
13
45
  }>;
14
46
  }
15
47
  /**
16
- * A reference to a React component that can be provided in three forms:
48
+ * A reference to a UI component that can be provided in three forms:
17
49
  *
18
50
  * 1. **String path** (recommended for collection configs):
19
51
  * ```ts
@@ -34,12 +66,13 @@ export interface LazyComponentRef<P = unknown> {
34
66
  * ```
35
67
  * Importing a component at the top level will pull React into the
36
68
  * backend runtime — only safe in code that the backend never imports.
69
+ * `pnpm check:headless` fails on a collection file that does this.
37
70
  *
38
71
  * @group Types
39
72
  */
40
- export type ComponentRef<P = any> = React.ComponentType<P> | LazyComponentRef<P> | (() => Promise<{
41
- default: React.ComponentType<P>;
42
- }>) | string;
73
+ export type ComponentRef<P = any> = string | LazyComponentRef<P> | (() => Promise<{
74
+ default: ComponentLike<P>;
75
+ }>) | ComponentLike<P>;
43
76
  /**
44
77
  * Type guard: checks if a value is a `LazyComponentRef` produced by the
45
78
  * Vite transform plugin.
@@ -1,7 +1,7 @@
1
1
  import type { CollectionConfig } from "./collections";
2
2
  import type { EntityStatus, EntityValues } from "./entities";
3
3
  import type { User } from "../users";
4
- import type { RebaseCallContext } from "../rebase_context";
4
+ import type { RebaseCallContext } from "../call_context";
5
5
  /**
6
6
  * Lifecycle callbacks for entity CRUD operations.
7
7
  *
@@ -2,25 +2,15 @@ export * from "./entities";
2
2
  export * from "./filter-operators";
3
3
  export * from "./chips";
4
4
  export * from "./properties";
5
+ export * from "./admin_block";
5
6
  export * from "./collections";
6
7
  export * from "./relations";
7
8
  export * from "./policy";
8
- export * from "./locales";
9
- export * from "./entity_link_builder";
10
- export * from "./user_management_delegate";
9
+ export * from "./security_rules";
11
10
  export * from "./entity_callbacks";
12
- export * from "./export_import";
13
- export * from "./modify_collections";
14
- export * from "./formex";
15
11
  export * from "./websockets";
16
12
  export * from "./backend";
17
- export * from "./translations";
18
- export * from "./plugins";
19
- export * from "./builders";
20
- export * from "./slots";
21
- export * from "./entity_actions";
22
- export * from "./property_config";
23
- export * from "./entity_views";
13
+ export * from "./channel_bus";
24
14
  export * from "./data_source";
25
15
  export * from "./storage_source";
26
16
  export * from "./cron";
@@ -28,6 +18,8 @@ export * from "./backup";
28
18
  export * from "./component_ref";
29
19
  export * from "./auth_adapter";
30
20
  export * from "./database_adapter";
31
- export * from "./breadcrumbs";
32
- export * from "./component_overrides";
33
21
  export * from "./api_keys";
22
+ export * from "./project_manifest";
23
+ export * from "./collection_contract";
24
+ export * from "./schema_version";
25
+ export * from "./storage_authorize";
@@ -0,0 +1,336 @@
1
+ /**
2
+ * The project manifest (`rebase.json`) and the build artifacts derived from it.
3
+ *
4
+ * Three separate documents live in this file, and keeping them distinct matters:
5
+ *
6
+ * 1. {@link RebaseProjectManifest} — `rebase.json`. **Authored** by the developer,
7
+ * committed to the repository. Declares topology only: which runtime major the
8
+ * project targets, and which apps *this repository* contributes to the project.
9
+ * Schema, security rules, hooks and functions stay in TypeScript under the
10
+ * config package — nothing that needs a type system belongs here.
11
+ *
12
+ * 2. {@link RebaseProjectLink} — the per-checkout link (`.rebase/cloud.json`).
13
+ * **Not committed**, because it is per-developer like a git remote. Says which
14
+ * deployed project this working copy points at, whether that is a Rebase Cloud
15
+ * project or the base URL of a self-hosted backend.
16
+ *
17
+ * 3. {@link RebaseBundleManifest} — `manifest.json` inside a built bundle.
18
+ * **Generated**, never hand-edited. It is the lockfile analogue: the exact
19
+ * contract a built artifact claims to satisfy, which the runtime validates
20
+ * before it boots and a control plane validates before it deploys.
21
+ *
22
+ * A repository declares only the apps it contains. The set of apps belonging to a
23
+ * project is held by the project itself, which is what makes multi-repo projects
24
+ * work: two repositories never need to know about each other, only about the
25
+ * project.
26
+ */
27
+ /**
28
+ * Which kind of thing an app is.
29
+ *
30
+ * - `backend` — the collections/hooks/functions that define the project's API.
31
+ * Exactly one per *project* (not per repository); the registry enforces it.
32
+ * - `static` — a pre-built client bundle (SPA, static site) served over CDN.
33
+ * - `admin` — the Rebase admin panel, either hosted by the platform or built
34
+ * into this repository.
35
+ * - `mobile` — a native app. Registration only: it gets client credentials and
36
+ * configuration, and is never built or hosted here.
37
+ * - `custom` — an arbitrary container image built from a Dockerfile. The eject
38
+ * hatch: full control, no managed-runtime guarantees.
39
+ */
40
+ export type RebaseAppType = "backend" | "static" | "admin" | "mobile" | "custom";
41
+ /**
42
+ * The backend app: the project's API surface.
43
+ *
44
+ * Paths are relative to the directory holding `rebase.json`. The defaults match
45
+ * the layout `rebase init` scaffolds, so a stock project may declare simply
46
+ * `{ "type": "backend" }`.
47
+ */
48
+ export interface RebaseBackendAppConfig {
49
+ type: "backend";
50
+ /** Directory of the config package (collections + index). Default `config`. */
51
+ config?: string;
52
+ /** Directory of server functions. Default `backend/functions`. */
53
+ functions?: string;
54
+ /** Directory of cron job definitions. Default `backend/crons` when present. */
55
+ crons?: string;
56
+ /**
57
+ * Path to the generated Drizzle schema module (tables/enums/relations).
58
+ * Default `backend/src/schema.generated.ts`.
59
+ */
60
+ schema?: string;
61
+ /**
62
+ * Which collections source the runtime uses.
63
+ *
64
+ * - `cms` (default) — collections come from the config package.
65
+ * - `baas` — collections are introspected from the live database at boot and
66
+ * the config package is not required.
67
+ */
68
+ mode?: "cms" | "baas";
69
+ /**
70
+ * Module path (relative to `config`) exporting the auth users collection as
71
+ * its default export. Default `collections/users`.
72
+ */
73
+ usersCollection?: string;
74
+ }
75
+ /**
76
+ * A static client bundle — SPA or static site — built here and served from CDN.
77
+ */
78
+ export interface RebaseStaticAppConfig {
79
+ type: "static";
80
+ /** Package directory containing the client sources. */
81
+ root: string;
82
+ /** Command that produces `output`. Run from the repository root. */
83
+ build?: string;
84
+ /** Directory of built assets, relative to the repository root. */
85
+ output: string;
86
+ /**
87
+ * Serve `index.html` for unmatched paths (client-side routing).
88
+ * Default `true` — the overwhelmingly common case for a client app, and a
89
+ * static *site* generator emits real files for its routes anyway.
90
+ */
91
+ spa?: boolean;
92
+ }
93
+ /**
94
+ * The admin panel.
95
+ *
96
+ * `hosted` is the default and means the platform serves it — nothing is built
97
+ * into this repository and nothing ships in the bundle. `bundled` builds it here,
98
+ * which is what a self-hosted or air-gapped deployment wants.
99
+ */
100
+ export interface RebaseAdminAppConfig {
101
+ type: "admin";
102
+ mode?: "hosted" | "bundled";
103
+ /** Only for `bundled`: package directory containing the admin sources. */
104
+ root?: string;
105
+ /** Only for `bundled`: build command. */
106
+ build?: string;
107
+ /** Only for `bundled`: directory of built assets. */
108
+ output?: string;
109
+ }
110
+ /**
111
+ * A native app. Registered for credentials and configuration; never built here.
112
+ */
113
+ export interface RebaseMobileAppConfig {
114
+ type: "mobile";
115
+ platform: "ios" | "android" | "other";
116
+ }
117
+ /**
118
+ * An app built from a Dockerfile into an arbitrary image.
119
+ *
120
+ * This is the deliberate escape hatch. A project containing one is not eligible
121
+ * for the managed runtime — the platform cannot make guarantees about an image
122
+ * it did not build — but it still deploys, and nothing else about the project
123
+ * changes.
124
+ */
125
+ export interface RebaseCustomAppConfig {
126
+ type: "custom";
127
+ /** Dockerfile path relative to the repository root. */
128
+ dockerfile?: string;
129
+ /** Build context relative to the repository root. Default `.`. */
130
+ context?: string;
131
+ /** Port the container listens on. Default 8080. */
132
+ port?: number;
133
+ }
134
+ export type RebaseAppConfig = RebaseBackendAppConfig | RebaseStaticAppConfig | RebaseAdminAppConfig | RebaseMobileAppConfig | RebaseCustomAppConfig;
135
+ /**
136
+ * `rebase.json` — the authored project manifest.
137
+ */
138
+ export interface RebaseProjectManifest {
139
+ /** JSON Schema URL, for editor completion. Ignored by the tooling. */
140
+ $schema?: string;
141
+ /**
142
+ * The runtime **major** this project targets, as a semver range
143
+ * (e.g. `^1`, `~1.4`, or an exact `1.4.2` to pin).
144
+ *
145
+ * The platform upgrades patches and minors underneath a project without
146
+ * asking; it never crosses a major. See {@link RUNTIME_CONTRACT_VERSION}.
147
+ */
148
+ runtime: string;
149
+ /**
150
+ * Apps this repository contributes, keyed by app name. The key is the app's
151
+ * identity within the project: it is what `rebase deploy <app>` names, what
152
+ * client credentials are issued against, and what a second repository must
153
+ * not collide with.
154
+ */
155
+ apps: Record<string, RebaseAppConfig>;
156
+ }
157
+ /**
158
+ * The per-checkout project link.
159
+ *
160
+ * Deliberately separate from `rebase.json`: the manifest is committed and shared,
161
+ * while the link is per-developer. Keeping them in one file would mean either
162
+ * committing someone's project id or gitignoring the topology.
163
+ */
164
+ export interface RebaseProjectLink {
165
+ /**
166
+ * A Rebase Cloud project id, or the base URL of any running Rebase backend
167
+ * (`https://api.example.com`). Both are first-class: every command that
168
+ * accepts a project reference accepts either, so a self-hosted project has
169
+ * the same tooling as a cloud one.
170
+ */
171
+ project: string;
172
+ /** Organization slug. Cloud projects only. */
173
+ org?: string;
174
+ /** Explicit API base URL, when it differs from the project's default. */
175
+ apiUrl?: string;
176
+ }
177
+ /**
178
+ * Whether a project can run on the managed runtime, and if not, precisely why.
179
+ *
180
+ * The reasons are returned rather than summarised so tooling can print something
181
+ * a developer can act on. "Not eligible" is never a dead end — it selects the
182
+ * custom-runtime path, which still deploys.
183
+ */
184
+ export interface ManagedCompatibility {
185
+ eligible: boolean;
186
+ reasons: string[];
187
+ }
188
+ /**
189
+ * Version of the bundle *format* itself.
190
+ *
191
+ * Bumped only when the on-disk layout changes in a way an older runtime could
192
+ * not read. A runtime accepts any bundle whose `bundleFormat` is less than or
193
+ * equal to its own — old bundles keep booting on new runtimes, which is the
194
+ * whole point of separating the artifact from the engine.
195
+ */
196
+ export declare const BUNDLE_FORMAT_VERSION = 1;
197
+ /**
198
+ * The runtime contract major.
199
+ *
200
+ * Distinct from the `@rebasepro/server` package version: the package may release
201
+ * any number of minors and patches while this stays put. It changes only when
202
+ * the bundle/runtime contract breaks compatibility, and a project's
203
+ * `manifest.runtime` range is matched against *this*.
204
+ */
205
+ export declare const RUNTIME_CONTRACT_VERSION = 1;
206
+ /** Where the runtime finds each part of the bundle. Paths are bundle-relative. */
207
+ export interface RebaseBundleEntrypoints {
208
+ /** Compiled config package directory (collections live under it). */
209
+ config?: string;
210
+ /** Compiled collections directory, when it differs from `<config>/collections`. */
211
+ collections?: string;
212
+ /** Compiled functions directory. */
213
+ functions?: string;
214
+ /** Compiled crons directory. */
215
+ crons?: string;
216
+ /** Compiled Drizzle schema module. */
217
+ schema?: string;
218
+ /** Module exporting the auth users collection (default export). */
219
+ usersCollection?: string;
220
+ /** Built admin assets, when the admin panel is bundled rather than hosted. */
221
+ admin?: string;
222
+ /** Built static assets to serve from the runtime, when not on a CDN. */
223
+ static?: string;
224
+ }
225
+ /**
226
+ * A native module found in the dependency closure.
227
+ *
228
+ * Recorded rather than merely counted so a rejection can name the offending
229
+ * package instead of saying "something here is native".
230
+ */
231
+ export interface NativeDependency {
232
+ name: string;
233
+ /** Why it was flagged — a `.node` binary, a gyp build, or an install script. */
234
+ reason: string;
235
+ }
236
+ /**
237
+ * `manifest.json` — generated, and the document the runtime and control plane
238
+ * both validate against.
239
+ */
240
+ export interface RebaseBundleManifest {
241
+ /** @see BUNDLE_FORMAT_VERSION */
242
+ bundleFormat: number;
243
+ runtime: {
244
+ /** The `runtime` range copied from `rebase.json`. */
245
+ range: string;
246
+ /** Exact `@rebasepro/server` version this bundle was built against. */
247
+ builtAgainst: string;
248
+ /** Runtime contract major this bundle requires. */
249
+ contract: number;
250
+ };
251
+ /**
252
+ * Hash of the compiled collection definitions.
253
+ *
254
+ * This is the contract stamp. A generated SDK records the value it was built
255
+ * from, a client sends it back, and a mismatch is what lets the platform say
256
+ * "this app was built against an older schema" instead of failing mysteriously
257
+ * at the first request. It covers collections only — a hook edit does not
258
+ * change a client's contract, so it must not invalidate every SDK.
259
+ */
260
+ schemaVersion: string;
261
+ /** Which app in `rebase.json` this bundle was built from. */
262
+ app: string;
263
+ /**
264
+ * What the runtime does with this bundle.
265
+ *
266
+ * - `cms` — a backend with declared collections; the runtime provisions their
267
+ * tables and serves the data API.
268
+ * - `baas` — a backend that introspects an existing database rather than
269
+ * declaring collections.
270
+ * - `static` — no backend at all: the bundle is a built SPA (`entry.static`),
271
+ * and the runtime only serves those assets. No database, no data sources —
272
+ * this is how a `static`/`admin` app runs on the same image as the backend.
273
+ */
274
+ mode: "cms" | "baas" | "static";
275
+ entry: RebaseBundleEntrypoints;
276
+ /** Collection slugs contained in the bundle, for quick inspection. */
277
+ collections?: string[];
278
+ hooks: {
279
+ /**
280
+ * Whether the dependency closure contains native code.
281
+ *
282
+ * The managed runtime refuses these: a prebuilt binary cannot be run on
283
+ * an image the platform did not build it for, and the honest failure is
284
+ * at deploy time rather than at 3am in a crash loop.
285
+ */
286
+ native: boolean;
287
+ nativeModules?: NativeDependency[];
288
+ };
289
+ /**
290
+ * What the bundle's config says about storage access control.
291
+ *
292
+ * Storage is not under RLS and its keys share one flat namespace, so a
293
+ * deployment with file storage enabled and no access model serves every
294
+ * user's files to every signed-in user. The runtime refuses to boot in that
295
+ * state — which, on a hosted platform that enables storage from the *console*
296
+ * rather than from the bundle, surfaces as a crash loop the developer cannot
297
+ * read.
298
+ *
299
+ * Recording it here lets a host reject the deploy with the reason instead.
300
+ * Absent on bundles built before this field existed.
301
+ */
302
+ storage?: {
303
+ /** Whether the config package exports a `storageAuthorize` hook. */
304
+ authorize: boolean;
305
+ };
306
+ deps: {
307
+ /** Runtime dependencies of user code, as declared. */
308
+ declared: Record<string, string>;
309
+ };
310
+ build: {
311
+ /** `@rebasepro/cli` version that produced this bundle. */
312
+ cli: string;
313
+ /** Node major the bundle was compiled on. */
314
+ node: string;
315
+ /** ISO-8601. */
316
+ createdAt: string;
317
+ };
318
+ }
319
+ /** The contract a running backend serves at `GET /api/meta/contract`. */
320
+ export interface RebaseProjectContract {
321
+ /** Matches {@link RebaseBundleManifest.schemaVersion}. */
322
+ schemaVersion: string;
323
+ runtime: {
324
+ /** `@rebasepro/server` version currently running. */
325
+ version: string;
326
+ contract: number;
327
+ };
328
+ mode: "cms" | "baas";
329
+ /** Full collection definitions, serialized — the input to SDK generation. */
330
+ collections: unknown[];
331
+ /** Collection slugs, for cheap inspection without parsing the definitions. */
332
+ collectionSlugs: string[];
333
+ generatedAt: string;
334
+ }
335
+ /** Header carrying the schema version an SDK was generated from. */
336
+ export declare const SCHEMA_VERSION_HEADER = "x-rebase-schema";