dce-commonkit 4.4.2 → 4.4.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/lib/index.d.ts +2 -1
- package/lib/index.js.map +1 -1
- package/lib/types/LogReviewerFilterState/ActionErrorFilterState.d.ts +17 -0
- package/lib/types/LogReviewerFilterState/ActionErrorFilterState.js +3 -0
- package/lib/types/LogReviewerFilterState/ActionErrorFilterState.js.map +1 -0
- package/lib/types/LogReviewerFilterState/AdvancedFilterState.d.ts +21 -0
- package/lib/types/LogReviewerFilterState/AdvancedFilterState.js +3 -0
- package/lib/types/LogReviewerFilterState/AdvancedFilterState.js.map +1 -0
- package/lib/types/LogReviewerFilterState/ContextFilterState.d.ts +10 -0
- package/lib/types/LogReviewerFilterState/ContextFilterState.js +3 -0
- package/lib/types/LogReviewerFilterState/ContextFilterState.js.map +1 -0
- package/lib/types/LogReviewerFilterState/DateFilterState.d.ts +17 -0
- package/lib/types/LogReviewerFilterState/DateFilterState.js +3 -0
- package/lib/types/LogReviewerFilterState/DateFilterState.js.map +1 -0
- package/lib/types/LogReviewerFilterState/TagFilterState.d.ts +8 -0
- package/lib/types/LogReviewerFilterState/TagFilterState.js +3 -0
- package/lib/types/LogReviewerFilterState/TagFilterState.js.map +1 -0
- package/lib/types/LogReviewerFilterState/index.d.ts +17 -0
- package/lib/types/LogReviewerFilterState/index.js +3 -0
- package/lib/types/LogReviewerFilterState/index.js.map +1 -0
- package/package.json +1 -1
- package/src/index.ts +2 -0
- package/src/types/LogReviewerFilterState/ActionErrorFilterState.ts +25 -0
- package/src/types/LogReviewerFilterState/AdvancedFilterState.ts +37 -0
- package/src/types/LogReviewerFilterState/ContextFilterState.ts +16 -0
- package/src/types/LogReviewerFilterState/DateFilterState.ts +26 -0
- package/src/types/LogReviewerFilterState/TagFilterState.ts +9 -0
- package/src/types/LogReviewerFilterState/index.ts +24 -0
package/lib/index.d.ts
CHANGED
|
@@ -62,4 +62,5 @@ import LogLevel from './types/LogLevel';
|
|
|
62
62
|
import CommonKitErrorCode from './types/CommonKitErrorCode';
|
|
63
63
|
import LogMetadataContextMap from './types/LogMetadataContextMap';
|
|
64
64
|
import LogMetadataTargetMap from './types/LogMetadataTargetMap';
|
|
65
|
-
|
|
65
|
+
import LogReviewerFilterState from './types/LogReviewerFilterState';
|
|
66
|
+
export { ErrorWithCode, MINUTE_IN_MS, HOUR_IN_MS, DAY_IN_MS, LOG_REVIEW_ROUTE_PATH_PREFIX, LOG_ROUTE_PATH, LOG_REVIEW_STATUS_ROUTE, LOG_REVIEW_GET_LOGS_ROUTE, SELECT_ADMIN_CHECK_ROUTE, CommonKitErrorCode, ParamType, DayOfWeek, Log, LogType, LogSource, LogAction, LogBuiltInMetadata, LogMetadataType, LogFunction, LogTypeSpecificInfo, LogMainInfo, LogSourceSpecificInfo, LogLevel, LogMetadataContextMap, LogMetadataTargetMap, LogReviewerFilterState, abbreviate, avg, ceilToNumDecimals, floorToNumDecimals, forceNumIntoBounds, padDecimalZeros, padZerosLeft, roundToNumDecimals, sum, waitMs, getOrdinal, getTimeInfoInET, startMinWait, getHumanReadableDate, getPartOfDay, stringsToHumanReadableList, onlyKeepLetters, parallelLimit, getMonthName, genCSV, extractProp, compareArraysByProp, genCommaList, validateEmail, validatePhoneNumber, validateString, getLocalTimeInfo, idify, prefixWithAOrAn, everyAsync, filterAsync, forEachAsync, mapAsync, someAsync, capitalize, shuffleArray, getWordCount, cloneDeep, getTimestampFromTimeInfoInET, };
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,gBAAgB;AAChB,yEAAmD;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;AAAA,gBAAgB;AAChB,yEAAmD;AA2EjD,wBA3EK,uBAAa,CA2EL;AAzEf,mBAAmB;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CAiCL;AAhCX,gEAA0C;AAiCxC,oBAjCK,mBAAS,CAiCL;AAhCX,kFAA4D;AAiC1D,6BAjCK,4BAAkB,CAiCL;AA3BpB,8DAAwC;AAiCtC,mBAjCK,kBAAQ,CAiCL;AAhCV,kFAA4D;AAmB1D,6BAnBK,4BAAkB,CAmBL"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import LogType from '../LogType';
|
|
2
|
+
/**
|
|
3
|
+
* Action filter state (only relevant for action logs)
|
|
4
|
+
* @author Yuen Ler Chow
|
|
5
|
+
*/
|
|
6
|
+
type ActionErrorFilterState = {
|
|
7
|
+
type: LogType | undefined;
|
|
8
|
+
errorMessage: string;
|
|
9
|
+
errorCode: string;
|
|
10
|
+
target: {
|
|
11
|
+
[k: string]: boolean;
|
|
12
|
+
};
|
|
13
|
+
action: {
|
|
14
|
+
[k: string]: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default ActionErrorFilterState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ActionErrorFilterState.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/ActionErrorFilterState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import LogSource from '../LogSource';
|
|
2
|
+
/**
|
|
3
|
+
* Advanced filter state
|
|
4
|
+
* @author Yuen Ler Chow
|
|
5
|
+
*/
|
|
6
|
+
type AdvancedFilterState = {
|
|
7
|
+
userFirstName: string;
|
|
8
|
+
userLastName: string;
|
|
9
|
+
userEmail: string;
|
|
10
|
+
userId: string;
|
|
11
|
+
includeLearners: boolean;
|
|
12
|
+
includeTTMs: boolean;
|
|
13
|
+
includeAdmins: boolean;
|
|
14
|
+
courseId: string;
|
|
15
|
+
courseName: string;
|
|
16
|
+
isMobile: (true | false | undefined);
|
|
17
|
+
source: LogSource | undefined;
|
|
18
|
+
routePath: string;
|
|
19
|
+
routeTemplate: string;
|
|
20
|
+
};
|
|
21
|
+
export default AdvancedFilterState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AdvancedFilterState.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/AdvancedFilterState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ContextFilterState.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/ContextFilterState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date filter state
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type DateFilterState = {
|
|
6
|
+
startDate: {
|
|
7
|
+
year: number;
|
|
8
|
+
month: number;
|
|
9
|
+
day: number;
|
|
10
|
+
};
|
|
11
|
+
endDate: {
|
|
12
|
+
year: number;
|
|
13
|
+
month: number;
|
|
14
|
+
day: number;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
17
|
+
export default DateFilterState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DateFilterState.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/DateFilterState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TagFilterState.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/TagFilterState.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import DateFilterState from './DateFilterState';
|
|
2
|
+
import ContextFilterState from './ContextFilterState';
|
|
3
|
+
import TagFilterState from './TagFilterState';
|
|
4
|
+
import ActionErrorFilterState from './ActionErrorFilterState';
|
|
5
|
+
import AdvancedFilterState from './AdvancedFilterState';
|
|
6
|
+
/**
|
|
7
|
+
* A bundle of filter state objects for each type of filter
|
|
8
|
+
* @author Gabe Abrams
|
|
9
|
+
*/
|
|
10
|
+
type LogReviewerFilterState = {
|
|
11
|
+
dateFilterState: DateFilterState;
|
|
12
|
+
contextFilterState: ContextFilterState;
|
|
13
|
+
tagFilterState: TagFilterState;
|
|
14
|
+
actionErrorFilterState: ActionErrorFilterState;
|
|
15
|
+
advancedFilterState: AdvancedFilterState;
|
|
16
|
+
};
|
|
17
|
+
export default LogReviewerFilterState;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/types/LogReviewerFilterState/index.ts"],"names":[],"mappings":""}
|
package/package.json
CHANGED
package/src/index.ts
CHANGED
|
@@ -69,6 +69,7 @@ import LogLevel from './types/LogLevel';
|
|
|
69
69
|
import CommonKitErrorCode from './types/CommonKitErrorCode';
|
|
70
70
|
import LogMetadataContextMap from './types/LogMetadataContextMap';
|
|
71
71
|
import LogMetadataTargetMap from './types/LogMetadataTargetMap';
|
|
72
|
+
import LogReviewerFilterState from './types/LogReviewerFilterState';
|
|
72
73
|
|
|
73
74
|
// Export each item
|
|
74
75
|
export {
|
|
@@ -100,6 +101,7 @@ export {
|
|
|
100
101
|
LogLevel,
|
|
101
102
|
LogMetadataContextMap,
|
|
102
103
|
LogMetadataTargetMap,
|
|
104
|
+
LogReviewerFilterState,
|
|
103
105
|
// Helpers
|
|
104
106
|
abbreviate,
|
|
105
107
|
avg,
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
// Import shared types
|
|
2
|
+
import LogType from '../LogType';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Action filter state (only relevant for action logs)
|
|
6
|
+
* @author Yuen Ler Chow
|
|
7
|
+
*/
|
|
8
|
+
type ActionErrorFilterState = {
|
|
9
|
+
// Required type of log
|
|
10
|
+
type: LogType | undefined, // If undefined, no filter applied
|
|
11
|
+
// Query for error message (only relevant if type is error)
|
|
12
|
+
errorMessage: string, // If empty, no filter applied
|
|
13
|
+
// Query for error code (only relevant if type is error)
|
|
14
|
+
errorCode: string, // If empty, no filter applied
|
|
15
|
+
// Action targets to include (only relevant if type is action)
|
|
16
|
+
target: {
|
|
17
|
+
[k: string]: boolean
|
|
18
|
+
},
|
|
19
|
+
// Action types to include (only relevant if type is action)
|
|
20
|
+
action: {
|
|
21
|
+
[k: string]: boolean
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
|
|
25
|
+
export default ActionErrorFilterState;
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
// Import shared types
|
|
2
|
+
import LogSource from '../LogSource';
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Advanced filter state
|
|
6
|
+
* @author Yuen Ler Chow
|
|
7
|
+
*/
|
|
8
|
+
type AdvancedFilterState = {
|
|
9
|
+
// Query for user first name (case insensitive)
|
|
10
|
+
userFirstName: string, // If empty, no filter applied
|
|
11
|
+
// Query for user last name (case insensitive)
|
|
12
|
+
userLastName: string, // If empty, no filter applied
|
|
13
|
+
// Query for user email (case insensitive)
|
|
14
|
+
userEmail: string, // If empty, no filter applied
|
|
15
|
+
// Match for userId (numerical)
|
|
16
|
+
userId: string, // If empty, no filter applied
|
|
17
|
+
// If true, include students
|
|
18
|
+
includeLearners: boolean,
|
|
19
|
+
// If true, include ttms
|
|
20
|
+
includeTTMs: boolean,
|
|
21
|
+
// If true, include admins
|
|
22
|
+
includeAdmins: boolean,
|
|
23
|
+
// Match for courseId (numerical)
|
|
24
|
+
courseId: string, // If empty, no filter applied
|
|
25
|
+
// Query for course name (case insensitive)
|
|
26
|
+
courseName: string, // If empty, no filter applied
|
|
27
|
+
// Required isMobile value
|
|
28
|
+
isMobile: (true | false | undefined), // If undefined, no filter applied
|
|
29
|
+
// Required log source value
|
|
30
|
+
source: LogSource | undefined, // If undefined, no filter applied
|
|
31
|
+
// Query for route path (only relevant if source is server)
|
|
32
|
+
routePath: string, // If empty, no filter applied
|
|
33
|
+
// Query for route template (only relevant if source is server)
|
|
34
|
+
routeTemplate: string, // If empty, no filter applied
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export default AdvancedFilterState;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Context filter state
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type ContextFilterState = {
|
|
6
|
+
[k: string]: (
|
|
7
|
+
// No subcontexts
|
|
8
|
+
| boolean // True if selected
|
|
9
|
+
// Includes subcontexts
|
|
10
|
+
| {
|
|
11
|
+
[k: string]: boolean // True if selected
|
|
12
|
+
}
|
|
13
|
+
)
|
|
14
|
+
};
|
|
15
|
+
|
|
16
|
+
export default ContextFilterState;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Date filter state
|
|
3
|
+
* @author Yuen Ler Chow
|
|
4
|
+
*/
|
|
5
|
+
type DateFilterState = {
|
|
6
|
+
// Current start date
|
|
7
|
+
startDate: {
|
|
8
|
+
// Full year
|
|
9
|
+
year: number,
|
|
10
|
+
// 1-indexed month
|
|
11
|
+
month: number,
|
|
12
|
+
// 1-indexed day
|
|
13
|
+
day: number,
|
|
14
|
+
},
|
|
15
|
+
// Current end date
|
|
16
|
+
endDate: {
|
|
17
|
+
// Full year
|
|
18
|
+
year: number,
|
|
19
|
+
// 1-indexed month
|
|
20
|
+
month: number,
|
|
21
|
+
// 1-indexed day
|
|
22
|
+
day: number,
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export default DateFilterState;
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import DateFilterState from './DateFilterState';
|
|
2
|
+
import ContextFilterState from './ContextFilterState';
|
|
3
|
+
import TagFilterState from './TagFilterState';
|
|
4
|
+
import ActionErrorFilterState from './ActionErrorFilterState';
|
|
5
|
+
import AdvancedFilterState from './AdvancedFilterState';
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* A bundle of filter state objects for each type of filter
|
|
9
|
+
* @author Gabe Abrams
|
|
10
|
+
*/
|
|
11
|
+
type LogReviewerFilterState = {
|
|
12
|
+
// Date filter state
|
|
13
|
+
dateFilterState: DateFilterState,
|
|
14
|
+
// Context filter state
|
|
15
|
+
contextFilterState: ContextFilterState,
|
|
16
|
+
// Tag filter state
|
|
17
|
+
tagFilterState: TagFilterState,
|
|
18
|
+
// Action error filter state
|
|
19
|
+
actionErrorFilterState: ActionErrorFilterState,
|
|
20
|
+
// Advanced filter state
|
|
21
|
+
advancedFilterState: AdvancedFilterState,
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
export default LogReviewerFilterState;
|