@auditcore/ui-core 0.3.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.
- package/LICENSE +21 -0
- package/README.md +1326 -0
- package/dist/account/camera.d.ts +8 -0
- package/dist/account/controller.d.ts +30 -0
- package/dist/account/index.d.ts +7 -0
- package/dist/account/messages.d.ts +2 -0
- package/dist/account/port.d.ts +10 -0
- package/dist/account/presentation.d.ts +9 -0
- package/dist/account/types.d.ts +42 -0
- package/dist/account/view.d.ts +12 -0
- package/dist/attributes/controller.d.ts +26 -0
- package/dist/attributes/index.d.ts +5 -0
- package/dist/attributes/messages.d.ts +3 -0
- package/dist/attributes/port.d.ts +4 -0
- package/dist/attributes/types.d.ts +60 -0
- package/dist/attributes/view.d.ts +49 -0
- package/dist/base/icons.d.ts +38 -0
- package/dist/base/index.d.ts +3 -0
- package/dist/base/types.d.ts +3 -0
- package/dist/batchchecks/controller.d.ts +60 -0
- package/dist/batchchecks/index.d.ts +7 -0
- package/dist/batchchecks/messages.d.ts +3 -0
- package/dist/batchchecks/model.d.ts +38 -0
- package/dist/batchchecks/port.d.ts +6 -0
- package/dist/batchchecks/rest-port.d.ts +4 -0
- package/dist/batchchecks/types.d.ts +121 -0
- package/dist/batchchecks/view.d.ts +58 -0
- package/dist/benford/chart.d.ts +49 -0
- package/dist/benford/controller.d.ts +48 -0
- package/dist/benford/index.d.ts +7 -0
- package/dist/benford/messages.d.ts +3 -0
- package/dist/benford/model.d.ts +32 -0
- package/dist/benford/rest-port.d.ts +4 -0
- package/dist/benford/types.d.ts +144 -0
- package/dist/benford/view.d.ts +45 -0
- package/dist/dataprotection/dsfa.d.ts +55 -0
- package/dist/dataprotection/dsfaView.d.ts +45 -0
- package/dist/dataprotection/exporters.d.ts +33 -0
- package/dist/dataprotection/index.d.ts +10 -0
- package/dist/dataprotection/messages.d.ts +5 -0
- package/dist/dataprotection/registerView.d.ts +47 -0
- package/dist/dataprotection/requests.d.ts +16 -0
- package/dist/dataprotection/rest-port.d.ts +4 -0
- package/dist/dataprotection/types.d.ts +291 -0
- package/dist/dataprotection/vvt.d.ts +69 -0
- package/dist/dbkanban/controller.d.ts +54 -0
- package/dist/dbkanban/index.d.ts +3 -0
- package/dist/dbkanban/messages.d.ts +5 -0
- package/dist/dbkanban/view.d.ts +39 -0
- package/dist/documents/controller.d.ts +63 -0
- package/dist/documents/form.d.ts +52 -0
- package/dist/documents/importing.d.ts +12 -0
- package/dist/documents/index.d.ts +6 -0
- package/dist/documents/list.d.ts +21 -0
- package/dist/documents/messages.d.ts +8 -0
- package/dist/documents/view.d.ts +36 -0
- package/dist/download.d.ts +14 -0
- package/dist/extraction/controller.d.ts +34 -0
- package/dist/extraction/index.d.ts +5 -0
- package/dist/extraction/messages.d.ts +3 -0
- package/dist/extraction/rest-port.d.ts +4 -0
- package/dist/extraction/types.d.ts +115 -0
- package/dist/extraction/view.d.ts +35 -0
- package/dist/extrapolation/controller-subsample.d.ts +20 -0
- package/dist/extrapolation/controller.d.ts +72 -0
- package/dist/extrapolation/index.d.ts +9 -0
- package/dist/extrapolation/messages.d.ts +3 -0
- package/dist/extrapolation/model-design.d.ts +28 -0
- package/dist/extrapolation/model-subsample.d.ts +40 -0
- package/dist/extrapolation/model.d.ts +92 -0
- package/dist/extrapolation/rest-port.d.ts +4 -0
- package/dist/extrapolation/types.d.ts +255 -0
- package/dist/extrapolation/view-details.d.ts +46 -0
- package/dist/extrapolation/view.d.ts +50 -0
- package/dist/focus.d.ts +10 -0
- package/dist/geo/controller.d.ts +87 -0
- package/dist/geo/index.d.ts +6 -0
- package/dist/geo/mapView.d.ts +30 -0
- package/dist/geo/messages.d.ts +3 -0
- package/dist/geo/model.d.ts +43 -0
- package/dist/geo/rest-port.d.ts +12 -0
- package/dist/geo/types.d.ts +195 -0
- package/dist/i18n.d.ts +29 -0
- package/dist/identifiers/controller.d.ts +63 -0
- package/dist/identifiers/index.d.ts +5 -0
- package/dist/identifiers/messages.d.ts +3 -0
- package/dist/identifiers/model.d.ts +87 -0
- package/dist/identifiers/rest-port.d.ts +4 -0
- package/dist/identifiers/types.d.ts +101 -0
- package/dist/index.d.ts +33 -0
- package/dist/index.js +10676 -0
- package/dist/index.js.map +1 -0
- package/dist/kanban/index.d.ts +2 -0
- package/dist/kanban/messages.d.ts +6 -0
- package/dist/messages.d.ts +2 -0
- package/dist/reporting/controller.d.ts +46 -0
- package/dist/reporting/index.d.ts +5 -0
- package/dist/reporting/messages.d.ts +3 -0
- package/dist/reporting/rest-port.d.ts +4 -0
- package/dist/reporting/types.d.ts +72 -0
- package/dist/reporting/view.d.ts +12 -0
- package/dist/reporttemplates/controller.d.ts +46 -0
- package/dist/reporttemplates/index.d.ts +5 -0
- package/dist/reporttemplates/messages.d.ts +3 -0
- package/dist/reporttemplates/port.d.ts +4 -0
- package/dist/reporttemplates/types.d.ts +92 -0
- package/dist/reporttemplates/view.d.ts +27 -0
- package/dist/risk/controller.d.ts +54 -0
- package/dist/risk/format.d.ts +13 -0
- package/dist/risk/index.d.ts +7 -0
- package/dist/risk/labels.d.ts +9 -0
- package/dist/risk/messages.d.ts +3 -0
- package/dist/risk/port.d.ts +41 -0
- package/dist/risk/state.d.ts +61 -0
- package/dist/risk/types.d.ts +107 -0
- package/dist/runner/aktionen.d.ts +16 -0
- package/dist/runner/controller.d.ts +72 -0
- package/dist/runner/eingabe.d.ts +5 -0
- package/dist/runner/index.d.ts +9 -0
- package/dist/runner/messages.d.ts +3 -0
- package/dist/runner/port.d.ts +20 -0
- package/dist/runner/profil.d.ts +39 -0
- package/dist/runner/types.d.ts +109 -0
- package/dist/runner/view-listen.d.ts +32 -0
- package/dist/runner/view.d.ts +95 -0
- package/dist/samplesize/controller.d.ts +33 -0
- package/dist/samplesize/index.d.ts +7 -0
- package/dist/samplesize/messages.d.ts +3 -0
- package/dist/samplesize/model.d.ts +40 -0
- package/dist/samplesize/port.d.ts +9 -0
- package/dist/samplesize/types.d.ts +92 -0
- package/dist/samplesize/view.d.ts +39 -0
- package/dist/sampling/controller.d.ts +62 -0
- package/dist/sampling/index.d.ts +6 -0
- package/dist/sampling/messages.d.ts +3 -0
- package/dist/sampling/model.d.ts +63 -0
- package/dist/sampling/rest-port.d.ts +4 -0
- package/dist/sampling/types.d.ts +136 -0
- package/dist/sampling/view.d.ts +45 -0
- package/dist/screening/controller.d.ts +52 -0
- package/dist/screening/index.d.ts +8 -0
- package/dist/screening/messages.d.ts +7 -0
- package/dist/screening/rest-port.d.ts +4 -0
- package/dist/screening/runForm.d.ts +22 -0
- package/dist/screening/types.d.ts +295 -0
- package/dist/screening/view.d.ts +84 -0
- package/dist/store.d.ts +30 -0
- package/dist/synopsis/controller.d.ts +68 -0
- package/dist/synopsis/exporters.d.ts +16 -0
- package/dist/synopsis/index.d.ts +8 -0
- package/dist/synopsis/messages.d.ts +3 -0
- package/dist/synopsis/navigation.d.ts +5 -0
- package/dist/synopsis/port.d.ts +38 -0
- package/dist/synopsis/types.d.ts +121 -0
- package/dist/synopsis/viewModel.d.ts +74 -0
- package/dist/synopsis/wordDiff.d.ts +31 -0
- package/dist/table/index.d.ts +6 -0
- package/dist/tabular/index.d.ts +2 -0
- package/dist/tabular/messages.d.ts +3 -0
- package/dist/tabular/tableImport.d.ts +40 -0
- package/package.json +55 -0
- package/styles/account.css +37 -0
- package/styles/attributes.css +18 -0
- package/styles/base.css +116 -0
- package/styles/batchchecks.css +26 -0
- package/styles/benford.css +39 -0
- package/styles/dataprotection.css +68 -0
- package/styles/dbkanban.css +38 -0
- package/styles/documents.css +51 -0
- package/styles/extraction.css +25 -0
- package/styles/extrapolation.css +34 -0
- package/styles/geo.css +54 -0
- package/styles/identifiers.css +38 -0
- package/styles/index.css +24 -0
- package/styles/kanban.css +115 -0
- package/styles/reporting.css +22 -0
- package/styles/reporttemplates.css +21 -0
- package/styles/risk.css +92 -0
- package/styles/runner.css +54 -0
- package/styles/samplesize.css +27 -0
- package/styles/sampling.css +31 -0
- package/styles/screening.css +86 -0
- package/styles/synopsis.css +83 -0
- package/styles/table.css +17 -0
- package/styles/tabular.css +11 -0
- package/styles/tokens.css +121 -0
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/** Texte der Kanban-Komponenten; Englisch vorbereitet. */
|
|
2
|
+
export declare const kanbanMessages: import('..').Catalogs<"loading" | "progress" | "search" | "settings" | "share" | "saved" | "ageDays" | "board" | "readOnly" | "sharedBy" | "renameHint" | "renameLabel" | "searchPlaceholder" | "priorityFilter" | "allPriorities" | "dueFilter" | "allDue" | "resetFilter" | "filteredHint" | "fullscreen" | "addCard" | "addCardIn" | "newCardTitle" | "emptyColumn" | "wipLimit" | "cardCount" | "priority_hoch" | "priority_mittel" | "priority_niedrig" | "due_none" | "due_overdue" | "due_due_soon" | "due_later" | "dueOn" | "markDone" | "markOpen" | "moreTags" | "checklistProgress" | "attachments" | "links" | "ageNew" | "ageHours" | "ageWeeks" | "ageMonths" | "cardRole" | "moveInstructions" | "grabbed" | "movedTo" | "dropped" | "cancelled" | "moveDenied" | "wipWarning" | "errorPrefix" | "retry">;
|
|
3
|
+
/** Texte von Detailansicht, Einstellungen, Teilen und Boardliste. */
|
|
4
|
+
export declare const kanbanDialogMessages: import('..').Catalogs<"close" | "template" | "title" | "cancel" | "image" | "pin" | "checklist" | "save" | "description" | "columns" | "detailTitle" | "column" | "created" | "create" | "wipLimit" | "attachments" | "links" | "badge" | "badgePlaceholder" | "priority" | "due" | "clearDue" | "descriptionPlaceholder" | "tags" | "tagPlaceholder" | "removeTag" | "assignees" | "checklistSummary" | "checklistPlaceholder" | "removeItem" | "appearance" | "customColor" | "clearColor" | "uploadImage" | "removeImage" | "imageTooLarge" | "openLink" | "noAttachments" | "deleteCard" | "confirmDelete" | "updated" | "settingsTitle" | "settingsDescription" | "addColumn" | "newColumn" | "columnLabel" | "columnColor" | "doneColumn" | "moveUp" | "moveDown" | "removeColumn" | "removedHint" | "shareTitle" | "shareDescription" | "searchUser" | "permission" | "permission_read" | "permission_edit" | "addShare" | "noShares" | "revoke" | "confirmRevoke" | "boardsTitle" | "myBoards" | "sharedBoards" | "noBoards" | "newBoard" | "boardTitle" | "unpin" | "deleteBoard" | "confirmDeleteBoard" | "tasksDone" | "justNow" | "minutesAgo" | "hoursAgo" | "daysAgo" | "weeksAgo" | "role_owner" | "role_edit" | "role_read">;
|
|
5
|
+
export type KanbanMessageKey = keyof typeof kanbanMessages.de;
|
|
6
|
+
export type KanbanDialogMessageKey = keyof typeof kanbanDialogMessages.de;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
import { RequestState } from '../store';
|
|
3
|
+
import { FormatProfile, ReportingCatalogue, ReportingPort, ReportTableInput, WorkbookPreview, WorkbookRequest } from './types';
|
|
4
|
+
export type ReportingBusy = 'load' | 'preview' | 'export';
|
|
5
|
+
export type ReportingError = 'noTables' | 'profile';
|
|
6
|
+
export interface ReportingCallbacks {
|
|
7
|
+
previewed?: (result: WorkbookPreview) => void;
|
|
8
|
+
exported?: (file: DownloadFile) => void;
|
|
9
|
+
failed?: (message: string) => void;
|
|
10
|
+
}
|
|
11
|
+
export interface ReportingData extends RequestState<string> {
|
|
12
|
+
catalogue: ReportingCatalogue | null;
|
|
13
|
+
profileId: string | null;
|
|
14
|
+
filename: string;
|
|
15
|
+
preview: WorkbookPreview | null;
|
|
16
|
+
/** Vorschau passt nicht mehr zu Profil, Dateiname oder Tabellen. */
|
|
17
|
+
stale: boolean;
|
|
18
|
+
validation: ReportingError | null;
|
|
19
|
+
exportedName: string | null;
|
|
20
|
+
}
|
|
21
|
+
export interface ReportingSource {
|
|
22
|
+
port: () => ReportingPort | null | undefined;
|
|
23
|
+
tables: () => readonly ReportTableInput[];
|
|
24
|
+
callbacks?: () => ReportingCallbacks;
|
|
25
|
+
}
|
|
26
|
+
export declare const INITIAL_REPORTING: ReportingData;
|
|
27
|
+
export declare function reportingProfile(state: ReportingData): FormatProfile | null;
|
|
28
|
+
/** Anfrage aus Zustand und Tabellen oder der erste fehlende Punkt. */
|
|
29
|
+
export declare function buildWorkbookRequest(state: ReportingData, tables: readonly ReportTableInput[]): {
|
|
30
|
+
ok: true;
|
|
31
|
+
request: WorkbookRequest;
|
|
32
|
+
} | {
|
|
33
|
+
ok: false;
|
|
34
|
+
error: ReportingError;
|
|
35
|
+
};
|
|
36
|
+
export declare function createReportingController(source: ReportingSource): {
|
|
37
|
+
store: import('..').Store<ReportingData>;
|
|
38
|
+
load: () => Promise<void>;
|
|
39
|
+
preview: () => Promise<void>;
|
|
40
|
+
exportWorkbook: () => Promise<DownloadFile | null>;
|
|
41
|
+
setProfile: (profileId: string | null) => void;
|
|
42
|
+
setFilename: (filename: string) => void;
|
|
43
|
+
/** Tabellen der Anwendung haben sich geändert. */
|
|
44
|
+
tablesChanged: () => void;
|
|
45
|
+
};
|
|
46
|
+
export type ReportingController = ReturnType<typeof createReportingController>;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Texte des Tabellenexports (Berichtsexport nach Excel). */
|
|
2
|
+
export declare const reportingMessages: import('..').Catalogs<"loading" | "notice" | "data" | "filename" | "title" | "profile" | "noPort" | "exported" | "preview" | "columns" | "export" | "failed" | "choose" | "colName" | "errorprofile" | "profileSource" | "colSource" | "tablesSummary" | "noTables" | "profileVersion" | "errornoTables" | "excelMissing" | "previewStale" | "workbook" | "sheetHeading" | "colType" | "colFormat" | "sourceprofile" | "sourceoverride" | "sample" | "sampleMore">;
|
|
3
|
+
export type ReportingMessageKey = keyof typeof reportingMessages.de;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RestOptions } from '@auditcore/common';
|
|
2
|
+
import { ReportingPort } from './types';
|
|
3
|
+
/** Port auf den REST-Vertrag `reporting_ui/1` von `auditcore_reporting.web` (Starlette oder FastAPI). */
|
|
4
|
+
export declare function createReportingRestPort(options: RestOptions): ReportingPort;
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
/** Spaltentyp: `json` übernimmt den JSON-Typ wie gesendet; `date`/`datetime` erwarten ISO-Text. */
|
|
3
|
+
export type ReportColumnType = 'json' | 'text' | 'number' | 'boolean' | 'date' | 'datetime';
|
|
4
|
+
export type ReportCell = string | number | boolean | null;
|
|
5
|
+
/** Eine Tabelle (ein Blatt) der Anwendung; Zeilen in Spaltenreihenfolge. */
|
|
6
|
+
export interface ReportTableInput {
|
|
7
|
+
name: string;
|
|
8
|
+
columns: readonly string[];
|
|
9
|
+
rows: readonly (readonly ReportCell[])[];
|
|
10
|
+
types?: Readonly<Record<string, ReportColumnType>>;
|
|
11
|
+
/** Ausdrückliche Excel-Formate je Spalte (z. B. `"@"` für Kennungen). */
|
|
12
|
+
formats?: Readonly<Record<string, string>>;
|
|
13
|
+
}
|
|
14
|
+
export interface FormatProfile {
|
|
15
|
+
id: string;
|
|
16
|
+
label: string;
|
|
17
|
+
description: string;
|
|
18
|
+
version: string;
|
|
19
|
+
status: string;
|
|
20
|
+
/** Herkunft: `repository@commit` oder Art des Profils. */
|
|
21
|
+
source: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface ReportingCatalogue {
|
|
24
|
+
contract: string;
|
|
25
|
+
library: string;
|
|
26
|
+
excel_available: boolean;
|
|
27
|
+
profiles: readonly FormatProfile[];
|
|
28
|
+
column_types: readonly ReportColumnType[];
|
|
29
|
+
limits: {
|
|
30
|
+
max_rows_per_sheet: number;
|
|
31
|
+
max_columns: number;
|
|
32
|
+
max_sheets: number;
|
|
33
|
+
max_cells: number;
|
|
34
|
+
max_text_characters: number;
|
|
35
|
+
max_output_bytes: number;
|
|
36
|
+
max_body_bytes: number;
|
|
37
|
+
sample_rows: number;
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export interface WorkbookRequest {
|
|
41
|
+
profile: string;
|
|
42
|
+
tables: readonly ReportTableInput[];
|
|
43
|
+
filename?: string;
|
|
44
|
+
}
|
|
45
|
+
export interface ColumnPreview {
|
|
46
|
+
name: string;
|
|
47
|
+
type: ReportColumnType;
|
|
48
|
+
format: string;
|
|
49
|
+
source: 'profile' | 'override';
|
|
50
|
+
}
|
|
51
|
+
export interface TablePreview {
|
|
52
|
+
name: string;
|
|
53
|
+
rows: number;
|
|
54
|
+
columns: readonly ColumnPreview[];
|
|
55
|
+
sample: readonly (readonly ReportCell[])[];
|
|
56
|
+
}
|
|
57
|
+
export interface WorkbookPreview {
|
|
58
|
+
contract: string;
|
|
59
|
+
profile: string;
|
|
60
|
+
tables: readonly TablePreview[];
|
|
61
|
+
/** Probelauf des Exports; `null`, wenn das Extra `excel` fehlt. */
|
|
62
|
+
workbook: {
|
|
63
|
+
bytes: number;
|
|
64
|
+
filename: string;
|
|
65
|
+
} | null;
|
|
66
|
+
}
|
|
67
|
+
/** Schnittstelle der Komponente zur Fachlogik; Standardumsetzung: `createReportingRestPort`. */
|
|
68
|
+
export interface ReportingPort {
|
|
69
|
+
profiles(): Promise<ReportingCatalogue>;
|
|
70
|
+
preview(request: WorkbookRequest): Promise<WorkbookPreview>;
|
|
71
|
+
exportWorkbook(request: WorkbookRequest): Promise<DownloadFile>;
|
|
72
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Locale, Translate } from '../i18n';
|
|
2
|
+
import { ReportingMessageKey } from './messages';
|
|
3
|
+
import { ReportCell, ReportTableInput, TablePreview, WorkbookPreview } from './types';
|
|
4
|
+
export type ReportingTranslate = Translate<ReportingMessageKey>;
|
|
5
|
+
/** Zelle der Vorschau: Werte wie gesendet (Zahlen sprachabhängig), leer als „—“. */
|
|
6
|
+
export declare function reportCellText(value: ReportCell, locale: Locale): string;
|
|
7
|
+
export declare function reportingTablesText(tables: readonly ReportTableInput[], t: ReportingTranslate, locale: Locale): string;
|
|
8
|
+
export declare function reportingWorkbookText(preview: WorkbookPreview, t: ReportingTranslate, locale: Locale): string;
|
|
9
|
+
export declare function reportingSheetHeading(table: TablePreview, t: ReportingTranslate, locale: Locale): string;
|
|
10
|
+
/** Hinweis, wenn die Vorschau nur einen Teil der Zeilen zeigt; sonst leer. */
|
|
11
|
+
export declare function reportingSampleNote(table: TablePreview, t: ReportingTranslate, locale: Locale): string;
|
|
12
|
+
export declare function reportingErrorKey(error: 'noTables' | 'profile'): ReportingMessageKey;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
import { RequestState, Store } from '../store';
|
|
3
|
+
import { ReporttemplatesPort, TemplateCatalogue, TemplateData, TemplateDetail, TemplateFormat, TemplatePreview, TemplateRequest } from './types';
|
|
4
|
+
export interface ReporttemplatesCallbacks {
|
|
5
|
+
selected?: (detail: TemplateDetail) => void;
|
|
6
|
+
previewed?: (result: TemplatePreview) => void;
|
|
7
|
+
rendered?: (file: DownloadFile) => void;
|
|
8
|
+
failed?: (message: string) => void;
|
|
9
|
+
}
|
|
10
|
+
/** Stand; `error` ist die Meldung der letzten abgelehnten Anfrage. */
|
|
11
|
+
export interface ReporttemplatesData extends RequestState<string> {
|
|
12
|
+
catalogue: TemplateCatalogue | null;
|
|
13
|
+
templateId: string | null;
|
|
14
|
+
detail: TemplateDetail | null;
|
|
15
|
+
format: TemplateFormat | null;
|
|
16
|
+
designId: string | null;
|
|
17
|
+
filename: string;
|
|
18
|
+
preview: TemplatePreview | null;
|
|
19
|
+
/** Vorschau passt nicht mehr zu Vorlage, Gestaltung oder Daten. */
|
|
20
|
+
stale: boolean;
|
|
21
|
+
renderedName: string | null;
|
|
22
|
+
}
|
|
23
|
+
export interface ReporttemplatesSource {
|
|
24
|
+
port: () => ReporttemplatesPort | null | undefined;
|
|
25
|
+
/** Daten der Anwendung; ohne Daten gelten die Beispieldaten der Vorlage. */
|
|
26
|
+
data?: () => TemplateData | null | undefined;
|
|
27
|
+
callbacks?: () => ReporttemplatesCallbacks;
|
|
28
|
+
}
|
|
29
|
+
export interface ReporttemplatesController {
|
|
30
|
+
store: Store<ReporttemplatesData>;
|
|
31
|
+
load: () => Promise<void>;
|
|
32
|
+
select: (id: string | null) => Promise<void>;
|
|
33
|
+
preview: () => Promise<void>;
|
|
34
|
+
render: () => Promise<DownloadFile | null>;
|
|
35
|
+
setFormat: (format: TemplateFormat | null) => void;
|
|
36
|
+
setDesign: (designId: string | null) => void;
|
|
37
|
+
setFilename: (filename: string) => void;
|
|
38
|
+
/** Daten der Anwendung haben sich geändert. */
|
|
39
|
+
dataChanged: () => void;
|
|
40
|
+
}
|
|
41
|
+
export declare const INITIAL_REPORTTEMPLATES: ReporttemplatesData;
|
|
42
|
+
/** Daten für Vorschau und Bericht: die der Anwendung, sonst die Beispieldaten. */
|
|
43
|
+
export declare function reporttemplatesData(state: ReporttemplatesData, data: TemplateData | null | undefined): TemplateData | null;
|
|
44
|
+
/** Anfrage aus Zustand und Daten oder `null`, solange keine Vorlage geladen ist. */
|
|
45
|
+
export declare function buildTemplateRequest(state: ReporttemplatesData, data: TemplateData | null | undefined): TemplateRequest | null;
|
|
46
|
+
export declare function createReporttemplatesController(source: ReporttemplatesSource): ReporttemplatesController;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Texte der Berichtsvorlagen (Vue `ReportTemplates`, React `FlowauditReportTemplates`); sichtbare Texte nur hier. */
|
|
2
|
+
export declare const reporttemplatesMessages: import('..').Catalogs<"loading" | "notice" | "data" | "filename" | "template" | "title" | "invalid" | "empty" | "field" | "version" | "format" | "noPort" | "yes" | "no" | "preview" | "required" | "failed" | "choose" | "design" | "previewStale" | "valid" | "loadingDetail" | "kindstructured" | "kinddocx" | "contract" | "fieldType" | "fieldRequired" | "textBlocks" | "conditional" | "legalBasis" | "dataGiven" | "dataSample" | "render" | "formatMissing" | "usedBlocks" | "noBlocks" | "previewFrame" | "rendered">;
|
|
3
|
+
export type ReporttemplatesMessageKey = keyof typeof reporttemplatesMessages.de;
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { RestOptions } from '@auditcore/common';
|
|
2
|
+
import { ReporttemplatesPort } from './types';
|
|
3
|
+
/** Port auf die Vorlagen-Endpunkte von `reporting_ui/1` (`auditcore_reporting.web`, Starlette oder FastAPI). */
|
|
4
|
+
export declare function createReportTemplatesRestPort(options: RestOptions): ReporttemplatesPort;
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
import { DownloadFile } from '@auditcore/common';
|
|
2
|
+
export type TemplateFormat = 'docx' | 'pdf' | 'html';
|
|
3
|
+
/** Daten gemäß Datenvertrag (JSON-Schema) der Vorlage. */
|
|
4
|
+
export type TemplateData = Readonly<Record<string, unknown>>;
|
|
5
|
+
export interface TemplateSummary {
|
|
6
|
+
id: string;
|
|
7
|
+
version: string;
|
|
8
|
+
/** Anzeigename ohne Platzhalter. */
|
|
9
|
+
title: string;
|
|
10
|
+
/** Dokumenttitel mit Platzhaltern, z. B. `Prüfbericht {{ aktenzeichen }}`. */
|
|
11
|
+
document_title: string;
|
|
12
|
+
description: string;
|
|
13
|
+
status: string;
|
|
14
|
+
/** `structured` (Blöcke: DOCX, PDF, HTML) oder `docx` (Word-Vorlage: DOCX). */
|
|
15
|
+
kind: 'structured' | 'docx';
|
|
16
|
+
formats: readonly TemplateFormat[];
|
|
17
|
+
fingerprint: string;
|
|
18
|
+
versions: readonly string[];
|
|
19
|
+
}
|
|
20
|
+
export interface DesignProfileInfo {
|
|
21
|
+
id: string;
|
|
22
|
+
version: string;
|
|
23
|
+
label: string;
|
|
24
|
+
}
|
|
25
|
+
export interface TemplateCatalogue {
|
|
26
|
+
contract: string;
|
|
27
|
+
templates: readonly TemplateSummary[];
|
|
28
|
+
designs: readonly DesignProfileInfo[];
|
|
29
|
+
/** Auf dem Server verfügbare Formate (`pdf` braucht das Extra `pdf`). */
|
|
30
|
+
formats: Readonly<Record<TemplateFormat, boolean>>;
|
|
31
|
+
}
|
|
32
|
+
export interface TemplateTextBlock {
|
|
33
|
+
id: string;
|
|
34
|
+
title: string;
|
|
35
|
+
text: string;
|
|
36
|
+
required: boolean;
|
|
37
|
+
legal_basis: string;
|
|
38
|
+
condition: unknown;
|
|
39
|
+
}
|
|
40
|
+
/** JSON-Schema-Teilmenge des Datenvertrags. */
|
|
41
|
+
export interface TemplateSchema {
|
|
42
|
+
type?: string | readonly string[];
|
|
43
|
+
title?: string;
|
|
44
|
+
description?: string;
|
|
45
|
+
required?: readonly string[];
|
|
46
|
+
properties?: Readonly<Record<string, TemplateSchema>>;
|
|
47
|
+
items?: TemplateSchema;
|
|
48
|
+
format?: string;
|
|
49
|
+
enum?: readonly unknown[];
|
|
50
|
+
}
|
|
51
|
+
export interface TemplateDetail extends TemplateSummary {
|
|
52
|
+
contract: string;
|
|
53
|
+
schema: TemplateSchema;
|
|
54
|
+
sample: TemplateData;
|
|
55
|
+
conditions: Readonly<Record<string, unknown>>;
|
|
56
|
+
text_blocks: readonly TemplateTextBlock[];
|
|
57
|
+
}
|
|
58
|
+
export interface DataIssue {
|
|
59
|
+
/** JSON-Pfad, z. B. `$.feststellungen[0].betrag`. */
|
|
60
|
+
path: string;
|
|
61
|
+
message: string;
|
|
62
|
+
}
|
|
63
|
+
export interface TemplatePreview {
|
|
64
|
+
contract: string;
|
|
65
|
+
template: {
|
|
66
|
+
id: string;
|
|
67
|
+
version: string;
|
|
68
|
+
fingerprint: string;
|
|
69
|
+
};
|
|
70
|
+
valid: boolean;
|
|
71
|
+
issues: readonly DataIssue[];
|
|
72
|
+
/** Vollständige HTML-Seite ohne Skripte (Anzeige im abgeschotteten iframe). */
|
|
73
|
+
html: string | null;
|
|
74
|
+
text_blocks: readonly string[];
|
|
75
|
+
data_sha256: string | null;
|
|
76
|
+
}
|
|
77
|
+
export interface TemplateRequest {
|
|
78
|
+
data: TemplateData;
|
|
79
|
+
version?: string;
|
|
80
|
+
design?: string;
|
|
81
|
+
}
|
|
82
|
+
export interface TemplateRenderRequest extends TemplateRequest {
|
|
83
|
+
format: TemplateFormat;
|
|
84
|
+
filename?: string;
|
|
85
|
+
}
|
|
86
|
+
/** Fachlogik hinter der Oberfläche; Standardumsetzung: `createReportTemplatesRestPort`. */
|
|
87
|
+
export interface ReporttemplatesPort {
|
|
88
|
+
templates: () => Promise<TemplateCatalogue>;
|
|
89
|
+
template: (id: string, version?: string) => Promise<TemplateDetail>;
|
|
90
|
+
preview: (id: string, request: TemplateRequest) => Promise<TemplatePreview>;
|
|
91
|
+
render: (id: string, request: TemplateRenderRequest) => Promise<DownloadFile>;
|
|
92
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { ReporttemplatesData } from './controller';
|
|
2
|
+
import { TemplateDetail, TemplateFormat } from './types';
|
|
3
|
+
/** Zeile der Datenvertrags-Übersicht (oberste Ebene des Schemas). */
|
|
4
|
+
export interface SchemaFieldRow {
|
|
5
|
+
name: string;
|
|
6
|
+
title: string;
|
|
7
|
+
type: string;
|
|
8
|
+
required: boolean;
|
|
9
|
+
}
|
|
10
|
+
export interface TextBlockRow {
|
|
11
|
+
id: string;
|
|
12
|
+
title: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
conditional: boolean;
|
|
15
|
+
legalBasis: string;
|
|
16
|
+
}
|
|
17
|
+
export interface FormatOption {
|
|
18
|
+
format: TemplateFormat;
|
|
19
|
+
available: boolean;
|
|
20
|
+
}
|
|
21
|
+
export declare function schemaFields(detail: TemplateDetail | null): SchemaFieldRow[];
|
|
22
|
+
export declare function textBlockRows(detail: TemplateDetail | null): TextBlockRow[];
|
|
23
|
+
export declare function formatOptions(state: ReporttemplatesData): FormatOption[];
|
|
24
|
+
/** Bericht erzeugen ist möglich: Vorlage geladen, Format gewählt und auf dem Server verfügbar. */
|
|
25
|
+
export declare function reporttemplatesCanRender(state: ReporttemplatesData): boolean;
|
|
26
|
+
/** Hinweis „keine Vorlagen“ nur nach abgeschlossener, fehlerfreier Anfrage. */
|
|
27
|
+
export declare function reporttemplatesIsEmpty(state: ReporttemplatesData): boolean;
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import { TableColumn, TableRow } from '@auditcore/common';
|
|
2
|
+
import { Translate } from '../i18n';
|
|
3
|
+
import { RiskMessageKey } from './messages';
|
|
4
|
+
import { RiskPort } from './port';
|
|
5
|
+
import { FlagEntry, RiskDistributionRow, RiskFilter, Totals } from './state';
|
|
6
|
+
import { DatasetFinding, Evaluation, ProfileDetail, ProfileReference, RecordView, RuleView } from './types';
|
|
7
|
+
export type RiskTranslate = Translate<RiskMessageKey>;
|
|
8
|
+
/** Eingaben der Gesamtansicht (Props). */
|
|
9
|
+
export interface RiskInputs {
|
|
10
|
+
evaluation?: Evaluation | null;
|
|
11
|
+
profile?: ProfileDetail | null;
|
|
12
|
+
port?: RiskPort | null;
|
|
13
|
+
}
|
|
14
|
+
export interface RiskData {
|
|
15
|
+
filter: RiskFilter;
|
|
16
|
+
selectedIndex: number | null;
|
|
17
|
+
/** Übergebene oder über den Port nachgeladene Profilbeschreibung. */
|
|
18
|
+
profile: ProfileDetail | null;
|
|
19
|
+
profileError: string;
|
|
20
|
+
}
|
|
21
|
+
/** Alles, was die Gesamtansicht aus Stand und Auswertung anzeigt (reine Funktion). */
|
|
22
|
+
export interface RiskSelection {
|
|
23
|
+
rules: RuleView[];
|
|
24
|
+
codes: string[];
|
|
25
|
+
rows: RiskDistributionRow[];
|
|
26
|
+
totals: Totals;
|
|
27
|
+
dataset: DatasetFinding[];
|
|
28
|
+
records: RecordView[];
|
|
29
|
+
tableColumns: TableColumn[];
|
|
30
|
+
tableRows: TableRow[];
|
|
31
|
+
selected: RecordView | null;
|
|
32
|
+
entries: FlagEntry[];
|
|
33
|
+
}
|
|
34
|
+
export declare const EMPTY_EVALUATION: Evaluation;
|
|
35
|
+
export declare function riskTableColumns(rules: readonly RuleView[], recordText: string): TableColumn[];
|
|
36
|
+
export declare function riskTableRows(evaluation: Evaluation, records: readonly RecordView[], rules: readonly RuleView[]): TableRow[];
|
|
37
|
+
export declare function selectRisk(state: Pick<RiskData, 'filter' | 'selectedIndex'>, given: Evaluation | null | undefined, recordText: string): RiskSelection;
|
|
38
|
+
/** Sichtbarer Profilstatus („freigegeben“ …) oder der Rohwert. */
|
|
39
|
+
export declare function profileStatusText(profile: ProfileReference | null | undefined, t: RiskTranslate): string;
|
|
40
|
+
/** Warnhinweis für nicht freigegebene Profile, sonst leer. */
|
|
41
|
+
export declare function profileHintText(profile: ProfileReference | null | undefined, t: RiskTranslate): string;
|
|
42
|
+
export declare function createRiskController(): {
|
|
43
|
+
store: import('..').Store<RiskData>;
|
|
44
|
+
loadProfile: (inputs: RiskInputs, latest: () => RiskInputs) => Promise<void>;
|
|
45
|
+
setFilter: (filter: RiskFilter) => void;
|
|
46
|
+
/** Klick auf einen Code der Verteilung: nach diesem Merkmal filtern (Treffer oder unbestimmt). */
|
|
47
|
+
selectCode: (code: string) => void;
|
|
48
|
+
/** Datensatz wählen; erneuter Klick hebt die Auswahl auf. Liefert die neue Auswahl. */
|
|
49
|
+
toggleRecord(index: number): number | null;
|
|
50
|
+
select: (index: number | null) => void;
|
|
51
|
+
/** Neue Auswertung: Auswahl aufheben. */
|
|
52
|
+
resetSelection: () => void;
|
|
53
|
+
};
|
|
54
|
+
export type RiskController = ReturnType<typeof createRiskController>;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Locale } from '../i18n';
|
|
2
|
+
import { JsonValue } from './types';
|
|
3
|
+
import { FlagState } from './state';
|
|
4
|
+
/** Farbton wie `FaBadge` (`tone`). */
|
|
5
|
+
export type Tone = 'neutral' | 'accent' | 'success' | 'warning' | 'danger';
|
|
6
|
+
export declare function formatValue(value: JsonValue | undefined, locale: Locale, empty: string): string;
|
|
7
|
+
export declare function formatShare(share: number, locale: Locale): string;
|
|
8
|
+
export declare function formatAmount(value: number | null, locale: Locale): string;
|
|
9
|
+
export declare function severityTone(severity: string | null): Tone;
|
|
10
|
+
/** Symbol je Zustand: Farbe ist nie der einzige Träger der Bedeutung. */
|
|
11
|
+
export declare const STATE_ICONS: Readonly<Record<FlagState, string>>;
|
|
12
|
+
export declare function stateTone(state: FlagState): Tone;
|
|
13
|
+
export declare function parameterLabel(key: string, locale: Locale): string;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
export { riskMessages, type RiskMessageKey } from './messages';
|
|
2
|
+
export * from './types';
|
|
3
|
+
export * from './state';
|
|
4
|
+
export * from './format';
|
|
5
|
+
export * from './labels';
|
|
6
|
+
export { createRiskRestPort, type ColumnCheck, type EvaluateRequest, type ProfileSummary, type RiskPort } from './port';
|
|
7
|
+
export * from './controller';
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { RiskMessageKey } from './messages';
|
|
2
|
+
import { FlagState, StateFilter } from './state';
|
|
3
|
+
export declare const STATE_KEYS: Readonly<Record<FlagState, RiskMessageKey>>;
|
|
4
|
+
export declare const STATE_FILTER_KEYS: Readonly<Record<StateFilter, RiskMessageKey>>;
|
|
5
|
+
export declare function statusKey(status: string): RiskMessageKey | null;
|
|
6
|
+
/** Hinweis für nicht freigegebene Profile, sonst `null`. */
|
|
7
|
+
export declare function statusHintKey(status: string): RiskMessageKey | null;
|
|
8
|
+
export declare function requirementKey(requirement: string): RiskMessageKey;
|
|
9
|
+
export declare function whenMissingKey(mode: string): RiskMessageKey;
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
/** Sichtbare Texte der Risiko-Komponenten (Deutsch vollständig, Englisch vorbereitet). */
|
|
2
|
+
export declare const riskMessages: import('..').Catalogs<"close" | "status" | "source" | "title" | "reason" | "value" | "filterAll" | "note" | "profile" | "field" | "version" | "origin" | "severity" | "required" | "inputs" | "fingerprint" | "statusApproved" | "statusLegacy" | "statusCandidate" | "statusHintLegacy" | "statusHintCandidate" | "stateHit" | "stateUndetermined" | "stateClear" | "stateSkipped" | "stateAbsent" | "stateCell" | "summaryTitle" | "summaryCaption" | "colCode" | "colLabel" | "colHits" | "colShare" | "colUndetermined" | "colVolume" | "colRecord" | "colFlags" | "totalsRecords" | "totalsHits" | "totalsUndetermined" | "totalsSkipped" | "skippedTitle" | "skippedHint" | "missingColumns" | "datasetTitle" | "reasonCount" | "filterTitle" | "filterCode" | "filterCodeAll" | "filterState" | "filterAffected" | "filterQuery" | "filterResult" | "tableCaption" | "noRecords" | "detailTitle" | "detailEmpty" | "detailNone" | "emptyValue" | "parameters" | "evidence" | "assessment" | "profileInfo" | "rulesTitle" | "fieldsTitle" | "colMeaning" | "colRequirement" | "colMissing" | "colWhenMissing" | "valueRequired" | "optional" | "missingError" | "missingSkip" | "missingAllFalse" | "missingUndetermined" | "undocumented" | "openDecisions">;
|
|
3
|
+
export type RiskMessageKey = keyof typeof riskMessages.de;
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { RestOptions } from '@auditcore/common';
|
|
2
|
+
import { Evaluation, JsonObject, ProfileDetail, ProfileReference } from './types';
|
|
3
|
+
export interface EvaluateRequest {
|
|
4
|
+
profile: {
|
|
5
|
+
id: string;
|
|
6
|
+
version: string;
|
|
7
|
+
};
|
|
8
|
+
records: readonly JsonObject[];
|
|
9
|
+
columns?: readonly string[];
|
|
10
|
+
reference_date?: string;
|
|
11
|
+
record_key?: string;
|
|
12
|
+
flatten?: boolean;
|
|
13
|
+
points?: Readonly<Record<string, number>>;
|
|
14
|
+
}
|
|
15
|
+
export interface ProfileSummary extends ProfileReference {
|
|
16
|
+
kind: string;
|
|
17
|
+
legal_status: string;
|
|
18
|
+
rule_count: number;
|
|
19
|
+
field_count: number;
|
|
20
|
+
open_decision_count: number;
|
|
21
|
+
}
|
|
22
|
+
export interface ColumnCheck {
|
|
23
|
+
profile: ProfileReference;
|
|
24
|
+
columns: string[];
|
|
25
|
+
complete: boolean;
|
|
26
|
+
aborts: boolean;
|
|
27
|
+
rules: Array<{
|
|
28
|
+
code: string;
|
|
29
|
+
label: string;
|
|
30
|
+
missing: string[];
|
|
31
|
+
when_missing_columns: string;
|
|
32
|
+
}>;
|
|
33
|
+
}
|
|
34
|
+
export interface RiskPort {
|
|
35
|
+
profiles(): Promise<ProfileSummary[]>;
|
|
36
|
+
profile(id: string, version: string): Promise<ProfileDetail>;
|
|
37
|
+
checkColumns(id: string, version: string, columns: readonly string[]): Promise<ColumnCheck>;
|
|
38
|
+
evaluate(request: EvaluateRequest): Promise<Evaluation>;
|
|
39
|
+
}
|
|
40
|
+
/** REST-Umsetzung des Ports, z. B. `createRiskRestPort({ baseUrl: '/api/risk' })`. */
|
|
41
|
+
export declare function createRiskRestPort(options: RestOptions): RiskPort;
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { DatasetFinding, Evaluation, JsonObject, JsonValue, RecordView, RuleView } from './types';
|
|
2
|
+
/** Zustand einer Regel für einen Datensatz. */
|
|
3
|
+
export type FlagState = 'hit' | 'clear' | 'undetermined' | 'skipped' | 'absent';
|
|
4
|
+
export declare const FLAG_STATES: readonly FlagState[];
|
|
5
|
+
export declare function flagState(record: RecordView, code: string, skipped: Readonly<Record<string, string>>): FlagState;
|
|
6
|
+
/** Regeln der Auswertung; ohne `rules` aus den Codes der Datensätze abgeleitet. */
|
|
7
|
+
export declare function evaluationRules(evaluation: Evaluation): RuleView[];
|
|
8
|
+
export declare function recordRules(evaluation: Evaluation): RuleView[];
|
|
9
|
+
export interface RiskDistributionRow {
|
|
10
|
+
code: string;
|
|
11
|
+
label: string;
|
|
12
|
+
hit: number;
|
|
13
|
+
clear: number;
|
|
14
|
+
undetermined: number;
|
|
15
|
+
total: number;
|
|
16
|
+
/** Anteil der Treffer an allen Datensätzen (0–1). */
|
|
17
|
+
share: number;
|
|
18
|
+
skipped: string | null;
|
|
19
|
+
/** Begründung → Anzahl der unbestimmten Datensätze. */
|
|
20
|
+
reasons: Record<string, number>;
|
|
21
|
+
/** Volumen laut Zusammenfassung des Profils, falls vorhanden. */
|
|
22
|
+
volume: number | null;
|
|
23
|
+
}
|
|
24
|
+
/** Verteilung je Regel in Profilreihenfolge (nur Datensatzregeln). */
|
|
25
|
+
export declare function distribution(evaluation: Evaluation): RiskDistributionRow[];
|
|
26
|
+
export interface Totals {
|
|
27
|
+
records: number;
|
|
28
|
+
withHits: number;
|
|
29
|
+
withUndetermined: number;
|
|
30
|
+
skippedRules: number;
|
|
31
|
+
}
|
|
32
|
+
export declare function totals(evaluation: Evaluation): Totals;
|
|
33
|
+
export declare function triggeredDataset(evaluation: Evaluation): DatasetFinding[];
|
|
34
|
+
/** Filter: `affected` = Treffer oder unbestimmt; `all` = jeder Datensatz. */
|
|
35
|
+
export type StateFilter = 'affected' | 'hit' | 'undetermined' | 'clear' | 'all';
|
|
36
|
+
export interface RiskFilter {
|
|
37
|
+
code: string | null;
|
|
38
|
+
state: StateFilter;
|
|
39
|
+
query: string;
|
|
40
|
+
}
|
|
41
|
+
export declare const DEFAULT_FILTER: RiskFilter;
|
|
42
|
+
export declare function recordLabel(record: RecordView): string;
|
|
43
|
+
export declare function filterRecords(evaluation: Evaluation, filter: RiskFilter): RecordView[];
|
|
44
|
+
/** Ein Eintrag der Detailansicht: Treffer oder unbestimmtes Merkmal eines Datensatzes. */
|
|
45
|
+
export interface FlagEntry {
|
|
46
|
+
code: string;
|
|
47
|
+
label: string;
|
|
48
|
+
state: 'hit' | 'undetermined';
|
|
49
|
+
reason: string;
|
|
50
|
+
severity: string | null;
|
|
51
|
+
note: string | null;
|
|
52
|
+
inputs: JsonObject;
|
|
53
|
+
parameters: JsonObject;
|
|
54
|
+
evidence: JsonObject;
|
|
55
|
+
origin: JsonObject;
|
|
56
|
+
messages: Record<string, string> | null;
|
|
57
|
+
}
|
|
58
|
+
/** Treffer und unbestimmte Merkmale eines Datensatzes in Profilreihenfolge. */
|
|
59
|
+
export declare function recordEntries(record: RecordView, rules: readonly RuleView[]): FlagEntry[];
|
|
60
|
+
/** Objekt als Liste `[Schlüssel, Wert]` in Einfügereihenfolge (für deklarative Tabellen). */
|
|
61
|
+
export declare function pairs(value: JsonObject | null | undefined): Array<[string, JsonValue]>;
|