@striae-org/striae 3.2.1 → 3.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/app/components/actions/case-export/core-export.ts +2 -2
- package/app/components/actions/case-export/data-processing.ts +19 -4
- package/app/components/actions/case-export/download-handlers.ts +57 -8
- package/app/components/actions/case-export/metadata-helpers.ts +1 -1
- package/app/components/actions/case-import/annotation-import.ts +2 -2
- package/app/components/actions/case-import/confirmation-import.ts +44 -20
- package/app/components/actions/case-import/confirmation-package.ts +86 -0
- package/app/components/actions/case-import/image-operations.ts +1 -1
- package/app/components/actions/case-import/index.ts +1 -0
- package/app/components/actions/case-import/orchestrator.ts +16 -6
- package/app/components/actions/case-import/storage-operations.ts +7 -7
- package/app/components/actions/case-import/validation.ts +7 -100
- package/app/components/actions/case-import/zip-processing.ts +47 -5
- package/app/components/actions/case-manage.ts +3 -3
- package/app/components/actions/confirm-export.ts +47 -16
- package/app/components/actions/generate-pdf.ts +3 -3
- package/app/components/actions/image-manage.ts +3 -3
- package/app/components/actions/notes-manage.ts +3 -3
- package/app/components/actions/signout.tsx +1 -1
- package/app/components/audit/user-audit-viewer.tsx +2 -3
- package/app/components/auth/auth-provider.tsx +2 -2
- package/app/components/auth/mfa-enrollment.tsx +3 -3
- package/app/components/auth/mfa-verification.tsx +4 -4
- package/app/components/canvas/box-annotations/box-annotations.tsx +2 -2
- package/app/components/canvas/canvas.tsx +1 -1
- package/app/components/canvas/confirmation/confirmation.tsx +1 -1
- package/app/components/form/form-button.tsx +1 -1
- package/app/components/form/form.module.css +9 -0
- package/app/components/public-signing-key-modal/public-signing-key-modal.module.css +163 -49
- package/app/components/public-signing-key-modal/public-signing-key-modal.tsx +365 -88
- package/app/components/sidebar/case-export/case-export.tsx +2 -54
- package/app/components/sidebar/case-import/case-import.tsx +20 -8
- package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +1 -1
- package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +1 -1
- package/app/components/sidebar/case-import/hooks/useFilePreview.ts +9 -7
- package/app/components/sidebar/case-import/hooks/useImportExecution.ts +2 -2
- package/app/components/sidebar/case-import/utils/file-validation.ts +57 -2
- package/app/components/sidebar/cases/case-sidebar.tsx +106 -50
- package/app/components/sidebar/cases/cases-modal.tsx +1 -1
- package/app/components/sidebar/cases/cases.module.css +101 -18
- package/app/components/sidebar/files/files-modal.tsx +3 -2
- package/app/components/sidebar/notes/notes-sidebar.tsx +3 -3
- package/app/components/sidebar/notes/notes.module.css +33 -13
- package/app/components/sidebar/sidebar-container.tsx +4 -3
- package/app/components/sidebar/sidebar.tsx +2 -2
- package/app/components/sidebar/upload/image-upload-zone.tsx +2 -2
- package/app/components/theme-provider/theme-provider.tsx +1 -1
- package/app/components/user/delete-account.tsx +1 -1
- package/app/components/user/manage-profile.tsx +3 -3
- package/app/components/user/mfa-phone-update.tsx +17 -14
- package/app/contexts/auth.context.ts +1 -1
- package/app/root.tsx +2 -2
- package/app/routes/auth/emailActionHandler.tsx +2 -2
- package/app/routes/auth/emailVerification.tsx +2 -2
- package/app/routes/auth/login.tsx +134 -11
- package/app/routes/auth/passwordReset.tsx +2 -2
- package/app/routes/striae/striae.tsx +2 -2
- package/app/services/audit/audit-console-logger.ts +46 -0
- package/app/services/audit/audit-export-csv.ts +126 -0
- package/app/services/audit/audit-export-report.ts +174 -0
- package/app/services/audit/audit-export-signing.ts +85 -0
- package/app/services/audit/audit-export.service.ts +334 -0
- package/app/services/audit/audit-file-type.ts +13 -0
- package/app/services/audit/audit-query-helpers.ts +88 -0
- package/app/services/audit/audit-worker-client.ts +95 -0
- package/app/services/audit/audit.service.ts +990 -0
- package/app/services/audit/builders/audit-entry-builder.ts +32 -0
- package/app/services/audit/builders/audit-event-builders-annotation.ts +150 -0
- package/app/services/audit/builders/audit-event-builders-case-file.ts +249 -0
- package/app/services/audit/builders/audit-event-builders-user-security.ts +449 -0
- package/app/services/audit/builders/audit-event-builders-workflow.ts +272 -0
- package/app/services/audit/builders/index.ts +40 -0
- package/app/services/audit/index.ts +2 -0
- package/app/types/case.ts +2 -2
- package/app/types/exceljs-bare.d.ts +3 -1
- package/app/types/user.ts +1 -1
- package/app/utils/SHA256.ts +5 -1
- package/app/utils/audit-export-signature.ts +2 -2
- package/app/utils/confirmation-signature.ts +8 -4
- package/app/utils/data-operations.ts +5 -5
- package/app/utils/export-verification.ts +353 -0
- package/app/utils/mfa-phone.ts +1 -1
- package/app/utils/mfa.ts +1 -1
- package/app/utils/permissions.ts +2 -2
- package/app/utils/signature-utils.ts +74 -4
- package/package.json +11 -9
- package/public/favicon.ico +0 -0
- package/public/icon-256.png +0 -0
- package/public/icon-512.png +0 -0
- package/public/manifest.json +39 -0
- package/public/shortcut.png +0 -0
- package/public/social-image.png +0 -0
- package/react-router.config.ts +5 -0
- package/worker-configuration.d.ts +4435 -562
- package/workers/data-worker/src/data-worker.example.ts +3 -3
- package/workers/pdf-worker/scripts/generate-assets.js +94 -0
- package/workers/pdf-worker/src/{generated-assets.ts → assets/generated-assets.ts} +117 -117
- package/workers/pdf-worker/src/{format-striae.ts → formats/format-striae.ts} +535 -535
- package/workers/pdf-worker/src/pdf-worker.example.ts +1 -1
- package/app/services/audit-export.service.ts +0 -755
- package/app/services/audit.service.ts +0 -1474
- package/public/favicon.svg +0 -9
- /package/app/services/{firebase-errors.ts → firebase/errors.ts} +0 -0
- /package/app/services/{firebase.ts → firebase/index.ts} +0 -0
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import paths from '~/config/config.json';
|
|
2
|
+
import { type ValidationAuditEntry } from '~/types';
|
|
3
|
+
import { getDataApiKey } from '~/utils/auth';
|
|
4
|
+
|
|
5
|
+
const AUDIT_WORKER_URL = paths.audit_worker_url;
|
|
6
|
+
|
|
7
|
+
interface FetchAuditEntriesParams {
|
|
8
|
+
userId: string;
|
|
9
|
+
startDate?: string;
|
|
10
|
+
endDate?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
interface FetchAuditEntriesResponse {
|
|
14
|
+
entries: ValidationAuditEntry[];
|
|
15
|
+
total: number;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
interface PersistAuditEntryResponse {
|
|
19
|
+
success: boolean;
|
|
20
|
+
entryCount: number;
|
|
21
|
+
filename: string;
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export type PersistAuditEntryResult =
|
|
25
|
+
| {
|
|
26
|
+
ok: true;
|
|
27
|
+
entryCount: number;
|
|
28
|
+
}
|
|
29
|
+
| {
|
|
30
|
+
ok: false;
|
|
31
|
+
status: number;
|
|
32
|
+
errorData: unknown;
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export async function fetchAuditEntriesForUser(
|
|
36
|
+
params: FetchAuditEntriesParams
|
|
37
|
+
): Promise<ValidationAuditEntry[] | null> {
|
|
38
|
+
const apiKey = await getDataApiKey();
|
|
39
|
+
const url = new URL(`${AUDIT_WORKER_URL}/audit/`);
|
|
40
|
+
url.searchParams.set('userId', params.userId);
|
|
41
|
+
|
|
42
|
+
if (params.startDate) {
|
|
43
|
+
url.searchParams.set('startDate', params.startDate);
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
if (params.endDate) {
|
|
47
|
+
url.searchParams.set('endDate', params.endDate);
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
const response = await fetch(url.toString(), {
|
|
51
|
+
method: 'GET',
|
|
52
|
+
headers: {
|
|
53
|
+
'X-Custom-Auth-Key': apiKey
|
|
54
|
+
}
|
|
55
|
+
});
|
|
56
|
+
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
return null;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const result = (await response.json()) as FetchAuditEntriesResponse;
|
|
62
|
+
return result.entries;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export async function persistAuditEntryForUser(
|
|
66
|
+
entry: ValidationAuditEntry
|
|
67
|
+
): Promise<PersistAuditEntryResult> {
|
|
68
|
+
const apiKey = await getDataApiKey();
|
|
69
|
+
const url = new URL(`${AUDIT_WORKER_URL}/audit/`);
|
|
70
|
+
url.searchParams.set('userId', entry.userId);
|
|
71
|
+
|
|
72
|
+
const response = await fetch(url.toString(), {
|
|
73
|
+
method: 'POST',
|
|
74
|
+
headers: {
|
|
75
|
+
'Content-Type': 'application/json',
|
|
76
|
+
'X-Custom-Auth-Key': apiKey
|
|
77
|
+
},
|
|
78
|
+
body: JSON.stringify(entry)
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
if (!response.ok) {
|
|
82
|
+
const errorData = await response.json().catch(() => ({}));
|
|
83
|
+
return {
|
|
84
|
+
ok: false,
|
|
85
|
+
status: response.status,
|
|
86
|
+
errorData
|
|
87
|
+
};
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
const result = (await response.json()) as PersistAuditEntryResponse;
|
|
91
|
+
return {
|
|
92
|
+
ok: true,
|
|
93
|
+
entryCount: result.entryCount
|
|
94
|
+
};
|
|
95
|
+
}
|