@edifice.io/client 1.7.4-develop-pedago.20241211160712
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/LICENSE +661 -0
- package/README.md +90 -0
- package/dist/analytics/Service.d.ts +17 -0
- 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/audience/ReactionsService.d.ts +22 -0
- package/dist/audience/Service.d.ts +13 -0
- package/dist/audience/ViewsService.d.ts +12 -0
- package/dist/audience/interface.d.ts +108 -0
- package/dist/cache/Service.d.ts +14 -0
- 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 +21 -0
- package/dist/configure/Theme.d.ts +34 -0
- package/dist/configure/User.d.ts +21 -0
- package/dist/configure/interfaces.d.ts +218 -0
- 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/directory/Service.d.ts +17 -0
- package/dist/directory/interface.d.ts +53 -0
- package/dist/embedder/Service.d.ts +39 -0
- package/dist/embedder/interface.d.ts +14 -0
- package/dist/globals.d.ts +52 -0
- package/dist/idiom/Idiom.d.ts +18 -0
- package/dist/idiom/Service.d.ts +24 -0
- package/dist/idiom/interfaces.d.ts +22 -0
- package/dist/index.cjs +6 -0
- package/dist/index.d.ts +13 -0
- package/dist/index.js +6192 -0
- package/dist/notify/Framework.d.ts +29 -0
- package/dist/notify/Subject.d.ts +9 -0
- package/dist/notify/interfaces.d.ts +113 -0
- package/dist/resources/ResourceService.d.ts +52 -0
- package/dist/resources/ServiceRegistry.d.ts +25 -0
- package/dist/resources/SnipletsService.d.ts +18 -0
- package/dist/resources/behaviours/AbstractBehaviourService.d.ts +34 -0
- package/dist/resources/behaviours/ActualitesBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/BlogBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/CollaborativewallBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/CommunityBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/ExercizerBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/FormulaireBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/ForumBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/HomeworksBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/MagnetoBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/MindmapBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/PagesBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/PollBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/ScrapbookBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/TimelinegeneratorBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/WikiBehaviour.d.ts +6 -0
- package/dist/resources/behaviours/WorkspaceBehaviour.d.ts +7 -0
- package/dist/resources/interface.d.ts +390 -0
- package/dist/resources/services/ScrapbookResourceService.d.ts +14 -0
- package/dist/rights/Service.d.ts +77 -0
- package/dist/rights/interface.d.ts +18 -0
- package/dist/services/OdeServices.d.ts +72 -0
- package/dist/services/index.d.ts +10 -0
- package/dist/session/Framework.d.ts +10 -0
- package/dist/session/Service.d.ts +39 -0
- package/dist/session/Session.d.ts +34 -0
- package/dist/session/interfaces.d.ts +268 -0
- package/dist/share/Service.d.ts +18 -0
- package/dist/share/interface.d.ts +104 -0
- package/dist/transport/Framework.d.ts +9 -0
- package/dist/transport/Http.d.ts +26 -0
- package/dist/transport/Service.d.ts +31 -0
- package/dist/transport/interfaces.d.ts +70 -0
- package/dist/utilities/DocumentHelper.d.ts +27 -0
- package/dist/utilities/StringUtils.d.ts +3 -0
- package/dist/utilities/index.d.ts +3 -0
- package/dist/utilities/isActionAvailable.d.ts +2 -0
- package/dist/video/Service.d.ts +21 -0
- package/dist/video/interface.d.ts +42 -0
- package/dist/widget/Framework.d.ts +31 -0
- package/dist/widget/LastInfos.widget.d.ts +15 -0
- package/dist/widget/interfaces.d.ts +53 -0
- package/dist/workspace/Service.d.ts +75 -0
- package/dist/workspace/interface.d.ts +67 -0
- package/package.json +53 -0
|
@@ -0,0 +1,218 @@
|
|
|
1
|
+
import { App, USER_PREFS } from '../globals';
|
|
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 School: {};
|
|
46
|
+
readonly User: {
|
|
47
|
+
/** User's preferences.*/
|
|
48
|
+
readonly preferences: IUserPreferences;
|
|
49
|
+
/** Legacy option (//FIXME which use ?).*/
|
|
50
|
+
readonly keepOpenOnLogout: boolean;
|
|
51
|
+
/** User's prefered apps. */
|
|
52
|
+
readonly bookmarkedApps: Array<IWebApp>;
|
|
53
|
+
/** Load the user's preferences for the given app. */
|
|
54
|
+
loadAppPrefs(app: App): Promise<any>;
|
|
55
|
+
/** Save the user's preferences for the given app. */
|
|
56
|
+
saveAppPrefs(app: App): Promise<void>;
|
|
57
|
+
loadLanguage(): Promise<string>;
|
|
58
|
+
saveLanguage(lang: string): Promise<void>;
|
|
59
|
+
};
|
|
60
|
+
}
|
|
61
|
+
export type AnalyticStatus = 'void' | 'pending' | 'ready' | 'failed';
|
|
62
|
+
export type TrackingType = 'matomo' | 'internal';
|
|
63
|
+
export interface ITrackingParams {
|
|
64
|
+
/** Whitelist of events to track, in the form "app" or "app.eventName" or "*.eventName". */
|
|
65
|
+
trackOnly: string[];
|
|
66
|
+
/** Blacklist of events not to track, in the form "app" or "app.eventName" or "*.eventName". */
|
|
67
|
+
doNotTrack: string[];
|
|
68
|
+
/** Set to true if state changes of the Single Page App need to be tracked. */
|
|
69
|
+
detailApps: boolean;
|
|
70
|
+
}
|
|
71
|
+
export interface IMatomoTrackingParams extends ITrackingParams {
|
|
72
|
+
url: string;
|
|
73
|
+
siteId: number;
|
|
74
|
+
UserId: string;
|
|
75
|
+
Profile: string;
|
|
76
|
+
School: string;
|
|
77
|
+
Project: string;
|
|
78
|
+
}
|
|
79
|
+
/** 2021 implementation of XiTi. */
|
|
80
|
+
export interface IXitiTrackingParams {
|
|
81
|
+
/** Which property of LIBELLE_SERVICE to use depends on the frontend. */
|
|
82
|
+
LIBELLE_SERVICE: {
|
|
83
|
+
default: string;
|
|
84
|
+
} & {
|
|
85
|
+
[prop: string]: string;
|
|
86
|
+
};
|
|
87
|
+
TYPE: string;
|
|
88
|
+
OUTIL: any;
|
|
89
|
+
STRUCT_ID: any;
|
|
90
|
+
STRUCT_UAI: string;
|
|
91
|
+
PROJET: any;
|
|
92
|
+
EXPLOITANT: any;
|
|
93
|
+
PLATFORME: any;
|
|
94
|
+
ID_PERSO: any;
|
|
95
|
+
PROFILE: any;
|
|
96
|
+
}
|
|
97
|
+
export interface ITheme {
|
|
98
|
+
/** (legacy) Name of the currently active skin (user's choice in /timeline) : "default" by default, or another available name. */
|
|
99
|
+
readonly skinName: string;
|
|
100
|
+
/** (legacy) Name of the currently active theme, derived from a parent which is classified as 1D (panda) or 2D(theme-open-ent). This is a domain-level configurated value. */
|
|
101
|
+
readonly themeName: string;
|
|
102
|
+
/** (legacy) FIXME Seems to be equal to themeName. */
|
|
103
|
+
readonly skin: string;
|
|
104
|
+
/** (legacy) URL to the currently active theme/skin folder. */
|
|
105
|
+
readonly themeUrl: string;
|
|
106
|
+
/** (legacy) URL to the currently active portal.html template. Used in infra-front. */
|
|
107
|
+
readonly portalTemplate: string;
|
|
108
|
+
/** (legacy) URL to the folder containing assets. */
|
|
109
|
+
readonly basePath: string;
|
|
110
|
+
/** (legacy) URL where the user is redirected after logout. */
|
|
111
|
+
readonly logoutCallback: string;
|
|
112
|
+
/** Available skins configuration (also called "overrides"). */
|
|
113
|
+
readonly skins: Array<IThemeConfOverriding>;
|
|
114
|
+
/** Check if the "school degree" of the current theme is 1D ("panda", or an override of it). */
|
|
115
|
+
readonly is1D: boolean;
|
|
116
|
+
/** Check if the "school degree" of the current theme is 2D ("theme-open-ent" or an override of it). */
|
|
117
|
+
readonly is2D: boolean;
|
|
118
|
+
/** Get the theme/skin configuration. */
|
|
119
|
+
getConf(version?: string): Promise<IThemeConf>;
|
|
120
|
+
/** Await for theme to be fully loaded (skin, overrides, degrees...). */
|
|
121
|
+
onFullyReady(): Promise<ITheme>;
|
|
122
|
+
/** Await for skin conf to be loaded. */
|
|
123
|
+
onSkinReady(): Promise<ITheme>;
|
|
124
|
+
/** Await for overrides conf to be loaded. */
|
|
125
|
+
onOverrideReady(): Promise<IThemeOverrides>;
|
|
126
|
+
/** List available themes. */
|
|
127
|
+
listThemes(): Promise<IThemeDesc[]>;
|
|
128
|
+
/** Configure UI with this theme by default. */
|
|
129
|
+
setDefaultTheme(theme: IThemeDesc): void;
|
|
130
|
+
/** List available skins. */
|
|
131
|
+
listSkins(): Promise<IThemeConfOverriding[]>;
|
|
132
|
+
/** Get the help path, which can be dedicated to 1D or 2D. */
|
|
133
|
+
getHelpPath(): Promise<String>;
|
|
134
|
+
}
|
|
135
|
+
export interface IThemeDesc {
|
|
136
|
+
_id: string;
|
|
137
|
+
displayName: string;
|
|
138
|
+
path: string;
|
|
139
|
+
}
|
|
140
|
+
export interface IThemeConf {
|
|
141
|
+
dependencies: {
|
|
142
|
+
themes: {
|
|
143
|
+
[name: string]: string;
|
|
144
|
+
};
|
|
145
|
+
widgets: {
|
|
146
|
+
[name: string]: string;
|
|
147
|
+
};
|
|
148
|
+
};
|
|
149
|
+
emitWrapper: boolean;
|
|
150
|
+
overriding: Array<IThemeConfOverriding>;
|
|
151
|
+
}
|
|
152
|
+
export interface IThemeConfOverriding {
|
|
153
|
+
parent: 'panda' | 'theme-open-ent';
|
|
154
|
+
child: string;
|
|
155
|
+
bootstrapVersion: string;
|
|
156
|
+
skins: Array<string>;
|
|
157
|
+
help: string;
|
|
158
|
+
group?: string;
|
|
159
|
+
edumedia: {
|
|
160
|
+
uri: string;
|
|
161
|
+
pattern: string;
|
|
162
|
+
ignoreSubjects?: Array<string>;
|
|
163
|
+
};
|
|
164
|
+
}
|
|
165
|
+
export type IThemeOverrides = {
|
|
166
|
+
[app in App]?: string;
|
|
167
|
+
};
|
|
168
|
+
export type AddBundleCallback = () => void | Promise<void>;
|
|
169
|
+
export interface IIdiom {
|
|
170
|
+
/** Get the translation of a given key.
|
|
171
|
+
* @param params (optional) map of key/value variables.
|
|
172
|
+
* @return the key itself when no translation exists.
|
|
173
|
+
*/
|
|
174
|
+
translate(key: string, params?: {
|
|
175
|
+
[param: string]: any;
|
|
176
|
+
}): string;
|
|
177
|
+
/** Load a language bundle then return a Promise. */
|
|
178
|
+
addBundlePromise(path: string): Promise<void>;
|
|
179
|
+
/** Load a language bundle then call an optional callback. */
|
|
180
|
+
addBundle(path: string, callback?: AddBundleCallback): void;
|
|
181
|
+
/** Load the JSON language file from a given folder, using the current user's language, then call an optional callback. */
|
|
182
|
+
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
183
|
+
/** Load the JSON language files from many given folders, using the current user's language, then return a Promise. */
|
|
184
|
+
addAllTranslations(folders: string[]): Promise<void>;
|
|
185
|
+
/** 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. */
|
|
186
|
+
addKeys(keys: any): void;
|
|
187
|
+
/** @return a new string without accentuation. */
|
|
188
|
+
removeAccents(str: string): string;
|
|
189
|
+
}
|
|
190
|
+
export type UserPreferenceKey = (typeof USER_PREFS)[keyof typeof USER_PREFS] | App;
|
|
191
|
+
export interface IUserPreferences {
|
|
192
|
+
data: {
|
|
193
|
+
[key in UserPreferenceKey]?: any;
|
|
194
|
+
};
|
|
195
|
+
get(key: UserPreferenceKey): any;
|
|
196
|
+
load(key: UserPreferenceKey, defaultTo?: any): Promise<any>;
|
|
197
|
+
update(key: UserPreferenceKey, data: any): IUserPreferences;
|
|
198
|
+
save(key: UserPreferenceKey): Promise<void>;
|
|
199
|
+
}
|
|
200
|
+
export interface IOdeTheme {
|
|
201
|
+
basePath: string;
|
|
202
|
+
bootstrapVersion: string;
|
|
203
|
+
is1d: boolean;
|
|
204
|
+
logoutCallback: string;
|
|
205
|
+
skin: string;
|
|
206
|
+
skinName: string;
|
|
207
|
+
skins: Array<IThemeConfOverriding>;
|
|
208
|
+
themeName: string;
|
|
209
|
+
themeUrl: string;
|
|
210
|
+
npmTheme: string | undefined;
|
|
211
|
+
}
|
|
212
|
+
export interface IGetConf {
|
|
213
|
+
app: App;
|
|
214
|
+
applications: IWebApp[];
|
|
215
|
+
conf: IThemeConf;
|
|
216
|
+
currentApp: IWebApp | undefined;
|
|
217
|
+
theme: IOdeTheme;
|
|
218
|
+
}
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
2
|
+
import { Bookmark, BookmarkWithDetails, BookmarkWithMembers, Group, User } from './interface';
|
|
3
|
+
export declare class DirectoryService {
|
|
4
|
+
private odeServices;
|
|
5
|
+
constructor(odeServices: IOdeServices);
|
|
6
|
+
private get http();
|
|
7
|
+
private get cache();
|
|
8
|
+
getAvatarUrl(id: string, type: 'user' | 'group', size?: string): string;
|
|
9
|
+
getDirectoryUrl(id: string, type: 'user' | 'group'): string;
|
|
10
|
+
getBookMarks(): Promise<Bookmark[]>;
|
|
11
|
+
getBookMarkById(idBookmark: string): Promise<BookmarkWithDetails>;
|
|
12
|
+
saveBookmarks(name: string, { bookmarks, groups, users, }: {
|
|
13
|
+
users: string[] | User[];
|
|
14
|
+
groups: string[] | Group[];
|
|
15
|
+
bookmarks: BookmarkWithMembers[] | string[];
|
|
16
|
+
}): Promise<BookmarkWithMembers>;
|
|
17
|
+
}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Selected User when using directory routes
|
|
3
|
+
*/
|
|
4
|
+
export interface User {
|
|
5
|
+
id: string;
|
|
6
|
+
displayName: string;
|
|
7
|
+
profile: string;
|
|
8
|
+
lastName: string;
|
|
9
|
+
firstName: string;
|
|
10
|
+
login: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Group {
|
|
13
|
+
id: string;
|
|
14
|
+
displayName: string;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Id and Name of Bookmark
|
|
18
|
+
*/
|
|
19
|
+
export interface Bookmark {
|
|
20
|
+
id: string;
|
|
21
|
+
displayName: string;
|
|
22
|
+
}
|
|
23
|
+
export interface BookmarkWithMembers extends Bookmark {
|
|
24
|
+
members: string[];
|
|
25
|
+
}
|
|
26
|
+
export interface BookmarkWithDetails extends Bookmark {
|
|
27
|
+
users: User[];
|
|
28
|
+
groups: Group[];
|
|
29
|
+
}
|
|
30
|
+
export interface BookmarkSaveResponse {
|
|
31
|
+
id: string;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Payload when getting bookamark info
|
|
35
|
+
*/
|
|
36
|
+
export interface BookmarkGetResponse {
|
|
37
|
+
id: string;
|
|
38
|
+
name: string;
|
|
39
|
+
groups: Array<{
|
|
40
|
+
id: string;
|
|
41
|
+
name: string;
|
|
42
|
+
activationCode: boolean;
|
|
43
|
+
groupType: string;
|
|
44
|
+
profile: string;
|
|
45
|
+
sortName: string;
|
|
46
|
+
}>;
|
|
47
|
+
users: Array<{
|
|
48
|
+
displayName: string;
|
|
49
|
+
profile: string;
|
|
50
|
+
id: string;
|
|
51
|
+
activationCode: boolean;
|
|
52
|
+
}>;
|
|
53
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
2
|
+
import { Embedder } from './interface';
|
|
3
|
+
export declare class EmbedderService {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: IOdeServices);
|
|
6
|
+
private get http();
|
|
7
|
+
/**
|
|
8
|
+
* Returns the default list of video embedder
|
|
9
|
+
* @returns the default list of video embedder
|
|
10
|
+
*/
|
|
11
|
+
getDefault(): Promise<Embedder[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Returns the custom list of video embedder
|
|
14
|
+
* @returns the custom list of video embedder
|
|
15
|
+
*/
|
|
16
|
+
getCustom(): Promise<Embedder[]>;
|
|
17
|
+
/**
|
|
18
|
+
* The provider matching with the URL
|
|
19
|
+
* @param {Embedder[]} embedderList - The list of video providers to test with
|
|
20
|
+
* @param {String} url - The URL for the video
|
|
21
|
+
* @returns The provider matching with the URL or undefined
|
|
22
|
+
*/
|
|
23
|
+
getProviderFromUrl(embedderList: Embedder[], url: string): Embedder | undefined;
|
|
24
|
+
private urlIsFromPattern;
|
|
25
|
+
/**
|
|
26
|
+
* Check if a given URL correspond to one of the URL pattern of the provider
|
|
27
|
+
* @param {String} url - The URL for the video
|
|
28
|
+
* @param {Embedder} embedder - The video provider to test with
|
|
29
|
+
* @returns boolean depending if a given URL correspond to one of the URL pattern of the provider
|
|
30
|
+
*/
|
|
31
|
+
private isUrlFromProvider;
|
|
32
|
+
/**
|
|
33
|
+
* Get embed code to display the video for an URL and a provider
|
|
34
|
+
* @param {Embedder} embedder - The video provider for the URL
|
|
35
|
+
* @param {String} url - The URL for the video
|
|
36
|
+
* @returns embed code to display the video for an URL and a provider
|
|
37
|
+
*/
|
|
38
|
+
getEmbedCodeForProvider(embedder: Embedder, url: string): string;
|
|
39
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export type Embedder = {
|
|
2
|
+
/** Embedder name */
|
|
3
|
+
name: string;
|
|
4
|
+
/** Embedder display name */
|
|
5
|
+
displayName: string;
|
|
6
|
+
/** Embedder list of url */
|
|
7
|
+
url: string[];
|
|
8
|
+
/** Embedder logo */
|
|
9
|
+
logo: string;
|
|
10
|
+
/** Embedder embed */
|
|
11
|
+
embed: string;
|
|
12
|
+
/** Embedder example */
|
|
13
|
+
example: string;
|
|
14
|
+
};
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
export declare const ERROR_CODE: {
|
|
2
|
+
readonly SUCCESS: "0000";
|
|
3
|
+
readonly UNKNOWN: "0010";
|
|
4
|
+
readonly NOT_INITIALIZED: "0020";
|
|
5
|
+
readonly NOT_SUPPORTED: "0030";
|
|
6
|
+
readonly APP_NOT_FOUND: "0040";
|
|
7
|
+
readonly AGENT_NOT_FOUND: "0050";
|
|
8
|
+
readonly TRANSPORT_ERROR: "0060";
|
|
9
|
+
readonly TIME_OUT: "0070";
|
|
10
|
+
readonly MALFORMED_DATA: "0080";
|
|
11
|
+
readonly NOT_LOGGED_IN: "0090";
|
|
12
|
+
};
|
|
13
|
+
export type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
|
|
14
|
+
export declare const APP: {
|
|
15
|
+
readonly ADMIN: "admin";
|
|
16
|
+
readonly ARCHIVE: "archive";
|
|
17
|
+
readonly AUTH: "auth";
|
|
18
|
+
readonly CAS: "cas";
|
|
19
|
+
readonly COMMUNICATION: "communication";
|
|
20
|
+
readonly CONVERSATION: "conversation";
|
|
21
|
+
readonly DIRECTORY: "directory";
|
|
22
|
+
readonly USERBOOK: "userbook";
|
|
23
|
+
readonly INFRA: "infra";
|
|
24
|
+
readonly PORTAL: "portal";
|
|
25
|
+
readonly TIMELINE: "timeline";
|
|
26
|
+
readonly WORKSPACE: "workspace";
|
|
27
|
+
readonly EXPLORER: "explorer";
|
|
28
|
+
readonly VIDEO: "video";
|
|
29
|
+
readonly MINDMAP: "mindmap";
|
|
30
|
+
readonly SCRAPBOOK: "scrapbook";
|
|
31
|
+
readonly COLLABORATIVEWALL: "collaborativewall";
|
|
32
|
+
readonly WIKI: "wiki";
|
|
33
|
+
};
|
|
34
|
+
export type App = (typeof APP)[keyof typeof APP] | string;
|
|
35
|
+
/**
|
|
36
|
+
* An ID is a unique string in its applicable field.
|
|
37
|
+
*/
|
|
38
|
+
export type ID = string;
|
|
39
|
+
/**
|
|
40
|
+
* Type of resource generated by an application.
|
|
41
|
+
* For example "folder", "blog", "mindmap"...
|
|
42
|
+
*/
|
|
43
|
+
export type ResourceType = string;
|
|
44
|
+
export declare const USER_PREFS: {
|
|
45
|
+
readonly APPS: "apps";
|
|
46
|
+
readonly WIDGETS: "widgets";
|
|
47
|
+
readonly LANGUAGE: "language";
|
|
48
|
+
readonly AUTH_CONNECTOR_ACCESSED: "authenticatedConnectorsAccessed";
|
|
49
|
+
readonly CURSUS: "cursus";
|
|
50
|
+
readonly INFOTIP: "infotip";
|
|
51
|
+
readonly RGPD_COOKIES: "rgpdCookies";
|
|
52
|
+
};
|
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { AddBundleCallback, IIdiom } from './interfaces';
|
|
2
|
+
import { IOdeServices } from '../services/OdeServices';
|
|
3
|
+
import { App } from '../globals';
|
|
4
|
+
export declare const defaultDiacriticsRemovalMap: {
|
|
5
|
+
base: string;
|
|
6
|
+
letters: RegExp;
|
|
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
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export type AddBundleCallback = () => void | Promise<void>;
|
|
2
|
+
export interface IIdiom {
|
|
3
|
+
/** Get the translation of a given key.
|
|
4
|
+
* @param params (optional) map of key/value variables.
|
|
5
|
+
* @return the key itself when no translation exists.
|
|
6
|
+
*/
|
|
7
|
+
translate(key: string, params?: {
|
|
8
|
+
[param: string]: any;
|
|
9
|
+
}): string;
|
|
10
|
+
/** Load a language bundle then return a Promise. */
|
|
11
|
+
addBundlePromise(currentLanguage: string, path: string): Promise<void>;
|
|
12
|
+
/** Load a language bundle then call an optional callback. */
|
|
13
|
+
addBundle(currentLanguage: string, path: string, callback?: AddBundleCallback): void;
|
|
14
|
+
/** Load the JSON language file from a given folder, using the current user's language, then call an optional callback. */
|
|
15
|
+
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
16
|
+
/** Load the JSON language files from many given folders, using the current user's language, then return a Promise. */
|
|
17
|
+
addAllTranslations(folders: string[]): Promise<void>;
|
|
18
|
+
/** 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. */
|
|
19
|
+
addKeys(keys: any): void;
|
|
20
|
+
/** @return a new string without accentuation. */
|
|
21
|
+
removeAccents(str: string): string;
|
|
22
|
+
}
|