identity-admin 1.25.24 → 1.26.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (147) hide show
  1. package/README.md +126 -126
  2. package/lib/Dashboard.d.ts +14 -14
  3. package/lib/Dashboard.js +95 -95
  4. package/lib/container/helpers/HelperInversify.d.ts +6 -6
  5. package/lib/container/helpers/HelperInversify.js +10 -10
  6. package/lib/container/helpers/HelperTypes.d.ts +5 -5
  7. package/lib/container/helpers/HelperTypes.js +7 -7
  8. package/lib/container/index.d.ts +1 -1
  9. package/lib/container/index.js +14 -14
  10. package/lib/container/repositories/RepositoryInversify.d.ts +4 -4
  11. package/lib/container/repositories/RepositoryInversify.js +13 -13
  12. package/lib/container/repositories/RepositoryTypes.d.ts +4 -4
  13. package/lib/container/repositories/RepositoryTypes.js +6 -6
  14. package/lib/container/types.d.ts +8 -8
  15. package/lib/container/types.js +9 -9
  16. package/lib/controllers/ActionController.d.ts +8 -8
  17. package/lib/controllers/ActionController.js +79 -79
  18. package/lib/controllers/DashboardController.d.ts +43 -43
  19. package/lib/controllers/DashboardController.js +695 -695
  20. package/lib/controllers/ResourceController.d.ts +15 -15
  21. package/lib/controllers/ResourceController.js +134 -134
  22. package/lib/helpers/ActionsGenerator.d.ts +11 -11
  23. package/lib/helpers/ActionsGenerator.js +179 -179
  24. package/lib/helpers/FiltersHelper.d.ts +9 -9
  25. package/lib/helpers/FiltersHelper.js +113 -105
  26. package/lib/helpers/LocalesHelper.d.ts +4 -4
  27. package/lib/helpers/LocalesHelper.js +73 -73
  28. package/lib/helpers/LocalizedStringHelper.d.ts +9 -9
  29. package/lib/helpers/LocalizedStringHelper.js +57 -57
  30. package/lib/helpers/Permissions/PermissionFetcher.d.ts +7 -7
  31. package/lib/helpers/Permissions/PermissionFetcher.js +78 -78
  32. package/lib/helpers/Permissions/PermissionLabel.d.ts +2 -2
  33. package/lib/helpers/Permissions/PermissionLabel.js +42 -42
  34. package/lib/helpers/Permissions/PermissionMapper.d.ts +13 -13
  35. package/lib/helpers/Permissions/PermissionMapper.js +35 -35
  36. package/lib/helpers/Permissions/PermissionResource.d.ts +5 -5
  37. package/lib/helpers/Permissions/PermissionResource.js +31 -31
  38. package/lib/helpers/Permissions/PermissionSavingService.d.ts +13 -13
  39. package/lib/helpers/Permissions/PermissionSavingService.js +32 -32
  40. package/lib/helpers/Permissions/SavePermissionGroup.d.ts +6 -6
  41. package/lib/helpers/Permissions/SavePermissionGroup.js +32 -32
  42. package/lib/helpers/Permissions/UpdatePermissionGroup.d.ts +6 -6
  43. package/lib/helpers/Permissions/UpdatePermissionGroup.js +50 -50
  44. package/lib/helpers/Permissions/types.d.ts +17 -17
  45. package/lib/helpers/Permissions/types.js +2 -2
  46. package/lib/helpers/PopulationHelper.d.ts +12 -12
  47. package/lib/helpers/PopulationHelper.js +50 -50
  48. package/lib/helpers/ReportsGenerator.d.ts +11 -11
  49. package/lib/helpers/ReportsGenerator.js +57 -57
  50. package/lib/helpers/ResourceGenerator.d.ts +9 -9
  51. package/lib/helpers/ResourceGenerator.js +172 -172
  52. package/lib/helpers/ResourceHelper.d.ts +28 -28
  53. package/lib/helpers/ResourceHelper.js +376 -376
  54. package/lib/helpers/RportsGenerator.d.ts +10 -10
  55. package/lib/helpers/RportsGenerator.js +21 -21
  56. package/lib/helpers/SchemaGenerator.d.ts +5 -5
  57. package/lib/helpers/SchemaGenerator.js +97 -97
  58. package/lib/helpers/SchemaHelper.d.ts +5 -5
  59. package/lib/helpers/SchemaHelper.js +21 -21
  60. package/lib/locales/en.json +53 -53
  61. package/lib/middlewares/isAuth.d.ts +13 -13
  62. package/lib/middlewares/isAuth.js +43 -43
  63. package/lib/models/ModelNames.d.ts +7 -7
  64. package/lib/models/ModelNames.js +10 -10
  65. package/lib/models/adminpermission/AdminPermission.d.ts +6 -6
  66. package/lib/models/adminpermission/AdminPermission.js +23 -23
  67. package/lib/models/adminpermission/IAdminPermission.d.ts +13 -13
  68. package/lib/models/adminpermission/IAdminPermission.js +2 -2
  69. package/lib/models/customPage/CustomPage.d.ts +2 -2
  70. package/lib/models/customPage/CustomPage.js +38 -38
  71. package/lib/models/customPage/ICustomPage.d.ts +17 -17
  72. package/lib/models/customPage/ICustomPage.js +2 -2
  73. package/lib/models/file/File.d.ts +2 -2
  74. package/lib/models/file/File.js +23 -23
  75. package/lib/models/file/IFile.d.ts +15 -15
  76. package/lib/models/file/IFile.js +2 -2
  77. package/lib/models/location/ILocation.d.ts +14 -14
  78. package/lib/models/location/ILocation.js +2 -2
  79. package/lib/models/location/Location.d.ts +2 -2
  80. package/lib/models/location/Location.js +21 -21
  81. package/lib/models/modelConfiguration/IModelConfigurations.d.ts +29 -29
  82. package/lib/models/modelConfiguration/IModelConfigurations.js +2 -2
  83. package/lib/models/modelConfiguration/ModelConfiguration.d.ts +13 -13
  84. package/lib/models/modelConfiguration/ModelConfiguration.js +95 -95
  85. package/lib/models/permission/IPermission.d.ts +14 -14
  86. package/lib/models/permission/IPermission.js +2 -2
  87. package/lib/models/permission/Permission.d.ts +2 -2
  88. package/lib/models/permission/Permission.js +21 -21
  89. package/lib/models/request-log/IRequestLog.d.ts +22 -22
  90. package/lib/models/request-log/IRequestLog.js +2 -2
  91. package/lib/models/request-log/RequestLog.d.ts +3 -3
  92. package/lib/models/request-log/RequestLog.js +51 -51
  93. package/lib/pdf/ReportTemplate.d.ts +71 -71
  94. package/lib/pdf/ReportTemplate.js +94 -94
  95. package/lib/repositories/DashboardRepository.d.ts +5 -5
  96. package/lib/repositories/DashboardRepository.js +12 -12
  97. package/lib/repositories/Repository.d.ts +68 -68
  98. package/lib/repositories/Repository.js +212 -212
  99. package/lib/repositories/RequestLogRepository.d.ts +10 -10
  100. package/lib/repositories/RequestLogRepository.js +54 -54
  101. package/lib/repositories/SaveResult.d.ts +14 -14
  102. package/lib/repositories/SaveResult.js +18 -18
  103. package/lib/router/index.d.ts +8 -8
  104. package/lib/router/index.js +104 -104
  105. package/lib/types/DashbordConfig.d.ts +21 -21
  106. package/lib/types/DashbordConfig.js +2 -2
  107. package/lib/types/IConfigurationFile.d.ts +9 -9
  108. package/lib/types/IConfigurationFile.js +2 -2
  109. package/lib/types/IResourceFile.d.ts +629 -624
  110. package/lib/types/IResourceFile.js +2 -2
  111. package/lib/types/IResourceResponse.d.ts +95 -95
  112. package/lib/types/IResourceResponse.js +2 -2
  113. package/lib/types/helpers.d.ts +61 -61
  114. package/lib/types/helpers.js +71 -71
  115. package/lib/utils/ResourceUtils.d.ts +2 -2
  116. package/lib/utils/ResourceUtils.js +7 -7
  117. package/lib/utils/ResponseUtils.d.ts +11 -11
  118. package/lib/utils/ResponseUtils.js +41 -41
  119. package/lib/utils/StringUtils.d.ts +9 -9
  120. package/lib/utils/StringUtils.js +46 -46
  121. package/lib/view/asset-manifest.json +18 -18
  122. package/lib/view/assets/icons/delete_icon.svg +3 -3
  123. package/lib/view/assets/icons/flags/ic_flag_cn.svg +9 -9
  124. package/lib/view/assets/icons/flags/ic_flag_sa.svg +9 -9
  125. package/lib/view/assets/icons/flags/ic_flag_vn.svg +9 -9
  126. package/lib/view/assets/icons/info_icon.svg +3 -3
  127. package/lib/view/assets/icons/navbar/ic_banking.svg +5 -5
  128. package/lib/view/assets/icons/navbar/ic_invoice.svg +4 -4
  129. package/lib/view/assets/icons/navbar/ic_kanban.svg +7 -7
  130. package/lib/view/assets/icons/navbar/ic_menu_item.svg +8 -8
  131. package/lib/view/assets/icons/small_info_icon.svg +3 -3
  132. package/lib/view/assets/illustrations/Group 16.svg +4 -4
  133. package/lib/view/assets/illustrations/logo.svg +5 -5
  134. package/lib/view/favicon/browserconfig.xml +9 -9
  135. package/lib/view/favicon/safari-pinned-tab.svg +182 -182
  136. package/lib/view/favicon/site.webmanifest +19 -19
  137. package/lib/view/fonts/index.css +18 -18
  138. package/lib/view/index.html +52 -52
  139. package/lib/view/manifest.json +20 -20
  140. package/lib/view/robots.txt +3 -3
  141. package/lib/view/static/css/main.54de06ef.css +1 -1
  142. package/lib/view/static/js/574.778b5963.chunk.js +1 -1
  143. package/lib/view/static/js/678.521704a3.chunk.js +1 -1
  144. package/lib/view/static/js/798.54856416.chunk.js +1 -1
  145. package/lib/view/static/js/main.4687f255.js +2 -2
  146. package/lib/view/static/js/main.4687f255.js.LICENSE.txt +214 -214
  147. package/package.json +58 -58
@@ -1,624 +1,629 @@
1
- import { ValidationChain } from 'express-validator';
2
- import { Document, Model } from 'mongoose';
3
- import { IRequest } from '../middlewares/isAuth';
4
- import { IRepository, PageInfo, PaginateParams } from '../repositories/Repository';
5
- import SaveResult from '../repositories/SaveResult';
6
- import { ActionNames, ActionTypes, FieldTypes, FileTypes, HandlerStrategy, NeighborTypes, Virtuals } from './helpers';
7
- declare type orderTypes = 'asc' | 'desc';
8
- declare type VirtualFieldTypes = 'password' | 'ref' | 'Array';
9
- declare type Severity = 'success' | 'info' | 'warning' | 'error';
10
- declare type ButtonColors = 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
11
- declare type ButtonVariants = 'text' | 'outlined' | 'contained';
12
- declare type ButtonSizes = 'small' | 'medium' | 'large';
13
- declare type PopulateFunction = (populatedString: any) => Promise<any>;
14
- interface Parent {
15
- /**
16
- * Name of the parent
17
- */
18
- name: string;
19
- /**
20
- * Icon of the parent. You can get the icons from
21
- * {@link https://mui.com/material-ui/material-icons/}
22
- */
23
- icon: string;
24
- }
25
- interface IPopulate {
26
- /**
27
- * This function is called for all the endpoints to have an access over the populated string
28
- */
29
- all?: PopulateFunction;
30
- /**
31
- * This function is called for the list endpoint to have an access over the populated string
32
- */
33
- list?: PopulateFunction;
34
- /**
35
- * This function is called for the get one endpoint either in show or form an access over the populated string
36
- */
37
- show?: PopulateFunction;
38
- }
39
- interface Action {
40
- /**
41
- * Specify if this action is accessible or not.
42
- * @default True for show, edit, delete, and new.
43
- * @default false for bulk delete.
44
- * You can ovveride any of these values here.
45
- */
46
- isAccessible?: boolean;
47
- /**
48
- * Specify if the page requires to be reloaded after executing the action
49
- * @default Fale for show, edit, delete, and new.
50
- */
51
- reloadAfterAction?: boolean;
52
- /**
53
- * The property that manages which admin role can use this action.
54
- * This function's result alters the isAccessible value. So no need to use both properties.
55
- * If both are used then isAccessible has the higher priority.
56
- * @default 'Same as isAccessible'
57
- */
58
- isAllowed?: (currentUser: Document) => boolean;
59
- /**
60
- * The property that manages which action will be extracted from action menu in list.
61
- * @default true for edit and show false for others
62
- */
63
- isMainAction?: boolean;
64
- }
65
- interface ICrudOperations {
66
- index?: {
67
- /**
68
- * Before handler that gives you the access to the filter object.
69
- * You can add to the filter object any key and value that will be used in the filter query before getting the records for list.
70
- * @returns the filter object
71
- */
72
- before?: (req: IRequest, filter: {
73
- [key: string]: any;
74
- }, currentUser: Document) => Promise<{
75
- [key: string]: any;
76
- }>;
77
- /**
78
- * After handler that gives you the access to the array of documents.
79
- * @returns the array of documents
80
- */
81
- after?: (req: IRequest, documents: Document[], currentUser: Document) => Promise<Document[]>;
82
- /**
83
- * index handler that gives you the access to the run custom index method with custom query.
84
- * @returns result list of records
85
- */
86
- index?: (req: IRequest, filter: {
87
- [key: string]: any;
88
- }, sortQuery: {
89
- [key: string]: any;
90
- }, paginateParams: PaginateParams | undefined, populate: any, currentUser: Document) => Promise<{
91
- records: Document[];
92
- pageInfo?: PageInfo;
93
- }>;
94
- };
95
- create?: {
96
- /**
97
- * Before handler that is called before creating a new record.
98
- * This function gives you the access to the record params before saving it, you can perform any update to the params before saving it.
99
- * @returns the params
100
- */
101
- before?: (req: IRequest, params: any, currentUser: Document) => Promise<any>;
102
- /**
103
- * After handler that gives you the access to the saved document.
104
- * @returns the saved document
105
- */
106
- after?: (req: IRequest, document: Document, currentUser: Document, params: any) => Promise<Document>;
107
- /**
108
- * Validators consist of an array of Express ValidationChain, each comprising validation functions that are executed before triggering the save query.
109
- */
110
- validators?: ValidationChain[];
111
- };
112
- update?: {
113
- /**
114
- * Before handler that is called before updating a record.
115
- * This function gives you the access to the record params before saving it, you can perform any update to the params before saving it.
116
- * @returns the params
117
- */
118
- before?: (req: IRequest, params: any, currentUser: Document) => Promise<any>;
119
- /**
120
- * After handler that gives you the access to the updated document.
121
- * @returns the updated document
122
- */
123
- after?: (req: IRequest, document: Document, params: any, currentUser: Document) => Promise<Document>;
124
- /**
125
- * update handler that gives you the access to the run custom update method with custom query.
126
- * @returns saved result with updated document
127
- */
128
- update?: (req: IRequest, record: Document, recordParams: any, currentUser: Document) => Promise<SaveResult<any>>;
129
- /**
130
- * Validators consist of an array of Express ValidationChain, each comprising validation functions that are executed before triggering the update query.
131
- */
132
- validators?: ValidationChain[];
133
- };
134
- show?: {
135
- after?: (req: IRequest, record: Document) => Promise<{
136
- record: Document;
137
- [key: string]: any;
138
- }>;
139
- /**
140
- * A function that is called before getting the next or the previous record. It gives you the access to the filter object.
141
- * @returns The filter object
142
- */
143
- nextPreviousButtonHandler?: (req: IRequest, filter: {
144
- [key: string]: any;
145
- }, currentUser: Document, direction: NeighborTypes) => Promise<{
146
- [key: string]: any;
147
- }>;
148
- };
149
- }
150
- export interface ActionData {
151
- /**
152
- * Record document
153
- */
154
- record: any;
155
- /**
156
- * Current user data
157
- */
158
- currentUser: Document;
159
- /**
160
- * Resource data to which this record belongs
161
- */
162
- resource: {
163
- /**
164
- * Model name of this table.
165
- */
166
- name: string;
167
- /**
168
- * Path of the resource to which you can redirect.
169
- */
170
- path: string;
171
- /**
172
- * Repository of this resource.
173
- */
174
- repository: IRepository<Document>;
175
- };
176
- }
177
- interface IFilters {
178
- /**
179
- * Scope filter props.
180
- * Can be either auto or manual. It cannot be both.
181
- * This filter is not accessible by default
182
- */
183
- scopes?: {
184
- /**
185
- * Specify if this filter is accessible or not
186
- * @default false
187
- */
188
- isAccessible: boolean;
189
- /**
190
- * Automatic scope that filters by the specified key with one of the given options
191
- * This filter works automatically by mentioning the key as saved in the database along with the values that this key can has.
192
- * It doesn't need a handler
193
- */
194
- auto?: IAutoScope;
195
- /**
196
- * Manual scope by using a handler.
197
- * In this case you can put the options you like with specifying in the handler what to do with each option.
198
- */
199
- manual?: IManualScope;
200
- };
201
- /**
202
- * Search bar filter props
203
- */
204
- searchBar?: {
205
- /**
206
- * Specify if this filter is accessible or not
207
- * @default true
208
- */
209
- isAccessible: boolean;
210
- };
211
- }
212
- interface IAutoScope {
213
- /**
214
- * Key of property as specified in the database
215
- */
216
- key: string;
217
- /**
218
- * Array of values that this key can have
219
- */
220
- options: string[];
221
- }
222
- interface IManualScope {
223
- /**
224
- * Array of values that will be appeared in the scope
225
- */
226
- options: string[];
227
- /**
228
- * A handler that will be called when scope filter is used.
229
- * This handler should perform a switch case on the specified options values, each case set the filter on its way.
230
- */
231
- handler: (filter: {
232
- [key: string]: any;
233
- }, scope: string, currentUser: Document) => Promise<{
234
- [key: string]: any;
235
- }>;
236
- }
237
- export interface IFieldValue {
238
- /**
239
- * If the field is required in the schema and you don't want it to be required in the form, you can override this here.
240
- * @default 'same as schema'
241
- */
242
- required?: boolean;
243
- /**
244
- * Specify either this field can be edited or not.
245
- * @default true
246
- */
247
- isEditable?: boolean;
248
- /**
249
- * Specify the type of the field. Can be used for specifying localized string, image,... etc.
250
- * @default 'Same as schema''
251
- */
252
- type?: FieldTypes;
253
- /**
254
- * Specify the enum values if the field type is an enum.
255
- * You can give custom labels with custom background color of the chib as color and label color as labelColor
256
- * @default 'Same as schema''
257
- */
258
- enumValues?: string[] | {
259
- [key: string]: {
260
- label: string;
261
- color: string;
262
- labelColor: string;
263
- };
264
- };
265
- /**
266
- * Specify the allowed country codes.
267
- * @required if the type is phone number
268
- * ex: ["sa", "eg", ...]
269
- */
270
- countryCodes?: string[];
271
- /**
272
- * Specify the array type if the field is of type array.
273
- * @default 'Same as schema''
274
- */
275
- arrayType?: FieldTypes;
276
- /**
277
- * Specify if the array is draggable. Only used when the field type is an array.
278
- * @default 'true''
279
- */
280
- isDraggable?: boolean;
281
- /**
282
- * Can be used only if this field is a reference to the Image collection
283
- */
284
- mediaUploader?: boolean;
285
- /**
286
- * Specify the type of the file to be uploaded. Only required if the media uploader is true.
287
- * @default image
288
- */
289
- fileType?: FileTypes;
290
- /**
291
- * Specify if the date is shown with time or not. Only used if the field type is Date
292
- * @default false
293
- */
294
- withTime?: boolean;
295
- /**
296
- * Specify the api route that to be called for getting the referenced values
297
- * @default undefined
298
- */
299
- apiRoute?: string;
300
- /**
301
- * Path of the value inside the model schema
302
- * @default undefined
303
- */
304
- valuePath?: string;
305
- /**
306
- * Specify if this property is clickable or not in the list view.
307
- * @default undefined
308
- */
309
- isClickable?: boolean;
310
- /**
311
- * Specify the keys that will be shown in the nested schema. Only used when the type is nested schema
312
- * @default undefined
313
- */
314
- keys?: string[];
315
- /**
316
- * Specify the nested schema. Only used if the type is nested schema.
317
- * @default undefined
318
- */
319
- schema?: IModel | {
320
- [key: string]: IFieldValue;
321
- };
322
- }
323
- export interface IVirtualValue {
324
- /**
325
- * For now we have some virtual fields that can be added
326
- * 1) Password: If you want to add password field in the creation form for example
327
- * 2) ref: If it is a one to many realtion. For example, if you want to get all subCatogeries that belong to a category when you show the category record
328
- * 3) array: If this field is an array
329
- */
330
- type: VirtualFieldTypes;
331
- /**
332
- * Array type exists only if the type is array
333
- */
334
- arrayType?: string;
335
- /**
336
- * Defines where this virtaul field need to be appeared
337
- */
338
- showIn: Virtuals;
339
- required: boolean;
340
- /**
341
- * Define Virtual field's resource in case of ref type or array of ref type
342
- */
343
- resource?: Model<any, any>;
344
- /**
345
- * Define Filter query creator required in case of showIn Filter
346
- */
347
- handler?: (filterQuery: {
348
- [key: string]: any;
349
- }, value: any | any[]) => Promise<{
350
- [key: string]: any;
351
- }>;
352
- }
353
- export interface IModel {
354
- /**
355
- * virtual data props
356
- */
357
- virtuals?: {
358
- [key: string]: IVirtualValue;
359
- };
360
- }
361
- interface ActionOptions {
362
- show?: Action;
363
- new?: Action;
364
- edit?: Action;
365
- delete?: Action;
366
- bulkDelete?: Action;
367
- /**
368
- * Any extra action to be added.
369
- */
370
- extras?: ExtraAction[];
371
- }
372
- export interface ExtraAction {
373
- /**
374
- * Key of this action.
375
- * Should be unique in the same resource file
376
- */
377
- key: string;
378
- /**
379
- * Name of this action
380
- */
381
- name: string;
382
- /**
383
- * Icon of this action.
384
- * {@link https://mui.com/material-ui/material-icons/}
385
- */
386
- icon: string;
387
- /**
388
- * Color of the action button
389
- * In case of bulk actions it is one of the button colors. @default inherit
390
- * In case of record actions it is any color like red, green, ... @default black
391
- */
392
- color?: string | ButtonColors;
393
- /**
394
- * Size of the action button. Only used in case of bulk actions
395
- * @default small
396
- */
397
- size?: ButtonSizes;
398
- /**
399
- * Variant of the action button. Only used in case of bulk actions
400
- * @default contained
401
- */
402
- variant?: ButtonVariants;
403
- /**
404
- * Action type if it is record action or resource action.
405
- */
406
- actionType: ActionTypes;
407
- /**
408
- * Guard message title that appears before executing the action to confirm execution.
409
- * @default 'No guard message'
410
- */
411
- guardTitle?: string;
412
- /**
413
- * Guard message body that appears before executing the action to confirm execution.
414
- * @default 'No guard message'
415
- */
416
- guard?: string;
417
- /**
418
- * Alert message appear after executing this action.
419
- * @default 'Action was executed successfully'
420
- */
421
- message?: string;
422
- /**
423
- * The severity of the alert. This defines the color and icon used.
424
- * @default 'success'
425
- */
426
- severity?: Severity;
427
- /**
428
- * Specify if you need the dialog to be in full screen or not. Used only in case of custom component strategy
429
- * @default 'false'
430
- */
431
- fullScreen?: boolean;
432
- /**
433
- * @returns boolean value.
434
- * This value Specifies to which records should this action appears.
435
- * @default 'Action is shown to all records'
436
- */
437
- isVisible?: (data: ActionData) => Promise<boolean>;
438
- /**
439
- * Handler function that is executed after clicking the action.
440
- */
441
- handler: (req: IRequest, res: any, data: ActionData) => Promise<IActionHandlerResponse>;
442
- /**
443
- * Icon of this action.
444
- * {@link https://mui.com/material-ui/material-icons/}
445
- */
446
- handlerStrategy?: HandlerStrategy;
447
- /**
448
- * The property that manages which action will be extracted from action menu in list.
449
- * @default true for edit and show false for others
450
- */
451
- isMainAction?: boolean;
452
- }
453
- export interface IActionHandlerResponse {
454
- /**
455
- * The action taken after executing the action.
456
- * For example, if you would like to go to list after executing the action, just set this value by list
457
- */
458
- action: ActionNames;
459
- /**
460
- * Path of the resource that is intended to redirect.
461
- * Is set to resource.path if you would like to be in the same table
462
- */
463
- path: string;
464
- /**
465
- * Id of the record that is used in actions that needs record id like show or edit
466
- */
467
- recordId?: string;
468
- /**
469
- * Path of the uploaded file in case of file download handling strategy
470
- */
471
- filePath?: string;
472
- }
473
- export interface IResourceFile {
474
- properties: {
475
- /**
476
- * The model
477
- */
478
- resource: Model<any, any>;
479
- /**
480
- * Model name as saved in the data base.
481
- */
482
- modelName: string;
483
- /**
484
- * Name of this model appeared on the nav bar.
485
- * @default 'Model name'
486
- */
487
- name?: string;
488
- /**
489
- * Property of this table that is shown as the link for the record.
490
- * Used to be searched by in the search bar.
491
- * If not mentioned explicitly, a search is done on the schema to check for property title, name, or email.
492
- * If these properties are not found, _id is taken.
493
- */
494
- title?: string;
495
- /**
496
- * The property to be sorted by the documents.
497
- * @default 'The schema title'
498
- */
499
- defaultOrderBy?: string;
500
- /**
501
- * The property that controls the permission of this model according to the current user role.
502
- * Specify either this user is allowed to see this model or not.
503
- * @default true
504
- */
505
- isAllowed?: (currentUser: Document) => Promise<boolean>;
506
- /**
507
- * The property that controls the visibility of this resource in the nav bar
508
- * @default true
509
- */
510
- isVisible?: (currentUser: Document) => Promise<boolean>;
511
- /**
512
- * The default order
513
- * @default asc
514
- */
515
- defaultOrder?: orderTypes;
516
- /**
517
- * Number of rows per page
518
- * @default 10
519
- */
520
- defaultrowsPerPage?: number;
521
- /**
522
- * The parent that this model is belong to in the nav bar.
523
- * @default 'Set up parent'
524
- */
525
- parent?: Parent;
526
- /**
527
- * Array of fields that are completely hidden from all pages
528
- */
529
- hiddenProperties?: string[];
530
- /**
531
- * Action options for overriding existing actions accessibility or adding custom actions
532
- */
533
- actions?: ActionOptions;
534
- /**
535
- * Filters options
536
- */
537
- filters?: IFilters;
538
- /**
539
- * Using before or after handlers of any crud operation
540
- */
541
- crudOperations?: ICrudOperations;
542
- /**
543
- * Translation object of the fields' names.
544
- */
545
- keysTranslations?: {
546
- [key: string]: any;
547
- };
548
- /**
549
- * Translation object of the actions' names.
550
- */
551
- actionsTranslations?: {
552
- [key: string]: any;
553
- };
554
- /**
555
- * Override some props of a field's schema structure
556
- * Add a new virtual property
557
- */
558
- model?: {
559
- [key: string]: IFieldValue;
560
- } | IModel;
561
- /**
562
- * Override the populated object
563
- */
564
- populate?: IPopulate;
565
- /**
566
- * Disable the display of next and previous buttons in the show page
567
- * @default false
568
- */
569
- disableNextPreviousButtonsInShowPage?: boolean;
570
- /**
571
- * Disable the display of next and previous buttons in the edit page
572
- * @default false
573
- */
574
- disableNextPreviousButtonsInEditPage?: boolean;
575
- /**
576
- * The option to display the edit page instead of the show page
577
- * @default false
578
- */
579
- displayEditPageInShowPage?: boolean;
580
- /**
581
- * Specify the path of image to be shown beside the name in the reference options
582
- * @default undefined
583
- */
584
- imageOnReferencePath?: string;
585
- /**
586
- * The option to disable displaying the image beside the name in the reference options
587
- * @default false
588
- */
589
- disableImageOnReference?: boolean;
590
- /**
591
- * An object for any extra data need to be sent with the resource file
592
- * @default undefined
593
- */
594
- extras?: {
595
- [key: string]: any;
596
- };
597
- };
598
- /**
599
- * Array of properties that should be appeared in the list action.
600
- * @default 'The whole fields'
601
- */
602
- listProperties?: string[];
603
- /**
604
- * Arrays of properties that should be appeared in the show action.
605
- * @default 'The whole fields'
606
- */
607
- showProperties?: string[];
608
- /**
609
- * Array of properties that should be appeared in the create/edit form.
610
- * @default 'The whole fields'
611
- */
612
- formProperties?: string[];
613
- /**
614
- * Array of properties that should be appeared in the filter.
615
- * @default 'The whole fields'
616
- */
617
- filterProperties?: string[];
618
- /**
619
- * Array of properties that should be appeared in the quick filters.
620
- * @default 'Empty array'
621
- */
622
- quickFilterProperties?: string[];
623
- }
624
- export {};
1
+ import { ValidationChain } from 'express-validator';
2
+ import { Document, Model } from 'mongoose';
3
+ import { IRequest } from '../middlewares/isAuth';
4
+ import { IRepository, PageInfo, PaginateParams } from '../repositories/Repository';
5
+ import SaveResult from '../repositories/SaveResult';
6
+ import { ActionNames, ActionTypes, FieldTypes, FileTypes, HandlerStrategy, NeighborTypes, Virtuals } from './helpers';
7
+ declare type orderTypes = 'asc' | 'desc';
8
+ declare type VirtualFieldTypes = 'password' | 'ref' | 'Array';
9
+ declare type Severity = 'success' | 'info' | 'warning' | 'error';
10
+ declare type ButtonColors = 'inherit' | 'primary' | 'secondary' | 'success' | 'error' | 'info' | 'warning';
11
+ declare type ButtonVariants = 'text' | 'outlined' | 'contained';
12
+ declare type ButtonSizes = 'small' | 'medium' | 'large';
13
+ declare type PopulateFunction = (populatedString: any) => Promise<any>;
14
+ interface Parent {
15
+ /**
16
+ * Name of the parent
17
+ */
18
+ name: string;
19
+ /**
20
+ * Icon of the parent. You can get the icons from
21
+ * {@link https://mui.com/material-ui/material-icons/}
22
+ */
23
+ icon: string;
24
+ }
25
+ interface IPopulate {
26
+ /**
27
+ * This function is called for all the endpoints to have an access over the populated string
28
+ */
29
+ all?: PopulateFunction;
30
+ /**
31
+ * This function is called for the list endpoint to have an access over the populated string
32
+ */
33
+ list?: PopulateFunction;
34
+ /**
35
+ * This function is called for the get one endpoint either in show or form an access over the populated string
36
+ */
37
+ show?: PopulateFunction;
38
+ }
39
+ interface Action {
40
+ /**
41
+ * Specify if this action is accessible or not.
42
+ * @default True for show, edit, delete, and new.
43
+ * @default false for bulk delete.
44
+ * You can ovveride any of these values here.
45
+ */
46
+ isAccessible?: boolean;
47
+ /**
48
+ * Specify if the page requires to be reloaded after executing the action
49
+ * @default Fale for show, edit, delete, and new.
50
+ */
51
+ reloadAfterAction?: boolean;
52
+ /**
53
+ * The property that manages which admin role can use this action.
54
+ * This function's result alters the isAccessible value. So no need to use both properties.
55
+ * If both are used then isAccessible has the higher priority.
56
+ * @default 'Same as isAccessible'
57
+ */
58
+ isAllowed?: (currentUser: Document) => boolean;
59
+ /**
60
+ * The property that manages which action will be extracted from action menu in list.
61
+ * @default true for edit and show false for others
62
+ */
63
+ isMainAction?: boolean;
64
+ }
65
+ interface ICrudOperations {
66
+ index?: {
67
+ /**
68
+ * Before handler that gives you the access to the filter object.
69
+ * You can add to the filter object any key and value that will be used in the filter query before getting the records for list.
70
+ * @returns the filter object
71
+ */
72
+ before?: (req: IRequest, filter: {
73
+ [key: string]: any;
74
+ }, currentUser: Document) => Promise<{
75
+ [key: string]: any;
76
+ }>;
77
+ /**
78
+ * After handler that gives you the access to the array of documents.
79
+ * @returns the array of documents
80
+ */
81
+ after?: (req: IRequest, documents: Document[], currentUser: Document) => Promise<Document[]>;
82
+ /**
83
+ * index handler that gives you the access to the run custom index method with custom query.
84
+ * @returns result list of records
85
+ */
86
+ index?: (req: IRequest, filter: {
87
+ [key: string]: any;
88
+ }, sortQuery: {
89
+ [key: string]: any;
90
+ }, paginateParams: PaginateParams | undefined, populate: any, currentUser: Document) => Promise<{
91
+ records: Document[];
92
+ pageInfo?: PageInfo;
93
+ }>;
94
+ };
95
+ create?: {
96
+ /**
97
+ * Before handler that is called before creating a new record.
98
+ * This function gives you the access to the record params before saving it, you can perform any update to the params before saving it.
99
+ * @returns the params
100
+ */
101
+ before?: (req: IRequest, params: any, currentUser: Document) => Promise<any>;
102
+ /**
103
+ * After handler that gives you the access to the saved document.
104
+ * @returns the saved document
105
+ */
106
+ after?: (req: IRequest, document: Document, currentUser: Document, params: any) => Promise<Document>;
107
+ /**
108
+ * Validators consist of an array of Express ValidationChain, each comprising validation functions that are executed before triggering the save query.
109
+ */
110
+ validators?: ValidationChain[];
111
+ };
112
+ update?: {
113
+ /**
114
+ * Before handler that is called before updating a record.
115
+ * This function gives you the access to the record params before saving it, you can perform any update to the params before saving it.
116
+ * @returns the params
117
+ */
118
+ before?: (req: IRequest, params: any, currentUser: Document) => Promise<any>;
119
+ /**
120
+ * After handler that gives you the access to the updated document.
121
+ * @returns the updated document
122
+ */
123
+ after?: (req: IRequest, document: Document, params: any, currentUser: Document) => Promise<Document>;
124
+ /**
125
+ * update handler that gives you the access to the run custom update method with custom query.
126
+ * @returns saved result with updated document
127
+ */
128
+ update?: (req: IRequest, record: Document, recordParams: any, currentUser: Document) => Promise<SaveResult<any>>;
129
+ /**
130
+ * Validators consist of an array of Express ValidationChain, each comprising validation functions that are executed before triggering the update query.
131
+ */
132
+ validators?: ValidationChain[];
133
+ };
134
+ show?: {
135
+ after?: (req: IRequest, record: Document) => Promise<{
136
+ record: Document;
137
+ [key: string]: any;
138
+ }>;
139
+ /**
140
+ * A function that is called before getting the next or the previous record. It gives you the access to the filter object.
141
+ * @returns The filter object
142
+ */
143
+ nextPreviousButtonHandler?: (req: IRequest, filter: {
144
+ [key: string]: any;
145
+ }, currentUser: Document, direction: NeighborTypes) => Promise<{
146
+ [key: string]: any;
147
+ }>;
148
+ };
149
+ }
150
+ export interface ActionData {
151
+ /**
152
+ * Record document
153
+ */
154
+ record: any;
155
+ /**
156
+ * Current user data
157
+ */
158
+ currentUser: Document;
159
+ /**
160
+ * Resource data to which this record belongs
161
+ */
162
+ resource: {
163
+ /**
164
+ * Model name of this table.
165
+ */
166
+ name: string;
167
+ /**
168
+ * Path of the resource to which you can redirect.
169
+ */
170
+ path: string;
171
+ /**
172
+ * Repository of this resource.
173
+ */
174
+ repository: IRepository<Document>;
175
+ };
176
+ }
177
+ interface IFilters {
178
+ /**
179
+ * Scope filter props.
180
+ * Can be either auto or manual. It cannot be both.
181
+ * This filter is not accessible by default
182
+ */
183
+ scopes?: {
184
+ /**
185
+ * Specify if this filter is accessible or not
186
+ * @default false
187
+ */
188
+ isAccessible: boolean;
189
+ /**
190
+ * Automatic scope that filters by the specified key with one of the given options
191
+ * This filter works automatically by mentioning the key as saved in the database along with the values that this key can has.
192
+ * It doesn't need a handler
193
+ */
194
+ auto?: IAutoScope;
195
+ /**
196
+ * Manual scope by using a handler.
197
+ * In this case you can put the options you like with specifying in the handler what to do with each option.
198
+ */
199
+ manual?: IManualScope;
200
+ };
201
+ /**
202
+ * Search bar filter props
203
+ */
204
+ searchBar?: {
205
+ /**
206
+ * Specify if this filter is accessible or not
207
+ * @default true
208
+ */
209
+ isAccessible: boolean;
210
+ };
211
+ }
212
+ interface IAutoScope {
213
+ /**
214
+ * Key of property as specified in the database
215
+ */
216
+ key: string;
217
+ /**
218
+ * Array of values that this key can have
219
+ */
220
+ options: string[];
221
+ }
222
+ interface IManualScope {
223
+ /**
224
+ * Array of values that will be appeared in the scope
225
+ */
226
+ options: string[];
227
+ /**
228
+ * A handler that will be called when scope filter is used.
229
+ * This handler should perform a switch case on the specified options values, each case set the filter on its way.
230
+ */
231
+ handler: (filter: {
232
+ [key: string]: any;
233
+ }, scope: string, currentUser: Document) => Promise<{
234
+ [key: string]: any;
235
+ }>;
236
+ }
237
+ export interface IFieldValue {
238
+ /**
239
+ * If the field is required in the schema and you don't want it to be required in the form, you can override this here.
240
+ * @default 'same as schema'
241
+ */
242
+ required?: boolean;
243
+ /**
244
+ * Specify either this field can be edited or not.
245
+ * @default true
246
+ */
247
+ isEditable?: boolean;
248
+ /**
249
+ * Specify the type of the field. Can be used for specifying localized string, image,... etc.
250
+ * @default 'Same as schema''
251
+ */
252
+ type?: FieldTypes;
253
+ /**
254
+ * Specify the enum values if the field type is an enum.
255
+ * You can give custom labels with custom background color of the chib as color and label color as labelColor
256
+ * @default 'Same as schema''
257
+ */
258
+ enumValues?: string[] | {
259
+ [key: string]: {
260
+ label: string;
261
+ color: string;
262
+ labelColor: string;
263
+ };
264
+ };
265
+ /**
266
+ * Specify the allowed country codes.
267
+ * @required if the type is phone number
268
+ * ex: ["sa", "eg", ...]
269
+ */
270
+ countryCodes?: string[];
271
+ /**
272
+ * Specify the array type if the field is of type array.
273
+ * @default 'Same as schema''
274
+ */
275
+ arrayType?: FieldTypes;
276
+ /**
277
+ * Specify if the array is draggable. Only used when the field type is an array.
278
+ * @default 'true''
279
+ */
280
+ isDraggable?: boolean;
281
+ /**
282
+ * Can be used only if this field is a reference to the Image collection
283
+ */
284
+ mediaUploader?: boolean;
285
+ /**
286
+ * Specify the type of the file to be uploaded. Only required if the media uploader is true.
287
+ * @default image
288
+ */
289
+ fileType?: FileTypes;
290
+ /**
291
+ * Specify if the date is shown with time or not. Only used if the field type is Date
292
+ * @default false
293
+ */
294
+ withTime?: boolean;
295
+ /**
296
+ * Specify the api route that to be called for getting the referenced values
297
+ * @default undefined
298
+ */
299
+ apiRoute?: string;
300
+ /**
301
+ * Path of the value inside the model schema
302
+ * @default undefined
303
+ */
304
+ valuePath?: string;
305
+ /**
306
+ * Specify if this property is clickable or not in the list view.
307
+ * @default undefined
308
+ */
309
+ isClickable?: boolean;
310
+ /**
311
+ * Specify the keys that will be shown in the nested schema. Only used when the type is nested schema
312
+ * @default undefined
313
+ */
314
+ keys?: string[];
315
+ /**
316
+ * Specify the nested schema. Only used if the type is nested schema.
317
+ * @default undefined
318
+ */
319
+ schema?: IModel | {
320
+ [key: string]: IFieldValue;
321
+ };
322
+ /**
323
+ * Specify if this field is filtered by multiple values not only one value. Only used if this value is one of the quick filters.
324
+ * @default undefined
325
+ */
326
+ multipleInFilter?: boolean;
327
+ }
328
+ export interface IVirtualValue {
329
+ /**
330
+ * For now we have some virtual fields that can be added
331
+ * 1) Password: If you want to add password field in the creation form for example
332
+ * 2) ref: If it is a one to many realtion. For example, if you want to get all subCatogeries that belong to a category when you show the category record
333
+ * 3) array: If this field is an array
334
+ */
335
+ type: VirtualFieldTypes;
336
+ /**
337
+ * Array type exists only if the type is array
338
+ */
339
+ arrayType?: string;
340
+ /**
341
+ * Defines where this virtaul field need to be appeared
342
+ */
343
+ showIn: Virtuals;
344
+ required: boolean;
345
+ /**
346
+ * Define Virtual field's resource in case of ref type or array of ref type
347
+ */
348
+ resource?: Model<any, any>;
349
+ /**
350
+ * Define Filter query creator required in case of showIn Filter
351
+ */
352
+ handler?: (filterQuery: {
353
+ [key: string]: any;
354
+ }, value: any | any[]) => Promise<{
355
+ [key: string]: any;
356
+ }>;
357
+ }
358
+ export interface IModel {
359
+ /**
360
+ * virtual data props
361
+ */
362
+ virtuals?: {
363
+ [key: string]: IVirtualValue;
364
+ };
365
+ }
366
+ interface ActionOptions {
367
+ show?: Action;
368
+ new?: Action;
369
+ edit?: Action;
370
+ delete?: Action;
371
+ bulkDelete?: Action;
372
+ /**
373
+ * Any extra action to be added.
374
+ */
375
+ extras?: ExtraAction[];
376
+ }
377
+ export interface ExtraAction {
378
+ /**
379
+ * Key of this action.
380
+ * Should be unique in the same resource file
381
+ */
382
+ key: string;
383
+ /**
384
+ * Name of this action
385
+ */
386
+ name: string;
387
+ /**
388
+ * Icon of this action.
389
+ * {@link https://mui.com/material-ui/material-icons/}
390
+ */
391
+ icon: string;
392
+ /**
393
+ * Color of the action button
394
+ * In case of bulk actions it is one of the button colors. @default inherit
395
+ * In case of record actions it is any color like red, green, ... @default black
396
+ */
397
+ color?: string | ButtonColors;
398
+ /**
399
+ * Size of the action button. Only used in case of bulk actions
400
+ * @default small
401
+ */
402
+ size?: ButtonSizes;
403
+ /**
404
+ * Variant of the action button. Only used in case of bulk actions
405
+ * @default contained
406
+ */
407
+ variant?: ButtonVariants;
408
+ /**
409
+ * Action type if it is record action or resource action.
410
+ */
411
+ actionType: ActionTypes;
412
+ /**
413
+ * Guard message title that appears before executing the action to confirm execution.
414
+ * @default 'No guard message'
415
+ */
416
+ guardTitle?: string;
417
+ /**
418
+ * Guard message body that appears before executing the action to confirm execution.
419
+ * @default 'No guard message'
420
+ */
421
+ guard?: string;
422
+ /**
423
+ * Alert message appear after executing this action.
424
+ * @default 'Action was executed successfully'
425
+ */
426
+ message?: string;
427
+ /**
428
+ * The severity of the alert. This defines the color and icon used.
429
+ * @default 'success'
430
+ */
431
+ severity?: Severity;
432
+ /**
433
+ * Specify if you need the dialog to be in full screen or not. Used only in case of custom component strategy
434
+ * @default 'false'
435
+ */
436
+ fullScreen?: boolean;
437
+ /**
438
+ * @returns boolean value.
439
+ * This value Specifies to which records should this action appears.
440
+ * @default 'Action is shown to all records'
441
+ */
442
+ isVisible?: (data: ActionData) => Promise<boolean>;
443
+ /**
444
+ * Handler function that is executed after clicking the action.
445
+ */
446
+ handler: (req: IRequest, res: any, data: ActionData) => Promise<IActionHandlerResponse>;
447
+ /**
448
+ * Icon of this action.
449
+ * {@link https://mui.com/material-ui/material-icons/}
450
+ */
451
+ handlerStrategy?: HandlerStrategy;
452
+ /**
453
+ * The property that manages which action will be extracted from action menu in list.
454
+ * @default true for edit and show false for others
455
+ */
456
+ isMainAction?: boolean;
457
+ }
458
+ export interface IActionHandlerResponse {
459
+ /**
460
+ * The action taken after executing the action.
461
+ * For example, if you would like to go to list after executing the action, just set this value by list
462
+ */
463
+ action: ActionNames;
464
+ /**
465
+ * Path of the resource that is intended to redirect.
466
+ * Is set to resource.path if you would like to be in the same table
467
+ */
468
+ path: string;
469
+ /**
470
+ * Id of the record that is used in actions that needs record id like show or edit
471
+ */
472
+ recordId?: string;
473
+ /**
474
+ * Path of the uploaded file in case of file download handling strategy
475
+ */
476
+ filePath?: string;
477
+ }
478
+ export interface IResourceFile {
479
+ properties: {
480
+ /**
481
+ * The model
482
+ */
483
+ resource: Model<any, any>;
484
+ /**
485
+ * Model name as saved in the data base.
486
+ */
487
+ modelName: string;
488
+ /**
489
+ * Name of this model appeared on the nav bar.
490
+ * @default 'Model name'
491
+ */
492
+ name?: string;
493
+ /**
494
+ * Property of this table that is shown as the link for the record.
495
+ * Used to be searched by in the search bar.
496
+ * If not mentioned explicitly, a search is done on the schema to check for property title, name, or email.
497
+ * If these properties are not found, _id is taken.
498
+ */
499
+ title?: string;
500
+ /**
501
+ * The property to be sorted by the documents.
502
+ * @default 'The schema title'
503
+ */
504
+ defaultOrderBy?: string;
505
+ /**
506
+ * The property that controls the permission of this model according to the current user role.
507
+ * Specify either this user is allowed to see this model or not.
508
+ * @default true
509
+ */
510
+ isAllowed?: (currentUser: Document) => Promise<boolean>;
511
+ /**
512
+ * The property that controls the visibility of this resource in the nav bar
513
+ * @default true
514
+ */
515
+ isVisible?: (currentUser: Document) => Promise<boolean>;
516
+ /**
517
+ * The default order
518
+ * @default asc
519
+ */
520
+ defaultOrder?: orderTypes;
521
+ /**
522
+ * Number of rows per page
523
+ * @default 10
524
+ */
525
+ defaultrowsPerPage?: number;
526
+ /**
527
+ * The parent that this model is belong to in the nav bar.
528
+ * @default 'Set up parent'
529
+ */
530
+ parent?: Parent;
531
+ /**
532
+ * Array of fields that are completely hidden from all pages
533
+ */
534
+ hiddenProperties?: string[];
535
+ /**
536
+ * Action options for overriding existing actions accessibility or adding custom actions
537
+ */
538
+ actions?: ActionOptions;
539
+ /**
540
+ * Filters options
541
+ */
542
+ filters?: IFilters;
543
+ /**
544
+ * Using before or after handlers of any crud operation
545
+ */
546
+ crudOperations?: ICrudOperations;
547
+ /**
548
+ * Translation object of the fields' names.
549
+ */
550
+ keysTranslations?: {
551
+ [key: string]: any;
552
+ };
553
+ /**
554
+ * Translation object of the actions' names.
555
+ */
556
+ actionsTranslations?: {
557
+ [key: string]: any;
558
+ };
559
+ /**
560
+ * Override some props of a field's schema structure
561
+ * Add a new virtual property
562
+ */
563
+ model?: {
564
+ [key: string]: IFieldValue;
565
+ } | IModel;
566
+ /**
567
+ * Override the populated object
568
+ */
569
+ populate?: IPopulate;
570
+ /**
571
+ * Disable the display of next and previous buttons in the show page
572
+ * @default false
573
+ */
574
+ disableNextPreviousButtonsInShowPage?: boolean;
575
+ /**
576
+ * Disable the display of next and previous buttons in the edit page
577
+ * @default false
578
+ */
579
+ disableNextPreviousButtonsInEditPage?: boolean;
580
+ /**
581
+ * The option to display the edit page instead of the show page
582
+ * @default false
583
+ */
584
+ displayEditPageInShowPage?: boolean;
585
+ /**
586
+ * Specify the path of image to be shown beside the name in the reference options
587
+ * @default undefined
588
+ */
589
+ imageOnReferencePath?: string;
590
+ /**
591
+ * The option to disable displaying the image beside the name in the reference options
592
+ * @default false
593
+ */
594
+ disableImageOnReference?: boolean;
595
+ /**
596
+ * An object for any extra data need to be sent with the resource file
597
+ * @default undefined
598
+ */
599
+ extras?: {
600
+ [key: string]: any;
601
+ };
602
+ };
603
+ /**
604
+ * Array of properties that should be appeared in the list action.
605
+ * @default 'The whole fields'
606
+ */
607
+ listProperties?: string[];
608
+ /**
609
+ * Arrays of properties that should be appeared in the show action.
610
+ * @default 'The whole fields'
611
+ */
612
+ showProperties?: string[];
613
+ /**
614
+ * Array of properties that should be appeared in the create/edit form.
615
+ * @default 'The whole fields'
616
+ */
617
+ formProperties?: string[];
618
+ /**
619
+ * Array of properties that should be appeared in the filter.
620
+ * @default 'The whole fields'
621
+ */
622
+ filterProperties?: string[];
623
+ /**
624
+ * Array of properties that should be appeared in the quick filters.
625
+ * @default 'Empty array'
626
+ */
627
+ quickFilterProperties?: string[];
628
+ }
629
+ export {};