@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
@@ -1,4 +1,4 @@
1
- import { User } from 'firebase/auth';
1
+ import type { User } from 'firebase/auth';
2
2
  import paths from '~/config/config.json';
3
3
  import {
4
4
  getImageApiKey,
@@ -6,8 +6,8 @@ import {
6
6
  } from '~/utils/auth';
7
7
  import { canUploadFile } from '~/utils/permissions';
8
8
  import { getCaseData, updateCaseData, deleteFileAnnotations } from '~/utils/data-operations';
9
- import { CaseData, FileData, ImageUploadResponse } from '~/types';
10
- import { auditService } from '~/services/audit.service';
9
+ import type { CaseData, FileData, ImageUploadResponse } from '~/types';
10
+ import { auditService } from '~/services/audit';
11
11
 
12
12
  const IMAGE_URL = paths.image_worker_url;
13
13
 
@@ -1,6 +1,6 @@
1
- import { User } from 'firebase/auth';
2
- import { AnnotationData } from '~/types/annotations';
3
- import { saveFileAnnotations, getFileAnnotations, DataOperationOptions } from '~/utils/data-operations';
1
+ import type { User } from 'firebase/auth';
2
+ import { type AnnotationData } from '~/types/annotations';
3
+ import { saveFileAnnotations, getFileAnnotations, type DataOperationOptions } from '~/utils/data-operations';
4
4
 
5
5
  export const saveNotes = async (
6
6
  user: User,
@@ -1,5 +1,5 @@
1
1
  import { auth } from '~/services/firebase';
2
- import { auditService } from '~/services/audit.service';
2
+ import { auditService } from '~/services/audit';
3
3
  import { generateUniqueId } from '~/utils/id-generator';
4
4
  import styles from './signout.module.css';
5
5
 
@@ -1,8 +1,7 @@
1
1
  import { useState, useEffect, useContext, useCallback } from 'react';
2
2
  import { AuthContext } from '~/contexts/auth.context';
3
- import { auditService } from '~/services/audit.service';
4
- import { auditExportService } from '~/services/audit-export.service';
5
- import { ValidationAuditEntry, AuditAction, AuditResult, AuditTrail, UserData, WorkflowPhase } from '~/types';
3
+ import { auditService, auditExportService } from '~/services/audit';
4
+ import { type ValidationAuditEntry, type AuditAction, type AuditResult, type AuditTrail, type UserData, type WorkflowPhase } from '~/types';
6
5
  import { getUserData } from '~/utils/permissions';
7
6
  import styles from './user-audit.module.css';
8
7
 
@@ -1,11 +1,11 @@
1
- import { User } from 'firebase/auth';
1
+ import type { User } from 'firebase/auth';
2
2
  import { useEffect, useState } from 'react';
3
3
  import { auth } from '~/services/firebase';
4
4
  import { useInactivityTimeout } from '~/hooks/useInactivityTimeout';
5
5
  import { INACTIVITY_CONFIG } from '~/config/inactivity';
6
6
  import { AuthContext } from '~/contexts/auth.context';
7
7
  import { InactivityWarning } from '~/components/user/inactivity-warning';
8
- import { auditService } from '~/services/audit.service';
8
+ import { auditService } from '~/services/audit';
9
9
  import { generateUniqueId } from '~/utils/id-generator';
10
10
 
11
11
  interface AuthProviderProps {
@@ -6,11 +6,11 @@ import {
6
6
  PhoneMultiFactorGenerator,
7
7
  RecaptchaVerifier,
8
8
  multiFactor,
9
- User
9
+ type User
10
10
  } from 'firebase/auth';
11
- import { handleAuthError, getValidationError } from '~/services/firebase-errors';
11
+ import { handleAuthError, getValidationError } from '~/services/firebase/errors';
12
12
  import { SignOut } from '~/components/actions/signout';
13
- import { auditService } from '~/services/audit.service';
13
+ import { auditService } from '~/services/audit';
14
14
  import styles from './mfa-enrollment.module.css';
15
15
 
16
16
  interface MFAEnrollmentProps {
@@ -3,13 +3,13 @@ import {
3
3
  PhoneAuthProvider,
4
4
  PhoneMultiFactorGenerator,
5
5
  RecaptchaVerifier,
6
- MultiFactorResolver,
7
- UserCredential
6
+ type MultiFactorResolver,
7
+ type UserCredential
8
8
  } from 'firebase/auth';
9
9
  import { auth } from '~/services/firebase';
10
- import { handleAuthError, getValidationError } from '~/services/firebase-errors';
10
+ import { handleAuthError, getValidationError } from '~/services/firebase/errors';
11
11
  import { SignOut } from '~/components/actions/signout';
12
- import { auditService } from '~/services/audit.service';
12
+ import { auditService } from '~/services/audit';
13
13
  import { generateUniqueId } from '~/utils/id-generator';
14
14
  import styles from './mfa-verification.module.css';
15
15
 
@@ -1,7 +1,7 @@
1
1
  import { useState, useCallback, useMemo, useRef, useEffect, useContext } from 'react';
2
- import { BoxAnnotation } from '~/types';
2
+ import { type BoxAnnotation } from '~/types';
3
3
  import { AuthContext } from '~/contexts/auth.context';
4
- import { auditService } from '~/services/audit.service';
4
+ import { auditService } from '~/services/audit';
5
5
  import { resolveEarliestAnnotationTimestamp } from '~/utils/annotation-timestamp';
6
6
  import styles from './box-annotations.module.css';
7
7
 
@@ -1,7 +1,7 @@
1
1
  import { useEffect, useState, useRef, useContext, useCallback } from 'react';
2
2
  import { BoxAnnotations } from './box-annotations/box-annotations';
3
3
  import { ConfirmationModal } from './confirmation/confirmation';
4
- import { AnnotationData, BoxAnnotation, ConfirmationData } from '~/types/annotations';
4
+ import { type AnnotationData, type BoxAnnotation, type ConfirmationData } from '~/types/annotations';
5
5
  import { AuthContext } from '~/contexts/auth.context';
6
6
  import { storeConfirmation } from '~/components/actions/confirm-export';
7
7
  import styles from './canvas.module.css';
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect, useContext } from 'react';
2
- import { ConfirmationData } from '~/types/annotations';
2
+ import { type ConfirmationData } from '~/types/annotations';
3
3
  import { AuthContext } from '~/contexts/auth.context';
4
4
  import { generateConfirmationId } from '~/utils/id-generator';
5
5
  import styles from './confirmation.module.css';
@@ -1,4 +1,4 @@
1
- import { Form as RemixForm } from '@remix-run/react';
1
+ import { Form as RemixForm } from 'react-router';
2
2
  import styles from './form.module.css';
3
3
 
4
4
  interface BaseFormProps {
@@ -364,20 +364,6 @@ export const CaseExport = ({
364
364
  </>
365
365
  )}
366
366
 
367
- <div className={styles.divider}>
368
- <span>Verification</span>
369
- </div>
370
-
371
- <div className={styles.publicKeySection}>
372
- <button
373
- type="button"
374
- className={styles.publicKeyButton}
375
- onClick={() => setIsPublicKeyModalOpen(true)}
376
- >
377
- View Public Signing Key
378
- </button>
379
- </div>
380
-
381
367
  {exportProgress && exportProgress.total > 0 && (
382
368
  <div className={styles.progressSection}>
383
369
  <div className={styles.progressText}>
@@ -391,7 +377,7 @@ export const CaseExport = ({
391
377
  </div>
392
378
  </div>
393
379
  )}
394
-
380
+
395
381
  {isExportingAll && !exportProgress && (
396
382
  <div className={styles.progressSection}>
397
383
  <div className={styles.progressText}>
@@ -399,6 +385,20 @@ export const CaseExport = ({
399
385
  </div>
400
386
  </div>
401
387
  )}
388
+
389
+ <div className={styles.divider}>
390
+ <span>Verification</span>
391
+ </div>
392
+
393
+ <div className={styles.publicKeySection}>
394
+ <button
395
+ type="button"
396
+ className={styles.publicKeyButton}
397
+ onClick={() => setIsPublicKeyModalOpen(true)}
398
+ >
399
+ View Public Signing Key
400
+ </button>
401
+ </div>
402
402
 
403
403
  {error && (
404
404
  <div className={styles.error}>
@@ -5,8 +5,8 @@ import {
5
5
  deleteReadOnlyCase
6
6
  } from '~/components/actions/case-review';
7
7
  import {
8
- ImportResult,
9
- ConfirmationImportResult
8
+ type ImportResult,
9
+ type ConfirmationImportResult
10
10
  } from '~/types';
11
11
  import {
12
12
  FileSelector,
@@ -1,4 +1,4 @@
1
- import { CaseImportPreview } from '~/types';
1
+ import { type CaseImportPreview } from '~/types';
2
2
  import styles from '../case-import.module.css';
3
3
 
4
4
  interface CasePreviewSectionProps {
@@ -1,4 +1,4 @@
1
- import { CaseImportPreview } from '~/types';
1
+ import { type CaseImportPreview } from '~/types';
2
2
  import styles from '../case-import.module.css';
3
3
 
4
4
  interface ConfirmationDialogProps {
@@ -1,8 +1,8 @@
1
1
  import { useState, useCallback } from 'react';
2
- import { User } from 'firebase/auth';
2
+ import type { User } from 'firebase/auth';
3
3
  import { previewCaseImport } from '~/components/actions/case-review';
4
- import { CaseImportPreview } from '~/types';
5
- import { ConfirmationPreview } from '../components/ConfirmationPreviewSection';
4
+ import { type CaseImportPreview } from '~/types';
5
+ import { type ConfirmationPreview } from '../components/ConfirmationPreviewSection';
6
6
 
7
7
  type UnknownRecord = Record<string, unknown>;
8
8
 
@@ -1,7 +1,7 @@
1
1
  import { useCallback } from 'react';
2
- import { User } from 'firebase/auth';
2
+ import type { User } from 'firebase/auth';
3
3
  import { importCaseForReview, importConfirmationData } from '~/components/actions/case-review';
4
- import { ImportResult, ConfirmationImportResult } from '~/types';
4
+ import { type ImportResult, type ConfirmationImportResult } from '~/types';
5
5
 
6
6
  interface ProgressState {
7
7
  stage: string;
@@ -1,18 +1,10 @@
1
- import { User } from 'firebase/auth';
2
- import {
3
- exportCaseData,
4
- exportAllCases,
5
- downloadCaseAsJSON,
6
- downloadCaseAsCSV,
7
- downloadAllCasesAsJSON,
8
- downloadAllCasesAsCSV,
9
- downloadCaseAsZip
10
- } from '../../actions/case-export';
1
+ import type { User } from 'firebase/auth';
2
+ import type * as CaseExportActions from '../../actions/case-export';
11
3
  import { useState, useEffect, useMemo, useCallback } from 'react';
12
4
  import styles from './cases.module.css';
13
5
  import { CasesModal } from './cases-modal';
14
6
  import { FilesModal } from '../files/files-modal';
15
- import { CaseExport, ExportFormat } from '../case-export/case-export';
7
+ import { CaseExport, type ExportFormat } from '../case-export/case-export';
16
8
  import { ImageUploadZone } from '../upload/image-upload-zone';
17
9
  import { UserAuditViewer } from '~/components/audit/user-audit-viewer';
18
10
  import {
@@ -36,7 +28,7 @@ import {
36
28
  getUserData
37
29
  } from '~/utils/permissions';
38
30
  import { getFileAnnotations } from '~/utils/data-operations';
39
- import { FileData, CaseActionType } from '~/types';
31
+ import { type FileData, type CaseActionType } from '~/types';
40
32
 
41
33
  interface CaseSidebarProps {
42
34
  user: User;
@@ -66,6 +58,18 @@ interface CaseSidebarProps {
66
58
 
67
59
  const SUCCESS_MESSAGE_TIMEOUT = 3000;
68
60
 
61
+ type CaseExportActionsModule = typeof CaseExportActions;
62
+
63
+ let caseExportActionsPromise: Promise<CaseExportActionsModule> | null = null;
64
+
65
+ const loadCaseExportActions = (): Promise<CaseExportActionsModule> => {
66
+ if (!caseExportActionsPromise) {
67
+ caseExportActionsPromise = import('../../actions/case-export');
68
+ }
69
+
70
+ return caseExportActionsPromise;
71
+ };
72
+
69
73
  export const CaseSidebar = ({
70
74
  user,
71
75
  onImageSelect,
@@ -512,20 +516,22 @@ const handleImageSelect = (file: FileData) => {
512
516
 
513
517
  const handleExport = async (exportCaseNumber: string, format: ExportFormat, includeImages?: boolean) => {
514
518
  try {
519
+ const caseExportActions = await loadCaseExportActions();
520
+
515
521
  if (includeImages) {
516
522
  // ZIP export with images - only available for single case exports
517
- await downloadCaseAsZip(user, exportCaseNumber, format);
523
+ await caseExportActions.downloadCaseAsZip(user, exportCaseNumber, format);
518
524
  } else {
519
525
  // Standard data-only export
520
- const exportData = await exportCaseData(user, exportCaseNumber, {
526
+ const exportData = await caseExportActions.exportCaseData(user, exportCaseNumber, {
521
527
  includeMetadata: true
522
528
  });
523
529
 
524
530
  // Download the exported data in the selected format
525
531
  if (format === 'json') {
526
- await downloadCaseAsJSON(user, exportData);
532
+ await caseExportActions.downloadCaseAsJSON(user, exportData);
527
533
  } else {
528
- await downloadCaseAsCSV(user, exportData);
534
+ await caseExportActions.downloadCaseAsCSV(user, exportData);
529
535
  }
530
536
  }
531
537
 
@@ -537,16 +543,18 @@ const handleImageSelect = (file: FileData) => {
537
543
 
538
544
  const handleExportAll = async (onProgress: (current: number, total: number, caseName: string) => void, format: ExportFormat) => {
539
545
  try {
546
+ const caseExportActions = await loadCaseExportActions();
547
+
540
548
  // Export all cases with progress callback
541
- const exportData = await exportAllCases(user, {
549
+ const exportData = await caseExportActions.exportAllCases(user, {
542
550
  includeMetadata: true
543
551
  }, onProgress);
544
552
 
545
553
  // Download the exported data in the selected format
546
554
  if (format === 'json') {
547
- await downloadAllCasesAsJSON(user, exportData);
555
+ await caseExportActions.downloadAllCasesAsJSON(user, exportData);
548
556
  } else {
549
- await downloadAllCasesAsCSV(user, exportData);
557
+ await caseExportActions.downloadAllCasesAsCSV(user, exportData);
550
558
  }
551
559
 
552
560
  } catch (error) {
@@ -1,5 +1,5 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { User } from 'firebase/auth';
2
+ import type { User } from 'firebase/auth';
3
3
  import { listCases } from '~/components/actions/case-manage';
4
4
  import { getFileAnnotations } from '~/utils/data-operations';
5
5
  import { fetchFiles } from '~/components/actions/image-manage';
@@ -1,8 +1,9 @@
1
- import React, { useState, useContext, useEffect } from 'react';
1
+ import type React from 'react';
2
+ import { useState, useContext, useEffect } from 'react';
2
3
  import { AuthContext } from '~/contexts/auth.context';
3
4
  import { deleteFile } from '~/components/actions/image-manage';
4
5
  import { getFileAnnotations } from '~/utils/data-operations';
5
- import { FileData } from '~/types';
6
+ import { type FileData } from '~/types';
6
7
  import styles from './files-modal.module.css';
7
8
 
8
9
  interface FilesModalProps {
@@ -1,11 +1,11 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { User } from 'firebase/auth';
2
+ import type { User } from 'firebase/auth';
3
3
  import { ColorSelector } from '~/components/colors/colors';
4
4
  import { NotesModal } from './notes-modal';
5
5
  import { getNotes, saveNotes } from '~/components/actions/notes-manage';
6
- import { AnnotationData } from '~/types/annotations';
6
+ import { type AnnotationData } from '~/types/annotations';
7
7
  import { resolveEarliestAnnotationTimestamp } from '~/utils/annotation-timestamp';
8
- import { auditService } from '~/services/audit.service';
8
+ import { auditService } from '~/services/audit';
9
9
  import styles from './notes.module.css';
10
10
 
11
11
  interface NotesSidebarProps {
@@ -1,10 +1,11 @@
1
1
  /* eslint-disable jsx-a11y/no-static-element-interactions */
2
2
  /* eslint-disable jsx-a11y/click-events-have-key-events */
3
- import React, { useState, useEffect } from 'react';
4
- import { Link } from '@remix-run/react';
3
+ import type React from 'react';
4
+ import { useState, useEffect } from 'react';
5
+ import { Link } from 'react-router';
5
6
  import { Sidebar } from './sidebar';
6
- import { User } from 'firebase/auth';
7
- import { FileData } from '~/types';
7
+ import type { User } from 'firebase/auth';
8
+ import { type FileData } from '~/types';
8
9
  import styles from './sidebar.module.css';
9
10
  import { getAppVersion } from '../../utils/version';
10
11
 
@@ -1,4 +1,4 @@
1
- import { User } from 'firebase/auth';
1
+ import type { User } from 'firebase/auth';
2
2
  import { useState, useCallback } from 'react';
3
3
  import styles from './sidebar.module.css';
4
4
  import { ManageProfile } from '../user/manage-profile';
@@ -7,7 +7,7 @@ import { CaseSidebar } from './cases/case-sidebar';
7
7
  import { NotesSidebar } from './notes/notes-sidebar';
8
8
  import { CaseImport } from './case-import/case-import';
9
9
  import { Toast } from '../toast/toast';
10
- import { FileData, ImportResult, ConfirmationImportResult } from '~/types';
10
+ import { type FileData, type ImportResult, type ConfirmationImportResult } from '~/types';
11
11
 
12
12
  interface SidebarProps {
13
13
  user: User;
@@ -1,8 +1,8 @@
1
- import { User } from 'firebase/auth';
1
+ import type { User } from 'firebase/auth';
2
2
  import { useState, useRef, useEffect, useCallback } from 'react';
3
3
  import styles from './image-upload-zone.module.css';
4
4
  import { uploadFile } from '~/components/actions/image-manage';
5
- import { FileData } from '~/types';
5
+ import { type FileData } from '~/types';
6
6
 
7
7
  interface ImageUploadZoneProps {
8
8
  user: User;
@@ -1,4 +1,4 @@
1
- import { JSX, createContext, useContext } from 'react';
1
+ import { type JSX, createContext, useContext } from 'react';
2
2
  import { classes, media } from '~/utils/style';
3
3
  import { themes, tokens } from './theme';
4
4
 
@@ -3,7 +3,7 @@ import { signOut } from 'firebase/auth';
3
3
  import { auth } from '~/services/firebase';
4
4
  import paths from '~/config/config.json';
5
5
  import { getUserApiKey } from '~/utils/auth';
6
- import { auditService } from '~/services/audit.service';
6
+ import { auditService } from '~/services/audit';
7
7
  import styles from './delete-account.module.css';
8
8
 
9
9
  interface DeletionProgress {
@@ -5,8 +5,8 @@ import { DeleteAccount } from './delete-account';
5
5
  import { UserAuditViewer } from '../audit/user-audit-viewer';
6
6
  import { AuthContext } from '~/contexts/auth.context';
7
7
  import { getUserData, updateUserData } from '~/utils/permissions';
8
- import { auditService } from '~/services/audit.service';
9
- import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase-errors';
8
+ import { auditService } from '~/services/audit';
9
+ import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase/errors';
10
10
  import { FormField, FormButton, FormMessage } from '../form';
11
11
  import { MfaPhoneUpdateSection } from './mfa-phone-update';
12
12
  import styles from './manage-profile.module.css';
@@ -12,9 +12,9 @@ import {
12
12
  type MultiFactorResolver,
13
13
  type User,
14
14
  } from 'firebase/auth';
15
- import { auditService } from '~/services/audit.service';
15
+ import { auditService } from '~/services/audit';
16
16
  import { auth } from '~/services/firebase';
17
- import { ERROR_MESSAGES, getValidationError, handleAuthError } from '~/services/firebase-errors';
17
+ import { ERROR_MESSAGES, getValidationError, handleAuthError } from '~/services/firebase/errors';
18
18
  import {
19
19
  formatPhoneNumberForMfa,
20
20
  getMaskedFactorDisplay,
@@ -1,5 +1,5 @@
1
1
  import { createContext } from 'react';
2
- import { User } from 'firebase/auth';
2
+ import type { User } from 'firebase/auth';
3
3
 
4
4
  interface AuthContextType {
5
5
  user: User | null;
@@ -1,12 +1,12 @@
1
- import { RemixBrowser } from "@remix-run/react";
2
- import { startTransition, StrictMode } from "react";
3
- import { hydrateRoot } from "react-dom/client";
4
-
5
- startTransition(() => {
6
- hydrateRoot(
7
- document,
8
- <StrictMode>
9
- <RemixBrowser />
10
- </StrictMode>
11
- );
12
- });
1
+ import { HydratedRouter } from "react-router/dom";
2
+ import { startTransition, StrictMode } from "react";
3
+ import { hydrateRoot } from "react-dom/client";
4
+
5
+ startTransition(() => {
6
+ hydrateRoot(
7
+ document,
8
+ <StrictMode>
9
+ <HydratedRouter />
10
+ </StrictMode>
11
+ );
12
+ });
@@ -1,5 +1,5 @@
1
- import type { EntryContext } from "@remix-run/cloudflare";
2
- import { RemixServer } from "@remix-run/react";
1
+ import type { EntryContext } from "react-router";
2
+ import { ServerRouter } from "react-router";
3
3
  import { isbot } from "isbot";
4
4
  import { renderToReadableStream } from "react-dom/server";
5
5
 
@@ -7,10 +7,10 @@ export default async function handleRequest(
7
7
  request: Request,
8
8
  responseStatusCode: number,
9
9
  responseHeaders: Headers,
10
- remixContext: EntryContext
10
+ reactRouterContext: EntryContext
11
11
  ) {
12
12
  const body = await renderToReadableStream(
13
- <RemixServer context={remixContext} url={request.url} />,
13
+ <ServerRouter context={reactRouterContext} url={request.url} />,
14
14
  {
15
15
  // If you wish to abort the rendering process, you can pass a signal here.
16
16
  // Please refer to the templates for example son how to configure this.
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useRef, useCallback } from 'react';
2
- import { useLocation } from '@remix-run/react';
2
+ import { useLocation } from 'react-router';
3
3
  import { signOut } from 'firebase/auth';
4
4
  import { auth } from '~/services/firebase';
5
5
  import { INACTIVITY_CONFIG } from '~/config/inactivity';
package/app/root.tsx CHANGED
@@ -1,4 +1,4 @@
1
- import type { LinksFunction } from "@remix-run/cloudflare";
1
+ import type { LinksFunction } from 'react-router';
2
2
  import {
3
3
  Links,
4
4
  Meta,
@@ -9,8 +9,8 @@ import {
9
9
  useRouteError,
10
10
  Link,
11
11
  useLocation,
12
- useMatches
13
- } from "@remix-run/react";
12
+ useMatches,
13
+ } from 'react-router';
14
14
  import {
15
15
  ThemeProvider,
16
16
  themeStyles
@@ -1,5 +1,5 @@
1
1
  import { useEffect, useMemo, useState } from 'react';
2
- import { Link, useNavigate } from '@remix-run/react';
2
+ import { Link, useNavigate } from 'react-router';
3
3
  import {
4
4
  applyActionCode,
5
5
  checkActionCode,
@@ -7,10 +7,10 @@ import {
7
7
  verifyPasswordResetCode,
8
8
  } from 'firebase/auth';
9
9
  import { auth } from '~/services/firebase';
10
- import { handleAuthError } from '~/services/firebase-errors';
10
+ import { handleAuthError } from '~/services/firebase/errors';
11
11
  import { evaluatePasswordPolicy } from '~/utils/password-policy';
12
12
  import { getSafeContinuePath } from '~/utils/auth-action-settings';
13
- import { auditService } from '~/services/audit.service';
13
+ import { auditService } from '~/services/audit';
14
14
  import { Icon } from '~/components/icon/icon';
15
15
  import styles from './emailActionHandler.module.css';
16
16
 
@@ -1,7 +1,7 @@
1
1
  import { useState } from 'react';
2
- import { Link } from '@remix-run/react';
3
- import { sendEmailVerification, User } from 'firebase/auth';
4
- import { auditService } from '~/services/audit.service';
2
+ import { Link } from 'react-router';
3
+ import { sendEmailVerification, type User } from 'firebase/auth';
4
+ import { auditService } from '~/services/audit';
5
5
  import { buildActionCodeSettings } from '~/utils/auth-action-settings';
6
6
  import styles from './login.module.css';
7
7
 
@@ -1,28 +1,28 @@
1
1
  import { useState, useEffect } from 'react';
2
- import { Link, useSearchParams } from '@remix-run/react';
2
+ import { Link, useSearchParams } from 'react-router';
3
3
  import { auth } from '~/services/firebase';
4
4
  import {
5
5
  signInWithEmailAndPassword,
6
6
  createUserWithEmailAndPassword,
7
7
  onAuthStateChanged,
8
8
  sendEmailVerification,
9
- User,
9
+ type User,
10
10
  updateProfile,
11
11
  getMultiFactorResolver,
12
- MultiFactorResolver,
13
- MultiFactorError
12
+ type MultiFactorResolver,
13
+ type MultiFactorError
14
14
  } from 'firebase/auth';
15
15
  import { PasswordReset } from '~/routes/auth/passwordReset';
16
16
  import { EmailVerification } from '~/routes/auth/emailVerification';
17
17
  import { EmailActionHandler } from '~/routes/auth/emailActionHandler';
18
- import { handleAuthError } from '~/services/firebase-errors';
18
+ import { handleAuthError } from '~/services/firebase/errors';
19
19
  import { MFAVerification } from '~/components/auth/mfa-verification';
20
20
  import { MFAEnrollment } from '~/components/auth/mfa-enrollment';
21
21
  import { Icon } from '~/components/icon/icon';
22
22
  import styles from './login.module.css';
23
23
  import { Striae } from '~/routes/striae/striae';
24
24
  import { getUserData, createUser } from '~/utils/permissions';
25
- import { auditService } from '~/services/audit.service';
25
+ import { auditService } from '~/services/audit';
26
26
  import { generateUniqueId } from '~/utils/id-generator';
27
27
  import { evaluatePasswordPolicy } from '~/utils/password-policy';
28
28
  import { buildActionCodeSettings } from '~/utils/auth-action-settings';
@@ -1,9 +1,9 @@
1
1
  import { useRef, useState } from 'react';
2
- import { Link } from '@remix-run/react';
2
+ import { Link } from 'react-router';
3
3
  import { sendPasswordResetEmail, signOut } from 'firebase/auth';
4
4
  import { auth } from '~/services/firebase';
5
- import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase-errors';
6
- import { auditService } from '~/services/audit.service';
5
+ import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase/errors';
6
+ import { auditService } from '~/services/audit';
7
7
  import { buildActionCodeSettings } from '~/utils/auth-action-settings';
8
8
  import styles from './passwordReset.module.css';
9
9
 
@@ -1,4 +1,4 @@
1
- import { redirect } from '@remix-run/cloudflare';
1
+ import { redirect } from 'react-router';
2
2
 
3
3
  export const loader = async () => {
4
4
  throw redirect('/');