ode-ts-client 1.1.4 → 1.2.0-dev-integration.202401121221
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 +7824 -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 +2 -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
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IWebApp } from "../index.cjs";
|
|
2
|
+
import { IOdeServices } from "../services/OdeServices";
|
|
3
|
+
export declare class AnalyticsService {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: IOdeServices);
|
|
6
|
+
private get http();
|
|
7
|
+
private get session();
|
|
8
|
+
/**
|
|
9
|
+
* Xiti tracker for page loading.
|
|
10
|
+
* @param locationPath
|
|
11
|
+
* @param app
|
|
12
|
+
*/
|
|
13
|
+
trackPageLoad(locationPath: string, app: IWebApp): Promise<void>;
|
|
14
|
+
private getXitiConfig;
|
|
15
|
+
private loadXitiScript;
|
|
16
|
+
private getXitiTrackingParams;
|
|
17
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { IHttpParams, IHttpResponse } from "../transport/interfaces";
|
|
2
|
+
import { OdeServices } from "../services/OdeServices";
|
|
3
|
+
export declare class CacheService {
|
|
4
|
+
private context;
|
|
5
|
+
constructor(context: OdeServices);
|
|
6
|
+
private get http();
|
|
7
|
+
private fromCacheIfPossible;
|
|
8
|
+
clearCache(key?: string): void;
|
|
9
|
+
httpGet<R = any>(url: string, params?: IHttpParams): Promise<{
|
|
10
|
+
value: R;
|
|
11
|
+
response: IHttpResponse;
|
|
12
|
+
}>;
|
|
13
|
+
httpGetJson<R = any>(url: string, params?: IHttpParams): Promise<R>;
|
|
14
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { AnalyticStatus, IXitiTrackingParams, IMatomoTrackingParams, ITrackingParams, TrackingType } from "./interfaces";
|
|
2
|
+
export declare type ParamsByTrackingSystem = {
|
|
3
|
+
type: "none" | "internal" | "matomo" | "multiple";
|
|
4
|
+
internal?: ITrackingParams;
|
|
5
|
+
matomo?: IMatomoTrackingParams;
|
|
6
|
+
xiti?: IXitiTrackingParams;
|
|
7
|
+
};
|
|
8
|
+
export declare 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
|
+
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { App } from "../globals";
|
|
2
|
+
import { IWebApp } from "../index.cjs";
|
|
2
3
|
export declare class AppConf {
|
|
3
4
|
private _publicConf;
|
|
4
5
|
private _currentApp?;
|
|
6
|
+
private _appConf;
|
|
5
7
|
/**
|
|
6
8
|
* Get the currently initialized App.
|
|
7
9
|
* @see getter SessionFramework.currentApp
|
|
@@ -10,6 +12,6 @@ export declare class AppConf {
|
|
|
10
12
|
setCurrentApp(app: App): AppConf;
|
|
11
13
|
initialize(app: App, alternativeApp?: boolean): Promise<void>;
|
|
12
14
|
getPublicConf(app: App): Promise<any>;
|
|
15
|
+
getWebAppConf(app: App): Promise<IWebApp | undefined>;
|
|
13
16
|
loadI18n(app: App): Promise<void>;
|
|
14
17
|
}
|
|
15
|
-
//# sourceMappingURL=AppConf.d.ts.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IConfigurationFramework } from "./interfaces";
|
|
2
2
|
import { Theme } from "./Theme";
|
|
3
|
-
import { Idiom } from "
|
|
3
|
+
import { Idiom } from "../idiom/Idiom";
|
|
4
4
|
import { User } from "./User";
|
|
5
5
|
import { AppConf } from "./AppConf";
|
|
6
6
|
import { Analytics } from "./Analytics";
|
|
@@ -20,4 +20,3 @@ export declare class ConfigurationFramework implements IConfigurationFramework {
|
|
|
20
20
|
}
|
|
21
21
|
/** The whole framework is a singleton. */
|
|
22
22
|
export declare const configure: ConfigurationFramework;
|
|
23
|
-
//# sourceMappingURL=Framework.d.ts.map
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { IGetConf } from "./interfaces";
|
|
2
|
+
import { App } from "../globals";
|
|
3
|
+
import { IOdeServices } from "../services/OdeServices";
|
|
4
|
+
export declare class ConfService {
|
|
5
|
+
private context;
|
|
6
|
+
constructor(context: IOdeServices);
|
|
7
|
+
private get http();
|
|
8
|
+
private get cdnDomain();
|
|
9
|
+
getConf(app: App): Promise<IGetConf>;
|
|
10
|
+
getCdnUrl(): string | undefined;
|
|
11
|
+
savePreference<T>(key: string, value: T): Promise<void>;
|
|
12
|
+
getPreference<T>(key: string): Promise<T>;
|
|
13
|
+
private getThemeConf;
|
|
14
|
+
private getApplicationsList;
|
|
15
|
+
private getWebAppConf;
|
|
16
|
+
private getTheme;
|
|
17
|
+
}
|
|
@@ -18,6 +18,8 @@ export interface IConfigurationFramework {
|
|
|
18
18
|
initialize(app: App, alternativeApp?: boolean): Promise<void>;
|
|
19
19
|
/** Load and return the public conf of an app. */
|
|
20
20
|
getPublicConf(app: App): Promise<any>;
|
|
21
|
+
/** Load and return the server conf of an app. */
|
|
22
|
+
getWebAppConf(app: App): Promise<IWebApp | undefined>;
|
|
21
23
|
/** Load the i18n of an app. */
|
|
22
24
|
loadI18n(app: App): Promise<void>;
|
|
23
25
|
};
|
|
@@ -78,7 +80,7 @@ export interface IMatomoTrackingParams extends ITrackingParams {
|
|
|
78
80
|
export interface IXitiTrackingParams {
|
|
79
81
|
/** Which property of LIBELLE_SERVICE to use depends on the frontend. */
|
|
80
82
|
LIBELLE_SERVICE: {
|
|
81
|
-
|
|
83
|
+
default: string;
|
|
82
84
|
} & {
|
|
83
85
|
[prop: string]: string;
|
|
84
86
|
};
|
|
@@ -167,8 +169,6 @@ export declare type AddBundleCallback = () => void | Promise<void>;
|
|
|
167
169
|
export interface IIdiom {
|
|
168
170
|
/** Get the translation of a given key.
|
|
169
171
|
* @param params (optional) map of key/value variables.
|
|
170
|
-
* Ex: Given "variabilized.i18n.key"="Limit to ${limit} bytes"
|
|
171
|
-
* translate('variabilized.i18n.key', {limit:50}) will return "Limit to 50 bytes".
|
|
172
172
|
* @return the key itself when no translation exists.
|
|
173
173
|
*/
|
|
174
174
|
translate(key: string, params?: {
|
|
@@ -187,7 +187,7 @@ export interface IIdiom {
|
|
|
187
187
|
/** @return a new string without accentuation. */
|
|
188
188
|
removeAccents(str: string): string;
|
|
189
189
|
}
|
|
190
|
-
export declare type UserPreferenceKey = typeof USER_PREFS[keyof typeof USER_PREFS] | App;
|
|
190
|
+
export declare type UserPreferenceKey = (typeof USER_PREFS)[keyof typeof USER_PREFS] | App;
|
|
191
191
|
export interface IUserPreferences {
|
|
192
192
|
data: {
|
|
193
193
|
[key in UserPreferenceKey]?: any;
|
|
@@ -197,4 +197,23 @@ export interface IUserPreferences {
|
|
|
197
197
|
update(key: UserPreferenceKey, data: any): IUserPreferences;
|
|
198
198
|
save(key: UserPreferenceKey): Promise<void>;
|
|
199
199
|
}
|
|
200
|
-
|
|
200
|
+
export interface IOdeTheme {
|
|
201
|
+
basePath: string;
|
|
202
|
+
bootstrap: string;
|
|
203
|
+
bootstrapPath: string;
|
|
204
|
+
bootstrapUrl: string;
|
|
205
|
+
bootstrapVersion: string;
|
|
206
|
+
is1d: boolean;
|
|
207
|
+
logoutCallback: string;
|
|
208
|
+
skin: string;
|
|
209
|
+
skinName: string;
|
|
210
|
+
skins: Array<IThemeConfOverriding>;
|
|
211
|
+
themeName: string;
|
|
212
|
+
themeUrl: string;
|
|
213
|
+
}
|
|
214
|
+
export interface IGetConf {
|
|
215
|
+
applications: IWebApp[];
|
|
216
|
+
conf: IThemeConf;
|
|
217
|
+
currentApp: IWebApp | undefined;
|
|
218
|
+
theme: IOdeTheme;
|
|
219
|
+
}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { OdeServices } from "../services/OdeServices";
|
|
2
|
+
import { Bookmark, BookmarkWithDetails, BookmarkWithMembers, Group, User } from "./interface";
|
|
3
|
+
export declare class DirectoryService {
|
|
4
|
+
private odeServices;
|
|
5
|
+
constructor(odeServices: OdeServices);
|
|
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
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { App } from "../globals";
|
|
3
|
-
import { IContext, IExplorerContext, ISearchParameters, ResourceType, GetResourcesResult, GetSubFoldersResult, CreateFolderResult, UpdateFolderResult, ID, ISearchResults, IResource, ManagePropertiesResult, UpdatePropertiesResult, PropKeyType } from "./interfaces";
|
|
3
|
+
import { IContext, IExplorerContext, ISearchParameters, ResourceType, GetResourcesResult, GetSubFoldersResult, CreateFolderResult, UpdateFolderResult, ID, ISearchResults, IResource, ManagePropertiesResult, UpdatePropertiesResult, PropKeyType, PublishParameters, PublishResult } from "./interfaces";
|
|
4
4
|
export declare class ExplorerContext implements IExplorerContext {
|
|
5
5
|
private searchParameters;
|
|
6
6
|
private context;
|
|
@@ -24,9 +24,10 @@ export declare class ExplorerContext implements IExplorerContext {
|
|
|
24
24
|
copy(targetId: string, resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
25
25
|
move(targetId: string, resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
26
26
|
delete(resourceIds: string[], folderIds: string[]): Promise<void>;
|
|
27
|
+
trash(trash: boolean, resourceIds: string[], folderIds: string[]): Promise<void>;
|
|
27
28
|
manageProperties(resourceType: ResourceType, resources: IResource[]): Promise<ManagePropertiesResult>;
|
|
28
29
|
updateProperties(resourceType: ResourceType, resources: IResource[], props: {
|
|
29
30
|
[key in PropKeyType]?: string;
|
|
30
31
|
}): Promise<UpdatePropertiesResult>;
|
|
32
|
+
publish(resourceType: ResourceType, parameters: PublishParameters): Promise<PublishResult>;
|
|
31
33
|
}
|
|
32
|
-
//# sourceMappingURL=Context.d.ts.map
|
|
@@ -3,7 +3,8 @@ import { App } from "../globals";
|
|
|
3
3
|
import { IAgentLoader } from "./AgentLoader";
|
|
4
4
|
import { ActionType, IBus, IExplorerContext, IExplorerFramework, ResourceType } from "./interfaces";
|
|
5
5
|
export declare class ExplorerFramework implements IExplorerFramework {
|
|
6
|
-
private
|
|
6
|
+
private _agentLoader?;
|
|
7
|
+
get agentLoader(): IAgentLoader;
|
|
7
8
|
setAgentLoader(loader: IAgentLoader): void;
|
|
8
9
|
/** Load the agent dedicated to resolve this @param action on this @param resource */
|
|
9
10
|
requestAgentFor(resource: ResourceType, action: ActionType): Promise<IBusAgent>;
|
|
@@ -12,4 +13,3 @@ export declare class ExplorerFramework implements IExplorerFramework {
|
|
|
12
13
|
}
|
|
13
14
|
/** The whole framework is a singleton. */
|
|
14
15
|
export declare const explorer: IExplorerFramework;
|
|
15
|
-
//# sourceMappingURL=Framework.d.ts.map
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { Observable } from "rxjs";
|
|
2
2
|
import { App } from "../globals";
|
|
3
|
+
import { RightRole } from "../services";
|
|
3
4
|
export declare abstract class ExplorerFrameworkFactory {
|
|
4
5
|
static instance(): IExplorerFramework;
|
|
5
6
|
}
|
|
@@ -94,19 +95,28 @@ export interface IExplorerContext {
|
|
|
94
95
|
* @param folderIds Array of folders ID to delete.
|
|
95
96
|
*/
|
|
96
97
|
delete(resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
98
|
+
/**
|
|
99
|
+
* Trash / Untrash resources and folders.
|
|
100
|
+
* @param trash boolean set status trash or untrash
|
|
101
|
+
* @param resourceIds Array of resources ID to delete.
|
|
102
|
+
* @param folderIds Array of folders ID to delete.
|
|
103
|
+
*/
|
|
104
|
+
trash(trash: boolean, resourceIds: ID[], folderIds: ID[]): Promise<void>;
|
|
97
105
|
/** Retrieves which properties of the resource(s) are manageable. */
|
|
98
106
|
manageProperties(resourceType: ResourceType, resources: IResource[]): Promise<ManagePropertiesResult>;
|
|
99
107
|
/** Update managed properties. */
|
|
100
108
|
updateProperties(resourceType: ResourceType, resources: IResource[], props: {
|
|
101
109
|
[key in PropKeyType]?: string;
|
|
102
110
|
}): Promise<UpdatePropertiesResult>;
|
|
111
|
+
/** Publish to Library */
|
|
112
|
+
publish(resourceType: ResourceType, parameters: PublishParameters): Promise<PublishResult>;
|
|
103
113
|
}
|
|
104
114
|
export declare const RESOURCE: {
|
|
105
115
|
readonly FOLDER: "folder";
|
|
106
116
|
readonly BLOG: "blog";
|
|
107
117
|
readonly EXERCISE: "exercise";
|
|
108
118
|
};
|
|
109
|
-
export declare type ResourceType = typeof RESOURCE[keyof typeof RESOURCE];
|
|
119
|
+
export declare type ResourceType = (typeof RESOURCE)[keyof typeof RESOURCE];
|
|
110
120
|
export declare const appNameForResource: {
|
|
111
121
|
[R in ResourceType]: App;
|
|
112
122
|
};
|
|
@@ -119,39 +129,47 @@ export declare const ACTION: {
|
|
|
119
129
|
readonly UPD_PROPS: "properties";
|
|
120
130
|
readonly COMMENT: "comment";
|
|
121
131
|
readonly DELETE: "delete";
|
|
132
|
+
readonly TRASH: "trash";
|
|
133
|
+
readonly RESTORE: "restore";
|
|
122
134
|
readonly MOVE: "move";
|
|
123
135
|
readonly COPY: "copy";
|
|
124
136
|
readonly EXPORT: "export";
|
|
125
137
|
readonly SHARE: "share";
|
|
126
|
-
readonly PUBLISH: "publish";
|
|
127
138
|
readonly PRINT: "print";
|
|
139
|
+
readonly PAGES_LIST: "pages_list";
|
|
140
|
+
readonly DISTRIBUTE: "distribute";
|
|
141
|
+
readonly REGISTER: "register";
|
|
142
|
+
readonly PUBLISH: "publish";
|
|
143
|
+
readonly PUBLISH_MOODLE: "publish_moodle";
|
|
128
144
|
};
|
|
129
|
-
export declare type ActionType = typeof ACTION[keyof typeof ACTION];
|
|
145
|
+
export declare type ActionType = (typeof ACTION)[keyof typeof ACTION];
|
|
130
146
|
export declare const FOLDER: {
|
|
131
147
|
readonly BIN: "bin";
|
|
132
148
|
readonly DEFAULT: "default";
|
|
133
149
|
};
|
|
134
|
-
export declare type FolderType = typeof FOLDER[keyof typeof FOLDER];
|
|
150
|
+
export declare type FolderType = (typeof FOLDER)[keyof typeof FOLDER];
|
|
135
151
|
export declare const BOOLEAN_FILTER: {
|
|
136
152
|
readonly OWNER: "owner";
|
|
137
153
|
readonly SHARED: "shared";
|
|
138
154
|
readonly PUBLIC: "public";
|
|
139
155
|
readonly FAVORITE: "favorite";
|
|
140
156
|
};
|
|
141
|
-
export declare type BooleanFilterType = typeof BOOLEAN_FILTER[keyof typeof BOOLEAN_FILTER];
|
|
157
|
+
export declare type BooleanFilterType = (typeof BOOLEAN_FILTER)[keyof typeof BOOLEAN_FILTER];
|
|
142
158
|
export declare const STRING_FILTER: {};
|
|
143
|
-
export declare type StringFilterType = typeof STRING_FILTER[keyof typeof STRING_FILTER];
|
|
159
|
+
export declare type StringFilterType = (typeof STRING_FILTER)[keyof typeof STRING_FILTER];
|
|
144
160
|
export declare const SORT_ORDER: {
|
|
145
161
|
readonly ASC: "asc";
|
|
146
162
|
readonly DESC: "desc";
|
|
147
163
|
};
|
|
148
|
-
export declare type SortOrderType = typeof SORT_ORDER[keyof typeof SORT_ORDER];
|
|
164
|
+
export declare type SortOrderType = (typeof SORT_ORDER)[keyof typeof SORT_ORDER];
|
|
149
165
|
export declare const SORT_BY: {
|
|
150
166
|
readonly NAME: "name";
|
|
151
|
-
readonly MODIFY_DATE: "
|
|
152
|
-
readonly
|
|
167
|
+
readonly MODIFY_DATE: "updatedAt";
|
|
168
|
+
readonly CREATEDAT: "createdAt";
|
|
169
|
+
readonly APPLICATION: "application";
|
|
170
|
+
readonly RESOURCE_TYPE: "resourceType";
|
|
153
171
|
};
|
|
154
|
-
export declare type SortByType = typeof SORT_BY[keyof typeof SORT_BY];
|
|
172
|
+
export declare type SortByType = (typeof SORT_BY)[keyof typeof SORT_BY];
|
|
155
173
|
export declare type ID = string;
|
|
156
174
|
export declare type StringFilterValue = {
|
|
157
175
|
value: string;
|
|
@@ -164,23 +182,23 @@ export declare const PROP_KEY: {
|
|
|
164
182
|
readonly DESCRIPTION: "description";
|
|
165
183
|
readonly URL: "url";
|
|
166
184
|
};
|
|
167
|
-
export declare type PropKeyType = typeof PROP_KEY[keyof typeof PROP_KEY];
|
|
185
|
+
export declare type PropKeyType = (typeof PROP_KEY)[keyof typeof PROP_KEY];
|
|
168
186
|
export declare const PROP_MODE: {
|
|
169
187
|
readonly READONLY: "RO";
|
|
170
188
|
readonly READWRITE: "RW";
|
|
171
189
|
};
|
|
172
|
-
export declare type PropModeType = typeof PROP_MODE[keyof typeof PROP_MODE];
|
|
190
|
+
export declare type PropModeType = (typeof PROP_MODE)[keyof typeof PROP_MODE];
|
|
173
191
|
export declare const PROP_TYPE: {
|
|
174
192
|
readonly TEXT: "text";
|
|
175
193
|
readonly NUMBER: "number";
|
|
176
194
|
readonly DATE: "date";
|
|
177
195
|
readonly IMAGE: "image";
|
|
178
196
|
};
|
|
179
|
-
export declare type PropTypeType = typeof PROP_TYPE[keyof typeof PROP_TYPE];
|
|
197
|
+
export declare type PropTypeType = (typeof PROP_TYPE)[keyof typeof PROP_TYPE];
|
|
180
198
|
export declare const PROP_FORMAT: {
|
|
181
199
|
readonly PLAIN: "plain";
|
|
182
200
|
};
|
|
183
|
-
export declare type PropFormatType = typeof PROP_FORMAT[keyof typeof PROP_FORMAT];
|
|
201
|
+
export declare type PropFormatType = (typeof PROP_FORMAT)[keyof typeof PROP_FORMAT];
|
|
184
202
|
export declare type SearchResultHandler = (input: IActionParameters, output: IActionResult) => void;
|
|
185
203
|
export interface ISearchParameters {
|
|
186
204
|
types: ResourceType[];
|
|
@@ -189,6 +207,7 @@ export interface ISearchParameters {
|
|
|
189
207
|
orders?: OrderValues;
|
|
190
208
|
pagination: IPagination;
|
|
191
209
|
search?: String;
|
|
210
|
+
trashed?: boolean;
|
|
192
211
|
}
|
|
193
212
|
export interface ISearchResults {
|
|
194
213
|
folders: IFolder[];
|
|
@@ -196,20 +215,24 @@ export interface ISearchResults {
|
|
|
196
215
|
resources: IResource[];
|
|
197
216
|
}
|
|
198
217
|
export interface IContext extends ISearchResults {
|
|
199
|
-
filters: IFilter[];
|
|
200
|
-
orders: IOrder[];
|
|
201
|
-
actions: IAction[];
|
|
202
218
|
preferences: IPreferences;
|
|
203
219
|
}
|
|
204
220
|
export interface IAction {
|
|
205
221
|
id: ActionType;
|
|
206
222
|
available: boolean;
|
|
223
|
+
target?: "actionbar";
|
|
224
|
+
workflow: string;
|
|
225
|
+
right?: RightRole;
|
|
207
226
|
}
|
|
208
227
|
export interface IFolder {
|
|
209
228
|
id: ID;
|
|
229
|
+
parentId: ID;
|
|
210
230
|
name: string;
|
|
211
231
|
type: FolderType | ID;
|
|
212
232
|
childNumber: number;
|
|
233
|
+
trashed: boolean;
|
|
234
|
+
rights: string[];
|
|
235
|
+
ancestors: string[];
|
|
213
236
|
}
|
|
214
237
|
export interface IFilter {
|
|
215
238
|
id: BooleanFilterType | StringFilterType;
|
|
@@ -231,23 +254,31 @@ export interface IProperty {
|
|
|
231
254
|
i18n?: string;
|
|
232
255
|
}
|
|
233
256
|
export interface IResource {
|
|
234
|
-
id: ID;
|
|
235
|
-
name: string;
|
|
236
|
-
thumbnail: string;
|
|
237
257
|
application: App;
|
|
258
|
+
assetId: string;
|
|
259
|
+
creatorId: string;
|
|
260
|
+
creatorName: string;
|
|
261
|
+
comments?: number;
|
|
238
262
|
createdAt: string;
|
|
239
|
-
|
|
240
|
-
|
|
263
|
+
favorite?: boolean;
|
|
264
|
+
folderIds?: ID[];
|
|
265
|
+
id: ID;
|
|
266
|
+
modifiedAt: string;
|
|
241
267
|
modifierId: ID;
|
|
242
268
|
modifierName: string;
|
|
243
|
-
|
|
244
|
-
|
|
269
|
+
name: string;
|
|
270
|
+
slug?: string;
|
|
245
271
|
public?: boolean;
|
|
246
272
|
shared?: boolean;
|
|
247
|
-
|
|
273
|
+
thumbnail: string;
|
|
274
|
+
updatedAt: string;
|
|
248
275
|
views?: number;
|
|
249
|
-
|
|
276
|
+
trashed: boolean;
|
|
277
|
+
trashedBy?: string[];
|
|
278
|
+
rights: RightStringified[];
|
|
279
|
+
description: string;
|
|
250
280
|
}
|
|
281
|
+
export declare type RightStringified = string;
|
|
251
282
|
export interface IPreferences {
|
|
252
283
|
view: "card" | "list";
|
|
253
284
|
}
|
|
@@ -268,17 +299,35 @@ export declare type UpdateFolderParameters = IActionParameters & {
|
|
|
268
299
|
parentId: ID | "default";
|
|
269
300
|
name: string;
|
|
270
301
|
};
|
|
302
|
+
export declare type OpenParameters = IActionParameters & {
|
|
303
|
+
resourceId: ID;
|
|
304
|
+
};
|
|
305
|
+
export declare type PrintParameters = IActionParameters & {
|
|
306
|
+
resourceId: ID;
|
|
307
|
+
withComments?: boolean;
|
|
308
|
+
};
|
|
271
309
|
export declare type CopyParameters = IActionParameters & {
|
|
310
|
+
application: string;
|
|
272
311
|
folderId: ID;
|
|
273
312
|
resourceIds: ID[];
|
|
274
313
|
folderIds: ID[];
|
|
275
314
|
};
|
|
276
315
|
export declare type MoveParameters = IActionParameters & {
|
|
316
|
+
application: string;
|
|
277
317
|
folderId: ID;
|
|
278
318
|
resourceIds: ID[];
|
|
279
319
|
folderIds: ID[];
|
|
280
320
|
};
|
|
281
321
|
export declare type DeleteParameters = IActionParameters & {
|
|
322
|
+
application: string;
|
|
323
|
+
resourceType: string;
|
|
324
|
+
resourceIds: ID[];
|
|
325
|
+
folderIds: ID[];
|
|
326
|
+
};
|
|
327
|
+
export declare type TrashParameters = IActionParameters & {
|
|
328
|
+
trash: boolean;
|
|
329
|
+
application: string;
|
|
330
|
+
resourceType: string;
|
|
282
331
|
resourceIds: ID[];
|
|
283
332
|
folderIds: ID[];
|
|
284
333
|
};
|
|
@@ -291,6 +340,23 @@ export declare type UpdatePropertiesParameters = IActionParameters & {
|
|
|
291
340
|
[key in PropKeyType]?: string;
|
|
292
341
|
};
|
|
293
342
|
};
|
|
343
|
+
export declare type PublishParameters = IActionParameters & {
|
|
344
|
+
userId: string | undefined;
|
|
345
|
+
title: string;
|
|
346
|
+
cover: Blob;
|
|
347
|
+
language: string;
|
|
348
|
+
activityType: string[];
|
|
349
|
+
subjectArea: string[];
|
|
350
|
+
age: [string, string];
|
|
351
|
+
description: string;
|
|
352
|
+
keyWords: string;
|
|
353
|
+
application: string | undefined;
|
|
354
|
+
licence: string;
|
|
355
|
+
teacherAvatar: Blob;
|
|
356
|
+
resourceId: string;
|
|
357
|
+
resourceEntId: string;
|
|
358
|
+
userStructureName: string;
|
|
359
|
+
};
|
|
294
360
|
export declare type FilterValues = {
|
|
295
361
|
[B in BooleanFilterType]?: boolean;
|
|
296
362
|
} & {
|
|
@@ -310,6 +376,7 @@ export declare type GetSubFoldersResult = IActionResult & {
|
|
|
310
376
|
};
|
|
311
377
|
export declare type CreateFolderResult = IActionResult & IFolder & {
|
|
312
378
|
createdAt: string;
|
|
379
|
+
creator_id?: string;
|
|
313
380
|
};
|
|
314
381
|
export declare type UpdateFolderResult = CreateFolderResult & {
|
|
315
382
|
updatedAt: string;
|
|
@@ -321,6 +388,19 @@ export declare type ManagePropertiesResult = IActionResult & {
|
|
|
321
388
|
export declare type UpdatePropertiesResult = IActionResult & {
|
|
322
389
|
resources: IResource[];
|
|
323
390
|
};
|
|
391
|
+
export declare type PublishResult = IActionResult & {
|
|
392
|
+
details: {
|
|
393
|
+
application: string;
|
|
394
|
+
created_at: string;
|
|
395
|
+
description: string;
|
|
396
|
+
front_url: string;
|
|
397
|
+
id: string;
|
|
398
|
+
title: string;
|
|
399
|
+
};
|
|
400
|
+
message: string;
|
|
401
|
+
reason: string;
|
|
402
|
+
success: boolean;
|
|
403
|
+
};
|
|
324
404
|
export interface IBus {
|
|
325
405
|
/**
|
|
326
406
|
* Ask any agent on the bus to perform an action on a type of resource.
|
|
@@ -334,7 +414,7 @@ export interface IBus {
|
|
|
334
414
|
* Subscribe to ActionResults any agent produces for a given ResourceType and ActionType.
|
|
335
415
|
* @param res The type of resource in concern.
|
|
336
416
|
* @param action The action in concern.
|
|
337
|
-
* @return A stream of
|
|
417
|
+
* @return A stream of IActionParameters and IActionResult
|
|
338
418
|
*/
|
|
339
419
|
subscribe(res: ResourceType, action: ActionType): Observable<{
|
|
340
420
|
input: IActionParameters;
|
|
@@ -349,4 +429,3 @@ export interface IBusAgent {
|
|
|
349
429
|
/** Ask this agent to resolve an action. */
|
|
350
430
|
activate(res: ResourceType, action: ActionType, parameters: IActionParameters): Promise<IActionResult>;
|
|
351
431
|
}
|
|
352
|
-
//# sourceMappingURL=interfaces.d.ts.map
|