openrxiv-utils 0.0.0 → 0.0.2

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.
@@ -0,0 +1,4 @@
1
+
2
+ > openrxiv-utils@0.0.2 build
3
+ > tsc
4
+
@@ -0,0 +1,15 @@
1
+
2
+ > openrxiv-utils@0.0.2 test
3
+ > vitest run
4
+
5
+
6
+  RUN  v3.2.4 /home/runner/work/openrxiv/openrxiv/packages/utils
7
+
8
+ ✓ src/biorxiv-parser.spec.ts (57 tests) 64ms
9
+ ✓ src/folder-structure.test.ts (162 tests) 124ms
10
+
11
+  Test Files  2 passed (2)
12
+  Tests  219 passed (219)
13
+  Start at  03:03:41
14
+  Duration  1.32s (transform 588ms, setup 0ms, collect 762ms, tests 189ms, environment 1ms, prepare 593ms)
15
+
package/CHANGELOG.md ADDED
@@ -0,0 +1,13 @@
1
+ # openrxiv-utils
2
+
3
+ ## 0.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - e1f69e1: Fix the hompage in npm
8
+
9
+ ## 0.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - cdcc345: Initial release of CLI, API and utilities
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "openrxiv-utils",
3
- "version": "0.0.0",
3
+ "version": "0.0.2",
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/yourusername/biorxiv-meca.git"
36
+ "url": "https://github.com/continuous-foundation/openrxiv.git"
37
37
  },
38
38
  "bugs": {
39
- "url": "https://github.com/yourusername/biorxiv-meca/issues"
39
+ "url": "https://github.com/continuous-foundation/openrxiv/issues"
40
40
  },
41
- "homepage": "https://github.com/yourusername/biorxiv-meca#readme"
41
+ "homepage": "https://github.com/continuous-foundation/openrxiv#readme"
42
42
  }
@@ -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,QAA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