@taiger-common/core 1.0.0

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/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 LIYUNG
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.
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./programs"), exports);
@@ -0,0 +1,225 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.PROGRAM_SUBJECTS = void 0;
4
+ exports.PROGRAM_SUBJECTS = {
5
+ LING: {
6
+ label: 'Linguistics',
7
+ category: 'AH'
8
+ },
9
+ MUS: {
10
+ label: 'Music',
11
+ category: 'AH'
12
+ },
13
+ THEO: {
14
+ label: 'Theology, Divinity and Religious Studies',
15
+ category: 'AH'
16
+ },
17
+ ARCH: {
18
+ label: 'Archaeology',
19
+ category: 'AH'
20
+ },
21
+ 'ARCH-BE': {
22
+ label: 'Architecture and Built Environment',
23
+ category: 'AH'
24
+ },
25
+ 'ART-DES': {
26
+ label: 'Art and Design',
27
+ category: 'AH'
28
+ },
29
+ CLAH: {
30
+ label: 'Classics and Ancient History',
31
+ category: 'AH'
32
+ },
33
+ ELL: {
34
+ label: 'English Language and Literature',
35
+ category: 'AH'
36
+ },
37
+ HIST: {
38
+ label: 'History',
39
+ category: 'AH'
40
+ },
41
+ ARTH: {
42
+ label: 'Art History',
43
+ category: 'AH'
44
+ },
45
+ 'MOD-LANG': {
46
+ label: 'Modern Languages',
47
+ category: 'AH'
48
+ },
49
+ 'PERF-ART': {
50
+ label: 'Performing Arts',
51
+ category: 'AH'
52
+ },
53
+ PHIL: {
54
+ label: 'Philosophy',
55
+ category: 'AH'
56
+ },
57
+ 'CHEM-ENG': {
58
+ label: 'Engineering - Chemical',
59
+ category: 'ET'
60
+ },
61
+ 'CIV-STR-ENG': {
62
+ label: 'Engineering - Civil and Structural',
63
+ category: 'ET'
64
+ },
65
+ CSIS: {
66
+ label: 'Computer Science and Information Systems',
67
+ category: 'ET'
68
+ },
69
+ 'DS-AI': {
70
+ label: 'Data Science and Artificial Intelligence',
71
+ category: 'ET'
72
+ },
73
+ 'ELEC-ENG': {
74
+ label: 'Engineering - Electrical and Electronic',
75
+ category: 'ET'
76
+ },
77
+ 'PETRO-ENG': {
78
+ label: 'Engineering - Petroleum',
79
+ category: 'ET'
80
+ },
81
+ 'MECH-ENG': {
82
+ label: 'Engineering - Mechanical',
83
+ category: 'ET'
84
+ },
85
+ 'MIN-MIN-ENG': {
86
+ label: 'Engineering - Mineral and Mining',
87
+ category: 'ET'
88
+ },
89
+ 'AG-FOR': {
90
+ label: 'Agriculture and Forestry',
91
+ category: 'LSM'
92
+ },
93
+ 'ANA-PHYS': {
94
+ label: 'Anatomy and Physiology',
95
+ category: 'LSM'
96
+ },
97
+ 'BIO-SCI': {
98
+ label: 'Biological Sciences',
99
+ category: 'LSM'
100
+ },
101
+ DENT: {
102
+ label: 'Dentistry',
103
+ category: 'LSM'
104
+ },
105
+ MED: {
106
+ label: 'Medicine',
107
+ category: 'LSM'
108
+ },
109
+ NURS: {
110
+ label: 'Nursing',
111
+ category: 'LSM'
112
+ },
113
+ PHARM: {
114
+ label: 'Pharmacy and Pharmacology',
115
+ category: 'LSM'
116
+ },
117
+ PSYCH: {
118
+ label: 'Psychology',
119
+ category: 'LSM'
120
+ },
121
+ 'VET-SCI': {
122
+ label: 'Veterinary Science',
123
+ category: 'LSM'
124
+ },
125
+ CHEM: {
126
+ label: 'Chemistry',
127
+ category: 'NS'
128
+ },
129
+ 'EAR-MAR-SCI': {
130
+ label: 'Earth and Marine Sciences',
131
+ category: 'NS'
132
+ },
133
+ 'ENV-SCI': {
134
+ label: 'Environmental Sciences',
135
+ category: 'NS'
136
+ },
137
+ GEO: {
138
+ label: 'Geography',
139
+ category: 'NS'
140
+ },
141
+ GEOL: {
142
+ label: 'Geology',
143
+ category: 'NS'
144
+ },
145
+ GEOPH: {
146
+ label: 'Geophysics',
147
+ category: 'NS'
148
+ },
149
+ 'MAT-SCI': {
150
+ label: 'Materials Sciences',
151
+ category: 'NS'
152
+ },
153
+ MATH: {
154
+ label: 'Mathematics',
155
+ category: 'NS'
156
+ },
157
+ 'PHYS-ASTRO': {
158
+ label: 'Physics and Astronomy',
159
+ category: 'NS'
160
+ },
161
+ 'ACC-FIN': {
162
+ label: 'Accounting and Finance',
163
+ category: 'SSM'
164
+ },
165
+ ANTH: {
166
+ label: 'Anthropology',
167
+ category: 'SSM'
168
+ },
169
+ 'BUS-MGMT': {
170
+ label: 'Business and Management Studies',
171
+ category: 'SSM'
172
+ },
173
+ 'COMM-MEDIA': {
174
+ label: 'Communication and Media Studies',
175
+ category: 'SSM'
176
+ },
177
+ 'DEV-STUD': {
178
+ label: 'Development Studies',
179
+ category: 'SSM'
180
+ },
181
+ ECON: {
182
+ label: 'Economics and Econometrics',
183
+ category: 'SSM'
184
+ },
185
+ 'EDU-TRAIN': {
186
+ label: 'Education and Training',
187
+ category: 'SSM'
188
+ },
189
+ 'HOSP-MGMT': {
190
+ label: 'Hospitality and Leisure Management',
191
+ category: 'SSM'
192
+ },
193
+ LAW: {
194
+ label: 'Law and Legal Studies',
195
+ category: 'SSM'
196
+ },
197
+ 'LIB-INFO': {
198
+ label: 'Library and Information Management',
199
+ category: 'SSM'
200
+ },
201
+ MKT: {
202
+ label: 'Marketing',
203
+ category: 'SSM'
204
+ },
205
+ POL: {
206
+ label: 'Politics',
207
+ category: 'SSM'
208
+ },
209
+ 'SOC-POL': {
210
+ label: 'Social Policy and Administration',
211
+ category: 'SSM'
212
+ },
213
+ SOC: {
214
+ label: 'Sociology',
215
+ category: 'SSM'
216
+ },
217
+ SPORT: {
218
+ label: 'Sports-Related Subjects',
219
+ category: 'SSM'
220
+ },
221
+ 'STAT-OR': {
222
+ label: 'Statistics and Operational Research',
223
+ category: 'SSM'
224
+ }
225
+ };
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.helloWorldSring = exports.helloWorldFunc = void 0;
4
+ function helloWorldFunc() {
5
+ return 'Hello, world function!';
6
+ }
7
+ exports.helloWorldFunc = helloWorldFunc;
8
+ exports.helloWorldSring = 'Hello, world String!';
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./helloWorld"), exports);
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./users"), exports);
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,48 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.is_TaiGer_Guest = exports.is_TaiGer_Student = exports.is_TaiGer_Manager = exports.is_TaiGer_Agent = exports.is_TaiGer_External = exports.is_TaiGer_Editor = exports.is_TaiGer_Admin = exports.is_TaiGer_AdminAgent = exports.is_TaiGer_role = void 0;
4
+ // Tested
5
+ var is_TaiGer_role = function (user) {
6
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin' ||
7
+ (user === null || user === void 0 ? void 0 : user.role) === 'Agent' ||
8
+ (user === null || user === void 0 ? void 0 : user.role) === 'Editor' ||
9
+ (user === null || user === void 0 ? void 0 : user.role) === 'External';
10
+ };
11
+ exports.is_TaiGer_role = is_TaiGer_role;
12
+ // Tested
13
+ var is_TaiGer_AdminAgent = function (user) {
14
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin' || (user === null || user === void 0 ? void 0 : user.role) === 'Agent';
15
+ };
16
+ exports.is_TaiGer_AdminAgent = is_TaiGer_AdminAgent;
17
+ // Tested
18
+ var is_TaiGer_Admin = function (user) {
19
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin';
20
+ };
21
+ exports.is_TaiGer_Admin = is_TaiGer_Admin;
22
+ // Tested
23
+ var is_TaiGer_Editor = function (user) {
24
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Editor';
25
+ };
26
+ exports.is_TaiGer_Editor = is_TaiGer_Editor;
27
+ var is_TaiGer_External = function (user) {
28
+ return (user === null || user === void 0 ? void 0 : user.role) === 'External';
29
+ };
30
+ exports.is_TaiGer_External = is_TaiGer_External;
31
+ // Tested
32
+ var is_TaiGer_Agent = function (user) {
33
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Agent';
34
+ };
35
+ exports.is_TaiGer_Agent = is_TaiGer_Agent;
36
+ var is_TaiGer_Manager = function (user) {
37
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Manager';
38
+ };
39
+ exports.is_TaiGer_Manager = is_TaiGer_Manager;
40
+ // Tested
41
+ var is_TaiGer_Student = function (user) {
42
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Student';
43
+ };
44
+ exports.is_TaiGer_Student = is_TaiGer_Student;
45
+ var is_TaiGer_Guest = function (user) {
46
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Guest';
47
+ };
48
+ exports.is_TaiGer_Guest = is_TaiGer_Guest;
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./checking-functions"), exports);
@@ -0,0 +1 @@
1
+ export * from './programs';
@@ -0,0 +1,222 @@
1
+ export var PROGRAM_SUBJECTS = {
2
+ LING: {
3
+ label: 'Linguistics',
4
+ category: 'AH'
5
+ },
6
+ MUS: {
7
+ label: 'Music',
8
+ category: 'AH'
9
+ },
10
+ THEO: {
11
+ label: 'Theology, Divinity and Religious Studies',
12
+ category: 'AH'
13
+ },
14
+ ARCH: {
15
+ label: 'Archaeology',
16
+ category: 'AH'
17
+ },
18
+ 'ARCH-BE': {
19
+ label: 'Architecture and Built Environment',
20
+ category: 'AH'
21
+ },
22
+ 'ART-DES': {
23
+ label: 'Art and Design',
24
+ category: 'AH'
25
+ },
26
+ CLAH: {
27
+ label: 'Classics and Ancient History',
28
+ category: 'AH'
29
+ },
30
+ ELL: {
31
+ label: 'English Language and Literature',
32
+ category: 'AH'
33
+ },
34
+ HIST: {
35
+ label: 'History',
36
+ category: 'AH'
37
+ },
38
+ ARTH: {
39
+ label: 'Art History',
40
+ category: 'AH'
41
+ },
42
+ 'MOD-LANG': {
43
+ label: 'Modern Languages',
44
+ category: 'AH'
45
+ },
46
+ 'PERF-ART': {
47
+ label: 'Performing Arts',
48
+ category: 'AH'
49
+ },
50
+ PHIL: {
51
+ label: 'Philosophy',
52
+ category: 'AH'
53
+ },
54
+ 'CHEM-ENG': {
55
+ label: 'Engineering - Chemical',
56
+ category: 'ET'
57
+ },
58
+ 'CIV-STR-ENG': {
59
+ label: 'Engineering - Civil and Structural',
60
+ category: 'ET'
61
+ },
62
+ CSIS: {
63
+ label: 'Computer Science and Information Systems',
64
+ category: 'ET'
65
+ },
66
+ 'DS-AI': {
67
+ label: 'Data Science and Artificial Intelligence',
68
+ category: 'ET'
69
+ },
70
+ 'ELEC-ENG': {
71
+ label: 'Engineering - Electrical and Electronic',
72
+ category: 'ET'
73
+ },
74
+ 'PETRO-ENG': {
75
+ label: 'Engineering - Petroleum',
76
+ category: 'ET'
77
+ },
78
+ 'MECH-ENG': {
79
+ label: 'Engineering - Mechanical',
80
+ category: 'ET'
81
+ },
82
+ 'MIN-MIN-ENG': {
83
+ label: 'Engineering - Mineral and Mining',
84
+ category: 'ET'
85
+ },
86
+ 'AG-FOR': {
87
+ label: 'Agriculture and Forestry',
88
+ category: 'LSM'
89
+ },
90
+ 'ANA-PHYS': {
91
+ label: 'Anatomy and Physiology',
92
+ category: 'LSM'
93
+ },
94
+ 'BIO-SCI': {
95
+ label: 'Biological Sciences',
96
+ category: 'LSM'
97
+ },
98
+ DENT: {
99
+ label: 'Dentistry',
100
+ category: 'LSM'
101
+ },
102
+ MED: {
103
+ label: 'Medicine',
104
+ category: 'LSM'
105
+ },
106
+ NURS: {
107
+ label: 'Nursing',
108
+ category: 'LSM'
109
+ },
110
+ PHARM: {
111
+ label: 'Pharmacy and Pharmacology',
112
+ category: 'LSM'
113
+ },
114
+ PSYCH: {
115
+ label: 'Psychology',
116
+ category: 'LSM'
117
+ },
118
+ 'VET-SCI': {
119
+ label: 'Veterinary Science',
120
+ category: 'LSM'
121
+ },
122
+ CHEM: {
123
+ label: 'Chemistry',
124
+ category: 'NS'
125
+ },
126
+ 'EAR-MAR-SCI': {
127
+ label: 'Earth and Marine Sciences',
128
+ category: 'NS'
129
+ },
130
+ 'ENV-SCI': {
131
+ label: 'Environmental Sciences',
132
+ category: 'NS'
133
+ },
134
+ GEO: {
135
+ label: 'Geography',
136
+ category: 'NS'
137
+ },
138
+ GEOL: {
139
+ label: 'Geology',
140
+ category: 'NS'
141
+ },
142
+ GEOPH: {
143
+ label: 'Geophysics',
144
+ category: 'NS'
145
+ },
146
+ 'MAT-SCI': {
147
+ label: 'Materials Sciences',
148
+ category: 'NS'
149
+ },
150
+ MATH: {
151
+ label: 'Mathematics',
152
+ category: 'NS'
153
+ },
154
+ 'PHYS-ASTRO': {
155
+ label: 'Physics and Astronomy',
156
+ category: 'NS'
157
+ },
158
+ 'ACC-FIN': {
159
+ label: 'Accounting and Finance',
160
+ category: 'SSM'
161
+ },
162
+ ANTH: {
163
+ label: 'Anthropology',
164
+ category: 'SSM'
165
+ },
166
+ 'BUS-MGMT': {
167
+ label: 'Business and Management Studies',
168
+ category: 'SSM'
169
+ },
170
+ 'COMM-MEDIA': {
171
+ label: 'Communication and Media Studies',
172
+ category: 'SSM'
173
+ },
174
+ 'DEV-STUD': {
175
+ label: 'Development Studies',
176
+ category: 'SSM'
177
+ },
178
+ ECON: {
179
+ label: 'Economics and Econometrics',
180
+ category: 'SSM'
181
+ },
182
+ 'EDU-TRAIN': {
183
+ label: 'Education and Training',
184
+ category: 'SSM'
185
+ },
186
+ 'HOSP-MGMT': {
187
+ label: 'Hospitality and Leisure Management',
188
+ category: 'SSM'
189
+ },
190
+ LAW: {
191
+ label: 'Law and Legal Studies',
192
+ category: 'SSM'
193
+ },
194
+ 'LIB-INFO': {
195
+ label: 'Library and Information Management',
196
+ category: 'SSM'
197
+ },
198
+ MKT: {
199
+ label: 'Marketing',
200
+ category: 'SSM'
201
+ },
202
+ POL: {
203
+ label: 'Politics',
204
+ category: 'SSM'
205
+ },
206
+ 'SOC-POL': {
207
+ label: 'Social Policy and Administration',
208
+ category: 'SSM'
209
+ },
210
+ SOC: {
211
+ label: 'Sociology',
212
+ category: 'SSM'
213
+ },
214
+ SPORT: {
215
+ label: 'Sports-Related Subjects',
216
+ category: 'SSM'
217
+ },
218
+ 'STAT-OR': {
219
+ label: 'Statistics and Operational Research',
220
+ category: 'SSM'
221
+ }
222
+ };
@@ -0,0 +1,4 @@
1
+ export function helloWorldFunc() {
2
+ return 'Hello, world function!';
3
+ }
4
+ export var helloWorldSring = 'Hello, world String!';
@@ -0,0 +1 @@
1
+ export * from './helloWorld';
@@ -0,0 +1 @@
1
+ export * from './users';
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,36 @@
1
+ // Tested
2
+ export var is_TaiGer_role = function (user) {
3
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin' ||
4
+ (user === null || user === void 0 ? void 0 : user.role) === 'Agent' ||
5
+ (user === null || user === void 0 ? void 0 : user.role) === 'Editor' ||
6
+ (user === null || user === void 0 ? void 0 : user.role) === 'External';
7
+ };
8
+ // Tested
9
+ export var is_TaiGer_AdminAgent = function (user) {
10
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin' || (user === null || user === void 0 ? void 0 : user.role) === 'Agent';
11
+ };
12
+ // Tested
13
+ export var is_TaiGer_Admin = function (user) {
14
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Admin';
15
+ };
16
+ // Tested
17
+ export var is_TaiGer_Editor = function (user) {
18
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Editor';
19
+ };
20
+ export var is_TaiGer_External = function (user) {
21
+ return (user === null || user === void 0 ? void 0 : user.role) === 'External';
22
+ };
23
+ // Tested
24
+ export var is_TaiGer_Agent = function (user) {
25
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Agent';
26
+ };
27
+ export var is_TaiGer_Manager = function (user) {
28
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Manager';
29
+ };
30
+ // Tested
31
+ export var is_TaiGer_Student = function (user) {
32
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Student';
33
+ };
34
+ export var is_TaiGer_Guest = function (user) {
35
+ return (user === null || user === void 0 ? void 0 : user.role) === 'Guest';
36
+ };
@@ -0,0 +1 @@
1
+ export * from './checking-functions';
@@ -0,0 +1 @@
1
+ export * from './programs';
@@ -0,0 +1,222 @@
1
+ export declare const PROGRAM_SUBJECTS: {
2
+ LING: {
3
+ label: string;
4
+ category: string;
5
+ };
6
+ MUS: {
7
+ label: string;
8
+ category: string;
9
+ };
10
+ THEO: {
11
+ label: string;
12
+ category: string;
13
+ };
14
+ ARCH: {
15
+ label: string;
16
+ category: string;
17
+ };
18
+ 'ARCH-BE': {
19
+ label: string;
20
+ category: string;
21
+ };
22
+ 'ART-DES': {
23
+ label: string;
24
+ category: string;
25
+ };
26
+ CLAH: {
27
+ label: string;
28
+ category: string;
29
+ };
30
+ ELL: {
31
+ label: string;
32
+ category: string;
33
+ };
34
+ HIST: {
35
+ label: string;
36
+ category: string;
37
+ };
38
+ ARTH: {
39
+ label: string;
40
+ category: string;
41
+ };
42
+ 'MOD-LANG': {
43
+ label: string;
44
+ category: string;
45
+ };
46
+ 'PERF-ART': {
47
+ label: string;
48
+ category: string;
49
+ };
50
+ PHIL: {
51
+ label: string;
52
+ category: string;
53
+ };
54
+ 'CHEM-ENG': {
55
+ label: string;
56
+ category: string;
57
+ };
58
+ 'CIV-STR-ENG': {
59
+ label: string;
60
+ category: string;
61
+ };
62
+ CSIS: {
63
+ label: string;
64
+ category: string;
65
+ };
66
+ 'DS-AI': {
67
+ label: string;
68
+ category: string;
69
+ };
70
+ 'ELEC-ENG': {
71
+ label: string;
72
+ category: string;
73
+ };
74
+ 'PETRO-ENG': {
75
+ label: string;
76
+ category: string;
77
+ };
78
+ 'MECH-ENG': {
79
+ label: string;
80
+ category: string;
81
+ };
82
+ 'MIN-MIN-ENG': {
83
+ label: string;
84
+ category: string;
85
+ };
86
+ 'AG-FOR': {
87
+ label: string;
88
+ category: string;
89
+ };
90
+ 'ANA-PHYS': {
91
+ label: string;
92
+ category: string;
93
+ };
94
+ 'BIO-SCI': {
95
+ label: string;
96
+ category: string;
97
+ };
98
+ DENT: {
99
+ label: string;
100
+ category: string;
101
+ };
102
+ MED: {
103
+ label: string;
104
+ category: string;
105
+ };
106
+ NURS: {
107
+ label: string;
108
+ category: string;
109
+ };
110
+ PHARM: {
111
+ label: string;
112
+ category: string;
113
+ };
114
+ PSYCH: {
115
+ label: string;
116
+ category: string;
117
+ };
118
+ 'VET-SCI': {
119
+ label: string;
120
+ category: string;
121
+ };
122
+ CHEM: {
123
+ label: string;
124
+ category: string;
125
+ };
126
+ 'EAR-MAR-SCI': {
127
+ label: string;
128
+ category: string;
129
+ };
130
+ 'ENV-SCI': {
131
+ label: string;
132
+ category: string;
133
+ };
134
+ GEO: {
135
+ label: string;
136
+ category: string;
137
+ };
138
+ GEOL: {
139
+ label: string;
140
+ category: string;
141
+ };
142
+ GEOPH: {
143
+ label: string;
144
+ category: string;
145
+ };
146
+ 'MAT-SCI': {
147
+ label: string;
148
+ category: string;
149
+ };
150
+ MATH: {
151
+ label: string;
152
+ category: string;
153
+ };
154
+ 'PHYS-ASTRO': {
155
+ label: string;
156
+ category: string;
157
+ };
158
+ 'ACC-FIN': {
159
+ label: string;
160
+ category: string;
161
+ };
162
+ ANTH: {
163
+ label: string;
164
+ category: string;
165
+ };
166
+ 'BUS-MGMT': {
167
+ label: string;
168
+ category: string;
169
+ };
170
+ 'COMM-MEDIA': {
171
+ label: string;
172
+ category: string;
173
+ };
174
+ 'DEV-STUD': {
175
+ label: string;
176
+ category: string;
177
+ };
178
+ ECON: {
179
+ label: string;
180
+ category: string;
181
+ };
182
+ 'EDU-TRAIN': {
183
+ label: string;
184
+ category: string;
185
+ };
186
+ 'HOSP-MGMT': {
187
+ label: string;
188
+ category: string;
189
+ };
190
+ LAW: {
191
+ label: string;
192
+ category: string;
193
+ };
194
+ 'LIB-INFO': {
195
+ label: string;
196
+ category: string;
197
+ };
198
+ MKT: {
199
+ label: string;
200
+ category: string;
201
+ };
202
+ POL: {
203
+ label: string;
204
+ category: string;
205
+ };
206
+ 'SOC-POL': {
207
+ label: string;
208
+ category: string;
209
+ };
210
+ SOC: {
211
+ label: string;
212
+ category: string;
213
+ };
214
+ SPORT: {
215
+ label: string;
216
+ category: string;
217
+ };
218
+ 'STAT-OR': {
219
+ label: string;
220
+ category: string;
221
+ };
222
+ };
@@ -0,0 +1,2 @@
1
+ export declare function helloWorldFunc(): string;
2
+ export declare const helloWorldSring = "Hello, world String!";
@@ -0,0 +1 @@
1
+ export * from './helloWorld';
@@ -0,0 +1 @@
1
+ export * from './users';
@@ -0,0 +1,3 @@
1
+ export interface UserProps {
2
+ role: string;
3
+ }
@@ -0,0 +1,10 @@
1
+ import { UserProps } from '../types';
2
+ export declare const is_TaiGer_role: (user: UserProps) => boolean;
3
+ export declare const is_TaiGer_AdminAgent: (user: UserProps) => boolean;
4
+ export declare const is_TaiGer_Admin: (user: UserProps) => boolean;
5
+ export declare const is_TaiGer_Editor: (user: UserProps) => boolean;
6
+ export declare const is_TaiGer_External: (user: UserProps) => boolean;
7
+ export declare const is_TaiGer_Agent: (user: UserProps) => boolean;
8
+ export declare const is_TaiGer_Manager: (user: UserProps) => boolean;
9
+ export declare const is_TaiGer_Student: (user: UserProps) => boolean;
10
+ export declare const is_TaiGer_Guest: (user: UserProps) => boolean;
@@ -0,0 +1 @@
1
+ export * from './checking-functions';
@@ -0,0 +1 @@
1
+ !function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.exampleTypescriptPackage=t():e.exampleTypescriptPackage=t()}(this,(()=>(()=>{"use strict";var e={61:(e,t)=>{Object.defineProperty(t,"__esModule",{value:!0}),t.helloWorldSring=t.helloWorldFunc=void 0,t.helloWorldFunc=function(){return"Hello, world function!"},t.helloWorldSring="Hello, world String!"},229:function(e,t,o){var r=this&&this.__createBinding||(Object.create?function(e,t,o,r){void 0===r&&(r=o);var n=Object.getOwnPropertyDescriptor(t,o);n&&!("get"in n?!t.__esModule:n.writable||n.configurable)||(n={enumerable:!0,get:function(){return t[o]}}),Object.defineProperty(e,r,n)}:function(e,t,o,r){void 0===r&&(r=o),e[r]=t[o]}),n=this&&this.__exportStar||function(e,t){for(var o in e)"default"===o||Object.prototype.hasOwnProperty.call(t,o)||r(t,e,o)};Object.defineProperty(t,"__esModule",{value:!0}),n(o(61),t)}},t={};return function o(r){var n=t[r];if(void 0!==n)return n.exports;var i=t[r]={exports:{}};return e[r].call(i.exports,i,i.exports,o),i.exports}(229)})()));
package/package.json ADDED
@@ -0,0 +1,73 @@
1
+ {
2
+ "name": "@taiger-common/core",
3
+ "version": "1.0.0",
4
+ "description": "TaiGer core package",
5
+ "main": "dist/cjs/index.js",
6
+ "module": "dist/esm/index.js",
7
+ "umd:main": "dist/umd/index.js",
8
+ "types": "dist/types/index.d.js",
9
+ "scripts": {
10
+ "_postinstall": "husky install",
11
+ "prepublishOnly": "pinst --disable",
12
+ "postpublish": "pinst --enable",
13
+ "build": "npm run build:cjs && npm run build:esm && npm run build:umd && npm run build:types",
14
+ "build:cjs": "node tools/cleanup cjs && tsc -p config/tsconfig.cjs.json",
15
+ "build:esm": "node tools/cleanup esm && tsc -p config/tsconfig.esm.json",
16
+ "build:umd": "node tools/cleanup umd && webpack --config config/webpack.config.js",
17
+ "build:types": "node tools/cleanup types && tsc -p config/tsconfig.types.json",
18
+ "clean": "node tools/cleanup",
19
+ "package": "npm run build && npm pack",
20
+ "test": "jest --no-cache --runInBand",
21
+ "test:cov": "jest --coverage --no-cache --runInBand",
22
+ "addscope": "node tools/packagejson name @tomchen/example-typescript-package"
23
+ },
24
+ "publishConfig": {
25
+ "access": "public"
26
+ },
27
+ "files": [
28
+ "dist"
29
+ ],
30
+ "keywords": [
31
+ "example",
32
+ "typescript",
33
+ "npm",
34
+ "package",
35
+ "sample",
36
+ "boilerplate",
37
+ "starter",
38
+ "demo",
39
+ "cjs",
40
+ "esm",
41
+ "umd"
42
+ ],
43
+ "author": "LIYUNG",
44
+ "license": "MIT",
45
+ "homepage": "https://github.com/LIYUNG/taiger-core",
46
+ "repository": {
47
+ "type": "git",
48
+ "url": "git+https://github.com/LIYUNG/taiger-core.git"
49
+ },
50
+ "bugs": {
51
+ "url": "https://github.com/LIYUNG/taiger-core/issues"
52
+ },
53
+ "dependencies": {},
54
+ "devDependencies": {
55
+ "@commitlint/cli": "^13.1.0",
56
+ "@commitlint/config-conventional": "^13.1.0",
57
+ "@types/jest": "^27.0.1",
58
+ "@typescript-eslint/eslint-plugin": "^4.31.1",
59
+ "@typescript-eslint/parser": "^4.31.1",
60
+ "eslint": "^7.32.0",
61
+ "eslint-config-prettier": "^8.3.0",
62
+ "eslint-plugin-prettier": "^4.0.0",
63
+ "husky": "^7.0.2",
64
+ "jest": "^27.2.0",
65
+ "pinst": "^2.1.6",
66
+ "prettier": "^2.4.0",
67
+ "ts-jest": "^27.0.5",
68
+ "ts-loader": "^9.2.5",
69
+ "typescript": "^4.4.3",
70
+ "webpack": "^5.52.1",
71
+ "webpack-cli": "^4.8.0"
72
+ }
73
+ }