@striae-org/striae 4.0.3 → 4.1.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.
Files changed (66) hide show
  1. package/app/components/actions/confirm-export.ts +4 -2
  2. package/app/components/actions/generate-pdf.ts +10 -2
  3. package/app/components/audit/user-audit-viewer.tsx +121 -940
  4. package/app/components/audit/user-audit.module.css +20 -0
  5. package/app/components/audit/viewer/audit-activity-summary.tsx +52 -0
  6. package/app/components/audit/viewer/audit-entries-list.tsx +200 -0
  7. package/app/components/audit/viewer/audit-filters-panel.tsx +306 -0
  8. package/app/components/audit/viewer/audit-user-info-card.tsx +44 -0
  9. package/app/components/audit/viewer/audit-viewer-header.tsx +55 -0
  10. package/app/components/audit/viewer/audit-viewer-utils.ts +121 -0
  11. package/app/components/audit/viewer/types.ts +1 -0
  12. package/app/components/audit/viewer/use-audit-viewer-data.ts +166 -0
  13. package/app/components/audit/viewer/use-audit-viewer-export.ts +176 -0
  14. package/app/components/audit/viewer/use-audit-viewer-filters.ts +141 -0
  15. package/app/components/auth/mfa-enrollment.module.css +13 -5
  16. package/app/components/auth/mfa-verification.module.css +13 -5
  17. package/app/components/canvas/canvas.tsx +3 -0
  18. package/app/components/canvas/confirmation/confirmation.tsx +13 -37
  19. package/app/components/public-signing-key-modal/public-signing-key-modal.module.css +1 -0
  20. package/app/components/public-signing-key-modal/public-signing-key-modal.tsx +8 -37
  21. package/app/components/sidebar/case-export/case-export.tsx +9 -34
  22. package/app/components/sidebar/case-import/case-import.module.css +2 -0
  23. package/app/components/sidebar/case-import/case-import.tsx +10 -34
  24. package/app/components/sidebar/cases/cases-modal.module.css +44 -9
  25. package/app/components/sidebar/cases/cases-modal.tsx +16 -14
  26. package/app/components/sidebar/files/files-modal.module.css +45 -10
  27. package/app/components/sidebar/files/files-modal.tsx +16 -16
  28. package/app/components/sidebar/notes/notes-modal.tsx +17 -15
  29. package/app/components/sidebar/notes/notes.module.css +2 -0
  30. package/app/components/sidebar/sidebar.module.css +2 -2
  31. package/app/components/toast/toast.module.css +2 -1
  32. package/app/components/toast/toast.tsx +16 -11
  33. package/app/components/user/delete-account.tsx +10 -31
  34. package/app/components/user/inactivity-warning.module.css +8 -6
  35. package/app/components/user/manage-profile.module.css +2 -0
  36. package/app/components/user/manage-profile.tsx +85 -30
  37. package/app/hooks/useOverlayDismiss.ts +68 -0
  38. package/app/routes/auth/login.example.tsx +19 -8
  39. package/app/routes/auth/passwordReset.module.css +23 -13
  40. package/app/routes/striae/striae.tsx +8 -1
  41. package/app/routes.ts +7 -0
  42. package/app/services/audit/audit-export-csv.ts +2 -0
  43. package/app/services/audit/audit.service.ts +29 -5
  44. package/app/services/audit/builders/audit-entry-builder.ts +2 -1
  45. package/app/services/audit/builders/audit-event-builders-user-security.ts +4 -2
  46. package/app/services/audit/builders/audit-event-builders-workflow.ts +6 -0
  47. package/app/types/audit.ts +2 -1
  48. package/app/types/user.ts +1 -0
  49. package/app/utils/data/permissions.ts +1 -0
  50. package/functions/api/pdf/[[path]].ts +32 -1
  51. package/load-context.ts +9 -0
  52. package/package.json +5 -1
  53. package/primershear.emails.example +6 -0
  54. package/scripts/deploy-pages-secrets.sh +6 -0
  55. package/scripts/deploy-primershear-emails.sh +166 -0
  56. package/worker-configuration.d.ts +7493 -7491
  57. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  58. package/workers/data-worker/wrangler.jsonc.example +1 -1
  59. package/workers/image-worker/wrangler.jsonc.example +1 -1
  60. package/workers/keys-worker/wrangler.jsonc.example +1 -1
  61. package/workers/pdf-worker/src/pdf-worker.example.ts +3 -0
  62. package/workers/pdf-worker/src/report-types.ts +3 -0
  63. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  64. package/workers/user-worker/src/user-worker.example.ts +6 -1
  65. package/workers/user-worker/wrangler.jsonc.example +1 -1
  66. package/wrangler.toml.example +1 -1
@@ -2,7 +2,7 @@
2
2
  "name": "AUDIT_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/audit-worker.ts",
5
- "compatibility_date": "2026-03-18",
5
+ "compatibility_date": "2026-03-19",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -3,7 +3,7 @@
3
3
  "name": "DATA_WORKER_NAME",
4
4
  "account_id": "ACCOUNT_ID",
5
5
  "main": "src/data-worker.ts",
6
- "compatibility_date": "2026-03-18",
6
+ "compatibility_date": "2026-03-19",
7
7
  "compatibility_flags": [
8
8
  "nodejs_compat"
9
9
  ],
@@ -2,7 +2,7 @@
2
2
  "name": "IMAGES_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/image-worker.ts",
5
- "compatibility_date": "2026-03-18",
5
+ "compatibility_date": "2026-03-19",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -2,7 +2,7 @@
2
2
  "name": "KEYS_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/keys.ts",
5
- "compatibility_date": "2026-03-18",
5
+ "compatibility_date": "2026-03-19",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -27,6 +27,9 @@ const DEFAULT_PDF_OPTIONS = {
27
27
  const reportModuleLoaders: Record<string, () => Promise<ReportModule>> = {
28
28
  // Default Striae report format module
29
29
  striae: () => import('./formats/format-striae'),
30
+ // Additional formats can be added here
31
+ primershear: () => import('./formats/format-primer-shear'),
32
+
30
33
  };
31
34
 
32
35
  const corsHeaders: Record<string, string> = {
@@ -55,6 +55,9 @@ export interface PDFGenerationData {
55
55
  currentDate?: string;
56
56
  notesUpdatedFormatted?: string;
57
57
  userCompany?: string;
58
+ userFirstName?: string;
59
+ userLastName?: string;
60
+ userBadgeId?: string;
58
61
  }
59
62
 
60
63
  export interface PDFGenerationRequest {
@@ -2,7 +2,7 @@
2
2
  "name": "PDF_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/pdf-worker.ts",
5
- "compatibility_date": "2026-03-18",
5
+ "compatibility_date": "2026-03-19",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -16,6 +16,7 @@ interface UserData {
16
16
  firstName: string;
17
17
  lastName: string;
18
18
  company: string;
19
+ badgeId?: string;
19
20
  permitted: boolean;
20
21
  cases: CaseItem[];
21
22
  readOnlyCases?: ReadOnlyCaseItem[];
@@ -40,6 +41,7 @@ interface UserRequestData {
40
41
  firstName?: string;
41
42
  lastName?: string;
42
43
  company?: string;
44
+ badgeId?: string;
43
45
  permitted?: boolean;
44
46
  readOnlyCases?: ReadOnlyCaseItem[];
45
47
  }
@@ -286,7 +288,8 @@ async function handleGetUser(env: Env, userUid: string): Promise<Response> {
286
288
  async function handleAddUser(request: Request, env: Env, userUid: string): Promise<Response> {
287
289
  try {
288
290
  const requestData: UserRequestData = await request.json();
289
- const { email, firstName, lastName, company, permitted } = requestData;
291
+ const { email, firstName, lastName, company, badgeId, permitted } = requestData;
292
+ const normalizedBadgeId = typeof badgeId === 'string' ? badgeId.trim() : undefined;
290
293
 
291
294
  // Check for existing user
292
295
  const value = await env.USER_DB.get(userUid);
@@ -302,6 +305,7 @@ async function handleAddUser(request: Request, env: Env, userUid: string): Promi
302
305
  firstName: firstName || existing.firstName,
303
306
  lastName: lastName || existing.lastName,
304
307
  company: company || existing.company,
308
+ badgeId: normalizedBadgeId !== undefined ? normalizedBadgeId : (existing.badgeId ?? ''),
305
309
  permitted: permitted !== undefined ? permitted : existing.permitted,
306
310
  updatedAt: new Date().toISOString()
307
311
  };
@@ -316,6 +320,7 @@ async function handleAddUser(request: Request, env: Env, userUid: string): Promi
316
320
  firstName: firstName || '',
317
321
  lastName: lastName || '',
318
322
  company: company || '',
323
+ badgeId: normalizedBadgeId ?? '',
319
324
  permitted: permitted !== undefined ? permitted : true,
320
325
  cases: [],
321
326
  createdAt: new Date().toISOString()
@@ -2,7 +2,7 @@
2
2
  "name": "USER_WORKER_NAME",
3
3
  "account_id": "ACCOUNT_ID",
4
4
  "main": "src/user-worker.ts",
5
- "compatibility_date": "2026-03-18",
5
+ "compatibility_date": "2026-03-19",
6
6
  "compatibility_flags": [
7
7
  "nodejs_compat"
8
8
  ],
@@ -1,6 +1,6 @@
1
1
  #:schema node_modules/wrangler/config-schema.json
2
2
  name = "PAGES_PROJECT_NAME"
3
- compatibility_date = "2026-03-18"
3
+ compatibility_date = "2026-03-19"
4
4
  compatibility_flags = ["nodejs_compat"]
5
5
  pages_build_output_dir = "./build/client"
6
6