@rebasepro/types 0.4.0 → 0.5.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.
- package/README.md +83 -232
- package/dist/index.es.js.map +1 -1
- package/dist/index.umd.js.map +1 -1
- package/dist/types/backend.d.ts +36 -1
- package/dist/types/collections.d.ts +21 -1
- package/dist/types/properties.d.ts +0 -8
- package/package.json +1 -1
- package/src/types/backend.ts +39 -1
- package/src/types/collections.ts +22 -1
- package/src/types/properties.ts +0 -9
package/README.md
CHANGED
|
@@ -1,242 +1,93 @@
|
|
|
1
|
-
|
|
2
|
-
<a href="https://rebase.pro">
|
|
3
|
-
<img src="https://rebase.pro/img/logo_small.png" width="240px" alt="Rebase logo" />
|
|
4
|
-
</a>
|
|
5
|
-
</p>
|
|
1
|
+
# @rebasepro/types
|
|
6
2
|
|
|
7
|
-
|
|
8
|
-
<h3 align="center">The Open-Source Headless CMS & Admin Panel for Postgres</h3>
|
|
9
|
-
<p align="center">
|
|
10
|
-
<strong>Ship production-ready backends and radically extensible back-office apps in minutes.</strong><br/>
|
|
11
|
-
Own your data, own your code. The absolute easiest way to build on PostgreSQL.
|
|
12
|
-
</p>
|
|
3
|
+
Shared TypeScript type definitions and interfaces for the Rebase ecosystem.
|
|
13
4
|
|
|
14
|
-
|
|
15
|
-
<a href="https://demo.rebase.pro">Live Demo</a> •
|
|
16
|
-
<a href="https://rebase.pro/docs">Documentation</a> •
|
|
17
|
-
<a href="https://rebase.pro/features">Features</a> •
|
|
18
|
-
<a href="https://github.com/rebasepro/rebase">GitHub</a> •
|
|
19
|
-
<a href="https://discord.gg/fxy7xsQm3m">Discord</a>
|
|
20
|
-
</p>
|
|
21
|
-
|
|
22
|
-
<p align="center">
|
|
23
|
-
<a href="https://www.npmjs.com/package/@rebasepro/core"><img src="https://img.shields.io/npm/v/@rebasepro/core.svg?style=flat-square&color=orange" alt="NPM Version" /></a>
|
|
24
|
-
<a href="https://opensource.org/licenses/MIT"><img src="https://img.shields.io/badge/license-MIT-purple.svg?style=flat-square" alt="License: MIT" /></a>
|
|
25
|
-
<a href="https://www.npmjs.com/package/@rebasepro/core"><img src="https://img.shields.io/npm/dw/@rebasepro/core?style=flat-square&color=blue" alt="NPM Downloads" /></a>
|
|
26
|
-
<a href="https://discord.gg/fxy7xsQm3m"><img src="https://img.shields.io/discord/1013768502458470442?style=flat-square&logo=discord&logoColor=white&label=Discord" alt="Discord" /></a>
|
|
27
|
-
</p>
|
|
28
|
-
|
|
29
|
-
<br/>
|
|
30
|
-
|
|
31
|
-
<p align="center">
|
|
32
|
-
<img src="https://rebase.pro/img/demo_products.png" width="800px" alt="Rebase Dashboard" />
|
|
33
|
-
</p>
|
|
34
|
-
|
|
35
|
-
---
|
|
36
|
-
|
|
37
|
-
## What is Rebase?
|
|
38
|
-
|
|
39
|
-
Rebase is a **developer-first**, open-source headless CMS and admin panel framework built with **React** and **TypeScript**. It gives you a complete backend-as-a-service layer on top of PostgreSQL — including authentication, S3-compatible storage, a full admin UI, and auto-generated APIs — while letting you extend every layer with custom React components, serverless functions, and scripts.
|
|
40
|
-
|
|
41
|
-
### ✨ Key Highlights
|
|
42
|
-
|
|
43
|
-
- 🔓 **No Vendor Lock-in** — Self-host anywhere. Full control over your infrastructure, code, and database.
|
|
44
|
-
- ⚡ **Instant Setup** — `npx @rebasepro/cli init` scaffolds a production-ready project in seconds.
|
|
45
|
-
- 🗄️ **PostgreSQL First** — First-class Postgres support with Drizzle ORM, schema introspection, and automatic migrations.
|
|
46
|
-
- 🧩 **Radical Extensibility** — Not constrained to pre-built widgets. If you can build it in React, you can build it in Rebase.
|
|
47
|
-
- 🎨 **Premium UI** — Fast, accessible design system built on Tailwind CSS v4 and Radix UI.
|
|
48
|
-
- 🤖 **AI-Ready** — MCP server for AI-assisted database management, plus data enhancement and insights plugins.
|
|
49
|
-
|
|
50
|
-
---
|
|
51
|
-
|
|
52
|
-
## ⚡ Quick Start
|
|
53
|
-
|
|
54
|
-
Scaffold a complete, self-hosted Rebase application connected to your database:
|
|
5
|
+
## Installation
|
|
55
6
|
|
|
56
7
|
```bash
|
|
57
|
-
|
|
8
|
+
pnpm add @rebasepro/types
|
|
58
9
|
```
|
|
59
10
|
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
11
|
+
## What This Package Does
|
|
12
|
+
|
|
13
|
+
Provides the canonical type definitions used across all Rebase packages — both client-side and server-side. This is a **types-only** package with no runtime dependencies. Every other `@rebasepro/*` package depends on it.
|
|
14
|
+
|
|
15
|
+
## Key Exports
|
|
16
|
+
|
|
17
|
+
### Collection & Entity Types
|
|
18
|
+
|
|
19
|
+
| Export | Description |
|
|
20
|
+
|--------|-------------|
|
|
21
|
+
| `EntityCollection` | Full collection definition (name, slug, properties, callbacks, security rules, views) |
|
|
22
|
+
| `Property` | Union type for all property configurations (text, number, date, reference, array, map, etc.) |
|
|
23
|
+
| `Entity` | Generic entity record type |
|
|
24
|
+
| `EntityCallbacks` | Lifecycle hooks (`onPreSave`, `onSaveSuccess`, `onDelete`, etc.) |
|
|
25
|
+
| `EntityValues` | Record of property values for an entity |
|
|
26
|
+
| `SecurityRule` | RLS-style access control rule for a collection |
|
|
27
|
+
|
|
28
|
+
### Backend & Driver Interfaces
|
|
29
|
+
|
|
30
|
+
| Export | Description |
|
|
31
|
+
|--------|-------------|
|
|
32
|
+
| `DataDriver` | Abstract interface for database drivers (`fetchCollection`, `saveEntity`, `deleteEntity`, etc.) |
|
|
33
|
+
| `DatabaseAdapter` | Pluggable database adapter interface (used by `server-core`) |
|
|
34
|
+
| `BackendBootstrapper` | Lifecycle interface for initializing database drivers, auth, history, and realtime |
|
|
35
|
+
| `DatabaseAdmin` | Admin operations interface (SQL execution, collection stats, table metadata) |
|
|
36
|
+
| `RealtimeProvider` | Interface for realtime subscription providers |
|
|
37
|
+
| `BackendConfig` / `BackendInstance` | Abstract backend configuration and instance types |
|
|
38
|
+
| `HealthCheckResult` | Return type for health check operations |
|
|
39
|
+
| `InitializedDriver` | Result of driver initialization (driver, realtime, registry, internals) |
|
|
40
|
+
| `BootstrappedAuth` | Result of auth initialization (user service, role service, email service) |
|
|
41
|
+
|
|
42
|
+
### Auth & User Types
|
|
43
|
+
|
|
44
|
+
| Export | Description |
|
|
45
|
+
|--------|-------------|
|
|
46
|
+
| `AuthAdapter` | Pluggable auth adapter interface (for Clerk, Auth0, custom auth) |
|
|
47
|
+
| `AuthController` | Client-side auth controller interface |
|
|
48
|
+
| `RebaseUser` | User record type |
|
|
49
|
+
| `Role` | Role definition type |
|
|
50
|
+
|
|
51
|
+
### Controller Interfaces
|
|
52
|
+
|
|
53
|
+
| Export | Description |
|
|
54
|
+
|--------|-------------|
|
|
55
|
+
| `RebaseClient` | Top-level client interface (data, auth, storage, email) |
|
|
56
|
+
| `DataSourceDelegate` | Data operations interface for client-side data sources |
|
|
57
|
+
| `StorageSource` | File storage interface |
|
|
58
|
+
| `CollectionRegistryInterface` | Collection lookup and registration |
|
|
59
|
+
| `NavigationController` | App navigation interface |
|
|
60
|
+
|
|
61
|
+
### Other
|
|
62
|
+
|
|
63
|
+
| Export | Description |
|
|
64
|
+
|--------|-------------|
|
|
65
|
+
| `CronJobDefinition` | Cron job configuration type |
|
|
66
|
+
| `BackendHooks` | Server-side hooks for intercepting admin data |
|
|
67
|
+
| `PluginConfig` | Plugin system types |
|
|
68
|
+
| `WebSocketMessage` | WebSocket protocol message types |
|
|
69
|
+
| `Locale` | Localization types |
|
|
70
|
+
|
|
71
|
+
## Quick Start
|
|
72
|
+
|
|
73
|
+
```typescript
|
|
74
|
+
import type {
|
|
75
|
+
EntityCollection,
|
|
76
|
+
DataDriver,
|
|
77
|
+
DatabaseAdapter,
|
|
78
|
+
RebaseUser,
|
|
79
|
+
Property,
|
|
80
|
+
} from "@rebasepro/types";
|
|
65
81
|
```
|
|
66
82
|
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
---
|
|
70
|
-
|
|
71
|
-
## Features
|
|
72
|
-
|
|
73
|
-
### 🏓 Full Admin Panel & CMS
|
|
74
|
-
|
|
75
|
-
An incredibly fast, windowed spreadsheet view to manage your database with inline editing, real-time updates, filtering, sorting, and text search. Switch between multiple view modes:
|
|
76
|
-
|
|
77
|
-
- **Spreadsheet table** — Inline editing, column reordering, drag-and-drop
|
|
78
|
-
- **Card grid** — Visual overview with image previews
|
|
79
|
-
- **List view** — Compact, scannable layout
|
|
80
|
-
- **Custom views** — Build any React component as a collection view
|
|
81
|
-
|
|
82
|
-
### 🔒 Typed Schema & Database Migrations
|
|
83
|
-
|
|
84
|
-
Define your data models using pure TypeScript collections. Rebase automatically generates your Drizzle ORM schema, handles PostgreSQL migrations, and keeps your live database perfectly in sync using built-in tooling like `rebase doctor`.
|
|
85
|
-
|
|
86
|
-
### 🔐 Authentication & Access Control
|
|
87
|
-
|
|
88
|
-
Built-in authentication with multiple providers:
|
|
89
|
-
|
|
90
|
-
- **Email/Password** — With password reset flow
|
|
91
|
-
- **Google OAuth** — One-click sign-in
|
|
92
|
-
- **Anonymous** — For guest access
|
|
93
|
-
|
|
94
|
-
Granular **role-based access control (RBAC)** with customizable permissions per collection, field, and action.
|
|
95
|
-
|
|
96
|
-
### 📦 S3-Compatible Storage
|
|
97
|
-
|
|
98
|
-
Native S3-compatible file storage with:
|
|
99
|
-
|
|
100
|
-
- Drag-and-drop uploads with progress tracking
|
|
101
|
-
- Automatic image resizing and optimization
|
|
102
|
-
- File metadata management
|
|
103
|
-
- Storage browser in Studio
|
|
104
|
-
|
|
105
|
-
### 🛠️ Studio — Developer Toolbox
|
|
106
|
-
|
|
107
|
-
A full developer environment built into the admin panel:
|
|
108
|
-
|
|
109
|
-
| Tool | Description |
|
|
110
|
-
|---|---|
|
|
111
|
-
| **SQL Editor** | Write and execute SQL queries directly against your database with schema-aware autocomplete |
|
|
112
|
-
| **RLS Policy Editor** | Visual editor for PostgreSQL Row-Level Security policies |
|
|
113
|
-
| **Schema Visualizer** | Interactive ER diagram of your database with relationship mapping |
|
|
114
|
-
| **JS/TS Editor** | In-browser code editor for scripts and functions |
|
|
115
|
-
| **API Explorer** | Browse and test your auto-generated REST API endpoints |
|
|
116
|
-
| **Cron Jobs** | Schedule and monitor recurring tasks |
|
|
117
|
-
| **Storage Browser** | Browse and manage files in your S3-compatible storage |
|
|
118
|
-
|
|
119
|
-
### ⚡ Extensible API & Edge Functions
|
|
120
|
-
|
|
121
|
-
Drop custom Hono routes or scheduled tasks into the `functions/` and `crons/` directories. Rebase auto-loads them with database access and JWT authentication middleware injected automatically.
|
|
122
|
-
|
|
123
|
-
### 🧬 SDK Generator
|
|
124
|
-
|
|
125
|
-
Auto-generate fully typed **TypeScript SDKs** from your collection definitions. Use them in any frontend, script, or service to interact with your Rebase backend with complete type safety.
|
|
126
|
-
|
|
127
|
-
```bash
|
|
128
|
-
npx @rebasepro/cli generate-sdk
|
|
129
|
-
```
|
|
130
|
-
|
|
131
|
-
### 🤖 MCP Server
|
|
132
|
-
|
|
133
|
-
A built-in **Model Context Protocol** server that enables AI assistants to:
|
|
134
|
-
|
|
135
|
-
- Query and manage your database schema
|
|
136
|
-
- Create, read, update, and delete documents
|
|
137
|
-
- Manage users and roles
|
|
138
|
-
- Introspect your data model
|
|
139
|
-
|
|
140
|
-
### 🔍 Schema Inference & Introspection
|
|
141
|
-
|
|
142
|
-
Point Rebase at an existing PostgreSQL database and automatically generate collection definitions from your tables — including types, relations, validation constraints, and more.
|
|
143
|
-
|
|
144
|
-
### 📥📤 Import & Export
|
|
145
|
-
|
|
146
|
-
Import data from **CSV, JSON, and Excel** with an intuitive field mapper. Export your data in multiple formats with configurable column selection.
|
|
147
|
-
|
|
148
|
-
### 🧩 Plugins
|
|
149
|
-
|
|
150
|
-
Extend the admin experience with first-party plugins:
|
|
151
|
-
|
|
152
|
-
- **Data Enhancement** — AI-powered field suggestions and auto-fill
|
|
153
|
-
- **Insights** — Analytics dashboards and usage metrics
|
|
154
|
-
|
|
155
|
-
### 📜 Standalone Scripting
|
|
156
|
-
|
|
157
|
-
Write standalone data manipulation scripts that connect directly to your running backend using the `@rebasepro/client` SDK. The CLI persists the dev server URL to `.rebase-dev-url` for zero-config local development.
|
|
158
|
-
|
|
159
|
-
### 🧩 Custom Views & React Extensibility
|
|
160
|
-
|
|
161
|
-
Build entirely custom views — dashboards, previews, charts — and drop them into the main navigation or as entity-level tabs. Use built-in hooks to interact with Rebase's internal state.
|
|
162
|
-
|
|
163
|
-
---
|
|
164
|
-
|
|
165
|
-
## 🛠️ Core Technologies
|
|
166
|
-
|
|
167
|
-
Built entirely on modern, battle-tested web standards:
|
|
168
|
-
|
|
169
|
-
| Technology | What we use it for |
|
|
170
|
-
|---|---|
|
|
171
|
-
| 💙 **TypeScript 5.x** | End-to-end type safety |
|
|
172
|
-
| ⚛️ **React 19** | Component-driven UI |
|
|
173
|
-
| 🌊 **Tailwind CSS v4** | Utility-first styling |
|
|
174
|
-
| 🔌 **WebSockets** | Real-time synchronization |
|
|
175
|
-
| 🗄️ **Drizzle ORM** | Type-safe SQL migrations and queries |
|
|
176
|
-
| 🧱 **Radix UI** | Accessible UI primitives |
|
|
177
|
-
| 📝 **TipTap v3** | Rich text editing |
|
|
178
|
-
| 🌐 **Hono** | Ultrafast HTTP server framework |
|
|
179
|
-
|
|
180
|
-
---
|
|
181
|
-
|
|
182
|
-
## 📦 Packages
|
|
183
|
-
|
|
184
|
-
Rebase is structured as a modular monorepo — install only the layers you need:
|
|
185
|
-
|
|
186
|
-
| Package | Description |
|
|
187
|
-
|---|---|
|
|
188
|
-
| `@rebasepro/types` | Core TypeScript type definitions |
|
|
189
|
-
| `@rebasepro/utils` | Shared utility functions |
|
|
190
|
-
| `@rebasepro/common` | Common modules shared across packages |
|
|
191
|
-
| `@rebasepro/formex` | Lightweight form management library |
|
|
192
|
-
| `@rebasepro/ui` | Standalone React component library (Tailwind + Radix) |
|
|
193
|
-
| `@rebasepro/core` | Core CMS logic and controllers |
|
|
194
|
-
| `@rebasepro/client` | Client-side data access layer |
|
|
195
|
-
| `@rebasepro/client-postgresql` | PostgreSQL client adapter |
|
|
196
|
-
| `@rebasepro/client-firebase` | Firebase/Firestore client adapter |
|
|
197
|
-
| `@rebasepro/server-core` | Server framework and middleware (Hono) |
|
|
198
|
-
| `@rebasepro/server-postgresql` | PostgreSQL server adapter with Drizzle |
|
|
199
|
-
| `@rebasepro/server-mongodb` | MongoDB server adapter |
|
|
200
|
-
| `@rebasepro/auth` | Authentication controllers and login views |
|
|
201
|
-
| `@rebasepro/admin` | Full admin panel interface |
|
|
202
|
-
| `@rebasepro/studio` | SQL editor, RLS editor, schema visualizer, API explorer |
|
|
203
|
-
| `@rebasepro/cli` | CLI for project scaffolding and management |
|
|
204
|
-
| `@rebasepro/sdk-generator` | TypeScript SDK code generation |
|
|
205
|
-
| `@rebasepro/mcp-server` | MCP server for AI integrations |
|
|
206
|
-
| `@rebasepro/schema-inference` | Database schema introspection and inference |
|
|
207
|
-
| `@rebasepro/plugin-data-enhancement` | AI-powered data enhancement plugin |
|
|
208
|
-
| `@rebasepro/plugin-insights` | Analytics and insights plugin |
|
|
209
|
-
|
|
210
|
-
---
|
|
211
|
-
|
|
212
|
-
## 🎨 Standalone UI Library
|
|
213
|
-
|
|
214
|
-
Rebase exposes its design system as a completely independent library. Fully typed, accessible, and customizable via Tailwind CSS v4:
|
|
215
|
-
|
|
216
|
-
```bash
|
|
217
|
-
npm install @rebasepro/ui
|
|
218
|
-
```
|
|
219
|
-
|
|
220
|
-
---
|
|
221
|
-
|
|
222
|
-
## Demo
|
|
223
|
-
|
|
224
|
-
Explore a live interactive sandbox with all features — data resets periodically:
|
|
225
|
-
|
|
226
|
-
**👉 [demo.rebase.pro](https://demo.rebase.pro)**
|
|
227
|
-
|
|
228
|
-
---
|
|
229
|
-
|
|
230
|
-
## Support & Community
|
|
231
|
-
|
|
232
|
-
- 📖 [Documentation](https://rebase.pro/docs)
|
|
233
|
-
- 💬 [Discord Community](https://discord.gg/fxy7xsQm3m)
|
|
234
|
-
- 🐛 [GitHub Issues](https://github.com/rebasepro/rebase/issues)
|
|
235
|
-
- 📝 [Changelog](./CHANGELOG.md)
|
|
236
|
-
|
|
237
|
-
---
|
|
83
|
+
## Related Packages
|
|
238
84
|
|
|
239
|
-
|
|
85
|
+
Every `@rebasepro/*` package depends on this one. Key consumers:
|
|
240
86
|
|
|
241
|
-
|
|
242
|
-
|
|
87
|
+
| Package | Uses |
|
|
88
|
+
|---------|------|
|
|
89
|
+
| `@rebasepro/server-core` | `DataDriver`, `DatabaseAdapter`, `BackendBootstrapper`, `AuthAdapter` |
|
|
90
|
+
| `@rebasepro/server-postgresql` | `BackendBootstrapper`, `InitializedDriver`, `RealtimeProvider` |
|
|
91
|
+
| `@rebasepro/server-mongodb` | `BackendBootstrapper`, `DataDriver`, `EntityCollection` |
|
|
92
|
+
| `@rebasepro/client` | `RebaseClient`, `DataSourceDelegate`, `StorageSource` |
|
|
93
|
+
| `@rebasepro/admin` | `EntityCollection`, `Property`, `PluginConfig`, controller interfaces |
|