dce-reactkit 4.1.6 → 4.1.8

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.
@@ -22,6 +22,8 @@ declare enum LogAction {
22
22
  Resume = "Resume",
23
23
  Jump = "Jump",
24
24
  Post = "Post",
25
+ Like = "Like",
26
+ Dislike = "Dislike",
25
27
  Unknown = "Unknown"
26
28
  }
27
29
  export default LogAction;
@@ -15,6 +15,9 @@ type LogFunction = (opts: ({
15
15
  [k: string]: any;
16
16
  };
17
17
  level?: LogLevel;
18
+ userId?: number;
19
+ userFirstName?: string;
20
+ userLastName?: string;
18
21
  } & ({
19
22
  error: any;
20
23
  } | {
package/dist/index.d.ts CHANGED
@@ -1177,6 +1177,8 @@ declare enum LogAction {
1177
1177
  Resume = "Resume",
1178
1178
  Jump = "Jump",
1179
1179
  Post = "Post",
1180
+ Like = "Like",
1181
+ Dislike = "Dislike",
1180
1182
  Unknown = "Unknown"
1181
1183
  }
1182
1184
 
@@ -1225,6 +1227,9 @@ type LogFunction = (opts: ({
1225
1227
  [k: string]: any;
1226
1228
  };
1227
1229
  level?: LogLevel;
1230
+ userId?: number;
1231
+ userFirstName?: string;
1232
+ userLastName?: string;
1228
1233
  } & ({
1229
1234
  error: any;
1230
1235
  } | {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dce-reactkit",
3
- "version": "4.1.6",
3
+ "version": "4.1.8",
4
4
  "description": "Shared components for Harvard DCE apps",
5
5
  "main": "dist/cjs/index.js",
6
6
  "module": "dist/esm/index.js",
@@ -115,6 +115,11 @@ const logClientEvent: LogFunction = async (opts) => {
115
115
  ? (opts as any).action
116
116
  : undefined
117
117
  ),
118
+ overriddenUserInfo: {
119
+ userId: opts.userId,
120
+ userFirstName: opts.userFirstName,
121
+ userLastName: opts.userLastName,
122
+ },
118
123
  },
119
124
  });
120
125
  };
@@ -41,6 +41,10 @@ enum LogAction {
41
41
  Jump = 'Jump',
42
42
  // Post a submission/message/etc. into the target
43
43
  Post = 'Post',
44
+ // Like something
45
+ Like = 'Like',
46
+ // Dislike something
47
+ Dislike = 'Dislike',
44
48
  // Unknown action
45
49
  Unknown = 'Unknown',
46
50
  }
@@ -23,6 +23,12 @@ type LogFunction = (
23
23
  },
24
24
  // Log level (default is info)
25
25
  level?: LogLevel,
26
+ // Optional Canvas userId that overrides the current userId from the session (if there is one)
27
+ userId?: number,
28
+ // Optional Canvas user first name that overrides the current user first name from the session (if there is one)
29
+ userFirstName?: string,
30
+ // Optional Canvas user last name that overrides the current user last name from the session (if there is one)
31
+ userLastName?: string,
26
32
  } & (
27
33
  // Error
28
34
  | {