@striae-org/striae 5.5.2 → 6.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 +3 -1
- package/app/components/actions/case-export/download-handlers.ts +130 -62
- package/app/components/actions/case-manage/archive-package-builder.ts +299 -0
- package/app/components/actions/case-manage/delete-helpers.ts +61 -0
- package/app/components/actions/case-manage/index.ts +2 -0
- package/app/components/actions/case-manage/operations.ts +714 -0
- package/app/components/actions/case-manage/types.ts +21 -0
- package/app/components/actions/case-manage/utils.ts +34 -0
- package/app/components/actions/case-manage.ts +1 -1079
- package/app/components/navbar/case-import/case-import.module.css +2 -2
- package/app/components/navbar/case-import/case-import.tsx +0 -8
- package/app/components/navbar/case-import/components/CasePreviewSection.tsx +1 -1
- package/app/components/navbar/case-modals/all-cases-modal.tsx +13 -1
- package/app/components/navbar/navbar.tsx +8 -5
- package/app/components/sidebar/cases/case-sidebar.tsx +3 -2
- package/app/components/sidebar/sidebar-container.tsx +7 -0
- package/{members.emails.example → app/config-example/members.emails} +1 -1
- package/{primershear.emails.example → app/config-example/primershear.emails} +1 -1
- package/app/routes/striae/striae.tsx +36 -11
- package/app/types/export.ts +1 -0
- package/app/utils/forensics/SHA256.ts +2 -2
- package/app/utils/forensics/audit-export-signature.ts +1 -1
- package/app/utils/forensics/confirmation-signature.ts +1 -1
- package/app/utils/forensics/signature-utils.ts +7 -2
- package/package.json +2 -4
- package/scripts/deploy-config.sh +33 -0
- package/scripts/deploy-members-emails.sh +4 -4
- package/scripts/deploy-primershear-emails.sh +3 -3
- package/workers/audit-worker/package.json +1 -1
- package/workers/audit-worker/wrangler.jsonc.example +1 -1
- package/workers/data-worker/package.json +1 -1
- package/workers/data-worker/src/signature-utils.ts +7 -2
- package/workers/data-worker/src/signing-payload-utils.ts +4 -4
- package/workers/data-worker/wrangler.jsonc.example +1 -1
- package/workers/image-worker/package.json +1 -1
- package/workers/image-worker/wrangler.jsonc.example +1 -1
- package/workers/pdf-worker/package.json +1 -1
- package/workers/pdf-worker/wrangler.jsonc.example +1 -1
- package/workers/user-worker/package.json +1 -1
- package/workers/user-worker/wrangler.jsonc.example +1 -1
- package/wrangler.toml.example +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export interface DeleteCaseResult {
|
|
2
|
+
missingImages: string[];
|
|
3
|
+
}
|
|
4
|
+
|
|
5
|
+
export interface CaseArchiveDetails {
|
|
6
|
+
archived: boolean;
|
|
7
|
+
archivedAt?: string;
|
|
8
|
+
archivedBy?: string;
|
|
9
|
+
archivedByDisplay?: string;
|
|
10
|
+
archiveReason?: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface DeleteFileWithoutAuditOptions {
|
|
14
|
+
skipCaseDataUpdate?: boolean;
|
|
15
|
+
skipValidation?: boolean;
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export interface DeleteFileWithoutAuditResult {
|
|
19
|
+
imageMissing: boolean;
|
|
20
|
+
fileName: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { type CaseData, type ReadOnlyCaseData } from '~/types';
|
|
2
|
+
|
|
3
|
+
const CASE_NUMBER_REGEX = /^[A-Za-z0-9-]+$/;
|
|
4
|
+
const MAX_CASE_NUMBER_LENGTH = 25;
|
|
5
|
+
|
|
6
|
+
export const validateCaseNumber = (caseNumber: string): boolean => {
|
|
7
|
+
return CASE_NUMBER_REGEX.test(caseNumber) && caseNumber.length <= MAX_CASE_NUMBER_LENGTH;
|
|
8
|
+
};
|
|
9
|
+
|
|
10
|
+
export const sortCaseNumbers = (cases: string[]): string[] => {
|
|
11
|
+
return cases.sort((a, b) => {
|
|
12
|
+
const getComponents = (str: string) => {
|
|
13
|
+
const numbers = str.match(/\d+/g)?.map(Number) || [];
|
|
14
|
+
const letters = str.match(/[A-Za-z]+/g)?.join('') || '';
|
|
15
|
+
return { numbers, letters };
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
const aComponents = getComponents(a);
|
|
19
|
+
const bComponents = getComponents(b);
|
|
20
|
+
|
|
21
|
+
const maxLength = Math.max(aComponents.numbers.length, bComponents.numbers.length);
|
|
22
|
+
for (let i = 0; i < maxLength; i++) {
|
|
23
|
+
const aNum = aComponents.numbers[i] || 0;
|
|
24
|
+
const bNum = bComponents.numbers[i] || 0;
|
|
25
|
+
if (aNum !== bNum) return aNum - bNum;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return aComponents.letters.localeCompare(bComponents.letters);
|
|
29
|
+
});
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
export const isReadOnlyCaseData = (caseData: CaseData): caseData is ReadOnlyCaseData => {
|
|
33
|
+
return 'isReadOnly' in caseData && typeof (caseData as ReadOnlyCaseData).isReadOnly === 'boolean';
|
|
34
|
+
};
|