-
Notifications
You must be signed in to change notification settings - Fork 1
/
config.js
152 lines (148 loc) · 3.47 KB
/
config.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
/**
* Crossref request URL - where to request paper details.
* @param doi - DOI -only- (not URL)
* @returns - CrossRef url for DOI.
*/
export const XREF = doi =>
`https://api.crossref.org/works/${doi}/transform/application/vnd.crossref.unixsd+xml`
/**
* Paths to data files.
* Read descriptions below to understand purpose of each file.
*
* Note: All text files (.txt) should contain one entry per line.
*/
export const FILES = {
/**
* A dataset of papers.
* @constant
* @type {string}
*/
PAPERS: './data/papers.json',
/**
* List of full website URLs ("https://...") from where to find papers.
* Alternatively, since some webpages can be difficult to crawl, lazy load,
* set cookies, redirect, etc., this a list item can be a physical, local
* cached file, of a website with DOIs.
* @constant
* @type {string}
*/
SOURCES: './data/sources.txt',
/**
* DOI of the next paper to be read.
* @constant
* @type {string}
*/
NEXT_FILE: './data/next.txt',
/**
* Meta data (title, authors, etc.) of the next paper to be read.
* @constant
* @type {string}
*/
NEXT_DESC: './data/desc.txt',
/**
* List of DOIs of previously read papers for the current semester.
* @constant
* @type {string}
*/
SEMESTER_PAPERS: './data/past.txt',
/**
* List of DOIs of previously read papers, for all time.
* We maintain this history for many reasons, one of which is to
* prevent previous paper from being selected again.
* @constant
* @type {string}
*/
ALLTIME_HISTORY: './data/history.txt',
/**
* List of stop words.
* Papers containing stop words are automatically omitted from
* papers dataset.
* @constant
* @type {string}
*/
STOPWORDS: './data/stopwords.txt',
/**
* Website "next paper" file (auto-updated).
* Used to display current paper selection.
* @constant
* @type {string}
*/
WEB_NEXT: './docs/next.md',
/**
* Website "papers list" file (auto-updated).
* Used to display a list of papers.
* @constant
* @type {string}
*/
WEB_PAPERS: './docs/papers.md'
}
/**
* Available CLI commands.
* This is handled by "main method" in index.js.
*/
export const ACTIONS = {
/**
* Choose next paper.
* @constant
* @type {string}
*/
CHOOSE: 'choose',
/**
* Get paper meta data for a specific DOI.
* @constant
* @type {string}
*/
DETAILS: 'details',
/**
* Set the next paper to specific DOI.
* @constant
* @type {string}
*/
SET: 'set',
/**
* Display paper data statistics.
* @constant
* @type {string}
*/
STATS: 'stats',
/**
* Update papers database.
* @constant
* @type {string}
*/
UPDATE: 'update',
/**
* Update website paper details.
* @constant
* @type {string}
*/
WEB: 'web'
}
/**
* Keys Enum
* @type {Object}
*/
export const KEYS = {
/**
* For accessing paper citation in papers dataset in MLA format.
* @constant
* @type {string}
*/
mla: 'mla',
/**
* For accessing paper citation in papers dataset in bibtex format
* @constant
* @type {string}
*/
bib: 'bib'
}
/**
* Other config options
*/
export const CONFIG = {
/**
* Max allowed URL request redirects.
*/
MAX_REDIRS: 20,
DOI_ORG_DOMAIN: 'https://doi.org'
}