@edifice.io/client 2.1.0-develop-enabling.0 → 2.1.0-develop-b2school.20250204153130
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/analytics/Service.d.ts +0 -24
- package/dist/apps/timeline/Framework.d.ts +25 -0
- package/dist/apps/timeline/Notification.model.d.ts +10 -0
- package/dist/apps/timeline/interfaces.d.ts +69 -0
- package/dist/cache/Service.d.ts +1 -1
- package/dist/configure/Analytics.d.ts +40 -0
- package/dist/configure/AppConf.d.ts +17 -0
- package/dist/configure/Framework.d.ts +22 -0
- package/dist/configure/Service.d.ts +1 -4
- package/dist/configure/Theme.d.ts +34 -0
- package/dist/configure/User.d.ts +21 -0
- package/dist/configure/interfaces.d.ts +79 -1
- package/dist/data/Service.d.ts +25 -0
- package/dist/data/WebBroker.d.ts +12 -0
- package/dist/data/interface.d.ts +50 -0
- package/dist/globals.d.ts +2 -0
- package/dist/idiom/Idiom.d.ts +18 -0
- package/dist/idiom/Service.d.ts +20 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +3776 -2231
- package/dist/notify/Framework.d.ts +29 -0
- package/dist/notify/Subject.d.ts +9 -0
- package/dist/notify/interfaces.d.ts +4 -1
- package/dist/resources/ResourceService.d.ts +1 -1
- package/dist/resources/interface.d.ts +8 -0
- package/dist/resources/services/HomeworksResourceService.d.ts +14 -0
- package/dist/resources/services/TimelineGeneratorResourceService.d.ts +14 -0
- package/dist/services/OdeServices.d.ts +20 -17
- package/dist/session/Framework.d.ts +10 -0
- package/dist/session/Service.d.ts +1 -1
- package/dist/session/Session.d.ts +34 -0
- package/dist/session/interfaces.d.ts +8 -5
- package/dist/share/Service.d.ts +1 -1
- package/dist/transport/Framework.d.ts +9 -0
- package/dist/transport/Http.d.ts +26 -0
- package/dist/{http → transport}/Service.d.ts +1 -3
- package/dist/{http → transport}/interfaces.d.ts +3 -0
- package/dist/widget/Framework.d.ts +31 -0
- package/dist/widget/LastInfos.widget.d.ts +0 -4
- package/dist/widget/interfaces.d.ts +3 -0
- package/package.json +17 -7
|
@@ -1,32 +1,8 @@
|
|
|
1
|
-
import { IMatomoTrackingParams, ITrackingParams, IXitiTrackingParams } from '../configure/interfaces';
|
|
2
1
|
import { IOdeServices } from '../services/OdeServices';
|
|
3
2
|
import { IWebApp } from '../session/interfaces';
|
|
4
|
-
export type XitiConf = {
|
|
5
|
-
ID_EXPLOITANT: string;
|
|
6
|
-
ID_PLATEFORME: string;
|
|
7
|
-
ID_PROJET: string;
|
|
8
|
-
active: boolean;
|
|
9
|
-
config: boolean;
|
|
10
|
-
structureMap?: {
|
|
11
|
-
[structureId: string]: {
|
|
12
|
-
UAI?: string;
|
|
13
|
-
active: boolean;
|
|
14
|
-
collectiviteId?: number;
|
|
15
|
-
plateformeId?: any;
|
|
16
|
-
projetId?: any;
|
|
17
|
-
};
|
|
18
|
-
};
|
|
19
|
-
};
|
|
20
|
-
export type ParamsByTrackingSystem = {
|
|
21
|
-
type: 'none' | 'internal' | 'matomo' | 'multiple';
|
|
22
|
-
internal?: ITrackingParams;
|
|
23
|
-
matomo?: IMatomoTrackingParams;
|
|
24
|
-
xiti?: IXitiTrackingParams;
|
|
25
|
-
};
|
|
26
3
|
export declare class AnalyticsService {
|
|
27
4
|
private context;
|
|
28
5
|
constructor(context: IOdeServices);
|
|
29
|
-
private get conf();
|
|
30
6
|
private get http();
|
|
31
7
|
private get session();
|
|
32
8
|
/**
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { IFlashMessageModel, ITimelineApp } from './interfaces';
|
|
2
|
+
import { Notification } from './Notification.model';
|
|
3
|
+
export declare class TimelineApp implements ITimelineApp {
|
|
4
|
+
private _notifications;
|
|
5
|
+
private _notificationTypes;
|
|
6
|
+
private _flashMessages;
|
|
7
|
+
private _pageNumber;
|
|
8
|
+
private _lastPage;
|
|
9
|
+
private _loading;
|
|
10
|
+
showMine: boolean;
|
|
11
|
+
get notifications(): Array<Notification>;
|
|
12
|
+
get isLoading(): boolean;
|
|
13
|
+
get page(): number;
|
|
14
|
+
get hasMorePage(): boolean;
|
|
15
|
+
get notificationTypes(): Array<string>;
|
|
16
|
+
get selectedNotificationTypes(): Array<string>;
|
|
17
|
+
get preferences(): any;
|
|
18
|
+
get flashMessages(): IFlashMessageModel[];
|
|
19
|
+
savePreferences(): Promise<void>;
|
|
20
|
+
resetPagination(): void;
|
|
21
|
+
initialize(): Promise<void>;
|
|
22
|
+
loadNotifications(force?: boolean): Promise<void>;
|
|
23
|
+
loadFlashMessages(): Promise<void>;
|
|
24
|
+
markAsRead(msg: IFlashMessageModel): Promise<void>;
|
|
25
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { ITimelineNotification, NotificationModel } from './interfaces';
|
|
2
|
+
export declare class Notification implements ITimelineNotification {
|
|
3
|
+
constructor(model: NotificationModel);
|
|
4
|
+
_id: string;
|
|
5
|
+
model: NotificationModel;
|
|
6
|
+
isUnread(): boolean;
|
|
7
|
+
delete(): Promise<any>;
|
|
8
|
+
discard(): Promise<any>;
|
|
9
|
+
report(): Promise<any>;
|
|
10
|
+
}
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
export declare abstract class ITimelineFactory {
|
|
2
|
+
static createInstance(): ITimelineApp;
|
|
3
|
+
}
|
|
4
|
+
export interface ITimelineApp {
|
|
5
|
+
initialize(): Promise<void>;
|
|
6
|
+
readonly notificationTypes: Array<string>;
|
|
7
|
+
readonly selectedNotificationTypes: Array<string>;
|
|
8
|
+
showMine: boolean;
|
|
9
|
+
/** Load more notifications, or force loading more by virtually incrementing the page. */
|
|
10
|
+
loadNotifications(force?: boolean): Promise<void>;
|
|
11
|
+
readonly notifications: Array<ITimelineNotification>;
|
|
12
|
+
resetPagination(): void;
|
|
13
|
+
readonly isLoading: boolean;
|
|
14
|
+
readonly page: number;
|
|
15
|
+
readonly hasMorePage: boolean;
|
|
16
|
+
savePreferences(): Promise<void>;
|
|
17
|
+
readonly preferences: any;
|
|
18
|
+
loadFlashMessages(): Promise<void>;
|
|
19
|
+
readonly flashMessages: Array<IFlashMessageModel>;
|
|
20
|
+
markAsRead(msg: IFlashMessageModel): Promise<void>;
|
|
21
|
+
}
|
|
22
|
+
export interface ITimelineNotification {
|
|
23
|
+
readonly _id: string;
|
|
24
|
+
readonly model: NotificationModel;
|
|
25
|
+
isUnread(): boolean;
|
|
26
|
+
delete(): Promise<void>;
|
|
27
|
+
discard(): Promise<void>;
|
|
28
|
+
report(): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
export type NotificationModel = {
|
|
31
|
+
_id: string;
|
|
32
|
+
type: string;
|
|
33
|
+
eventType: string;
|
|
34
|
+
resource: string;
|
|
35
|
+
sender: string;
|
|
36
|
+
params: {
|
|
37
|
+
uri: string;
|
|
38
|
+
username: string;
|
|
39
|
+
blogTitle: string;
|
|
40
|
+
resourceUri: string;
|
|
41
|
+
};
|
|
42
|
+
date: {
|
|
43
|
+
$date: number;
|
|
44
|
+
};
|
|
45
|
+
message: string;
|
|
46
|
+
recipients?: Array<Recipient>;
|
|
47
|
+
reported?: boolean;
|
|
48
|
+
reporters?: any;
|
|
49
|
+
};
|
|
50
|
+
export interface Recipient {
|
|
51
|
+
userId: string;
|
|
52
|
+
}
|
|
53
|
+
export interface IFlashMessageModel {
|
|
54
|
+
readonly id: string;
|
|
55
|
+
readonly title?: string;
|
|
56
|
+
readonly contents?: object;
|
|
57
|
+
readonly startDate?: string;
|
|
58
|
+
readonly endDate?: string;
|
|
59
|
+
readonly readCount?: number;
|
|
60
|
+
readonly author?: string;
|
|
61
|
+
readonly profiles?: string[];
|
|
62
|
+
readonly color?: string;
|
|
63
|
+
readonly customColor?: string | null;
|
|
64
|
+
readonly lastModifier?: string;
|
|
65
|
+
readonly structureId?: string;
|
|
66
|
+
readonly subStructures?: string[];
|
|
67
|
+
readonly signature?: string;
|
|
68
|
+
readonly signatureColor?: string;
|
|
69
|
+
}
|
package/dist/cache/Service.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { IHttpParams, IHttpResponse } from '../http/interfaces';
|
|
2
1
|
import { IOdeServices } from '../services/OdeServices';
|
|
2
|
+
import { IHttpParams, IHttpResponse } from '../transport/interfaces';
|
|
3
3
|
export declare class CacheService {
|
|
4
4
|
private context;
|
|
5
5
|
constructor(context: IOdeServices);
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AnalyticStatus, IXitiTrackingParams, IMatomoTrackingParams, ITrackingParams, TrackingType } from './interfaces';
|
|
2
|
+
export type ParamsByTrackingSystem = {
|
|
3
|
+
type: 'none' | 'internal' | 'matomo' | 'multiple';
|
|
4
|
+
internal?: ITrackingParams;
|
|
5
|
+
matomo?: IMatomoTrackingParams;
|
|
6
|
+
xiti?: IXitiTrackingParams;
|
|
7
|
+
};
|
|
8
|
+
export type XitiConf = {
|
|
9
|
+
ID_EXPLOITANT: string;
|
|
10
|
+
ID_PLATEFORME: string;
|
|
11
|
+
ID_PROJET: string;
|
|
12
|
+
active: boolean;
|
|
13
|
+
config: boolean;
|
|
14
|
+
structureMap?: {
|
|
15
|
+
[structureId: string]: {
|
|
16
|
+
UAI?: string;
|
|
17
|
+
active: boolean;
|
|
18
|
+
collectiviteId?: number;
|
|
19
|
+
plateformeId?: any;
|
|
20
|
+
projetId?: any;
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
};
|
|
24
|
+
export declare class Analytics {
|
|
25
|
+
private _status;
|
|
26
|
+
private _params?;
|
|
27
|
+
get status(): AnalyticStatus;
|
|
28
|
+
xiti(): Promise<IXitiTrackingParams | undefined>;
|
|
29
|
+
parameters<T extends ITrackingParams>(type: TrackingType): Promise<T | undefined>;
|
|
30
|
+
private parametersWithCheck;
|
|
31
|
+
/**
|
|
32
|
+
* This method loads the conf and waits for the user session to start.
|
|
33
|
+
* It can be called ASAP, but it will be automatically called if needed.
|
|
34
|
+
* @returns A promise of the end of the init process (it may throw errors)
|
|
35
|
+
* @throws ERROR_CODE.MALFORMED_DATA when config cannot be read.
|
|
36
|
+
*/
|
|
37
|
+
private initialize;
|
|
38
|
+
/** 2021 implementation of XiTi. */
|
|
39
|
+
private initializeXiti;
|
|
40
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { App } from '../globals';
|
|
2
|
+
import { IWebApp } from '../session/interfaces';
|
|
3
|
+
export declare class AppConf {
|
|
4
|
+
private _publicConf;
|
|
5
|
+
private _currentApp?;
|
|
6
|
+
private _appConf;
|
|
7
|
+
/**
|
|
8
|
+
* Get the currently initialized App.
|
|
9
|
+
* @see getter SessionFramework.currentApp
|
|
10
|
+
*/
|
|
11
|
+
get currentApp(): App | null;
|
|
12
|
+
setCurrentApp(app: App): AppConf;
|
|
13
|
+
initialize(app: App, alternativeApp?: boolean): Promise<void>;
|
|
14
|
+
getPublicConf(app: App): Promise<any>;
|
|
15
|
+
getWebAppConf(app: App): Promise<IWebApp | undefined>;
|
|
16
|
+
loadI18n(app: App): Promise<void>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { IConfigurationFramework } from './interfaces';
|
|
2
|
+
import { Theme } from './Theme';
|
|
3
|
+
import { Idiom } from '../idiom/Idiom';
|
|
4
|
+
import { User } from './User';
|
|
5
|
+
import { AppConf } from './AppConf';
|
|
6
|
+
import { Analytics } from './Analytics';
|
|
7
|
+
export declare class ConfigurationFramework implements IConfigurationFramework {
|
|
8
|
+
readonly Platform: {
|
|
9
|
+
deploymentTag: string;
|
|
10
|
+
cdnDomain: string;
|
|
11
|
+
apps: AppConf;
|
|
12
|
+
theme: Theme;
|
|
13
|
+
analytics: Analytics;
|
|
14
|
+
idiom: Idiom;
|
|
15
|
+
listLanguages: () => Promise<any>;
|
|
16
|
+
};
|
|
17
|
+
readonly School: {};
|
|
18
|
+
readonly User: User;
|
|
19
|
+
initialize(version?: string | null, cdnDomain?: string | null): Promise<void>;
|
|
20
|
+
}
|
|
21
|
+
/** The whole framework is a singleton. */
|
|
22
|
+
export declare const configure: ConfigurationFramework;
|
|
@@ -4,13 +4,10 @@ import { IGetConf } from './interfaces';
|
|
|
4
4
|
export declare class ConfService {
|
|
5
5
|
private context;
|
|
6
6
|
constructor(context: IOdeServices);
|
|
7
|
-
readonly Platform: {
|
|
8
|
-
deploymentTag: string;
|
|
9
|
-
cdnDomain: string;
|
|
10
|
-
};
|
|
11
7
|
private get http();
|
|
12
8
|
private get cache();
|
|
13
9
|
private get cdnDomain();
|
|
10
|
+
private get notify();
|
|
14
11
|
getConf(app: App): Promise<IGetConf>;
|
|
15
12
|
getPublicConf<T>(app: App): Promise<T>;
|
|
16
13
|
getCdnUrl(): string | undefined;
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { ITheme, IThemeConf, IThemeDesc, IThemeOverrides, IThemeConfOverriding } from './interfaces';
|
|
2
|
+
export declare class Theme implements ITheme {
|
|
3
|
+
private _conf?;
|
|
4
|
+
private _loaded?;
|
|
5
|
+
skinName: string;
|
|
6
|
+
themeName: string;
|
|
7
|
+
skin: string;
|
|
8
|
+
themeUrl: string;
|
|
9
|
+
templateOverrides: IThemeOverrides;
|
|
10
|
+
portalTemplate: string;
|
|
11
|
+
basePath: string;
|
|
12
|
+
logoutCallback: string;
|
|
13
|
+
skins: Array<IThemeConfOverriding>;
|
|
14
|
+
is1D: boolean;
|
|
15
|
+
is2D: boolean;
|
|
16
|
+
initialize(version?: string): Promise<void>;
|
|
17
|
+
private get version();
|
|
18
|
+
private get cdnDomain();
|
|
19
|
+
onFullyReady(): Promise<ITheme>;
|
|
20
|
+
private _onSkinReady;
|
|
21
|
+
onSkinReady(): Promise<ITheme>;
|
|
22
|
+
private _onOverrideReady;
|
|
23
|
+
onOverrideReady(): Promise<IThemeOverrides>;
|
|
24
|
+
getConf(version?: string): Promise<IThemeConf>;
|
|
25
|
+
load(version?: string): Promise<void>;
|
|
26
|
+
private loadDisconnected;
|
|
27
|
+
private loadConnected;
|
|
28
|
+
/** Load the user's configured theme. */
|
|
29
|
+
private loadDefaultTheme;
|
|
30
|
+
listThemes(): Promise<IThemeDesc[]>;
|
|
31
|
+
setDefaultTheme(theme: IThemeDesc): Promise<void>;
|
|
32
|
+
listSkins(): Promise<IThemeConfOverriding[]>;
|
|
33
|
+
getHelpPath(): Promise<string>;
|
|
34
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { App } from '../globals';
|
|
2
|
+
import { IUserPreferences } from './interfaces';
|
|
3
|
+
import { IWebApp } from '../session/interfaces';
|
|
4
|
+
export declare class User {
|
|
5
|
+
private _me;
|
|
6
|
+
private _keepOpenOnLogout;
|
|
7
|
+
private _preferences;
|
|
8
|
+
private _bookmarkedApps;
|
|
9
|
+
get keepOpenOnLogout(): boolean;
|
|
10
|
+
get preferences(): IUserPreferences;
|
|
11
|
+
get bookmarkedApps(): Array<IWebApp>;
|
|
12
|
+
initialize(version?: string): Promise<void>;
|
|
13
|
+
private setCurrentModel;
|
|
14
|
+
private loadPublicConf;
|
|
15
|
+
/** Bookmarks : pinned apps */
|
|
16
|
+
private loadBookmarks;
|
|
17
|
+
loadAppPrefs(app: App): Promise<any>;
|
|
18
|
+
saveAppPrefs(app: App): Promise<void>;
|
|
19
|
+
loadLanguage(): Promise<string>;
|
|
20
|
+
saveLanguage(lang: string): Promise<void>;
|
|
21
|
+
}
|
|
@@ -1,5 +1,62 @@
|
|
|
1
1
|
import { App, USER_PREFS } from '../globals';
|
|
2
2
|
import { IWebApp } from '../session/interfaces';
|
|
3
|
+
export declare abstract class ConfigurationFrameworkFactory {
|
|
4
|
+
static instance(): IConfigurationFramework;
|
|
5
|
+
}
|
|
6
|
+
export interface IConfigurationFramework {
|
|
7
|
+
/** Framework initialization */
|
|
8
|
+
initialize(version: string | null, cdnDomain: string | null): Promise<void>;
|
|
9
|
+
readonly Platform: {
|
|
10
|
+
readonly deploymentTag: string;
|
|
11
|
+
readonly cdnDomain: string;
|
|
12
|
+
readonly apps: {
|
|
13
|
+
/**
|
|
14
|
+
* Initialize an app (preload its public conf and i18n)
|
|
15
|
+
* @param app Which application to initialize
|
|
16
|
+
* @param alternativeApp Truthy when an application needs initializing another, while remaining principal.
|
|
17
|
+
*/
|
|
18
|
+
initialize(app: App, alternativeApp?: boolean): Promise<void>;
|
|
19
|
+
/** Load and return the public conf of an app. */
|
|
20
|
+
getPublicConf(app: App): Promise<any>;
|
|
21
|
+
/** Load and return the server conf of an app. */
|
|
22
|
+
getWebAppConf(app: App): Promise<IWebApp | undefined>;
|
|
23
|
+
/** Load the i18n of an app. */
|
|
24
|
+
loadI18n(app: App): Promise<void>;
|
|
25
|
+
};
|
|
26
|
+
/** Configured theme. */
|
|
27
|
+
readonly theme: ITheme;
|
|
28
|
+
/** Configured tracking. */
|
|
29
|
+
readonly analytics: {
|
|
30
|
+
/** Get a tracker parameters. */
|
|
31
|
+
parameters<T extends ITrackingParams>(type: TrackingType): Promise<T | undefined>;
|
|
32
|
+
/**
|
|
33
|
+
* Get the XiTi configuration.
|
|
34
|
+
* This method awaits for the session to be be fully loaded.
|
|
35
|
+
* //FIXME refactor xiti configuration
|
|
36
|
+
*/
|
|
37
|
+
xiti(): Promise<IXitiTrackingParams | undefined>;
|
|
38
|
+
/** Check the status, if something goes wrong. */
|
|
39
|
+
readonly status: AnalyticStatus;
|
|
40
|
+
};
|
|
41
|
+
/** I18n (port from legacy infra-front)*/
|
|
42
|
+
readonly idiom: IIdiom;
|
|
43
|
+
listLanguages(): Promise<string[]>;
|
|
44
|
+
};
|
|
45
|
+
readonly User: {
|
|
46
|
+
/** User's preferences.*/
|
|
47
|
+
readonly preferences: IUserPreferences;
|
|
48
|
+
/** Legacy option (//FIXME which use ?).*/
|
|
49
|
+
readonly keepOpenOnLogout: boolean;
|
|
50
|
+
/** User's prefered apps. */
|
|
51
|
+
readonly bookmarkedApps: Array<IWebApp>;
|
|
52
|
+
/** Load the user's preferences for the given app. */
|
|
53
|
+
loadAppPrefs(app: App): Promise<any>;
|
|
54
|
+
/** Save the user's preferences for the given app. */
|
|
55
|
+
saveAppPrefs(app: App): Promise<void>;
|
|
56
|
+
loadLanguage(): Promise<string>;
|
|
57
|
+
saveLanguage(lang: string): Promise<void>;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
3
60
|
export type AnalyticStatus = 'void' | 'pending' | 'ready' | 'failed';
|
|
4
61
|
export type TrackingType = 'matomo' | 'internal';
|
|
5
62
|
export interface ITrackingParams {
|
|
@@ -72,7 +129,7 @@ export interface ITheme {
|
|
|
72
129
|
/** List available skins. */
|
|
73
130
|
listSkins(): Promise<IThemeConfOverriding[]>;
|
|
74
131
|
/** Get the help path, which can be dedicated to 1D or 2D. */
|
|
75
|
-
getHelpPath(): Promise<
|
|
132
|
+
getHelpPath(): Promise<string>;
|
|
76
133
|
}
|
|
77
134
|
export interface IThemeDesc {
|
|
78
135
|
_id: string;
|
|
@@ -108,6 +165,27 @@ export type IThemeOverrides = {
|
|
|
108
165
|
[app in App]?: string;
|
|
109
166
|
};
|
|
110
167
|
export type AddBundleCallback = () => void | Promise<void>;
|
|
168
|
+
export interface IIdiom {
|
|
169
|
+
/** Get the translation of a given key.
|
|
170
|
+
* @param params (optional) map of key/value variables.
|
|
171
|
+
* @return the key itself when no translation exists.
|
|
172
|
+
*/
|
|
173
|
+
translate(key: string, params?: {
|
|
174
|
+
[param: string]: any;
|
|
175
|
+
}): string;
|
|
176
|
+
/** Load a language bundle then return a Promise. */
|
|
177
|
+
addBundlePromise(path: string): Promise<void>;
|
|
178
|
+
/** Load a language bundle then call an optional callback. */
|
|
179
|
+
addBundle(path: string, callback?: AddBundleCallback): void;
|
|
180
|
+
/** Load the JSON language file from a given folder, using the current user's language, then call an optional callback. */
|
|
181
|
+
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
182
|
+
/** Load the JSON language files from many given folders, using the current user's language, then return a Promise. */
|
|
183
|
+
addAllTranslations(folders: string[]): Promise<void>;
|
|
184
|
+
/** Add new key/values translations to the in-memory dictionary, using a key/value map. Existing in-memory keys ARE NOT REPLACED. Only new ones are added. */
|
|
185
|
+
addKeys(keys: any): void;
|
|
186
|
+
/** @return a new string without accentuation. */
|
|
187
|
+
removeAccents(str: string): string;
|
|
188
|
+
}
|
|
111
189
|
export type UserPreferenceKey = (typeof USER_PREFS)[keyof typeof USER_PREFS] | App;
|
|
112
190
|
export interface IUserPreferences {
|
|
113
191
|
data: {
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { DataServiceProps, IDataService } from './interface';
|
|
2
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
3
|
+
/** Public conf of an app with a DataService activated. See backend /conf/public */
|
|
4
|
+
export interface PublicConfForDataService {
|
|
5
|
+
'data-service'?: DataServiceProps;
|
|
6
|
+
}
|
|
7
|
+
export declare class DataService implements IDataService {
|
|
8
|
+
private odeServices;
|
|
9
|
+
private _webBroker?;
|
|
10
|
+
private app?;
|
|
11
|
+
private user?;
|
|
12
|
+
private profile?;
|
|
13
|
+
constructor(odeServices: IOdeServices);
|
|
14
|
+
private get conf();
|
|
15
|
+
private get notify();
|
|
16
|
+
initialize(): Promise<void>;
|
|
17
|
+
predestroy(): void;
|
|
18
|
+
/** Send a web-user-level event to the data pipeline. */
|
|
19
|
+
private trackWebEvent;
|
|
20
|
+
private addUserInfos;
|
|
21
|
+
trackVideoSave(video_id: string, duration: number, weight: number, isCaptation: boolean, url: string, browser: string, deviceType?: string): void;
|
|
22
|
+
trackVideoRead(video_id: string, isCaptation: boolean, url: string, browser: string, deviceType?: string): void;
|
|
23
|
+
trackSpeechAndText(direction: 'STT' | 'TTS'): void;
|
|
24
|
+
trackAccessLibraryFromExplorer(): void;
|
|
25
|
+
}
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { DataServiceProps, IEventBroker } from './interface';
|
|
2
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
3
|
+
export declare class WebBroker implements IEventBroker {
|
|
4
|
+
private odeServices;
|
|
5
|
+
private subscription?;
|
|
6
|
+
constructor(odeServices: IOdeServices);
|
|
7
|
+
private get http();
|
|
8
|
+
private get events();
|
|
9
|
+
private dispatchEvent;
|
|
10
|
+
initialize(props: DataServiceProps['web'] | undefined): this;
|
|
11
|
+
destroy(): void;
|
|
12
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/** Joker value to permit sending all events. */
|
|
2
|
+
export declare const SEND_ALL = "*";
|
|
3
|
+
/** Data tracking service. */
|
|
4
|
+
export interface IDataService {
|
|
5
|
+
/**
|
|
6
|
+
* Send a VIDEO_SAVE event to the backend.
|
|
7
|
+
* @param video_id ID of the workspace's video document.
|
|
8
|
+
* @param duration Duration of the video, in ms.
|
|
9
|
+
* @param weight Weight of the video, in bytes.
|
|
10
|
+
* @param isCaptation Truthy is the video was captured on the end-user device.
|
|
11
|
+
* @param url Current URL of the navigator, when video was saved.
|
|
12
|
+
* @param browser Browser name and version (space-separated)
|
|
13
|
+
* @param deviceType @see UAParser.getDevice().type => console|mobile|tablet|smarttv|wearable|embedded
|
|
14
|
+
*/
|
|
15
|
+
trackVideoSave(video_id: string, duration: number, weight: number, isCaptation: boolean, url: string, browser: string, deviceType?: string): void;
|
|
16
|
+
/**
|
|
17
|
+
* Send a VIDEO_READ event to the backend.
|
|
18
|
+
* @param video_id ID of the workspace's video document.
|
|
19
|
+
* @param isCaptation Truthy is the video was captured on the end-user device.
|
|
20
|
+
* @param url Current URL of the navigator, when video is played.
|
|
21
|
+
* @param browser Browser name and version (space-separated)
|
|
22
|
+
* @param deviceType @see UAParser.getDevice().type => console|mobile|tablet|smarttv|wearable|embedded
|
|
23
|
+
*/
|
|
24
|
+
trackVideoRead(video_id: string, isCaptation: boolean, url: string, browser: string, deviceType?: string): void;
|
|
25
|
+
/**
|
|
26
|
+
* Send a SPEECH_AND_TEXT event to the backend.
|
|
27
|
+
* @param direction speech-to-text (voice recognition) or text-to-speech (voice generation)
|
|
28
|
+
*/
|
|
29
|
+
trackSpeechAndText(direction: 'STT' | 'TTS'): void;
|
|
30
|
+
/**
|
|
31
|
+
* Send a ACCESS_LIBRARY_FROM_EXPLORER event to the backend.
|
|
32
|
+
*/
|
|
33
|
+
trackAccessLibraryFromExplorer(): void;
|
|
34
|
+
}
|
|
35
|
+
/** Public properties of the DataService. */
|
|
36
|
+
export interface DataServiceProps {
|
|
37
|
+
/** Parameters for web applications. */
|
|
38
|
+
web?: {
|
|
39
|
+
/**
|
|
40
|
+
* If defined, lists events to send to the backend (with "*" meaning all).
|
|
41
|
+
* If undefined, all events will be sent.
|
|
42
|
+
*/
|
|
43
|
+
send?: Array<string | typeof SEND_ALL>;
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
/** An event broker for the DataService. */
|
|
47
|
+
export interface IEventBroker {
|
|
48
|
+
/** Stops dispatching messages. */
|
|
49
|
+
destroy(): void;
|
|
50
|
+
}
|
package/dist/globals.d.ts
CHANGED
|
@@ -25,11 +25,13 @@ export declare const APP: {
|
|
|
25
25
|
readonly TIMELINE: "timeline";
|
|
26
26
|
readonly WORKSPACE: "workspace";
|
|
27
27
|
readonly EXPLORER: "explorer";
|
|
28
|
+
readonly HOMEWORKS: "homeworks";
|
|
28
29
|
readonly VIDEO: "video";
|
|
29
30
|
readonly MINDMAP: "mindmap";
|
|
30
31
|
readonly SCRAPBOOK: "scrapbook";
|
|
31
32
|
readonly COLLABORATIVEWALL: "collaborativewall";
|
|
32
33
|
readonly WIKI: "wiki";
|
|
34
|
+
readonly TIMELINEGENERATOR: "timelinegenerator";
|
|
33
35
|
};
|
|
34
36
|
export type App = (typeof APP)[keyof typeof APP] | string;
|
|
35
37
|
/**
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AddBundleCallback, IIdiom } from '../configure/interfaces';
|
|
2
|
+
export declare const defaultDiacriticsRemovalMap: {
|
|
3
|
+
base: string;
|
|
4
|
+
letters: RegExp;
|
|
5
|
+
}[];
|
|
6
|
+
export declare class Idiom implements IIdiom {
|
|
7
|
+
translate(key: string, params?: {
|
|
8
|
+
[param: string]: any;
|
|
9
|
+
}): string;
|
|
10
|
+
addBundlePromise(path: string): Promise<void>;
|
|
11
|
+
addBundle(path: string, callback?: AddBundleCallback): void;
|
|
12
|
+
loadBundlePromise(lang: string, path: string): Promise<void>;
|
|
13
|
+
private loadBundle;
|
|
14
|
+
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
15
|
+
addAllTranslations(folders: string[]): Promise<void>;
|
|
16
|
+
addKeys(keys: any): void;
|
|
17
|
+
removeAccents(str: string): string;
|
|
18
|
+
}
|
package/dist/idiom/Service.d.ts
CHANGED
|
@@ -1,4 +1,24 @@
|
|
|
1
|
+
import { App } from '../globals';
|
|
2
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
3
|
+
import { AddBundleCallback, IIdiom } from './interfaces';
|
|
1
4
|
export declare const defaultDiacriticsRemovalMap: {
|
|
2
5
|
base: string;
|
|
3
6
|
letters: RegExp;
|
|
4
7
|
}[];
|
|
8
|
+
export declare class IdiomService implements IIdiom {
|
|
9
|
+
private context;
|
|
10
|
+
constructor(context: IOdeServices);
|
|
11
|
+
private get http();
|
|
12
|
+
getIdiom(currentLanguage: string, app: App): Promise<any>;
|
|
13
|
+
translate(key: string, params?: {
|
|
14
|
+
[param: string]: any;
|
|
15
|
+
}): string;
|
|
16
|
+
addBundlePromise(currentLanguage: string, path: string): Promise<void>;
|
|
17
|
+
addBundle(currentLanguage: string, path: string, callback?: AddBundleCallback): void;
|
|
18
|
+
loadBundlePromise(currentLanguage: string, path: string): Promise<void>;
|
|
19
|
+
private loadBundle;
|
|
20
|
+
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
21
|
+
addAllTranslations(folders: string[]): Promise<void>;
|
|
22
|
+
addKeys(keys: any): void;
|
|
23
|
+
removeAccents(str: string): string;
|
|
24
|
+
}
|