openrxiv-utils 0.0.0 → 0.0.3
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.
- package/.turbo/turbo-build.log +4 -0
- package/.turbo/turbo-test.log +17 -0
- package/CHANGELOG.md +20 -0
- package/dist/biorxiv-parser.d.ts +5 -0
- package/dist/biorxiv-parser.d.ts.map +1 -1
- package/dist/biorxiv-parser.js +12 -7
- package/dist/biorxiv-parser.js.map +1 -1
- package/dist/biorxiv-parser.spec.js +25 -0
- package/dist/biorxiv-parser.spec.js.map +1 -1
- package/package.json +4 -4
- package/src/biorxiv-parser.spec.ts +27 -0
- package/src/biorxiv-parser.ts +15 -7
- package/dist/content-structure.d.ts +0 -38
- package/dist/content-structure.d.ts.map +0 -1
- package/dist/content-structure.js +0 -199
- package/dist/content-structure.js.map +0 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
|
|
2
|
+
> openrxiv-utils@0.0.3 test
|
|
3
|
+
> vitest run
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
[1m[46m RUN [49m[22m [36mv4.0.18 [39m[90m/home/runner/work/openrxiv/openrxiv/packages/utils[39m
|
|
7
|
+
|
|
8
|
+
[32m✓[39m dist/biorxiv-parser.spec.js [2m([22m[2m67 tests[22m[2m)[22m[32m 60[2mms[22m[39m
|
|
9
|
+
[32m✓[39m src/folder-structure.test.ts [2m([22m[2m162 tests[22m[2m)[22m[32m 99[2mms[22m[39m
|
|
10
|
+
[32m✓[39m dist/folder-structure.test.js [2m([22m[2m162 tests[22m[2m)[22m[32m 78[2mms[22m[39m
|
|
11
|
+
[32m✓[39m src/biorxiv-parser.spec.ts [2m([22m[2m67 tests[22m[2m)[22m[32m 41[2mms[22m[39m
|
|
12
|
+
|
|
13
|
+
[2m Test Files [22m [1m[32m4 passed[39m[22m[90m (4)[39m
|
|
14
|
+
[2m Tests [22m [1m[32m458 passed[39m[22m[90m (458)[39m
|
|
15
|
+
[2m Start at [22m 21:43:38
|
|
16
|
+
[2m Duration [22m 1.46s[2m (transform 826ms, setup 0ms, import 1.30s, tests 278ms, environment 1ms)[22m
|
|
17
|
+
|
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
# openrxiv-utils
|
|
2
|
+
|
|
3
|
+
## 0.0.3
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 0bda5e5: Update to new DOI prefix
|
|
8
|
+
- 0bda5e5: Update libraries and prisma
|
|
9
|
+
|
|
10
|
+
## 0.0.2
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- e1f69e1: Fix the hompage in npm
|
|
15
|
+
|
|
16
|
+
## 0.0.1
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- cdcc345: Initial release of CLI, API and utilities
|
package/dist/biorxiv-parser.d.ts
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility functions for parsing bioRxiv URLs and DOIs
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* bioRxiv DOI prefixes - both legacy (10.1101) and new (10.64898, Dec 2025+)
|
|
6
|
+
*/
|
|
7
|
+
export declare const BIORXIV_DOI_PREFIXES: readonly ["10.1101", "10.64898"];
|
|
8
|
+
export declare const BIORXIV_DOI_PREFIX_PATTERN = "(10\\.1101|10\\.64898)";
|
|
4
9
|
export interface ParsedBiorxivURL {
|
|
5
10
|
doi: string;
|
|
6
11
|
baseDOI: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-parser.d.ts","sourceRoot":"","sources":["../src/biorxiv-parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,GAAG,EAAE,MAAM,CAAC;IACZ,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;IACv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AAE,MAAM,GAAG,QAAQ,GAAG,IAAI,CAwCrD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED;;;GAGG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAGzD;AAED;;;GAGG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAEtD;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAGtD;AAED;;GAEG;AACH,wBAAgB,eAAe,CAAC,GAAG,EAAE,MAAM,GAAG,gBAAgB,GAAG,IAAI,CAiBpE"}
|
package/dist/biorxiv-parser.js
CHANGED
|
@@ -1,6 +1,11 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Utility functions for parsing bioRxiv URLs and DOIs
|
|
3
3
|
*/
|
|
4
|
+
/**
|
|
5
|
+
* bioRxiv DOI prefixes - both legacy (10.1101) and new (10.64898, Dec 2025+)
|
|
6
|
+
*/
|
|
7
|
+
export const BIORXIV_DOI_PREFIXES = ['10.1101', '10.64898'];
|
|
8
|
+
export const BIORXIV_DOI_PREFIX_PATTERN = '(10\\.1101|10\\.64898)';
|
|
4
9
|
/**
|
|
5
10
|
* Extract DOI from a bioRxiv URL
|
|
6
11
|
*/
|
|
@@ -28,8 +33,8 @@ export function extractDOIFromURL(url) {
|
|
|
28
33
|
doi = match[1];
|
|
29
34
|
}
|
|
30
35
|
}
|
|
31
|
-
// Check for direct DOI input
|
|
32
|
-
else if (url.startsWith('10.1101/')) {
|
|
36
|
+
// Check for direct DOI input (both 10.1101 and 10.64898 prefixes)
|
|
37
|
+
else if (url.startsWith('10.1101/') || url.startsWith('10.64898/')) {
|
|
33
38
|
doi = url;
|
|
34
39
|
}
|
|
35
40
|
if (doi) {
|
|
@@ -43,12 +48,12 @@ export function extractDOIFromURL(url) {
|
|
|
43
48
|
* Supports both legacy numeric format (2019 and earlier) and current date-based format (2019+)
|
|
44
49
|
*/
|
|
45
50
|
export function parseDOI(doi) {
|
|
46
|
-
// Handle current date-based format (2019+):
|
|
47
|
-
const currentPattern =
|
|
51
|
+
// Handle current date-based format (2019+): {prefix}/YYYY.MM.DD.XXXXXXvN
|
|
52
|
+
const currentPattern = new RegExp(`^${BIORXIV_DOI_PREFIX_PATTERN}/(\\d{4})\\.(\\d{2})\\.(\\d{2})\\.(\\d{6,8})(v\\d+)?$`);
|
|
48
53
|
const currentMatch = doi.match(currentPattern);
|
|
49
54
|
if (currentMatch) {
|
|
50
55
|
const [prefix, suffix] = doi.split('/');
|
|
51
|
-
const [, year, month, day, identifier, version] = currentMatch;
|
|
56
|
+
const [, , year, month, day, identifier, version] = currentMatch;
|
|
52
57
|
const date = `${year}-${month}-${day}`;
|
|
53
58
|
return {
|
|
54
59
|
doi,
|
|
@@ -59,8 +64,8 @@ export function parseDOI(doi) {
|
|
|
59
64
|
version: version || null,
|
|
60
65
|
};
|
|
61
66
|
}
|
|
62
|
-
// Handle legacy numeric format (2019 and earlier): 10.1101
|
|
63
|
-
const legacyPattern =
|
|
67
|
+
// Handle legacy numeric format (2019 and earlier): {prefix}/XXXXXX (10.1101 only; 10.64898 uses date format)
|
|
68
|
+
const legacyPattern = new RegExp(`^${BIORXIV_DOI_PREFIX_PATTERN}/(\\d{6,8})(v\\d+)?$`);
|
|
64
69
|
const legacyMatch = doi.match(legacyPattern);
|
|
65
70
|
if (legacyMatch) {
|
|
66
71
|
const [prefix, suffix] = doi.split('/');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-parser.js","sourceRoot":"","sources":["../src/biorxiv-parser.ts"],"names":[],"mappings":"AAAA;;GAEG;
|
|
1
|
+
{"version":3,"file":"biorxiv-parser.js","sourceRoot":"","sources":["../src/biorxiv-parser.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,oBAAo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IAAI;KACd,CAAC;AACJ,CAAC"}
|
|
@@ -33,6 +33,12 @@ describe('BioRxiv URL Parser', () => {
|
|
|
33
33
|
],
|
|
34
34
|
['https://doi.org/10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295v3'],
|
|
35
35
|
['10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295v3'],
|
|
36
|
+
// New prefix 10.64898 (Dec 2025+)
|
|
37
|
+
['10.64898/2025.12.15.123456v1', '10.64898/2025.12.15.123456v1'],
|
|
38
|
+
[
|
|
39
|
+
'https://www.biorxiv.org/content/10.64898/2025.12.01.999999v2',
|
|
40
|
+
'10.64898/2025.12.01.999999v2',
|
|
41
|
+
],
|
|
36
42
|
])('should extract DOI from standard content URL', (url, expected) => {
|
|
37
43
|
const result = extractDOIFromURL(url);
|
|
38
44
|
expect(result).toBe(expected);
|
|
@@ -85,6 +91,18 @@ describe('BioRxiv URL Parser', () => {
|
|
|
85
91
|
version: 'v1',
|
|
86
92
|
});
|
|
87
93
|
});
|
|
94
|
+
it('should parse DOI with new 10.64898 prefix (Dec 2025+)', () => {
|
|
95
|
+
const doi = '10.64898/2025.12.15.123456v1';
|
|
96
|
+
const result = parseDOI(doi);
|
|
97
|
+
expect(result).toEqual({
|
|
98
|
+
doi: '10.64898/2025.12.15.123456v1',
|
|
99
|
+
prefix: '10.64898',
|
|
100
|
+
date: '2025-12-15',
|
|
101
|
+
identifier: '123456',
|
|
102
|
+
suffix: '2025.12.15.123456',
|
|
103
|
+
version: 'v1',
|
|
104
|
+
});
|
|
105
|
+
});
|
|
88
106
|
it('should return null for invalid DOI format', () => {
|
|
89
107
|
const invalidDOIs = [
|
|
90
108
|
'10.1000/123.456.789',
|
|
@@ -108,6 +126,7 @@ describe('BioRxiv URL Parser', () => {
|
|
|
108
126
|
['10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295'], // Remove version
|
|
109
127
|
['10.1101/2024.01.25.577295v12', '10.1101/2024.01.25.577295'], // Remove double digit version
|
|
110
128
|
['10.1101/2020.03.19.20039131v2', '10.1101/2020.03.19.20039131'], // medrxiv variant
|
|
129
|
+
['10.64898/2025.12.15.123456v1', '10.64898/2025.12.15.123456'],
|
|
111
130
|
])('should extract base DOI from versioned DOI', (doi, expected) => {
|
|
112
131
|
const result = extractBaseDOI(doi);
|
|
113
132
|
expect(result).toBe(expected);
|
|
@@ -134,6 +153,10 @@ describe('BioRxiv URL Parser', () => {
|
|
|
134
153
|
['10.1101/789012v12', true],
|
|
135
154
|
['10.1101/789012v3', true],
|
|
136
155
|
['10.1101/2020.03.19.20039131v2', true],
|
|
156
|
+
['10.64898/2025.12.15.123456', true],
|
|
157
|
+
['10.64898/2025.12.01.999999v1', true],
|
|
158
|
+
['10.64898/789012', true],
|
|
159
|
+
['10.64898/789012v3', true],
|
|
137
160
|
['10.1101/2024.1.25.577295', false],
|
|
138
161
|
['10.1101/2024.01.25.57729', false],
|
|
139
162
|
['invalid-doi', false],
|
|
@@ -153,6 +176,8 @@ describe('BioRxiv URL Parser', () => {
|
|
|
153
176
|
['10.1101/2024.01.25.577295v3', true],
|
|
154
177
|
['https://www.biorxiv.org/content/10.1101/486050v2.article-info', true],
|
|
155
178
|
['https://www.biorxiv.org/content/10.1101/486050', true],
|
|
179
|
+
['10.64898/2025.12.15.123456v1', true],
|
|
180
|
+
['https://www.biorxiv.org/content/10.64898/2025.12.01.999999v2', true],
|
|
156
181
|
// Invalid
|
|
157
182
|
['https://example.com/not-biorxiv', false],
|
|
158
183
|
['https://biorxiv.org/invalid-path', false],
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"biorxiv-parser.spec.js","sourceRoot":"","sources":["../src/biorxiv-parser.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,IAAI,CAAC;YACN;gBACE,6DAA6D;gBAC7D,6BAA6B;aAC9B;YACD;gBACE,+DAA+D;gBAC/D,+BAA+B;aAChC;YACD;gBACE,0EAA0E;gBAC1E,6BAA6B;aAC9B;YACD;gBACE,kEAAkE;gBAClE,6BAA6B;aAC9B;YACD;gBACE,sEAAsE;gBACtE,6BAA6B;aAC9B;YACD;gBACE,iEAAiE;gBACjE,6BAA6B;aAC9B;YACD;gBACE,mEAAmE;gBACnE,6BAA6B;aAC9B;YACD,CAAC,6CAA6C,EAAE,6BAA6B,CAAC;YAC9E,CAAC,6BAA6B,EAAE,6BAA6B,CAAC;
|
|
1
|
+
{"version":3,"file":"biorxiv-parser.spec.js","sourceRoot":"","sources":["../src/biorxiv-parser.spec.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAC;AAC9C,OAAO,EACL,iBAAiB,EACjB,QAAQ,EACR,cAAc,EACd,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,eAAe,GAChB,MAAM,qBAAqB,CAAC;AAE7B,QAAQ,CAAC,oBAAoB,EAAE,GAAG,EAAE;IAClC,QAAQ,CAAC,mBAAmB,EAAE,GAAG,EAAE;QACjC,EAAE,CAAC,IAAI,CAAC;YACN;gBACE,6DAA6D;gBAC7D,6BAA6B;aAC9B;YACD;gBACE,+DAA+D;gBAC/D,+BAA+B;aAChC;YACD;gBACE,0EAA0E;gBAC1E,6BAA6B;aAC9B;YACD;gBACE,kEAAkE;gBAClE,6BAA6B;aAC9B;YACD;gBACE,sEAAsE;gBACtE,6BAA6B;aAC9B;YACD;gBACE,iEAAiE;gBACjE,6BAA6B;aAC9B;YACD;gBACE,mEAAmE;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AC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;QAC5C,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,0CAA0C,EAAE,GAAG,EAAE;YAClD,MAAM,GAAG,GAAG,wEAAwE,CAAC;YACrF,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;QAEH,EAAE,CAAC,mCAAmC,EAAE,GAAG,EAAE;YAC3C,MAAM,GAAG,GAAG,qEAAqE,CAAC;YAClF,MAAM,MAAM,GAAG,iBAAiB,CAAC,GAAG,CAAC,CAAC;YACtC,MAAM,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,6BAA6B,CAAC,CAAC;QACrD,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openrxiv-utils",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.3",
|
|
4
4
|
"description": "Utility functions for bioRxiv operations including URL parsing and DOI handling",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -33,10 +33,10 @@
|
|
|
33
33
|
"devDependencies": {},
|
|
34
34
|
"repository": {
|
|
35
35
|
"type": "git",
|
|
36
|
-
"url": "https://github.com/
|
|
36
|
+
"url": "https://github.com/continuous-foundation/openrxiv.git"
|
|
37
37
|
},
|
|
38
38
|
"bugs": {
|
|
39
|
-
"url": "https://github.com/
|
|
39
|
+
"url": "https://github.com/continuous-foundation/openrxiv/issues"
|
|
40
40
|
},
|
|
41
|
-
"homepage": "https://github.com/
|
|
41
|
+
"homepage": "https://github.com/continuous-foundation/openrxiv#readme"
|
|
42
42
|
}
|
|
@@ -42,6 +42,12 @@ describe('BioRxiv URL Parser', () => {
|
|
|
42
42
|
],
|
|
43
43
|
['https://doi.org/10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295v3'],
|
|
44
44
|
['10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295v3'],
|
|
45
|
+
// New prefix 10.64898 (Dec 2025+)
|
|
46
|
+
['10.64898/2025.12.15.123456v1', '10.64898/2025.12.15.123456v1'],
|
|
47
|
+
[
|
|
48
|
+
'https://www.biorxiv.org/content/10.64898/2025.12.01.999999v2',
|
|
49
|
+
'10.64898/2025.12.01.999999v2',
|
|
50
|
+
],
|
|
45
51
|
])('should extract DOI from standard content URL', (url, expected) => {
|
|
46
52
|
const result = extractDOIFromURL(url);
|
|
47
53
|
expect(result).toBe(expected);
|
|
@@ -102,6 +108,20 @@ describe('BioRxiv URL Parser', () => {
|
|
|
102
108
|
});
|
|
103
109
|
});
|
|
104
110
|
|
|
111
|
+
it('should parse DOI with new 10.64898 prefix (Dec 2025+)', () => {
|
|
112
|
+
const doi = '10.64898/2025.12.15.123456v1';
|
|
113
|
+
const result = parseDOI(doi);
|
|
114
|
+
|
|
115
|
+
expect(result).toEqual({
|
|
116
|
+
doi: '10.64898/2025.12.15.123456v1',
|
|
117
|
+
prefix: '10.64898',
|
|
118
|
+
date: '2025-12-15',
|
|
119
|
+
identifier: '123456',
|
|
120
|
+
suffix: '2025.12.15.123456',
|
|
121
|
+
version: 'v1',
|
|
122
|
+
});
|
|
123
|
+
});
|
|
124
|
+
|
|
105
125
|
it('should return null for invalid DOI format', () => {
|
|
106
126
|
const invalidDOIs = [
|
|
107
127
|
'10.1000/123.456.789',
|
|
@@ -127,6 +147,7 @@ describe('BioRxiv URL Parser', () => {
|
|
|
127
147
|
['10.1101/2024.01.25.577295v3', '10.1101/2024.01.25.577295'], // Remove version
|
|
128
148
|
['10.1101/2024.01.25.577295v12', '10.1101/2024.01.25.577295'], // Remove double digit version
|
|
129
149
|
['10.1101/2020.03.19.20039131v2', '10.1101/2020.03.19.20039131'], // medrxiv variant
|
|
150
|
+
['10.64898/2025.12.15.123456v1', '10.64898/2025.12.15.123456'],
|
|
130
151
|
])('should extract base DOI from versioned DOI', (doi, expected) => {
|
|
131
152
|
const result = extractBaseDOI(doi);
|
|
132
153
|
expect(result).toBe(expected);
|
|
@@ -155,6 +176,10 @@ describe('BioRxiv URL Parser', () => {
|
|
|
155
176
|
['10.1101/789012v12', true],
|
|
156
177
|
['10.1101/789012v3', true],
|
|
157
178
|
['10.1101/2020.03.19.20039131v2', true],
|
|
179
|
+
['10.64898/2025.12.15.123456', true],
|
|
180
|
+
['10.64898/2025.12.01.999999v1', true],
|
|
181
|
+
['10.64898/789012', true],
|
|
182
|
+
['10.64898/789012v3', true],
|
|
158
183
|
['10.1101/2024.1.25.577295', false],
|
|
159
184
|
['10.1101/2024.01.25.57729', false],
|
|
160
185
|
['invalid-doi', false],
|
|
@@ -175,6 +200,8 @@ describe('BioRxiv URL Parser', () => {
|
|
|
175
200
|
['10.1101/2024.01.25.577295v3', true],
|
|
176
201
|
['https://www.biorxiv.org/content/10.1101/486050v2.article-info', true],
|
|
177
202
|
['https://www.biorxiv.org/content/10.1101/486050', true],
|
|
203
|
+
['10.64898/2025.12.15.123456v1', true],
|
|
204
|
+
['https://www.biorxiv.org/content/10.64898/2025.12.01.999999v2', true],
|
|
178
205
|
// Invalid
|
|
179
206
|
['https://example.com/not-biorxiv', false],
|
|
180
207
|
['https://biorxiv.org/invalid-path', false],
|
package/src/biorxiv-parser.ts
CHANGED
|
@@ -2,6 +2,12 @@
|
|
|
2
2
|
* Utility functions for parsing bioRxiv URLs and DOIs
|
|
3
3
|
*/
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* bioRxiv DOI prefixes - both legacy (10.1101) and new (10.64898, Dec 2025+)
|
|
7
|
+
*/
|
|
8
|
+
export const BIORXIV_DOI_PREFIXES = ['10.1101', '10.64898'] as const;
|
|
9
|
+
export const BIORXIV_DOI_PREFIX_PATTERN = '(10\\.1101|10\\.64898)';
|
|
10
|
+
|
|
5
11
|
export interface ParsedBiorxivURL {
|
|
6
12
|
doi: string;
|
|
7
13
|
baseDOI: string;
|
|
@@ -47,8 +53,8 @@ export function extractDOIFromURL(url: string): string | null {
|
|
|
47
53
|
doi = match[1];
|
|
48
54
|
}
|
|
49
55
|
}
|
|
50
|
-
// Check for direct DOI input
|
|
51
|
-
else if (url.startsWith('10.1101/')) {
|
|
56
|
+
// Check for direct DOI input (both 10.1101 and 10.64898 prefixes)
|
|
57
|
+
else if (url.startsWith('10.1101/') || url.startsWith('10.64898/')) {
|
|
52
58
|
doi = url;
|
|
53
59
|
}
|
|
54
60
|
|
|
@@ -65,13 +71,15 @@ export function extractDOIFromURL(url: string): string | null {
|
|
|
65
71
|
* Supports both legacy numeric format (2019 and earlier) and current date-based format (2019+)
|
|
66
72
|
*/
|
|
67
73
|
export function parseDOI(doi: string): DOIParts | null {
|
|
68
|
-
// Handle current date-based format (2019+):
|
|
69
|
-
const currentPattern =
|
|
74
|
+
// Handle current date-based format (2019+): {prefix}/YYYY.MM.DD.XXXXXXvN
|
|
75
|
+
const currentPattern = new RegExp(
|
|
76
|
+
`^${BIORXIV_DOI_PREFIX_PATTERN}/(\\d{4})\\.(\\d{2})\\.(\\d{2})\\.(\\d{6,8})(v\\d+)?$`,
|
|
77
|
+
);
|
|
70
78
|
const currentMatch = doi.match(currentPattern);
|
|
71
79
|
|
|
72
80
|
if (currentMatch) {
|
|
73
81
|
const [prefix, suffix] = doi.split('/');
|
|
74
|
-
const [, year, month, day, identifier, version] = currentMatch;
|
|
82
|
+
const [, , year, month, day, identifier, version] = currentMatch;
|
|
75
83
|
const date = `${year}-${month}-${day}`;
|
|
76
84
|
|
|
77
85
|
return {
|
|
@@ -84,8 +92,8 @@ export function parseDOI(doi: string): DOIParts | null {
|
|
|
84
92
|
};
|
|
85
93
|
}
|
|
86
94
|
|
|
87
|
-
// Handle legacy numeric format (2019 and earlier): 10.1101
|
|
88
|
-
const legacyPattern =
|
|
95
|
+
// Handle legacy numeric format (2019 and earlier): {prefix}/XXXXXX (10.1101 only; 10.64898 uses date format)
|
|
96
|
+
const legacyPattern = new RegExp(`^${BIORXIV_DOI_PREFIX_PATTERN}/(\\d{6,8})(v\\d+)?$`);
|
|
89
97
|
const legacyMatch = doi.match(legacyPattern);
|
|
90
98
|
|
|
91
99
|
if (legacyMatch) {
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for determining bioRxiv content structure
|
|
3
|
-
* based on the date requested.
|
|
4
|
-
*
|
|
5
|
-
* The bioRxiv structure is:
|
|
6
|
-
* - Before late 2018: Files are in Back_Content/Batch_[nn]/ folders
|
|
7
|
-
* - After late 2018: Files are in Current_Content/[Month]_[Year]/ folders
|
|
8
|
-
*/
|
|
9
|
-
export interface ContentStructure {
|
|
10
|
-
server: 'biorxiv' | 'medrxiv';
|
|
11
|
-
type: 'current' | 'back';
|
|
12
|
-
prefix: string;
|
|
13
|
-
batch: string;
|
|
14
|
-
}
|
|
15
|
-
export interface ContentStructureOptions {
|
|
16
|
-
server?: 'biorxiv' | 'medrxiv';
|
|
17
|
-
month?: string;
|
|
18
|
-
batch?: string;
|
|
19
|
-
}
|
|
20
|
-
/**
|
|
21
|
-
* Normalizes batch input to the standard "Batch_XX" format
|
|
22
|
-
* @param batch - Batch input in various formats (e.g., "1", "batch-1", "Batch_01", "batch_01")
|
|
23
|
-
* @param server - Server type to determine batch format (e.g., "biorxiv", "medrxiv")
|
|
24
|
-
* @returns Normalized batch string in appropriate format
|
|
25
|
-
*/
|
|
26
|
-
export declare function normalizeBatch(batch: string | number, server?: string): string;
|
|
27
|
-
/**
|
|
28
|
-
* Determines the content structure for a given month or batch
|
|
29
|
-
* @param options - Options containing month or batch
|
|
30
|
-
* @returns ContentStructure with the appropriate prefix and type
|
|
31
|
-
*/
|
|
32
|
-
export declare function getContentStructure(options: ContentStructureOptions): ContentStructure;
|
|
33
|
-
export declare function removeDuplicateFolders(folders: ContentStructure[]): ContentStructure[];
|
|
34
|
-
/**
|
|
35
|
-
* Sort folders chronologically, putting batches before months
|
|
36
|
-
*/
|
|
37
|
-
export declare function sortFoldersChronologically(folders: ContentStructure[]): ContentStructure[];
|
|
38
|
-
//# sourceMappingURL=content-structure.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-structure.d.ts","sourceRoot":"","sources":["../src/content-structure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,MAAM,WAAW,gBAAgB;IAC/B,MAAM,EAAE,SAAS,GAAG,SAAS,CAAC;IAC9B,IAAI,EAAE,SAAS,GAAG,MAAM,CAAC;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,uBAAuB;IACtC,MAAM,CAAC,EAAE,SAAS,GAAG,SAAS,CAAC;IAC/B,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;;;;GAKG;AACH,wBAAgB,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,MAAM,GAAE,MAAkB,GAAG,MAAM,CA+BzF;AAED;;;;GAIG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,uBAAuB,GAAG,gBAAgB,CAuDtF;AAuFD,wBAAgB,sBAAsB,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAYtF;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,OAAO,EAAE,gBAAgB,EAAE,GAAG,gBAAgB,EAAE,CAsB1F"}
|
|
@@ -1,199 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Utility functions for determining bioRxiv content structure
|
|
3
|
-
* based on the date requested.
|
|
4
|
-
*
|
|
5
|
-
* The bioRxiv structure is:
|
|
6
|
-
* - Before late 2018: Files are in Back_Content/Batch_[nn]/ folders
|
|
7
|
-
* - After late 2018: Files are in Current_Content/[Month]_[Year]/ folders
|
|
8
|
-
*/
|
|
9
|
-
/**
|
|
10
|
-
* Normalizes batch input to the standard "Batch_XX" format
|
|
11
|
-
* @param batch - Batch input in various formats (e.g., "1", "batch-1", "Batch_01", "batch_01")
|
|
12
|
-
* @param server - Server type to determine batch format (e.g., "biorxiv", "medrxiv")
|
|
13
|
-
* @returns Normalized batch string in appropriate format
|
|
14
|
-
*/
|
|
15
|
-
export function normalizeBatch(batch, server = 'biorxiv') {
|
|
16
|
-
if (typeof batch === 'number') {
|
|
17
|
-
if (batch < 1) {
|
|
18
|
-
throw new Error(`Invalid batch format: ${batch}. Expected a positive number or batch identifier.`);
|
|
19
|
-
}
|
|
20
|
-
const batchNum = batch.toString().padStart(2, '0');
|
|
21
|
-
return server.toLowerCase() === 'medrxiv' ? `medRxiv_Batch_${batchNum}` : `Batch_${batchNum}`;
|
|
22
|
-
}
|
|
23
|
-
// Remove common prefixes and normalize
|
|
24
|
-
const normalized = batch
|
|
25
|
-
.toLowerCase()
|
|
26
|
-
.replace(/^batch[-_]?/i, '') // Remove "batch", "batch-", "batch_"
|
|
27
|
-
.replace(/^medrxiv[-_]?batch[-_]?/i, '') // Remove "medrxiv_batch", "medrxiv-batch", etc.
|
|
28
|
-
.replace(/^0+/, '') // Remove leading zeros
|
|
29
|
-
.trim();
|
|
30
|
-
// Parse the number and format it
|
|
31
|
-
const batchNum = parseInt(normalized, 10);
|
|
32
|
-
if (isNaN(batchNum) || batchNum < 1) {
|
|
33
|
-
throw new Error(`Invalid batch format: ${batch}. Expected a positive number or batch identifier.`);
|
|
34
|
-
}
|
|
35
|
-
const formattedBatchNum = batchNum.toString().padStart(2, '0');
|
|
36
|
-
return server.toLowerCase() === 'medrxiv'
|
|
37
|
-
? `medRxiv_Batch_${formattedBatchNum}`
|
|
38
|
-
: `Batch_${formattedBatchNum}`;
|
|
39
|
-
}
|
|
40
|
-
/**
|
|
41
|
-
* Determines the content structure for a given month or batch
|
|
42
|
-
* @param options - Options containing month or batch
|
|
43
|
-
* @returns ContentStructure with the appropriate prefix and type
|
|
44
|
-
*/
|
|
45
|
-
export function getContentStructure(options) {
|
|
46
|
-
if (options.month && options.batch) {
|
|
47
|
-
throw new Error('Either month or batch must be specified, not both');
|
|
48
|
-
}
|
|
49
|
-
if (!options.month && !options.batch) {
|
|
50
|
-
throw new Error('Either month or batch must be specified');
|
|
51
|
-
}
|
|
52
|
-
if (options.batch) {
|
|
53
|
-
// If batch is specified, use Back_Content structure
|
|
54
|
-
const normalizedBatch = normalizeBatch(options.batch, options.server);
|
|
55
|
-
return {
|
|
56
|
-
server: options.server || 'biorxiv',
|
|
57
|
-
type: 'back',
|
|
58
|
-
prefix: `Back_Content/${normalizedBatch}/`,
|
|
59
|
-
batch: normalizedBatch,
|
|
60
|
-
};
|
|
61
|
-
}
|
|
62
|
-
if (options.month) {
|
|
63
|
-
// Normalize month format to YYYY-MM
|
|
64
|
-
const normalizedMonth = normalizeMonthToYYYYMM(options.month);
|
|
65
|
-
if (!normalizedMonth) {
|
|
66
|
-
throw new Error(`Invalid month format: ${options.month}. Expected YYYY-MM or Month_YYYY format.`);
|
|
67
|
-
}
|
|
68
|
-
const [year, monthNum] = normalizedMonth.split('-').map(Number);
|
|
69
|
-
// bioRxiv switched from Back_Content to Current_Content in late 2018
|
|
70
|
-
// We'll use December 2018 as the cutoff point to be safe
|
|
71
|
-
const cutoffDate = new Date(2018, 11, 1); // December 1, 2018 (0-indexed month)
|
|
72
|
-
const requestedDate = new Date(year, monthNum - 1, 1);
|
|
73
|
-
if (requestedDate < cutoffDate) {
|
|
74
|
-
// Use Back_Content structure - but we don't know which batch
|
|
75
|
-
// User should specify batch explicitly for pre-2019 content
|
|
76
|
-
throw new Error(`Date ${options.month} is in the Back_Content period. Please specify a batch using --batch option. ` +
|
|
77
|
-
`Available batches can be listed with 'biorxiv list' command.`);
|
|
78
|
-
}
|
|
79
|
-
else {
|
|
80
|
-
// Use Current_Content structure
|
|
81
|
-
const monthName = getMonthName(monthNum);
|
|
82
|
-
return {
|
|
83
|
-
server: options.server || 'biorxiv',
|
|
84
|
-
type: 'current',
|
|
85
|
-
prefix: `Current_Content/${monthName}_${year}/`,
|
|
86
|
-
batch: `${monthName}_${year}`,
|
|
87
|
-
};
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
throw new Error('Invalid content structure options');
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* Normalizes various month formats to YYYY-MM
|
|
94
|
-
* @param month - Month in various formats
|
|
95
|
-
* @returns Normalized YYYY-MM format or null if invalid
|
|
96
|
-
*/
|
|
97
|
-
function normalizeMonthToYYYYMM(month) {
|
|
98
|
-
// Already in YYYY-MM format
|
|
99
|
-
if (month.match(/^\d{4}-\d{2}$/)) {
|
|
100
|
-
const [, monthNum] = month.split('-').map(Number);
|
|
101
|
-
if (monthNum < 1 || monthNum > 12) {
|
|
102
|
-
return null; // Invalid month number
|
|
103
|
-
}
|
|
104
|
-
return month;
|
|
105
|
-
}
|
|
106
|
-
// Month_YYYY format (e.g., "November_2018")
|
|
107
|
-
const monthYearMatch = month.match(/^([A-Za-z]+)_(\d{4})$/);
|
|
108
|
-
if (monthYearMatch) {
|
|
109
|
-
const monthName = monthYearMatch[1];
|
|
110
|
-
const year = monthYearMatch[2];
|
|
111
|
-
const monthNum = getMonthNumber(monthName);
|
|
112
|
-
if (monthNum !== null) {
|
|
113
|
-
return `${year}-${monthNum.toString().padStart(2, '0')}`;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
/**
|
|
119
|
-
* Gets month number from month name
|
|
120
|
-
* @param monthName - Month name (case insensitive)
|
|
121
|
-
* @returns Month number (1-12) or null if invalid
|
|
122
|
-
*/
|
|
123
|
-
function getMonthNumber(monthName) {
|
|
124
|
-
const monthNames = [
|
|
125
|
-
'january',
|
|
126
|
-
'february',
|
|
127
|
-
'march',
|
|
128
|
-
'april',
|
|
129
|
-
'may',
|
|
130
|
-
'june',
|
|
131
|
-
'july',
|
|
132
|
-
'august',
|
|
133
|
-
'september',
|
|
134
|
-
'october',
|
|
135
|
-
'november',
|
|
136
|
-
'december',
|
|
137
|
-
];
|
|
138
|
-
const normalizedName = monthName.toLowerCase();
|
|
139
|
-
const monthIndex = monthNames.indexOf(normalizedName);
|
|
140
|
-
return monthIndex !== -1 ? monthIndex + 1 : null;
|
|
141
|
-
}
|
|
142
|
-
/**
|
|
143
|
-
* Gets month name from month number
|
|
144
|
-
* @param monthNum - Month number (1-12)
|
|
145
|
-
* @returns Month name (e.g., "January")
|
|
146
|
-
*/
|
|
147
|
-
function getMonthName(monthNum) {
|
|
148
|
-
const monthNames = [
|
|
149
|
-
'January',
|
|
150
|
-
'February',
|
|
151
|
-
'March',
|
|
152
|
-
'April',
|
|
153
|
-
'May',
|
|
154
|
-
'June',
|
|
155
|
-
'July',
|
|
156
|
-
'August',
|
|
157
|
-
'September',
|
|
158
|
-
'October',
|
|
159
|
-
'November',
|
|
160
|
-
'December',
|
|
161
|
-
];
|
|
162
|
-
if (monthNum < 1 || monthNum > 12) {
|
|
163
|
-
throw new Error(`Invalid month number: ${monthNum}. Must be 1-12.`);
|
|
164
|
-
}
|
|
165
|
-
return monthNames[monthNum - 1];
|
|
166
|
-
}
|
|
167
|
-
export function removeDuplicateFolders(folders) {
|
|
168
|
-
return folders.filter((folder, index, self) => index ===
|
|
169
|
-
self.findIndex((t) => t.prefix === folder.prefix &&
|
|
170
|
-
t.server === folder.server &&
|
|
171
|
-
t.type === folder.type &&
|
|
172
|
-
t.batch === folder.batch));
|
|
173
|
-
}
|
|
174
|
-
/**
|
|
175
|
-
* Sort folders chronologically, putting batches before months
|
|
176
|
-
*/
|
|
177
|
-
export function sortFoldersChronologically(folders) {
|
|
178
|
-
return folders.sort((a, b) => {
|
|
179
|
-
// Put batches before months
|
|
180
|
-
if (a.type === 'back' && b.type === 'current')
|
|
181
|
-
return -1;
|
|
182
|
-
if (a.type === 'current' && b.type === 'back')
|
|
183
|
-
return 1;
|
|
184
|
-
// For batches, sort by batch number
|
|
185
|
-
if (a.type === 'back' && b.type === 'back') {
|
|
186
|
-
const aNum = parseInt(a.batch.replace(/\D/g, ''));
|
|
187
|
-
const bNum = parseInt(b.batch.replace(/\D/g, ''));
|
|
188
|
-
return aNum - bNum;
|
|
189
|
-
}
|
|
190
|
-
// For months, sort chronologically (newest first)
|
|
191
|
-
if (a.type === 'current' && b.type === 'current') {
|
|
192
|
-
const aDate = new Date(a.batch);
|
|
193
|
-
const bDate = new Date(b.batch);
|
|
194
|
-
return aDate.getTime() - bDate.getTime();
|
|
195
|
-
}
|
|
196
|
-
return 0;
|
|
197
|
-
});
|
|
198
|
-
}
|
|
199
|
-
//# sourceMappingURL=content-structure.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"content-structure.js","sourceRoot":"","sources":["../src/content-structure.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAeH;;;;;GAKG;AACH,MAAM,UAAU,cAAc,CAAC,KAAsB,EAAE,SAAiB,SAAS;IAC/E,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE,CAAC;QAC9B,IAAI,KAAK,GAAG,CAAC,EAAE,CAAC;YACd,MAAM,IAAI,KAAK,CACb,yBAAyB,KAAK,mDAAmD,CAClF,CAAC;QACJ,CAAC;QACD,MAAM,QAAQ,GAAG,KAAK,CAAC,QAAQ,EAAE,CAAC,QAAQ,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QACnD,OAAO,MAAM,CAAC,WAAW,EAAE,KAAK,SAAS,CAAC,CAAC,CAAC,iBAAiB,QAAQ,EAAE,CAAC,CAAC,CAAC,SAAS,QAAQ,EAAE,CAAC;IAChG,CAAC;IAED,uCAAuC;IACvC,MAAM,UAAU,GAAG,KAAK;SACrB,WAAW,EAAE;SACb,OAAO,CAAC,cAAc,EAAE,EAAE,CAAC,CAAC,qCAAqC;SACjE,OAAO,CAAC,0BAA0B,EAAE,EAAE,CAAC,CAA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