@striae-org/striae 4.0.3 → 4.2.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 (118) hide show
  1. package/.env.example +8 -0
  2. package/app/components/actions/case-export/core-export.ts +14 -8
  3. package/app/components/actions/case-export/data-processing.ts +1 -0
  4. package/app/components/actions/case-export/download-handlers.ts +7 -0
  5. package/app/components/actions/case-export/metadata-helpers.ts +2 -1
  6. package/app/components/actions/case-import/confirmation-import.ts +12 -2
  7. package/app/components/actions/case-import/orchestrator.ts +78 -32
  8. package/app/components/actions/case-import/storage-operations.ts +97 -8
  9. package/app/components/actions/case-import/zip-processing.ts +159 -86
  10. package/app/components/actions/case-manage.ts +430 -8
  11. package/app/components/actions/confirm-export.ts +13 -4
  12. package/app/components/actions/generate-pdf.ts +10 -2
  13. package/app/components/actions/image-manage.ts +77 -44
  14. package/app/components/audit/user-audit-viewer.tsx +137 -945
  15. package/app/components/audit/user-audit.module.css +41 -0
  16. package/app/components/audit/viewer/audit-activity-summary.tsx +52 -0
  17. package/app/components/audit/viewer/audit-entries-list.tsx +207 -0
  18. package/app/components/audit/viewer/audit-filters-panel.tsx +307 -0
  19. package/app/components/audit/viewer/audit-user-info-card.tsx +44 -0
  20. package/app/components/audit/viewer/audit-viewer-header.tsx +55 -0
  21. package/app/components/audit/viewer/audit-viewer-utils.ts +123 -0
  22. package/app/components/audit/viewer/types.ts +1 -0
  23. package/app/components/audit/viewer/use-audit-viewer-data.ts +186 -0
  24. package/app/components/audit/viewer/use-audit-viewer-export.ts +176 -0
  25. package/app/components/audit/viewer/use-audit-viewer-filters.ts +141 -0
  26. package/app/components/auth/mfa-enrollment.module.css +13 -5
  27. package/app/components/auth/mfa-verification.module.css +13 -5
  28. package/app/components/canvas/box-annotations/box-annotations.module.css +22 -18
  29. package/app/components/canvas/box-annotations/box-annotations.tsx +15 -0
  30. package/app/components/canvas/canvas.module.css +64 -54
  31. package/app/components/canvas/canvas.tsx +17 -16
  32. package/app/components/canvas/confirmation/confirmation.module.css +1 -0
  33. package/app/components/canvas/confirmation/confirmation.tsx +17 -47
  34. package/app/components/navbar/case-modals/archive-case-modal.module.css +110 -0
  35. package/app/components/navbar/case-modals/archive-case-modal.tsx +129 -0
  36. package/app/components/navbar/case-modals/open-case-modal.module.css +81 -0
  37. package/app/components/navbar/case-modals/open-case-modal.tsx +120 -0
  38. package/app/components/navbar/case-modals/rename-case-modal.module.css +81 -0
  39. package/app/components/navbar/case-modals/rename-case-modal.tsx +107 -0
  40. package/app/components/navbar/navbar.module.css +447 -0
  41. package/app/components/navbar/navbar.tsx +377 -0
  42. package/app/components/public-signing-key-modal/public-signing-key-modal.module.css +2 -0
  43. package/app/components/public-signing-key-modal/public-signing-key-modal.tsx +21 -51
  44. package/app/components/sidebar/case-export/case-export.module.css +1 -0
  45. package/app/components/sidebar/case-export/case-export.tsx +14 -77
  46. package/app/components/sidebar/case-import/case-import.module.css +25 -0
  47. package/app/components/sidebar/case-import/case-import.tsx +64 -40
  48. package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +20 -1
  49. package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +15 -0
  50. package/app/components/sidebar/cases/case-sidebar.tsx +25 -519
  51. package/app/components/sidebar/cases/cases-modal.module.css +45 -9
  52. package/app/components/sidebar/cases/cases-modal.tsx +16 -16
  53. package/app/components/sidebar/cases/cases.module.css +62 -21
  54. package/app/components/sidebar/files/files-modal.module.css +46 -10
  55. package/app/components/sidebar/files/files-modal.tsx +22 -23
  56. package/app/components/sidebar/notes/notes-editor-modal.module.css +49 -0
  57. package/app/components/sidebar/notes/notes-editor-modal.tsx +66 -0
  58. package/app/components/sidebar/notes/notes-modal.tsx +18 -17
  59. package/app/components/sidebar/notes/notes-sidebar.tsx +199 -113
  60. package/app/components/sidebar/notes/notes.module.css +155 -0
  61. package/app/components/sidebar/sidebar-container.tsx +15 -28
  62. package/app/components/sidebar/sidebar.module.css +7 -71
  63. package/app/components/sidebar/sidebar.tsx +24 -125
  64. package/app/components/sidebar/upload/image-upload-zone.module.css +13 -13
  65. package/app/components/toast/toast.module.css +2 -1
  66. package/app/components/toast/toast.tsx +16 -11
  67. package/app/components/user/delete-account.tsx +10 -31
  68. package/app/components/user/inactivity-warning.module.css +9 -6
  69. package/app/components/user/inactivity-warning.tsx +15 -2
  70. package/app/components/user/manage-profile.module.css +2 -0
  71. package/app/components/user/manage-profile.tsx +108 -40
  72. package/app/hooks/useOverlayDismiss.ts +116 -0
  73. package/app/routes/auth/login.example.tsx +19 -8
  74. package/app/routes/auth/login.tsx +785 -774
  75. package/app/routes/auth/passwordReset.module.css +23 -13
  76. package/app/routes/striae/striae.module.css +10 -3
  77. package/app/routes/striae/striae.tsx +477 -31
  78. package/app/routes.ts +7 -0
  79. package/app/services/audit/audit-export-csv.ts +2 -0
  80. package/app/services/audit/audit.service.ts +202 -32
  81. package/app/services/audit/builders/audit-entry-builder.ts +2 -1
  82. package/app/services/audit/builders/audit-event-builders-case-file.ts +43 -0
  83. package/app/services/audit/builders/audit-event-builders-user-security.ts +4 -2
  84. package/app/services/audit/builders/audit-event-builders-workflow.ts +8 -0
  85. package/app/services/audit/builders/index.ts +1 -0
  86. package/app/types/audit.ts +5 -2
  87. package/app/types/case.ts +29 -0
  88. package/app/types/import.ts +3 -0
  89. package/app/types/user.ts +1 -0
  90. package/app/utils/data/permissions.ts +17 -1
  91. package/app/utils/forensics/audit-export-signature.ts +5 -1
  92. package/app/utils/forensics/confirmation-signature.ts +3 -0
  93. package/app/utils/forensics/export-verification.ts +497 -22
  94. package/functions/api/pdf/[[path]].ts +32 -1
  95. package/load-context.ts +9 -0
  96. package/package.json +6 -2
  97. package/primershear.emails.example +6 -0
  98. package/scripts/deploy-pages-secrets.sh +6 -0
  99. package/scripts/deploy-primershear-emails.sh +167 -0
  100. package/worker-configuration.d.ts +7493 -7491
  101. package/workers/audit-worker/worker-configuration.d.ts +7448 -11323
  102. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  103. package/workers/data-worker/worker-configuration.d.ts +7448 -11323
  104. package/workers/data-worker/wrangler.jsonc.example +1 -1
  105. package/workers/image-worker/worker-configuration.d.ts +7447 -11322
  106. package/workers/image-worker/wrangler.jsonc.example +1 -1
  107. package/workers/keys-worker/worker-configuration.d.ts +7447 -11322
  108. package/workers/keys-worker/wrangler.jsonc.example +1 -1
  109. package/workers/pdf-worker/src/formats/format-striae.ts +8 -7
  110. package/workers/pdf-worker/src/pdf-worker.example.ts +3 -0
  111. package/workers/pdf-worker/src/report-types.ts +3 -0
  112. package/workers/pdf-worker/worker-configuration.d.ts +7448 -11323
  113. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  114. package/workers/user-worker/src/user-worker.example.ts +6 -1
  115. package/workers/user-worker/worker-configuration.d.ts +7448 -11323
  116. package/workers/user-worker/wrangler.jsonc.example +1 -1
  117. package/wrangler.toml.example +1 -1
  118. package/public/.well-known/keybase.txt +0 -56
@@ -0,0 +1,167 @@
1
+ #!/bin/bash
2
+
3
+ # ============================================
4
+ # PRIMERSHEAR EMAIL LIST DEPLOYMENT SCRIPT
5
+ # ============================================
6
+ # Reads primershear.emails, updates PRIMERSHEAR_EMAILS in .env,
7
+ # then deploys that secret directly to Cloudflare Pages.
8
+ #
9
+ # Usage:
10
+ # bash ./scripts/deploy-primershear-emails.sh [--production-only|--preview-only|--env-only]
11
+ #
12
+ # Options:
13
+ # --production-only Deploy to production Pages environment only
14
+ # --preview-only Deploy to preview Pages environment only
15
+ # --env-only Update .env only; do not deploy to Cloudflare
16
+ # -h, --help Show this help message
17
+
18
+ set -e
19
+ set -o pipefail
20
+
21
+ RED='\033[0;31m'
22
+ GREEN='\033[0;32m'
23
+ YELLOW='\033[1;33m'
24
+ BLUE='\033[0;34m'
25
+ NC='\033[0m'
26
+
27
+ echo -e "${BLUE}📧 PrimerShear Email List Deployment${NC}"
28
+ echo "======================================"
29
+
30
+ SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
31
+ PROJECT_ROOT="$(cd "$SCRIPT_DIR/.." && pwd)"
32
+ cd "$PROJECT_ROOT"
33
+
34
+ trap 'echo -e "\n${RED}❌ deploy-primershear-emails.sh failed near line ${LINENO}${NC}"' ERR
35
+
36
+ # ── Argument parsing ─────────────────────────────────────────────────────────
37
+
38
+ deploy_production=true
39
+ deploy_preview=true
40
+ env_only=false
41
+
42
+ for arg in "$@"; do
43
+ case "$arg" in
44
+ -h|--help)
45
+ echo "Usage: bash ./scripts/deploy-primershear-emails.sh [--production-only|--preview-only|--env-only]"
46
+ echo ""
47
+ echo "Options:"
48
+ echo " --production-only Deploy to production Pages environment only"
49
+ echo " --preview-only Deploy to preview Pages environment only"
50
+ echo " --env-only Update .env only; do not deploy to Cloudflare"
51
+ echo " -h, --help Show this help message"
52
+ exit 0
53
+ ;;
54
+ --production-only)
55
+ deploy_production=true
56
+ deploy_preview=false
57
+ ;;
58
+ --preview-only)
59
+ deploy_production=false
60
+ deploy_preview=true
61
+ ;;
62
+ --env-only)
63
+ env_only=true
64
+ ;;
65
+ *)
66
+ echo -e "${RED}❌ Unknown option: $arg${NC}"
67
+ echo "Use --help to see supported options."
68
+ exit 1
69
+ ;;
70
+ esac
71
+ done
72
+
73
+ # ── Read emails file ──────────────────────────────────────────────────────────
74
+
75
+ EMAILS_FILE="$PROJECT_ROOT/primershear.emails"
76
+
77
+ if [ ! -f "$EMAILS_FILE" ]; then
78
+ echo -e "${RED}❌ primershear.emails not found at: $EMAILS_FILE${NC}"
79
+ echo -e "${YELLOW} Create it with one email address per line.${NC}"
80
+ exit 1
81
+ fi
82
+
83
+ # Strip comment lines and blank lines, then join with commas
84
+ # Use || true to avoid failure if paste gets no input (handles empty file gracefully)
85
+ PRIMERSHEAR_EMAILS=$(grep -v '^\s*#' "$EMAILS_FILE" | grep -v '^\s*$' | paste -sd ',' - || true)
86
+
87
+ if [ -z "$PRIMERSHEAR_EMAILS" ]; then
88
+ echo -e "${YELLOW}⚠️ primershear.emails contains no active email addresses.${NC}"
89
+ echo -e "${YELLOW} The secret will be set to an empty string, disabling the feature.${NC}"
90
+ fi
91
+
92
+ EMAIL_COUNT=$(echo "$PRIMERSHEAR_EMAILS" | tr ',' '\n' | grep -c '[^[:space:]]' || true)
93
+ echo -e "${GREEN}✅ Loaded $EMAIL_COUNT email address(es) from primershear.emails${NC}"
94
+
95
+ # ── Update .env ───────────────────────────────────────────────────────────────
96
+
97
+ ENV_FILE="$PROJECT_ROOT/.env"
98
+
99
+ if [ ! -f "$ENV_FILE" ]; then
100
+ echo -e "${RED}❌ .env not found. Run deploy-config first.${NC}"
101
+ exit 1
102
+ fi
103
+
104
+ # Replace the PRIMERSHEAR_EMAILS= line in .env (handles both empty and populated values)
105
+ if grep -q '^PRIMERSHEAR_EMAILS=' "$ENV_FILE"; then
106
+ # Use a temp file to avoid sed -i portability issues across macOS/Linux
107
+ local_tmp=$(mktemp)
108
+ sed "s|^PRIMERSHEAR_EMAILS=.*|PRIMERSHEAR_EMAILS=${PRIMERSHEAR_EMAILS}|" "$ENV_FILE" > "$local_tmp"
109
+ mv "$local_tmp" "$ENV_FILE"
110
+ echo -e "${GREEN}✅ Updated PRIMERSHEAR_EMAILS in .env${NC}"
111
+ else
112
+ echo "" >> "$ENV_FILE"
113
+ echo "PRIMERSHEAR_EMAILS=${PRIMERSHEAR_EMAILS}" >> "$ENV_FILE"
114
+ echo -e "${GREEN}✅ Appended PRIMERSHEAR_EMAILS to .env${NC}"
115
+ fi
116
+
117
+ if [ "$env_only" = "true" ]; then
118
+ echo -e "\n${GREEN}🎉 .env updated. Skipping Cloudflare deployment (--env-only).${NC}"
119
+ exit 0
120
+ fi
121
+
122
+ # ── Deploy to Cloudflare Pages ────────────────────────────────────────────────
123
+
124
+ if ! command -v wrangler > /dev/null 2>&1; then
125
+ echo -e "${RED}❌ wrangler is not installed or not in PATH${NC}"
126
+ exit 1
127
+ fi
128
+
129
+ source "$ENV_FILE"
130
+
131
+ PAGES_PROJECT_NAME=$(echo "$PAGES_PROJECT_NAME" | tr -d '\r')
132
+ if [ -z "$PAGES_PROJECT_NAME" ]; then
133
+ echo -e "${RED}❌ PAGES_PROJECT_NAME is missing from .env${NC}"
134
+ exit 1
135
+ fi
136
+
137
+ set_secret() {
138
+ local pages_env=$1
139
+ echo -e "${YELLOW} Setting PRIMERSHEAR_EMAILS for $pages_env...${NC}"
140
+ if [ "$pages_env" = "production" ]; then
141
+ printf '%s' "$PRIMERSHEAR_EMAILS" | wrangler pages secret put PRIMERSHEAR_EMAILS \
142
+ --project-name "$PAGES_PROJECT_NAME"
143
+ else
144
+ printf '%s' "$PRIMERSHEAR_EMAILS" | wrangler pages secret put PRIMERSHEAR_EMAILS \
145
+ --project-name "$PAGES_PROJECT_NAME" --env "$pages_env"
146
+ fi
147
+ }
148
+
149
+ if [ "$deploy_production" = "true" ]; then
150
+ set_secret "production"
151
+ echo -e "${GREEN}✅ PRIMERSHEAR_EMAILS deployed to production${NC}"
152
+ fi
153
+
154
+ if [ "$deploy_preview" = "true" ]; then
155
+ set_secret "preview"
156
+ echo -e "${GREEN}✅ PRIMERSHEAR_EMAILS deployed to preview${NC}"
157
+ fi
158
+
159
+ # Deploy Pages so the new secret takes effect immediately
160
+ echo -e "\n${YELLOW}🚀 Building and deploying Pages to activate new secret...${NC}"
161
+ if ! npm run deploy; then
162
+ echo -e "${RED}❌ Pages deployment failed${NC}"
163
+ exit 1
164
+ fi
165
+ echo -e "${GREEN}✅ Pages deployment complete${NC}"
166
+
167
+ echo -e "\n${GREEN}🎉 PrimerShear email list deployment complete!${NC}"