@danjojojo/strapi-audit-trail 0.0.0-stage → 1.0.1
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/README.md +55 -2
- package/dist/admin/App-Bh07BNJH.mjs +24221 -0
- package/dist/admin/App-CnbPoQeS.js +24238 -0
- package/dist/admin/en-B4KWt_jN.js +4 -0
- package/dist/admin/en-Byx4XI2L.mjs +4 -0
- package/dist/admin/index-B_D8BZUB.mjs +108 -0
- package/dist/admin/index-D6PVUxkf.js +107 -0
- package/dist/admin/index.js +4 -0
- package/dist/admin/index.mjs +4 -0
- package/dist/admin/src/components/Initializer.d.ts +5 -0
- package/dist/admin/src/components/PluginIcon.d.ts +2 -0
- package/dist/admin/src/components/actions/HeaderAction.d.ts +2 -0
- package/dist/admin/src/components/blocks/BlocksDetailView.d.ts +2 -0
- package/dist/admin/src/components/blocks/BlocksDialogView.d.ts +2 -0
- package/dist/admin/src/components/blocks/BlocksRenderer.d.ts +2 -0
- package/dist/admin/src/components/blocks/BlocksToolkit.d.ts +1 -0
- package/dist/admin/src/components/blocks/components/Code.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/Heading.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/Image.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/List.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/ListItem.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/Paragraph.d.ts +2 -0
- package/dist/admin/src/components/blocks/components/Quote.d.ts +2 -0
- package/dist/admin/src/components/blocks/modifiers/InlineCode.d.ts +2 -0
- package/dist/admin/src/components/detail/Header.d.ts +3 -0
- package/dist/admin/src/components/detail/RenderDocumentView.d.ts +4 -0
- package/dist/admin/src/components/detail/RenderField.d.ts +2 -0
- package/dist/admin/src/components/dialogs/AuditLoginDialog.d.ts +3 -0
- package/dist/admin/src/components/fields/Blocks.d.ts +2 -0
- package/dist/admin/src/components/fields/Boolean.d.ts +2 -0
- package/dist/admin/src/components/fields/Component.d.ts +2 -0
- package/dist/admin/src/components/fields/CustomField.d.ts +2 -0
- package/dist/admin/src/components/fields/Date.d.ts +9 -0
- package/dist/admin/src/components/fields/Dynamiczone.d.ts +2 -0
- package/dist/admin/src/components/fields/Integer.d.ts +2 -0
- package/dist/admin/src/components/fields/Json.d.ts +2 -0
- package/dist/admin/src/components/fields/Markdown.d.ts +2 -0
- package/dist/admin/src/components/fields/Media.d.ts +2 -0
- package/dist/admin/src/components/fields/Relation.d.ts +2 -0
- package/dist/admin/src/components/fields/String.d.ts +2 -0
- package/dist/admin/src/components/fields/Textarea.d.ts +2 -0
- package/dist/admin/src/components/fields/base/CompDynamiczone.d.ts +2 -0
- package/dist/admin/src/components/fields/base/CompEmpty.d.ts +1 -0
- package/dist/admin/src/components/fields/base/CompRepeatable.d.ts +2 -0
- package/dist/admin/src/components/fields/base/CompSingle.d.ts +2 -0
- package/dist/admin/src/components/home/Header.d.ts +4 -0
- package/dist/admin/src/components/layout/ContentLayout.d.ts +3 -0
- package/dist/admin/src/components/layout/DetailContentLayout.d.ts +2 -0
- package/dist/admin/src/components/layout/LandingContentLayout.d.ts +3 -0
- package/dist/admin/src/components/layout/Layout.d.ts +3 -0
- package/dist/admin/src/components/layout/Sidebar.d.ts +1 -0
- package/dist/admin/src/components/layout/VersionsSidebar.d.ts +2 -0
- package/dist/admin/src/components/layout/sidebar/SidebarContent.d.ts +1 -0
- package/dist/admin/src/components/layout/sidebar/SidebarHeader.d.ts +1 -0
- package/dist/admin/src/components/layout/sidebar/SidebarNote.d.ts +1 -0
- package/dist/admin/src/components/layout/sidebar/SidebarSearch.d.ts +1 -0
- package/dist/admin/src/components/markdown/MarkdownDetailView.d.ts +2 -0
- package/dist/admin/src/components/markdown/MarkdownDialogView.d.ts +2 -0
- package/dist/admin/src/components/markdown/MarkdownHeader.d.ts +7 -0
- package/dist/admin/src/components/markdown/MarkdownValue.d.ts +2 -0
- package/dist/admin/src/components/markdown/ParsedMarkdown.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/Code.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/Heading.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/List.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/ListItem.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/Paragraph.d.ts +2 -0
- package/dist/admin/src/components/markdown/components/Quote.d.ts +2 -0
- package/dist/admin/src/components/styled/BlocksLayout.d.ts +57 -0
- package/dist/admin/src/components/styled/FieldLayout.d.ts +35 -0
- package/dist/admin/src/components/styled/MarkdownLayout.d.ts +51 -0
- package/dist/admin/src/components/styled/StyledBlockquote.d.ts +5 -0
- package/dist/admin/src/components/styled/StyledCode.d.ts +11 -0
- package/dist/admin/src/components/styled/StyledCustomField.d.ts +6 -0
- package/dist/admin/src/components/styled/StyledDialog.d.ts +8 -0
- package/dist/admin/src/components/styled/StyledHeading.d.ts +56 -0
- package/dist/admin/src/components/styled/StyledImage.d.ts +3 -0
- package/dist/admin/src/components/styled/StyledLinkButton.d.ts +3 -0
- package/dist/admin/src/components/styled/StyledList.d.ts +16 -0
- package/dist/admin/src/components/ui/Container.d.ts +8 -0
- package/dist/admin/src/components/ui/EmptyState.d.ts +2 -0
- package/dist/admin/src/components/ui/ErrorState.d.ts +3 -0
- package/dist/admin/src/components/ui/Field.d.ts +2 -0
- package/dist/admin/src/components/ui/Grid.d.ts +16 -0
- package/dist/admin/src/components/ui/Header.d.ts +2 -0
- package/dist/admin/src/components/ui/Loader.d.ts +1 -0
- package/dist/admin/src/components/ui/Pagination.d.ts +3 -0
- package/dist/admin/src/components/ui/Pill.d.ts +3 -0
- package/dist/admin/src/components/ui/SearchInput.d.ts +2 -0
- package/dist/admin/src/components/ui/SidebarListItem.d.ts +2 -0
- package/dist/admin/src/components/ui/SidebarListTitle.d.ts +2 -0
- package/dist/admin/src/components/ui/Status.d.ts +2 -0
- package/dist/admin/src/components/ui/Table.d.ts +5 -0
- package/dist/admin/src/components/ui/Versions.d.ts +13 -0
- package/dist/admin/src/constants.d.ts +38 -0
- package/dist/admin/src/helpers/audit-logs-formatters.d.ts +6 -0
- package/dist/admin/src/helpers/document-view/container-renderer.d.ts +2 -0
- package/dist/admin/src/helpers/document-view/field-value.d.ts +3 -0
- package/dist/admin/src/helpers/response-status.d.ts +2 -0
- package/dist/admin/src/hooks/useAuditLogins.d.ts +7 -0
- package/dist/admin/src/hooks/useAuditLogs.d.ts +11 -0
- package/dist/admin/src/hooks/useCarouselInput.d.ts +7 -0
- package/dist/admin/src/hooks/useCollections.d.ts +14 -0
- package/dist/admin/src/hooks/useRouting.d.ts +11 -0
- package/dist/admin/src/hooks/useTable.d.ts +8 -0
- package/dist/admin/src/hooks/useVersions.d.ts +6 -0
- package/dist/admin/src/index.d.ts +3 -0
- package/dist/admin/src/pages/App.d.ts +2 -0
- package/dist/admin/src/pages/AppRoutes.d.ts +1 -0
- package/dist/admin/src/pages/ContentTypePage.d.ts +1 -0
- package/dist/admin/src/pages/DetailPage.d.ts +1 -0
- package/dist/admin/src/pages/ErrorPage.d.ts +3 -0
- package/dist/admin/src/pages/LoginsPage.d.ts +1 -0
- package/dist/admin/src/pages/NoPermissionPage.d.ts +3 -0
- package/dist/admin/src/pages/RecentsPage.d.ts +1 -0
- package/dist/admin/src/permissions.d.ts +10 -0
- package/dist/admin/src/pluginId.d.ts +1 -0
- package/dist/admin/src/providers/app.provider.d.ts +3 -0
- package/dist/admin/src/providers/audit-logs.provider.d.ts +14 -0
- package/dist/admin/src/providers/collection.provider.d.ts +15 -0
- package/dist/admin/src/providers/markdown-mode.provider.d.ts +7 -0
- package/dist/admin/src/services/index.d.ts +7 -0
- package/dist/admin/src/types/actions.types.d.ts +16 -0
- package/dist/admin/src/types/block.types.d.ts +27 -0
- package/dist/admin/src/types/container.types.d.ts +50 -0
- package/dist/admin/src/types/detail.types.d.ts +8 -0
- package/dist/admin/src/types/dialog.types.d.ts +8 -0
- package/dist/admin/src/types/field-value.types.d.ts +25 -0
- package/dist/admin/src/types/fields-container.types.d.ts +8 -0
- package/dist/admin/src/types/fields.types.d.ts +101 -0
- package/dist/admin/src/types/internal.types.d.ts +5 -0
- package/dist/admin/src/types/markdown.types.d.ts +6 -0
- package/dist/admin/src/types/service.types.d.ts +93 -0
- package/dist/admin/src/types/ui.types.d.ts +67 -0
- package/dist/admin/src/types/utils.types.d.ts +1 -0
- package/dist/admin/src/types/versions.types.d.ts +17 -0
- package/dist/admin/src/utils/getTranslation.d.ts +2 -0
- package/dist/admin/src/utils/numbers.d.ts +8 -0
- package/dist/admin/src/utils/placeHeaderAction.d.ts +2 -0
- package/dist/admin/src/utils/routing.d.ts +5 -0
- package/dist/admin/src/utils/string.d.ts +3 -0
- package/dist/server/index.js +25234 -0
- package/dist/server/index.mjs +25223 -0
- package/dist/server/src/bootstrap.d.ts +5 -0
- package/dist/server/src/config/index.d.ts +5 -0
- package/dist/server/src/constants.d.ts +4 -0
- package/dist/server/src/content-types/audit-log/schema.json.d.ts +67 -0
- package/dist/server/src/content-types/audit-login/schema.json.d.ts +49 -0
- package/dist/server/src/content-types/index.d.ts +117 -0
- package/dist/server/src/controllers/audit-logins.d.ts +8 -0
- package/dist/server/src/controllers/audit-logs.d.ts +9 -0
- package/dist/server/src/controllers/collection.d.ts +8 -0
- package/dist/server/src/controllers/index.d.ts +19 -0
- package/dist/server/src/destroy.d.ts +5 -0
- package/dist/server/src/index.d.ts +211 -0
- package/dist/server/src/middlewares/audit-logins.d.ts +2 -0
- package/dist/server/src/middlewares/audit-logs.d.ts +2 -0
- package/dist/server/src/middlewares/index.d.ts +2 -0
- package/dist/server/src/permissions.d.ts +2 -0
- package/dist/server/src/policies/index.d.ts +2 -0
- package/dist/server/src/register.d.ts +5 -0
- package/dist/server/src/routes/admin/audit-logins.d.ts +12 -0
- package/dist/server/src/routes/admin/audit-logs.d.ts +12 -0
- package/dist/server/src/routes/admin/index.d.ts +12 -0
- package/dist/server/src/routes/content-api/index.d.ts +5 -0
- package/dist/server/src/routes/index.d.ts +18 -0
- package/dist/server/src/services/audit-logins.d.ts +16 -0
- package/dist/server/src/services/audit-logs.d.ts +21 -0
- package/dist/server/src/services/collection.d.ts +11 -0
- package/dist/server/src/services/index.d.ts +43 -0
- package/dist/server/src/types/audit-logins.d.ts +8 -0
- package/dist/server/src/types/audit-logs.d.ts +27 -0
- package/dist/server/src/types/internal.d.ts +8 -0
- package/package.json +80 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ActionContext, ActionComponent, ActionDescription } from './internal.types';
|
|
2
|
+
export type HeaderActionType = (props: ActionContext) => ActionDescription | null;
|
|
3
|
+
export type PlaceHeaderAction = (props: {
|
|
4
|
+
/**
|
|
5
|
+
* @description Pass the actions array.
|
|
6
|
+
*/
|
|
7
|
+
actions: ActionComponent[];
|
|
8
|
+
/**
|
|
9
|
+
* @description Pass the action components to be placed in the header.
|
|
10
|
+
*/
|
|
11
|
+
component: ActionComponent[];
|
|
12
|
+
/**
|
|
13
|
+
* @description Specify the target where the action component will be placed in the header. This will put the action component before the target.
|
|
14
|
+
*/
|
|
15
|
+
placeBefore?: ActionComponent['type'];
|
|
16
|
+
}) => ActionComponent[];
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { MediaEntry } from './field-value.types';
|
|
2
|
+
/** FOR BASE BLOCK */
|
|
3
|
+
export interface BaseBlock {
|
|
4
|
+
children: React.ReactNode;
|
|
5
|
+
}
|
|
6
|
+
/** FOR LIST BLOCK */
|
|
7
|
+
export interface ListBlockProps extends BaseBlock {
|
|
8
|
+
format: 'ordered' | 'unordered';
|
|
9
|
+
}
|
|
10
|
+
/** FOR IMAGE BLOCK */
|
|
11
|
+
export interface ImageBlockProps extends BaseBlock {
|
|
12
|
+
data: MediaEntry;
|
|
13
|
+
}
|
|
14
|
+
/** FOR HEADING BLOCK */
|
|
15
|
+
export type HeadingTag = 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
|
|
16
|
+
export interface HeadingBlockProps extends BaseBlock {
|
|
17
|
+
level: 1 | 2 | 3 | 4 | 5 | 6;
|
|
18
|
+
}
|
|
19
|
+
/** FOR BLOCK TOOLKIT */
|
|
20
|
+
export interface ToolkitProps {
|
|
21
|
+
icon: React.JSX.Element;
|
|
22
|
+
label: string;
|
|
23
|
+
}
|
|
24
|
+
/** FOR BLOCK RENDERER */
|
|
25
|
+
export interface BlocksRendererProps {
|
|
26
|
+
value: any;
|
|
27
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
export interface GetContainersParams {
|
|
2
|
+
schema: string | undefined;
|
|
3
|
+
layout: string | undefined;
|
|
4
|
+
}
|
|
5
|
+
export interface ContainerField {
|
|
6
|
+
id: string;
|
|
7
|
+
label: string;
|
|
8
|
+
size: number;
|
|
9
|
+
settings: SettingsContent;
|
|
10
|
+
metadata: MetadataContent;
|
|
11
|
+
schema: SchemaContent;
|
|
12
|
+
}
|
|
13
|
+
export interface GetContainersResult {
|
|
14
|
+
type: 'normal' | 'dynamiczone';
|
|
15
|
+
fields: ContainerField[][];
|
|
16
|
+
}
|
|
17
|
+
export interface FieldLayout {
|
|
18
|
+
name: string;
|
|
19
|
+
size: number;
|
|
20
|
+
}
|
|
21
|
+
export type SchemaContent = {
|
|
22
|
+
type: string;
|
|
23
|
+
required?: boolean;
|
|
24
|
+
relation?: string;
|
|
25
|
+
component?: string;
|
|
26
|
+
repeatable?: boolean;
|
|
27
|
+
multiple?: boolean;
|
|
28
|
+
customField?: string;
|
|
29
|
+
};
|
|
30
|
+
export type SettingsContent = {
|
|
31
|
+
mainField: string | null;
|
|
32
|
+
};
|
|
33
|
+
export type MetadataContent = {
|
|
34
|
+
edit: {
|
|
35
|
+
mainField?: string | null;
|
|
36
|
+
};
|
|
37
|
+
list: {
|
|
38
|
+
label: string;
|
|
39
|
+
};
|
|
40
|
+
};
|
|
41
|
+
export type Schema = Record<string, SchemaContent>;
|
|
42
|
+
export type Metadatas = Record<string, MetadataContent>;
|
|
43
|
+
export interface Layout {
|
|
44
|
+
settings: SettingsContent;
|
|
45
|
+
metadatas: Metadatas;
|
|
46
|
+
layouts: {
|
|
47
|
+
list: string[];
|
|
48
|
+
edit: FieldLayout[][];
|
|
49
|
+
};
|
|
50
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
export interface Relation {
|
|
2
|
+
id?: number | string;
|
|
3
|
+
documentId?: string;
|
|
4
|
+
[key: string]: any;
|
|
5
|
+
}
|
|
6
|
+
export interface MediaEntry {
|
|
7
|
+
id?: number | string;
|
|
8
|
+
name: string;
|
|
9
|
+
alternativeText?: string | null;
|
|
10
|
+
url: string;
|
|
11
|
+
caption?: string | null;
|
|
12
|
+
width: number;
|
|
13
|
+
height: number;
|
|
14
|
+
formats?: Record<string, unknown>;
|
|
15
|
+
hash: string;
|
|
16
|
+
ext: string;
|
|
17
|
+
mime: string;
|
|
18
|
+
size: number;
|
|
19
|
+
previewUrl?: string | null;
|
|
20
|
+
provider: string;
|
|
21
|
+
provider_metadata?: unknown | null;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
[key: string]: any;
|
|
25
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { GetContainersResult } from './container.types';
|
|
2
|
+
export interface BaseContainerProps {
|
|
3
|
+
children: React.ReactNode;
|
|
4
|
+
}
|
|
5
|
+
export interface DefaultContainerProps {
|
|
6
|
+
container: GetContainersResult | null;
|
|
7
|
+
renderFields: (fields: GetContainersResult['fields'][number][number]) => React.JSX.Element;
|
|
8
|
+
}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import { GetContainersResult, MetadataContent, SchemaContent, SettingsContent } from './container.types';
|
|
2
|
+
/** BASE FIELD */
|
|
3
|
+
export interface FieldProps {
|
|
4
|
+
label: string;
|
|
5
|
+
children?: React.ReactNode;
|
|
6
|
+
paddingBottom?: string;
|
|
7
|
+
type?: string;
|
|
8
|
+
value?: any;
|
|
9
|
+
required?: boolean;
|
|
10
|
+
}
|
|
11
|
+
/** BOOLEAN FIELD */
|
|
12
|
+
export interface BooleanProps {
|
|
13
|
+
label: string;
|
|
14
|
+
value: string;
|
|
15
|
+
schema: SchemaContent;
|
|
16
|
+
}
|
|
17
|
+
/** RELATION FIELD */
|
|
18
|
+
export interface RelationProps {
|
|
19
|
+
label: string;
|
|
20
|
+
value: any;
|
|
21
|
+
metadata: MetadataContent;
|
|
22
|
+
schema: SchemaContent;
|
|
23
|
+
}
|
|
24
|
+
export interface RelationButton {
|
|
25
|
+
value: string;
|
|
26
|
+
}
|
|
27
|
+
export interface ScrollableRelationButtons {
|
|
28
|
+
itemsLength: number;
|
|
29
|
+
children: React.ReactNode;
|
|
30
|
+
}
|
|
31
|
+
/** MEDIA FIELD */
|
|
32
|
+
export interface MediaProps {
|
|
33
|
+
label: string;
|
|
34
|
+
value: any;
|
|
35
|
+
schema: SchemaContent;
|
|
36
|
+
}
|
|
37
|
+
/** INPUT FIELD */
|
|
38
|
+
export interface InputFieldProps {
|
|
39
|
+
label: string;
|
|
40
|
+
value: any;
|
|
41
|
+
schema: SchemaContent;
|
|
42
|
+
}
|
|
43
|
+
/** DOCUMENT VIEW FIELD */
|
|
44
|
+
export interface RenderFieldProps {
|
|
45
|
+
label: string;
|
|
46
|
+
type: string;
|
|
47
|
+
value: any;
|
|
48
|
+
schema: SchemaContent;
|
|
49
|
+
metadata: MetadataContent;
|
|
50
|
+
settings: SettingsContent;
|
|
51
|
+
}
|
|
52
|
+
/** DYNAMIC ZONE PROPS */
|
|
53
|
+
export interface DynamiczoneProps {
|
|
54
|
+
value: any[];
|
|
55
|
+
}
|
|
56
|
+
/** COMPONENT PROPS */
|
|
57
|
+
export interface ComponentProps {
|
|
58
|
+
label: string;
|
|
59
|
+
value: any | any[];
|
|
60
|
+
schema: SchemaContent;
|
|
61
|
+
settings: SettingsContent;
|
|
62
|
+
}
|
|
63
|
+
/** SINGLE COMPONENT PROPS */
|
|
64
|
+
export interface SingleComponentProps {
|
|
65
|
+
containers: GetContainersResult[] | null;
|
|
66
|
+
renderFields: (fields: GetContainersResult['fields'][number][number]) => React.JSX.Element;
|
|
67
|
+
}
|
|
68
|
+
/** REPEATABLE COMPONENT PROPS */
|
|
69
|
+
export interface RepeatableComponentProps {
|
|
70
|
+
containers: GetContainersResult[] | null;
|
|
71
|
+
value: any[];
|
|
72
|
+
renderTitle: (value: any, container: GetContainersResult) => string;
|
|
73
|
+
renderFields: (fields: GetContainersResult['fields'][number][number], value: any) => React.JSX.Element;
|
|
74
|
+
}
|
|
75
|
+
/** DYNAMIC ZONE COMPONENT PROPS */
|
|
76
|
+
export interface DynamiczoneComponentProps {
|
|
77
|
+
value: any[];
|
|
78
|
+
renderTitle: (value: any, container: GetContainersResult) => string;
|
|
79
|
+
renderContainers: (value: any) => GetContainersResult[] | null;
|
|
80
|
+
renderFields: (fields: GetContainersResult['fields'][number][number], value: any) => React.JSX.Element;
|
|
81
|
+
}
|
|
82
|
+
export interface CustomInputFieldProps extends InputFieldProps {
|
|
83
|
+
customField: string;
|
|
84
|
+
}
|
|
85
|
+
export interface CustomFieldInputProps {
|
|
86
|
+
name: string;
|
|
87
|
+
value: unknown;
|
|
88
|
+
disabled?: boolean;
|
|
89
|
+
attribute?: {
|
|
90
|
+
type: string;
|
|
91
|
+
customField: string;
|
|
92
|
+
};
|
|
93
|
+
onChange?: (event: {
|
|
94
|
+
target: {
|
|
95
|
+
name: string;
|
|
96
|
+
value: unknown;
|
|
97
|
+
type: string;
|
|
98
|
+
};
|
|
99
|
+
}) => void;
|
|
100
|
+
[key: string]: unknown;
|
|
101
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ContentManagerPlugin, DocumentActionComponent, DocumentActionDescription, EditViewContext } from '@strapi/content-manager/strapi-admin';
|
|
2
|
+
export type AppPluginAPI = ContentManagerPlugin['config']['apis'];
|
|
3
|
+
export type ActionContext = EditViewContext;
|
|
4
|
+
export type ActionComponent = DocumentActionComponent;
|
|
5
|
+
export type ActionDescription = DocumentActionDescription;
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
import { ACTION_COLORS } from '../constants';
|
|
2
|
+
import { Struct } from '@strapi/strapi';
|
|
3
|
+
export interface CollectionData {
|
|
4
|
+
uid: string;
|
|
5
|
+
name: string;
|
|
6
|
+
kind: Struct.ContentTypeSchema['kind'] | 'others' | 'none';
|
|
7
|
+
}
|
|
8
|
+
export type Columns = keyof AuditLogsData;
|
|
9
|
+
export interface Pagination {
|
|
10
|
+
page: number;
|
|
11
|
+
pageSize: number;
|
|
12
|
+
pageCount: number;
|
|
13
|
+
total: number;
|
|
14
|
+
}
|
|
15
|
+
export interface AuditLogsData {
|
|
16
|
+
id: number;
|
|
17
|
+
documentId: string;
|
|
18
|
+
action: keyof typeof ACTION_COLORS;
|
|
19
|
+
collectionName: string;
|
|
20
|
+
collectionUid: string;
|
|
21
|
+
contentTypeKind: string;
|
|
22
|
+
relatedDocumentId: string;
|
|
23
|
+
actionFrom: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
}
|
|
26
|
+
export interface AuditLogData {
|
|
27
|
+
id: number;
|
|
28
|
+
documentId: string;
|
|
29
|
+
action: keyof typeof ACTION_COLORS;
|
|
30
|
+
collectionName: string;
|
|
31
|
+
collectionUid: string;
|
|
32
|
+
contentTypeKind: string;
|
|
33
|
+
relatedDocumentId: string;
|
|
34
|
+
actionFrom: string;
|
|
35
|
+
createdAt: string;
|
|
36
|
+
payload: string;
|
|
37
|
+
documentSchema: string;
|
|
38
|
+
documentLayout: string;
|
|
39
|
+
componentsSchema: string;
|
|
40
|
+
componentsLayout: string;
|
|
41
|
+
componentsNames: string;
|
|
42
|
+
}
|
|
43
|
+
export interface AuditLoginsData {
|
|
44
|
+
id: number;
|
|
45
|
+
documentId: string;
|
|
46
|
+
emailAddress: string;
|
|
47
|
+
loginResult: string;
|
|
48
|
+
requestTime: string;
|
|
49
|
+
userDetails: string;
|
|
50
|
+
userClient: string;
|
|
51
|
+
ipAddress: string;
|
|
52
|
+
loginErrorReason: string;
|
|
53
|
+
createdAt: string;
|
|
54
|
+
}
|
|
55
|
+
export interface GetAuditLogs {
|
|
56
|
+
collectionUid?: string;
|
|
57
|
+
query?: {
|
|
58
|
+
_q?: string;
|
|
59
|
+
sort?: string;
|
|
60
|
+
page?: number;
|
|
61
|
+
pageSize?: number;
|
|
62
|
+
};
|
|
63
|
+
}
|
|
64
|
+
export interface GetAuditLog {
|
|
65
|
+
collectionUid?: string;
|
|
66
|
+
documentId?: string;
|
|
67
|
+
query?: {
|
|
68
|
+
action?: string;
|
|
69
|
+
createdAt?: string;
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
export interface GetAuditLogins {
|
|
73
|
+
query?: {
|
|
74
|
+
_q?: string;
|
|
75
|
+
sort?: string;
|
|
76
|
+
page?: number;
|
|
77
|
+
pageSize?: number;
|
|
78
|
+
};
|
|
79
|
+
}
|
|
80
|
+
export type ResponseStatus = 'invalid' | 'network-error' | 'none';
|
|
81
|
+
export type GetAllCollectionsResponse = CollectionData[];
|
|
82
|
+
export interface GetAuditLogsResponse {
|
|
83
|
+
data: AuditLogsData[];
|
|
84
|
+
meta: Pagination;
|
|
85
|
+
}
|
|
86
|
+
export interface GetAuditLogResponse {
|
|
87
|
+
auditLog: AuditLogData;
|
|
88
|
+
relatedLogs: AuditLogsData[];
|
|
89
|
+
}
|
|
90
|
+
export interface GetAuditLoginsResponse {
|
|
91
|
+
data: AuditLoginsData[];
|
|
92
|
+
meta: Pagination;
|
|
93
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { DefaultTheme } from 'styled-components';
|
|
2
|
+
export interface SearchInputProps {
|
|
3
|
+
value: string;
|
|
4
|
+
wipeAction: () => void;
|
|
5
|
+
onChangeAction: (value: string) => void;
|
|
6
|
+
size?: 'S' | 'M';
|
|
7
|
+
}
|
|
8
|
+
export interface SidebarListItemProps {
|
|
9
|
+
active: boolean;
|
|
10
|
+
href: string;
|
|
11
|
+
label: string;
|
|
12
|
+
}
|
|
13
|
+
export interface SidebarListTitleProps {
|
|
14
|
+
title: string;
|
|
15
|
+
count: number;
|
|
16
|
+
}
|
|
17
|
+
export interface HeaderProps {
|
|
18
|
+
title: string | null | undefined;
|
|
19
|
+
count?: number;
|
|
20
|
+
backUrl?: string | null;
|
|
21
|
+
rightAction?: {
|
|
22
|
+
icon: React.ReactNode;
|
|
23
|
+
label: string;
|
|
24
|
+
url: string;
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
export interface EmptyStateProps {
|
|
28
|
+
content?: string;
|
|
29
|
+
hideAction?: boolean;
|
|
30
|
+
icon?: React.ReactNode;
|
|
31
|
+
action?: React.ReactNode;
|
|
32
|
+
}
|
|
33
|
+
export interface Colors {
|
|
34
|
+
backgroundColor: keyof DefaultTheme['colors'];
|
|
35
|
+
textColor: keyof DefaultTheme['colors'];
|
|
36
|
+
}
|
|
37
|
+
export type BadgeColors = Record<string, Colors>;
|
|
38
|
+
export interface TableProps<T extends Record<string, any>, S extends keyof T & string = keyof T & string> {
|
|
39
|
+
data: T[];
|
|
40
|
+
columns: {
|
|
41
|
+
/** Set which columns to show */
|
|
42
|
+
show: S[];
|
|
43
|
+
/** Set which shown columns will be overridden with specific labels */
|
|
44
|
+
override?: Partial<Record<S, string>>;
|
|
45
|
+
/** Badge properties */
|
|
46
|
+
badge?: {
|
|
47
|
+
/** Set the column which will serve as the badge */
|
|
48
|
+
column: NoInfer<S>;
|
|
49
|
+
/** Pass an object of badge column value and BadgeColor */
|
|
50
|
+
colors?: BadgeColors;
|
|
51
|
+
};
|
|
52
|
+
datetime?: S[];
|
|
53
|
+
};
|
|
54
|
+
/** Pass here the fields that will be joined, which then makes up the link which will happen when a row is clicked */
|
|
55
|
+
rowLink?: {
|
|
56
|
+
path: (keyof T & string)[];
|
|
57
|
+
params?: (keyof T & string)[];
|
|
58
|
+
};
|
|
59
|
+
pagination?: {
|
|
60
|
+
pageCount: number;
|
|
61
|
+
};
|
|
62
|
+
rowDialog?: (data: T, onClose: () => void) => React.JSX.Element;
|
|
63
|
+
}
|
|
64
|
+
export interface StatusProps {
|
|
65
|
+
value: string;
|
|
66
|
+
colors: BadgeColors;
|
|
67
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type TextCase = 'retain' | 'upper' | 'lower' | 'sentence' | 'capitalize';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { AuditLogsData } from './service.types';
|
|
2
|
+
export interface VersionsSidebarProps {
|
|
3
|
+
logs: AuditLogsData[];
|
|
4
|
+
isLoading: boolean;
|
|
5
|
+
isInvalid?: boolean;
|
|
6
|
+
hasError?: boolean;
|
|
7
|
+
}
|
|
8
|
+
export interface Version {
|
|
9
|
+
action: string;
|
|
10
|
+
createdAt: string;
|
|
11
|
+
}
|
|
12
|
+
export interface VersionButtonProps {
|
|
13
|
+
onClick: () => void;
|
|
14
|
+
version: AuditLogsData;
|
|
15
|
+
isCurrent: boolean;
|
|
16
|
+
active: boolean;
|
|
17
|
+
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { CollectionData } from '../types/service.types';
|
|
2
|
+
export declare const appendToContentManagerPath: (url: string) => string;
|
|
3
|
+
export declare const appendToPluginPath: (url: string) => string;
|
|
4
|
+
export declare const appendCollectionPath: (collection: CollectionData) => string;
|
|
5
|
+
export declare const stripPath: (url: string) => string;
|