adminforth 1.0.73 → 1.0.75
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/dataConnectors/mongo.ts +5 -6
- package/dataConnectors/postgres.ts +16 -15
- package/dataConnectors/sqlite.ts +17 -12
- package/dist/dataConnectors/mongo.js +5 -5
- package/dist/dataConnectors/postgres.js +15 -15
- package/dist/dataConnectors/sqlite.js +15 -12
- package/dist/index.js +36 -13
- package/dist/modules/codeInjector.js +33 -7
- package/dist/servers/express.js +6 -8
- package/dist/spa/spa/src/main.ts +1 -1
- package/dist/spa/spa/src/utils.ts +11 -0
- package/dist/spa/spa/src/views/LoginView.vue +5 -2
- package/dist/types/AdminForthConfig.js +33 -1
- package/index.ts +40 -17
- package/modules/codeInjector.ts +38 -7
- package/package.json +2 -1
- package/plugins/base.ts +4 -5
- package/servers/express.ts +7 -9
- package/spa/src/main.ts +1 -1
- package/spa/src/utils.ts +11 -0
- package/spa/src/views/LoginView.vue +5 -2
- package/types/AdminForthConfig.ts +53 -14
- package/types.ts +0 -36
|
@@ -1,4 +1,23 @@
|
|
|
1
|
-
|
|
1
|
+
|
|
2
|
+
|
|
3
|
+
export interface CodeInjector {
|
|
4
|
+
srcFoldersToSync: Object;
|
|
5
|
+
allComponentNames: Object;
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export interface AdminForthClass {
|
|
9
|
+
config: AdminForthConfig;
|
|
10
|
+
codeInjector: CodeInjector;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
export interface AdminForthPluginType {
|
|
15
|
+
adminforth: AdminForthClass;
|
|
16
|
+
pluginDir: string;
|
|
17
|
+
customFolderName: string;
|
|
18
|
+
modifyResourceConfig(adminforth: AdminForthClass, resourceConfig: AdminForthResource): void;
|
|
19
|
+
componentPath(componentFile: string): string;
|
|
20
|
+
}
|
|
2
21
|
|
|
3
22
|
export type AdminForthConfigMenuItem = {
|
|
4
23
|
type?: 'heading' | 'group' | 'resource' | 'page' | 'gap' | 'divider',
|
|
@@ -20,7 +39,7 @@ export type AdminForthConfigMenuItem = {
|
|
|
20
39
|
export type AdminForthResourceColumn = {
|
|
21
40
|
name: string,
|
|
22
41
|
label?: string,
|
|
23
|
-
type?:
|
|
42
|
+
type?: AdminForthDataTypes,
|
|
24
43
|
primaryKey?: boolean,
|
|
25
44
|
required?: boolean | { create: boolean, edit: boolean },
|
|
26
45
|
editingNote?: string | { create: string, edit: string },
|
|
@@ -48,8 +67,9 @@ export type AdminForthResource = {
|
|
|
48
67
|
table: string,
|
|
49
68
|
dataSource: string,
|
|
50
69
|
columns: Array<AdminForthResourceColumn>,
|
|
70
|
+
dataSourceColumns?: Array<AdminForthResourceColumn>,
|
|
51
71
|
itemLabel?: Function,
|
|
52
|
-
plugins?: Array<
|
|
72
|
+
plugins?: Array<AdminForthPluginType>,
|
|
53
73
|
hooks?: {
|
|
54
74
|
show?: {
|
|
55
75
|
beforeDatasourceRequest?: Function | Array<Function>,
|
|
@@ -153,18 +173,37 @@ export type AdminForthResourceColumnComponent = {
|
|
|
153
173
|
list?: string,
|
|
154
174
|
}
|
|
155
175
|
|
|
176
|
+
export enum AdminForthDataTypes {
|
|
177
|
+
STRING = 'string',
|
|
178
|
+
INTEGER = 'integer',
|
|
179
|
+
FLOAT = 'float',
|
|
180
|
+
DECIMAL = 'decimal',
|
|
181
|
+
BOOLEAN = 'boolean',
|
|
182
|
+
DATE = 'date',
|
|
183
|
+
DATETIME = 'datetime',
|
|
184
|
+
TIME = 'time',
|
|
185
|
+
TEXT = 'text',
|
|
186
|
+
JSON = 'json',
|
|
187
|
+
}
|
|
188
|
+
|
|
189
|
+
export enum AdminForthFilterOperators {
|
|
190
|
+
EQ = 'eq',
|
|
191
|
+
NE = 'ne',
|
|
192
|
+
GT = 'gt',
|
|
193
|
+
LT = 'lt',
|
|
194
|
+
GTE = 'gte',
|
|
195
|
+
LTE = 'lte',
|
|
196
|
+
LIKE = 'like',
|
|
197
|
+
ILIKE = 'ilike',
|
|
198
|
+
IN = 'in',
|
|
199
|
+
NIN = 'nin',
|
|
200
|
+
};
|
|
201
|
+
|
|
202
|
+
export enum AdminForthSortDirections {
|
|
203
|
+
ASC = 'asc',
|
|
204
|
+
DESC = 'desc',
|
|
205
|
+
};
|
|
156
206
|
|
|
157
|
-
export type AdminForthTypesValues =
|
|
158
|
-
| 'string'
|
|
159
|
-
| 'integer'
|
|
160
|
-
| 'float'
|
|
161
|
-
| 'decimal'
|
|
162
|
-
| 'boolean'
|
|
163
|
-
| 'date'
|
|
164
|
-
| 'datetime'
|
|
165
|
-
| 'time'
|
|
166
|
-
| 'text'
|
|
167
|
-
| 'json';
|
|
168
207
|
|
|
169
208
|
export type AdminForthResourceColumnEnumElement = {
|
|
170
209
|
value: string | null,
|
package/types.ts
DELETED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
// typical types which AdminForth supports
|
|
4
|
-
//
|
|
5
|
-
export const AdminForthTypes = {
|
|
6
|
-
STRING: 'string',
|
|
7
|
-
INTEGER: 'integer',
|
|
8
|
-
FLOAT: 'float',
|
|
9
|
-
DECIMAL: 'decimal',
|
|
10
|
-
BOOLEAN: 'boolean',
|
|
11
|
-
DATE: 'date',
|
|
12
|
-
DATETIME: 'datetime',
|
|
13
|
-
TIME: 'time',
|
|
14
|
-
TEXT: 'text',
|
|
15
|
-
JSON: 'json',
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export type AdminForthTypesValues = keyof typeof AdminForthTypes;
|
|
19
|
-
|
|
20
|
-
export const AdminForthFilterOperators = {
|
|
21
|
-
EQ: 'eq',
|
|
22
|
-
NE: 'ne',
|
|
23
|
-
GT: 'gt',
|
|
24
|
-
LT: 'lt',
|
|
25
|
-
GTE: 'gte',
|
|
26
|
-
LTE: 'lte',
|
|
27
|
-
LIKE: 'like',
|
|
28
|
-
ILIKE: 'ilike',
|
|
29
|
-
IN: 'in',
|
|
30
|
-
NIN: 'nin',
|
|
31
|
-
};
|
|
32
|
-
|
|
33
|
-
export const AdminForthSortDirections = {
|
|
34
|
-
ASC: 'asc',
|
|
35
|
-
DESC: 'desc',
|
|
36
|
-
};
|