@orion-studios/cms 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 +96 -0
- package/dist/analytics/react.d.ts +53 -0
- package/dist/analytics/react.js +195 -0
- package/dist/blocks/index.d.ts +222 -0
- package/dist/blocks/index.js +338 -0
- package/dist/chunk-HVJCF2IZ.js +76 -0
- package/dist/chunk-VPUODCNH.js +448 -0
- package/dist/chunk-WQDHEQDE.js +527 -0
- package/dist/content/index.d.ts +51 -0
- package/dist/content/index.js +8 -0
- package/dist/forms/index.d.ts +70 -0
- package/dist/forms/index.js +38 -0
- package/dist/forms/react.d.ts +45 -0
- package/dist/forms/react.js +8 -0
- package/dist/server/index.d.ts +403 -0
- package/dist/server/index.js +2280 -0
- package/dist/studio/index.d.ts +534 -0
- package/dist/studio/index.js +3824 -0
- package/dist/studio/styles.css +444 -0
- package/dist/submission-BKdBedOe.d.ts +61 -0
- package/dist/submission-CzrfXu17.d.ts +30 -0
- package/package.json +97 -0
- package/sql/bootstrap.sql +458 -0
- package/sql/migrations/0001_atomic_scheduled_publish.sql +68 -0
- package/sql/migrations/0002_rate_limits.sql +62 -0
- package/sql/migrations/0003_atomic_global_update.sql +46 -0
- package/sql/migrations/0004_analytics_visitor_tracking.sql +8 -0
|
@@ -0,0 +1,534 @@
|
|
|
1
|
+
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
2
|
+
import { ComponentType, InputHTMLAttributes } from 'react';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { SupabaseClient, Session } from '@supabase/supabase-js';
|
|
5
|
+
import { F as FormConfig, a as FormNotifyConfig } from '../submission-CzrfXu17.js';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Editor field derivation: turns a block's Zod schema into a default editor
|
|
9
|
+
* field list so blocks are editable with zero editor configuration. Explicit
|
|
10
|
+
* `editor.fields` entries in defineBlock() override the derived ones per key.
|
|
11
|
+
*/
|
|
12
|
+
type EditorInput = 'text' | 'textarea' | 'number' | 'checkbox' | 'select' | 'link' | 'media' | 'file' | 'paragraphs' | 'stringList' | 'itemList';
|
|
13
|
+
type EditorField = {
|
|
14
|
+
key: string;
|
|
15
|
+
label: string;
|
|
16
|
+
input: EditorInput;
|
|
17
|
+
/** Editable inline in the preview (text/textarea only). */
|
|
18
|
+
inline?: boolean;
|
|
19
|
+
options?: Array<{
|
|
20
|
+
label: string;
|
|
21
|
+
value: string;
|
|
22
|
+
}>;
|
|
23
|
+
/** For itemList: fields of each item, derived recursively. */
|
|
24
|
+
itemFields?: EditorField[];
|
|
25
|
+
/** For itemList: a new-item template from the item schema's defaults. */
|
|
26
|
+
itemTemplate?: Record<string, unknown>;
|
|
27
|
+
/** For itemList: item property used as the collapsed label. */
|
|
28
|
+
itemLabelKey?: string;
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* Globals follow the same single-source-of-truth pattern as blocks: one
|
|
33
|
+
* `defineGlobal()` call yields the schema, defaults, validation, and the
|
|
34
|
+
* Studio's editor fields.
|
|
35
|
+
*/
|
|
36
|
+
type GlobalDefinition<TSchema extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = {
|
|
37
|
+
key: string;
|
|
38
|
+
label: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
schema: TSchema;
|
|
41
|
+
editor: {
|
|
42
|
+
fields: EditorField[];
|
|
43
|
+
};
|
|
44
|
+
defaultData: z.infer<TSchema>;
|
|
45
|
+
};
|
|
46
|
+
type GlobalRegistry = {
|
|
47
|
+
list(): GlobalDefinition[];
|
|
48
|
+
get(key: string): GlobalDefinition | undefined;
|
|
49
|
+
/** Parses stored data through the schema (defaults applied, unknown keys stripped). */
|
|
50
|
+
normalize(key: string, data: unknown): Record<string, unknown>;
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
/**
|
|
54
|
+
* The Orion CMS block system.
|
|
55
|
+
*
|
|
56
|
+
* One `defineBlock()` call is the single source of truth for a section type.
|
|
57
|
+
* Everything else — TypeScript types, default data, server-side validation,
|
|
58
|
+
* the builder palette, the inspector fields, and rendering — derives from it.
|
|
59
|
+
*/
|
|
60
|
+
/** A block instance as stored inside a page's JSONB layout. */
|
|
61
|
+
type BlockInstance<TData = Record<string, unknown>> = {
|
|
62
|
+
id: string;
|
|
63
|
+
type: string;
|
|
64
|
+
data: TData;
|
|
65
|
+
/** Presentation settings (spacing, background, visibility) — builder-owned. */
|
|
66
|
+
settings?: Record<string, unknown>;
|
|
67
|
+
};
|
|
68
|
+
type PageLayout = BlockInstance[];
|
|
69
|
+
type BlockPreviewProps<TData> = {
|
|
70
|
+
data: TData;
|
|
71
|
+
/** True when rendering inside the Studio builder (enables inline editing affordances). */
|
|
72
|
+
editing?: boolean;
|
|
73
|
+
/** Inline-commit callback available in the builder. */
|
|
74
|
+
onChange?: (patch: Partial<TData>) => void;
|
|
75
|
+
};
|
|
76
|
+
type BlockDefinition<TSchema extends z.ZodObject<z.ZodRawShape> = z.ZodObject<z.ZodRawShape>> = {
|
|
77
|
+
type: string;
|
|
78
|
+
label: string;
|
|
79
|
+
description?: string;
|
|
80
|
+
/** Palette grouping in the builder. */
|
|
81
|
+
category?: string;
|
|
82
|
+
schema: TSchema;
|
|
83
|
+
/** Derived from the schema; entries here override per key and set order. */
|
|
84
|
+
editor: {
|
|
85
|
+
fields: EditorField[];
|
|
86
|
+
};
|
|
87
|
+
defaultData: z.infer<TSchema>;
|
|
88
|
+
preview?: ComponentType<BlockPreviewProps<z.infer<TSchema>>>;
|
|
89
|
+
};
|
|
90
|
+
type ValidationIssue = {
|
|
91
|
+
blockId: string;
|
|
92
|
+
blockType: string;
|
|
93
|
+
path: string;
|
|
94
|
+
message: string;
|
|
95
|
+
};
|
|
96
|
+
type BlockRegistry = {
|
|
97
|
+
list(): BlockDefinition[];
|
|
98
|
+
get(type: string): BlockDefinition | undefined;
|
|
99
|
+
has(type: string): boolean;
|
|
100
|
+
/** Palette entries for the builder's Add Section panel. */
|
|
101
|
+
palette(): Array<{
|
|
102
|
+
type: string;
|
|
103
|
+
label: string;
|
|
104
|
+
description?: string;
|
|
105
|
+
category?: string;
|
|
106
|
+
defaultData: Record<string, unknown>;
|
|
107
|
+
}>;
|
|
108
|
+
/**
|
|
109
|
+
* Validates and normalizes a layout: unknown block types are rejected,
|
|
110
|
+
* each block's data is parsed through its schema (applying defaults,
|
|
111
|
+
* stripping unknown keys), and issues are collected per block.
|
|
112
|
+
*/
|
|
113
|
+
validateLayout(layout: unknown): {
|
|
114
|
+
ok: boolean;
|
|
115
|
+
layout: PageLayout;
|
|
116
|
+
issues: ValidationIssue[];
|
|
117
|
+
};
|
|
118
|
+
/** Creates a new block instance of the given type with schema defaults. */
|
|
119
|
+
createInstance(type: string): BlockInstance;
|
|
120
|
+
};
|
|
121
|
+
|
|
122
|
+
/**
|
|
123
|
+
* The Orion Studio: the complete admin experience as one client component.
|
|
124
|
+
*
|
|
125
|
+
* Mount it at a route in the consuming app:
|
|
126
|
+
*
|
|
127
|
+
* // src/app/(studio)/studio/page.tsx
|
|
128
|
+
* import { SiteStudio } from '@/cms/studio'
|
|
129
|
+
* export default function StudioPage() { return <SiteStudio /> }
|
|
130
|
+
*
|
|
131
|
+
* where @/cms/studio wires the site's block + global registries and branding.
|
|
132
|
+
*/
|
|
133
|
+
type StudioConfig = {
|
|
134
|
+
registry: BlockRegistry;
|
|
135
|
+
globals: GlobalRegistry;
|
|
136
|
+
siteName: string;
|
|
137
|
+
logoUrl?: string;
|
|
138
|
+
/** Supabase project URL used for media transform URLs. Defaults to env. */
|
|
139
|
+
supabaseUrl?: string;
|
|
140
|
+
};
|
|
141
|
+
declare function Studio({ registry, globals, siteName, logoUrl, supabaseUrl }: StudioConfig): react_jsx_runtime.JSX.Element;
|
|
142
|
+
|
|
143
|
+
declare function getBrowserSupabase(): SupabaseClient;
|
|
144
|
+
declare function useStudioSession(): {
|
|
145
|
+
session: Session | null;
|
|
146
|
+
loading: boolean;
|
|
147
|
+
getToken: () => Promise<string | null>;
|
|
148
|
+
signOut: () => Promise<void>;
|
|
149
|
+
};
|
|
150
|
+
|
|
151
|
+
type PasswordInputProps = Omit<InputHTMLAttributes<HTMLInputElement>, 'type'>;
|
|
152
|
+
declare function PasswordInput({ className, ...props }: PasswordInputProps): react_jsx_runtime.JSX.Element;
|
|
153
|
+
|
|
154
|
+
type AnalyticsKpis = {
|
|
155
|
+
visitors: number;
|
|
156
|
+
identifiedVisitors: number;
|
|
157
|
+
returningVisitors: number;
|
|
158
|
+
sessions: number;
|
|
159
|
+
pageviews: number;
|
|
160
|
+
pagesPerVisitor: number;
|
|
161
|
+
calls: number;
|
|
162
|
+
formSubmits: number;
|
|
163
|
+
emails: number;
|
|
164
|
+
portalClicks: number;
|
|
165
|
+
conversions: number;
|
|
166
|
+
conversionRate: number;
|
|
167
|
+
};
|
|
168
|
+
type AnalyticsSummary = {
|
|
169
|
+
range: {
|
|
170
|
+
from: string;
|
|
171
|
+
to: string;
|
|
172
|
+
};
|
|
173
|
+
kpis: AnalyticsKpis;
|
|
174
|
+
previous: AnalyticsKpis;
|
|
175
|
+
trend: Array<{
|
|
176
|
+
day: string;
|
|
177
|
+
visitors: number;
|
|
178
|
+
conversions: number;
|
|
179
|
+
}>;
|
|
180
|
+
pages: Array<{
|
|
181
|
+
path: string;
|
|
182
|
+
views: number;
|
|
183
|
+
entries: number;
|
|
184
|
+
conversions: number;
|
|
185
|
+
}>;
|
|
186
|
+
sources: Array<{
|
|
187
|
+
source: string;
|
|
188
|
+
sessions: number;
|
|
189
|
+
conversions: number;
|
|
190
|
+
}>;
|
|
191
|
+
locations: Array<{
|
|
192
|
+
location: string;
|
|
193
|
+
sessions: number;
|
|
194
|
+
}>;
|
|
195
|
+
devices: Array<{
|
|
196
|
+
device: string;
|
|
197
|
+
sessions: number;
|
|
198
|
+
}>;
|
|
199
|
+
hours: number[];
|
|
200
|
+
paths: Array<{
|
|
201
|
+
path: string[];
|
|
202
|
+
count: number;
|
|
203
|
+
converted: number;
|
|
204
|
+
}>;
|
|
205
|
+
forms: Array<{
|
|
206
|
+
form: string;
|
|
207
|
+
views: number;
|
|
208
|
+
starts: number;
|
|
209
|
+
submits: number;
|
|
210
|
+
}>;
|
|
211
|
+
notFound: Array<{
|
|
212
|
+
path: string;
|
|
213
|
+
count: number;
|
|
214
|
+
}>;
|
|
215
|
+
};
|
|
216
|
+
|
|
217
|
+
/**
|
|
218
|
+
* Typed client for /api/cms used by the Studio. Every call attaches the
|
|
219
|
+
* current Supabase access token as a bearer credential.
|
|
220
|
+
*/
|
|
221
|
+
type StudioPageSummary = {
|
|
222
|
+
id: string;
|
|
223
|
+
slug: string;
|
|
224
|
+
path: string;
|
|
225
|
+
title: string;
|
|
226
|
+
status: 'draft' | 'published';
|
|
227
|
+
builder_owned: boolean;
|
|
228
|
+
updated_at: string;
|
|
229
|
+
published_at: string | null;
|
|
230
|
+
publish_at: string | null;
|
|
231
|
+
/** Computed by GET /pages: draft layout differs from the live one. */
|
|
232
|
+
has_draft_changes?: boolean;
|
|
233
|
+
};
|
|
234
|
+
type StudioPage = StudioPageSummary & {
|
|
235
|
+
seo: Record<string, unknown>;
|
|
236
|
+
draft_layout: PageLayout;
|
|
237
|
+
published_layout: PageLayout | null;
|
|
238
|
+
};
|
|
239
|
+
type StudioMedia = {
|
|
240
|
+
id: string;
|
|
241
|
+
storage_path: string;
|
|
242
|
+
filename: string;
|
|
243
|
+
alt: string;
|
|
244
|
+
caption: string;
|
|
245
|
+
mime_type: string;
|
|
246
|
+
width: number | null;
|
|
247
|
+
height: number | null;
|
|
248
|
+
};
|
|
249
|
+
type StudioVersion = {
|
|
250
|
+
id: number;
|
|
251
|
+
kind: string;
|
|
252
|
+
title: string;
|
|
253
|
+
author: string;
|
|
254
|
+
created_at: string;
|
|
255
|
+
};
|
|
256
|
+
type StudioVersionDetail = StudioVersion & {
|
|
257
|
+
page_id: string;
|
|
258
|
+
seo: Record<string, unknown>;
|
|
259
|
+
layout: PageLayout;
|
|
260
|
+
};
|
|
261
|
+
type StudioRole = 'admin' | 'developer' | 'editor' | 'content';
|
|
262
|
+
type StudioUser = {
|
|
263
|
+
id: string;
|
|
264
|
+
email: string | null;
|
|
265
|
+
name: string;
|
|
266
|
+
role: StudioRole | null;
|
|
267
|
+
created_at: string | null;
|
|
268
|
+
last_sign_in_at: string | null;
|
|
269
|
+
};
|
|
270
|
+
type StudioSubmission = {
|
|
271
|
+
id: number;
|
|
272
|
+
form_id: string;
|
|
273
|
+
data: Record<string, unknown>;
|
|
274
|
+
source: string;
|
|
275
|
+
read_at: string | null;
|
|
276
|
+
created_at: string;
|
|
277
|
+
};
|
|
278
|
+
type StudioForm = {
|
|
279
|
+
id: string;
|
|
280
|
+
slug: string;
|
|
281
|
+
title: string;
|
|
282
|
+
config: FormConfig;
|
|
283
|
+
/** Stored separately from config so the public read layer never sees it. */
|
|
284
|
+
notify?: FormNotifyConfig;
|
|
285
|
+
success_message: string;
|
|
286
|
+
updated_at: string;
|
|
287
|
+
submissionCount?: number;
|
|
288
|
+
unreadCount?: number;
|
|
289
|
+
};
|
|
290
|
+
type StudioRedirect = {
|
|
291
|
+
id: string;
|
|
292
|
+
from_path: string;
|
|
293
|
+
to_path: string;
|
|
294
|
+
permanent: boolean;
|
|
295
|
+
created_at: string;
|
|
296
|
+
};
|
|
297
|
+
type StudioActivity = {
|
|
298
|
+
id: number;
|
|
299
|
+
actor_name: string;
|
|
300
|
+
action: string;
|
|
301
|
+
subject: string;
|
|
302
|
+
created_at: string;
|
|
303
|
+
};
|
|
304
|
+
type StudioDashboard = {
|
|
305
|
+
pages: {
|
|
306
|
+
total: number;
|
|
307
|
+
pendingDrafts: Array<{
|
|
308
|
+
id: string;
|
|
309
|
+
title: string;
|
|
310
|
+
path: string;
|
|
311
|
+
status: string;
|
|
312
|
+
publish_at: string | null;
|
|
313
|
+
}>;
|
|
314
|
+
recent: StudioPageSummary[];
|
|
315
|
+
lastPublishedAt: string | null;
|
|
316
|
+
};
|
|
317
|
+
submissions: {
|
|
318
|
+
total: number;
|
|
319
|
+
unread: number;
|
|
320
|
+
recent: StudioSubmission[];
|
|
321
|
+
};
|
|
322
|
+
activity: StudioActivity[];
|
|
323
|
+
};
|
|
324
|
+
type StudioMediaUsage = Array<{
|
|
325
|
+
id: string;
|
|
326
|
+
title: string;
|
|
327
|
+
path: string;
|
|
328
|
+
}>;
|
|
329
|
+
declare class StudioApiError extends Error {
|
|
330
|
+
status: number;
|
|
331
|
+
fieldErrors?: Record<string, string>;
|
|
332
|
+
issues?: unknown[];
|
|
333
|
+
usage?: StudioMediaUsage;
|
|
334
|
+
constructor(status: number, message: string, extra?: {
|
|
335
|
+
fieldErrors?: Record<string, string>;
|
|
336
|
+
issues?: unknown[];
|
|
337
|
+
usage?: StudioMediaUsage;
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
type StudioApi = ReturnType<typeof createStudioApi>;
|
|
341
|
+
declare function createStudioApi(options: {
|
|
342
|
+
getToken: () => Promise<string | null>;
|
|
343
|
+
basePath?: string;
|
|
344
|
+
}): {
|
|
345
|
+
me: () => Promise<{
|
|
346
|
+
user: {
|
|
347
|
+
id: string;
|
|
348
|
+
email: string | null;
|
|
349
|
+
role: StudioRole;
|
|
350
|
+
name: string;
|
|
351
|
+
};
|
|
352
|
+
}>;
|
|
353
|
+
listPages: () => Promise<{
|
|
354
|
+
pages: StudioPageSummary[];
|
|
355
|
+
}>;
|
|
356
|
+
getPage: (id: string) => Promise<{
|
|
357
|
+
page: StudioPage;
|
|
358
|
+
}>;
|
|
359
|
+
createPage: (input: {
|
|
360
|
+
slug: string;
|
|
361
|
+
title: string;
|
|
362
|
+
path?: string;
|
|
363
|
+
}) => Promise<{
|
|
364
|
+
page: StudioPage;
|
|
365
|
+
}>;
|
|
366
|
+
saveDraft: (id: string, input: {
|
|
367
|
+
title?: string;
|
|
368
|
+
seo?: Record<string, unknown>;
|
|
369
|
+
layout?: PageLayout;
|
|
370
|
+
slug?: string;
|
|
371
|
+
path?: string;
|
|
372
|
+
publishAt?: string | null;
|
|
373
|
+
}) => Promise<{
|
|
374
|
+
page: StudioPage;
|
|
375
|
+
}>;
|
|
376
|
+
publish: (id: string) => Promise<{
|
|
377
|
+
page: StudioPage;
|
|
378
|
+
}>;
|
|
379
|
+
unpublish: (id: string) => Promise<{
|
|
380
|
+
page: StudioPage;
|
|
381
|
+
}>;
|
|
382
|
+
duplicatePage: (id: string) => Promise<{
|
|
383
|
+
page: StudioPage;
|
|
384
|
+
}>;
|
|
385
|
+
deletePage: (id: string) => Promise<{
|
|
386
|
+
success: true;
|
|
387
|
+
}>;
|
|
388
|
+
previewToken: (id: string) => Promise<{
|
|
389
|
+
token: string;
|
|
390
|
+
path: string;
|
|
391
|
+
url: string;
|
|
392
|
+
}>;
|
|
393
|
+
listVersions: (id: string) => Promise<{
|
|
394
|
+
versions: StudioVersion[];
|
|
395
|
+
}>;
|
|
396
|
+
getVersion: (versionId: number) => Promise<{
|
|
397
|
+
version: StudioVersionDetail;
|
|
398
|
+
}>;
|
|
399
|
+
restoreVersion: (versionId: number) => Promise<{
|
|
400
|
+
page: StudioPage;
|
|
401
|
+
}>;
|
|
402
|
+
getGlobal: (key: string) => Promise<{
|
|
403
|
+
global: {
|
|
404
|
+
key: string;
|
|
405
|
+
data: Record<string, unknown>;
|
|
406
|
+
};
|
|
407
|
+
}>;
|
|
408
|
+
updateGlobal: (key: string, data: Record<string, unknown>) => Promise<{
|
|
409
|
+
global: {
|
|
410
|
+
key: string;
|
|
411
|
+
data: Record<string, unknown>;
|
|
412
|
+
};
|
|
413
|
+
}>;
|
|
414
|
+
listGlobalVersions: (key: string) => Promise<{
|
|
415
|
+
versions: Array<{
|
|
416
|
+
id: number;
|
|
417
|
+
key: string;
|
|
418
|
+
data: Record<string, unknown>;
|
|
419
|
+
created_at: string;
|
|
420
|
+
}>;
|
|
421
|
+
}>;
|
|
422
|
+
restoreGlobalVersion: (versionId: number) => Promise<{
|
|
423
|
+
global: {
|
|
424
|
+
key: string;
|
|
425
|
+
data: Record<string, unknown>;
|
|
426
|
+
};
|
|
427
|
+
}>;
|
|
428
|
+
listMedia: () => Promise<{
|
|
429
|
+
media: StudioMedia[];
|
|
430
|
+
}>;
|
|
431
|
+
uploadMedia: (form: FormData) => Promise<{
|
|
432
|
+
media: StudioMedia;
|
|
433
|
+
}>;
|
|
434
|
+
updateMedia: (id: string, input: {
|
|
435
|
+
alt?: string;
|
|
436
|
+
caption?: string;
|
|
437
|
+
filename?: string;
|
|
438
|
+
}) => Promise<{
|
|
439
|
+
media: StudioMedia;
|
|
440
|
+
}>;
|
|
441
|
+
replaceMedia: (id: string, form: FormData) => Promise<{
|
|
442
|
+
media: StudioMedia;
|
|
443
|
+
}>;
|
|
444
|
+
mediaUsage: (id: string) => Promise<{
|
|
445
|
+
usage: StudioMediaUsage;
|
|
446
|
+
}>;
|
|
447
|
+
deleteMedia: (id: string, force?: boolean) => Promise<{
|
|
448
|
+
success: true;
|
|
449
|
+
}>;
|
|
450
|
+
listForms: () => Promise<{
|
|
451
|
+
forms: StudioForm[];
|
|
452
|
+
}>;
|
|
453
|
+
createForm: (input: {
|
|
454
|
+
slug: string;
|
|
455
|
+
title: string;
|
|
456
|
+
}) => Promise<{
|
|
457
|
+
form: StudioForm;
|
|
458
|
+
}>;
|
|
459
|
+
getForm: (slug: string) => Promise<{
|
|
460
|
+
form: StudioForm;
|
|
461
|
+
}>;
|
|
462
|
+
updateForm: (slug: string, input: {
|
|
463
|
+
title: string;
|
|
464
|
+
config: FormConfig;
|
|
465
|
+
notify?: FormNotifyConfig;
|
|
466
|
+
successMessage: string;
|
|
467
|
+
}) => Promise<{
|
|
468
|
+
form: StudioForm;
|
|
469
|
+
}>;
|
|
470
|
+
deleteForm: (slug: string) => Promise<{
|
|
471
|
+
success: true;
|
|
472
|
+
}>;
|
|
473
|
+
listSubmissions: (params?: {
|
|
474
|
+
form?: string;
|
|
475
|
+
beforeId?: number;
|
|
476
|
+
unread?: boolean;
|
|
477
|
+
limit?: number;
|
|
478
|
+
}) => Promise<{
|
|
479
|
+
submissions: StudioSubmission[];
|
|
480
|
+
hasMore: boolean;
|
|
481
|
+
}>;
|
|
482
|
+
markSubmission: (id: number, read: boolean) => Promise<{
|
|
483
|
+
success: true;
|
|
484
|
+
}>;
|
|
485
|
+
deleteSubmission: (id: number) => Promise<{
|
|
486
|
+
success: true;
|
|
487
|
+
}>;
|
|
488
|
+
exportSubmissionsCsv: (form?: string) => Promise<string>;
|
|
489
|
+
listRedirects: () => Promise<{
|
|
490
|
+
redirects: StudioRedirect[];
|
|
491
|
+
}>;
|
|
492
|
+
createRedirect: (input: {
|
|
493
|
+
fromPath: string;
|
|
494
|
+
toPath: string;
|
|
495
|
+
permanent?: boolean;
|
|
496
|
+
}) => Promise<{
|
|
497
|
+
redirect: StudioRedirect;
|
|
498
|
+
}>;
|
|
499
|
+
deleteRedirect: (id: string) => Promise<{
|
|
500
|
+
success: true;
|
|
501
|
+
}>;
|
|
502
|
+
dashboard: () => Promise<StudioDashboard>;
|
|
503
|
+
listActivity: () => Promise<{
|
|
504
|
+
activity: StudioActivity[];
|
|
505
|
+
}>;
|
|
506
|
+
analytics: (params?: {
|
|
507
|
+
from?: string;
|
|
508
|
+
to?: string;
|
|
509
|
+
}) => Promise<AnalyticsSummary>;
|
|
510
|
+
listUsers: () => Promise<{
|
|
511
|
+
users: StudioUser[];
|
|
512
|
+
assignableRoles: StudioRole[];
|
|
513
|
+
}>;
|
|
514
|
+
createUser: (input: {
|
|
515
|
+
email: string;
|
|
516
|
+
password: string;
|
|
517
|
+
role: StudioRole;
|
|
518
|
+
name?: string;
|
|
519
|
+
}) => Promise<{
|
|
520
|
+
user: StudioUser;
|
|
521
|
+
}>;
|
|
522
|
+
updateUser: (id: string, input: {
|
|
523
|
+
role?: StudioRole;
|
|
524
|
+
name?: string;
|
|
525
|
+
password?: string;
|
|
526
|
+
}) => Promise<{
|
|
527
|
+
success: true;
|
|
528
|
+
}>;
|
|
529
|
+
deleteUser: (id: string) => Promise<{
|
|
530
|
+
success: true;
|
|
531
|
+
}>;
|
|
532
|
+
};
|
|
533
|
+
|
|
534
|
+
export { PasswordInput, type PasswordInputProps, Studio, type StudioActivity, type StudioApi, StudioApiError, type StudioConfig, type StudioDashboard, type StudioForm, type StudioMedia, type StudioMediaUsage, type StudioPage, type StudioPageSummary, type StudioRedirect, type StudioSubmission, type StudioVersion, type StudioVersionDetail, createStudioApi, getBrowserSupabase, useStudioSession };
|