@striae-org/striae 3.1.1 → 3.2.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 (51) hide show
  1. package/.env.example +2 -0
  2. package/README.md +3 -32
  3. package/app/components/actions/case-export/data-processing.ts +49 -9
  4. package/app/components/actions/case-export/download-handlers.ts +125 -40
  5. package/app/components/actions/case-export/metadata-helpers.ts +31 -13
  6. package/app/components/actions/generate-pdf.ts +4 -0
  7. package/app/components/form/base-form.tsx +1 -1
  8. package/app/components/sidebar/case-export/case-export.tsx +15 -15
  9. package/app/components/sidebar/cases/case-sidebar.tsx +23 -16
  10. package/app/components/sidebar/sidebar-container.tsx +1 -1
  11. package/app/config-example/inactivity.ts +1 -1
  12. package/app/entry.client.tsx +12 -12
  13. package/app/entry.server.tsx +4 -4
  14. package/app/hooks/useInactivityTimeout.ts +1 -1
  15. package/app/root.tsx +3 -3
  16. package/app/routes/auth/emailActionHandler.tsx +1 -1
  17. package/app/routes/auth/emailVerification.tsx +1 -1
  18. package/app/routes/auth/login.tsx +1 -1
  19. package/app/routes/auth/passwordReset.tsx +1 -1
  20. package/app/routes/auth/route.ts +1 -1
  21. package/app/services/firebase.ts +4 -0
  22. package/app/types/exceljs-bare.d.ts +7 -0
  23. package/app/utils/auth.ts +5 -1
  24. package/functions/[[path]].ts +2 -2
  25. package/package.json +33 -18
  26. package/public/_routes.json +1 -0
  27. package/public/icon-256.png +0 -0
  28. package/public/vendor/exceljs.LICENSE +22 -0
  29. package/public/vendor/exceljs.bare.min.js +45 -0
  30. package/scripts/deploy-all.sh +52 -0
  31. package/scripts/deploy-config.sh +508 -3
  32. package/scripts/deploy-worker-secrets.sh +6 -2
  33. package/tsconfig.json +18 -8
  34. package/vite.config.ts +6 -22
  35. package/workers/audit-worker/package.json +8 -4
  36. package/workers/audit-worker/wrangler.jsonc.example +1 -1
  37. package/workers/data-worker/package.json +8 -4
  38. package/workers/data-worker/wrangler.jsonc.example +1 -1
  39. package/workers/image-worker/package.json +8 -4
  40. package/workers/image-worker/wrangler.jsonc.example +1 -1
  41. package/workers/keys-worker/package.json +8 -4
  42. package/workers/keys-worker/src/keys.example.ts +1 -0
  43. package/workers/keys-worker/wrangler.jsonc.example +1 -1
  44. package/workers/pdf-worker/package.json +9 -4
  45. package/workers/pdf-worker/src/format-striae.ts +2 -1
  46. package/workers/pdf-worker/src/generated-assets.ts +117 -0
  47. package/workers/pdf-worker/src/pdf-worker.example.ts +12 -1
  48. package/workers/pdf-worker/wrangler.jsonc.example +1 -1
  49. package/workers/user-worker/package.json +8 -4
  50. package/workers/user-worker/wrangler.jsonc.example +1 -1
  51. package/wrangler.toml.example +1 -1
@@ -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,
@@ -1,5 +1,5 @@
1
1
  import { useState } from 'react';
2
- import { Link } from '@remix-run/react';
2
+ import { Link } from 'react-router';
3
3
  import { sendEmailVerification, User } from 'firebase/auth';
4
4
  import { auditService } from '~/services/audit.service';
5
5
  import { buildActionCodeSettings } from '~/utils/auth-action-settings';
@@ -1,5 +1,5 @@
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,
@@ -1,5 +1,5 @@
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
5
  import { handleAuthError, ERROR_MESSAGES } from '~/services/firebase-errors';
@@ -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('/');
@@ -1,6 +1,8 @@
1
1
  import { initializeApp } from 'firebase/app';
2
2
  import {
3
3
  getAuth,
4
+ setPersistence,
5
+ browserSessionPersistence,
4
6
  //connectAuthEmulator,
5
7
  } from 'firebase/auth';
6
8
  import firebaseConfig from '~/config/firebase';
@@ -9,6 +11,8 @@ import { getAppVersion } from '~/utils/version';
9
11
  export const app = initializeApp(firebaseConfig, "Striae");
10
12
  export const auth = getAuth(app);
11
13
 
14
+ setPersistence(auth, browserSessionPersistence);
15
+
12
16
  console.log(`Welcome to ${app.name} v${getAppVersion()}`);
13
17
 
14
18
  //Connect to the Firebase Auth emulator if running locally
@@ -0,0 +1,7 @@
1
+ declare global {
2
+ interface Window {
3
+ ExcelJS?: typeof import('exceljs');
4
+ }
5
+ }
6
+
7
+ export {};
package/app/utils/auth.ts CHANGED
@@ -3,7 +3,7 @@ import paths from '~/config/config.json';
3
3
  const KEYS_URL = paths.keys_url;
4
4
  const KEYS_AUTH = paths.keys_auth;
5
5
 
6
- type KeyType = 'USER_DB_AUTH' | 'R2_KEY_SECRET' | 'IMAGES_API_TOKEN' | 'ACCOUNT_HASH';
6
+ type KeyType = 'USER_DB_AUTH' | 'R2_KEY_SECRET' | 'IMAGES_API_TOKEN' | 'ACCOUNT_HASH' | 'PDF_WORKER_AUTH';
7
7
 
8
8
  async function getApiKey(keyType: KeyType): Promise<string> {
9
9
  const keyResponse = await fetch(`${KEYS_URL}/${keyType}`, {
@@ -31,4 +31,8 @@ export async function getImageApiKey(): Promise<string> {
31
31
 
32
32
  export async function getAccountHash(): Promise<string> {
33
33
  return getApiKey('ACCOUNT_HASH');
34
+ }
35
+
36
+ export async function getPdfApiKey(): Promise<string> {
37
+ return getApiKey('PDF_WORKER_AUTH');
34
38
  }
@@ -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,24 @@
1
1
  {
2
2
  "name": "@striae-org/striae",
3
- "version": "3.1.1",
3
+ "version": "3.2.1",
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": "github",
15
+ "url": "https://github.com/sponsors/striae-org"
16
+ },
17
+ {
18
+ "type": "patreon",
19
+ "url": "https://join.striae.org"
20
+ }
21
+ ],
12
22
  "bugs": {
13
23
  "url": "https://github.com/striae-org/striae/issues"
14
24
  },
@@ -16,7 +26,7 @@
16
26
  "forensics",
17
27
  "firearms",
18
28
  "annotation",
19
- "remix",
29
+ "react",
20
30
  "cloudflare-workers",
21
31
  "chain-of-custody",
22
32
  "audit-trail"
@@ -60,15 +70,13 @@
60
70
  "LICENSE",
61
71
  "NOTICE"
62
72
  ],
63
- "sideEffects": [
64
- "**/*.css"
65
- ],
73
+ "sideEffects": false,
66
74
  "type": "module",
67
75
  "scripts": {
68
76
  "deploy:all": "bash ./scripts/deploy-all.sh",
69
77
  "emulators": "firebase emulators:start --only auth",
70
- "dev": "node ./scripts/dev.cjs && remix vite:dev",
71
- "build": "node ./scripts/dev.cjs && remix vite:build",
78
+ "dev": "node ./scripts/dev.cjs && react-router dev",
79
+ "build": "node ./scripts/dev.cjs && react-router build",
72
80
  "clean": "rm -rf build node_modules/.cache .cache",
73
81
  "clean:build": "npm run clean && npm run build",
74
82
  "deploy": "npm run build && wrangler pages deploy",
@@ -80,7 +88,7 @@
80
88
  "publish:all:dry-run": "npm run publish:npm:dry-run && npm run publish:github:dry-run",
81
89
  "lint": "node ./scripts/run-eslint.cjs",
82
90
  "start": "node ./scripts/dev.cjs && wrangler pages dev",
83
- "typecheck": "tsc",
91
+ "typecheck": "react-router typegen && tsc",
84
92
  "typegen": "wrangler types",
85
93
  "preview": "npm run build && wrangler pages dev",
86
94
  "cf-typegen": "wrangler types",
@@ -100,18 +108,18 @@
100
108
  "deploy-workers:user": "cd workers/user-worker && npm run deploy"
101
109
  },
102
110
  "dependencies": {
103
- "@remix-run/cloudflare": "^2.17.4",
104
- "@remix-run/cloudflare-pages": "^2.17.4",
105
- "@remix-run/react": "^2.17.4",
111
+ "@react-router/cloudflare": "^7.13.1",
112
+ "exceljs": "^4.4.0",
106
113
  "firebase": "^12.10.0",
107
114
  "isbot": "^5.1.35",
108
115
  "jszip": "^3.10.1",
109
- "react": "^18.0.0",
110
- "react-dom": "^18.0.0",
111
- "xlsx": "^0.18.5"
116
+ "react": "^19.2.4",
117
+ "react-dom": "^19.2.4",
118
+ "react-router": "^7.13.1"
112
119
  },
113
120
  "devDependencies": {
114
- "@remix-run/dev": "^2.17.4",
121
+ "@react-router/dev": "^7.13.1",
122
+ "@react-router/fs-routes": "^7.13.1",
115
123
  "@types/react": "^19.1.10",
116
124
  "@types/react-dom": "^19.1.7",
117
125
  "@typescript-eslint/eslint-plugin": "^8.54.0",
@@ -128,10 +136,17 @@
128
136
  "typescript": "^5.9.3",
129
137
  "vite": "^6.4.1",
130
138
  "vite-tsconfig-paths": "^6.1.1",
131
- "wrangler": "^3.114.17"
139
+ "wrangler": "^4.73.0"
132
140
  },
133
141
  "overrides": {
134
- "tar": "7.5.11"
142
+ "tar": "7.5.11",
143
+ "undici": "7.24.1",
144
+ "exceljs": {
145
+ "archiver": "7.0.1",
146
+ "fast-csv": "5.0.5",
147
+ "unzipper": "0.12.3",
148
+ "glob": "13.0.6"
149
+ }
135
150
  },
136
151
  "engines": {
137
152
  "node": ">=20.0.0"
@@ -8,6 +8,7 @@
8
8
  "/*.css",
9
9
  "/*.js",
10
10
  "/*.pdf",
11
+ "/*.png",
11
12
  "/*.zip"
12
13
  ]
13
14
  }
Binary file
@@ -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
+