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.
- package/dist/cjs/index.js +9 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/types/types/LogAction.d.ts +2 -0
- package/dist/cjs/types/types/LogFunction.d.ts +3 -0
- package/dist/esm/index.js +9 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/types/types/LogAction.d.ts +2 -0
- package/dist/esm/types/types/LogFunction.d.ts +3 -0
- package/dist/index.d.ts +5 -0
- package/package.json +1 -1
- package/src/helpers/logClientEvent.tsx +5 -0
- package/src/types/LogAction.ts +4 -0
- package/src/types/LogFunction.ts +6 -0
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
|
@@ -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
|
};
|
package/src/types/LogAction.ts
CHANGED
package/src/types/LogFunction.ts
CHANGED
|
@@ -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
|
| {
|