@zerotal/admin 1.6.3 → 1.7.2
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/api-surface.md +1906 -0
- package/package.json +10 -9
package/api-surface.md
ADDED
|
@@ -0,0 +1,1906 @@
|
|
|
1
|
+
# @zerotal/admin — public API surface
|
|
2
|
+
|
|
3
|
+
<!-- AUTO-GENERATED by scripts/api-surface.ts. Do not edit by hand.
|
|
4
|
+
Run `bun run api:surface` to regenerate after an intentional API change. -->
|
|
5
|
+
|
|
6
|
+
## . `(./src/index.ts)`
|
|
7
|
+
|
|
8
|
+
class Action = {
|
|
9
|
+
new (key: string): Action
|
|
10
|
+
static make: (key: string) => Action
|
|
11
|
+
_authorizeFn?: ActionVisible
|
|
12
|
+
_beforeReplica?: (data: Record<string, unknown>) => Record<string, unknown>
|
|
13
|
+
_bulk: boolean
|
|
14
|
+
_color: ActionColor
|
|
15
|
+
_confirm?: string
|
|
16
|
+
_danger: boolean
|
|
17
|
+
_excludeAttributes: string[]
|
|
18
|
+
_form?: Field[]
|
|
19
|
+
_formUsing?: (data: Record<string, unknown>, resource: ResourceClass) => Field[]
|
|
20
|
+
_handler?: ActionHandler
|
|
21
|
+
_hrefFn?: (ctx: ActionContext) => string
|
|
22
|
+
_icon?: string
|
|
23
|
+
_iconOnly: boolean
|
|
24
|
+
_key: string
|
|
25
|
+
_label?: string
|
|
26
|
+
_modalHeading?: string
|
|
27
|
+
_modalSubmit?: string
|
|
28
|
+
_success?: string
|
|
29
|
+
_visibleFn?: ActionVisible
|
|
30
|
+
asBulk: () => Action
|
|
31
|
+
authorize: (fn: ActionVisible) => Action
|
|
32
|
+
beforeReplicaSaved: (fn: (data: Record<string, unknown>) => Record<string, unknown>) => Action
|
|
33
|
+
color: (color: ActionColor) => Action
|
|
34
|
+
danger: (value?: boolean) => Action
|
|
35
|
+
excludeAttributes: (keys: string[]) => Action
|
|
36
|
+
execute: (ctx: ActionContext) => Promise<void>
|
|
37
|
+
fieldsFor: (data: Record<string, unknown>, resource: ResourceClass) => Field[]
|
|
38
|
+
form: (fields: Field[]) => Action
|
|
39
|
+
formUsing: (fn: (data: Record<string, unknown>, resource: ResourceClass) => Field[]) => Action
|
|
40
|
+
getLabel: () => string
|
|
41
|
+
hasForm: () => boolean
|
|
42
|
+
href: (ctx: ActionContext) => string | null
|
|
43
|
+
icon: (name: string) => Action
|
|
44
|
+
iconButton: (value?: boolean) => Action
|
|
45
|
+
isLink: () => boolean
|
|
46
|
+
isVisibleFor: (record: AdminRecord | undefined, ctx: ActionContext) => boolean
|
|
47
|
+
label: (label: string) => Action
|
|
48
|
+
modalHeading: (text: string) => Action
|
|
49
|
+
modalSubmitLabel: (text: string) => Action
|
|
50
|
+
requiresConfirmation: (message?: string) => Action
|
|
51
|
+
run: (fn: ActionHandler) => Action
|
|
52
|
+
successMessage: (message: string) => Action
|
|
53
|
+
url: (fn: (ctx: ActionContext) => string) => Action
|
|
54
|
+
visible: (fn: ActionVisible) => Action
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
class ActionGroup = {
|
|
58
|
+
new (actions: Action[]): ActionGroup
|
|
59
|
+
_actions: Action[]
|
|
60
|
+
_icon: string
|
|
61
|
+
_label: string
|
|
62
|
+
getLabel: () => string
|
|
63
|
+
icon: (name: string) => ActionGroup
|
|
64
|
+
label: (label: string) => ActionGroup
|
|
65
|
+
visibleActions: (record: AdminRecord | undefined, ctx: ActionContext) => Action[]
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
class AdminAbilityMiddleware = {
|
|
69
|
+
new (): AdminAbilityMiddleware
|
|
70
|
+
static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
|
|
71
|
+
afterResponse?: (ctx: HttpContext) => Promise<void>
|
|
72
|
+
handle: (_http: HttpContext, next: NextFn) => Promise<Response | void>
|
|
73
|
+
onError?: (ctx: HttpContext, error: Error) => Promise<void>
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
class AdminGuardMiddleware = {
|
|
77
|
+
new (): AdminGuardMiddleware
|
|
78
|
+
static with: <T extends new (...args: any[]) => BaseMiddleware<any>, Opts = T extends new (...args: any[]) => BaseMiddleware<infer U> ? U : object>(this: T, options: DeepPartial<NoInfer<Opts>>) => new () => InstanceType<T>
|
|
79
|
+
afterResponse?: (ctx: HttpContext) => Promise<void>
|
|
80
|
+
handle: (_http: HttpContext, next: NextFn) => Promise<Response | void>
|
|
81
|
+
onError?: (ctx: HttpContext, error: Error) => Promise<void>
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
class AdminPage = {
|
|
85
|
+
new (): AdminPage
|
|
86
|
+
static ability?: string
|
|
87
|
+
static cluster?: typeof Cluster
|
|
88
|
+
static durable?: boolean | { ttl?: string; scope?: 'user' | 'session';}
|
|
89
|
+
static getNavigationLabel: () => string
|
|
90
|
+
static layout: any
|
|
91
|
+
static navigationBadge?: () => Promise<string | number | null> | string | number | null
|
|
92
|
+
static navigationBadgeColor?: BadgeTone
|
|
93
|
+
static navigationGroup?: string
|
|
94
|
+
static navigationIcon: string
|
|
95
|
+
static navigationLabel?: string
|
|
96
|
+
static navigationSort: number
|
|
97
|
+
static readonly __isFlowPage: true
|
|
98
|
+
static routeParams?: string[]
|
|
99
|
+
static showInNavigation: boolean
|
|
100
|
+
static slug: string
|
|
101
|
+
static title: string
|
|
102
|
+
static using: Compose
|
|
103
|
+
$refresh: () => void
|
|
104
|
+
$set: (key: string, value: unknown) => void
|
|
105
|
+
_applyClientUpdate: (key: string, value: unknown, arrayKey?: string) => Promise<void>
|
|
106
|
+
_buildSchema: (builders: Map<string, ValidateBuilder>) => Schema
|
|
107
|
+
_childIds: string[]
|
|
108
|
+
_clearDurable: boolean
|
|
109
|
+
_clientScripts: string[]
|
|
110
|
+
_downloads: { filename: string; content: string; mime: string;}[]
|
|
111
|
+
_drainEffects: () => FlowEffects
|
|
112
|
+
_emitUpdateHook: (base: 'onUpdating' | 'onUpdated', prop: string, value: unknown, key?: string) => Promise<void>
|
|
113
|
+
_errors: Record<string, string[]>
|
|
114
|
+
_events: { name: string; data: Record<string, unknown>; to?: string; self?: boolean;}[]
|
|
115
|
+
_exposedData: () => Record<string, unknown>
|
|
116
|
+
_flashes: FlashMessage[]
|
|
117
|
+
_flowId: string
|
|
118
|
+
_flowPath: string
|
|
119
|
+
_flowSlots: Record<string, string>
|
|
120
|
+
_isHydrated: boolean
|
|
121
|
+
_prevChildIds: string[]
|
|
122
|
+
_redirectStatus: number | null
|
|
123
|
+
_redirectUrl: string | null
|
|
124
|
+
_shouldRefresh: boolean
|
|
125
|
+
_streamSender: ((ref: string, content: string, replace: boolean) => void) | null
|
|
126
|
+
_taskSignal: AbortSignal | null
|
|
127
|
+
_titleValue: string | null
|
|
128
|
+
_validateField: (field: string) => Promise<void>
|
|
129
|
+
addError: (field: string, message: string) => void
|
|
130
|
+
bind: (key: string, optionValue?: string) => Record<string, unknown>
|
|
131
|
+
cancelled: boolean
|
|
132
|
+
child: <C extends Component>(ChildClass: new () => C, opts?: { key?: string | number; props?: Partial<C>; lazy?: boolean; defer?: boolean; stream?: boolean; slots?: Record<string, string>;}) => Promise<HtmlNode>
|
|
133
|
+
clearDurable: () => void
|
|
134
|
+
client: (script: string) => void
|
|
135
|
+
currentUrl: (_options?: CurrentUrlOptions) => string
|
|
136
|
+
dispatch: <K extends string>(name: K, ...args: K extends EventName ? EventArgs<FlowEvents[K]> : [payload?: Record<string, unknown>]) => void
|
|
137
|
+
dispatchSelf: <K extends string>(name: K, ...args: K extends EventName ? EventArgs<FlowEvents[K]> : [payload?: Record<string, unknown>]) => void
|
|
138
|
+
dispatchTo: <K extends string>(component: string, name: K, ...args: K extends EventName ? EventArgs<FlowEvents[K]> : [payload?: Record<string, unknown>]) => void
|
|
139
|
+
download: (filename: string, content: string | Uint8Array, mime?: string) => void
|
|
140
|
+
errors: ErrorsProxy
|
|
141
|
+
flash: (message: string, optionsOrLevel?: FlashLevel | FlashOptions) => FlashBuilder
|
|
142
|
+
hasSlot: (name?: string) => boolean
|
|
143
|
+
layout: (page: HtmlNode) => HtmlNode | Promise<HtmlNode>
|
|
144
|
+
navigateCurrent: (_options?: CurrentUrlOptions) => Promise<void>
|
|
145
|
+
onBoot: (_ctx?: HttpContext) => Promise<void>
|
|
146
|
+
onDehydrate: () => Promise<void>
|
|
147
|
+
onError: (error: Error) => Promise<void>
|
|
148
|
+
onHydrate: () => Promise<void>
|
|
149
|
+
onMount: (_ctx?: HttpContext) => Promise<void>
|
|
150
|
+
onRendered: (_html: string) => Promise<void>
|
|
151
|
+
onRendering: () => Promise<void>
|
|
152
|
+
onUpdate: () => Promise<void>
|
|
153
|
+
onUpdated: (_prop: string, _value: unknown, _key?: string) => Promise<void>
|
|
154
|
+
onUpdating: (_prop: string, _value: unknown, _key?: string) => Promise<void>
|
|
155
|
+
placeholder: () => HtmlNode
|
|
156
|
+
redirect: (url: string, status?: number) => RedirectFlash
|
|
157
|
+
redirectIntended: (fallback?: string, status?: number) => RedirectFlash
|
|
158
|
+
redirectRoute: <N extends RouteTarget>(name: N, params?: RouteParamsArg<N>, status?: number) => RedirectFlash
|
|
159
|
+
refresh: () => Promise<void>
|
|
160
|
+
render: () => Promise<HtmlNode>
|
|
161
|
+
resetValidation: (field?: string) => void
|
|
162
|
+
signal: AbortSignal
|
|
163
|
+
slot: (name?: string) => HtmlNode
|
|
164
|
+
stream: (ref: string, content: string, opts?: { replace?: boolean;}) => void
|
|
165
|
+
title: { (): string; (value: string): void;}
|
|
166
|
+
validate: (rulesOrForm?: ValidationRules | { __isFlowForm: true; _validateToErrors(): Record<string, string[]>;}) => Promise<void>
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
class AdminProvider = {
|
|
170
|
+
new (app: Application): AdminProvider
|
|
171
|
+
static dependsOn: (typeof FlowProvider)[]
|
|
172
|
+
static environments: AppEnvironment[]
|
|
173
|
+
static priority?: number
|
|
174
|
+
static provides: readonly ['admin.panel']
|
|
175
|
+
devProcesses: () => DevProcessDefinition[]
|
|
176
|
+
doctorChecks: () => DoctorCheck[]
|
|
177
|
+
onBooted: () => Promise<void>
|
|
178
|
+
onBooting: () => Promise<void>
|
|
179
|
+
onRegister: () => void
|
|
180
|
+
onRequestProcessed: (_ctx: HttpContext) => Promise<void>
|
|
181
|
+
onRequestReceived: (_ctx: HttpContext) => Promise<void>
|
|
182
|
+
onResponseSent: (_ctx: HttpContext) => Promise<void>
|
|
183
|
+
onStarted: () => Promise<void>
|
|
184
|
+
onStarting: () => Promise<void>
|
|
185
|
+
onStopped: () => Promise<void>
|
|
186
|
+
onStopping: () => Promise<void>
|
|
187
|
+
replContext: () => Record<string, unknown>
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
class BuilderBlock = {
|
|
191
|
+
new (name: string): BuilderBlock
|
|
192
|
+
_fields: Field[]
|
|
193
|
+
_icon?: string
|
|
194
|
+
_label?: string
|
|
195
|
+
getLabel: () => string
|
|
196
|
+
icon: (name: string) => BuilderBlock
|
|
197
|
+
label: (label: string) => BuilderBlock
|
|
198
|
+
name: string
|
|
199
|
+
schema: (fields: Field[]) => BuilderBlock
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
class Callout = {
|
|
203
|
+
new (content: string): Callout
|
|
204
|
+
_content: string
|
|
205
|
+
_heading?: string | undefined
|
|
206
|
+
_icon?: string
|
|
207
|
+
_tone: CalloutTone
|
|
208
|
+
heading: (heading: string) => Callout
|
|
209
|
+
icon: (name: string) => Callout
|
|
210
|
+
tone: (tone: CalloutTone) => Callout
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
class ChartWidget = {
|
|
214
|
+
new (title: string, resolver: ChartResolver): ChartWidget
|
|
215
|
+
_columns: number
|
|
216
|
+
_height: number
|
|
217
|
+
_key?: string
|
|
218
|
+
_poll?: string
|
|
219
|
+
_resolver: ChartResolver
|
|
220
|
+
_title: string
|
|
221
|
+
columns: (n: number) => ChartWidget
|
|
222
|
+
data: () => Promise<ChartData>
|
|
223
|
+
height: (px: number) => ChartWidget
|
|
224
|
+
key: (key: string) => ChartWidget
|
|
225
|
+
poll: (interval: string) => ChartWidget
|
|
226
|
+
widgetKey: (index: number) => string
|
|
227
|
+
}
|
|
228
|
+
|
|
229
|
+
class Cluster = {
|
|
230
|
+
new (): Cluster
|
|
231
|
+
static ability?: string
|
|
232
|
+
static getNavigationLabel: () => string
|
|
233
|
+
static navigationGroup?: string
|
|
234
|
+
static navigationIcon: string
|
|
235
|
+
static navigationLabel?: string
|
|
236
|
+
static navigationSort: number
|
|
237
|
+
static slug: string
|
|
238
|
+
static title: string
|
|
239
|
+
static url: (base: string) => string
|
|
240
|
+
}
|
|
241
|
+
|
|
242
|
+
class Column = {
|
|
243
|
+
new (key: string): Column
|
|
244
|
+
static make: (key: string) => Column
|
|
245
|
+
_align: CellAlign
|
|
246
|
+
_badge?: (value: unknown, row: Record<string, unknown>) => BadgeTone | null
|
|
247
|
+
_circular: boolean
|
|
248
|
+
_column?: string
|
|
249
|
+
_copyable: boolean
|
|
250
|
+
_exportable: boolean
|
|
251
|
+
_filterable: boolean
|
|
252
|
+
_format?: (value: unknown, row: Record<string, unknown>) => string
|
|
253
|
+
_inputType: string
|
|
254
|
+
_key: string
|
|
255
|
+
_kind: ColumnKind
|
|
256
|
+
_label?: string
|
|
257
|
+
_options?: ColumnOption[]
|
|
258
|
+
_render?: (value: unknown, row: Record<string, unknown>) => HtmlNode | string
|
|
259
|
+
_searchable: boolean
|
|
260
|
+
_sortable: boolean
|
|
261
|
+
_summaries: ColumnSummary[]
|
|
262
|
+
align: (align: CellAlign) => Column
|
|
263
|
+
avg: (label?: string, format?: (n: number) => string) => Column
|
|
264
|
+
badge: (fn: (value: unknown, row: Record<string, unknown>) => BadgeTone | null) => Column
|
|
265
|
+
cell: (row: Record<string, unknown>) => RenderableCell
|
|
266
|
+
circular: (value?: boolean) => Column
|
|
267
|
+
color: () => Column
|
|
268
|
+
column: (name: string) => Column
|
|
269
|
+
computeSummaries: (rows: Record<string, unknown>[]) => SummaryResult[]
|
|
270
|
+
copyable: (value?: boolean) => Column
|
|
271
|
+
count: (label?: string) => Column
|
|
272
|
+
editSelect: (options: Record<string, string> | ColumnOption[]) => Column
|
|
273
|
+
editText: (type?: string) => Column
|
|
274
|
+
exportable: (value?: boolean) => Column
|
|
275
|
+
filterable: (value?: boolean) => Column
|
|
276
|
+
format: (fn: (value: unknown, row: Record<string, unknown>) => string) => Column
|
|
277
|
+
getColumn: () => string
|
|
278
|
+
getLabel: () => string
|
|
279
|
+
hasSummary: () => boolean
|
|
280
|
+
icon: () => Column
|
|
281
|
+
image: () => Column
|
|
282
|
+
label: (label: string) => Column
|
|
283
|
+
range: (label?: string, format?: (n: number) => string) => Column
|
|
284
|
+
raw: (row: Record<string, unknown>) => unknown
|
|
285
|
+
render: (fn: (value: unknown, row: Record<string, unknown>) => HtmlNode | string) => Column
|
|
286
|
+
searchable: (value?: boolean) => Column
|
|
287
|
+
sortable: (value?: boolean) => Column
|
|
288
|
+
sum: (label?: string, format?: (n: number) => string) => Column
|
|
289
|
+
summarize: (summary: ColumnSummary | ColumnSummary[]) => Column
|
|
290
|
+
toggle: () => Column
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
class Constraint = {
|
|
294
|
+
new (key: string, kind?: ConstraintKind): Constraint
|
|
295
|
+
_column?: string
|
|
296
|
+
_key: string
|
|
297
|
+
_kind: ConstraintKind
|
|
298
|
+
_label?: string
|
|
299
|
+
_options: ConstraintOption[]
|
|
300
|
+
apply: (query: AdminQuery, operator: string, value: string, conjunction: Conjunction) => AdminQuery
|
|
301
|
+
column: (column: string) => Constraint
|
|
302
|
+
getColumn: () => string
|
|
303
|
+
getLabel: () => string
|
|
304
|
+
isUnary: (operator: string) => boolean
|
|
305
|
+
label: (label: string) => Constraint
|
|
306
|
+
operators: () => ConstraintOperator[]
|
|
307
|
+
options: (options: Record<string, string> | ConstraintOption[]) => Constraint
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
class Entry = {
|
|
311
|
+
new (key: string): Entry
|
|
312
|
+
static make: (key: string) => Entry
|
|
313
|
+
_badge: boolean
|
|
314
|
+
_boolean: boolean
|
|
315
|
+
_circular: boolean
|
|
316
|
+
_color?: BadgeTone | Resolver<BadgeTone | null>
|
|
317
|
+
_columnSpan: number
|
|
318
|
+
_copyable: boolean
|
|
319
|
+
_date?: 'date' | 'datetime' | 'since'
|
|
320
|
+
_default?: unknown
|
|
321
|
+
_format?: Resolver<string>
|
|
322
|
+
_html: boolean
|
|
323
|
+
_icon?: string | Resolver<string | null>
|
|
324
|
+
_imageHeight: number
|
|
325
|
+
_key: string
|
|
326
|
+
_kind: EntryKind
|
|
327
|
+
_label?: string
|
|
328
|
+
_language?: string
|
|
329
|
+
_limit?: number
|
|
330
|
+
_money?: string
|
|
331
|
+
_placeholder: string
|
|
332
|
+
_render?: (value: unknown, row: Record<string, unknown>) => HtmlNode | string
|
|
333
|
+
_schema: Entry[]
|
|
334
|
+
_size: EntrySize
|
|
335
|
+
_state?: (row: Record<string, unknown>) => unknown
|
|
336
|
+
_tooltip?: string
|
|
337
|
+
_url?: Resolver<string | null>
|
|
338
|
+
_weight: EntryWeight
|
|
339
|
+
badge: (value?: boolean) => Entry
|
|
340
|
+
boolean: (value?: boolean) => Entry
|
|
341
|
+
circular: (value?: boolean) => Entry
|
|
342
|
+
color: (tone: BadgeTone | Resolver<BadgeTone | null>) => Entry
|
|
343
|
+
columnSpan: (span: number) => Entry
|
|
344
|
+
copyable: (value?: boolean) => Entry
|
|
345
|
+
date: () => Entry
|
|
346
|
+
dateTime: () => Entry
|
|
347
|
+
default: (value: unknown) => Entry
|
|
348
|
+
display: (row: Record<string, unknown>) => EntryDisplay
|
|
349
|
+
format: (fn: Resolver<string>) => Entry
|
|
350
|
+
getLabel: () => string
|
|
351
|
+
height: (px: number) => Entry
|
|
352
|
+
html: (value?: boolean) => Entry
|
|
353
|
+
icon: (name: string | Resolver<string | null>) => Entry
|
|
354
|
+
label: (label: string) => Entry
|
|
355
|
+
language: (name: string) => Entry
|
|
356
|
+
limit: (n: number) => Entry
|
|
357
|
+
money: (currency?: string) => Entry
|
|
358
|
+
placeholder: (text: string) => Entry
|
|
359
|
+
render: (fn: (value: unknown, row: Record<string, unknown>) => HtmlNode | string) => Entry
|
|
360
|
+
schema: (entries: Entry[]) => Entry
|
|
361
|
+
since: () => Entry
|
|
362
|
+
size: (size: EntrySize) => Entry
|
|
363
|
+
state: (fn: (row: Record<string, unknown>) => unknown) => Entry
|
|
364
|
+
tooltip: (text: string) => Entry
|
|
365
|
+
url: (fn: Resolver<string | null>) => Entry
|
|
366
|
+
weight: (weight: EntryWeight) => Entry
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
class Field = {
|
|
370
|
+
new (key: string, type?: FieldType): Field
|
|
371
|
+
static make: (key: string) => Field
|
|
372
|
+
_accept?: string
|
|
373
|
+
_addLabel?: string
|
|
374
|
+
_afterUpdate?: (value: unknown, data: Record<string, unknown>) => Record<string, unknown> | void
|
|
375
|
+
_autocomplete?: string
|
|
376
|
+
_blocks: BuilderBlock[]
|
|
377
|
+
_columnSpan: number
|
|
378
|
+
_confirmed: boolean
|
|
379
|
+
_createOption: boolean
|
|
380
|
+
_default?: unknown
|
|
381
|
+
_disabled: boolean
|
|
382
|
+
_disabledFn?: FieldPredicate
|
|
383
|
+
_helper?: string
|
|
384
|
+
_itemLabel?: (data: Record<string, unknown>, index: number) => string
|
|
385
|
+
_key: string
|
|
386
|
+
_label?: string
|
|
387
|
+
_live: boolean
|
|
388
|
+
_max?: number
|
|
389
|
+
_maxItems?: number
|
|
390
|
+
_maxLength?: number
|
|
391
|
+
_min?: number
|
|
392
|
+
_minItems?: number
|
|
393
|
+
_minLength?: number
|
|
394
|
+
_multiple: boolean
|
|
395
|
+
_mutate?: (value: unknown) => unknown | Promise<unknown>
|
|
396
|
+
_options?: SelectOption[]
|
|
397
|
+
_optionsLoader?: () => Promise<SelectOption[]> | SelectOption[]
|
|
398
|
+
_placeholder?: string
|
|
399
|
+
_render?: (value: unknown, data: Record<string, unknown>) => HtmlNode | string
|
|
400
|
+
_reorderable: boolean
|
|
401
|
+
_required: boolean
|
|
402
|
+
_rows: number
|
|
403
|
+
_rule?: (rule: AnyRule) => AnyRule
|
|
404
|
+
_searchable: boolean
|
|
405
|
+
_step?: number
|
|
406
|
+
_subfields: Field[]
|
|
407
|
+
_type: FieldType
|
|
408
|
+
_uploadDir: string
|
|
409
|
+
_visibleFn?: FieldPredicate
|
|
410
|
+
_visibleOn?: FieldMode[]
|
|
411
|
+
accept: (mime: string) => Field
|
|
412
|
+
addActionLabel: (label: string) => Field
|
|
413
|
+
afterStateUpdated: (fn: (value: unknown, data: Record<string, unknown>) => Record<string, unknown> | void) => Field
|
|
414
|
+
autocomplete: (value: string) => Field
|
|
415
|
+
blocks: (blocks: BuilderBlock[]) => Field
|
|
416
|
+
buildRule: (v: RuleBuilder) => FieldRule
|
|
417
|
+
checkboxList: () => Field
|
|
418
|
+
color: () => Field
|
|
419
|
+
columnSpan: (span: number) => Field
|
|
420
|
+
confirmed: (value?: boolean) => Field
|
|
421
|
+
createOption: (value?: boolean) => Field
|
|
422
|
+
date: () => Field
|
|
423
|
+
dateTime: () => Field
|
|
424
|
+
default: (value: unknown) => Field
|
|
425
|
+
defaultValue: () => unknown
|
|
426
|
+
dehydrate: (value: unknown) => Promise<unknown>
|
|
427
|
+
disabled: (value?: boolean) => Field
|
|
428
|
+
disabledWhen: (fn: FieldPredicate) => Field
|
|
429
|
+
disk: (dir: string) => Field
|
|
430
|
+
email: () => Field
|
|
431
|
+
file: () => Field
|
|
432
|
+
getLabel: () => string
|
|
433
|
+
helperText: (text: string) => Field
|
|
434
|
+
hidden: () => Field
|
|
435
|
+
hiddenOn: (...modes: FieldMode[]) => Field
|
|
436
|
+
hydrate: (value: unknown) => unknown
|
|
437
|
+
image: () => Field
|
|
438
|
+
isArrayValued: () => boolean
|
|
439
|
+
isDisabledFor: (data: Record<string, unknown>) => boolean
|
|
440
|
+
itemLabel: (fn: (data: Record<string, unknown>, index: number) => string) => Field
|
|
441
|
+
keyValue: () => Field
|
|
442
|
+
label: (label: string) => Field
|
|
443
|
+
live: (value?: boolean) => Field
|
|
444
|
+
max: (n: number) => Field
|
|
445
|
+
maxItems: (n: number) => Field
|
|
446
|
+
maxLength: (n: number) => Field
|
|
447
|
+
min: (n: number) => Field
|
|
448
|
+
minItems: (n: number) => Field
|
|
449
|
+
minLength: (n: number) => Field
|
|
450
|
+
multiple: (value?: boolean) => Field
|
|
451
|
+
mutate: (fn: (value: unknown) => unknown | Promise<unknown>) => Field
|
|
452
|
+
numeric: () => Field
|
|
453
|
+
options: (options: Record<string, string> | SelectOption[]) => Field
|
|
454
|
+
optionsUsing: (loader: () => Promise<SelectOption[]> | SelectOption[]) => Field
|
|
455
|
+
password: () => Field
|
|
456
|
+
placeholder: (text: string) => Field
|
|
457
|
+
radio: () => Field
|
|
458
|
+
render: (fn: (value: unknown, data: Record<string, unknown>) => HtmlNode | string) => Field
|
|
459
|
+
reorderable: (value?: boolean) => Field
|
|
460
|
+
required: (value?: boolean) => Field
|
|
461
|
+
rows: (n: number) => Field
|
|
462
|
+
rule: (fn: (rule: AnyRule) => AnyRule) => Field
|
|
463
|
+
schema: (fields: Field[]) => Field
|
|
464
|
+
searchable: (value?: boolean) => Field
|
|
465
|
+
step: (n: number) => Field
|
|
466
|
+
tags: () => Field
|
|
467
|
+
tel: () => Field
|
|
468
|
+
time: () => Field
|
|
469
|
+
toggle: () => Field
|
|
470
|
+
url: () => Field
|
|
471
|
+
visible: (fn: FieldPredicate) => Field
|
|
472
|
+
visibleForData: (data: Record<string, unknown>) => boolean
|
|
473
|
+
visibleIn: (mode: FieldMode) => boolean
|
|
474
|
+
visibleOn: (...modes: FieldMode[]) => Field
|
|
475
|
+
}
|
|
476
|
+
|
|
477
|
+
class Filter = {
|
|
478
|
+
new (key: string, type?: FilterType): Filter
|
|
479
|
+
static make: (key: string) => Filter
|
|
480
|
+
_apply?: FilterApply
|
|
481
|
+
_column?: string
|
|
482
|
+
_constraints: Constraint[]
|
|
483
|
+
_falseLabel: string
|
|
484
|
+
_key: string
|
|
485
|
+
_label?: string
|
|
486
|
+
_options: FilterOption[]
|
|
487
|
+
_trueLabel: string
|
|
488
|
+
_type: FilterType
|
|
489
|
+
apply: (query: AdminQuery, value: string) => AdminQuery
|
|
490
|
+
choices: () => FilterOption[]
|
|
491
|
+
column: (column: string) => Filter
|
|
492
|
+
constraints: (constraints: Constraint[]) => Filter
|
|
493
|
+
getLabel: () => string
|
|
494
|
+
label: (label: string) => Filter
|
|
495
|
+
labels: (trueLabel: string, falseLabel: string) => Filter
|
|
496
|
+
options: (options: Record<string, string> | FilterOption[]) => Filter
|
|
497
|
+
query: (fn: FilterApply) => Filter
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
class FormSection = {
|
|
501
|
+
new (heading?: string): FormSection
|
|
502
|
+
static make: (heading?: string) => FormSection
|
|
503
|
+
_collapsible: boolean
|
|
504
|
+
_columns: number
|
|
505
|
+
_description?: string
|
|
506
|
+
_fields: Field[]
|
|
507
|
+
_fieldset: boolean
|
|
508
|
+
_heading?: string | undefined
|
|
509
|
+
_icon?: string
|
|
510
|
+
collapsible: (value?: boolean) => FormSection
|
|
511
|
+
columns: (n: number) => FormSection
|
|
512
|
+
description: (description: string) => FormSection
|
|
513
|
+
getFields: () => Field[]
|
|
514
|
+
heading: (heading: string) => FormSection
|
|
515
|
+
icon: (name: string) => FormSection
|
|
516
|
+
schema: (fields: Field[]) => FormSection
|
|
517
|
+
}
|
|
518
|
+
|
|
519
|
+
class FormSplit = {
|
|
520
|
+
new (sections: FormSection[]): FormSplit
|
|
521
|
+
_sections: FormSection[]
|
|
522
|
+
getFields: () => Field[]
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
class FormTab = {
|
|
526
|
+
new (label: string): FormTab
|
|
527
|
+
_columns: number
|
|
528
|
+
_fields: Field[]
|
|
529
|
+
_icon?: string
|
|
530
|
+
_label: string
|
|
531
|
+
columns: (n: number) => FormTab
|
|
532
|
+
getFields: () => Field[]
|
|
533
|
+
icon: (name: string) => FormTab
|
|
534
|
+
schema: (fields: Field[]) => FormTab
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
class FormTabs = {
|
|
538
|
+
new (tabs: FormTab[]): FormTabs
|
|
539
|
+
_tabs: FormTab[]
|
|
540
|
+
getFields: () => Field[]
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
class Group = {
|
|
544
|
+
new (column: string): Group
|
|
545
|
+
static make: (column: string) => Group
|
|
546
|
+
_collapsible: boolean
|
|
547
|
+
_column: string
|
|
548
|
+
_getTitle?: (row: Record<string, unknown>) => string
|
|
549
|
+
_label?: string
|
|
550
|
+
collapsible: (value?: boolean) => Group
|
|
551
|
+
getColumn: () => string
|
|
552
|
+
getLabel: () => string
|
|
553
|
+
getTitleUsing: (fn: (row: Record<string, unknown>) => string) => Group
|
|
554
|
+
label: (label: string) => Group
|
|
555
|
+
titleFor: (row: Record<string, unknown>) => string
|
|
556
|
+
}
|
|
557
|
+
|
|
558
|
+
class ImportRecordsJob = {
|
|
559
|
+
new (_payload: ImportRecordsPayload): ImportRecordsJob
|
|
560
|
+
className: string
|
|
561
|
+
handle: () => Promise<void>
|
|
562
|
+
payload: () => Record<string, unknown>
|
|
563
|
+
readonly maxAttempts: 1
|
|
564
|
+
readonly queue: 'default'
|
|
565
|
+
}
|
|
566
|
+
|
|
567
|
+
class Panel = {
|
|
568
|
+
new (): Panel
|
|
569
|
+
static all: () => PanelInstance[]
|
|
570
|
+
static auth: (config: AdminAuthConfig) => void
|
|
571
|
+
static authConfig: () => AdminAuthConfig | undefined
|
|
572
|
+
static can: (ability: string | undefined) => Promise<boolean>
|
|
573
|
+
static config: () => AdminConfigShape
|
|
574
|
+
static configure: (config: Partial<AdminConfigShape>) => void
|
|
575
|
+
static consoles: () => ConsoleContribution[]
|
|
576
|
+
static contributedWidgets: () => WidgetContribution[]
|
|
577
|
+
static current: () => PanelInstance
|
|
578
|
+
static dashboardLayout: (store: DashboardLayoutStore) => void
|
|
579
|
+
static dashboardLayoutStore: () => DashboardLayoutStore | undefined
|
|
580
|
+
static dashboardWidgets: () => DashboardWidget[]
|
|
581
|
+
static default: () => PanelInstance
|
|
582
|
+
static find: (slug: string) => ResourceClass | undefined
|
|
583
|
+
static findConsole: (slug: string) => ConsoleContribution | undefined
|
|
584
|
+
static findPage: (slug: string) => PanelPage | undefined
|
|
585
|
+
static forPath: (path: string) => PanelInstance
|
|
586
|
+
static get: (id: string) => PanelInstance | undefined
|
|
587
|
+
static host: () => AdminPanelHost
|
|
588
|
+
static make: (id: string, config?: Partial<AdminConfigShape>) => PanelInstance
|
|
589
|
+
static media: (provider: MediaProvider, options?: { disk?: string;}) => void
|
|
590
|
+
static mediaDisk: () => string | undefined
|
|
591
|
+
static mediaProvider: () => MediaProvider | undefined
|
|
592
|
+
static navigation: () => NavGroup[]
|
|
593
|
+
static navigationBadges: () => Promise<Record<string, { text: string; color: string;}>>
|
|
594
|
+
static notificationProvider: () => NotificationProvider | undefined
|
|
595
|
+
static notifications: (provider: NotificationProvider) => void
|
|
596
|
+
static pages: (...pages: AdminPageClass[]) => void
|
|
597
|
+
static plugin: (...plugins: AdminPlugin[]) => Promise<void>
|
|
598
|
+
static pluginEnabled: (id: string) => boolean
|
|
599
|
+
static register: (...resources: ResourceClass[]) => void
|
|
600
|
+
static registeredPages: () => PanelPage[]
|
|
601
|
+
static renderHook: (name: RenderHookName, hook: RenderHook) => void
|
|
602
|
+
static renderHooks: (name: RenderHookName) => RenderHook[]
|
|
603
|
+
static reset: () => void
|
|
604
|
+
static resources: () => ResourceClass[]
|
|
605
|
+
static roleProvider: () => RoleProvider | undefined
|
|
606
|
+
static roles: (provider: RoleProvider) => void
|
|
607
|
+
static savedViewProvider: () => SavedViewProvider | undefined
|
|
608
|
+
static savedViews: (provider: SavedViewProvider) => void
|
|
609
|
+
static visibleNavigation: () => Promise<NavGroup[]>
|
|
610
|
+
static visibleSearchProviders: () => Promise<PanelSearchProvider[]>
|
|
611
|
+
static visibleTopbarSlots: () => Promise<TopbarSlot[]>
|
|
612
|
+
static visibleUserMenuItems: () => Promise<UserMenuContribution[]>
|
|
613
|
+
static visibleWidgets: () => Promise<DashboardWidget[]>
|
|
614
|
+
static widgets: (...widgets: DashboardWidget[]) => void
|
|
615
|
+
}
|
|
616
|
+
|
|
617
|
+
class PanelInstance = {
|
|
618
|
+
new (id: string, config?: Partial<AdminConfigShape>): PanelInstance
|
|
619
|
+
auth: (config: AdminAuthConfig) => void
|
|
620
|
+
authConfig: () => AdminAuthConfig | undefined
|
|
621
|
+
base: () => string
|
|
622
|
+
can: (ability: string | undefined) => Promise<boolean>
|
|
623
|
+
config: () => AdminConfigShape
|
|
624
|
+
configure: (config: Partial<AdminConfigShape>) => void
|
|
625
|
+
consoles: () => ConsoleContribution[]
|
|
626
|
+
contributedWidgets: () => WidgetContribution[]
|
|
627
|
+
dashboardLayout: (store: DashboardLayoutStore) => void
|
|
628
|
+
dashboardLayoutStore: () => DashboardLayoutStore | undefined
|
|
629
|
+
dashboardWidgets: () => DashboardWidget[]
|
|
630
|
+
find: (slug: string) => ResourceClass | undefined
|
|
631
|
+
findConsole: (slug: string) => ConsoleContribution | undefined
|
|
632
|
+
findPage: (slug: string) => PanelPage | undefined
|
|
633
|
+
host: () => AdminPanelHost
|
|
634
|
+
media: (provider: MediaProvider, options?: { disk?: string;}) => void
|
|
635
|
+
mediaDisk: () => string | undefined
|
|
636
|
+
mediaProvider: () => MediaProvider | undefined
|
|
637
|
+
navigation: () => NavGroup[]
|
|
638
|
+
navigationBadges: () => Promise<Record<string, { text: string; color: string;}>>
|
|
639
|
+
notificationProvider: () => NotificationProvider | undefined
|
|
640
|
+
notifications: (provider: NotificationProvider) => void
|
|
641
|
+
pages: (...pages: AdminPageClass[]) => void
|
|
642
|
+
plugin: (...plugins: AdminPlugin[]) => Promise<void>
|
|
643
|
+
pluginEnabled: (id: string) => boolean
|
|
644
|
+
readonly id: string
|
|
645
|
+
register: (...resources: ResourceClass[]) => void
|
|
646
|
+
registeredPages: () => PanelPage[]
|
|
647
|
+
renderHook: (name: RenderHookName, hook: RenderHook) => void
|
|
648
|
+
renderHooks: (name: RenderHookName) => RenderHook[]
|
|
649
|
+
reset: () => void
|
|
650
|
+
resources: () => ResourceClass[]
|
|
651
|
+
roleProvider: () => RoleProvider | undefined
|
|
652
|
+
roles: (provider: RoleProvider) => void
|
|
653
|
+
savedViewProvider: () => SavedViewProvider | undefined
|
|
654
|
+
savedViews: (provider: SavedViewProvider) => void
|
|
655
|
+
visibleNavigation: () => Promise<NavGroup[]>
|
|
656
|
+
visibleSearchProviders: () => Promise<PanelSearchProvider[]>
|
|
657
|
+
visibleTopbarSlots: () => Promise<TopbarSlot[]>
|
|
658
|
+
visibleUserMenuItems: () => Promise<UserMenuContribution[]>
|
|
659
|
+
visibleWidgets: () => Promise<DashboardWidget[]>
|
|
660
|
+
widgets: (...widgets: DashboardWidget[]) => void
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
class Prime = {
|
|
664
|
+
new (kind: PrimeKind, content: string): Prime
|
|
665
|
+
_alt?: string
|
|
666
|
+
_content: string
|
|
667
|
+
_kind: PrimeKind
|
|
668
|
+
alt: (alt: string) => Prime
|
|
669
|
+
}
|
|
670
|
+
|
|
671
|
+
class RelationManager = {
|
|
672
|
+
new (resource: ResourceClass, foreignKey: string): RelationManager
|
|
673
|
+
_attachLimit: number
|
|
674
|
+
_canAttach: boolean
|
|
675
|
+
_canCreate: boolean
|
|
676
|
+
_foreignKey: string
|
|
677
|
+
_icon?: string
|
|
678
|
+
_kind: RelationKind
|
|
679
|
+
_perPage: number
|
|
680
|
+
_pivotColumns: PivotColumn[]
|
|
681
|
+
_relationName?: string
|
|
682
|
+
_resource: typeof Resource
|
|
683
|
+
_title?: string
|
|
684
|
+
attachLimit: (n: number) => RelationManager
|
|
685
|
+
canAttach: (value: boolean) => RelationManager
|
|
686
|
+
canCreate: (value: boolean) => RelationManager
|
|
687
|
+
getTitle: () => string
|
|
688
|
+
icon: (name: string) => RelationManager
|
|
689
|
+
isBelongsToMany: () => boolean
|
|
690
|
+
perPage: (n: number) => RelationManager
|
|
691
|
+
pivotColumns: (columns: PivotColumn[]) => RelationManager
|
|
692
|
+
title: (title: string) => RelationManager
|
|
693
|
+
}
|
|
694
|
+
|
|
695
|
+
class Resource = {
|
|
696
|
+
new (): Resource
|
|
697
|
+
static afterSave: (_record: AdminRecord, _mode: 'create' | 'edit') => Promise<void>
|
|
698
|
+
static arrangeTree: (rows: Record<string, unknown>[]) => { row: Record<string, unknown>; depth: number;}[]
|
|
699
|
+
static bulkActions: () => ActionItem[]
|
|
700
|
+
static calendarColumn?: string
|
|
701
|
+
static can: (_ability: string, _record?: AdminRecord) => boolean
|
|
702
|
+
static cluster?: typeof Cluster
|
|
703
|
+
static columns: () => Column[]
|
|
704
|
+
static count: (modifyQuery?: QueryModifier) => Promise<number>
|
|
705
|
+
static create: (data: Record<string, unknown>) => Promise<AdminRecord | null>
|
|
706
|
+
static createUrl: (base: string, parentId?: unknown) => string
|
|
707
|
+
static data: () => Promise<Record<string, unknown>[] | null> | Record<string, unknown>[] | null
|
|
708
|
+
static defaultGroup?: string
|
|
709
|
+
static defaultSort?: { column: string; direction?: 'asc' | 'desc';}
|
|
710
|
+
static density: 'comfortable' | 'compact'
|
|
711
|
+
static destroy: (id: unknown) => Promise<boolean>
|
|
712
|
+
static eager: string[]
|
|
713
|
+
static editUrl: (base: string, id: unknown, parentId?: unknown) => string
|
|
714
|
+
static emptyState: () => EmptyState
|
|
715
|
+
static filterLayout: 'inline' | 'panel' | 'drawer'
|
|
716
|
+
static filters: () => Filter[]
|
|
717
|
+
static find: (id: unknown) => Promise<Record<string, unknown> | null>
|
|
718
|
+
static forceDelete: (id: unknown) => Promise<boolean>
|
|
719
|
+
static form: () => FormComponent[]
|
|
720
|
+
static getLabel: () => string
|
|
721
|
+
static getModelName: () => string
|
|
722
|
+
static getPluralLabel: () => string
|
|
723
|
+
static getSlug: () => string
|
|
724
|
+
static globallySearchable: () => boolean
|
|
725
|
+
static groups: () => Group[]
|
|
726
|
+
static headerActions: () => ActionItem[]
|
|
727
|
+
static history: boolean
|
|
728
|
+
static impersonatable: boolean
|
|
729
|
+
static indexUrl: (base: string, parentId?: unknown) => string
|
|
730
|
+
static infolist: () => InfolistComponent[]
|
|
731
|
+
static isEditable: () => boolean
|
|
732
|
+
static kanbanColumn?: string
|
|
733
|
+
static kanbanLanes: Record<string, string>
|
|
734
|
+
static label?: string
|
|
735
|
+
static listAll: (options?: ListOptions) => Promise<Record<string, unknown>[]>
|
|
736
|
+
static locales: string[]
|
|
737
|
+
static model: AdminModel
|
|
738
|
+
static mutateBeforeSave: (data: AdminRecord, _mode: 'create' | 'edit') => AdminRecord
|
|
739
|
+
static mutateFormDataBeforeFill: (data: AdminRecord) => AdminRecord
|
|
740
|
+
static navigationBadge: () => Promise<string | number | null> | string | number | null
|
|
741
|
+
static navigationBadgeColor: 'primary' | 'success' | 'muted' | 'destructive'
|
|
742
|
+
static navigationGroup?: string
|
|
743
|
+
static navigationIcon: string
|
|
744
|
+
static navigationParentItem?: string
|
|
745
|
+
static navigationSort: number
|
|
746
|
+
static optimisticLock?: string
|
|
747
|
+
static parent?: { resource: () => typeof Resource; foreignKey: string;}
|
|
748
|
+
static parentParam: () => string
|
|
749
|
+
static parentResource: () => typeof Resource | undefined
|
|
750
|
+
static perPage: number
|
|
751
|
+
static pluralLabel?: string
|
|
752
|
+
static primaryKey: string
|
|
753
|
+
static recordActions: () => ActionItem[]
|
|
754
|
+
static recordTitle: (record: Record<string, unknown>) => string
|
|
755
|
+
static recordTitleAttribute?: string
|
|
756
|
+
static recordUrl: (base: string, id: unknown, parentId?: unknown) => string
|
|
757
|
+
static records: (options?: ListOptions) => Promise<RecordPage>
|
|
758
|
+
static relations: () => RelationManager[]
|
|
759
|
+
static reorderable?: string
|
|
760
|
+
static restore: (id: unknown) => Promise<boolean>
|
|
761
|
+
static routePath: () => string
|
|
762
|
+
static searchableColumns: () => string[]
|
|
763
|
+
static singular: boolean
|
|
764
|
+
static singularRecord: () => Promise<Record<string, unknown> | null>
|
|
765
|
+
static slug?: string
|
|
766
|
+
static stickyHeader: boolean
|
|
767
|
+
static striped: boolean
|
|
768
|
+
static tableLayout: 'table' | 'grid' | 'kanban' | 'calendar'
|
|
769
|
+
static tabs: () => Tab[]
|
|
770
|
+
static translatable: string[]
|
|
771
|
+
static translated: (value: unknown, locale: string) => unknown
|
|
772
|
+
static treeParentColumn?: string
|
|
773
|
+
static update: (id: unknown, data: Record<string, unknown>) => Promise<boolean>
|
|
774
|
+
static usesSoftDeletes: () => boolean
|
|
775
|
+
static widgets: () => DashboardWidget[]
|
|
776
|
+
}
|
|
777
|
+
|
|
778
|
+
class Section = {
|
|
779
|
+
new (heading?: string): Section
|
|
780
|
+
static make: (heading?: string) => Section
|
|
781
|
+
_collapsed: boolean
|
|
782
|
+
_collapsible: boolean
|
|
783
|
+
_columns: number
|
|
784
|
+
_description?: string
|
|
785
|
+
_entries: Entry[]
|
|
786
|
+
_heading?: string | undefined
|
|
787
|
+
_icon?: string
|
|
788
|
+
collapsible: (collapsed?: boolean) => Section
|
|
789
|
+
columns: (n: number) => Section
|
|
790
|
+
description: (description: string) => Section
|
|
791
|
+
heading: (heading: string) => Section
|
|
792
|
+
icon: (name: string) => Section
|
|
793
|
+
schema: (entries: Entry[]) => Section
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
class Stat = {
|
|
797
|
+
new (label: string, value: string | number): Stat
|
|
798
|
+
_description?: string
|
|
799
|
+
_icon?: string
|
|
800
|
+
_label: string
|
|
801
|
+
_tone: BadgeTone
|
|
802
|
+
_value: string | number
|
|
803
|
+
description: (text: string) => Stat
|
|
804
|
+
icon: (name: string) => Stat
|
|
805
|
+
tone: (tone: WidgetTone) => Stat
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
class StatsWidget = {
|
|
809
|
+
new (resolver: StatsResolver): StatsWidget
|
|
810
|
+
_columns: number
|
|
811
|
+
_key?: string
|
|
812
|
+
_poll?: string
|
|
813
|
+
_resolver: StatsResolver
|
|
814
|
+
columns: (n: number) => StatsWidget
|
|
815
|
+
key: (key: string) => StatsWidget
|
|
816
|
+
poll: (interval: string) => StatsWidget
|
|
817
|
+
stats: () => Promise<Stat[]>
|
|
818
|
+
widgetKey: (index: number) => string
|
|
819
|
+
}
|
|
820
|
+
|
|
821
|
+
class Tab = {
|
|
822
|
+
new (key: string): Tab
|
|
823
|
+
static make: (key: string) => Tab
|
|
824
|
+
_badge: boolean
|
|
825
|
+
_badgeTone: BadgeTone
|
|
826
|
+
_badgeValue?: string | number
|
|
827
|
+
_icon?: string
|
|
828
|
+
_key: string
|
|
829
|
+
_label?: string
|
|
830
|
+
_modify?: QueryModifier
|
|
831
|
+
badge: (value?: number | string) => Tab
|
|
832
|
+
badgeColor: (tone: BadgeTone) => Tab
|
|
833
|
+
getLabel: () => string
|
|
834
|
+
icon: (name: string) => Tab
|
|
835
|
+
label: (label: string) => Tab
|
|
836
|
+
modifyQuery: (fn: QueryModifier) => Tab
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
class TableWidget = {
|
|
840
|
+
new (title: string, columns: TableWidgetColumn[], resolver: TableRowsResolver): TableWidget
|
|
841
|
+
_columns: TableWidgetColumn[]
|
|
842
|
+
_key?: string
|
|
843
|
+
_poll?: string
|
|
844
|
+
_resolver: TableRowsResolver
|
|
845
|
+
_title: string
|
|
846
|
+
_wide: boolean
|
|
847
|
+
key: (key: string) => TableWidget
|
|
848
|
+
poll: (interval: string) => TableWidget
|
|
849
|
+
rows: () => Promise<Record<string, unknown>[]>
|
|
850
|
+
wide: (value?: boolean) => TableWidget
|
|
851
|
+
widgetKey: (index: number) => string
|
|
852
|
+
}
|
|
853
|
+
|
|
854
|
+
class Wizard = {
|
|
855
|
+
new (steps: WizardStep[]): Wizard
|
|
856
|
+
_steps: WizardStep[]
|
|
857
|
+
getFields: () => Field[]
|
|
858
|
+
}
|
|
859
|
+
|
|
860
|
+
class WizardStep = {
|
|
861
|
+
new (label: string): WizardStep
|
|
862
|
+
_columns: number
|
|
863
|
+
_description?: string
|
|
864
|
+
_fields: Field[]
|
|
865
|
+
_icon?: string
|
|
866
|
+
_label: string
|
|
867
|
+
columns: (n: number) => WizardStep
|
|
868
|
+
description: (text: string) => WizardStep
|
|
869
|
+
getFields: () => Field[]
|
|
870
|
+
icon: (name: string) => WizardStep
|
|
871
|
+
schema: (fields: Field[]) => WizardStep
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
const DEFAULT_ADMIN_CONFIG = AdminConfigShape
|
|
875
|
+
|
|
876
|
+
const DEFAULT_PANEL_ID = 'admin'
|
|
877
|
+
|
|
878
|
+
const EMPTY_LAYOUT = DashboardLayout
|
|
879
|
+
|
|
880
|
+
const IMPERSONATOR_KEY = 'admin.impersonator'
|
|
881
|
+
|
|
882
|
+
const IMPORT_ROW_LIMIT = 2000
|
|
883
|
+
|
|
884
|
+
const MAPPING_FIELD_PREFIX = 'map_'
|
|
885
|
+
|
|
886
|
+
const NOTIFICATION_CHANNEL = 'admin-notifications'
|
|
887
|
+
|
|
888
|
+
const NOTIFICATION_EVENT = '.notification.sent'
|
|
889
|
+
|
|
890
|
+
const THEME_STORAGE_KEY = 'zerotal-theme'
|
|
891
|
+
|
|
892
|
+
const VIEW_PARAMS = readonly ['search', 'filters', 'tab', 'sortBy', 'sortDir', 'sort', 'trashed', 'perPage', 'cols', 'group']
|
|
893
|
+
|
|
894
|
+
function action = (key: string) => Action
|
|
895
|
+
|
|
896
|
+
function actionGroup = (actions: Action[]) => ActionGroup
|
|
897
|
+
|
|
898
|
+
function AdminConfig = (options?: Partial<AdminConfigShape>) => AdminConfigShape
|
|
899
|
+
|
|
900
|
+
function adminHead = (title?: string, theme?: AdminThemeConfig) => string
|
|
901
|
+
|
|
902
|
+
function adminTailwindConfig = () => string
|
|
903
|
+
|
|
904
|
+
function adminTokensCss = () => string
|
|
905
|
+
|
|
906
|
+
function applyLayout = <T>(widgets: T[], keyOf: (widget: T, index: number) => string, layout: DashboardLayout | null) => { visible: T[]; hidden: { key: string; widget: T; }[];}
|
|
907
|
+
|
|
908
|
+
function authRoles = (options?: AuthRolesOptions) => RoleProvider
|
|
909
|
+
|
|
910
|
+
function belongsToMany = (resource: ResourceClass, relationName: string) => RelationManager
|
|
911
|
+
|
|
912
|
+
function booleanConstraint = (key: string) => Constraint
|
|
913
|
+
|
|
914
|
+
function builder = (key: string) => Field
|
|
915
|
+
|
|
916
|
+
function builderBlock = (name: string) => BuilderBlock
|
|
917
|
+
|
|
918
|
+
function bulkDeleteAction = () => Action
|
|
919
|
+
|
|
920
|
+
function bulkEditAction = (fields?: string[]) => Action
|
|
921
|
+
|
|
922
|
+
function bulkExportAction = (format?: ExportFormat) => Action
|
|
923
|
+
|
|
924
|
+
function bulkForceDeleteAction = () => Action
|
|
925
|
+
|
|
926
|
+
function bulkRestoreAction = () => Action
|
|
927
|
+
|
|
928
|
+
function callout = (content: string) => Callout
|
|
929
|
+
|
|
930
|
+
function chartWidget = (title: string, resolver: ChartResolver) => ChartWidget
|
|
931
|
+
|
|
932
|
+
function checkbox = (key: string) => Field
|
|
933
|
+
|
|
934
|
+
function checkboxList = (key: string) => Field
|
|
935
|
+
|
|
936
|
+
function codeEditor = (key: string) => Field
|
|
937
|
+
|
|
938
|
+
function codeEntry = (key: string) => Entry
|
|
939
|
+
|
|
940
|
+
function colorColumn = (key: string) => Column
|
|
941
|
+
|
|
942
|
+
function colorEntry = (key: string) => Entry
|
|
943
|
+
|
|
944
|
+
function colorPicker = (key: string) => Field
|
|
945
|
+
|
|
946
|
+
function createAction = () => Action
|
|
947
|
+
|
|
948
|
+
function customField = (key: string) => Field
|
|
949
|
+
|
|
950
|
+
function databaseMedia = (options?: DatabaseMediaOptions) => MediaProvider
|
|
951
|
+
|
|
952
|
+
function databaseNotifications = (options?: DatabaseNotificationOptions) => NotificationProvider
|
|
953
|
+
|
|
954
|
+
function dateConstraint = (key: string) => Constraint
|
|
955
|
+
|
|
956
|
+
function datePicker = (key: string) => Field
|
|
957
|
+
|
|
958
|
+
function dateTimePicker = (key: string) => Field
|
|
959
|
+
|
|
960
|
+
function deleteAction = () => Action
|
|
961
|
+
|
|
962
|
+
function deleteMedia = (item: MediaItem, options: { provider: MediaProvider; disk?: string;}) => Promise<[true] | [false, string]>
|
|
963
|
+
|
|
964
|
+
function describeRuleTree = (node: QueryRule | null, filter?: { _constraints: Constraint[];}) => string
|
|
965
|
+
|
|
966
|
+
function dispatchImport = (payload: ImportRecordsPayload) => Promise<boolean>
|
|
967
|
+
|
|
968
|
+
function editAction = () => Action
|
|
969
|
+
|
|
970
|
+
function exportAction = (format?: ExportFormat) => Action
|
|
971
|
+
|
|
972
|
+
function fieldset = (legend?: string) => FormSection
|
|
973
|
+
|
|
974
|
+
function fileUpload = (key: string) => Field
|
|
975
|
+
|
|
976
|
+
function flattenActions = (items: ActionItem[]) => Action[]
|
|
977
|
+
|
|
978
|
+
function flattenFields = (components: FormComponent[]) => Field[]
|
|
979
|
+
|
|
980
|
+
function forceDeleteAction = () => Action
|
|
981
|
+
|
|
982
|
+
function formatSize = (bytes: number) => string
|
|
983
|
+
|
|
984
|
+
function formSection = (heading?: string) => FormSection
|
|
985
|
+
|
|
986
|
+
function formTab = (label: string) => FormTab
|
|
987
|
+
|
|
988
|
+
function formTabs = (tabs: FormTab[]) => FormTabs
|
|
989
|
+
|
|
990
|
+
function group = (column: string) => Group
|
|
991
|
+
|
|
992
|
+
function groupPermissions = (permissions: Permission[]) => { group: string; items: Permission[];}[]
|
|
993
|
+
|
|
994
|
+
function guessColumnMapping = (headers: string[], candidates: { key: string; label: string;}[]) => Record<number, string>
|
|
995
|
+
|
|
996
|
+
function hasMany = (resource: ResourceClass, foreignKey: string) => RelationManager
|
|
997
|
+
|
|
998
|
+
function hidden = (key: string) => Field
|
|
999
|
+
|
|
1000
|
+
function iconColumn = (key: string) => Column
|
|
1001
|
+
|
|
1002
|
+
function iconEntry = (key: string) => Entry
|
|
1003
|
+
|
|
1004
|
+
function imageColumn = (key: string) => Column
|
|
1005
|
+
|
|
1006
|
+
function imageEntry = (key: string) => Entry
|
|
1007
|
+
|
|
1008
|
+
function impersonateAction = () => Action
|
|
1009
|
+
|
|
1010
|
+
function impersonatedName = () => Promise<string | null>
|
|
1011
|
+
|
|
1012
|
+
function importAction = (options?: { queue?: boolean;}) => Action
|
|
1013
|
+
|
|
1014
|
+
function importCsv = (resource: ResourceClass, csv: string, mapping?: Record<number, string>, options?: { limit?: number;}) => Promise<ImportResult>
|
|
1015
|
+
|
|
1016
|
+
function isFormSection = (c: FormComponent) => c is FormSection
|
|
1017
|
+
|
|
1018
|
+
function isImage = (item: MediaItem) => boolean
|
|
1019
|
+
|
|
1020
|
+
function isImpersonating = () => Promise<boolean>
|
|
1021
|
+
|
|
1022
|
+
function isUpload = (value: unknown) => value is UploadedFileLike
|
|
1023
|
+
|
|
1024
|
+
function keyValue = (key: string) => Field
|
|
1025
|
+
|
|
1026
|
+
function keyValueEntry = (key: string) => Entry
|
|
1027
|
+
|
|
1028
|
+
function makeResourceForm = (schema: FormComponent[], mode: FieldMode, className: string) => { FormClass: ResourceFormClass; fields: Field[];}
|
|
1029
|
+
|
|
1030
|
+
function markdownEditor = (key: string) => Field
|
|
1031
|
+
|
|
1032
|
+
function mediaPath = (name: string, folder?: string) => string
|
|
1033
|
+
|
|
1034
|
+
function mediaPicker = (key: string) => Field
|
|
1035
|
+
|
|
1036
|
+
function mediaUrl = (item: MediaItem, disk?: string) => Promise<string | null>
|
|
1037
|
+
|
|
1038
|
+
function moveKey = (order: string[], key: string, direction: -1 | 1) => string[]
|
|
1039
|
+
|
|
1040
|
+
function numberConstraint = (key: string) => Constraint
|
|
1041
|
+
|
|
1042
|
+
function panelPermissions = (panel: PanelInstance) => Permission[]
|
|
1043
|
+
|
|
1044
|
+
function parseCsv = (text: string) => string[][]
|
|
1045
|
+
|
|
1046
|
+
function parseRuleTree = (value: string) => QueryRule | null
|
|
1047
|
+
|
|
1048
|
+
function prime = (text: string) => Prime
|
|
1049
|
+
|
|
1050
|
+
function primeHtml = (html: string) => Prime
|
|
1051
|
+
|
|
1052
|
+
function primeImage = (src: string) => Prime
|
|
1053
|
+
|
|
1054
|
+
function queryBuilder = (key: string) => Filter
|
|
1055
|
+
|
|
1056
|
+
function radio = (key: string) => Field
|
|
1057
|
+
|
|
1058
|
+
function reconcile = (layout: DashboardLayout | null, keys: string[]) => DashboardLayout
|
|
1059
|
+
|
|
1060
|
+
function recordHistory = (options: HistoryOptions) => Promise<HistoryEntry[]>
|
|
1061
|
+
|
|
1062
|
+
function repeatableEntry = (key: string) => Entry
|
|
1063
|
+
|
|
1064
|
+
function repeater = (key: string) => Field
|
|
1065
|
+
|
|
1066
|
+
function replicateAction = () => Action
|
|
1067
|
+
|
|
1068
|
+
function resolveMediaSrc = (value: unknown, disk?: string) => string | null
|
|
1069
|
+
|
|
1070
|
+
function resolveRenderHooks = (hooks: RenderHook[], context?: RenderHookContext) => (HtmlNode | string)[]
|
|
1071
|
+
|
|
1072
|
+
function restoreAction = () => Action
|
|
1073
|
+
|
|
1074
|
+
function revertPayload = (entry: HistoryEntry) => Record<string, unknown>
|
|
1075
|
+
|
|
1076
|
+
function richEditor = (key: string) => Field
|
|
1077
|
+
|
|
1078
|
+
function roleHas = (role: Role, held: string[], key: string) => boolean
|
|
1079
|
+
|
|
1080
|
+
function ruleTreeIsEmpty = (node: QueryRule | null) => boolean
|
|
1081
|
+
|
|
1082
|
+
function runQueuedImport = (payload: ImportRecordsPayload) => Promise<ImportResult>
|
|
1083
|
+
|
|
1084
|
+
function section = (heading?: string) => Section
|
|
1085
|
+
|
|
1086
|
+
function select = (key: string) => Field
|
|
1087
|
+
|
|
1088
|
+
function selectColumn = (key: string, options: Record<string, string> | ColumnOption[]) => Column
|
|
1089
|
+
|
|
1090
|
+
function selectConstraint = (key: string) => Constraint
|
|
1091
|
+
|
|
1092
|
+
function selectFilter = (key: string) => Filter
|
|
1093
|
+
|
|
1094
|
+
function slider = (key: string) => Field
|
|
1095
|
+
|
|
1096
|
+
function split = (sections: FormSection[]) => FormSplit
|
|
1097
|
+
|
|
1098
|
+
function startImpersonating = (userId: unknown) => Promise<[true] | [false, string]>
|
|
1099
|
+
|
|
1100
|
+
function stat = (label: string, value: string | number) => Stat
|
|
1101
|
+
|
|
1102
|
+
function statsWidget = (resolver: StatsResolver) => StatsWidget
|
|
1103
|
+
|
|
1104
|
+
function stopImpersonating = () => Promise<[true] | [false, string]>
|
|
1105
|
+
|
|
1106
|
+
function storeMedia = (file: UploadedFileLike, options: StoreMediaOptions) => Promise<[true, MediaItem] | [false, string]>
|
|
1107
|
+
|
|
1108
|
+
function tab = (key: string) => Tab
|
|
1109
|
+
|
|
1110
|
+
function tableWidget = (title: string, columns: TableWidgetColumn[], resolver: TableRowsResolver) => TableWidget
|
|
1111
|
+
|
|
1112
|
+
function tagsInput = (key: string) => Field
|
|
1113
|
+
|
|
1114
|
+
function ternaryFilter = (key: string) => Filter
|
|
1115
|
+
|
|
1116
|
+
function text = (key: string) => Column
|
|
1117
|
+
|
|
1118
|
+
function textarea = (key: string) => Field
|
|
1119
|
+
|
|
1120
|
+
function textConstraint = (key: string) => Constraint
|
|
1121
|
+
|
|
1122
|
+
function textEntry = (key: string) => Entry
|
|
1123
|
+
|
|
1124
|
+
function textFilter = (key: string) => Filter
|
|
1125
|
+
|
|
1126
|
+
function textInput = (key: string) => Field
|
|
1127
|
+
|
|
1128
|
+
function textInputColumn = (key: string) => Column
|
|
1129
|
+
|
|
1130
|
+
function timePicker = (key: string) => Field
|
|
1131
|
+
|
|
1132
|
+
function toCsv = (rows: Record<string, unknown>[], columns: Column[]) => string
|
|
1133
|
+
|
|
1134
|
+
function toFormLayout = (components: FormComponent[]) => FormBlock[]
|
|
1135
|
+
|
|
1136
|
+
function toFormSections = (components: FormComponent[]) => FormSection[]
|
|
1137
|
+
|
|
1138
|
+
function toggle = (key: string) => Field
|
|
1139
|
+
|
|
1140
|
+
function toggleButtons = (key: string) => Field
|
|
1141
|
+
|
|
1142
|
+
function toggleColumn = (key: string) => Column
|
|
1143
|
+
|
|
1144
|
+
function toXlsx = (rows: Record<string, unknown>[], columns: Column[], options?: { sheet?: string;}) => Uint8Array
|
|
1145
|
+
|
|
1146
|
+
function viewAction = () => Action
|
|
1147
|
+
|
|
1148
|
+
function viewIsActive = (view: SavedView, current: URLSearchParams | string) => boolean
|
|
1149
|
+
|
|
1150
|
+
function viewQuery = (params: URLSearchParams | string) => string
|
|
1151
|
+
|
|
1152
|
+
function widgetPollInterval = (widgets: DashboardWidget[]) => string | undefined
|
|
1153
|
+
|
|
1154
|
+
function wizard = (steps: WizardStep[]) => Wizard
|
|
1155
|
+
|
|
1156
|
+
function wizardStep = (label: string) => WizardStep
|
|
1157
|
+
|
|
1158
|
+
interface ActionContext = {
|
|
1159
|
+
base: string
|
|
1160
|
+
data?: Record<string, unknown> | undefined
|
|
1161
|
+
ids?: string[] | undefined
|
|
1162
|
+
listOptions?: ListOptions | undefined
|
|
1163
|
+
page: ActionPage
|
|
1164
|
+
panelId?: string | undefined
|
|
1165
|
+
parentId?: string | undefined
|
|
1166
|
+
record?: AdminRecord | undefined
|
|
1167
|
+
records?: AdminRecord[] | undefined
|
|
1168
|
+
resource: typeof Resource
|
|
1169
|
+
slug: string
|
|
1170
|
+
}
|
|
1171
|
+
|
|
1172
|
+
interface ActionPage = {
|
|
1173
|
+
download?: (filename: string, content: string | Uint8Array, mime?: string) => unknown
|
|
1174
|
+
flash: (message: string, level?: string) => unknown
|
|
1175
|
+
redirect: (url: string) => { withSuccess(message: string): unknown;}
|
|
1176
|
+
}
|
|
1177
|
+
|
|
1178
|
+
interface AdminAuthConfig = {
|
|
1179
|
+
authMiddleware?: MiddlewareClass[]
|
|
1180
|
+
authenticateWhen?: (user: unknown) => boolean | Promise<boolean>
|
|
1181
|
+
emailVerification?: { isVerified(user: unknown): boolean; resend(user: unknown): Promise<void> | void;}
|
|
1182
|
+
enabled?: boolean
|
|
1183
|
+
guestMiddleware?: MiddlewareClass[]
|
|
1184
|
+
heading?: string
|
|
1185
|
+
identifier?: string
|
|
1186
|
+
loginPath?: string
|
|
1187
|
+
passwordReset?: { sendResetLink(email: string): Promise<boolean> | boolean; reset(input: { email: string; token: string; password: string; }): Promise<boolean> | boolean;}
|
|
1188
|
+
profilePath?: string
|
|
1189
|
+
redirectTo?: string
|
|
1190
|
+
remember?: boolean
|
|
1191
|
+
updateProfile?: (user: unknown, data: Record<string, unknown>) => Promise<void> | void
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
interface AdminConfigShape = {
|
|
1195
|
+
auth?: AdminAuthConfig
|
|
1196
|
+
authorize?: AdminAuthorizer
|
|
1197
|
+
brand: string
|
|
1198
|
+
middleware?: MiddlewareClass[]
|
|
1199
|
+
path: string
|
|
1200
|
+
plugins?: Record<string, boolean>
|
|
1201
|
+
tagline?: string
|
|
1202
|
+
theme?: AdminThemeConfig
|
|
1203
|
+
userMenu?: UserMenu
|
|
1204
|
+
}
|
|
1205
|
+
|
|
1206
|
+
interface AdminModel = {
|
|
1207
|
+
all?: () => Promise<any[]>
|
|
1208
|
+
count?: () => Promise<number>
|
|
1209
|
+
create?: (data: Record<string, unknown>) => Promise<any>
|
|
1210
|
+
find?: (id: unknown) => Promise<any>
|
|
1211
|
+
name?: string
|
|
1212
|
+
onlyTrashed?: () => AdminQuery
|
|
1213
|
+
query?: () => AdminQuery
|
|
1214
|
+
softDeletes?: boolean
|
|
1215
|
+
withTrashed?: () => AdminQuery
|
|
1216
|
+
}
|
|
1217
|
+
|
|
1218
|
+
interface AdminNotification = {
|
|
1219
|
+
body?: string
|
|
1220
|
+
href?: string
|
|
1221
|
+
icon?: string
|
|
1222
|
+
id: string
|
|
1223
|
+
read?: boolean
|
|
1224
|
+
time?: string
|
|
1225
|
+
title: string
|
|
1226
|
+
}
|
|
1227
|
+
|
|
1228
|
+
interface AdminPanelHost = {
|
|
1229
|
+
console: (contribution: ConsoleContribution) => void
|
|
1230
|
+
enabled: (id: string) => boolean
|
|
1231
|
+
navItem: (contribution: NavContribution) => void
|
|
1232
|
+
page: (contribution: PageContribution) => void
|
|
1233
|
+
renderHook: (name: string, hook: (context: RenderHookContext) => HtmlNode | string | null) => void
|
|
1234
|
+
searchProvider: (provider: PanelSearchProvider) => void
|
|
1235
|
+
topbarSlot: (slot: TopbarSlot) => void
|
|
1236
|
+
userMenuItem: (item: UserMenuContribution) => void
|
|
1237
|
+
widget: (contribution: WidgetContribution) => void
|
|
1238
|
+
}
|
|
1239
|
+
|
|
1240
|
+
interface AdminPlugin = {
|
|
1241
|
+
id: string
|
|
1242
|
+
install: (panel: AdminPanelHost) => void | Promise<void>
|
|
1243
|
+
}
|
|
1244
|
+
|
|
1245
|
+
interface AdminQuery = {
|
|
1246
|
+
all?: () => Promise<Record<string, unknown>[]>
|
|
1247
|
+
count: () => Promise<number>
|
|
1248
|
+
get?: () => Promise<Record<string, unknown>[]>
|
|
1249
|
+
limit: (n: number) => AdminQuery
|
|
1250
|
+
offset: (n: number) => AdminQuery
|
|
1251
|
+
orWhere?: { (column: string, operator: unknown, value?: unknown): AdminQuery; (group: (query: AdminQuery) => void): AdminQuery;}
|
|
1252
|
+
orWhereLike?: (column: string, value: string) => AdminQuery
|
|
1253
|
+
orWhereNotLike?: (column: string, value: string) => AdminQuery
|
|
1254
|
+
orWhereNotNull?: (column: string) => AdminQuery
|
|
1255
|
+
orWhereNull?: (column: string) => AdminQuery
|
|
1256
|
+
orderBy: (column: string, direction?: 'asc' | 'desc') => AdminQuery
|
|
1257
|
+
where: { (column: string, operator: unknown, value?: unknown): AdminQuery; (group: (query: AdminQuery) => void): AdminQuery;}
|
|
1258
|
+
whereIn?: (column: string, values: unknown[]) => AdminQuery
|
|
1259
|
+
whereLike?: (column: string, value: string) => AdminQuery
|
|
1260
|
+
whereNotIn?: (column: string, values: unknown[]) => AdminQuery
|
|
1261
|
+
whereNotLike?: (column: string, value: string) => AdminQuery
|
|
1262
|
+
whereNotNull?: (column: string) => AdminQuery
|
|
1263
|
+
whereNull?: (column: string) => AdminQuery
|
|
1264
|
+
with?: (relation: string) => AdminQuery
|
|
1265
|
+
}
|
|
1266
|
+
|
|
1267
|
+
interface AdminRecord = {
|
|
1268
|
+
[key: string]: unknown
|
|
1269
|
+
delete?: () => Promise<void>
|
|
1270
|
+
fill?: (data: Record<string, unknown>) => unknown
|
|
1271
|
+
forceDelete?: () => Promise<void>
|
|
1272
|
+
restore?: () => Promise<void>
|
|
1273
|
+
save?: () => Promise<unknown>
|
|
1274
|
+
trashed?: () => boolean
|
|
1275
|
+
}
|
|
1276
|
+
|
|
1277
|
+
interface AdminThemeConfig = {
|
|
1278
|
+
cdn?: boolean
|
|
1279
|
+
noFonts?: boolean
|
|
1280
|
+
stylesheet?: string
|
|
1281
|
+
tokensCss?: string
|
|
1282
|
+
}
|
|
1283
|
+
|
|
1284
|
+
interface AuthRolesOptions = {
|
|
1285
|
+
guard?: string
|
|
1286
|
+
superusers?: string[]
|
|
1287
|
+
}
|
|
1288
|
+
|
|
1289
|
+
interface ChartData = {
|
|
1290
|
+
datasets: ChartDataset[]
|
|
1291
|
+
labels: string[]
|
|
1292
|
+
type: ChartType
|
|
1293
|
+
}
|
|
1294
|
+
|
|
1295
|
+
interface ChartDataset = {
|
|
1296
|
+
color?: string
|
|
1297
|
+
data: number[]
|
|
1298
|
+
label?: string
|
|
1299
|
+
}
|
|
1300
|
+
|
|
1301
|
+
interface ColumnOption = {
|
|
1302
|
+
label: string
|
|
1303
|
+
value: string
|
|
1304
|
+
}
|
|
1305
|
+
|
|
1306
|
+
interface ColumnSummary = {
|
|
1307
|
+
format?: ((value: number) => string) | undefined
|
|
1308
|
+
kind: SummaryKind
|
|
1309
|
+
label?: string | undefined
|
|
1310
|
+
}
|
|
1311
|
+
|
|
1312
|
+
interface ConsoleAction = {
|
|
1313
|
+
confirm?: string
|
|
1314
|
+
danger?: boolean
|
|
1315
|
+
icon?: string
|
|
1316
|
+
key: string
|
|
1317
|
+
label: string
|
|
1318
|
+
run: (row: ConsoleRow) => Promise<string | void> | string | void
|
|
1319
|
+
}
|
|
1320
|
+
|
|
1321
|
+
interface ConsoleColumn = {
|
|
1322
|
+
align?: 'start' | 'center' | 'end'
|
|
1323
|
+
badge?: (value: unknown, row: ConsoleRow) => BadgeTone | null
|
|
1324
|
+
format?: (value: unknown, row: ConsoleRow) => string
|
|
1325
|
+
key: string
|
|
1326
|
+
label: string
|
|
1327
|
+
mono?: boolean
|
|
1328
|
+
}
|
|
1329
|
+
|
|
1330
|
+
interface ConsoleContribution = {
|
|
1331
|
+
ability: string
|
|
1332
|
+
navigationBadge?: () => Promise<string | number | null> | string | number | null
|
|
1333
|
+
navigationBadgeColor?: BadgeTone
|
|
1334
|
+
navigationGroup?: string
|
|
1335
|
+
navigationIcon?: string
|
|
1336
|
+
navigationLabel?: string
|
|
1337
|
+
navigationSort?: number
|
|
1338
|
+
showInNavigation?: boolean
|
|
1339
|
+
slug: string
|
|
1340
|
+
tabs: ConsoleTab[]
|
|
1341
|
+
title: string
|
|
1342
|
+
}
|
|
1343
|
+
|
|
1344
|
+
interface ConsoleHeaderAction = {
|
|
1345
|
+
confirm?: string
|
|
1346
|
+
danger?: boolean
|
|
1347
|
+
icon?: string
|
|
1348
|
+
key: string
|
|
1349
|
+
label: string
|
|
1350
|
+
run: () => Promise<string | void> | string | void
|
|
1351
|
+
}
|
|
1352
|
+
|
|
1353
|
+
interface ConsoleTab = {
|
|
1354
|
+
badge?: () => Promise<number | null> | number | null
|
|
1355
|
+
columns: ConsoleColumn[]
|
|
1356
|
+
description?: string
|
|
1357
|
+
empty?: string
|
|
1358
|
+
headerActions?: ConsoleHeaderAction[]
|
|
1359
|
+
key: string
|
|
1360
|
+
label: string
|
|
1361
|
+
rowActions?: ConsoleAction[]
|
|
1362
|
+
rowKey?: string
|
|
1363
|
+
rows: () => Promise<ConsoleRow[]> | ConsoleRow[]
|
|
1364
|
+
}
|
|
1365
|
+
|
|
1366
|
+
interface ConstraintOperator = {
|
|
1367
|
+
label: string
|
|
1368
|
+
unary?: boolean
|
|
1369
|
+
value: string
|
|
1370
|
+
}
|
|
1371
|
+
|
|
1372
|
+
interface ConstraintOption = {
|
|
1373
|
+
label: string
|
|
1374
|
+
value: string
|
|
1375
|
+
}
|
|
1376
|
+
|
|
1377
|
+
interface DashboardLayout = {
|
|
1378
|
+
hidden: string[]
|
|
1379
|
+
order: string[]
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
interface DashboardLayoutStore = {
|
|
1383
|
+
load: () => Promise<DashboardLayout | null> | DashboardLayout | null
|
|
1384
|
+
save: (layout: DashboardLayout) => Promise<void> | void
|
|
1385
|
+
}
|
|
1386
|
+
|
|
1387
|
+
interface DatabaseMediaOptions = {
|
|
1388
|
+
columns?: Partial<Record<keyof MediaItem, string>>
|
|
1389
|
+
table?: string
|
|
1390
|
+
}
|
|
1391
|
+
|
|
1392
|
+
interface DatabaseNotificationOptions = {
|
|
1393
|
+
limit?: number
|
|
1394
|
+
notifiable?: () => Promise<unknown> | unknown
|
|
1395
|
+
present?: (row: StoredNotification, data: Record<string, unknown>) => AdminNotification
|
|
1396
|
+
table?: string
|
|
1397
|
+
}
|
|
1398
|
+
|
|
1399
|
+
interface EmptyState = {
|
|
1400
|
+
actions?: ActionItem[]
|
|
1401
|
+
description?: string
|
|
1402
|
+
heading: string
|
|
1403
|
+
icon?: string
|
|
1404
|
+
}
|
|
1405
|
+
|
|
1406
|
+
interface EntryDisplay = {
|
|
1407
|
+
badge: boolean
|
|
1408
|
+
boolean: boolean | null
|
|
1409
|
+
circular: boolean
|
|
1410
|
+
columnSpan: number
|
|
1411
|
+
copyValue: string | null
|
|
1412
|
+
custom: ((value: unknown, row: Record<string, unknown>) => HtmlNode | string) | null
|
|
1413
|
+
href: string | null
|
|
1414
|
+
html: boolean
|
|
1415
|
+
icon: string | null
|
|
1416
|
+
imageHeight: number
|
|
1417
|
+
isPlaceholder: boolean
|
|
1418
|
+
items: EntryDisplay[][]
|
|
1419
|
+
kind: EntryKind
|
|
1420
|
+
label: string
|
|
1421
|
+
language: string | null
|
|
1422
|
+
pairs: { key: string; value: string;}[]
|
|
1423
|
+
raw: unknown
|
|
1424
|
+
row: Record<string, unknown>
|
|
1425
|
+
size: EntrySize
|
|
1426
|
+
text: string
|
|
1427
|
+
tone: BadgeTone | null
|
|
1428
|
+
tooltip: string | null
|
|
1429
|
+
weight: EntryWeight
|
|
1430
|
+
}
|
|
1431
|
+
|
|
1432
|
+
interface FilterOption = {
|
|
1433
|
+
label: string
|
|
1434
|
+
value: string
|
|
1435
|
+
}
|
|
1436
|
+
|
|
1437
|
+
interface HistoryChange = {
|
|
1438
|
+
field: string
|
|
1439
|
+
from: unknown
|
|
1440
|
+
to: unknown
|
|
1441
|
+
}
|
|
1442
|
+
|
|
1443
|
+
interface HistoryEntry = {
|
|
1444
|
+
actor: string | null
|
|
1445
|
+
at: string
|
|
1446
|
+
changes: HistoryChange[]
|
|
1447
|
+
event: string
|
|
1448
|
+
id: string
|
|
1449
|
+
revertible: boolean
|
|
1450
|
+
}
|
|
1451
|
+
|
|
1452
|
+
interface HistoryOptions = {
|
|
1453
|
+
id: unknown
|
|
1454
|
+
limit?: number
|
|
1455
|
+
resolveActor?: (id: number) => Promise<string | null> | string | null
|
|
1456
|
+
type: string
|
|
1457
|
+
}
|
|
1458
|
+
|
|
1459
|
+
interface ImportRecordsPayload = {
|
|
1460
|
+
csv: string
|
|
1461
|
+
mapping?: Record<number, string> | undefined
|
|
1462
|
+
panelId: string
|
|
1463
|
+
slug: string
|
|
1464
|
+
}
|
|
1465
|
+
|
|
1466
|
+
interface ImportResult = {
|
|
1467
|
+
created: number
|
|
1468
|
+
failures: string[]
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
interface ListOptions = {
|
|
1472
|
+
modifyQuery?: QueryModifier
|
|
1473
|
+
page?: number
|
|
1474
|
+
perPage?: number
|
|
1475
|
+
search?: string | undefined
|
|
1476
|
+
sortBy?: string | undefined
|
|
1477
|
+
sortDir?: 'asc' | 'desc'
|
|
1478
|
+
thenSort?: readonly { column: string; direction: 'asc' | 'desc';}[] | undefined
|
|
1479
|
+
trashed?: 'with' | 'only' | undefined
|
|
1480
|
+
}
|
|
1481
|
+
|
|
1482
|
+
interface MediaItem = {
|
|
1483
|
+
alt?: string
|
|
1484
|
+
folder?: string
|
|
1485
|
+
id: string
|
|
1486
|
+
mime: string
|
|
1487
|
+
name: string
|
|
1488
|
+
path: string
|
|
1489
|
+
size: number
|
|
1490
|
+
uploadedAt?: string
|
|
1491
|
+
}
|
|
1492
|
+
|
|
1493
|
+
interface MediaProvider = {
|
|
1494
|
+
list: (query: { folder?: string; search?: string; limit: number;}) => Promise<MediaItem[]> | MediaItem[]
|
|
1495
|
+
remove: (id: string) => Promise<void> | void
|
|
1496
|
+
save: (item: Omit<MediaItem, 'id'>) => Promise<MediaItem> | MediaItem
|
|
1497
|
+
update?: (id: string, changes: Pick<MediaItem, 'alt' | 'folder'>) => Promise<void> | void
|
|
1498
|
+
}
|
|
1499
|
+
|
|
1500
|
+
interface NavContribution = {
|
|
1501
|
+
ability: string
|
|
1502
|
+
external?: boolean
|
|
1503
|
+
group?: string
|
|
1504
|
+
href: string
|
|
1505
|
+
icon?: string
|
|
1506
|
+
label: string
|
|
1507
|
+
sort?: number
|
|
1508
|
+
}
|
|
1509
|
+
|
|
1510
|
+
interface NavGroup = {
|
|
1511
|
+
group: string | null
|
|
1512
|
+
items: NavItem[]
|
|
1513
|
+
}
|
|
1514
|
+
|
|
1515
|
+
interface NavItem = {
|
|
1516
|
+
ability?: string | undefined
|
|
1517
|
+
children?: NavItem[]
|
|
1518
|
+
external?: boolean | undefined
|
|
1519
|
+
href: string
|
|
1520
|
+
icon: string
|
|
1521
|
+
label: string
|
|
1522
|
+
parent?: string | undefined
|
|
1523
|
+
slug: string
|
|
1524
|
+
sort: number
|
|
1525
|
+
}
|
|
1526
|
+
|
|
1527
|
+
interface NotificationProvider = {
|
|
1528
|
+
markAllRead?: () => Promise<void> | void
|
|
1529
|
+
markRead?: (id: string) => Promise<void> | void
|
|
1530
|
+
resolve: () => Promise<AdminNotification[]> | AdminNotification[]
|
|
1531
|
+
unreadCount?: () => Promise<number> | number
|
|
1532
|
+
}
|
|
1533
|
+
|
|
1534
|
+
interface PageContribution = {
|
|
1535
|
+
ability: string
|
|
1536
|
+
cluster?: typeof Cluster
|
|
1537
|
+
navigationBadge?: () => Promise<string | number | null> | string | number | null
|
|
1538
|
+
navigationBadgeColor?: BadgeTone
|
|
1539
|
+
navigationGroup?: string
|
|
1540
|
+
navigationIcon?: string
|
|
1541
|
+
navigationLabel?: string
|
|
1542
|
+
navigationSort?: number
|
|
1543
|
+
page: PanelPageClass
|
|
1544
|
+
routeParams?: string[]
|
|
1545
|
+
showInNavigation?: boolean
|
|
1546
|
+
slug: string
|
|
1547
|
+
title: string
|
|
1548
|
+
}
|
|
1549
|
+
|
|
1550
|
+
interface PanelPage = {
|
|
1551
|
+
ability: string | undefined
|
|
1552
|
+
cluster?: typeof Cluster | undefined
|
|
1553
|
+
navigationBadge?: (() => Promise<string | number | null> | string | number | null) | undefined
|
|
1554
|
+
navigationBadgeColor?: BadgeTone | undefined
|
|
1555
|
+
navigationGroup: string | undefined
|
|
1556
|
+
navigationIcon: string
|
|
1557
|
+
navigationLabel: string
|
|
1558
|
+
navigationSort: number
|
|
1559
|
+
page: PanelPageClass
|
|
1560
|
+
routeParams: string[]
|
|
1561
|
+
showInNavigation: boolean
|
|
1562
|
+
slug: string
|
|
1563
|
+
title: string
|
|
1564
|
+
}
|
|
1565
|
+
|
|
1566
|
+
interface PanelSearchProvider = {
|
|
1567
|
+
ability: string
|
|
1568
|
+
icon?: string
|
|
1569
|
+
id: string
|
|
1570
|
+
label: string
|
|
1571
|
+
search: (term: string) => Promise<SearchHit[]> | SearchHit[]
|
|
1572
|
+
}
|
|
1573
|
+
|
|
1574
|
+
interface Permission = {
|
|
1575
|
+
group: string
|
|
1576
|
+
key: string
|
|
1577
|
+
label: string
|
|
1578
|
+
}
|
|
1579
|
+
|
|
1580
|
+
interface PivotColumn = {
|
|
1581
|
+
key: string
|
|
1582
|
+
label?: string
|
|
1583
|
+
}
|
|
1584
|
+
|
|
1585
|
+
interface RecordPage = {
|
|
1586
|
+
lastPage: number
|
|
1587
|
+
page: number
|
|
1588
|
+
perPage: number
|
|
1589
|
+
rows: Record<string, unknown>[]
|
|
1590
|
+
total: number
|
|
1591
|
+
}
|
|
1592
|
+
|
|
1593
|
+
interface RenderableCell = {
|
|
1594
|
+
badge?: BadgeTone | undefined
|
|
1595
|
+
text: string
|
|
1596
|
+
}
|
|
1597
|
+
|
|
1598
|
+
interface RenderHookContext = {
|
|
1599
|
+
page?: 'list' | 'record' | 'form' | 'dashboard' | undefined
|
|
1600
|
+
recordId?: string | undefined
|
|
1601
|
+
resource?: string | undefined
|
|
1602
|
+
}
|
|
1603
|
+
|
|
1604
|
+
interface Role = {
|
|
1605
|
+
description?: string
|
|
1606
|
+
id: string
|
|
1607
|
+
name: string
|
|
1608
|
+
superuser?: boolean
|
|
1609
|
+
}
|
|
1610
|
+
|
|
1611
|
+
interface RoleProvider = {
|
|
1612
|
+
create?: (role: Omit<Role, 'id'>) => Promise<void> | void
|
|
1613
|
+
list: () => Promise<Role[]> | Role[]
|
|
1614
|
+
permissionsFor: (roleId: string) => Promise<string[]> | string[]
|
|
1615
|
+
remove?: (roleId: string) => Promise<void> | void
|
|
1616
|
+
setPermissions: (roleId: string, keys: string[]) => Promise<void> | void
|
|
1617
|
+
}
|
|
1618
|
+
|
|
1619
|
+
interface SavedView = {
|
|
1620
|
+
id: string
|
|
1621
|
+
name: string
|
|
1622
|
+
query: string
|
|
1623
|
+
resource: string
|
|
1624
|
+
shared?: boolean
|
|
1625
|
+
}
|
|
1626
|
+
|
|
1627
|
+
interface SavedViewProvider = {
|
|
1628
|
+
list: (resource: string) => Promise<SavedView[]> | SavedView[]
|
|
1629
|
+
remove: (id: string) => Promise<void> | void
|
|
1630
|
+
save: (view: Omit<SavedView, 'id'>) => Promise<void> | void
|
|
1631
|
+
}
|
|
1632
|
+
|
|
1633
|
+
interface SearchHit = {
|
|
1634
|
+
description?: string
|
|
1635
|
+
href: string
|
|
1636
|
+
label: string
|
|
1637
|
+
}
|
|
1638
|
+
|
|
1639
|
+
interface SelectOption = {
|
|
1640
|
+
label: string
|
|
1641
|
+
value: string
|
|
1642
|
+
}
|
|
1643
|
+
|
|
1644
|
+
interface StoredNotification = {
|
|
1645
|
+
created_at: string
|
|
1646
|
+
data: string
|
|
1647
|
+
id: string
|
|
1648
|
+
notifiable_id: string
|
|
1649
|
+
notifiable_type: string
|
|
1650
|
+
read_at: string | null
|
|
1651
|
+
type: string
|
|
1652
|
+
}
|
|
1653
|
+
|
|
1654
|
+
interface StoreMediaOptions = {
|
|
1655
|
+
accept?: string[]
|
|
1656
|
+
disk?: string
|
|
1657
|
+
folder?: string
|
|
1658
|
+
maxBytes?: number
|
|
1659
|
+
provider: MediaProvider
|
|
1660
|
+
}
|
|
1661
|
+
|
|
1662
|
+
interface SummaryResult = {
|
|
1663
|
+
label: string
|
|
1664
|
+
text: string
|
|
1665
|
+
}
|
|
1666
|
+
|
|
1667
|
+
interface TableWidgetColumn = {
|
|
1668
|
+
key: string
|
|
1669
|
+
label: string
|
|
1670
|
+
}
|
|
1671
|
+
|
|
1672
|
+
interface TopbarSlot = {
|
|
1673
|
+
ability: string
|
|
1674
|
+
id: string
|
|
1675
|
+
render: () => HtmlNode | Promise<HtmlNode>
|
|
1676
|
+
sort?: number
|
|
1677
|
+
}
|
|
1678
|
+
|
|
1679
|
+
interface UploadedFileLike = {
|
|
1680
|
+
mime: string
|
|
1681
|
+
originalName: string
|
|
1682
|
+
size: number
|
|
1683
|
+
store: (directory: string, disk?: string, filename?: string) => Promise<string>
|
|
1684
|
+
}
|
|
1685
|
+
|
|
1686
|
+
interface UserMenu = {
|
|
1687
|
+
items: UserMenuItem[]
|
|
1688
|
+
label?: string
|
|
1689
|
+
}
|
|
1690
|
+
|
|
1691
|
+
interface UserMenuContribution = {
|
|
1692
|
+
ability: string
|
|
1693
|
+
href: string
|
|
1694
|
+
icon?: string
|
|
1695
|
+
label: string
|
|
1696
|
+
sort?: number
|
|
1697
|
+
}
|
|
1698
|
+
|
|
1699
|
+
interface UserMenuItem = {
|
|
1700
|
+
href: string
|
|
1701
|
+
icon?: string
|
|
1702
|
+
label: string
|
|
1703
|
+
}
|
|
1704
|
+
|
|
1705
|
+
interface WidgetContribution = {
|
|
1706
|
+
ability: string
|
|
1707
|
+
sort?: number
|
|
1708
|
+
widget: DashboardWidget
|
|
1709
|
+
}
|
|
1710
|
+
|
|
1711
|
+
type ActionColor = 'primary' | 'success' | 'muted' | 'destructive' | 'default'
|
|
1712
|
+
|
|
1713
|
+
type ActionHandler = (ctx: ActionContext) => void | Promise<void>
|
|
1714
|
+
|
|
1715
|
+
type ActionItem = Action | ActionGroup
|
|
1716
|
+
|
|
1717
|
+
type ActionVisible = (record: AdminRecord | undefined, ctx: ActionContext) => boolean
|
|
1718
|
+
|
|
1719
|
+
type AdminAuthorizer = (ability: string) => boolean | Promise<boolean>
|
|
1720
|
+
|
|
1721
|
+
type AdminPageClass = typeof AdminPage & (new () => AdminPage)
|
|
1722
|
+
|
|
1723
|
+
type BadgeTone = 'primary' | 'success' | 'muted' | 'destructive' | 'default'
|
|
1724
|
+
|
|
1725
|
+
type CalloutTone = 'primary' | 'success' | 'destructive' | 'default' | 'warning'
|
|
1726
|
+
|
|
1727
|
+
type CellAlign = 'start' | 'center' | 'end'
|
|
1728
|
+
|
|
1729
|
+
type ChartResolver = () => Promise<ChartData> | ChartData
|
|
1730
|
+
|
|
1731
|
+
type ChartType = 'line' | 'bar' | 'doughnut' | 'pie'
|
|
1732
|
+
|
|
1733
|
+
type ClusterClass = typeof Cluster
|
|
1734
|
+
|
|
1735
|
+
type ColumnKind = 'text' | 'toggle' | 'select' | 'input' | 'image' | 'color' | 'icon'
|
|
1736
|
+
|
|
1737
|
+
type Conjunction = 'and' | 'or'
|
|
1738
|
+
|
|
1739
|
+
type ConsoleRow = { [x: string]: unknown;}
|
|
1740
|
+
|
|
1741
|
+
type ConstraintKind = 'number' | 'boolean' | 'text' | 'select' | 'date'
|
|
1742
|
+
|
|
1743
|
+
type DashboardWidget = StatsWidget | ChartWidget | TableWidget
|
|
1744
|
+
|
|
1745
|
+
type EntryKind = 'text' | 'image' | 'color' | 'icon' | 'code' | 'keyValue' | 'repeatable'
|
|
1746
|
+
|
|
1747
|
+
type EntrySize = 'sm' | 'base' | 'lg'
|
|
1748
|
+
|
|
1749
|
+
type EntryWeight = 'normal' | 'medium' | 'semibold' | 'bold'
|
|
1750
|
+
|
|
1751
|
+
type ExportFormat = 'csv' | 'xlsx'
|
|
1752
|
+
|
|
1753
|
+
type FieldMode = 'create' | 'edit'
|
|
1754
|
+
|
|
1755
|
+
type FieldPredicate = (data: Record<string, unknown>) => boolean
|
|
1756
|
+
|
|
1757
|
+
type FieldType = 'number' | 'text' | 'toggle' | 'select' | 'color' | 'builder' | 'date' | 'code' | 'keyValue' | 'datetime' | 'email' | 'password' | 'url' | 'tel' | 'textarea' | 'checkbox' | 'radio' | 'checkboxList' | 'time' | 'hidden' | 'tags' | 'file' | 'media' | 'slider' | 'toggleButtons' | 'markdown' | 'richText' | 'repeater' | 'custom'
|
|
1758
|
+
|
|
1759
|
+
type FilterApply = (query: AdminQuery, value: string) => AdminQuery
|
|
1760
|
+
|
|
1761
|
+
type FilterType = 'text' | 'select' | 'ternary' | 'builder'
|
|
1762
|
+
|
|
1763
|
+
type FormBlock = { kind: 'section'; section: FormSection;} | { kind: 'tabs'; tabs: FormTabs;} | { kind: 'wizard'; wizard: Wizard;} | { kind: 'split'; split: FormSplit;} | { kind: 'callout'; callout: Callout;} | { kind: 'prime'; prime: Prime;}
|
|
1764
|
+
|
|
1765
|
+
type FormComponent = FormSection | FormTabs | Wizard | FormSplit | Callout | Prime | Field
|
|
1766
|
+
|
|
1767
|
+
type InfolistComponent = Section | Entry
|
|
1768
|
+
|
|
1769
|
+
type PanelPageClass = new () => object
|
|
1770
|
+
|
|
1771
|
+
type PrimeKind = 'text' | 'image' | 'html'
|
|
1772
|
+
|
|
1773
|
+
type QueryModifier = (query: AdminQuery) => AdminQuery
|
|
1774
|
+
|
|
1775
|
+
type QueryRule = { type: 'rule'; constraint: string; operator: string; value?: string;} | { type: 'group'; operator: Conjunction; rules: QueryRule[];}
|
|
1776
|
+
|
|
1777
|
+
type RelationKind = 'hasMany' | 'belongsToMany'
|
|
1778
|
+
|
|
1779
|
+
type RenderHook = (context: RenderHookContext) => HtmlNode | string | null
|
|
1780
|
+
|
|
1781
|
+
type RenderHookName = 'body.start' | 'body.end' | 'sidebar.start' | 'sidebar.end' | 'topbar.start' | 'topbar.end' | 'page.header.start' | 'page.header.end' | 'table.start' | 'table.end' | 'form.start' | 'form.end' | 'record.start' | 'record.end'
|
|
1782
|
+
|
|
1783
|
+
type ResourceClass = typeof Resource
|
|
1784
|
+
|
|
1785
|
+
type ResourceFormClass = new () => Form & Record<string, unknown>
|
|
1786
|
+
|
|
1787
|
+
type StatsResolver = () => Promise<Stat[]> | Stat[]
|
|
1788
|
+
|
|
1789
|
+
type SummaryKind = 'sum' | 'avg' | 'count' | 'min' | 'max' | 'range'
|
|
1790
|
+
|
|
1791
|
+
type TableRowsResolver = () => Promise<Record<string, unknown>[]> | Record<string, unknown>[]
|
|
1792
|
+
|
|
1793
|
+
type WidgetTone = 'primary' | 'success' | 'muted' | 'destructive' | 'default'
|
|
1794
|
+
|
|
1795
|
+
value AdminLayout = unknown
|
|
1796
|
+
|
|
1797
|
+
value ConsolePage = unknown
|
|
1798
|
+
|
|
1799
|
+
value DashboardPage = unknown
|
|
1800
|
+
|
|
1801
|
+
value environmentIndicator = unknown
|
|
1802
|
+
|
|
1803
|
+
value EnvironmentIndicatorOptions = unknown
|
|
1804
|
+
|
|
1805
|
+
value FormModeConfig = unknown
|
|
1806
|
+
|
|
1807
|
+
value Icon = unknown
|
|
1808
|
+
|
|
1809
|
+
value makeAdminLayout = unknown
|
|
1810
|
+
|
|
1811
|
+
value makeConsolePage = unknown
|
|
1812
|
+
|
|
1813
|
+
value makeDashboardPage = unknown
|
|
1814
|
+
|
|
1815
|
+
value makeMediaPage = unknown
|
|
1816
|
+
|
|
1817
|
+
value makeNotificationsPage = unknown
|
|
1818
|
+
|
|
1819
|
+
value makeRecordViewPage = unknown
|
|
1820
|
+
|
|
1821
|
+
value makeResourceListPage = unknown
|
|
1822
|
+
|
|
1823
|
+
value makeRolesPage = unknown
|
|
1824
|
+
|
|
1825
|
+
value makeSearchPage = unknown
|
|
1826
|
+
|
|
1827
|
+
value MediaPage = unknown
|
|
1828
|
+
|
|
1829
|
+
value NotificationsPage = unknown
|
|
1830
|
+
|
|
1831
|
+
value RecordViewPage = unknown
|
|
1832
|
+
|
|
1833
|
+
value registerResourceForm = unknown
|
|
1834
|
+
|
|
1835
|
+
value renderAction = unknown
|
|
1836
|
+
|
|
1837
|
+
value renderActionGroup = unknown
|
|
1838
|
+
|
|
1839
|
+
value renderActionMenuItem = unknown
|
|
1840
|
+
|
|
1841
|
+
value renderWidgets = unknown
|
|
1842
|
+
|
|
1843
|
+
value ResourceFormPage = unknown
|
|
1844
|
+
|
|
1845
|
+
value ResourceListPage = unknown
|
|
1846
|
+
|
|
1847
|
+
value RolesPage = unknown
|
|
1848
|
+
|
|
1849
|
+
value SearchPage = unknown
|
|
1850
|
+
|
|
1851
|
+
## ./auth `(./src/auth/index.ts)`
|
|
1852
|
+
|
|
1853
|
+
function registerAuthRoutes = (path: string, panelGuard: MiddlewareClass[]) => void
|
|
1854
|
+
|
|
1855
|
+
value AuthLayout = unknown
|
|
1856
|
+
|
|
1857
|
+
value ForgotPasswordPage = unknown
|
|
1858
|
+
|
|
1859
|
+
value LoginPage = unknown
|
|
1860
|
+
|
|
1861
|
+
value ProfilePage = unknown
|
|
1862
|
+
|
|
1863
|
+
value ResetPasswordPage = unknown
|
|
1864
|
+
|
|
1865
|
+
value VerifyEmailPage = unknown
|
|
1866
|
+
|
|
1867
|
+
## ./testing `(./src/testing.ts)`
|
|
1868
|
+
|
|
1869
|
+
class FlowTest = {
|
|
1870
|
+
new <T extends Component>(page: T, name: string): FlowTest<T>
|
|
1871
|
+
static mount: <T extends Component>(PageClass: PageClass<T>, props?: Partial<T>) => Promise<FlowTest<T>>
|
|
1872
|
+
assertDispatched: (eventName: string) => FlowTest<T>
|
|
1873
|
+
assertDontSee: (text: string) => FlowTest<T>
|
|
1874
|
+
assertErrored: (match?: string | RegExp) => FlowTest<T>
|
|
1875
|
+
assertFlashed: (level?: string, message?: string) => FlowTest<T>
|
|
1876
|
+
assertHasErrors: (field: string, message?: string) => FlowTest<T>
|
|
1877
|
+
assertNoErrors: () => FlowTest<T>
|
|
1878
|
+
assertNotRedirected: () => FlowTest<T>
|
|
1879
|
+
assertRedirectedTo: (url: string) => FlowTest<T>
|
|
1880
|
+
assertSee: (text: string) => FlowTest<T>
|
|
1881
|
+
call: (method: string, ...args: unknown[]) => Promise<FlowTest<T>>
|
|
1882
|
+
effects: () => FlowEffects | null
|
|
1883
|
+
errors: () => Record<string, string[]>
|
|
1884
|
+
flashes: () => FlowEffects['flashes']
|
|
1885
|
+
html: () => string
|
|
1886
|
+
lastError: () => Error | null
|
|
1887
|
+
page: () => T
|
|
1888
|
+
render: () => Promise<FlowTest<T>>
|
|
1889
|
+
seed: (prop: keyof T, value: unknown) => Promise<FlowTest<T>>
|
|
1890
|
+
set: (prop: keyof T, value: unknown) => Promise<FlowTest<T>>
|
|
1891
|
+
snapshot: () => Snapshot | null
|
|
1892
|
+
tolerateErrors: () => FlowTest<T>
|
|
1893
|
+
update: (prop: keyof T, value: unknown) => Promise<FlowTest<T>>
|
|
1894
|
+
}
|
|
1895
|
+
|
|
1896
|
+
const AdminTest = { list(resource: ResourceClass, props?: Record<string, unknown>, panel?: PanelInstance): Promise<AdminPageTest>; view(resource: ResourceClass, recordId: string | number, panel?: PanelInstance): Promise<AdminPageTest>; form(resource: ResourceClass, mode?: FieldMode, props?: Record<string, unknown>, panel?: PanelInstance): Promise<AdminPageTest>;}
|
|
1897
|
+
|
|
1898
|
+
function assertHasAction = (t: AdminPageTest, label: string) => void
|
|
1899
|
+
|
|
1900
|
+
function assertHasColumn = (t: AdminPageTest, resource: ResourceClass, key: string) => void
|
|
1901
|
+
|
|
1902
|
+
function assertHasField = (t: AdminPageTest, resource: ResourceClass, key: string) => void
|
|
1903
|
+
|
|
1904
|
+
function assertSeesRecord = (t: AdminPageTest, resource: ResourceClass, record: Record<string, unknown>) => void
|
|
1905
|
+
|
|
1906
|
+
type AdminPageTest = FlowTest<Component>
|