identity-admin-ui 1.11.45 → 1.11.47

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/lib/index.d.ts CHANGED
@@ -1,876 +1,880 @@
1
- /// <reference types="react" />
2
- import * as react_jsx_runtime from 'react/jsx-runtime';
3
- import * as react from 'react';
4
- import { ReactElement, ReactNode, Dispatch, SetStateAction } from 'react';
5
- import { GridCellParams, GridRenderCellParams, GridDensity, GridSortDirection, GridRowSelectionModel } from '@mui/x-data-grid';
6
- import * as axios from 'axios';
7
- import { AxiosRequestConfig } from 'axios';
8
- import * as _mui_system from '@mui/system';
9
- import * as _mui_material from '@mui/material';
10
- import { SxProps, AlertColor as AlertColor$1 } from '@mui/material';
11
- import * as notistack from 'notistack';
12
- import { SnackbarOrigin } from 'notistack';
13
-
14
- type TLink = {
15
- href?: string;
16
- name: string;
17
- icon?: ReactElement;
18
- };
19
-
20
- interface IdentityPageProps {
21
- variant: PageVariant;
22
- loading: boolean;
23
- data: any;
24
- taptitle: string;
25
- headingTitle: string;
26
- enableDefaultActions?: boolean;
27
- BreadCrumbLinks?: (props: any) => TLink[];
28
- themeStretch?: boolean;
29
- Component?: (props: any) => JSX.Element;
30
- DefaultActions: (props: any) => JSX.Element;
31
- LoadingSkelton: () => JSX.Element;
32
- Actions: (props: any) => JSX.Element;
33
- HeadingView: (props: any) => JSX.Element;
34
- BreadcrumbsChildren?: (props: any) => JSX.Element;
35
- }
36
- declare enum PageVariant {
37
- LIST = "List",
38
- SHOW = "Show",
39
- FORM = "Form",
40
- CUSTOM = "Custom"
41
- }
42
-
43
- declare const IdentityPage: (props: IdentityPageProps) => react_jsx_runtime.JSX.Element;
44
-
45
- declare const ApiContext: react.Context<ApiContextProps>;
46
- interface ApiContextProps {
47
- statusCode: number | null;
48
- dashbaordUrlPrefix?: string;
49
- }
50
- interface ApiContextConfig {
51
- language: string;
52
- baseUrl: string;
53
- onLogout: () => void;
54
- sleepTime?: number;
55
- children: any;
56
- dashbaordUrlPrefix?: string;
57
- }
58
- declare const ApiContextProvider: (props: ApiContextConfig) => react_jsx_runtime.JSX.Element;
59
-
60
- declare enum RequestState {
61
- IDLE = "idle",
62
- LOADING = "loading",
63
- SUCCEEDED = "succeeded",
64
- FAILED = "failed"
65
- }
66
- interface IState<T> {
67
- data: T | undefined;
68
- state: RequestState;
69
- error?: any | null;
70
- }
71
- declare class State<T> {
72
- data: T | undefined;
73
- state: RequestState;
74
- error?: any;
75
- private constructor();
76
- static idle<T>(data?: T): IState<T>;
77
- static loading<T>(data?: T): IState<T>;
78
- static succeeded<T>(data: T): IState<T>;
79
- static error<T>(error: any, data?: T): IState<T>;
80
- }
81
-
82
- declare enum ActionNames {
83
- SHOW = "SHOW",
84
- LIST = "LIST",
85
- NEW = "NEW",
86
- EDIT = "EDIT"
87
- }
88
- declare enum ActionTypes {
89
- RECORD = "RECORD",
90
- Resource = "RESOUCRE"
91
- }
92
- declare enum FieldTypes {
93
- STRING = "String",
94
- NUMBER = "Number",
95
- ENUM = "enum",
96
- REFERENCE = "ref",
97
- DATE = "Date",
98
- PASSWORD = "password",
99
- BOOLEAN = "Boolean",
100
- OBJECTID = "ObjectID",
101
- NESTEDSCHEMA = "nestedSchema",
102
- ARRAY = "Array",
103
- IMAGE = "image",
104
- LOCALIZEDString = "localizedString",
105
- PHONENUMBER = "phoneNumber",
106
- COLOR = "color",
107
- TIMEPICKER = "timePicker",
108
- FILE = "File",
109
- LOCATION = "LOCATION",
110
- RICH_TEXT_I = "RICH_TEXT_I",
111
- RICH_TEXT_II = "RICH_TEXT_II",
112
- EXTERNAL_LINK = "EXTERNAL_LINK",
113
- MULTIPLE_TEXT = "MULTIPLE_TEXT"
114
- }
115
- declare enum HandlerStrategy {
116
- NORMAL = "NORMAL",
117
- FILE_DOWNLOAD = "FILE_DOWNLOAD",
118
- CUSTOM_COMPONENT = "CUSTOM_COMPONENT"
119
- }
120
-
121
- type SizeType = 'small' | 'medium' | undefined;
122
- declare enum FileTypes {
123
- ALL = "ALL",
124
- IMAGE = "IMAGE",
125
- _3D = "3D",
126
- PDF = "PDF",
127
- EXCEL = "EXCEL",
128
- WORD = "WORD",
129
- VIDEO = "VIDEO",
130
- TEXT = "TEXT",
131
- ZIP = "ZIP",
132
- POWER_POINT = "POWER_POINT",
133
- AUDIO = "AUDIO"
134
- }
135
- declare enum ImageOptimizingCategories {
136
- NORMAL = "NORMAL",
137
- BANNERS = "BANNERS"
138
- }
139
-
140
- interface IResource {
141
- filterProperties: string[];
142
- quickFilterProperties: string[];
143
- formProperties: string[];
144
- listProperties: IProperty[];
145
- showProperties: IProperty[];
146
- properties: IMainProperty;
147
- permissions?: {
148
- [permissionKey: string]: boolean;
149
- };
150
- }
151
- interface IOptionalResource {
152
- filterProperties?: string[];
153
- quickFilterProperties?: string[];
154
- formProperties?: string[];
155
- listProperties?: IProperty[];
156
- showProperties?: IProperty[];
157
- properties?: IMainProperty;
158
- }
159
- /**
160
- * Interface representing a property within a resource schema.
161
- * Each `IProperty` defines metadata about a field, including its key,
162
- * display value, optional path, and an optional custom cell renderer for grid components.
163
- */
164
- interface IProperty {
165
- /**
166
- * The unique key identifier for the property.
167
- * Used to reference the property within the schema and data records.
168
- */
169
- key: string;
170
- /**
171
- * Display value for the property, often used as a label or title.
172
- */
173
- value: string;
174
- /**
175
- * Optional path for the property, typically representing a route or URL for accessing related resources.
176
- */
177
- path?: string;
178
- /**
179
- * Optional function to render a custom cell in a grid component.
180
- * Accepts `GridCellParams` as an argument and returns a JSX element.
181
- * Useful for custom cell formatting or interactive elements.
182
- */
183
- renderCell?: (params: GridCellParams) => JSX.Element;
184
- }
185
- interface IMainProperty {
186
- title: string;
187
- path: string;
188
- name: string;
189
- modelName: string;
190
- parent: IParent;
191
- defaultOrder: orderTypes;
192
- defaultOrderBy: string;
193
- defaultrowsPerPage: number;
194
- filters: IFilter;
195
- actions: IAction;
196
- model: {
197
- [key: string]: ISchemaObject;
198
- };
199
- disableNextPreviousButtonsInShowPage?: boolean;
200
- disableNextPreviousButtonsInEditPage?: boolean;
201
- displayEditPageInShowPage?: boolean;
202
- imageOnReferencePath?: string;
203
- disableImageOnReference?: string;
204
- }
205
- interface IParent {
206
- icon: string;
207
- name: string;
208
- value: string;
209
- }
210
- interface IFilter {
211
- scopes: {
212
- isAccessible: boolean;
213
- showAll?: boolean;
214
- options?: {
215
- key: string;
216
- value: string;
217
- }[];
218
- manual?: {
219
- options: string[];
220
- };
221
- auto?: {
222
- key: string;
223
- options: string[];
224
- };
225
- };
226
- searchBar: {
227
- isAccessible: boolean;
228
- };
229
- }
230
- interface IAction {
231
- bulkDelete: IDeleteActionMin;
232
- delete: IDeleteActionMin;
233
- edit: IActionMin;
234
- new: IActionMin;
235
- show: IActionMin;
236
- extras?: IExtras;
237
- }
238
- interface IExtras {
239
- record: {
240
- [key: string]: IExtarAction;
241
- };
242
- resource: {
243
- [key: string]: IExtarAction;
244
- };
245
- }
246
- interface IExtarAction {
247
- actionType: ActionTypes;
248
- guard?: string;
249
- icon: string;
250
- key: string;
251
- keys?: string[];
252
- name: string;
253
- severity?: Severity;
254
- message?: string;
255
- guardTitle?: string;
256
- }
257
- interface IActionMin {
258
- isAccessible: boolean;
259
- value: string;
260
- }
261
- interface IDeleteActionMin extends IActionMin {
262
- cancelDeleteOption: string;
263
- confirmDeleteOption: string;
264
- confirmationMessageBody: string;
265
- confirmationMessageTitle: string;
266
- }
267
- type orderTypes = 'asc' | 'desc';
268
- type Severity = 'success' | 'info' | 'warning' | 'error';
269
- interface ISchemaObject {
270
- required?: boolean;
271
- isEditable?: boolean;
272
- type?: FieldTypes;
273
- enumValues?: string[];
274
- countryCodes?: string[];
275
- arrayType?: FieldTypes;
276
- isDraggable?: boolean;
277
- value?: string;
278
- mediaUploader?: boolean;
279
- fileType?: FileTypes;
280
- withTime?: boolean;
281
- apiRoute?: string;
282
- defaultValue: string;
283
- valuePath?: string;
284
- path?: string;
285
- keys?: string[];
286
- schema?: {
287
- [key: string]: ISchemaObject;
288
- };
289
- isClickable?: boolean;
290
- multipleInFilter?: boolean;
291
- }
292
-
293
- type ResourceResponse = {
294
- [key: string]: IResource | {
295
- [key: string]: string[];
296
- };
297
- } | {
298
- [key: string]: any;
299
- } | null | undefined;
300
- declare const ResourcesContext: react.Context<{
301
- resources: ResourceResponse;
302
- getResources: () => void;
303
- state: RequestState;
304
- clearResources: () => void;
305
- loadingLogo?: string | undefined;
306
- logoSxProps?: SxProps | undefined;
307
- }>;
308
- interface ResourcesContextConfig {
309
- resourcesUrl: string;
310
- laodingLogo?: string;
311
- logoSxProps?: SxProps;
312
- children: any;
313
- }
314
- declare const ResourcesContextProvider: (props: ResourcesContextConfig) => react_jsx_runtime.JSX.Element;
315
-
316
- interface ResourcePaths {
317
- root: string;
318
- list: string;
319
- edit: (id: string) => string;
320
- show: (id: string) => string;
321
- new: string;
322
- }
323
- interface PathsContextConfig {
324
- root: string;
325
- home: string;
326
- children: any;
327
- }
328
- declare const PathsContext: react.Context<{
329
- paths: {
330
- [key: string]: ResourcePaths;
331
- };
332
- root: string;
333
- home: string;
334
- }>;
335
- declare const PathsContextProvider: (props: PathsContextConfig) => react_jsx_runtime.JSX.Element;
336
- declare function path(root: string, sublink: string): string;
337
-
338
- type AppConfigurations = {
339
- textFieldSize: SizeType;
340
- themeLayout?: 'vertical' | 'horizontal' | 'mini';
341
- defaultRowsPerPage: number;
342
- themeStretch: boolean;
343
- setThemeLayout?: React.Dispatch<React.SetStateAction<'horizontal' | 'vertical' | 'mini'>>;
344
- loadingLoago?: string;
345
- navBarLogo?: string;
346
- miniNavBarLogo?: string;
347
- };
348
- declare const AppConfigurationsContext: react.Context<AppConfigurations>;
349
- declare const AppConfigurationsContextProvider: (props: any) => react_jsx_runtime.JSX.Element;
350
-
351
- interface CredentialKeys {
352
- identityPoolId: string;
353
- region: string;
354
- userPoolId: string;
355
- userPoolWebClientId: string;
356
- bucket: string;
357
- googleApiKey: string;
358
- bucketUrl: string;
359
- }
360
- declare const CredentialsContext: react.Context<CredentialKeys>;
361
- interface CredentialProps extends CredentialKeys {
362
- children: ReactNode;
363
- }
364
- declare const CredentialsContextProvider: (props: CredentialProps) => react_jsx_runtime.JSX.Element;
365
-
366
- interface ISnackMessageProps {
367
- state: boolean;
368
- message?: string | undefined;
369
- severity?: AlertColor$1 | undefined;
370
- position?: SnackbarOrigin;
371
- snackAlertDelay?: number;
372
- }
373
- declare const SnackAlertContext: react.Context<{
374
- setAlert: (message: string, severity: AlertColor$1, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
375
- setErrorAlert: (message: string, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
376
- setSuccessAlert: (message: string, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
377
- }>;
378
- type SnackAlertProviderProps = {
379
- children: ReactNode;
380
- };
381
- declare function SnackAlertProvider({ children }: SnackAlertProviderProps): react_jsx_runtime.JSX.Element;
382
-
383
- interface IDialogProps {
384
- open: boolean;
385
- onDismiss: () => void;
386
- data: any;
387
- }
388
- declare const DialogContext: react.Context<{
389
- openDialog: (dialogComponent: (data: IDialogProps) => JSX.Element, data?: any) => void;
390
- }>;
391
- type DialogProviderProps = {
392
- children: ReactNode;
393
- };
394
- declare function DialogContextProvider({ children }: DialogProviderProps): react_jsx_runtime.JSX.Element;
395
-
396
- declare enum AdminNotificationNavigationType {
397
- NONE = "NONE",
398
- INTERNAL = "INTERNAL",
399
- EXTERNAL = "EXTERNAL"
400
- }
401
- declare enum AdminNotificationTypePriority {
402
- LOW = "LOW",
403
- MEDIUM = "MEDIUM",
404
- HIGH = "HIGH"
405
- }
406
- interface IDashboardNotification {
407
- id: string;
408
- text: string;
409
- createdAt: Date;
410
- clickable: boolean;
411
- redirectUrl?: string;
412
- redirectUrlType: AdminNotificationNavigationType;
413
- isRead: boolean;
414
- priority: AdminNotificationTypePriority;
415
- type?: string;
416
- }
417
-
418
- declare const NotificationContext: react.Context<{
419
- notifications?: IDashboardNotification[] | undefined;
420
- getNotifications: () => void;
421
- state: RequestState;
422
- clearNotifications: () => void;
423
- }>;
424
- interface NotificationsContextConfig {
425
- notificationsUrl: string;
426
- children: any;
427
- }
428
- declare const NotificationsContextProvider: (props: NotificationsContextConfig) => react_jsx_runtime.JSX.Element;
429
-
430
- interface IGridExtras {
431
- noRowsText?: string;
432
- bulkDeleteText?: string;
433
- afterDeleteSnackBarText?: string;
434
- afterBulkDeleteSnackBarText?: (numberOfSelectedRows: number) => string;
435
- itemsSelectedText?: string;
436
- cancelText?: string;
437
- confirmText?: string;
438
- onClickProperty?: {
439
- [key: string]: (prop: ListProps, resourceName: string, params: GridRenderCellParams) => void;
440
- };
441
- hideBulkActions?: boolean;
442
- hideActions?: boolean;
443
- hideToolbar?: boolean;
444
- overridenResource?: (resource: IResource) => IOptionalResource;
445
- density?: GridDensity;
446
- }
447
- interface GridProps {
448
- resources: any;
449
- resourceName: string;
450
- paramsState: ParamsState;
451
- bulkActionsDialogState: {
452
- [key: string]: IBulkActionsDialogState;
453
- } | undefined;
454
- setBulkActionsDialogState: react.Dispatch<react.SetStateAction<{
455
- [key: string]: IBulkActionsDialogState;
456
- } | undefined>>;
457
- extras?: IGridExtras;
458
- setCustomActions: react.Dispatch<react.SetStateAction<JSX.Element | undefined>>;
459
- hidePagination?: boolean;
460
- }
461
- declare function DataGridd({ resources, resourceName, paramsState, bulkActionsDialogState, extras, setBulkActionsDialogState, hidePagination, }: GridProps): react_jsx_runtime.JSX.Element;
462
-
463
- interface ListProps {
464
- value: string;
465
- key: string;
466
- path: string;
467
- renderCell?: (params: GridCellParams) => JSX.Element;
468
- flex?: number;
469
- }
470
- interface ListParams {
471
- page: number;
472
- perPage: number;
473
- order?: GridSortDirection;
474
- orderBy?: string;
475
- filter?: string;
476
- scope?: string;
477
- filters?: string;
478
- }
479
- type ParamsState = [ListParams, Dispatch<SetStateAction<ListParams>>];
480
-
481
- interface IBulkActionsDialogState {
482
- state: boolean;
483
- modelName: string;
484
- saveLoadingState: boolean;
485
- fullScreen: boolean;
486
- setSelected: (value: React.SetStateAction<GridRowSelectionModel>) => void;
487
- documentIds: string[];
488
- afterExecuteMessage: string;
489
- severity: AlertColor;
490
- }
491
-
492
- type IBulkActionComponent = (bulkActionsDialogState: {
493
- [key: string]: IBulkActionsDialogState;
494
- } | undefined, onClose: (key: string) => void, onSubmit: (data: any, actionKey: string) => Promise<void>) => JSX.Element;
495
-
496
- interface IListProps {
497
- apiRoute: string;
498
- key?: string;
499
- path: string;
500
- modelName: string;
501
- }
502
- interface IActionsProps {
503
- initialQueryParams: ListParams;
504
- setParams: React.Dispatch<React.SetStateAction<ListParams>>;
505
- }
506
- interface IListRecordsProps extends IListProps {
507
- extras?: IGridExtras;
508
- Actions?: (props: IActionsProps) => JSX.Element;
509
- bulkActionsComponents?: IBulkActionComponent;
510
- HeadingView?: JSX.Element;
511
- disableFilterButton?: boolean;
512
- dataListComponent?: (props: GridProps) => JSX.Element;
513
- defaultFilters?: string;
514
- }
515
-
516
- type AlertColor = 'success' | 'info' | 'warning' | 'error';
517
- declare function ListRecords(props: IListRecordsProps): react_jsx_runtime.JSX.Element;
518
-
519
- interface INextpreviousExtras {
520
- onNoNextText?: string;
521
- onNoPreviousText?: string;
522
- previousButtonTitle?: string;
523
- nextButtonTitle?: string;
524
- onClickNext?: (currentRecordId?: string) => void;
525
- onClickPrevious?: (currentRecordId?: string) => void;
526
- }
527
- interface INextPrevious extends INextpreviousExtras {
528
- recordId: string;
529
- modelPath: string;
530
- numberOfRecords?: number;
531
- recordIndex?: number;
532
- navigateTo: (recordId: string) => void;
533
- params?: ListParams;
534
- }
535
- declare function NextPreviousButtons({ modelPath, onNoNextText, onNoPreviousText, recordId, nextButtonTitle, previousButtonTitle, recordIndex, numberOfRecords, params, navigateTo, onClickNext, onClickPrevious, }: INextPrevious): react_jsx_runtime.JSX.Element;
536
-
537
- /**
538
- * Props interface for the ShowRecord component.
539
- * This interface defines the properties required to render the record detail view,
540
- * including optional custom components and actions.
541
- */
542
- interface ShowRecordProps extends INextpreviousExtras {
543
- /**
544
- * An optional key for React's reconciliation process.
545
- */
546
- key?: string;
547
- /**
548
- * The path to the specific resource being shown.
549
- */
550
- path: string;
551
- /**
552
- * The API route to fetch the model data for the resource.
553
- */
554
- modelRoute: string;
555
- /**
556
- * An optional custom component to render the record details.
557
- * @param props - The props passed to the component.
558
- * @returns {JSX.Element} The rendered component.
559
- */
560
- Component?: (props: any) => JSX.Element;
561
- /**
562
- * An optional custom component for rendering the heading view.
563
- * @param props - The props passed to the component.
564
- * @returns {JSX.Element} The rendered component.
565
- */
566
- HeadingView?: (props: any) => JSX.Element;
567
- /**
568
- * An optional component to render additional actions related to the record.
569
- * @param props - The props passed to the component.
570
- * @returns {JSX.Element} The rendered component.
571
- */
572
- Actions?: (props: any) => JSX.Element;
573
- /**
574
- * An optional component to render children elements within the breadcrumbs.
575
- * @param props - The props passed to the component.
576
- * @returns {JSX.Element} The rendered component.
577
- */
578
- BreadcrumbsChildren?: (props: any) => JSX.Element;
579
- /**
580
- * An optional array of links for the breadcrumbs navigation.
581
- * This can be used to generate links based on the current record's data.
582
- */
583
- BreadCrumbLinks?: (props: any) => TLink[];
584
- /**
585
- * An optional flag to disable default actions like edit.
586
- */
587
- disableDefaultActions?: boolean;
588
- /**
589
- * An optional string representing default filters to apply when fetching records.
590
- */
591
- defaultFilters?: string;
592
- showFilterChips?: boolean;
593
- /**
594
- * An optional flag to disable default actions like edit.
595
- */
596
- hideHeaderBreadcrumbs?: boolean;
597
- /**
598
- * An optional flag to disable skeleton before loading record.
599
- */
600
- hideSkeleton?: boolean;
601
- }
602
-
603
- /**
604
- * Component to display a record for a specific resource.
605
- * This component fetches and displays details for a record identified by its ID,
606
- * handles user permissions, and manages UI elements like breadcrumbs, filters,
607
- * and navigation buttons.
608
- *
609
- * @param {ShowRecordProps} props - The props for the ShowRecord component.
610
- *
611
- * @returns {JSX.Element} A JSX element representing the record detail view.
612
- *
613
- * @example
614
- * ```tsx
615
- * <ShowRecord
616
- * path="user"
617
- * modelRoute="/api/users"
618
- * disableDefaultActions={false}
619
- * />
620
- * ```
621
- */
622
- declare function ShowRecord(props: ShowRecordProps): react_jsx_runtime.JSX.Element;
623
-
624
- interface ICreateEdit extends INextpreviousExtras {
625
- isEdit: boolean;
626
- modelRoute: string;
627
- key?: string;
628
- path: string;
629
- removeHeaderBreadcrumbs?: boolean;
630
- afterEditSnackText?: (recordName: string) => string;
631
- afterCreateSnackText?: (recordName: string) => string;
632
- onSubmitForm?: () => void;
633
- Component?: (props: any) => JSX.Element;
634
- Actions?: (props: any) => JSX.Element;
635
- HeadingView?: (props: any) => JSX.Element;
636
- BreadcrumbsChildren?: (props: any) => JSX.Element;
637
- redirectPath?: (record: any) => string;
638
- BreadCrumbLinks?: (props: any) => TLink[];
639
- disableCreateNewButtonOnReference?: boolean;
640
- keepFullWidthElements?: boolean;
641
- defaultFilters?: string | undefined;
642
- showFilterChips?: boolean;
643
- hideHeaderBreadcrumbs?: boolean;
644
- }
645
- declare function CreateEdit(props: ICreateEdit): react_jsx_runtime.JSX.Element;
646
-
647
- type IdentityModelConfigurationPageProps = {
648
- path: string;
649
- modelRoute: string;
650
- };
651
- declare function IdentityModelConfigurationPage({ path, modelRoute }: IdentityModelConfigurationPageProps): react_jsx_runtime.JSX.Element;
652
-
653
- declare function Permissions({ isEdit }: {
654
- isEdit: boolean;
655
- }): react_jsx_runtime.JSX.Element;
656
-
657
- declare function ShowMailLog(props: any): react_jsx_runtime.JSX.Element;
658
-
659
- interface RequestConfig {
660
- url: string;
661
- body?: any;
662
- axiosRequestConfig?: AxiosRequestConfig;
663
- query?: any;
664
- onSuccess?: (data: any) => void;
665
- onError?: (error: any) => void;
666
- rowResponse?: boolean;
667
- }
668
- declare function useApi<T>(initialValue?: IState<any>): {
669
- requestState: IState<T>;
670
- get: (requstConfig: RequestConfig) => void;
671
- post: (requstConfig: RequestConfig) => void;
672
- patch: (requstConfig: RequestConfig) => void;
673
- remove: (requstConfig: RequestConfig) => void;
674
- revertToIdle: () => void;
675
- revertToInitialState: () => void;
676
- };
677
-
678
- declare function useNavData(): {
679
- subheader: string;
680
- items: any;
681
- }[];
682
-
683
- declare const useAppConfigurations: () => {
684
- textFieldSize: SizeType;
685
- themeLayout?: "horizontal" | "vertical" | "mini" | undefined;
686
- defaultRowsPerPage: number;
687
- themeStretch: boolean;
688
- setThemeLayout?: react.Dispatch<react.SetStateAction<"horizontal" | "vertical" | "mini">> | undefined;
689
- loadingLoago?: string | undefined;
690
- navBarLogo?: string | undefined;
691
- miniNavBarLogo?: string | undefined;
692
- };
693
-
694
- declare const useResources: () => {
695
- resources: ResourceResponse;
696
- getResources: () => void;
697
- state: RequestState;
698
- clearResources: () => void;
699
- loadingLogo?: string | undefined;
700
- logoSxProps?: _mui_system.SxProps | undefined;
701
- };
702
-
703
- declare const useCredentials: () => CredentialKeys;
704
-
705
- declare const useSnackAlert: () => {
706
- setAlert: (message: string, severity: _mui_material.AlertColor, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
707
- setErrorAlert: (message: string, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
708
- setSuccessAlert: (message: string, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
709
- };
710
-
711
- declare const usePaths: () => {
712
- paths: {
713
- [key: string]: ResourcePaths;
714
- };
715
- root: string;
716
- home: string;
717
- };
718
-
719
- declare const useDialogs: () => {
720
- openDialog: (dialogComponent: (data: IDialogProps) => JSX.Element, data?: any) => void;
721
- };
722
-
723
- declare const useNotifications: () => {
724
- notifications?: IDashboardNotification[] | undefined;
725
- getNotifications: () => void;
726
- state: RequestState;
727
- clearNotifications: () => void;
728
- };
729
-
730
- declare const IdentityClient: axios.AxiosInstance;
731
- declare module 'axios' {
732
- interface AxiosRequestConfig {
733
- _retry?: boolean;
734
- _auth?: boolean;
735
- }
736
- }
737
-
738
- type Props = {
739
- children: React.ReactNode;
740
- Logo?: (props: any) => JSX.Element;
741
- };
742
- declare function DashboardLayout({ children, Logo }: Props): react_jsx_runtime.JSX.Element;
743
-
744
- interface PresetsColor {
745
- lighter: string;
746
- light: string;
747
- main: string;
748
- dark: string;
749
- darker: string;
750
- contrastText: string;
751
- }
752
-
753
- interface SettingsValueProps {
754
- themeStretch?: boolean;
755
- themeMode?: 'light' | 'dark';
756
- themeDirection?: 'rtl' | 'ltr';
757
- themeContrast?: 'default' | 'bold';
758
- themeColorPresets?: 'default' | 'cyan' | 'purple' | 'blue' | 'orange' | 'red';
759
- customColorPresets?: PresetsColor;
760
- }
761
- interface ThemeProps extends SettingsValueProps {
762
- children: React.ReactNode;
763
- }
764
- declare function ThemeProvider({ children, themeColorPresets, themeContrast, themeDirection, themeMode, customColorPresets }: ThemeProps): react_jsx_runtime.JSX.Element;
765
-
766
- declare function DashBoardRouter(props: any): {
767
- path: string;
768
- children: {
769
- path: string;
770
- element: react_jsx_runtime.JSX.Element;
771
- children: any[];
772
- }[];
773
- };
774
-
775
- declare function NotificationsPopover(): react_jsx_runtime.JSX.Element;
776
-
777
- interface ActionDialogProps {
778
- open: boolean;
779
- /** Title to display when isSecondaryAction is false */
780
- title: string;
781
- /** Message to display when isSecondaryAction is false */
782
- message?: string;
783
- /** Title to display when isSecondaryAction is true */
784
- secondaryTitle?: string;
785
- /** Message to display when isSecondaryAction is true */
786
- secondaryMessage?: string;
787
- /** Determines which action to perform */
788
- isSecondaryAction?: boolean;
789
- /** Function to call when the dialog is closed */
790
- onClose: () => void;
791
- /** Function to call when isSecondaryAction is false */
792
- onAction?: () => void;
793
- /** Function to call when isSecondaryAction is true */
794
- onSecondaryAction?: () => void;
795
- /** Button text for primary action */
796
- buttonText?: string;
797
- /** Button text for secondary action */
798
- secondaryButtonText?: string;
799
- /** Loading indicator for action button */
800
- loading?: boolean;
801
- }
802
- declare function ActionDialog({ open, title, message, secondaryTitle, secondaryMessage, isSecondaryAction, onClose, onAction, onSecondaryAction, secondaryButtonText, buttonText, loading, }: ActionDialogProps): react_jsx_runtime.JSX.Element;
803
-
804
- /**
805
- * Props for the IdentityShow component, providing information
806
- * about the user record, paths, and additional configuration.
807
- */
808
- interface IdentityShowProps {
809
- /**
810
- * The user's record data, with each property representing a different
811
- * attribute of the user (e.g., name, email, etc.).
812
- */
813
- record: {
814
- [key: string]: any;
815
- };
816
- /**
817
- * The paths for various resources related to the user.
818
- * The key represents the resource name, and the value provides paths to access these resources.
819
- */
820
- userPath: {
821
- [key: string]: ResourcePaths;
822
- };
823
- /**
824
- * The path to the specific resource being shown.
825
- */
826
- path: any;
827
- }
828
-
829
- /**
830
- * Component to display the identity details of a user or resource.
831
- * It presents properties defined in `IdentityShowProps` in a card layout.
832
- *
833
- * @param {IdentityShowProps} props - The props for the IdentityShow component.
834
- *
835
- * @returns {JSX.Element} A JSX element displaying identity details in a card format.
836
- *
837
- * @example
838
- * ```tsx
839
- * <IdentityShow record={record} path="userPath" userPath="userDetails" />
840
- * ```
841
- */
842
- declare function IdentityShow({ record, path, userPath }: IdentityShowProps): react_jsx_runtime.JSX.Element;
843
-
844
- /**
845
- * DumpServiceActionProps type for Dump service action
846
- */
847
- interface DumpServiceActionProps {
848
- /**
849
- * @param baseUrl is the base url for dump service where deployed ex: http:localhost:3000/api
850
- */
851
- baseUrl: string;
852
- }
853
-
854
- /**
855
- * DumpServiceAction: is a button with custom dialog where to unselect the model where didn't meant to be included in the dump
856
- * @param DumpServiceActionProps
857
- */
858
- declare function DumpServiceAction({ baseUrl }: DumpServiceActionProps): react_jsx_runtime.JSX.Element;
859
-
860
- declare class UniqueFieldHelper {
861
- private resource;
862
- private uniqueFields;
863
- constructor(resource: IResource);
864
- getUniqueFields(): Set<string>;
865
- private execute;
866
- }
867
-
868
- declare function getUrlFilters(data: any, schema: any, scopeKey: string | undefined): string;
869
-
870
- declare function getFilterValues(fieldObject: any, field: string, defaultValuesObject: {
871
- [key: string]: any;
872
- }, searchParams: any, schema: {
873
- [key: string]: ISchemaObject;
874
- }): void;
875
-
876
- export { ActionDialog, ActionDialogProps, ActionNames, ActionTypes, ApiContext, ApiContextConfig, ApiContextProps, ApiContextProvider, AppConfigurationsContext, AppConfigurationsContextProvider, CredentialKeys, CredentialsContext, CredentialsContextProvider, DashboardLayout, DialogContext, DialogContextProvider, FieldTypes, FileTypes, HandlerStrategy, IAction, IActionMin, IActionsProps, IDialogProps, IExtarAction, IExtras, IFilter, IListProps, IListRecordsProps, IMainProperty, IOptionalResource, IParent, IProperty, ISchemaObject, ISnackMessageProps, IState, IdentityModelConfigurationPage as IdenityModelConfiguration, IdentityClient, DumpServiceAction as IdentityDumpServiceAction, CreateEdit as IdentityEdit, DataGridd as IdentityGrid, ListRecords as IdentityList, IdentityPage, IdentityPageProps, Permissions as IdentityPermissionPage, DashBoardRouter as IdentityRouter, ShowRecord as IdentityShow, ShowMailLog as IdentityShowMailLog, ImageOptimizingCategories, NextPreviousButtons, NotificationContext, NotificationsPopover as NotificationPopover, NotificationsContextConfig, NotificationsContextProvider, PageVariant, PathsContext, PathsContextConfig, PathsContextProvider, RequestConfig, RequestState, ResourcePaths, ResourceResponse, ResourcesContext, ResourcesContextConfig, ResourcesContextProvider, SettingsValueProps, Severity, IdentityShow as ShowRecord, SizeType, SnackAlertContext, SnackAlertProvider, State, ThemeProps, ThemeProvider, UniqueFieldHelper, getFilterValues, getUrlFilters, orderTypes, path, useApi, useAppConfigurations, useCredentials, useDialogs, useNavData, useNotifications, usePaths, useResources, useSnackAlert };
1
+ /// <reference types="react" />
2
+ import * as react_jsx_runtime from 'react/jsx-runtime';
3
+ import * as react from 'react';
4
+ import { ReactElement, ReactNode, Dispatch, SetStateAction } from 'react';
5
+ import { GridCellParams, GridRenderCellParams, GridDensity, GridSortDirection, GridRowSelectionModel } from '@mui/x-data-grid';
6
+ import * as axios from 'axios';
7
+ import { AxiosRequestConfig } from 'axios';
8
+ import * as _mui_system from '@mui/system';
9
+ import * as _mui_material from '@mui/material';
10
+ import { SxProps, AlertColor as AlertColor$1 } from '@mui/material';
11
+ import * as notistack from 'notistack';
12
+ import { SnackbarOrigin } from 'notistack';
13
+
14
+ type TLink = {
15
+ href?: string;
16
+ name: string;
17
+ icon?: ReactElement;
18
+ };
19
+
20
+ interface IdentityPageProps {
21
+ variant: PageVariant;
22
+ loading: boolean;
23
+ data: any;
24
+ taptitle: string;
25
+ headingTitle: string;
26
+ enableDefaultActions?: boolean;
27
+ BreadCrumbLinks?: (props: any) => TLink[];
28
+ themeStretch?: boolean;
29
+ Component?: (props: any) => JSX.Element;
30
+ DefaultActions: (props: any) => JSX.Element;
31
+ LoadingSkelton: () => JSX.Element;
32
+ Actions: (props: any) => JSX.Element;
33
+ HeadingView: (props: any) => JSX.Element;
34
+ BreadcrumbsChildren?: (props: any) => JSX.Element;
35
+ }
36
+ declare enum PageVariant {
37
+ LIST = "List",
38
+ SHOW = "Show",
39
+ FORM = "Form",
40
+ CUSTOM = "Custom"
41
+ }
42
+
43
+ declare const IdentityPage: (props: IdentityPageProps) => react_jsx_runtime.JSX.Element;
44
+
45
+ declare const ApiContext: react.Context<ApiContextProps>;
46
+ interface ApiContextProps {
47
+ statusCode: number | null;
48
+ dashbaordUrlPrefix?: string;
49
+ }
50
+ interface ApiContextConfig {
51
+ language: string;
52
+ baseUrl: string;
53
+ onLogout: () => void;
54
+ sleepTime?: number;
55
+ children: any;
56
+ dashbaordUrlPrefix?: string;
57
+ }
58
+ declare const ApiContextProvider: (props: ApiContextConfig) => react_jsx_runtime.JSX.Element;
59
+
60
+ declare enum RequestState {
61
+ IDLE = "idle",
62
+ LOADING = "loading",
63
+ SUCCEEDED = "succeeded",
64
+ FAILED = "failed"
65
+ }
66
+ interface IState<T> {
67
+ data: T | undefined;
68
+ state: RequestState;
69
+ error?: any | null;
70
+ }
71
+ declare class State<T> {
72
+ data: T | undefined;
73
+ state: RequestState;
74
+ error?: any;
75
+ private constructor();
76
+ static idle<T>(data?: T): IState<T>;
77
+ static loading<T>(data?: T): IState<T>;
78
+ static succeeded<T>(data: T): IState<T>;
79
+ static error<T>(error: any, data?: T): IState<T>;
80
+ }
81
+
82
+ declare enum ActionNames {
83
+ SHOW = "SHOW",
84
+ LIST = "LIST",
85
+ NEW = "NEW",
86
+ EDIT = "EDIT"
87
+ }
88
+ declare enum ActionTypes {
89
+ RECORD = "RECORD",
90
+ Resource = "RESOUCRE"
91
+ }
92
+ declare enum FieldTypes {
93
+ STRING = "String",
94
+ NUMBER = "Number",
95
+ ENUM = "enum",
96
+ REFERENCE = "ref",
97
+ DATE = "Date",
98
+ PASSWORD = "password",
99
+ BOOLEAN = "Boolean",
100
+ OBJECTID = "ObjectID",
101
+ NESTEDSCHEMA = "nestedSchema",
102
+ ARRAY = "Array",
103
+ IMAGE = "image",
104
+ LOCALIZEDString = "localizedString",
105
+ PHONENUMBER = "phoneNumber",
106
+ COLOR = "color",
107
+ TIMEPICKER = "timePicker",
108
+ FILE = "File",
109
+ LOCATION = "LOCATION",
110
+ RICH_TEXT_I = "RICH_TEXT_I",
111
+ RICH_TEXT_II = "RICH_TEXT_II",
112
+ EXTERNAL_LINK = "EXTERNAL_LINK",
113
+ MULTIPLE_TEXT = "MULTIPLE_TEXT"
114
+ }
115
+ declare enum HandlerStrategy {
116
+ NORMAL = "NORMAL",
117
+ FILE_DOWNLOAD = "FILE_DOWNLOAD",
118
+ CUSTOM_COMPONENT = "CUSTOM_COMPONENT"
119
+ }
120
+
121
+ type SizeType = 'small' | 'medium' | undefined;
122
+ declare enum FileTypes {
123
+ ALL = "ALL",
124
+ IMAGE = "IMAGE",
125
+ _3D = "3D",
126
+ PDF = "PDF",
127
+ EXCEL = "EXCEL",
128
+ WORD = "WORD",
129
+ VIDEO = "VIDEO",
130
+ TEXT = "TEXT",
131
+ ZIP = "ZIP",
132
+ POWER_POINT = "POWER_POINT",
133
+ AUDIO = "AUDIO"
134
+ }
135
+ declare enum ImageOptimizingCategories {
136
+ NORMAL = "NORMAL",
137
+ BANNERS = "BANNERS"
138
+ }
139
+
140
+ interface IResource {
141
+ filterProperties: string[];
142
+ quickFilterProperties: string[];
143
+ formProperties: string[];
144
+ listProperties: IProperty[];
145
+ showProperties: IProperty[];
146
+ properties: IMainProperty;
147
+ permissions?: {
148
+ [permissionKey: string]: boolean;
149
+ };
150
+ }
151
+ interface IOptionalResource {
152
+ filterProperties?: string[];
153
+ quickFilterProperties?: string[];
154
+ formProperties?: string[];
155
+ listProperties?: IProperty[];
156
+ showProperties?: IProperty[];
157
+ properties?: IMainProperty;
158
+ }
159
+ /**
160
+ * Interface representing a property within a resource schema.
161
+ * Each `IProperty` defines metadata about a field, including its key,
162
+ * display value, optional path, and an optional custom cell renderer for grid components.
163
+ */
164
+ interface IProperty {
165
+ /**
166
+ * The unique key identifier for the property.
167
+ * Used to reference the property within the schema and data records.
168
+ */
169
+ key: string;
170
+ /**
171
+ * Display value for the property, often used as a label or title.
172
+ */
173
+ value: string;
174
+ /**
175
+ * Optional path for the property, typically representing a route or URL for accessing related resources.
176
+ */
177
+ path?: string;
178
+ /**
179
+ * Optional function to render a custom cell in a grid component.
180
+ * Accepts `GridCellParams` as an argument and returns a JSX element.
181
+ * Useful for custom cell formatting or interactive elements.
182
+ */
183
+ renderCell?: (params: GridCellParams) => JSX.Element;
184
+ }
185
+ interface IMainProperty {
186
+ title: string;
187
+ path: string;
188
+ name: string;
189
+ modelName: string;
190
+ parent: IParent;
191
+ defaultOrder: orderTypes;
192
+ defaultOrderBy: string;
193
+ defaultrowsPerPage: number;
194
+ filters: IFilter;
195
+ actions: IAction;
196
+ model: {
197
+ [key: string]: ISchemaObject;
198
+ };
199
+ disableNextPreviousButtonsInShowPage?: boolean;
200
+ disableNextPreviousButtonsInEditPage?: boolean;
201
+ displayEditPageInShowPage?: boolean;
202
+ imageOnReferencePath?: string;
203
+ disableImageOnReference?: string;
204
+ }
205
+ interface IParent {
206
+ icon: string;
207
+ name: string;
208
+ value: string;
209
+ }
210
+ interface IFilter {
211
+ scopes: {
212
+ isAccessible: boolean;
213
+ showAll?: boolean;
214
+ options?: {
215
+ key: string;
216
+ value: string;
217
+ }[];
218
+ manual?: {
219
+ options: string[];
220
+ };
221
+ auto?: {
222
+ key: string;
223
+ options: string[];
224
+ };
225
+ };
226
+ searchBar: {
227
+ isAccessible: boolean;
228
+ };
229
+ }
230
+ interface IAction {
231
+ bulkDelete: IDeleteActionMin;
232
+ delete: IDeleteActionMin;
233
+ edit: IActionMin;
234
+ new: IActionMin;
235
+ show: IActionMin;
236
+ extras?: IExtras;
237
+ }
238
+ interface IExtras {
239
+ record: {
240
+ [key: string]: IExtarAction;
241
+ };
242
+ resource: {
243
+ [key: string]: IExtarAction;
244
+ };
245
+ }
246
+ interface IExtarAction {
247
+ actionType: ActionTypes;
248
+ guard?: string;
249
+ icon: string;
250
+ key: string;
251
+ keys?: string[];
252
+ name: string;
253
+ severity?: Severity;
254
+ message?: string;
255
+ guardTitle?: string;
256
+ }
257
+ interface IActionMin {
258
+ isAccessible: boolean;
259
+ value: string;
260
+ }
261
+ interface IDeleteActionMin extends IActionMin {
262
+ cancelDeleteOption: string;
263
+ confirmDeleteOption: string;
264
+ confirmationMessageBody: string;
265
+ confirmationMessageTitle: string;
266
+ }
267
+ type orderTypes = 'asc' | 'desc';
268
+ type Severity = 'success' | 'info' | 'warning' | 'error';
269
+ interface ISchemaObject {
270
+ required?: boolean;
271
+ isEditable?: boolean;
272
+ type?: FieldTypes;
273
+ enumValues?: string[];
274
+ countryCodes?: string[];
275
+ arrayType?: FieldTypes;
276
+ isDraggable?: boolean;
277
+ value?: string;
278
+ mediaUploader?: boolean;
279
+ fileType?: FileTypes;
280
+ withTime?: boolean;
281
+ apiRoute?: string;
282
+ defaultValue: string;
283
+ valuePath?: string;
284
+ path?: string;
285
+ keys?: string[];
286
+ schema?: {
287
+ [key: string]: ISchemaObject;
288
+ };
289
+ isClickable?: boolean;
290
+ multipleInFilter?: boolean;
291
+ }
292
+
293
+ type ResourceResponse = {
294
+ [key: string]: IResource | {
295
+ [key: string]: string[];
296
+ };
297
+ } | {
298
+ [key: string]: any;
299
+ } | null | undefined;
300
+ declare const ResourcesContext: react.Context<{
301
+ resources: ResourceResponse;
302
+ getResources: () => void;
303
+ state: RequestState;
304
+ clearResources: () => void;
305
+ loadingLogo?: string | undefined;
306
+ logoSxProps?: SxProps | undefined;
307
+ }>;
308
+ interface ResourcesContextConfig {
309
+ resourcesUrl: string;
310
+ laodingLogo?: string;
311
+ logoSxProps?: SxProps;
312
+ children: any;
313
+ }
314
+ declare const ResourcesContextProvider: (props: ResourcesContextConfig) => react_jsx_runtime.JSX.Element;
315
+
316
+ interface ResourcePaths {
317
+ root: string;
318
+ list: string;
319
+ edit: (id: string) => string;
320
+ show: (id: string) => string;
321
+ new: string;
322
+ }
323
+ interface PathsContextConfig {
324
+ root: string;
325
+ home: string;
326
+ children: any;
327
+ }
328
+ declare const PathsContext: react.Context<{
329
+ paths: {
330
+ [key: string]: ResourcePaths;
331
+ };
332
+ root: string;
333
+ home: string;
334
+ }>;
335
+ declare const PathsContextProvider: (props: PathsContextConfig) => react_jsx_runtime.JSX.Element;
336
+ declare function path(root: string, sublink: string): string;
337
+
338
+ type AppConfigurations = {
339
+ textFieldSize: SizeType;
340
+ themeLayout?: 'vertical' | 'horizontal' | 'mini';
341
+ defaultRowsPerPage: number;
342
+ themeStretch: boolean;
343
+ setThemeLayout?: React.Dispatch<React.SetStateAction<'horizontal' | 'vertical' | 'mini'>>;
344
+ loadingLoago?: string;
345
+ navBarLogo?: string;
346
+ miniNavBarLogo?: string;
347
+ };
348
+ declare const AppConfigurationsContext: react.Context<AppConfigurations>;
349
+ declare const AppConfigurationsContextProvider: (props: any) => react_jsx_runtime.JSX.Element;
350
+
351
+ interface CredentialKeys {
352
+ identityPoolId: string;
353
+ region: string;
354
+ userPoolId: string;
355
+ userPoolWebClientId: string;
356
+ bucket: string;
357
+ googleApiKey: string;
358
+ bucketUrl: string;
359
+ }
360
+ declare const CredentialsContext: react.Context<CredentialKeys>;
361
+ interface CredentialProps extends CredentialKeys {
362
+ children: ReactNode;
363
+ }
364
+ declare const CredentialsContextProvider: (props: CredentialProps) => react_jsx_runtime.JSX.Element;
365
+
366
+ interface ISnackMessageProps {
367
+ state: boolean;
368
+ message?: string | undefined;
369
+ severity?: AlertColor$1 | undefined;
370
+ position?: SnackbarOrigin;
371
+ snackAlertDelay?: number;
372
+ }
373
+ declare const SnackAlertContext: react.Context<{
374
+ setAlert: (message: string, severity: AlertColor$1, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
375
+ setErrorAlert: (message: string, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
376
+ setSuccessAlert: (message: string, position?: SnackbarOrigin, snackAlertDelay?: number) => void;
377
+ }>;
378
+ type SnackAlertProviderProps = {
379
+ children: ReactNode;
380
+ };
381
+ declare function SnackAlertProvider({ children }: SnackAlertProviderProps): react_jsx_runtime.JSX.Element;
382
+
383
+ interface IDialogProps {
384
+ open: boolean;
385
+ onDismiss: () => void;
386
+ data: any;
387
+ }
388
+ declare const DialogContext: react.Context<{
389
+ openDialog: (dialogComponent: (data: IDialogProps) => JSX.Element, data?: any) => void;
390
+ }>;
391
+ type DialogProviderProps = {
392
+ children: ReactNode;
393
+ };
394
+ declare function DialogContextProvider({ children }: DialogProviderProps): react_jsx_runtime.JSX.Element;
395
+
396
+ declare enum AdminNotificationNavigationType {
397
+ NONE = "NONE",
398
+ INTERNAL = "INTERNAL",
399
+ EXTERNAL = "EXTERNAL"
400
+ }
401
+ declare enum AdminNotificationTypePriority {
402
+ LOW = "LOW",
403
+ MEDIUM = "MEDIUM",
404
+ HIGH = "HIGH"
405
+ }
406
+ interface IDashboardNotification {
407
+ id: string;
408
+ text: string;
409
+ createdAt: Date;
410
+ clickable: boolean;
411
+ redirectUrl?: string;
412
+ redirectUrlType: AdminNotificationNavigationType;
413
+ isRead: boolean;
414
+ priority: AdminNotificationTypePriority;
415
+ type?: string;
416
+ }
417
+
418
+ declare const NotificationContext: react.Context<{
419
+ notifications?: IDashboardNotification[] | undefined;
420
+ getNotifications: () => void;
421
+ state: RequestState;
422
+ clearNotifications: () => void;
423
+ }>;
424
+ interface NotificationsContextConfig {
425
+ notificationsUrl: string;
426
+ children: any;
427
+ }
428
+ declare const NotificationsContextProvider: (props: NotificationsContextConfig) => react_jsx_runtime.JSX.Element;
429
+
430
+ interface IGridExtras {
431
+ noRowsText?: string;
432
+ bulkDeleteText?: string;
433
+ afterDeleteSnackBarText?: string;
434
+ afterBulkDeleteSnackBarText?: (numberOfSelectedRows: number) => string;
435
+ itemsSelectedText?: string;
436
+ cancelText?: string;
437
+ confirmText?: string;
438
+ onClickProperty?: {
439
+ [key: string]: (prop: ListProps, resourceName: string, params: GridRenderCellParams) => void;
440
+ };
441
+ hideBulkActions?: boolean;
442
+ hideActions?: boolean;
443
+ hideToolbar?: boolean;
444
+ overridenResource?: (resource: IResource) => IOptionalResource;
445
+ density?: GridDensity;
446
+ }
447
+ interface GridProps {
448
+ resources: any;
449
+ resourceName: string;
450
+ paramsState: ParamsState;
451
+ bulkActionsDialogState: {
452
+ [key: string]: IBulkActionsDialogState;
453
+ } | undefined;
454
+ setBulkActionsDialogState: react.Dispatch<react.SetStateAction<{
455
+ [key: string]: IBulkActionsDialogState;
456
+ } | undefined>>;
457
+ extras?: IGridExtras;
458
+ setCustomActions: react.Dispatch<react.SetStateAction<JSX.Element | undefined>>;
459
+ hidePagination?: boolean;
460
+ }
461
+ declare function DataGridd({ resources, resourceName, paramsState, bulkActionsDialogState, extras, setBulkActionsDialogState, hidePagination, }: GridProps): react_jsx_runtime.JSX.Element;
462
+
463
+ interface ListProps {
464
+ value: string;
465
+ key: string;
466
+ path: string;
467
+ renderCell?: (params: GridCellParams) => JSX.Element;
468
+ flex?: number;
469
+ }
470
+ interface ListParams {
471
+ page: number;
472
+ perPage: number;
473
+ order?: GridSortDirection;
474
+ orderBy?: string;
475
+ filter?: string;
476
+ scope?: string;
477
+ filters?: string;
478
+ }
479
+ type ParamsState = [ListParams, Dispatch<SetStateAction<ListParams>>];
480
+
481
+ interface IBulkActionsDialogState {
482
+ state: boolean;
483
+ modelName: string;
484
+ saveLoadingState: boolean;
485
+ fullScreen: boolean;
486
+ setSelected: (value: React.SetStateAction<GridRowSelectionModel>) => void;
487
+ documentIds: string[];
488
+ afterExecuteMessage: string;
489
+ severity: AlertColor;
490
+ }
491
+
492
+ type IBulkActionComponent = (bulkActionsDialogState: {
493
+ [key: string]: IBulkActionsDialogState;
494
+ } | undefined, onClose: (key: string) => void, onSubmit: (data: any, actionKey: string) => Promise<void>) => JSX.Element;
495
+
496
+ interface IListProps {
497
+ apiRoute: string;
498
+ key?: string;
499
+ path: string;
500
+ modelName: string;
501
+ }
502
+ interface IActionsProps {
503
+ initialQueryParams: ListParams;
504
+ setParams: React.Dispatch<React.SetStateAction<ListParams>>;
505
+ }
506
+ interface IListRecordsProps extends IListProps {
507
+ extras?: IGridExtras;
508
+ Actions?: (props: IActionsProps) => JSX.Element;
509
+ bulkActionsComponents?: IBulkActionComponent;
510
+ HeadingView?: JSX.Element;
511
+ disableFilterButton?: boolean;
512
+ dataListComponent?: (props: GridProps) => JSX.Element;
513
+ defaultFilters?: string;
514
+ }
515
+
516
+ type AlertColor = 'success' | 'info' | 'warning' | 'error';
517
+ declare function ListRecords(props: IListRecordsProps): react_jsx_runtime.JSX.Element;
518
+
519
+ interface INextpreviousExtras {
520
+ onNoNextText?: string;
521
+ onNoPreviousText?: string;
522
+ previousButtonTitle?: string;
523
+ nextButtonTitle?: string;
524
+ onClickNext?: (currentRecordId?: string) => void;
525
+ onClickPrevious?: (currentRecordId?: string) => void;
526
+ }
527
+ interface INextPrevious extends INextpreviousExtras {
528
+ recordId: string;
529
+ modelPath: string;
530
+ numberOfRecords?: number;
531
+ recordIndex?: number;
532
+ navigateTo: (recordId: string) => void;
533
+ params?: ListParams;
534
+ }
535
+ declare function NextPreviousButtons({ modelPath, onNoNextText, onNoPreviousText, recordId, nextButtonTitle, previousButtonTitle, recordIndex, numberOfRecords, params, navigateTo, onClickNext, onClickPrevious, }: INextPrevious): react_jsx_runtime.JSX.Element;
536
+
537
+ /**
538
+ * Props interface for the ShowRecord component.
539
+ * This interface defines the properties required to render the record detail view,
540
+ * including optional custom components and actions.
541
+ */
542
+ interface ShowRecordProps extends INextpreviousExtras {
543
+ /**
544
+ * An optional key for React's reconciliation process.
545
+ */
546
+ key?: string;
547
+ /**
548
+ * The path to the specific resource being shown.
549
+ */
550
+ path: string;
551
+ /**
552
+ * The API route to fetch the model data for the resource.
553
+ */
554
+ modelRoute: string;
555
+ /**
556
+ * An optional custom component to render the record details.
557
+ * @param props - The props passed to the component.
558
+ * @returns {JSX.Element} The rendered component.
559
+ */
560
+ Component?: (props: any) => JSX.Element;
561
+ /**
562
+ * An optional custom component for rendering the heading view.
563
+ * @param props - The props passed to the component.
564
+ * @returns {JSX.Element} The rendered component.
565
+ */
566
+ HeadingView?: (props: any) => JSX.Element;
567
+ /**
568
+ * An optional component to render additional actions related to the record.
569
+ * @param props - The props passed to the component.
570
+ * @returns {JSX.Element} The rendered component.
571
+ */
572
+ Actions?: (props: any) => JSX.Element;
573
+ /**
574
+ * An optional component to render children elements within the breadcrumbs.
575
+ * @param props - The props passed to the component.
576
+ * @returns {JSX.Element} The rendered component.
577
+ */
578
+ BreadcrumbsChildren?: (props: any) => JSX.Element;
579
+ /**
580
+ * An optional array of links for the breadcrumbs navigation.
581
+ * This can be used to generate links based on the current record's data.
582
+ */
583
+ BreadCrumbLinks?: (props: any) => TLink[];
584
+ /**
585
+ * An optional flag to disable default actions like edit.
586
+ */
587
+ disableDefaultActions?: boolean;
588
+ /**
589
+ * An optional string representing default filters to apply when fetching records.
590
+ */
591
+ defaultFilters?: string;
592
+ showFilterChips?: boolean;
593
+ /**
594
+ * An optional flag to disable default actions like edit.
595
+ */
596
+ hideHeaderBreadcrumbs?: boolean;
597
+ /**
598
+ * An optional flag to disable skeleton before loading record.
599
+ */
600
+ hideSkeleton?: boolean;
601
+ /**
602
+ * An optional flag to disable fetching the record.
603
+ */
604
+ disableFetchRecord?: boolean;
605
+ }
606
+
607
+ /**
608
+ * Component to display a record for a specific resource.
609
+ * This component fetches and displays details for a record identified by its ID,
610
+ * handles user permissions, and manages UI elements like breadcrumbs, filters,
611
+ * and navigation buttons.
612
+ *
613
+ * @param {ShowRecordProps} props - The props for the ShowRecord component.
614
+ *
615
+ * @returns {JSX.Element} A JSX element representing the record detail view.
616
+ *
617
+ * @example
618
+ * ```tsx
619
+ * <ShowRecord
620
+ * path="user"
621
+ * modelRoute="/api/users"
622
+ * disableDefaultActions={false}
623
+ * />
624
+ * ```
625
+ */
626
+ declare function ShowRecord(props: ShowRecordProps): react_jsx_runtime.JSX.Element;
627
+
628
+ interface ICreateEdit extends INextpreviousExtras {
629
+ isEdit: boolean;
630
+ modelRoute: string;
631
+ key?: string;
632
+ path: string;
633
+ removeHeaderBreadcrumbs?: boolean;
634
+ afterEditSnackText?: (recordName: string) => string;
635
+ afterCreateSnackText?: (recordName: string) => string;
636
+ onSubmitForm?: () => void;
637
+ Component?: (props: any) => JSX.Element;
638
+ Actions?: (props: any) => JSX.Element;
639
+ HeadingView?: (props: any) => JSX.Element;
640
+ BreadcrumbsChildren?: (props: any) => JSX.Element;
641
+ redirectPath?: (record: any) => string;
642
+ BreadCrumbLinks?: (props: any) => TLink[];
643
+ disableCreateNewButtonOnReference?: boolean;
644
+ keepFullWidthElements?: boolean;
645
+ defaultFilters?: string | undefined;
646
+ showFilterChips?: boolean;
647
+ hideHeaderBreadcrumbs?: boolean;
648
+ }
649
+ declare function CreateEdit(props: ICreateEdit): react_jsx_runtime.JSX.Element;
650
+
651
+ type IdentityModelConfigurationPageProps = {
652
+ path: string;
653
+ modelRoute: string;
654
+ };
655
+ declare function IdentityModelConfigurationPage({ path, modelRoute }: IdentityModelConfigurationPageProps): react_jsx_runtime.JSX.Element;
656
+
657
+ declare function Permissions({ isEdit }: {
658
+ isEdit: boolean;
659
+ }): react_jsx_runtime.JSX.Element;
660
+
661
+ declare function ShowMailLog(props: any): react_jsx_runtime.JSX.Element;
662
+
663
+ interface RequestConfig {
664
+ url: string;
665
+ body?: any;
666
+ axiosRequestConfig?: AxiosRequestConfig;
667
+ query?: any;
668
+ onSuccess?: (data: any) => void;
669
+ onError?: (error: any) => void;
670
+ rowResponse?: boolean;
671
+ }
672
+ declare function useApi<T>(initialValue?: IState<any>): {
673
+ requestState: IState<T>;
674
+ get: (requstConfig: RequestConfig) => void;
675
+ post: (requstConfig: RequestConfig) => void;
676
+ patch: (requstConfig: RequestConfig) => void;
677
+ remove: (requstConfig: RequestConfig) => void;
678
+ revertToIdle: () => void;
679
+ revertToInitialState: () => void;
680
+ };
681
+
682
+ declare function useNavData(): {
683
+ subheader: string;
684
+ items: any;
685
+ }[];
686
+
687
+ declare const useAppConfigurations: () => {
688
+ textFieldSize: SizeType;
689
+ themeLayout?: "horizontal" | "vertical" | "mini" | undefined;
690
+ defaultRowsPerPage: number;
691
+ themeStretch: boolean;
692
+ setThemeLayout?: react.Dispatch<react.SetStateAction<"horizontal" | "vertical" | "mini">> | undefined;
693
+ loadingLoago?: string | undefined;
694
+ navBarLogo?: string | undefined;
695
+ miniNavBarLogo?: string | undefined;
696
+ };
697
+
698
+ declare const useResources: () => {
699
+ resources: ResourceResponse;
700
+ getResources: () => void;
701
+ state: RequestState;
702
+ clearResources: () => void;
703
+ loadingLogo?: string | undefined;
704
+ logoSxProps?: _mui_system.SxProps | undefined;
705
+ };
706
+
707
+ declare const useCredentials: () => CredentialKeys;
708
+
709
+ declare const useSnackAlert: () => {
710
+ setAlert: (message: string, severity: _mui_material.AlertColor, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
711
+ setErrorAlert: (message: string, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
712
+ setSuccessAlert: (message: string, position?: notistack.SnackbarOrigin | undefined, snackAlertDelay?: number | undefined) => void;
713
+ };
714
+
715
+ declare const usePaths: () => {
716
+ paths: {
717
+ [key: string]: ResourcePaths;
718
+ };
719
+ root: string;
720
+ home: string;
721
+ };
722
+
723
+ declare const useDialogs: () => {
724
+ openDialog: (dialogComponent: (data: IDialogProps) => JSX.Element, data?: any) => void;
725
+ };
726
+
727
+ declare const useNotifications: () => {
728
+ notifications?: IDashboardNotification[] | undefined;
729
+ getNotifications: () => void;
730
+ state: RequestState;
731
+ clearNotifications: () => void;
732
+ };
733
+
734
+ declare const IdentityClient: axios.AxiosInstance;
735
+ declare module 'axios' {
736
+ interface AxiosRequestConfig {
737
+ _retry?: boolean;
738
+ _auth?: boolean;
739
+ }
740
+ }
741
+
742
+ type Props = {
743
+ children: React.ReactNode;
744
+ Logo?: (props: any) => JSX.Element;
745
+ };
746
+ declare function DashboardLayout({ children, Logo }: Props): react_jsx_runtime.JSX.Element;
747
+
748
+ interface PresetsColor {
749
+ lighter: string;
750
+ light: string;
751
+ main: string;
752
+ dark: string;
753
+ darker: string;
754
+ contrastText: string;
755
+ }
756
+
757
+ interface SettingsValueProps {
758
+ themeStretch?: boolean;
759
+ themeMode?: 'light' | 'dark';
760
+ themeDirection?: 'rtl' | 'ltr';
761
+ themeContrast?: 'default' | 'bold';
762
+ themeColorPresets?: 'default' | 'cyan' | 'purple' | 'blue' | 'orange' | 'red';
763
+ customColorPresets?: PresetsColor;
764
+ }
765
+ interface ThemeProps extends SettingsValueProps {
766
+ children: React.ReactNode;
767
+ }
768
+ declare function ThemeProvider({ children, themeColorPresets, themeContrast, themeDirection, themeMode, customColorPresets }: ThemeProps): react_jsx_runtime.JSX.Element;
769
+
770
+ declare function DashBoardRouter(props: any): {
771
+ path: string;
772
+ children: {
773
+ path: string;
774
+ element: react_jsx_runtime.JSX.Element;
775
+ children: any[];
776
+ }[];
777
+ };
778
+
779
+ declare function NotificationsPopover(): react_jsx_runtime.JSX.Element;
780
+
781
+ interface ActionDialogProps {
782
+ open: boolean;
783
+ /** Title to display when isSecondaryAction is false */
784
+ title: string;
785
+ /** Message to display when isSecondaryAction is false */
786
+ message?: string;
787
+ /** Title to display when isSecondaryAction is true */
788
+ secondaryTitle?: string;
789
+ /** Message to display when isSecondaryAction is true */
790
+ secondaryMessage?: string;
791
+ /** Determines which action to perform */
792
+ isSecondaryAction?: boolean;
793
+ /** Function to call when the dialog is closed */
794
+ onClose: () => void;
795
+ /** Function to call when isSecondaryAction is false */
796
+ onAction?: () => void;
797
+ /** Function to call when isSecondaryAction is true */
798
+ onSecondaryAction?: () => void;
799
+ /** Button text for primary action */
800
+ buttonText?: string;
801
+ /** Button text for secondary action */
802
+ secondaryButtonText?: string;
803
+ /** Loading indicator for action button */
804
+ loading?: boolean;
805
+ }
806
+ declare function ActionDialog({ open, title, message, secondaryTitle, secondaryMessage, isSecondaryAction, onClose, onAction, onSecondaryAction, secondaryButtonText, buttonText, loading, }: ActionDialogProps): react_jsx_runtime.JSX.Element;
807
+
808
+ /**
809
+ * Props for the IdentityShow component, providing information
810
+ * about the user record, paths, and additional configuration.
811
+ */
812
+ interface IdentityShowProps {
813
+ /**
814
+ * The user's record data, with each property representing a different
815
+ * attribute of the user (e.g., name, email, etc.).
816
+ */
817
+ record: {
818
+ [key: string]: any;
819
+ };
820
+ /**
821
+ * The paths for various resources related to the user.
822
+ * The key represents the resource name, and the value provides paths to access these resources.
823
+ */
824
+ userPath: {
825
+ [key: string]: ResourcePaths;
826
+ };
827
+ /**
828
+ * The path to the specific resource being shown.
829
+ */
830
+ path: any;
831
+ }
832
+
833
+ /**
834
+ * Component to display the identity details of a user or resource.
835
+ * It presents properties defined in `IdentityShowProps` in a card layout.
836
+ *
837
+ * @param {IdentityShowProps} props - The props for the IdentityShow component.
838
+ *
839
+ * @returns {JSX.Element} A JSX element displaying identity details in a card format.
840
+ *
841
+ * @example
842
+ * ```tsx
843
+ * <IdentityShow record={record} path="userPath" userPath="userDetails" />
844
+ * ```
845
+ */
846
+ declare function IdentityShow({ record, path, userPath }: IdentityShowProps): react_jsx_runtime.JSX.Element;
847
+
848
+ /**
849
+ * DumpServiceActionProps type for Dump service action
850
+ */
851
+ interface DumpServiceActionProps {
852
+ /**
853
+ * @param baseUrl is the base url for dump service where deployed ex: http:localhost:3000/api
854
+ */
855
+ baseUrl: string;
856
+ }
857
+
858
+ /**
859
+ * DumpServiceAction: is a button with custom dialog where to unselect the model where didn't meant to be included in the dump
860
+ * @param DumpServiceActionProps
861
+ */
862
+ declare function DumpServiceAction({ baseUrl }: DumpServiceActionProps): react_jsx_runtime.JSX.Element;
863
+
864
+ declare class UniqueFieldHelper {
865
+ private resource;
866
+ private uniqueFields;
867
+ constructor(resource: IResource);
868
+ getUniqueFields(): Set<string>;
869
+ private execute;
870
+ }
871
+
872
+ declare function getUrlFilters(data: any, schema: any, scopeKey: string | undefined): string;
873
+
874
+ declare function getFilterValues(fieldObject: any, field: string, defaultValuesObject: {
875
+ [key: string]: any;
876
+ }, searchParams: any, schema: {
877
+ [key: string]: ISchemaObject;
878
+ }): void;
879
+
880
+ export { ActionDialog, ActionDialogProps, ActionNames, ActionTypes, ApiContext, ApiContextConfig, ApiContextProps, ApiContextProvider, AppConfigurationsContext, AppConfigurationsContextProvider, CredentialKeys, CredentialsContext, CredentialsContextProvider, DashboardLayout, DialogContext, DialogContextProvider, FieldTypes, FileTypes, HandlerStrategy, IAction, IActionMin, IActionsProps, IDialogProps, IExtarAction, IExtras, IFilter, IListProps, IListRecordsProps, IMainProperty, IOptionalResource, IParent, IProperty, ISchemaObject, ISnackMessageProps, IState, IdentityModelConfigurationPage as IdenityModelConfiguration, IdentityClient, DumpServiceAction as IdentityDumpServiceAction, CreateEdit as IdentityEdit, DataGridd as IdentityGrid, ListRecords as IdentityList, IdentityPage, IdentityPageProps, Permissions as IdentityPermissionPage, DashBoardRouter as IdentityRouter, ShowRecord as IdentityShow, ShowMailLog as IdentityShowMailLog, ImageOptimizingCategories, NextPreviousButtons, NotificationContext, NotificationsPopover as NotificationPopover, NotificationsContextConfig, NotificationsContextProvider, PageVariant, PathsContext, PathsContextConfig, PathsContextProvider, RequestConfig, RequestState, ResourcePaths, ResourceResponse, ResourcesContext, ResourcesContextConfig, ResourcesContextProvider, SettingsValueProps, Severity, IdentityShow as ShowRecord, SizeType, SnackAlertContext, SnackAlertProvider, State, ThemeProps, ThemeProvider, UniqueFieldHelper, getFilterValues, getUrlFilters, orderTypes, path, useApi, useAppConfigurations, useCredentials, useDialogs, useNavData, useNotifications, usePaths, useResources, useSnackAlert };