@zerotal/admin 1.7.3 → 1.7.5
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 +10 -68
- package/package.json +9 -9
package/api-surface.md
CHANGED
|
@@ -871,26 +871,10 @@ class WizardStep = {
|
|
|
871
871
|
schema: (fields: Field[]) => WizardStep
|
|
872
872
|
}
|
|
873
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
874
|
const NOTIFICATION_CHANNEL = 'admin-notifications'
|
|
887
875
|
|
|
888
876
|
const NOTIFICATION_EVENT = '.notification.sent'
|
|
889
877
|
|
|
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
878
|
function action = (key: string) => Action
|
|
895
879
|
|
|
896
880
|
function actionGroup = (actions: Action[]) => ActionGroup
|
|
@@ -903,8 +887,6 @@ function adminTailwindConfig = () => string
|
|
|
903
887
|
|
|
904
888
|
function adminTokensCss = () => string
|
|
905
889
|
|
|
906
|
-
function applyLayout = <T>(widgets: T[], keyOf: (widget: T, index: number) => string, layout: DashboardLayout | null) => { visible: T[]; hidden: { key: string; widget: T; }[];}
|
|
907
|
-
|
|
908
890
|
function authRoles = (options?: AuthRolesOptions) => RoleProvider
|
|
909
891
|
|
|
910
892
|
function belongsToMany = (resource: ResourceClass, relationName: string) => RelationManager
|
|
@@ -961,8 +943,6 @@ function deleteAction = () => Action
|
|
|
961
943
|
|
|
962
944
|
function deleteMedia = (item: MediaItem, options: { provider: MediaProvider; disk?: string;}) => Promise<[true] | [false, string]>
|
|
963
945
|
|
|
964
|
-
function describeRuleTree = (node: QueryRule | null, filter?: { _constraints: Constraint[];}) => string
|
|
965
|
-
|
|
966
946
|
function dispatchImport = (payload: ImportRecordsPayload) => Promise<boolean>
|
|
967
947
|
|
|
968
948
|
function editAction = () => Action
|
|
@@ -973,10 +953,6 @@ function fieldset = (legend?: string) => FormSection
|
|
|
973
953
|
|
|
974
954
|
function fileUpload = (key: string) => Field
|
|
975
955
|
|
|
976
|
-
function flattenActions = (items: ActionItem[]) => Action[]
|
|
977
|
-
|
|
978
|
-
function flattenFields = (components: FormComponent[]) => Field[]
|
|
979
|
-
|
|
980
956
|
function forceDeleteAction = () => Action
|
|
981
957
|
|
|
982
958
|
function formatSize = (bytes: number) => string
|
|
@@ -989,10 +965,6 @@ function formTabs = (tabs: FormTab[]) => FormTabs
|
|
|
989
965
|
|
|
990
966
|
function group = (column: string) => Group
|
|
991
967
|
|
|
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
968
|
function hasMany = (resource: ResourceClass, foreignKey: string) => RelationManager
|
|
997
969
|
|
|
998
970
|
function hidden = (key: string) => Field
|
|
@@ -1013,20 +985,12 @@ function importAction = (options?: { queue?: boolean;}) => Action
|
|
|
1013
985
|
|
|
1014
986
|
function importCsv = (resource: ResourceClass, csv: string, mapping?: Record<number, string>, options?: { limit?: number;}) => Promise<ImportResult>
|
|
1015
987
|
|
|
1016
|
-
function isFormSection = (c: FormComponent) => c is FormSection
|
|
1017
|
-
|
|
1018
|
-
function isImage = (item: MediaItem) => boolean
|
|
1019
|
-
|
|
1020
988
|
function isImpersonating = () => Promise<boolean>
|
|
1021
989
|
|
|
1022
|
-
function isUpload = (value: unknown) => value is UploadedFileLike
|
|
1023
|
-
|
|
1024
990
|
function keyValue = (key: string) => Field
|
|
1025
991
|
|
|
1026
992
|
function keyValueEntry = (key: string) => Entry
|
|
1027
993
|
|
|
1028
|
-
function makeResourceForm = (schema: FormComponent[], mode: FieldMode, className: string) => { FormClass: ResourceFormClass; fields: Field[];}
|
|
1029
|
-
|
|
1030
994
|
function markdownEditor = (key: string) => Field
|
|
1031
995
|
|
|
1032
996
|
function mediaPath = (name: string, folder?: string) => string
|
|
@@ -1035,16 +999,12 @@ function mediaPicker = (key: string) => Field
|
|
|
1035
999
|
|
|
1036
1000
|
function mediaUrl = (item: MediaItem, disk?: string) => Promise<string | null>
|
|
1037
1001
|
|
|
1038
|
-
function moveKey = (order: string[], key: string, direction: -1 | 1) => string[]
|
|
1039
|
-
|
|
1040
1002
|
function numberConstraint = (key: string) => Constraint
|
|
1041
1003
|
|
|
1042
1004
|
function panelPermissions = (panel: PanelInstance) => Permission[]
|
|
1043
1005
|
|
|
1044
1006
|
function parseCsv = (text: string) => string[][]
|
|
1045
1007
|
|
|
1046
|
-
function parseRuleTree = (value: string) => QueryRule | null
|
|
1047
|
-
|
|
1048
1008
|
function prime = (text: string) => Prime
|
|
1049
1009
|
|
|
1050
1010
|
function primeHtml = (html: string) => Prime
|
|
@@ -1055,8 +1015,6 @@ function queryBuilder = (key: string) => Filter
|
|
|
1055
1015
|
|
|
1056
1016
|
function radio = (key: string) => Field
|
|
1057
1017
|
|
|
1058
|
-
function reconcile = (layout: DashboardLayout | null, keys: string[]) => DashboardLayout
|
|
1059
|
-
|
|
1060
1018
|
function recordHistory = (options: HistoryOptions) => Promise<HistoryEntry[]>
|
|
1061
1019
|
|
|
1062
1020
|
function repeatableEntry = (key: string) => Entry
|
|
@@ -1067,18 +1025,12 @@ function replicateAction = () => Action
|
|
|
1067
1025
|
|
|
1068
1026
|
function resolveMediaSrc = (value: unknown, disk?: string) => string | null
|
|
1069
1027
|
|
|
1070
|
-
function resolveRenderHooks = (hooks: RenderHook[], context?: RenderHookContext) => (HtmlNode | string)[]
|
|
1071
|
-
|
|
1072
1028
|
function restoreAction = () => Action
|
|
1073
1029
|
|
|
1074
|
-
function revertPayload = (entry: HistoryEntry) => Record<string, unknown>
|
|
1075
|
-
|
|
1076
1030
|
function richEditor = (key: string) => Field
|
|
1077
1031
|
|
|
1078
1032
|
function roleHas = (role: Role, held: string[], key: string) => boolean
|
|
1079
1033
|
|
|
1080
|
-
function ruleTreeIsEmpty = (node: QueryRule | null) => boolean
|
|
1081
|
-
|
|
1082
1034
|
function runQueuedImport = (payload: ImportRecordsPayload) => Promise<ImportResult>
|
|
1083
1035
|
|
|
1084
1036
|
function section = (heading?: string) => Section
|
|
@@ -1131,10 +1083,6 @@ function timePicker = (key: string) => Field
|
|
|
1131
1083
|
|
|
1132
1084
|
function toCsv = (rows: Record<string, unknown>[], columns: Column[]) => string
|
|
1133
1085
|
|
|
1134
|
-
function toFormLayout = (components: FormComponent[]) => FormBlock[]
|
|
1135
|
-
|
|
1136
|
-
function toFormSections = (components: FormComponent[]) => FormSection[]
|
|
1137
|
-
|
|
1138
1086
|
function toggle = (key: string) => Field
|
|
1139
1087
|
|
|
1140
1088
|
function toggleButtons = (key: string) => Field
|
|
@@ -1145,12 +1093,6 @@ function toXlsx = (rows: Record<string, unknown>[], columns: Column[], options?:
|
|
|
1145
1093
|
|
|
1146
1094
|
function viewAction = () => Action
|
|
1147
1095
|
|
|
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
1096
|
function wizard = (steps: WizardStep[]) => Wizard
|
|
1155
1097
|
|
|
1156
1098
|
function wizardStep = (label: string) => WizardStep
|
|
@@ -1708,7 +1650,7 @@ interface WidgetContribution = {
|
|
|
1708
1650
|
widget: DashboardWidget
|
|
1709
1651
|
}
|
|
1710
1652
|
|
|
1711
|
-
type ActionColor = '
|
|
1653
|
+
type ActionColor = 'default' | 'primary' | 'success' | 'muted' | 'destructive'
|
|
1712
1654
|
|
|
1713
1655
|
type ActionHandler = (ctx: ActionContext) => void | Promise<void>
|
|
1714
1656
|
|
|
@@ -1720,9 +1662,9 @@ type AdminAuthorizer = (ability: string) => boolean | Promise<boolean>
|
|
|
1720
1662
|
|
|
1721
1663
|
type AdminPageClass = typeof AdminPage & (new () => AdminPage)
|
|
1722
1664
|
|
|
1723
|
-
type BadgeTone = '
|
|
1665
|
+
type BadgeTone = 'default' | 'primary' | 'success' | 'muted' | 'destructive'
|
|
1724
1666
|
|
|
1725
|
-
type CalloutTone = '
|
|
1667
|
+
type CalloutTone = 'default' | 'primary' | 'success' | 'warning' | 'destructive'
|
|
1726
1668
|
|
|
1727
1669
|
type CellAlign = 'start' | 'center' | 'end'
|
|
1728
1670
|
|
|
@@ -1738,11 +1680,11 @@ type Conjunction = 'and' | 'or'
|
|
|
1738
1680
|
|
|
1739
1681
|
type ConsoleRow = { [x: string]: unknown;}
|
|
1740
1682
|
|
|
1741
|
-
type ConstraintKind = '
|
|
1683
|
+
type ConstraintKind = 'text' | 'number' | 'date' | 'boolean' | 'select'
|
|
1742
1684
|
|
|
1743
1685
|
type DashboardWidget = StatsWidget | ChartWidget | TableWidget
|
|
1744
1686
|
|
|
1745
|
-
type EntryKind = 'text' | '
|
|
1687
|
+
type EntryKind = 'text' | 'icon' | 'image' | 'color' | 'code' | 'keyValue' | 'repeatable'
|
|
1746
1688
|
|
|
1747
1689
|
type EntrySize = 'sm' | 'base' | 'lg'
|
|
1748
1690
|
|
|
@@ -1754,13 +1696,13 @@ type FieldMode = 'create' | 'edit'
|
|
|
1754
1696
|
|
|
1755
1697
|
type FieldPredicate = (data: Record<string, unknown>) => boolean
|
|
1756
1698
|
|
|
1757
|
-
type FieldType = '
|
|
1699
|
+
type FieldType = 'text' | 'email' | 'password' | 'number' | 'url' | 'tel' | 'textarea' | 'select' | 'checkbox' | 'toggle' | 'radio' | 'checkboxList' | 'date' | 'datetime' | 'time' | 'color' | 'hidden' | 'tags' | 'keyValue' | 'file' | 'media' | 'slider' | 'toggleButtons' | 'code' | 'markdown' | 'richText' | 'repeater' | 'builder' | 'custom'
|
|
1758
1700
|
|
|
1759
1701
|
type FilterApply = (query: AdminQuery, value: string) => AdminQuery
|
|
1760
1702
|
|
|
1761
|
-
type FilterType = '
|
|
1703
|
+
type FilterType = 'select' | 'ternary' | 'builder' | 'text'
|
|
1762
1704
|
|
|
1763
|
-
type FormBlock = {
|
|
1705
|
+
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
1706
|
|
|
1765
1707
|
type FormComponent = FormSection | FormTabs | Wizard | FormSplit | Callout | Prime | Field
|
|
1766
1708
|
|
|
@@ -1768,11 +1710,11 @@ type InfolistComponent = Section | Entry
|
|
|
1768
1710
|
|
|
1769
1711
|
type PanelPageClass = new () => object
|
|
1770
1712
|
|
|
1771
|
-
type PrimeKind = 'text' | '
|
|
1713
|
+
type PrimeKind = 'text' | 'html' | 'image'
|
|
1772
1714
|
|
|
1773
1715
|
type QueryModifier = (query: AdminQuery) => AdminQuery
|
|
1774
1716
|
|
|
1775
|
-
type QueryRule = {
|
|
1717
|
+
type QueryRule = { type: 'rule'; constraint: string; operator: string; value?: string } | { type: 'group'; operator: Conjunction; rules: QueryRule[] }
|
|
1776
1718
|
|
|
1777
1719
|
type RelationKind = 'hasMany' | 'belongsToMany'
|
|
1778
1720
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@zerotal/admin",
|
|
3
|
-
"version": "1.7.
|
|
3
|
+
"version": "1.7.5",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"maturity": "stable",
|
|
6
6
|
"private": false,
|
|
@@ -32,16 +32,16 @@
|
|
|
32
32
|
"typecheck": "tsc --noEmit"
|
|
33
33
|
},
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@zerotal/cache": "1.7.
|
|
36
|
-
"@zerotal/core": "1.7.
|
|
37
|
-
"@zerotal/flow": "1.7.
|
|
38
|
-
"@zerotal/flow-ui": "1.7.
|
|
39
|
-
"@zerotal/validator": "1.7.
|
|
35
|
+
"@zerotal/cache": "1.7.5",
|
|
36
|
+
"@zerotal/core": "1.7.5",
|
|
37
|
+
"@zerotal/flow": "1.7.5",
|
|
38
|
+
"@zerotal/flow-ui": "1.7.5",
|
|
39
|
+
"@zerotal/validator": "1.7.5"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
|
-
"@zerotal/orm": "1.7.
|
|
43
|
-
"@zerotal/auth": "1.7.
|
|
44
|
-
"@zerotal/queue": "1.7.
|
|
42
|
+
"@zerotal/orm": "1.7.5",
|
|
43
|
+
"@zerotal/auth": "1.7.5",
|
|
44
|
+
"@zerotal/queue": "1.7.5"
|
|
45
45
|
},
|
|
46
46
|
"peerDependencies": {
|
|
47
47
|
"@zerotal/orm": "^1.0.0",
|