@striae-org/striae 5.2.1 → 5.3.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.
Files changed (117) hide show
  1. package/.env.example +2 -10
  2. package/README.md +5 -46
  3. package/app/components/actions/case-export/core-export.ts +5 -174
  4. package/app/components/actions/case-export/download-handlers.ts +84 -751
  5. package/app/components/actions/case-export/index.ts +6 -30
  6. package/app/components/actions/case-export/metadata-helpers.ts +0 -78
  7. package/app/components/actions/case-export/types-constants.ts +0 -43
  8. package/app/components/actions/case-import/confirmation-import.ts +75 -36
  9. package/app/components/actions/case-import/confirmation-package.ts +68 -1
  10. package/app/components/actions/case-import/index.ts +1 -1
  11. package/app/components/actions/case-import/orchestrator.ts +78 -53
  12. package/app/components/actions/case-import/zip-processing.ts +160 -330
  13. package/app/components/actions/generate-pdf.ts +3 -2
  14. package/app/components/audit/user-audit-viewer.tsx +0 -19
  15. package/app/components/audit/viewer/audit-viewer-header.tsx +0 -33
  16. package/app/components/navbar/case-modals/archive-case-modal.tsx +1 -1
  17. package/app/components/navbar/case-modals/export-case-modal.module.css +27 -0
  18. package/app/components/navbar/case-modals/export-case-modal.tsx +132 -0
  19. package/app/components/navbar/case-modals/export-confirmations-modal.module.css +24 -0
  20. package/app/components/navbar/case-modals/export-confirmations-modal.tsx +108 -0
  21. package/app/components/navbar/navbar.tsx +1 -1
  22. package/app/components/sidebar/case-import/case-import.module.css +35 -0
  23. package/app/components/sidebar/case-import/components/CasePreviewSection.tsx +51 -3
  24. package/app/components/sidebar/case-import/components/ConfirmationDialog.tsx +2 -4
  25. package/app/components/sidebar/case-import/components/ConfirmationPreviewSection.tsx +36 -5
  26. package/app/components/sidebar/case-import/hooks/useFilePreview.ts +5 -9
  27. package/app/components/sidebar/case-import/index.ts +1 -4
  28. package/app/components/sidebar/notes/class-details-shared.ts +2 -2
  29. package/app/components/toast/toast.module.css +36 -0
  30. package/app/components/toast/toast.tsx +6 -2
  31. package/app/components/user/manage-profile.tsx +4 -3
  32. package/app/config-example/config.json +1 -2
  33. package/app/root.tsx +0 -7
  34. package/app/routes/_index.tsx +1 -1
  35. package/app/routes/auth/login.example.tsx +22 -103
  36. package/app/routes/auth/login.tsx +22 -103
  37. package/app/routes/auth/route.ts +1 -1
  38. package/app/routes/striae/striae.tsx +117 -59
  39. package/app/services/firebase/index.ts +0 -3
  40. package/app/types/case.ts +1 -0
  41. package/app/types/export.ts +2 -2
  42. package/app/types/import.ts +10 -0
  43. package/app/utils/auth/index.ts +0 -1
  44. package/app/utils/data/permissions.ts +3 -2
  45. package/package.json +9 -16
  46. package/public/_headers +0 -4
  47. package/public/_routes.json +0 -1
  48. package/worker-configuration.d.ts +20 -17
  49. package/workers/audit-worker/src/audit-worker.example.ts +9 -806
  50. package/workers/audit-worker/src/config.ts +7 -0
  51. package/workers/audit-worker/src/crypto/data-at-rest.ts +410 -0
  52. package/workers/audit-worker/src/handlers/audit-routes.ts +125 -0
  53. package/workers/audit-worker/src/storage/audit-storage.ts +99 -0
  54. package/workers/audit-worker/src/types.ts +56 -0
  55. package/workers/audit-worker/worker-configuration.d.ts +1 -1
  56. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  57. package/workers/data-worker/src/config.ts +11 -0
  58. package/workers/data-worker/src/data-worker.example.ts +21 -942
  59. package/workers/data-worker/src/handlers/decrypt-export.ts +118 -0
  60. package/workers/data-worker/src/handlers/signing.ts +174 -0
  61. package/workers/data-worker/src/handlers/storage-routes.ts +129 -0
  62. package/workers/data-worker/src/registry/key-registry.ts +368 -0
  63. package/workers/data-worker/src/types.ts +46 -0
  64. package/workers/data-worker/worker-configuration.d.ts +1 -1
  65. package/workers/data-worker/wrangler.jsonc.example +1 -1
  66. package/workers/image-worker/worker-configuration.d.ts +1 -1
  67. package/workers/image-worker/wrangler.jsonc.example +1 -1
  68. package/workers/pdf-worker/worker-configuration.d.ts +2 -3
  69. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  70. package/workers/user-worker/src/auth.ts +30 -0
  71. package/workers/user-worker/src/cleanup/account-deletion.ts +337 -0
  72. package/workers/user-worker/src/config.ts +4 -0
  73. package/workers/user-worker/src/encryption-utils.ts +25 -0
  74. package/workers/user-worker/src/firebase/admin.ts +152 -0
  75. package/workers/user-worker/src/handlers/user-routes.ts +242 -0
  76. package/workers/user-worker/src/registry/user-kv.ts +172 -0
  77. package/workers/user-worker/src/storage/user-records.ts +34 -0
  78. package/workers/user-worker/src/types.ts +106 -0
  79. package/workers/user-worker/src/user-worker.example.ts +18 -964
  80. package/workers/user-worker/worker-configuration.d.ts +4 -2
  81. package/workers/user-worker/wrangler.jsonc.example +12 -1
  82. package/wrangler.toml.example +1 -1
  83. package/app/components/actions/case-export/data-processing.ts +0 -223
  84. package/app/components/sidebar/case-export/case-export.module.css +0 -418
  85. package/app/components/sidebar/case-export/case-export.tsx +0 -310
  86. package/app/types/exceljs-bare.d.ts +0 -9
  87. package/app/utils/auth/auth.ts +0 -11
  88. package/public/.well-known/security.txt +0 -6
  89. package/public/favicon.ico +0 -0
  90. package/public/icon-256.png +0 -0
  91. package/public/icon-512.png +0 -0
  92. package/public/manifest.json +0 -39
  93. package/public/shortcut.png +0 -0
  94. package/public/social-image.png +0 -0
  95. package/public/vendor/exceljs.LICENSE +0 -22
  96. package/public/vendor/exceljs.bare.min.js +0 -45
  97. package/scripts/deploy-all.sh +0 -166
  98. package/scripts/deploy-config/modules/env-utils.sh +0 -322
  99. package/scripts/deploy-config/modules/keys.sh +0 -404
  100. package/scripts/deploy-config/modules/prompt.sh +0 -372
  101. package/scripts/deploy-config/modules/scaffolding.sh +0 -344
  102. package/scripts/deploy-config/modules/validation.sh +0 -365
  103. package/scripts/deploy-config.sh +0 -236
  104. package/scripts/deploy-pages-secrets.sh +0 -231
  105. package/scripts/deploy-pages.sh +0 -34
  106. package/scripts/deploy-primershear-emails.sh +0 -167
  107. package/scripts/deploy-worker-secrets.sh +0 -374
  108. package/scripts/dev.cjs +0 -23
  109. package/scripts/install-workers.sh +0 -88
  110. package/scripts/run-eslint.cjs +0 -43
  111. package/scripts/update-compatibility-dates.cjs +0 -124
  112. package/scripts/update-markdown-versions.cjs +0 -43
  113. package/workers/keys-worker/package.json +0 -18
  114. package/workers/keys-worker/src/keys.example.ts +0 -67
  115. package/workers/keys-worker/src/keys.ts +0 -67
  116. package/workers/keys-worker/worker-configuration.d.ts +0 -7447
  117. package/workers/keys-worker/wrangler.jsonc.example +0 -15
@@ -1,18 +0,0 @@
1
- {
2
- "name": "keys-worker",
3
- "version": "0.0.0",
4
- "private": true,
5
- "scripts": {
6
- "deploy": "wrangler deploy",
7
- "dev": "wrangler dev",
8
- "start": "wrangler dev"
9
- },
10
- "devDependencies": {
11
- "@cloudflare/puppeteer": "^1.0.6",
12
- "wrangler": "^4.77.0"
13
- },
14
- "overrides": {
15
- "undici": "7.24.1",
16
- "yauzl": "3.2.1"
17
- }
18
- }
@@ -1,67 +0,0 @@
1
- interface Env {
2
- R2_KEY_SECRET: string;
3
- ACCOUNT_HASH: string;
4
- IMAGES_API_TOKEN: string;
5
- USER_DB_AUTH: string;
6
- PDF_WORKER_AUTH: string;
7
- KEYS_AUTH: string;
8
- }
9
-
10
- const corsHeaders: Record<string, string> = {
11
- 'Access-Control-Allow-Origin': 'PAGES_CUSTOM_DOMAIN',
12
- 'Access-Control-Allow-Methods': 'GET,POST,OPTIONS',
13
- 'Access-Control-Allow-Headers': 'Content-Type, X-Custom-Auth-Key',
14
- 'Content-Type': 'text/plain'
15
- };
16
-
17
- const hasValidHeader = (request: Request, env: Env): boolean =>
18
- request.headers.get("X-Custom-Auth-Key") === env.KEYS_AUTH;
19
-
20
- export default {
21
- async fetch(request: Request, env: Env): Promise<Response> {
22
- if (request.method === 'OPTIONS') {
23
- return new Response(null, { headers: corsHeaders });
24
- }
25
-
26
- if (!hasValidHeader(request, env)) {
27
- return new Response('Forbidden', {
28
- status: 403,
29
- headers: corsHeaders
30
- });
31
- }
32
-
33
- const url = new URL(request.url);
34
- const path = url.pathname.replace('/', '');
35
-
36
- // Handle regular key retrieval
37
- if (request.method === 'GET') {
38
- const keyName = path;
39
-
40
- if (!keyName) {
41
- return new Response('Key name required', {
42
- status: 400,
43
- headers: corsHeaders
44
- });
45
- }
46
-
47
- if (!(keyName in env)) {
48
- return new Response('Key not found', {
49
- status: 404,
50
- headers: corsHeaders
51
- });
52
- }
53
-
54
- // Type assertion needed here since TypeScript doesn't know that keyName exists in env
55
- const keyValue = env[keyName as keyof Env];
56
-
57
- return new Response(keyValue, {
58
- headers: corsHeaders
59
- });
60
- }
61
-
62
- return new Response('Method not allowed', {
63
- status: 405,
64
- headers: corsHeaders
65
- });
66
- }
67
- };
@@ -1,67 +0,0 @@
1
- interface Env {
2
- R2_KEY_SECRET: string;
3
- ACCOUNT_HASH: string;
4
- IMAGES_API_TOKEN: string;
5
- USER_DB_AUTH: string;
6
- PDF_WORKER_AUTH: string;
7
- KEYS_AUTH: string;
8
- }
9
-
10
- const corsHeaders: Record<string, string> = {
11
- 'Access-Control-Allow-Origin': 'https://striae.app',
12
- 'Access-Control-Allow-Methods': 'GET,POST,OPTIONS',
13
- 'Access-Control-Allow-Headers': 'Content-Type, X-Custom-Auth-Key',
14
- 'Content-Type': 'text/plain'
15
- };
16
-
17
- const hasValidHeader = (request: Request, env: Env): boolean =>
18
- request.headers.get("X-Custom-Auth-Key") === env.KEYS_AUTH;
19
-
20
- export default {
21
- async fetch(request: Request, env: Env): Promise<Response> {
22
- if (request.method === 'OPTIONS') {
23
- return new Response(null, { headers: corsHeaders });
24
- }
25
-
26
- if (!hasValidHeader(request, env)) {
27
- return new Response('Forbidden', {
28
- status: 403,
29
- headers: corsHeaders
30
- });
31
- }
32
-
33
- const url = new URL(request.url);
34
- const path = url.pathname.replace('/', '');
35
-
36
- // Handle regular key retrieval
37
- if (request.method === 'GET') {
38
- const keyName = path;
39
-
40
- if (!keyName) {
41
- return new Response('Key name required', {
42
- status: 400,
43
- headers: corsHeaders
44
- });
45
- }
46
-
47
- if (!(keyName in env)) {
48
- return new Response('Key not found', {
49
- status: 404,
50
- headers: corsHeaders
51
- });
52
- }
53
-
54
- // Type assertion needed here since TypeScript doesn't know that keyName exists in env
55
- const keyValue = env[keyName as keyof Env];
56
-
57
- return new Response(keyValue, {
58
- headers: corsHeaders
59
- });
60
- }
61
-
62
- return new Response('Method not allowed', {
63
- status: 405,
64
- headers: corsHeaders
65
- });
66
- }
67
- };