@rebasepro/server-core 0.6.1 → 0.7.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/package.json +14 -14
- package/src/api/errors.ts +16 -2
- package/src/api/graphql/graphql-schema-generator.ts +45 -10
- package/src/api/server.ts +10 -2
- package/src/api/types.ts +6 -0
- package/src/auth/adapter-middleware.ts +10 -2
- package/src/auth/admin-roles-route.ts +36 -0
- package/src/auth/admin-users-route.ts +302 -0
- package/src/auth/api-keys/api-key-middleware.ts +4 -3
- package/src/auth/api-keys/api-key-routes.ts +12 -2
- package/src/auth/api-keys/api-key-store.ts +83 -66
- package/src/auth/api-keys/api-key-types.ts +8 -0
- package/src/auth/apple-oauth.ts +2 -1
- package/src/auth/auth-hooks.ts +21 -0
- package/src/auth/bitbucket-oauth.ts +2 -1
- package/src/auth/builtin-auth-adapter.ts +28 -4
- package/src/auth/custom-auth-adapter.ts +2 -0
- package/src/auth/discord-oauth.ts +2 -1
- package/src/auth/facebook-oauth.ts +2 -1
- package/src/auth/github-oauth.ts +2 -1
- package/src/auth/gitlab-oauth.ts +2 -1
- package/src/auth/google-oauth.ts +8 -4
- package/src/auth/index.ts +2 -0
- package/src/auth/interfaces.ts +27 -0
- package/src/auth/linkedin-oauth.ts +2 -1
- package/src/auth/magic-link-routes.ts +167 -0
- package/src/auth/mfa-crypto.ts +91 -0
- package/src/auth/mfa-routes.ts +34 -10
- package/src/auth/microsoft-oauth.ts +2 -1
- package/src/auth/middleware.ts +10 -1
- package/src/auth/reset-password-admin.ts +17 -1
- package/src/auth/routes.ts +77 -8
- package/src/auth/session-routes.ts +15 -3
- package/src/auth/slack-oauth.ts +2 -1
- package/src/auth/spotify-oauth.ts +2 -1
- package/src/auth/twitter-oauth.ts +8 -1
- package/src/cron/cron-store.ts +25 -23
- package/src/email/index.ts +3 -2
- package/src/email/templates.ts +82 -0
- package/src/email/types.ts +16 -0
- package/src/init.ts +137 -5
- package/src/services/routed-realtime-service.ts +113 -0
- package/src/utils/dev-port.ts +13 -7
- package/test/auth-routes.test.ts +54 -4
- package/test/custom-auth-adapter.test.ts +20 -1
- package/test/env.test.ts +9 -19
- package/test/multi-datasource-routing.test.ts +113 -0
- package/test/routed-realtime-service.test.ts +86 -0
- package/test/transform-auth-response.test.ts +305 -0
- package/build-errors.txt +0 -52
- package/dist/api/ast-schema-editor.d.ts +0 -21
- package/dist/api/collections_for_test/callbacks_test_collection.d.ts +0 -2
- package/dist/api/errors.d.ts +0 -53
- package/dist/api/graphql/graphql-schema-generator.d.ts +0 -35
- package/dist/api/graphql/index.d.ts +0 -1
- package/dist/api/index.d.ts +0 -9
- package/dist/api/logs-routes.d.ts +0 -37
- package/dist/api/openapi-generator.d.ts +0 -16
- package/dist/api/rest/api-generator.d.ts +0 -88
- package/dist/api/rest/index.d.ts +0 -1
- package/dist/api/rest/query-parser.d.ts +0 -11
- package/dist/api/schema-editor-routes.d.ts +0 -3
- package/dist/api/server.d.ts +0 -40
- package/dist/api/types.d.ts +0 -98
- package/dist/auth/adapter-middleware.d.ts +0 -37
- package/dist/auth/admin-user-ops.d.ts +0 -79
- package/dist/auth/api-keys/api-key-middleware.d.ts +0 -39
- package/dist/auth/api-keys/api-key-permission-guard.d.ts +0 -32
- package/dist/auth/api-keys/api-key-routes.d.ts +0 -20
- package/dist/auth/api-keys/api-key-store.d.ts +0 -35
- package/dist/auth/api-keys/api-key-types.d.ts +0 -88
- package/dist/auth/api-keys/index.d.ts +0 -17
- package/dist/auth/apple-oauth.d.ts +0 -30
- package/dist/auth/auth-hooks.d.ts +0 -225
- package/dist/auth/bitbucket-oauth.d.ts +0 -11
- package/dist/auth/builtin-auth-adapter.d.ts +0 -49
- package/dist/auth/crypto-utils.d.ts +0 -16
- package/dist/auth/custom-auth-adapter.d.ts +0 -39
- package/dist/auth/discord-oauth.d.ts +0 -14
- package/dist/auth/facebook-oauth.d.ts +0 -14
- package/dist/auth/github-oauth.d.ts +0 -15
- package/dist/auth/gitlab-oauth.d.ts +0 -13
- package/dist/auth/google-oauth.d.ts +0 -47
- package/dist/auth/index.d.ts +0 -36
- package/dist/auth/interfaces.d.ts +0 -401
- package/dist/auth/jwt.d.ts +0 -55
- package/dist/auth/linkedin-oauth.d.ts +0 -18
- package/dist/auth/mfa-routes.d.ts +0 -6
- package/dist/auth/mfa.d.ts +0 -49
- package/dist/auth/microsoft-oauth.d.ts +0 -16
- package/dist/auth/middleware.d.ts +0 -106
- package/dist/auth/password.d.ts +0 -22
- package/dist/auth/rate-limiter.d.ts +0 -50
- package/dist/auth/reset-password-admin.d.ts +0 -29
- package/dist/auth/rls-scope.d.ts +0 -31
- package/dist/auth/routes.d.ts +0 -33
- package/dist/auth/session-routes.d.ts +0 -25
- package/dist/auth/slack-oauth.d.ts +0 -12
- package/dist/auth/spotify-oauth.d.ts +0 -12
- package/dist/auth/twitter-oauth.d.ts +0 -18
- package/dist/backend-CIxN4FVm.js +0 -15
- package/dist/backend-CIxN4FVm.js.map +0 -1
- package/dist/chunk-Dze3rakg.js +0 -42
- package/dist/collections/BackendCollectionRegistry.d.ts +0 -13
- package/dist/collections/loader.d.ts +0 -5
- package/dist/cron/cron-loader.d.ts +0 -17
- package/dist/cron/cron-routes.d.ts +0 -14
- package/dist/cron/cron-scheduler.d.ts +0 -106
- package/dist/cron/cron-store.d.ts +0 -32
- package/dist/cron/index.d.ts +0 -6
- package/dist/db/interfaces.d.ts +0 -18
- package/dist/dist-CZKP-Xz4.js +0 -832
- package/dist/dist-CZKP-Xz4.js.map +0 -1
- package/dist/email/index.d.ts +0 -6
- package/dist/email/smtp-email-service.d.ts +0 -25
- package/dist/email/templates.d.ts +0 -42
- package/dist/email/types.d.ts +0 -108
- package/dist/env.d.ts +0 -102
- package/dist/from-VbwD7xRf.js +0 -3849
- package/dist/from-VbwD7xRf.js.map +0 -1
- package/dist/functions/function-loader.d.ts +0 -17
- package/dist/functions/function-routes.d.ts +0 -10
- package/dist/functions/index.d.ts +0 -3
- package/dist/history/history-routes.d.ts +0 -23
- package/dist/history/index.d.ts +0 -1
- package/dist/index.d.ts +0 -33
- package/dist/index.es.js +0 -61731
- package/dist/index.es.js.map +0 -1
- package/dist/index.umd.js +0 -73221
- package/dist/index.umd.js.map +0 -1
- package/dist/init/docs.d.ts +0 -4
- package/dist/init/health.d.ts +0 -2
- package/dist/init/middlewares.d.ts +0 -10
- package/dist/init/shutdown.d.ts +0 -11
- package/dist/init/storage.d.ts +0 -5
- package/dist/init.d.ts +0 -258
- package/dist/jwt-DHcQRGC3.js +0 -4168
- package/dist/jwt-DHcQRGC3.js.map +0 -1
- package/dist/logger-BYU66ENZ.js +0 -94
- package/dist/logger-BYU66ENZ.js.map +0 -1
- package/dist/ms-BeBSuOXN.js +0 -125
- package/dist/ms-BeBSuOXN.js.map +0 -1
- package/dist/multipart-parser-CedBDOeC.js +0 -299
- package/dist/multipart-parser-CedBDOeC.js.map +0 -1
- package/dist/serve-spa.d.ts +0 -30
- package/dist/services/driver-registry.d.ts +0 -78
- package/dist/services/webhook-service.d.ts +0 -29
- package/dist/singleton.d.ts +0 -35
- package/dist/src-COaj0G3P.js +0 -1182
- package/dist/src-COaj0G3P.js.map +0 -1
- package/dist/storage/LocalStorageController.d.ts +0 -46
- package/dist/storage/S3StorageController.d.ts +0 -36
- package/dist/storage/image-transform.d.ts +0 -50
- package/dist/storage/index.d.ts +0 -28
- package/dist/storage/routes.d.ts +0 -38
- package/dist/storage/storage-registry.d.ts +0 -78
- package/dist/storage/tus-handler.d.ts +0 -51
- package/dist/storage/types.d.ts +0 -103
- package/dist/types/index.d.ts +0 -11
- package/dist/utils/dev-port.d.ts +0 -35
- package/dist/utils/logger.d.ts +0 -31
- package/dist/utils/logging.d.ts +0 -9
- package/dist/utils/request-id.d.ts +0 -4
- package/dist/utils/request-logger.d.ts +0 -19
- package/dist/utils/sql.d.ts +0 -27
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
export interface LoadedFunction {
|
|
3
|
-
/** Endpoint name derived from filename (e.g., "send-invoice") */
|
|
4
|
-
name: string;
|
|
5
|
-
/** The Hono sub-app to mount */
|
|
6
|
-
app: Hono<import("hono").Env>;
|
|
7
|
-
}
|
|
8
|
-
/**
|
|
9
|
-
* Auto-discover Hono route files from a directory.
|
|
10
|
-
*
|
|
11
|
-
* Each file should default-export a Hono app (or router).
|
|
12
|
-
* The filename (without extension) becomes the mount path:
|
|
13
|
-
* `functions/send-invoice.ts` → mounted at `/send-invoice`
|
|
14
|
-
*
|
|
15
|
-
* This mirrors how `loadCollectionsFromDirectory` works for collections.
|
|
16
|
-
*/
|
|
17
|
-
export declare function loadFunctionsFromDirectory(directory: string): Promise<LoadedFunction[]>;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import { HonoEnv } from "../api/types";
|
|
3
|
-
import { LoadedFunction } from "./function-loader";
|
|
4
|
-
/**
|
|
5
|
-
* Mount all loaded function routes under a single Hono router.
|
|
6
|
-
*
|
|
7
|
-
* Each function is mounted at `/<function-name>`, preserving
|
|
8
|
-
* whatever HTTP methods and middleware the Hono sub-app defines.
|
|
9
|
-
*/
|
|
10
|
-
export declare function createFunctionRoutes(functions: LoadedFunction[]): Hono<HonoEnv>;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Hono } from "hono";
|
|
2
|
-
import { HonoEnv } from "../api/types";
|
|
3
|
-
import { BackendCollectionRegistry } from "../collections/BackendCollectionRegistry";
|
|
4
|
-
import { DataDriver } from "@rebasepro/types";
|
|
5
|
-
/**
|
|
6
|
-
* Create Hono routes for entity history.
|
|
7
|
-
* Mounted at `{basePath}/data/:slug/:entityId/history`.
|
|
8
|
-
*/
|
|
9
|
-
export interface HistoryService {
|
|
10
|
-
fetchHistory(tableName: string, entityId: string, options: {
|
|
11
|
-
limit: number;
|
|
12
|
-
offset: number;
|
|
13
|
-
}): Promise<{
|
|
14
|
-
data: Record<string, unknown>[];
|
|
15
|
-
total: number;
|
|
16
|
-
}>;
|
|
17
|
-
fetchHistoryEntry(historyId: string): Promise<Record<string, unknown> | null>;
|
|
18
|
-
}
|
|
19
|
-
export declare function createHistoryRoutes(params: {
|
|
20
|
-
historyService: HistoryService;
|
|
21
|
-
registry: BackendCollectionRegistry;
|
|
22
|
-
driver: DataDriver;
|
|
23
|
-
}): Hono<HonoEnv>;
|
package/dist/history/index.d.ts
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { createHistoryRoutes } from "./history-routes";
|
package/dist/index.d.ts
DELETED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @rebasepro/server-core
|
|
3
|
-
*
|
|
4
|
-
* Database-Agnostic Backend Core for Rebase.
|
|
5
|
-
* This package provides the core backend services, generic driver routing,
|
|
6
|
-
* and API layers. Database implementations (e.g., PostgreSQL) are provided
|
|
7
|
-
* by specialized driver packages like `@rebasepro/server-postgresql`.
|
|
8
|
-
*/
|
|
9
|
-
export * from "./db/interfaces";
|
|
10
|
-
export * from "./auth/interfaces";
|
|
11
|
-
export * from "./init";
|
|
12
|
-
export { rebase, _setRebaseMock, _resetRebaseMock } from "./singleton";
|
|
13
|
-
export * from "./services/driver-registry";
|
|
14
|
-
export * from "./api/types";
|
|
15
|
-
export * from "./api";
|
|
16
|
-
export * from "./types";
|
|
17
|
-
export * from "./types/index";
|
|
18
|
-
export * from "./auth";
|
|
19
|
-
export * from "./email";
|
|
20
|
-
export * from "./storage";
|
|
21
|
-
export * from "./utils/logging";
|
|
22
|
-
export * from "./utils/logger";
|
|
23
|
-
export * from "./utils/request-logger";
|
|
24
|
-
export * from "./utils/request-id";
|
|
25
|
-
export * from "./utils/sql";
|
|
26
|
-
export * from "./history";
|
|
27
|
-
export * from "./functions";
|
|
28
|
-
export * from "./cron";
|
|
29
|
-
export * from "./serve-spa";
|
|
30
|
-
export * from "./utils/dev-port";
|
|
31
|
-
export { loadEnv } from "./env";
|
|
32
|
-
export type { RebaseEnv } from "./env";
|
|
33
|
-
export { z } from "zod";
|