@striae-org/striae 3.2.0 → 3.2.2

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.
Files changed (109) hide show
  1. package/README.md +3 -32
  2. package/app/components/actions/case-export/core-export.ts +2 -2
  3. package/app/components/actions/case-export/data-processing.ts +65 -10
  4. package/app/components/actions/case-export/download-handlers.ts +130 -44
  5. package/app/components/actions/case-export/metadata-helpers.ts +32 -14
  6. package/app/components/actions/case-import/annotation-import.ts +2 -2
  7. package/app/components/actions/case-import/confirmation-import.ts +3 -3
  8. package/app/components/actions/case-import/image-operations.ts +1 -1
  9. package/app/components/actions/case-import/orchestrator.ts +4 -4
  10. package/app/components/actions/case-import/storage-operations.ts +7 -7
  11. package/app/components/actions/case-import/validation.ts +3 -3
  12. package/app/components/actions/case-import/zip-processing.ts +3 -3
  13. package/app/components/actions/case-manage.ts +3 -3
  14. package/app/components/actions/confirm-export.ts +3 -3
  15. package/app/components/actions/generate-pdf.ts +3 -3
  16. package/app/components/actions/image-manage.ts +3 -3
  17. package/app/components/actions/notes-manage.ts +3 -3
  18. package/app/components/actions/signout.tsx +1 -1
  19. package/app/components/audit/user-audit-viewer.tsx +2 -3
  20. package/app/components/auth/auth-provider.tsx +2 -2
  21. package/app/components/auth/mfa-enrollment.tsx +3 -3
  22. package/app/components/auth/mfa-verification.tsx +4 -4
  23. package/app/components/canvas/box-annotations/box-annotations.tsx +2 -2
  24. package/app/components/canvas/canvas.tsx +1 -1
  25. package/app/components/canvas/confirmation/confirmation.tsx +1 -1
  26. package/app/components/form/base-form.tsx +1 -1
  27. package/app/components/sidebar/case-export/case-export.tsx +15 -15
  28. package/app/components/sidebar/case-import/case-import.tsx +2 -2
  29. package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +1 -1
  30. package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +1 -1
  31. package/app/components/sidebar/case-import/hooks/useFilePreview.ts +3 -3
  32. package/app/components/sidebar/case-import/hooks/useImportExecution.ts +2 -2
  33. package/app/components/sidebar/cases/case-sidebar.tsx +27 -19
  34. package/app/components/sidebar/cases/cases-modal.tsx +1 -1
  35. package/app/components/sidebar/files/files-modal.tsx +3 -2
  36. package/app/components/sidebar/notes/notes-sidebar.tsx +3 -3
  37. package/app/components/sidebar/sidebar-container.tsx +5 -4
  38. package/app/components/sidebar/sidebar.tsx +2 -2
  39. package/app/components/sidebar/upload/image-upload-zone.tsx +2 -2
  40. package/app/components/theme-provider/theme-provider.tsx +1 -1
  41. package/app/components/user/delete-account.tsx +1 -1
  42. package/app/components/user/manage-profile.tsx +2 -2
  43. package/app/components/user/mfa-phone-update.tsx +2 -2
  44. package/app/contexts/auth.context.ts +1 -1
  45. package/app/entry.client.tsx +12 -12
  46. package/app/entry.server.tsx +4 -4
  47. package/app/hooks/useInactivityTimeout.ts +1 -1
  48. package/app/root.tsx +3 -3
  49. package/app/routes/auth/emailActionHandler.tsx +3 -3
  50. package/app/routes/auth/emailVerification.tsx +3 -3
  51. package/app/routes/auth/login.tsx +6 -6
  52. package/app/routes/auth/passwordReset.tsx +3 -3
  53. package/app/routes/auth/route.ts +1 -1
  54. package/app/routes/striae/striae.tsx +2 -2
  55. package/app/services/audit/audit-console-logger.ts +46 -0
  56. package/app/services/audit/audit-export-csv.ts +126 -0
  57. package/app/services/audit/audit-export-report.ts +174 -0
  58. package/app/services/audit/audit-export-signing.ts +85 -0
  59. package/app/services/audit/audit-export.service.ts +334 -0
  60. package/app/services/audit/audit-file-type.ts +13 -0
  61. package/app/services/audit/audit-query-helpers.ts +88 -0
  62. package/app/services/audit/audit-worker-client.ts +95 -0
  63. package/app/services/audit/audit.service.ts +990 -0
  64. package/app/services/audit/builders/audit-entry-builder.ts +32 -0
  65. package/app/services/audit/builders/audit-event-builders-annotation.ts +150 -0
  66. package/app/services/audit/builders/audit-event-builders-case-file.ts +249 -0
  67. package/app/services/audit/builders/audit-event-builders-user-security.ts +449 -0
  68. package/app/services/audit/builders/audit-event-builders-workflow.ts +272 -0
  69. package/app/services/audit/builders/index.ts +40 -0
  70. package/app/services/audit/index.ts +2 -0
  71. package/app/types/case.ts +2 -2
  72. package/app/types/exceljs-bare.d.ts +9 -0
  73. package/app/types/user.ts +1 -1
  74. package/app/utils/audit-export-signature.ts +2 -2
  75. package/app/utils/confirmation-signature.ts +3 -3
  76. package/app/utils/data-operations.ts +5 -5
  77. package/app/utils/mfa-phone.ts +1 -1
  78. package/app/utils/mfa.ts +1 -1
  79. package/app/utils/permissions.ts +2 -2
  80. package/functions/[[path]].ts +2 -2
  81. package/package.json +34 -20
  82. package/public/vendor/exceljs.LICENSE +22 -0
  83. package/public/vendor/exceljs.bare.min.js +45 -0
  84. package/scripts/deploy-all.sh +52 -0
  85. package/scripts/deploy-config.sh +282 -1
  86. package/tsconfig.json +18 -8
  87. package/vite.config.ts +6 -22
  88. package/worker-configuration.d.ts +4435 -562
  89. package/workers/audit-worker/package.json +8 -4
  90. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  91. package/workers/data-worker/package.json +8 -4
  92. package/workers/data-worker/src/data-worker.example.ts +3 -3
  93. package/workers/data-worker/wrangler.jsonc.example +1 -1
  94. package/workers/image-worker/package.json +8 -4
  95. package/workers/image-worker/wrangler.jsonc.example +1 -1
  96. package/workers/keys-worker/package.json +8 -4
  97. package/workers/keys-worker/wrangler.jsonc.example +1 -1
  98. package/workers/pdf-worker/package.json +8 -4
  99. package/workers/pdf-worker/src/{generated-assets.ts → assets/generated-assets.ts} +117 -117
  100. package/workers/pdf-worker/src/{format-striae.ts → formats/format-striae.ts} +535 -535
  101. package/workers/pdf-worker/src/pdf-worker.example.ts +1 -1
  102. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  103. package/workers/user-worker/package.json +8 -4
  104. package/workers/user-worker/wrangler.jsonc.example +1 -1
  105. package/wrangler.toml.example +1 -1
  106. package/app/services/audit-export.service.ts +0 -755
  107. package/app/services/audit.service.ts +0 -1474
  108. /package/app/services/{firebase-errors.ts → firebase/errors.ts} +0 -0
  109. /package/app/services/{firebase.ts → firebase/index.ts} +0 -0
@@ -0,0 +1,40 @@
1
+ export { buildValidationAuditEntry } from './audit-entry-builder';
2
+
3
+ export {
4
+ buildCaseExportAuditParams,
5
+ buildCaseImportAuditParams,
6
+ buildConfirmationCreationAuditParams,
7
+ buildConfirmationExportAuditParams,
8
+ buildConfirmationImportAuditParams
9
+ } from './audit-event-builders-workflow';
10
+
11
+ export {
12
+ buildCaseCreationAuditParams,
13
+ buildCaseDeletionAuditParams,
14
+ buildCaseRenameAuditParams,
15
+ buildFileAccessAuditParams,
16
+ buildFileDeletionAuditParams,
17
+ buildFileUploadAuditParams,
18
+ buildPDFGenerationAuditParams
19
+ } from './audit-event-builders-case-file';
20
+
21
+ export {
22
+ buildAnnotationCreateAuditParams,
23
+ buildAnnotationDeleteAuditParams,
24
+ buildAnnotationEditAuditParams
25
+ } from './audit-event-builders-annotation';
26
+
27
+ export {
28
+ buildAccountDeletionAuditParams,
29
+ buildEmailVerificationAuditParams,
30
+ buildEmailVerificationByEmailAuditParams,
31
+ buildMarkEmailVerificationSuccessfulAuditParams,
32
+ buildMfaAuthenticationAuditParams,
33
+ buildMfaEnrollmentAuditParams,
34
+ buildPasswordResetAuditParams,
35
+ buildSecurityViolationAuditParams,
36
+ buildUserLoginAuditParams,
37
+ buildUserLogoutAuditParams,
38
+ buildUserProfileUpdateAuditParams,
39
+ buildUserRegistrationAuditParams
40
+ } from './audit-event-builders-user-security';
@@ -0,0 +1,2 @@
1
+ export { AuditService, auditService } from './audit.service';
2
+ export { AuditExportService, auditExportService } from './audit-export.service';
package/app/types/case.ts CHANGED
@@ -1,5 +1,5 @@
1
- import { FileData } from './file';
2
- import { AnnotationData, ConfirmationData } from './annotations';
1
+ import { type FileData } from './file';
2
+ import { type AnnotationData, type ConfirmationData } from './annotations';
3
3
 
4
4
  // Case-related types and interfaces
5
5
 
@@ -0,0 +1,9 @@
1
+ import type * as ExcelJSModule from 'exceljs';
2
+
3
+ declare global {
4
+ interface Window {
5
+ ExcelJS?: typeof ExcelJSModule;
6
+ }
7
+ }
8
+
9
+ export {};
package/app/types/user.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // User-related types and interfaces
2
2
 
3
- import { ReadOnlyCaseMetadata } from './import';
3
+ import { type ReadOnlyCaseMetadata } from './import';
4
4
 
5
5
  export interface UserData {
6
6
  uid: string;
@@ -1,7 +1,7 @@
1
1
  import {
2
- ForensicManifestSignature,
2
+ type ForensicManifestSignature,
3
3
  FORENSIC_MANIFEST_SIGNATURE_ALGORITHM,
4
- ManifestSignatureVerificationResult
4
+ type ManifestSignatureVerificationResult
5
5
  } from './SHA256';
6
6
  import { verifySignaturePayload } from './signature-utils';
7
7
 
@@ -1,8 +1,8 @@
1
- import { ConfirmationImportData } from '~/types';
1
+ import { type ConfirmationImportData } from '~/types';
2
2
  import {
3
- ForensicManifestSignature,
3
+ type ForensicManifestSignature,
4
4
  FORENSIC_MANIFEST_SIGNATURE_ALGORITHM,
5
- ManifestSignatureVerificationResult
5
+ type ManifestSignatureVerificationResult
6
6
  } from './SHA256';
7
7
  import { verifySignaturePayload } from './signature-utils';
8
8
 
@@ -4,20 +4,20 @@
4
4
  * for all interactions with the data worker microservice
5
5
  */
6
6
 
7
- import { User } from 'firebase/auth';
8
- import { CaseData, AnnotationData, ConfirmationImportData } from '~/types';
7
+ import type { User } from 'firebase/auth';
8
+ import { type CaseData, type AnnotationData, type ConfirmationImportData } from '~/types';
9
9
  import paths from '~/config/config.json';
10
10
  import { getDataApiKey } from './auth';
11
11
  import { validateUserSession, canAccessCase, canModifyCase } from './permissions';
12
12
  import {
13
- ForensicManifestData,
14
- ForensicManifestSignature,
13
+ type ForensicManifestData,
14
+ type ForensicManifestSignature,
15
15
  FORENSIC_MANIFEST_VERSION
16
16
  } from './SHA256';
17
17
  import { CONFIRMATION_SIGNATURE_VERSION } from './confirmation-signature';
18
18
  import {
19
19
  AUDIT_EXPORT_SIGNATURE_VERSION,
20
- AuditExportSigningPayload,
20
+ type AuditExportSigningPayload,
21
21
  isValidAuditExportSigningPayload
22
22
  } from './audit-export-signature';
23
23
 
@@ -1,5 +1,5 @@
1
1
  import type { MultiFactorInfo } from 'firebase/auth';
2
- import { getValidationError } from '~/services/firebase-errors';
2
+ import { getValidationError } from '~/services/firebase/errors';
3
3
 
4
4
  export interface PhoneValidationResult {
5
5
  isValid: boolean;
package/app/utils/mfa.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  // MFA Configuration Helper
2
2
  // This file contains utilities and documentation for managing MFA in your Firebase project
3
3
 
4
- import { multiFactor, User } from 'firebase/auth';
4
+ import { multiFactor, type User } from 'firebase/auth';
5
5
 
6
6
  /**
7
7
  * Check if a user has MFA enrolled
@@ -1,5 +1,5 @@
1
- import { User } from 'firebase/auth';
2
- import { UserData, ExtendedUserData, UserLimits, ReadOnlyCaseMetadata } from '~/types';
1
+ import type { User } from 'firebase/auth';
2
+ import type { UserData, ExtendedUserData, UserLimits, ReadOnlyCaseMetadata } from '~/types';
3
3
  import paths from '~/config/config.json';
4
4
  import { getUserApiKey } from './auth';
5
5
 
@@ -1,7 +1,7 @@
1
- import { createPagesFunctionHandler } from "@remix-run/cloudflare-pages";
1
+ import { createPagesFunctionHandler } from "@react-router/cloudflare";
2
2
 
3
3
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
4
- // @ts-ignore - the server build file is generated by `remix vite:build`
4
+ // @ts-ignore - the server build file is generated by `react-router build`
5
5
  import * as build from "../build/server";
6
6
 
7
7
  // eslint-disable-next-line @typescript-eslint/ban-ts-comment
package/package.json CHANGED
@@ -1,14 +1,20 @@
1
1
  {
2
2
  "name": "@striae-org/striae",
3
- "version": "3.2.0",
3
+ "version": "3.2.2",
4
4
  "private": false,
5
- "description": "Cloud-native forensic annotation application for firearms identification (Remix + Cloudflare Workers).",
5
+ "description": "Striae is a cloud-native forensic annotation application for firearms identification, built with React Router and Cloudflare Workers.",
6
6
  "license": "Apache-2.0",
7
7
  "homepage": "https://www.striae.org",
8
8
  "repository": {
9
9
  "type": "git",
10
10
  "url": "https://github.com/striae-org/striae.git"
11
11
  },
12
+ "funding": [
13
+ {
14
+ "type": "patreon",
15
+ "url": "https://www.patreon.com/striae"
16
+ }
17
+ ],
12
18
  "bugs": {
13
19
  "url": "https://github.com/striae-org/striae/issues"
14
20
  },
@@ -16,7 +22,7 @@
16
22
  "forensics",
17
23
  "firearms",
18
24
  "annotation",
19
- "remix",
25
+ "react",
20
26
  "cloudflare-workers",
21
27
  "chain-of-custody",
22
28
  "audit-trail"
@@ -45,8 +51,11 @@
45
51
  "workers/*/src/*.example.ts",
46
52
  "workers/*/src/*.example.js",
47
53
  "workers/*/src/*.ts",
54
+ "workers/*/src/assets/*.ts",
55
+ "workers/*/src/formats/*.ts",
48
56
  "!workers/*/src/*worker.ts",
49
- "workers/pdf-worker/src/format-striae.ts",
57
+ "workers/pdf-worker/src/assets/generated-assets.ts",
58
+ "workers/pdf-worker/src/formats/format-striae.ts",
50
59
  "workers/pdf-worker/src/report-types.ts",
51
60
  "workers/*/wrangler.jsonc.example",
52
61
  ".env.example",
@@ -60,15 +69,13 @@
60
69
  "LICENSE",
61
70
  "NOTICE"
62
71
  ],
63
- "sideEffects": [
64
- "**/*.css"
65
- ],
72
+ "sideEffects": false,
66
73
  "type": "module",
67
74
  "scripts": {
68
75
  "deploy:all": "bash ./scripts/deploy-all.sh",
69
76
  "emulators": "firebase emulators:start --only auth",
70
- "dev": "node ./scripts/dev.cjs && remix vite:dev",
71
- "build": "node ./scripts/dev.cjs && remix vite:build",
77
+ "dev": "node ./scripts/dev.cjs && react-router dev",
78
+ "build": "node ./scripts/dev.cjs && react-router build",
72
79
  "clean": "rm -rf build node_modules/.cache .cache",
73
80
  "clean:build": "npm run clean && npm run build",
74
81
  "deploy": "npm run build && wrangler pages deploy",
@@ -77,10 +84,10 @@
77
84
  "publish:github": "npm publish --registry=https://npm.pkg.github.com --@striae-org:registry=https://npm.pkg.github.com",
78
85
  "publish:github:dry-run": "npm publish --dry-run --registry=https://npm.pkg.github.com --@striae-org:registry=https://npm.pkg.github.com",
79
86
  "publish:all": "npm run publish:npm && npm run publish:github",
80
- "publish:all:dry-run": "npm run publish:npm:dry-run && npm run publish:github:dry-run",
87
+ "publish:all:dry-run": "npm run publish:npm:dry-run && npm run publish:github:dry-run",
81
88
  "lint": "node ./scripts/run-eslint.cjs",
82
89
  "start": "node ./scripts/dev.cjs && wrangler pages dev",
83
- "typecheck": "tsc",
90
+ "typecheck": "react-router typegen && tsc",
84
91
  "typegen": "wrangler types",
85
92
  "preview": "npm run build && wrangler pages dev",
86
93
  "cf-typegen": "wrangler types",
@@ -100,18 +107,18 @@
100
107
  "deploy-workers:user": "cd workers/user-worker && npm run deploy"
101
108
  },
102
109
  "dependencies": {
103
- "@remix-run/cloudflare": "^2.17.4",
104
- "@remix-run/cloudflare-pages": "^2.17.4",
105
- "@remix-run/react": "^2.17.4",
110
+ "@react-router/cloudflare": "^7.13.1",
111
+ "exceljs": "^4.4.0",
106
112
  "firebase": "^12.10.0",
107
113
  "isbot": "^5.1.35",
108
114
  "jszip": "^3.10.1",
109
- "react": "^18.0.0",
110
- "react-dom": "^18.0.0",
111
- "xlsx": "^0.18.5"
115
+ "react": "^19.2.4",
116
+ "react-dom": "^19.2.4",
117
+ "react-router": "^7.13.1"
112
118
  },
113
119
  "devDependencies": {
114
- "@remix-run/dev": "^2.17.4",
120
+ "@react-router/dev": "^7.13.1",
121
+ "@react-router/fs-routes": "^7.13.1",
115
122
  "@types/react": "^19.1.10",
116
123
  "@types/react-dom": "^19.1.7",
117
124
  "@typescript-eslint/eslint-plugin": "^8.54.0",
@@ -128,10 +135,17 @@
128
135
  "typescript": "^5.9.3",
129
136
  "vite": "^6.4.1",
130
137
  "vite-tsconfig-paths": "^6.1.1",
131
- "wrangler": "^3.114.17"
138
+ "wrangler": "^4.73.0"
132
139
  },
133
140
  "overrides": {
134
- "tar": "7.5.11"
141
+ "tar": "7.5.11",
142
+ "undici": "7.24.1",
143
+ "exceljs": {
144
+ "archiver": "7.0.1",
145
+ "fast-csv": "5.0.5",
146
+ "unzipper": "0.12.3",
147
+ "glob": "13.0.6"
148
+ }
135
149
  },
136
150
  "engines": {
137
151
  "node": ">=20.0.0"
@@ -0,0 +1,22 @@
1
+ The MIT License (MIT)
2
+
3
+ Copyright (c) 2014-2019 Guyon Roche
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
22
+