ode-ts-client 1.1.2 → 1.1.3-explorer.202302151517

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.
Files changed (79) hide show
  1. package/dist/agents/blog.agent.d.ts +2 -0
  2. package/dist/agents/folder.agent.d.ts +2 -0
  3. package/dist/agents/index.d.ts +4 -0
  4. package/dist/{ts/apps → apps}/timeline/Framework.d.ts +0 -1
  5. package/dist/{ts/apps → apps}/timeline/Notification.model.d.ts +0 -1
  6. package/dist/{ts/apps → apps}/timeline/interfaces.d.ts +1 -2
  7. package/dist/{ts/configure → configure}/Analytics.d.ts +0 -1
  8. package/dist/{ts/configure → configure}/AppConf.d.ts +3 -1
  9. package/dist/{ts/configure → configure}/Framework.d.ts +0 -1
  10. package/dist/{ts/configure → configure}/Idiom.d.ts +3 -2
  11. package/dist/{ts/configure → configure}/Theme.d.ts +0 -1
  12. package/dist/{ts/configure → configure}/User.d.ts +0 -1
  13. package/dist/{ts/configure → configure}/interfaces.d.ts +13 -7
  14. package/dist/{ts/explore → explore}/Agent.d.ts +1 -2
  15. package/dist/{ts/explore → explore}/AgentLoader.d.ts +0 -2
  16. package/dist/{ts/explore → explore}/Bus.d.ts +0 -1
  17. package/dist/{ts/explore → explore}/Context.d.ts +3 -2
  18. package/dist/{ts/explore → explore}/Framework.d.ts +2 -2
  19. package/dist/{ts/explore → explore}/interfaces.d.ts +110 -43
  20. package/dist/{ts/globals.d.ts → globals.d.ts} +3 -3
  21. package/dist/index.cjs.d.ts +1 -0
  22. package/dist/index.d.ts +9 -0
  23. package/dist/legacy/Behaviours.d.ts +29 -0
  24. package/dist/legacy/entcore.d.ts +7 -0
  25. package/dist/legacy/http.d.ts +24 -0
  26. package/dist/legacy/me.d.ts +12 -0
  27. package/dist/legacy/rights.d.ts +55 -0
  28. package/dist/{ts/notify → notify}/Framework.d.ts +0 -1
  29. package/dist/{ts/notify → notify}/interfaces.d.ts +2 -3
  30. package/dist/ode-ts-client.js +15 -16
  31. package/dist/ode-ts-client.mjs +8478 -0
  32. package/dist/{ts/session → session}/Framework.d.ts +2 -1
  33. package/dist/{ts/session → session}/Session.d.ts +10 -3
  34. package/dist/{ts/session → session}/interfaces.d.ts +93 -4
  35. package/dist/{ts/transport → transport}/Framework.d.ts +0 -1
  36. package/dist/{ts/transport → transport}/Http.d.ts +0 -1
  37. package/dist/{ts/transport → transport}/interfaces.d.ts +5 -3
  38. package/dist/version.txt +1 -1
  39. package/dist/{ts/widget → widget}/Framework.d.ts +0 -1
  40. package/dist/{ts/widget → widget}/LastInfos.widget.d.ts +0 -1
  41. package/dist/{ts/widget → widget}/interfaces.d.ts +3 -4
  42. package/package.json +18 -14
  43. package/dist/ode-ts-client.js.map +0 -1
  44. package/dist/test/Foundation.spec.d.ts +0 -2
  45. package/dist/test/Foundation.spec.d.ts.map +0 -1
  46. package/dist/test/mocks/agents/MockedAgentLoader.d.ts +0 -9
  47. package/dist/test/mocks/agents/MockedAgentLoader.d.ts.map +0 -1
  48. package/dist/test/mocks/agents/MockedFolderAgent.d.ts +0 -15
  49. package/dist/test/mocks/agents/MockedFolderAgent.d.ts.map +0 -1
  50. package/dist/ts/apps/timeline/Framework.d.ts.map +0 -1
  51. package/dist/ts/apps/timeline/Notification.model.d.ts.map +0 -1
  52. package/dist/ts/apps/timeline/interfaces.d.ts.map +0 -1
  53. package/dist/ts/configure/Analytics.d.ts.map +0 -1
  54. package/dist/ts/configure/AppConf.d.ts.map +0 -1
  55. package/dist/ts/configure/Framework.d.ts.map +0 -1
  56. package/dist/ts/configure/Idiom.d.ts.map +0 -1
  57. package/dist/ts/configure/Theme.d.ts.map +0 -1
  58. package/dist/ts/configure/User.d.ts.map +0 -1
  59. package/dist/ts/configure/interfaces.d.ts.map +0 -1
  60. package/dist/ts/explore/Agent.d.ts.map +0 -1
  61. package/dist/ts/explore/AgentLoader.d.ts.map +0 -1
  62. package/dist/ts/explore/Bus.d.ts.map +0 -1
  63. package/dist/ts/explore/Context.d.ts.map +0 -1
  64. package/dist/ts/explore/Framework.d.ts.map +0 -1
  65. package/dist/ts/explore/interfaces.d.ts.map +0 -1
  66. package/dist/ts/globals.d.ts.map +0 -1
  67. package/dist/ts/index.d.ts +0 -12
  68. package/dist/ts/index.d.ts.map +0 -1
  69. package/dist/ts/notify/Framework.d.ts.map +0 -1
  70. package/dist/ts/notify/interfaces.d.ts.map +0 -1
  71. package/dist/ts/session/Framework.d.ts.map +0 -1
  72. package/dist/ts/session/Session.d.ts.map +0 -1
  73. package/dist/ts/session/interfaces.d.ts.map +0 -1
  74. package/dist/ts/transport/Framework.d.ts.map +0 -1
  75. package/dist/ts/transport/Http.d.ts.map +0 -1
  76. package/dist/ts/transport/interfaces.d.ts.map +0 -1
  77. package/dist/ts/widget/Framework.d.ts.map +0 -1
  78. package/dist/ts/widget/LastInfos.widget.d.ts.map +0 -1
  79. package/dist/ts/widget/interfaces.d.ts.map +0 -1
@@ -0,0 +1,2 @@
1
+ import { AgentFactory } from '.';
2
+ export declare const factory: AgentFactory;
@@ -0,0 +1,2 @@
1
+ import { AgentFactory } from '.';
2
+ export declare const factory: AgentFactory;
@@ -0,0 +1,4 @@
1
+ import { IBusAgent } from "..";
2
+ export type AgentFactory = () => IBusAgent;
3
+ export { factory as blogAgentFactory } from "./blog.agent";
4
+ export { factory as folderAgentFactory } from "./folder.agent";
@@ -23,4 +23,3 @@ export declare class TimelineApp implements ITimelineApp {
23
23
  loadFlashMessages(): Promise<void>;
24
24
  markAsRead(msg: IFlashMessageModel): Promise<void>;
25
25
  }
26
- //# sourceMappingURL=Framework.d.ts.map
@@ -8,4 +8,3 @@ export declare class Notification implements ITimelineNotification {
8
8
  discard(): Promise<any>;
9
9
  report(): Promise<any>;
10
10
  }
11
- //# sourceMappingURL=Notification.model.d.ts.map
@@ -27,7 +27,7 @@ export interface ITimelineNotification {
27
27
  discard(): Promise<void>;
28
28
  report(): Promise<void>;
29
29
  }
30
- export declare type NotificationModel = {
30
+ export type NotificationModel = {
31
31
  _id: string;
32
32
  type: string;
33
33
  eventType: string;
@@ -67,4 +67,3 @@ export interface IFlashMessageModel {
67
67
  readonly signature?: string;
68
68
  readonly signatureColor?: string;
69
69
  }
70
- //# sourceMappingURL=interfaces.d.ts.map
@@ -16,4 +16,3 @@ export declare class Analytics {
16
16
  /** 2021 implementation of XiTi. */
17
17
  private initializeXiti;
18
18
  }
19
- //# sourceMappingURL=Analytics.d.ts.map
@@ -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
@@ -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
@@ -1,6 +1,8 @@
1
1
  import { AddBundleCallback, IIdiom } from "./interfaces";
2
2
  export declare class Idiom implements IIdiom {
3
- translate(key: string): string;
3
+ translate(key: string, params?: {
4
+ [param: string]: any;
5
+ }): string;
4
6
  addBundlePromise(path: string): Promise<void>;
5
7
  addBundle(path: string, callback?: AddBundleCallback): void;
6
8
  private loadBundlePromise;
@@ -10,4 +12,3 @@ export declare class Idiom implements IIdiom {
10
12
  addKeys(keys: any): void;
11
13
  removeAccents(str: string): string;
12
14
  }
13
- //# sourceMappingURL=Idiom.d.ts.map
@@ -32,4 +32,3 @@ export declare class Theme implements ITheme {
32
32
  listSkins(): Promise<IThemeConfOverriding[]>;
33
33
  getHelpPath(): Promise<String>;
34
34
  }
35
- //# sourceMappingURL=Theme.d.ts.map
@@ -19,4 +19,3 @@ export declare class User {
19
19
  loadLanguage(): Promise<string>;
20
20
  saveLanguage(lang: string): Promise<void>;
21
21
  }
22
- //# sourceMappingURL=User.d.ts.map
@@ -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
  };
@@ -56,8 +58,8 @@ export interface IConfigurationFramework {
56
58
  saveLanguage(lang: string): Promise<void>;
57
59
  };
58
60
  }
59
- export declare type AnalyticStatus = "void" | "pending" | "ready" | "failed";
60
- export declare type TrackingType = "matomo" | "internal";
61
+ export type AnalyticStatus = "void" | "pending" | "ready" | "failed";
62
+ export type TrackingType = "matomo" | "internal";
61
63
  export interface ITrackingParams {
62
64
  /** Whitelist of events to track, in the form "app" or "app.eventName" or "*.eventName". */
63
65
  trackOnly: string[];
@@ -160,15 +162,20 @@ export interface IThemeConfOverriding {
160
162
  ignoreSubjects?: Array<string>;
161
163
  };
162
164
  }
163
- export declare type IThemeOverrides = {
165
+ export type IThemeOverrides = {
164
166
  [app in App]?: string;
165
167
  };
166
- export declare type AddBundleCallback = () => void | Promise<void>;
168
+ export type AddBundleCallback = () => void | Promise<void>;
167
169
  export interface IIdiom {
168
170
  /** Get the translation of a given key.
171
+ * @param params (optional) map of key/value variables.
172
+ * Ex: Given "variabilized.i18n.key"="Limit to ${limit} bytes"
173
+ * translate('variabilized.i18n.key', {limit:50}) will return "Limit to 50 bytes".
169
174
  * @return the key itself when no translation exists.
170
175
  */
171
- translate(key: string): string;
176
+ translate(key: string, params?: {
177
+ [param: string]: any;
178
+ }): string;
172
179
  /** Load a language bundle then return a Promise. */
173
180
  addBundlePromise(path: string): Promise<void>;
174
181
  /** Load a language bundle then call an optional callback. */
@@ -182,7 +189,7 @@ export interface IIdiom {
182
189
  /** @return a new string without accentuation. */
183
190
  removeAccents(str: string): string;
184
191
  }
185
- export declare type UserPreferenceKey = typeof USER_PREFS[keyof typeof USER_PREFS] | App;
192
+ export type UserPreferenceKey = typeof USER_PREFS[keyof typeof USER_PREFS] | App;
186
193
  export interface IUserPreferences {
187
194
  data: {
188
195
  [key in UserPreferenceKey]?: any;
@@ -192,4 +199,3 @@ export interface IUserPreferences {
192
199
  update(key: UserPreferenceKey, data: any): IUserPreferences;
193
200
  save(key: UserPreferenceKey): Promise<void>;
194
201
  }
195
- //# sourceMappingURL=interfaces.d.ts.map
@@ -1,5 +1,5 @@
1
1
  import { ActionType, IActionParameters, IActionResult, IBusAgent, ResourceType } from "./interfaces";
2
- export declare type IHandler = (parameters: IActionParameters) => Promise<IActionResult>;
2
+ export type IHandler = (parameters: IActionParameters) => Promise<IActionResult>;
3
3
  /**
4
4
  * Manage a generic RESOURCE
5
5
  */
@@ -18,4 +18,3 @@ export declare abstract class AbstractBusAgent implements IBusAgent {
18
18
  protected abstract registerHandlers(): void;
19
19
  activate(res: ResourceType, action: ActionType, parameters: IActionParameters): Promise<IActionResult>;
20
20
  }
21
- //# sourceMappingURL=Agent.d.ts.map
@@ -9,7 +9,5 @@ export interface IAgentLoader {
9
9
  * Default implementation of the loader.
10
10
  */
11
11
  export declare class AgentLoader implements IAgentLoader {
12
- private http;
13
12
  load(res: ResourceType): Promise<void>;
14
13
  }
15
- //# sourceMappingURL=AgentLoader.d.ts.map
@@ -18,4 +18,3 @@ export declare class BusFactory {
18
18
  static get instance(): Bus;
19
19
  }
20
20
  export {};
21
- //# sourceMappingURL=Bus.d.ts.map
@@ -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 agentLoader;
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
@@ -94,19 +94,28 @@ export interface IExplorerContext {
94
94
  * @param folderIds Array of folders ID to delete.
95
95
  */
96
96
  delete(resourceIds: ID[], folderIds: ID[]): Promise<void>;
97
+ /**
98
+ * Trash / Untrash resources and folders.
99
+ * @param trash boolean set status trash or untrash
100
+ * @param resourceIds Array of resources ID to delete.
101
+ * @param folderIds Array of folders ID to delete.
102
+ */
103
+ trash(trash: boolean, resourceIds: ID[], folderIds: ID[]): Promise<void>;
97
104
  /** Retrieves which properties of the resource(s) are manageable. */
98
105
  manageProperties(resourceType: ResourceType, resources: IResource[]): Promise<ManagePropertiesResult>;
99
106
  /** Update managed properties. */
100
107
  updateProperties(resourceType: ResourceType, resources: IResource[], props: {
101
108
  [key in PropKeyType]?: string;
102
109
  }): Promise<UpdatePropertiesResult>;
110
+ /** Publish to Library */
111
+ publish(resourceType: ResourceType, parameters: PublishParameters): Promise<PublishResult>;
103
112
  }
104
113
  export declare const RESOURCE: {
105
114
  readonly FOLDER: "folder";
106
115
  readonly BLOG: "blog";
107
116
  readonly EXERCISE: "exercise";
108
117
  };
109
- export declare type ResourceType = typeof RESOURCE[keyof typeof RESOURCE];
118
+ export type ResourceType = typeof RESOURCE[keyof typeof RESOURCE];
110
119
  export declare const appNameForResource: {
111
120
  [R in ResourceType]: App;
112
121
  };
@@ -119,41 +128,47 @@ export declare const ACTION: {
119
128
  readonly UPD_PROPS: "properties";
120
129
  readonly COMMENT: "comment";
121
130
  readonly DELETE: "delete";
131
+ readonly TRASH: "trash";
132
+ readonly RESTORE: "restore";
122
133
  readonly MOVE: "move";
123
134
  readonly COPY: "copy";
124
135
  readonly EXPORT: "export";
125
136
  readonly SHARE: "share";
126
- readonly PUBLISH: "publish";
127
137
  readonly PRINT: "print";
138
+ readonly PAGES_LIST: "pages_list";
139
+ readonly DISTRIBUTE: "distribute";
140
+ readonly REGISTER: "register";
141
+ readonly PUBLISH: "publish";
142
+ readonly PUBLISH_MOODLE: "publish_moodle";
128
143
  };
129
- export declare type ActionType = typeof ACTION[keyof typeof ACTION];
144
+ export type ActionType = typeof ACTION[keyof typeof ACTION];
130
145
  export declare const FOLDER: {
131
146
  readonly BIN: "bin";
132
147
  readonly DEFAULT: "default";
133
148
  };
134
- export declare type FolderType = typeof FOLDER[keyof typeof FOLDER];
149
+ export type FolderType = typeof FOLDER[keyof typeof FOLDER];
135
150
  export declare const BOOLEAN_FILTER: {
136
151
  readonly OWNER: "owner";
137
152
  readonly SHARED: "shared";
138
153
  readonly PUBLIC: "public";
139
154
  readonly FAVORITE: "favorite";
140
155
  };
141
- export declare type BooleanFilterType = typeof BOOLEAN_FILTER[keyof typeof BOOLEAN_FILTER];
156
+ export type BooleanFilterType = typeof BOOLEAN_FILTER[keyof typeof BOOLEAN_FILTER];
142
157
  export declare const STRING_FILTER: {};
143
- export declare type StringFilterType = typeof STRING_FILTER[keyof typeof STRING_FILTER];
158
+ export type StringFilterType = typeof STRING_FILTER[keyof typeof STRING_FILTER];
144
159
  export declare const SORT_ORDER: {
145
160
  readonly ASC: "asc";
146
161
  readonly DESC: "desc";
147
162
  };
148
- export declare type SortOrderType = typeof SORT_ORDER[keyof typeof SORT_ORDER];
163
+ export type SortOrderType = typeof SORT_ORDER[keyof typeof SORT_ORDER];
149
164
  export declare const SORT_BY: {
150
165
  readonly NAME: "name";
151
166
  readonly MODIFY_DATE: "modifiedAt";
152
167
  readonly VIEWS: "views";
153
168
  };
154
- export declare type SortByType = typeof SORT_BY[keyof typeof SORT_BY];
155
- export declare type ID = string;
156
- export declare type StringFilterValue = {
169
+ export type SortByType = typeof SORT_BY[keyof typeof SORT_BY];
170
+ export type ID = string;
171
+ export type StringFilterValue = {
157
172
  value: string;
158
173
  i18n: string;
159
174
  };
@@ -164,24 +179,24 @@ export declare const PROP_KEY: {
164
179
  readonly DESCRIPTION: "description";
165
180
  readonly URL: "url";
166
181
  };
167
- export declare type PropKeyType = typeof PROP_KEY[keyof typeof PROP_KEY];
182
+ export type PropKeyType = typeof PROP_KEY[keyof typeof PROP_KEY];
168
183
  export declare const PROP_MODE: {
169
184
  readonly READONLY: "RO";
170
185
  readonly READWRITE: "RW";
171
186
  };
172
- export declare type PropModeType = typeof PROP_MODE[keyof typeof PROP_MODE];
187
+ export type PropModeType = typeof PROP_MODE[keyof typeof PROP_MODE];
173
188
  export declare const PROP_TYPE: {
174
189
  readonly TEXT: "text";
175
190
  readonly NUMBER: "number";
176
191
  readonly DATE: "date";
177
192
  readonly IMAGE: "image";
178
193
  };
179
- export declare type PropTypeType = typeof PROP_TYPE[keyof typeof PROP_TYPE];
194
+ export type PropTypeType = typeof PROP_TYPE[keyof typeof PROP_TYPE];
180
195
  export declare const PROP_FORMAT: {
181
196
  readonly PLAIN: "plain";
182
197
  };
183
- export declare type PropFormatType = typeof PROP_FORMAT[keyof typeof PROP_FORMAT];
184
- export declare type SearchResultHandler = (input: IActionParameters, output: IActionResult) => void;
198
+ export type PropFormatType = typeof PROP_FORMAT[keyof typeof PROP_FORMAT];
199
+ export type SearchResultHandler = (input: IActionParameters, output: IActionResult) => void;
185
200
  export interface ISearchParameters {
186
201
  types: ResourceType[];
187
202
  app: App;
@@ -204,12 +219,15 @@ export interface IContext extends ISearchResults {
204
219
  export interface IAction {
205
220
  id: ActionType;
206
221
  available: boolean;
222
+ target?: "actionbar";
207
223
  }
208
224
  export interface IFolder {
209
225
  id: ID;
226
+ parentId: ID;
210
227
  name: string;
211
228
  type: FolderType | ID;
212
229
  childNumber: number;
230
+ trashed: boolean;
213
231
  }
214
232
  export interface IFilter {
215
233
  id: BooleanFilterType | StringFilterType;
@@ -231,96 +249,146 @@ export interface IProperty {
231
249
  i18n?: string;
232
250
  }
233
251
  export interface IResource {
234
- id: ID;
235
- name: string;
236
- thumbnail: string;
237
252
  application: App;
238
- createdAt: string;
253
+ assetId: string;
239
254
  authorId: string;
240
- authorName: string;
255
+ creatorName: string;
256
+ comments?: number;
257
+ createdAt: string;
258
+ favorite?: boolean;
259
+ folderId?: ID;
260
+ id: ID;
261
+ modifiedAt: string;
241
262
  modifierId: ID;
242
263
  modifierName: string;
243
- modifiedAt: string;
244
- folderId?: ID;
264
+ name: string;
245
265
  public?: boolean;
246
266
  shared?: boolean;
247
- favorite?: boolean;
267
+ thumbnail: string;
268
+ updatedAt: string;
248
269
  views?: number;
249
- comments?: number;
270
+ trashed: boolean;
250
271
  }
251
272
  export interface IPreferences {
252
273
  view: "card" | "list";
253
274
  }
254
275
  export interface IActionParameters {
255
276
  }
256
- export declare type GetContextParameters = IActionParameters & ISearchParameters;
257
- export declare type GetResourcesParameters = IActionParameters & ISearchParameters;
258
- export declare type CreateFolderParameters = IActionParameters & {
277
+ export type GetContextParameters = IActionParameters & ISearchParameters;
278
+ export type GetResourcesParameters = IActionParameters & ISearchParameters;
279
+ export type CreateFolderParameters = IActionParameters & {
259
280
  app: App;
260
281
  type: ResourceType;
261
282
  parentId: ID | "default";
262
283
  name: string;
263
284
  };
264
- export declare type UpdateFolderParameters = IActionParameters & {
285
+ export type UpdateFolderParameters = IActionParameters & {
265
286
  folderId: ID;
266
287
  app: App;
267
288
  type: ResourceType;
268
289
  parentId: ID | "default";
269
290
  name: string;
270
291
  };
271
- export declare type CopyParameters = IActionParameters & {
292
+ export type OpenParameters = IActionParameters & {
293
+ resourceId: ID;
294
+ };
295
+ export type PrintParameters = IActionParameters & {
296
+ resourceId: ID;
297
+ withComments?: boolean;
298
+ };
299
+ export type CopyParameters = IActionParameters & {
300
+ application: string;
272
301
  folderId: ID;
273
302
  resourceIds: ID[];
274
303
  folderIds: ID[];
275
304
  };
276
- export declare type MoveParameters = IActionParameters & {
305
+ export type MoveParameters = IActionParameters & {
306
+ application: string;
277
307
  folderId: ID;
278
308
  resourceIds: ID[];
279
309
  folderIds: ID[];
280
310
  };
281
- export declare type DeleteParameters = IActionParameters & {
311
+ export type DeleteParameters = IActionParameters & {
312
+ application: string;
313
+ resourceType: string;
314
+ resourceIds: ID[];
315
+ folderIds: ID[];
316
+ };
317
+ export type TrashParameters = IActionParameters & {
318
+ trash: boolean;
319
+ application: string;
320
+ resourceType: string;
282
321
  resourceIds: ID[];
283
322
  folderIds: ID[];
284
323
  };
285
- export declare type ManagePropertiesParameters = IActionParameters & {
324
+ export type ManagePropertiesParameters = IActionParameters & {
286
325
  resources: IResource[];
287
326
  };
288
- export declare type UpdatePropertiesParameters = IActionParameters & {
327
+ export type UpdatePropertiesParameters = IActionParameters & {
289
328
  resources: IResource[];
290
329
  props: {
291
330
  [key in PropKeyType]?: string;
292
331
  };
293
332
  };
294
- export declare type FilterValues = {
333
+ export type PublishParameters = IActionParameters & {
334
+ userId: string | undefined;
335
+ title: string;
336
+ cover: Blob;
337
+ language: string;
338
+ activityType: string[];
339
+ subjectArea: string[];
340
+ age: [string, string];
341
+ description: string;
342
+ keyWords: string;
343
+ application: string | undefined;
344
+ licence: string;
345
+ teacherAvatar: Blob;
346
+ resourceId: string;
347
+ userStructureName: string;
348
+ };
349
+ export type FilterValues = {
295
350
  [B in BooleanFilterType]?: boolean;
296
351
  } & {
297
352
  [S in StringFilterType]?: string;
298
353
  } & {
299
354
  folder?: ID;
300
355
  };
301
- export declare type OrderValues = {
356
+ export type OrderValues = {
302
357
  [O in SortByType]?: SortOrderType;
303
358
  };
304
359
  export interface IActionResult {
305
360
  }
306
- export declare type GetContextResult = IActionResult & IContext;
307
- export declare type GetResourcesResult = IActionResult & ISearchResults;
308
- export declare type GetSubFoldersResult = IActionResult & {
361
+ export type GetContextResult = IActionResult & IContext;
362
+ export type GetResourcesResult = IActionResult & ISearchResults;
363
+ export type GetSubFoldersResult = IActionResult & {
309
364
  folders: IFolder[];
310
365
  };
311
- export declare type CreateFolderResult = IActionResult & IFolder & {
366
+ export type CreateFolderResult = IActionResult & IFolder & {
312
367
  createdAt: string;
313
368
  };
314
- export declare type UpdateFolderResult = CreateFolderResult & {
369
+ export type UpdateFolderResult = CreateFolderResult & {
315
370
  updatedAt: string;
316
371
  parentId: ID | "default";
317
372
  };
318
- export declare type ManagePropertiesResult = IActionResult & {
373
+ export type ManagePropertiesResult = IActionResult & {
319
374
  genericProps: IProperty[];
320
375
  };
321
- export declare type UpdatePropertiesResult = IActionResult & {
376
+ export type UpdatePropertiesResult = IActionResult & {
322
377
  resources: IResource[];
323
378
  };
379
+ export type PublishResult = IActionResult & {
380
+ details: {
381
+ application: string;
382
+ created_at: string;
383
+ description: string;
384
+ front_url: string;
385
+ id: string;
386
+ title: string;
387
+ };
388
+ message: string;
389
+ reason: string;
390
+ success: boolean;
391
+ };
324
392
  export interface IBus {
325
393
  /**
326
394
  * Ask any agent on the bus to perform an action on a type of resource.
@@ -349,4 +417,3 @@ export interface IBusAgent {
349
417
  /** Ask this agent to resolve an action. */
350
418
  activate(res: ResourceType, action: ActionType, parameters: IActionParameters): Promise<IActionResult>;
351
419
  }
352
- //# sourceMappingURL=interfaces.d.ts.map
@@ -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 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 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
@@ -0,0 +1 @@
1
+ export * from "./index";
@@ -0,0 +1,9 @@
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";
@@ -0,0 +1,29 @@
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( serviceName:string, resource:IBehavioursAppBehaviours ): Promise<any>;
23
+ // @deprecated findBehaviours(serviceName, resource): void;
24
+ loadBehaviours( serviceName:string, callback: ((resource:IBehavioursAppBehaviours)=>void) ): IBehavioursActions;
25
+ load( serviceName:string ): Promise<any>;
26
+ findWorkflow( serviceName:string ): Promise<any>;
27
+ workflowsFrom( obj:any, dependencies:any ): {};
28
+ applicationsBehaviours: any;
29
+ }
@@ -0,0 +1,7 @@
1
+ import { IBehaviours } from "./Behaviours";
2
+
3
+ declare interface Entcore {
4
+ Behaviours: IBehaviours;
5
+ }
6
+ export declare var entcore: Entcore;
7
+ export declare var newLogin: boolean;
@@ -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
+ }