259 Commits

Author SHA1 Message Date
Elian Doran
4203a1160e
Merge pull request #1018 from TriliumNext/fix_server-build
fix: fix server build not running due to missing file
2025-01-22 23:39:09 +02:00
Panagiotis Papadopoulos
8f09b6a192 fix: fix server build not running due to missing file
as discussed in #1010 – quick & dirty fix by copying over the file into the server side of things
Comment added to both files, about deduplication in the future

fixes #1010
2025-01-20 20:15:39 +01:00
Panagiotis Papadopoulos
4be675c4e1 test(import/mime): add additional test case for getMime 2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
4e59f58ce6 refactor(import/mime): simplify getMime 2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
6a0edb68de refactor(import/mime): simplify getType 2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
91ae4b629e refactor(import/mime): simplify normalizeMimeType 2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
815929c376 refactor(import/mime): split CODE_MIME_TYPES Record into two separate objects
CODE_MIME_TYPES -> as a Set -> as we only care about the existance of those types
CODE_MIME_TYPES_OVERRIDE -> as a Map with those keys and the "overwrite" values as associated value

-> this way  we don't have to unnecessarily store additional boolean values for everything *but* those hand ful of mime types

-> also I've sorted the items alphabetically, while I was at it
2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
1405e22f89 test(import/mime): add tests 2025-01-20 08:36:11 +01:00
Panagiotis Papadopoulos
33274ada65 test: port spec tests to vitest 2025-01-17 20:24:20 +01:00
Elian Doran
1807b2b031
chore(types): missing import type for JS imports 2025-01-13 23:18:10 +02:00
Elian Doran
9db9d412d9
feat(import/markdown): preserve language tags when possible 2025-01-11 15:22:36 +02:00
Elian Doran
36387deb0d
chore(test): add test for markdown import 2025-01-10 22:03:08 +02:00
Elian Doran
324696bc54
refactor(ts): enable verbatim module syntax 2025-01-09 18:36:24 +02:00
Elian Doran
4cbb529fd4
chore(prettier): fix all files 2025-01-09 18:07:02 +02:00
Panagiotis Papadopoulos
afb91f82e1 refactor(sanitizeAttributeNames): directly export function
no need to wrap the exported function in an object first
2025-01-02 18:25:09 +01:00
Panagiotis Papadopoulos
7fe23c7ac2 refactor(services): use named imports from utils 2025-01-02 13:47:44 +01:00
Elian Doran
b321d99076
chore(code): fix editorconfig for src/public 2024-12-22 15:42:15 +02:00
Elian Doran
cef464f88b
fix(import/single): h1 not being removed due to downgrade to h2 2024-11-28 19:37:00 +02:00
Elian Doran
6056b55bde
fix(import/single): title extraction not working due to h1 conversion 2024-11-28 19:30:47 +02:00
maphew
47c05b2c6d feat: prefer HTML title tag over filename during import
When importing HTML files, extract and use the title from the <title> tag
if available, falling back to the filename only when no title tag is found.

This improves handling of titles with special characters that can't be
represented in filenames.
2024-11-16 09:06:58 -07:00
Elian Doran
5e80f120c9
server: Refactor variable usage 2024-10-10 20:21:06 +03:00
perf3ct
c37a51c6d0
use type assertions to make TS happy? 2024-10-03 22:48:47 -07:00
perf3ct
91095e8d4e
detectFileTypeAndMime also returns the type, fixes #456 2024-10-03 22:24:43 -07:00
Elian Doran
bc5a1de9b7 server: Fix import when no meta (closes #281) 2024-07-28 23:39:25 +03:00
Elian Doran
89314fac03 server: Report ZIP import errors properly 2024-07-28 23:38:34 +03:00
Elian Doran
24af2e55dc
server: Fix the remainder of import issues 2024-07-24 20:33:35 +03:00
Elian Doran
42f0073ab6
server: Fix various imports 2024-07-24 20:31:26 +03:00
Elian Doran
76fcea7189
server: Fix missing .js import for rows file 2024-07-24 20:20:20 +03:00
Elian Doran
27c296fa6c
server-esm: Fix marked import issue 2024-07-19 00:02:39 +03:00
Elian Doran
f4d19e2bc1
server-esm: Solve some more imports 2024-07-18 22:58:12 +03:00
Elian Doran
0ceae0a65e
server-esm: Change some more export object to export default object 2024-07-18 21:47:30 +03:00
Elian Doran
55eecb0f61
server-esm: Change export object to export default object 2024-07-18 21:42:44 +03:00
Elian Doran
2750df04a3
server-esm: Change simple library import statements 2024-07-18 21:37:45 +03:00
Elian Doran
35d11cc0d2
server-esm: Change simple local import statements 2024-07-18 21:35:17 +03:00
Elian Doran
8fb67c9766
server-esm: Normalize quotes in require imports 2024-07-18 21:28:51 +03:00
Elian Doran
79123b0c63
server: Fix import of non-text files 2024-07-14 15:21:45 +03:00
Elian Doran
606490a611
server: Remove log and fix whitespace 2024-07-13 16:56:13 +03:00
Elian Doran
d99cc11d8b
server: Fix import of notes with type=file 2024-07-13 16:52:31 +03:00
Elian Doran
1b0690ddfc
server: Fix note type import
A regression caused by the port to TypeScript caused all note types to
be treated as a "text" instead of other types such as canvas. The MIME
type, however, was unaffected.
2024-07-13 16:43:33 +03:00
Elian Doran
625d935f08
Merge pull request #44 from TriliumNext/feature/typescript_backend_8
Convert backend to TypeScript (80% -> 81%)
2024-04-16 21:01:20 +03:00
Elian Doran
98d12901a5
Merge pull request #43 from TriliumNext/feature/typescript_backend_7
Convert backend to TypeScript (71% -> 80%)
2024-04-15 21:51:00 +03:00
Elian Doran
4c69384b5d
Merge pull request #41 from TriliumNext/feature/typescript_backend_5
Convert backend to TypeScript (64% -> 67%)
2024-04-15 21:09:37 +03:00
Elian Doran
a66e4435ba
server-ts: Address requested changes 2024-04-13 17:30:48 +03:00
Elian Doran
8297e1a835
Merge branch 'feature/typescript_backend_5' into feature/typescript_backend_8 2024-04-10 19:28:10 +03:00
Elian Doran
b517b18394
Merge branch 'feature/typescript_backend_5' into feature/typescript_backend_7 2024-04-10 19:27:31 +03:00
Elian Doran
fb32ab9707
server-ts: Address requested changes 2024-04-10 19:26:08 +03:00
Elian Doran
34cd2eba91
server-ts: Remove use of (req as any) 2024-04-07 14:29:08 +03:00
Elian Doran
3902719008
server-ts: Convert routes/api/import 2024-04-06 21:30:27 +03:00
Elian Doran
15dee4b952
server-ts: Convert services/backend_script_api 2024-04-04 22:04:30 +03:00
Elian Doran
53d4873c1f
server-ts: Port services/import/zip 2024-04-03 22:46:14 +03:00