dce-expresskit 4.0.0 → 4.2.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.
Files changed (41) hide show
  1. package/lib/constants/LOG_REVIEW_PAGE_SIZE.d.ts +6 -0
  2. package/lib/constants/LOG_REVIEW_PAGE_SIZE.js +9 -0
  3. package/lib/constants/LOG_REVIEW_PAGE_SIZE.js.map +1 -0
  4. package/lib/helpers/dataSigner.js +7 -5
  5. package/lib/helpers/dataSigner.js.map +1 -1
  6. package/lib/helpers/genRouteHandler.js +45 -20
  7. package/lib/helpers/genRouteHandler.js.map +1 -1
  8. package/lib/helpers/getLogReviewerLogs.d.ts +27 -0
  9. package/lib/helpers/getLogReviewerLogs.js +238 -0
  10. package/lib/helpers/getLogReviewerLogs.js.map +1 -0
  11. package/lib/helpers/initExpressKitCollections.d.ts +33 -0
  12. package/lib/helpers/initExpressKitCollections.js +180 -0
  13. package/lib/helpers/initExpressKitCollections.js.map +1 -0
  14. package/lib/helpers/initServer.d.ts +0 -33
  15. package/lib/helpers/initServer.js +31 -75
  16. package/lib/helpers/initServer.js.map +1 -1
  17. package/lib/index.d.ts +2 -3
  18. package/lib/index.js +3 -5
  19. package/lib/index.js.map +1 -1
  20. package/lib/types/ExpressKitErrorCode.d.ts +2 -1
  21. package/lib/types/ExpressKitErrorCode.js +1 -0
  22. package/lib/types/ExpressKitErrorCode.js.map +1 -1
  23. package/lib/types/LogReviewerAdmin.d.ts +10 -0
  24. package/lib/types/LogReviewerAdmin.js +3 -0
  25. package/lib/types/LogReviewerAdmin.js.map +1 -0
  26. package/lib/types/SelectAdmin.d.ts +10 -0
  27. package/lib/types/SelectAdmin.js +3 -0
  28. package/lib/types/SelectAdmin.js.map +1 -0
  29. package/package.json +2 -2
  30. package/src/constants/LOG_REVIEW_PAGE_SIZE.ts +7 -0
  31. package/src/helpers/dataSigner.ts +2 -2
  32. package/src/helpers/genRouteHandler.ts +28 -4
  33. package/src/helpers/getLogReviewerLogs.ts +260 -0
  34. package/src/helpers/initExpressKitCollections.ts +144 -0
  35. package/src/helpers/initServer.ts +43 -84
  36. package/src/index.ts +2 -4
  37. package/src/types/ExpressKitErrorCode.ts +1 -0
  38. package/src/types/LogReviewerAdmin.ts +14 -0
  39. package/src/types/SelectAdmin.ts +14 -0
  40. package/src/helpers/initCrossServerCredentialCollection.ts +0 -19
  41. package/src/helpers/initLogCollection.ts +0 -30
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Type describing a LogReviewerAdmin user
3
+ * @author Yuen Ler Chow
4
+ */
5
+ type LogReviewerAdmin = {
6
+ // User Canvas Id
7
+ id: number,
8
+ // User first name
9
+ userFirstName: string,
10
+ // User last name
11
+ userLastName: string,
12
+ };
13
+
14
+ export default LogReviewerAdmin;
@@ -0,0 +1,14 @@
1
+ /**
2
+ * Type describing a SelectAdmin user (subset of Admin)
3
+ * @author Gardenia Liu
4
+ */
5
+ type SelectAdmin = {
6
+ // User Canvas Id
7
+ id: number,
8
+ // User first name
9
+ userFirstName: string,
10
+ // User last name
11
+ userLastName: string,
12
+ };
13
+
14
+ export default SelectAdmin;
@@ -1,19 +0,0 @@
1
- // Import dce-mango
2
- import { Collection as MangoCollection } from 'dce-mango';
3
-
4
- /**
5
- * Initialize a cross-server credential collection given the dce-mango Collection class
6
- * @author Gabe Abrams
7
- * @param Collection the Collection class from dce-mango
8
- * @returns initialized logCollection
9
- */
10
- const initCrossServerCredentialCollection = (Collection: typeof MangoCollection) => {
11
- return new Collection(
12
- 'CrossServerCredential',
13
- {
14
- uniqueIndexKey: 'key',
15
- },
16
- );
17
- };
18
-
19
- export default initCrossServerCredentialCollection;
@@ -1,30 +0,0 @@
1
- // Import dce-mango
2
- import { Collection as MangoCollection } from 'dce-mango';
3
-
4
- /**
5
- * Initialize a log collection given the dce-mango Collection class
6
- * @author Gabe Abrams
7
- * @param Collection the Collection class from dce-mango
8
- * @returns initialized logCollection
9
- */
10
- const initLogCollection = (Collection: typeof MangoCollection) => {
11
- return new Collection(
12
- 'Log',
13
- {
14
- uniqueIndexKey: 'id',
15
- indexKeys: [
16
- 'courseId',
17
- 'context',
18
- 'subcontext',
19
- 'tags',
20
- 'year',
21
- 'month',
22
- 'day',
23
- 'hour',
24
- 'type',
25
- ],
26
- },
27
- );
28
- };
29
-
30
- export default initLogCollection;