ode-ts-client 1.1.4 → 1.2.0
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/agents/blog.agent.d.ts +2 -0
- package/dist/agents/folder.agent.d.ts +2 -0
- package/dist/agents/index.d.ts +4 -0
- package/dist/analytics/Service.d.ts +17 -0
- package/dist/{ts/apps → apps}/timeline/Framework.d.ts +0 -1
- package/dist/{ts/apps → apps}/timeline/Notification.model.d.ts +0 -1
- package/dist/{ts/apps → apps}/timeline/interfaces.d.ts +0 -1
- package/dist/cache/Service.d.ts +14 -0
- package/dist/configure/Analytics.d.ts +40 -0
- package/dist/{ts/configure → configure}/AppConf.d.ts +3 -1
- package/dist/{ts/configure → configure}/Framework.d.ts +1 -2
- package/dist/configure/Service.d.ts +17 -0
- package/dist/{ts/configure → configure}/Theme.d.ts +0 -1
- package/dist/{ts/configure → configure}/User.d.ts +0 -1
- package/dist/{ts/configure → configure}/interfaces.d.ts +24 -5
- package/dist/directory/Service.d.ts +17 -0
- package/dist/directory/interface.d.ts +53 -0
- package/dist/{ts/explore → explore}/Agent.d.ts +0 -1
- package/dist/{ts/explore → explore}/AgentLoader.d.ts +0 -2
- package/dist/{ts/explore → explore}/Bus.d.ts +0 -1
- package/dist/{ts/explore → explore}/Context.d.ts +3 -2
- package/dist/{ts/explore → explore}/Framework.d.ts +2 -2
- package/dist/{ts/explore → explore}/interfaces.d.ts +107 -28
- package/dist/{ts/globals.d.ts → globals.d.ts} +3 -3
- package/dist/{ts/configure → idiom}/Idiom.d.ts +6 -3
- package/dist/idiom/Service.d.ts +24 -0
- package/dist/idiom/interfaces.d.ts +22 -0
- package/dist/index.cjs.d.ts +1 -0
- package/dist/index.d.ts +10 -0
- package/dist/legacy/Behaviours.d.ts +35 -0
- package/dist/legacy/entcore.d.ts +7 -0
- package/dist/legacy/http.d.ts +24 -0
- package/dist/legacy/me.d.ts +12 -0
- package/dist/legacy/rights.d.ts +55 -0
- package/dist/{ts/notify → notify}/Framework.d.ts +0 -1
- package/dist/{ts/notify → notify}/interfaces.d.ts +2 -3
- package/dist/ode-ts-client.js +16 -15
- package/dist/ode-ts-client.js.map +1 -1
- package/dist/ode-ts-client.mjs +7821 -0
- package/dist/ode-ts-client.mjs.map +1 -0
- package/dist/resources/BlogResourceService.d.ts +11 -0
- package/dist/resources/ResourceService.d.ts +55 -0
- package/dist/resources/interface.d.ts +26 -0
- package/dist/rights/Service.d.ts +78 -0
- package/dist/rights/interface.d.ts +16 -0
- package/dist/services/OdeServices.d.ts +48 -0
- package/dist/services/index.d.ts +7 -0
- package/dist/{ts/session → session}/Framework.d.ts +2 -1
- package/dist/session/Service.d.ts +32 -0
- package/dist/{ts/session → session}/Session.d.ts +5 -3
- package/dist/{ts/session → session}/interfaces.d.ts +32 -4
- package/dist/share/Service.d.ts +18 -0
- package/dist/share/interface.d.ts +99 -0
- package/dist/{ts/transport → transport}/Framework.d.ts +0 -1
- package/dist/{ts/transport → transport}/Http.d.ts +0 -1
- package/dist/transport/Service.d.ts +25 -0
- package/dist/{ts/transport → transport}/interfaces.d.ts +3 -1
- package/dist/utils/FileTypeUtils.d.ts +6 -0
- package/dist/utils/MimeTypeUtils.d.ts +20 -0
- package/dist/utils/StringUtils.d.ts +3 -0
- package/dist/version.txt +1 -1
- package/dist/{ts/widget → widget}/Framework.d.ts +0 -1
- package/dist/{ts/widget → widget}/LastInfos.widget.d.ts +0 -1
- package/dist/{ts/widget → widget}/interfaces.d.ts +1 -2
- package/dist/workspace/Service.d.ts +12 -0
- package/dist/workspace/interface.d.ts +48 -0
- package/package.json +43 -29
- package/dist/test/Foundation.spec.d.ts +0 -2
- package/dist/test/Foundation.spec.d.ts.map +0 -1
- package/dist/test/mocks/agents/MockedAgentLoader.d.ts +0 -9
- package/dist/test/mocks/agents/MockedAgentLoader.d.ts.map +0 -1
- package/dist/test/mocks/agents/MockedFolderAgent.d.ts +0 -15
- package/dist/test/mocks/agents/MockedFolderAgent.d.ts.map +0 -1
- package/dist/ts/apps/timeline/Framework.d.ts.map +0 -1
- package/dist/ts/apps/timeline/Notification.model.d.ts.map +0 -1
- package/dist/ts/apps/timeline/interfaces.d.ts.map +0 -1
- package/dist/ts/configure/Analytics.d.ts +0 -19
- package/dist/ts/configure/Analytics.d.ts.map +0 -1
- package/dist/ts/configure/AppConf.d.ts.map +0 -1
- package/dist/ts/configure/Framework.d.ts.map +0 -1
- package/dist/ts/configure/Idiom.d.ts.map +0 -1
- package/dist/ts/configure/Theme.d.ts.map +0 -1
- package/dist/ts/configure/User.d.ts.map +0 -1
- package/dist/ts/configure/interfaces.d.ts.map +0 -1
- package/dist/ts/explore/Agent.d.ts.map +0 -1
- package/dist/ts/explore/AgentLoader.d.ts.map +0 -1
- package/dist/ts/explore/Bus.d.ts.map +0 -1
- package/dist/ts/explore/Context.d.ts.map +0 -1
- package/dist/ts/explore/Framework.d.ts.map +0 -1
- package/dist/ts/explore/interfaces.d.ts.map +0 -1
- package/dist/ts/globals.d.ts.map +0 -1
- package/dist/ts/index.d.ts +0 -12
- package/dist/ts/index.d.ts.map +0 -1
- package/dist/ts/notify/Framework.d.ts.map +0 -1
- package/dist/ts/notify/interfaces.d.ts.map +0 -1
- package/dist/ts/session/Framework.d.ts.map +0 -1
- package/dist/ts/session/Session.d.ts.map +0 -1
- package/dist/ts/session/interfaces.d.ts.map +0 -1
- package/dist/ts/transport/Framework.d.ts.map +0 -1
- package/dist/ts/transport/Http.d.ts.map +0 -1
- package/dist/ts/transport/interfaces.d.ts.map +0 -1
- package/dist/ts/widget/Framework.d.ts.map +0 -1
- package/dist/ts/widget/LastInfos.widget.d.ts.map +0 -1
- package/dist/ts/widget/interfaces.d.ts.map +0 -1
|
@@ -8,8 +8,9 @@ export declare const ERROR_CODE: {
|
|
|
8
8
|
readonly TRANSPORT_ERROR: "0060";
|
|
9
9
|
readonly TIME_OUT: "0070";
|
|
10
10
|
readonly MALFORMED_DATA: "0080";
|
|
11
|
+
readonly NOT_LOGGED_IN: "0090";
|
|
11
12
|
};
|
|
12
|
-
export declare type ErrorCode = typeof ERROR_CODE[keyof typeof ERROR_CODE];
|
|
13
|
+
export declare type ErrorCode = (typeof ERROR_CODE)[keyof typeof ERROR_CODE];
|
|
13
14
|
export declare const APP: {
|
|
14
15
|
readonly EXPLORER: "explorer";
|
|
15
16
|
readonly PORTAL: "portal";
|
|
@@ -19,7 +20,7 @@ export declare const APP: {
|
|
|
19
20
|
readonly CAS: "cas";
|
|
20
21
|
readonly VIDEO: "video";
|
|
21
22
|
};
|
|
22
|
-
export declare type App = typeof APP[keyof typeof APP];
|
|
23
|
+
export declare type App = (typeof APP)[keyof typeof APP];
|
|
23
24
|
export declare const USER_PREFS: {
|
|
24
25
|
readonly APPS: "apps";
|
|
25
26
|
readonly WIDGETS: "widgets";
|
|
@@ -29,4 +30,3 @@ export declare const USER_PREFS: {
|
|
|
29
30
|
readonly INFOTIP: "infotip";
|
|
30
31
|
readonly RGPD_COOKIES: "rgpdCookies";
|
|
31
32
|
};
|
|
32
|
-
//# sourceMappingURL=globals.d.ts.map
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import { AddBundleCallback, IIdiom } from "
|
|
1
|
+
import { AddBundleCallback, IIdiom } from "../configure/interfaces";
|
|
2
|
+
export declare const defaultDiacriticsRemovalMap: {
|
|
3
|
+
base: string;
|
|
4
|
+
letters: RegExp;
|
|
5
|
+
}[];
|
|
2
6
|
export declare class Idiom implements IIdiom {
|
|
3
7
|
translate(key: string, params?: {
|
|
4
8
|
[param: string]: any;
|
|
5
9
|
}): string;
|
|
6
10
|
addBundlePromise(path: string): Promise<void>;
|
|
7
11
|
addBundle(path: string, callback?: AddBundleCallback): void;
|
|
8
|
-
|
|
12
|
+
loadBundlePromise(lang: string, path: string): Promise<void>;
|
|
9
13
|
private loadBundle;
|
|
10
14
|
addTranslations(folder: string, callback?: AddBundleCallback): void;
|
|
11
15
|
addAllTranslations(folders: string[]): Promise<void>;
|
|
12
16
|
addKeys(keys: any): void;
|
|
13
17
|
removeAccents(str: string): string;
|
|
14
18
|
}
|
|
15
|
-
//# sourceMappingURL=Idiom.d.ts.map
|
|
@@ -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 declare 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
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./index";
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export * from "./globals";
|
|
2
|
+
export * from "./explore/interfaces";
|
|
3
|
+
export * from "./notify/interfaces";
|
|
4
|
+
export * as RxJS from "rxjs";
|
|
5
|
+
export * from "./transport/interfaces";
|
|
6
|
+
export * from "./configure/interfaces";
|
|
7
|
+
export * from "./session/interfaces";
|
|
8
|
+
export * from "./widget/interfaces";
|
|
9
|
+
export * from "./apps/timeline/interfaces";
|
|
10
|
+
export * from "./services";
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { Shareable } from "./rights";
|
|
2
|
+
|
|
3
|
+
export interface IBehavioursActions {
|
|
4
|
+
error(cb: Function): void;
|
|
5
|
+
}
|
|
6
|
+
export interface IBehavioursCopyRightsParams {
|
|
7
|
+
provider: { resource: Shareable; application: string };
|
|
8
|
+
target: { resources: Shareable[]; application: string };
|
|
9
|
+
}
|
|
10
|
+
export interface IBehavioursAppBehaviours {
|
|
11
|
+
model: any;
|
|
12
|
+
rights: { resource: any; workflow: any };
|
|
13
|
+
loadResources(): Promise<any>;
|
|
14
|
+
sniplets: any;
|
|
15
|
+
}
|
|
16
|
+
export declare interface IBehaviours {
|
|
17
|
+
storedRights: any;
|
|
18
|
+
sharingRights(): Promise<any>;
|
|
19
|
+
appSharingRights(prefix: string): Promise<any>;
|
|
20
|
+
copyRights(params: IBehavioursCopyRightsParams): Promise<void>;
|
|
21
|
+
register(application: string, appBehaviours: any): void;
|
|
22
|
+
findRights(
|
|
23
|
+
serviceName: string,
|
|
24
|
+
resource: IBehavioursAppBehaviours,
|
|
25
|
+
): Promise<any>;
|
|
26
|
+
// @deprecated findBehaviours(serviceName, resource): void;
|
|
27
|
+
loadBehaviours(
|
|
28
|
+
serviceName: string,
|
|
29
|
+
callback: (resource: IBehavioursAppBehaviours) => void,
|
|
30
|
+
): IBehavioursActions;
|
|
31
|
+
load(serviceName: string): Promise<any>;
|
|
32
|
+
findWorkflow(serviceName: string): Promise<any>;
|
|
33
|
+
workflowsFrom(obj: any, dependencies: any): {};
|
|
34
|
+
applicationsBehaviours: any;
|
|
35
|
+
}
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
export declare function Http(): void;
|
|
2
|
+
export declare var http: () => any;
|
|
3
|
+
export declare let toFormData: (obj) => string;
|
|
4
|
+
/**
|
|
5
|
+
* Promisified HTTP
|
|
6
|
+
*/
|
|
7
|
+
export declare type PromiseHttp<T> = Promise<T> & {
|
|
8
|
+
e400: (e) => void;
|
|
9
|
+
};
|
|
10
|
+
export declare class HttpPromisified<T> {
|
|
11
|
+
private inner;
|
|
12
|
+
constructor(inner?: any);
|
|
13
|
+
private promisify(req);
|
|
14
|
+
get(url: string, params?: any): PromiseHttp<T>;
|
|
15
|
+
post(url: string, params?: any): PromiseHttp<T>;
|
|
16
|
+
postFile(url: string, data: any, params?: any): PromiseHttp<T>;
|
|
17
|
+
postJson(url: string, json: any): PromiseHttp<T>;
|
|
18
|
+
put(url: string, data?: any): PromiseHttp<T>;
|
|
19
|
+
putJson(url: string, json: any): PromiseHttp<T>;
|
|
20
|
+
delete(url: string): PromiseHttp<T>;
|
|
21
|
+
deleteJson(url: string, json: any): PromiseHttp<T>;
|
|
22
|
+
putFile(url: string, data: FormData, opt?: any): PromiseHttp<T>;
|
|
23
|
+
}
|
|
24
|
+
export declare function httpPromisy<T>(inner?: any): HttpPromisified<T>;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
export declare class Me {
|
|
2
|
+
static preferences: any;
|
|
3
|
+
static loading: any[];
|
|
4
|
+
private static eventer;
|
|
5
|
+
static hasWorkflowRight(workflowName: string): Promise<boolean>;
|
|
6
|
+
static readonly session: any;
|
|
7
|
+
static savePreference(app: string): Promise<void>;
|
|
8
|
+
static preference(app: string): Promise<any>;
|
|
9
|
+
static revalidateTerms(): Promise<void>;
|
|
10
|
+
static shouldRevalidate(): Promise<{}>;
|
|
11
|
+
static onSessionReady(): Promise<{}>;
|
|
12
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
export interface Shareable {
|
|
2
|
+
shared: any;
|
|
3
|
+
owner: {
|
|
4
|
+
userId: string;
|
|
5
|
+
displayName: string;
|
|
6
|
+
};
|
|
7
|
+
myRights: any;
|
|
8
|
+
}
|
|
9
|
+
export interface ShareVisible {
|
|
10
|
+
id: string;
|
|
11
|
+
name: string;
|
|
12
|
+
groupDisplayName?: string;
|
|
13
|
+
structureName?: string;
|
|
14
|
+
actions?: any;
|
|
15
|
+
}
|
|
16
|
+
export interface ShareAction {
|
|
17
|
+
name: string[];
|
|
18
|
+
displayName: string;
|
|
19
|
+
type: string;
|
|
20
|
+
priority?: number;
|
|
21
|
+
requires?: any;
|
|
22
|
+
}
|
|
23
|
+
export interface ShareInfosDetail {
|
|
24
|
+
checked: {
|
|
25
|
+
[key: string]: string[];
|
|
26
|
+
};
|
|
27
|
+
checkedInherited: {
|
|
28
|
+
[key: string]: string[];
|
|
29
|
+
};
|
|
30
|
+
visibles: ShareVisible[];
|
|
31
|
+
}
|
|
32
|
+
export interface ShareInfos {
|
|
33
|
+
actions: ShareAction[];
|
|
34
|
+
groups: ShareInfosDetail;
|
|
35
|
+
users: ShareInfosDetail;
|
|
36
|
+
}
|
|
37
|
+
export interface SharePayload {
|
|
38
|
+
groups?: {
|
|
39
|
+
[key: string]: string[];
|
|
40
|
+
};
|
|
41
|
+
bookmarks?: {
|
|
42
|
+
[key: string]: string[];
|
|
43
|
+
};
|
|
44
|
+
users?: {
|
|
45
|
+
[key: string]: string[];
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
export declare class Rights<T extends Shareable> {
|
|
49
|
+
private resource;
|
|
50
|
+
constructor(resource: T);
|
|
51
|
+
myRights: any;
|
|
52
|
+
isOwner(): boolean;
|
|
53
|
+
fromBehaviours(prefix?: string): Promise<any>;
|
|
54
|
+
fromObject(obj: any, prefix: string): Promise<any>;
|
|
55
|
+
}
|
|
@@ -53,10 +53,9 @@ export declare const LAYER_NAME: {
|
|
|
53
53
|
readonly WIDGETS: "widgets";
|
|
54
54
|
readonly EXPLORER: "explorer";
|
|
55
55
|
};
|
|
56
|
-
export declare type LayerName = typeof LAYER_NAME[keyof typeof LAYER_NAME];
|
|
56
|
+
export declare type LayerName = (typeof LAYER_NAME)[keyof typeof LAYER_NAME];
|
|
57
57
|
export declare const EVENT_NAME: {
|
|
58
58
|
readonly USERPREF_CHANGED: "userprefChanged";
|
|
59
59
|
readonly SEARCH_RESULTED: "searchResulted";
|
|
60
60
|
};
|
|
61
|
-
export declare type EventName = typeof EVENT_NAME[keyof typeof EVENT_NAME];
|
|
62
|
-
//# sourceMappingURL=interfaces.d.ts.map
|
|
61
|
+
export declare type EventName = (typeof EVENT_NAME)[keyof typeof EVENT_NAME];
|