@iblai/data-layer 1.13.0 → 1.13.2
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/index.d.ts +5 -1
- package/dist/index.esm.js +172 -24
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +172 -24
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/src/config.d.ts +6 -0
- package/dist/src/features/analytics/types.d.ts +4 -0
- package/dist/src/features/auth/__tests__/token-refresh.test.d.ts +1 -0
- package/dist/src/features/auth/token-refresh.d.ts +11 -0
- package/dist/src/utils/index.d.ts +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
package/dist/package.json
CHANGED
package/dist/src/config.d.ts
CHANGED
|
@@ -6,4 +6,10 @@ export default class Config {
|
|
|
6
6
|
static mentorIframeUrl: string;
|
|
7
7
|
static studioUrl: string;
|
|
8
8
|
static httpErrorHandlers: {};
|
|
9
|
+
/**
|
|
10
|
+
* Optional override for how expired auth tokens are re-minted after a 401.
|
|
11
|
+
* Resolve `true` once fresh tokens are in storage. Left unset, the data
|
|
12
|
+
* layer mints them itself from the edX session.
|
|
13
|
+
*/
|
|
14
|
+
static refreshAuthToken: (() => Promise<boolean>) | undefined;
|
|
9
15
|
}
|
|
@@ -69,6 +69,8 @@ export interface TranscriptsMessagesDetailsResponse {
|
|
|
69
69
|
model: string;
|
|
70
70
|
username: string;
|
|
71
71
|
name: string;
|
|
72
|
+
/** Preferred over `name`/`username` in the UI; older deployments omit it. */
|
|
73
|
+
email?: string | null;
|
|
72
74
|
first_user_message: string;
|
|
73
75
|
topics: string[];
|
|
74
76
|
message_count: number;
|
|
@@ -102,6 +104,8 @@ export interface TranscriptsMessagesResponse {
|
|
|
102
104
|
cost: number;
|
|
103
105
|
username: string;
|
|
104
106
|
name: string;
|
|
107
|
+
/** Preferred over `name`/`username` in the UI; older deployments omit it. */
|
|
108
|
+
email?: string | null;
|
|
105
109
|
first_user_message: string;
|
|
106
110
|
topics: string[];
|
|
107
111
|
message_count: number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Refreshes the auth tokens, collapsing concurrent callers onto one request.
|
|
3
|
+
* A page load that fires ten requests in parallel produces ten 401s; without
|
|
4
|
+
* this they would mint ten token sets and race each other into storage.
|
|
5
|
+
*
|
|
6
|
+
* Never rejects — a thrown refresh resolves `false`, which callers read as
|
|
7
|
+
* "give up and run the registered 401 handler" (i.e. log out).
|
|
8
|
+
*/
|
|
9
|
+
export declare const refreshAuthTokenOnce: () => Promise<boolean>;
|
|
10
|
+
/** Test hook: drops any in-flight refresh so cases start from a clean slate. */
|
|
11
|
+
export declare const __resetTokenRefreshState: () => void;
|