@vertebr/admin 0.4.0 → 0.5.1
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/dist/database/connector.d.ts +1 -1
- package/dist/database/connector.d.ts.map +1 -1
- package/dist/database/connector.js +42 -6
- package/dist/database/connector.js.map +1 -1
- package/dist/database/index.d.ts +4 -4
- package/dist/database/index.d.ts.map +1 -1
- package/dist/database/index.js +4 -4
- package/dist/database/index.js.map +1 -1
- package/dist/database/{firestore.d.ts → providers/firestore.d.ts} +1 -1
- package/dist/database/providers/firestore.d.ts.map +1 -0
- package/dist/database/providers/firestore.js.map +1 -0
- package/dist/database/{memory.d.ts → providers/memory.d.ts} +1 -1
- package/dist/database/providers/memory.d.ts.map +1 -0
- package/dist/database/providers/memory.js.map +1 -0
- package/dist/database/{mongo.d.ts → providers/mongo.d.ts} +1 -1
- package/dist/database/providers/mongo.d.ts.map +1 -0
- package/dist/database/providers/mongo.js.map +1 -0
- package/dist/database/{postgres.d.ts → providers/postgres.d.ts} +1 -1
- package/dist/database/providers/postgres.d.ts.map +1 -0
- package/dist/database/providers/postgres.js.map +1 -0
- package/dist/database/types.d.ts +20 -5
- package/dist/database/types.d.ts.map +1 -1
- package/dist/index.d.ts +9 -264
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +23 -957
- package/dist/index.js.map +1 -1
- package/dist/runtime/api/catalog.d.ts +59 -0
- package/dist/runtime/api/catalog.d.ts.map +1 -0
- package/dist/runtime/api/catalog.js +85 -0
- package/dist/runtime/api/catalog.js.map +1 -0
- package/dist/runtime/api/configs.d.ts +15 -0
- package/dist/runtime/api/configs.d.ts.map +1 -0
- package/dist/runtime/api/configs.js +43 -0
- package/dist/runtime/api/configs.js.map +1 -0
- package/dist/runtime/api/emails.d.ts +85 -0
- package/dist/runtime/api/emails.d.ts.map +1 -0
- package/dist/runtime/api/emails.js +520 -0
- package/dist/runtime/api/emails.js.map +1 -0
- package/dist/runtime/api/gallery.d.ts +28 -0
- package/dist/runtime/api/gallery.d.ts.map +1 -0
- package/dist/runtime/api/gallery.js +91 -0
- package/dist/runtime/api/gallery.js.map +1 -0
- package/dist/runtime/api/metrics.d.ts +22 -0
- package/dist/runtime/api/metrics.d.ts.map +1 -0
- package/dist/runtime/api/metrics.js +38 -0
- package/dist/runtime/api/metrics.js.map +1 -0
- package/dist/runtime/api/public.d.ts +22 -0
- package/dist/runtime/api/public.d.ts.map +1 -0
- package/dist/runtime/api/public.js +69 -0
- package/dist/runtime/api/public.js.map +1 -0
- package/dist/runtime/api/request.d.ts +26 -0
- package/dist/runtime/api/request.d.ts.map +1 -0
- package/dist/runtime/api/request.js +38 -0
- package/dist/runtime/api/request.js.map +1 -0
- package/dist/runtime/api/resources.d.ts +85 -0
- package/dist/runtime/api/resources.d.ts.map +1 -0
- package/dist/runtime/api/resources.js +263 -0
- package/dist/runtime/api/resources.js.map +1 -0
- package/dist/runtime/api/routes.d.ts +8 -0
- package/dist/runtime/api/routes.d.ts.map +1 -0
- package/dist/runtime/api/routes.js +202 -0
- package/dist/runtime/api/routes.js.map +1 -0
- package/dist/runtime/api/spa.d.ts +2 -0
- package/dist/runtime/api/spa.d.ts.map +1 -0
- package/dist/runtime/api/spa.js +34 -0
- package/dist/runtime/api/spa.js.map +1 -0
- package/dist/runtime/connectors/payments/connector.d.ts +30 -0
- package/dist/runtime/connectors/payments/connector.d.ts.map +1 -0
- package/dist/runtime/connectors/payments/connector.js +226 -0
- package/dist/runtime/connectors/payments/connector.js.map +1 -0
- package/dist/runtime/connectors/payments/index.d.ts +4 -0
- package/dist/runtime/connectors/payments/index.d.ts.map +1 -0
- package/dist/runtime/connectors/payments/index.js +10 -0
- package/dist/runtime/connectors/payments/index.js.map +1 -0
- package/dist/runtime/connectors/payments/stripe.d.ts +99 -0
- package/dist/runtime/connectors/payments/stripe.d.ts.map +1 -0
- package/dist/runtime/connectors/payments/stripe.js +189 -0
- package/dist/runtime/connectors/payments/stripe.js.map +1 -0
- package/dist/runtime/connectors/payments/types.d.ts +67 -0
- package/dist/runtime/connectors/payments/types.d.ts.map +1 -0
- package/dist/runtime/connectors/payments/types.js +16 -0
- package/dist/runtime/connectors/payments/types.js.map +1 -0
- package/dist/runtime/connectors/stripe.d.ts +19 -0
- package/dist/runtime/connectors/stripe.d.ts.map +1 -0
- package/dist/runtime/connectors/stripe.js +26 -0
- package/dist/runtime/connectors/stripe.js.map +1 -0
- package/dist/runtime/constants.d.ts +5 -0
- package/dist/runtime/constants.d.ts.map +1 -0
- package/dist/runtime/constants.js +8 -0
- package/dist/runtime/constants.js.map +1 -0
- package/dist/runtime/createAdmin.d.ts +3 -0
- package/dist/runtime/createAdmin.d.ts.map +1 -0
- package/dist/runtime/createAdmin.js +152 -0
- package/dist/runtime/createAdmin.js.map +1 -0
- package/dist/runtime/errors.d.ts +17 -0
- package/dist/runtime/errors.d.ts.map +1 -0
- package/dist/runtime/errors.js +36 -0
- package/dist/runtime/errors.js.map +1 -0
- package/dist/runtime/mail.d.ts +23 -0
- package/dist/runtime/mail.d.ts.map +1 -0
- package/dist/runtime/mail.js +248 -0
- package/dist/runtime/mail.js.map +1 -0
- package/dist/runtime/services/environment.d.ts +8 -0
- package/dist/runtime/services/environment.d.ts.map +1 -0
- package/dist/runtime/services/environment.js +78 -0
- package/dist/runtime/services/environment.js.map +1 -0
- package/dist/runtime/services/registry.d.ts +6 -0
- package/dist/runtime/services/registry.d.ts.map +1 -0
- package/dist/runtime/services/registry.js +32 -0
- package/dist/runtime/services/registry.js.map +1 -0
- package/dist/runtime/services/state.d.ts +25 -0
- package/dist/runtime/services/state.d.ts.map +1 -0
- package/dist/runtime/services/state.js +3 -0
- package/dist/runtime/services/state.js.map +1 -0
- package/dist/runtime/types/actions.d.ts +15 -0
- package/dist/runtime/types/actions.d.ts.map +1 -0
- package/dist/runtime/types/actions.js +3 -0
- package/dist/runtime/types/actions.js.map +1 -0
- package/dist/runtime/types/admin.d.ts +83 -0
- package/dist/runtime/types/admin.d.ts.map +1 -0
- package/dist/runtime/types/admin.js +3 -0
- package/dist/runtime/types/admin.js.map +1 -0
- package/dist/runtime/types/auth.d.ts +67 -0
- package/dist/runtime/types/auth.d.ts.map +1 -0
- package/dist/runtime/types/auth.js +3 -0
- package/dist/runtime/types/auth.js.map +1 -0
- package/dist/runtime/types/config.d.ts +39 -0
- package/dist/runtime/types/config.d.ts.map +1 -0
- package/dist/runtime/types/config.js +3 -0
- package/dist/runtime/types/config.js.map +1 -0
- package/dist/runtime/types/index.d.ts +15 -0
- package/dist/runtime/types/index.d.ts.map +1 -0
- package/dist/runtime/types/index.js +7 -0
- package/dist/runtime/types/index.js.map +1 -0
- package/dist/runtime/types/layout.d.ts +29 -0
- package/dist/runtime/types/layout.d.ts.map +1 -0
- package/dist/runtime/types/layout.js +3 -0
- package/dist/runtime/types/layout.js.map +1 -0
- package/dist/runtime/types/mail/catalog.d.ts +104 -0
- package/dist/runtime/types/mail/catalog.d.ts.map +1 -0
- package/dist/runtime/types/mail/catalog.js +3 -0
- package/dist/runtime/types/mail/catalog.js.map +1 -0
- package/dist/runtime/types/mail/definition.d.ts +68 -0
- package/dist/runtime/types/mail/definition.d.ts.map +1 -0
- package/dist/runtime/types/mail/definition.js +3 -0
- package/dist/runtime/types/mail/definition.js.map +1 -0
- package/dist/runtime/types/mail/index.d.ts +4 -0
- package/dist/runtime/types/mail/index.d.ts.map +1 -0
- package/dist/runtime/types/mail/index.js +3 -0
- package/dist/runtime/types/mail/index.js.map +1 -0
- package/dist/runtime/types/mail/message.d.ts +45 -0
- package/dist/runtime/types/mail/message.d.ts.map +1 -0
- package/dist/runtime/types/mail/message.js +3 -0
- package/dist/runtime/types/mail/message.js.map +1 -0
- package/dist/runtime/types/metrics.d.ts +46 -0
- package/dist/runtime/types/metrics.d.ts.map +1 -0
- package/dist/runtime/types/metrics.js +3 -0
- package/dist/runtime/types/metrics.js.map +1 -0
- package/dist/runtime/types/resource.d.ts +41 -0
- package/dist/runtime/types/resource.d.ts.map +1 -0
- package/dist/runtime/types/resource.js +3 -0
- package/dist/runtime/types/resource.js.map +1 -0
- package/dist/runtime/utils/auth.d.ts +4 -0
- package/dist/runtime/utils/auth.d.ts.map +1 -0
- package/dist/runtime/utils/auth.js +29 -0
- package/dist/runtime/utils/auth.js.map +1 -0
- package/dist/runtime/utils/config.d.ts +4 -0
- package/dist/runtime/utils/config.d.ts.map +1 -0
- package/dist/runtime/utils/config.js +14 -0
- package/dist/runtime/utils/config.js.map +1 -0
- package/dist/runtime/utils/http.d.ts +7 -0
- package/dist/runtime/utils/http.d.ts.map +1 -0
- package/dist/runtime/utils/http.js +61 -0
- package/dist/runtime/utils/http.js.map +1 -0
- package/dist/runtime/utils/metricsRange.d.ts +34 -0
- package/dist/runtime/utils/metricsRange.d.ts.map +1 -0
- package/dist/runtime/utils/metricsRange.js +121 -0
- package/dist/runtime/utils/metricsRange.js.map +1 -0
- package/dist/runtime/utils/sidebar.d.ts +2 -0
- package/dist/runtime/utils/sidebar.d.ts.map +1 -0
- package/dist/runtime/utils/sidebar.js +8 -0
- package/dist/runtime/utils/sidebar.js.map +1 -0
- package/dist/runtime/utils/staticDir.d.ts +2 -0
- package/dist/runtime/utils/staticDir.d.ts.map +1 -0
- package/dist/runtime/utils/staticDir.js +16 -0
- package/dist/runtime/utils/staticDir.js.map +1 -0
- package/dist/runtime/utils/uploads.d.ts +6 -0
- package/dist/runtime/utils/uploads.d.ts.map +1 -0
- package/dist/runtime/utils/uploads.js +66 -0
- package/dist/runtime/utils/uploads.js.map +1 -0
- package/dist/schema.d.ts +6 -0
- package/dist/schema.d.ts.map +1 -1
- package/package.json +1 -1
- package/static/assets/index-DKyVvFeT.js +332 -0
- package/static/assets/index-DUwFg1bw.css +1 -0
- package/static/index.html +2 -2
- package/dist/database/firestore.d.ts.map +0 -1
- package/dist/database/firestore.js.map +0 -1
- package/dist/database/memory.d.ts.map +0 -1
- package/dist/database/memory.js.map +0 -1
- package/dist/database/mongo.d.ts.map +0 -1
- package/dist/database/mongo.js.map +0 -1
- package/dist/database/postgres.d.ts.map +0 -1
- package/dist/database/postgres.js.map +0 -1
- package/static/assets/index-CZ7lykOe.css +0 -1
- package/static/assets/index-DvZiFDex.js +0 -329
- /package/dist/database/{firestore.js → providers/firestore.js} +0 -0
- /package/dist/database/{memory.js → providers/memory.js} +0 -0
- /package/dist/database/{mongo.js → providers/mongo.js} +0 -0
- /package/dist/database/{postgres.js → providers/postgres.js} +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -2,271 +2,16 @@
|
|
|
2
2
|
* Vertebr — core admin control plane.
|
|
3
3
|
* Wire resources once; owners control them from the admin UI.
|
|
4
4
|
*/
|
|
5
|
-
import { type ConfigStore } from "./store";
|
|
6
|
-
import type { FieldSchema, FieldType, GalleryDefinition, HandlerContext, ResourceUploadDefinition } from "./schema";
|
|
7
5
|
export { memoryStore, mergeConfigValue, type ConfigStore, } from "./store";
|
|
8
6
|
export type { FieldSchema, FieldType, GalleryDefinition, GalleryItem, GalleryMeta, HandlerContext, ResourceUploadDefinition, ResourceUploadFile, ResourceUploadMeta, ResourceUploadResult, } from "./schema";
|
|
9
|
-
|
|
10
|
-
export
|
|
11
|
-
export type ResourceAction
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
};
|
|
16
|
-
export type
|
|
17
|
-
|
|
18
|
-
label: string;
|
|
19
|
-
schema: Record<string, FieldSchema>;
|
|
20
|
-
list?: (ctx: HandlerContext) => Promise<T[]> | T[];
|
|
21
|
-
get?: (id: string, ctx: HandlerContext) => Promise<T | undefined> | T | undefined;
|
|
22
|
-
create?: (input: Partial<T>, ctx: HandlerContext) => Promise<T> | T;
|
|
23
|
-
update?: (id: string, input: Partial<T>, ctx: HandlerContext) => Promise<T> | T;
|
|
24
|
-
remove?: (id: string, ctx: HandlerContext) => Promise<void> | void;
|
|
25
|
-
actions?: Record<string, ResourceAction<T>>;
|
|
26
|
-
/**
|
|
27
|
-
* Field-keyed upload handlers. Keys must match schema fields
|
|
28
|
-
* (typically image URL strings).
|
|
29
|
-
*/
|
|
30
|
-
uploads?: Record<string, ResourceUploadDefinition>;
|
|
31
|
-
permissions?: {
|
|
32
|
-
create?: boolean;
|
|
33
|
-
update?: boolean;
|
|
34
|
-
delete?: boolean;
|
|
35
|
-
};
|
|
36
|
-
/**
|
|
37
|
-
* When true, storefront can list this resource via
|
|
38
|
-
* `/api/public/resources/{id}` (no auth). Rows with `active: false`
|
|
39
|
-
* are omitted.
|
|
40
|
-
*/
|
|
41
|
-
public?: boolean;
|
|
42
|
-
};
|
|
43
|
-
/** Sidebar group for configs / controls in the dashboard. */
|
|
44
|
-
export type ConfigSection = "config" | "page";
|
|
45
|
-
export type ConfigDefinition = {
|
|
46
|
-
id: string;
|
|
47
|
-
label: string;
|
|
48
|
-
schema: Record<string, FieldSchema>;
|
|
49
|
-
/** Sidebar group — use `"page"` for page-specific content. @default "config" */
|
|
50
|
-
section?: ConfigSection;
|
|
51
|
-
get: (ctx: HandlerContext) => Promise<Record<string, unknown>> | Record<string, unknown>;
|
|
52
|
-
set: (value: Record<string, unknown>, ctx: HandlerContext) => Promise<void> | void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* High-level control registration — store-backed config with optional
|
|
56
|
-
* public storefront read.
|
|
57
|
-
*/
|
|
58
|
-
export type ControlDefinition = {
|
|
59
|
-
id: string;
|
|
60
|
-
label: string;
|
|
61
|
-
schema: Record<string, FieldSchema>;
|
|
62
|
-
store: ConfigStore;
|
|
63
|
-
/** Sidebar group — use `"page"` for page-specific content. @default "config" */
|
|
64
|
-
section?: ConfigSection;
|
|
65
|
-
/** When true, exposed via `/api/public/controls` (no auth). */
|
|
66
|
-
public?: boolean;
|
|
67
|
-
/**
|
|
68
|
-
* Defaults merged under stored values.
|
|
69
|
-
* Schema `default` values are applied first, then this.
|
|
70
|
-
*/
|
|
71
|
-
defaults?: Record<string, unknown> | ((env: string) => Record<string, unknown>);
|
|
72
|
-
};
|
|
73
|
-
/** Store-backed page content — same as `control()` with `section: "page"`. */
|
|
74
|
-
export type PageDefinition = Omit<ControlDefinition, "section">;
|
|
75
|
-
/** Named slot in a host-rendered page layout. */
|
|
76
|
-
export type LayoutSlot = {
|
|
77
|
-
id: string;
|
|
78
|
-
label: string;
|
|
79
|
-
};
|
|
80
|
-
export type LayoutPreset = {
|
|
81
|
-
id: string;
|
|
82
|
-
label: string;
|
|
83
|
-
};
|
|
84
|
-
/**
|
|
85
|
-
* Owner-reorderable page layout. Vertebr stores the recipe; the host
|
|
86
|
-
* still owns CSS and rendering.
|
|
87
|
-
*/
|
|
88
|
-
export type LayoutDefinition = {
|
|
89
|
-
id: string;
|
|
90
|
-
label: string;
|
|
91
|
-
slots: LayoutSlot[];
|
|
92
|
-
/** @default slot ids in declaration order */
|
|
93
|
-
defaultOrder?: string[];
|
|
94
|
-
presets?: LayoutPreset[];
|
|
95
|
-
store: ConfigStore;
|
|
96
|
-
public?: boolean;
|
|
97
|
-
section?: ConfigSection;
|
|
98
|
-
};
|
|
99
|
-
export type Connector = {
|
|
100
|
-
id: string;
|
|
101
|
-
register: (admin: Admin) => void;
|
|
102
|
-
};
|
|
103
|
-
/** Dashboard KPI card returned by `metrics()`. */
|
|
104
|
-
export type MetricCard = {
|
|
105
|
-
id: string;
|
|
106
|
-
label: string;
|
|
107
|
-
value: string | number;
|
|
108
|
-
hint?: string;
|
|
109
|
-
tone?: "neutral" | "ok" | "warn" | "danger";
|
|
110
|
-
};
|
|
111
|
-
export type MetricsDefinition = {
|
|
112
|
-
id?: string;
|
|
113
|
-
label?: string;
|
|
114
|
-
load: (ctx: HandlerContext) => Promise<MetricCard[]> | MetricCard[];
|
|
115
|
-
};
|
|
116
|
-
/**
|
|
117
|
-
* Per-environment auth — adjusted by the host app developer.
|
|
118
|
-
* Vertebr enforces these after resolving the user via `auth.getUser`.
|
|
119
|
-
*/
|
|
120
|
-
export type EnvironmentAuthConfig = {
|
|
121
|
-
/** Require a signed-in user for this environment. @default false */
|
|
122
|
-
required?: boolean;
|
|
123
|
-
/**
|
|
124
|
-
* Custom claim key (e.g. `allowedEnvs`).
|
|
125
|
-
* Array/string claims must include `claimIncludes` (defaults to env id).
|
|
126
|
-
*/
|
|
127
|
-
claimKey?: string;
|
|
128
|
-
/** Value required in the claim. Defaults to this environment's id. */
|
|
129
|
-
claimIncludes?: string;
|
|
130
|
-
/** If set, user.roles must include at least one of these. */
|
|
131
|
-
roles?: string[];
|
|
132
|
-
/**
|
|
133
|
-
* Public browser auth configuration. Safe Firebase web config only;
|
|
134
|
-
* never put service-account credentials or secrets here.
|
|
135
|
-
*/
|
|
136
|
-
client?: {
|
|
137
|
-
provider: "firebase";
|
|
138
|
-
config: {
|
|
139
|
-
apiKey: string;
|
|
140
|
-
authDomain: string;
|
|
141
|
-
projectId: string;
|
|
142
|
-
appId: string;
|
|
143
|
-
messagingSenderId?: string;
|
|
144
|
-
};
|
|
145
|
-
methods?: Array<"email" | "google">;
|
|
146
|
-
};
|
|
147
|
-
};
|
|
148
|
-
export type AdminEnvironment = {
|
|
149
|
-
id: string;
|
|
150
|
-
label: string;
|
|
151
|
-
/** Optional UI hint — e.g. production = danger. */
|
|
152
|
-
tone?: "neutral" | "warn" | "danger";
|
|
153
|
-
/** Auth rules for this environment (developer-configurable). */
|
|
154
|
-
auth?: EnvironmentAuthConfig;
|
|
155
|
-
};
|
|
156
|
-
/** Public auth summary returned to the dashboard (no secrets). */
|
|
157
|
-
export type EnvironmentAuthPublic = {
|
|
158
|
-
required: boolean;
|
|
159
|
-
claimKey?: string;
|
|
160
|
-
roles?: string[];
|
|
161
|
-
client?: EnvironmentAuthConfig["client"];
|
|
162
|
-
};
|
|
163
|
-
export type VertebrUser = {
|
|
164
|
-
uid: string;
|
|
165
|
-
claims?: Record<string, unknown>;
|
|
166
|
-
roles?: string[];
|
|
167
|
-
};
|
|
168
|
-
export type AuthContext = {
|
|
169
|
-
env: string;
|
|
170
|
-
user: VertebrUser | null;
|
|
171
|
-
environment: AdminEnvironment;
|
|
172
|
-
};
|
|
173
|
-
export type AdminAuth = {
|
|
174
|
-
/** Resolve the current user (Firebase token, session, etc.). */
|
|
175
|
-
getUser?: (request: unknown) => Promise<VertebrUser | null> | VertebrUser | null;
|
|
176
|
-
/**
|
|
177
|
-
* Global gate after per-env auth rules.
|
|
178
|
-
* Return false to deny even when env auth passed.
|
|
179
|
-
*/
|
|
180
|
-
check: (request: unknown, ctx: AuthContext) => Promise<boolean> | boolean;
|
|
181
|
-
};
|
|
182
|
-
export type CreateAdminOptions = {
|
|
183
|
-
auth: AdminAuth;
|
|
184
|
-
basePath?: string;
|
|
185
|
-
/** Directory of built dashboard SPA (index.html + assets). */
|
|
186
|
-
staticDir?: string;
|
|
187
|
-
/**
|
|
188
|
-
* Environments the owner can switch between.
|
|
189
|
-
* Omit or pass one entry for single-env apps.
|
|
190
|
-
*/
|
|
191
|
-
environments?: AdminEnvironment[];
|
|
192
|
-
/** Fallback when the client sends no env header. */
|
|
193
|
-
defaultEnvironment?: string;
|
|
194
|
-
/**
|
|
195
|
-
* Run resource/config handlers inside host env scope
|
|
196
|
-
* (Firestore ALS, tenant context, etc.).
|
|
197
|
-
*/
|
|
198
|
-
onEnvironment?: <T>(env: string, run: () => Promise<T> | T) => Promise<T> | T;
|
|
199
|
-
};
|
|
200
|
-
export type Admin = {
|
|
201
|
-
resource: <T = unknown>(def: ResourceDefinition<T>) => Admin;
|
|
202
|
-
config: (def: ConfigDefinition) => Admin;
|
|
203
|
-
/**
|
|
204
|
-
* Register a store-backed control (dashboard form + optional public read).
|
|
205
|
-
* Prefer this over raw `config()` for site flags and copy.
|
|
206
|
-
*/
|
|
207
|
-
control: (def: ControlDefinition) => Admin;
|
|
208
|
-
/**
|
|
209
|
-
* Register page-specific content (appears under Pages in the sidebar).
|
|
210
|
-
* Equivalent to `control({ ...def, section: "page" })`.
|
|
211
|
-
*/
|
|
212
|
-
page: (def: PageDefinition) => Admin;
|
|
213
|
-
/**
|
|
214
|
-
* Register an owner-reorderable layout (preset + ordered blocks).
|
|
215
|
-
* Appears under Pages by default; expose with `public: true` for the storefront.
|
|
216
|
-
*/
|
|
217
|
-
layout: (def: LayoutDefinition) => Admin;
|
|
218
|
-
/** Register the overview metrics board. */
|
|
219
|
-
metrics: (def: MetricsDefinition) => Admin;
|
|
220
|
-
/**
|
|
221
|
-
* Register a media gallery (sidebar under Resources).
|
|
222
|
-
* Host lists/uploads/deletes assets; Vertebr renders the UI.
|
|
223
|
-
*/
|
|
224
|
-
gallery: (def: GalleryDefinition) => Admin;
|
|
225
|
-
/** Server-side read of a registered config/control (auth not applied). */
|
|
226
|
-
readConfig: (id: string, env: string) => Promise<Record<string, unknown>>;
|
|
227
|
-
use: (connector: Connector) => Admin;
|
|
228
|
-
routes: () => AdminRoute[];
|
|
229
|
-
hapiRoutes: () => HapiCompatibleRoute[];
|
|
230
|
-
resources: () => ResourceDefinition[];
|
|
231
|
-
configs: () => ConfigDefinition[];
|
|
232
|
-
environments: () => AdminEnvironment[];
|
|
233
|
-
};
|
|
234
|
-
export type AdminRoute = {
|
|
235
|
-
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
236
|
-
path: string;
|
|
237
|
-
handler: (request: unknown) => Promise<unknown> | unknown;
|
|
238
|
-
};
|
|
239
|
-
export type HapiCompatibleRoute = {
|
|
240
|
-
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
241
|
-
path: string;
|
|
242
|
-
options?: {
|
|
243
|
-
auth?: false | string;
|
|
244
|
-
[key: string]: any;
|
|
245
|
-
};
|
|
246
|
-
handler: (request: unknown, h: unknown) => Promise<unknown> | unknown;
|
|
247
|
-
};
|
|
248
|
-
export declare class VertebrAuthError extends Error {
|
|
249
|
-
readonly statusCode = 401;
|
|
250
|
-
constructor(message?: string);
|
|
251
|
-
}
|
|
252
|
-
export declare class VertebrNotFoundError extends Error {
|
|
253
|
-
readonly statusCode = 404;
|
|
254
|
-
constructor(message?: string);
|
|
255
|
-
}
|
|
256
|
-
export declare class VertebrEnvError extends Error {
|
|
257
|
-
readonly statusCode = 400;
|
|
258
|
-
constructor(message?: string);
|
|
259
|
-
}
|
|
260
|
-
export declare class VertebrBadRequestError extends Error {
|
|
261
|
-
readonly statusCode = 400;
|
|
262
|
-
constructor(message?: string);
|
|
263
|
-
}
|
|
264
|
-
export declare function createAdmin(options: CreateAdminOptions): Admin;
|
|
265
|
-
/** Example connector shape — Stripe implementation TBD. */
|
|
266
|
-
export declare function stripeConnector(options: {
|
|
267
|
-
id?: string;
|
|
268
|
-
client: unknown;
|
|
269
|
-
panels?: Array<"sessions" | "webhookHealth" | "refunds">;
|
|
270
|
-
}): Connector;
|
|
7
|
+
export { VERTEBR_ENV_HEADER } from "./runtime/constants";
|
|
8
|
+
export { METRICS_RANGES, parseMetricsRange, resolveMetricsRange, type MetricsRangeId, type ResolvedMetricsRange, } from "./runtime/utils/metricsRange";
|
|
9
|
+
export type { Admin, AdminAuth, AdminEnvironment, AdminRoute, AuthContext, CollectionWideAction, ConfigDefinition, ConfigSection, Connector, ControlDefinition, CreateAdminOptions, EnvironmentAuthConfig, EnvironmentAuthPublic, HapiCompatibleRoute, LayoutDefinition, LayoutPreset, LayoutSlot, ActionInputField, MailCampaign, MailCampaignAudience, MailCampaignScheduleInput, MailCampaignStatus, MailComposeResult, MailDefinition, MailHistoryEntry, MailHistoryRecordInput, MailLibraryTemplate, MailMessage, MailProductOption, MailDiscountOption, MailSendResult, MailSentHandler, MailTemplate, MetricCard, MetricChart, MetricChartPoint, MetricsDefinition, MetricsPayload, PageDefinition, ResourceAction, ResourceDefinition, ResourceMailBinding, ResourceMailConfig, VertebrUser, } from "./runtime/types";
|
|
10
|
+
export type { MailSendReceipt } from "./runtime/types/mail/message";
|
|
11
|
+
export { VertebrAuthError, VertebrBadRequestError, VertebrEnvError, VertebrNotFoundError, } from "./runtime/errors";
|
|
12
|
+
export { createAdmin } from "./runtime/createAdmin";
|
|
13
|
+
export { stripeConnector } from "./runtime/connectors/stripe";
|
|
14
|
+
export type { StripeConnectorOptions } from "./runtime/connectors/stripe";
|
|
15
|
+
export { paymentsConnector, stripePaymentsProvider, toMailDiscountOptions, type ListPaymentSessionsOptions, type PaymentDiscount, type PaymentSession, type PaymentWebhookHealth, type PaymentsConnectorOptions, type PaymentsPanel, type PaymentsProvider, type RefundPaymentOptions, type StripeCheckoutSessionLike, type StripePaymentsClient, type StripePaymentsProviderOptions, type StripePromotionCodeLike, } from "./runtime/connectors/payments";
|
|
271
16
|
export { adapterConfigStore, adapterCount, adapterList, databaseConnector, firestoreAdapter, memoryAdapter, mongoAdapter, postgresAdapter, postgresJsonbTableDDL, whereEq, type CollectionResourceDefinition, type DatabaseAdapter, type DatabaseAdapterResolver, type DatabaseConnectorOptions, type DatabaseDoc, type DatabaseListOptions, type DatabaseWhere, type FirestoreAdapterOptions, type FirestoreLike, type MemoryAdapterOptions, type MongoAdapterOptions, type MongoCollectionLike, type MongoCursorLike, type MongoDbLike, type PostgresAdapterMode, type PostgresAdapterOptions, type PostgresQueryable, } from "./database";
|
|
272
17
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,EACL,WAAW,EACX,gBAAgB,EAChB,KAAK,WAAW,GACjB,MAAM,SAAS,CAAC;AAEjB,YAAY,EACV,WAAW,EACX,SAAS,EACT,iBAAiB,EACjB,WAAW,EACX,WAAW,EACX,cAAc,EACd,wBAAwB,EACxB,kBAAkB,EAClB,kBAAkB,EAClB,oBAAoB,GACrB,MAAM,UAAU,CAAC;AAElB,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD,OAAO,EACL,cAAc,EACd,iBAA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