@edifice.io/client 2.5.24 → 2.6.0-develop-integration.20260710151131

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.
@@ -0,0 +1,29 @@
1
+ import { IOdeServices } from '../services/OdeServices';
2
+ import { WorkspaceElement } from '../workspace/interface';
3
+ import { NextcloudDocument } from './interface';
4
+ export declare class NextcloudService {
5
+ private context;
6
+ constructor(context: IOdeServices);
7
+ private get http();
8
+ /**
9
+ * List a user's Nextcloud documents and folders at a given path.
10
+ * @param userId - the id of the user whose files are listed.
11
+ * @param path - path to list, relative to the user's Nextcloud root; root when omitted.
12
+ */
13
+ listDocuments(userId: string, path?: string): Promise<NextcloudDocument[]>;
14
+ /**
15
+ * Copy Nextcloud documents into the entcore workspace.
16
+ * @param userId - the id of the user whose files are copied.
17
+ * @param paths - paths of the documents to copy, relative to the user's Nextcloud root.
18
+ * @param parentId - the workspace folder to copy into; user's root when omitted.
19
+ */
20
+ copyDocumentToWorkspace(userId: string, paths: string[], parentId?: string): Promise<WorkspaceElement[]>;
21
+ /**
22
+ * Build the URL to download/preview a Nextcloud document.
23
+ * There is no dedicated thumbnail endpoint on the backend, so this is also
24
+ * used as an image preview source for image documents.
25
+ * @param userId - the id of the user who owns the file.
26
+ * @param doc - the document to build the URL for.
27
+ */
28
+ getFileUrl(userId: string, doc: NextcloudDocument): string;
29
+ }
@@ -0,0 +1,27 @@
1
+ /** A user's Nextcloud document or folder, as consumed by the frontend. */
2
+ export interface NextcloudDocument {
3
+ /** Path of this entry, relative to the user's Nextcloud root. Used as a unique id. */
4
+ path: string;
5
+ name: string;
6
+ ownerDisplayName?: string;
7
+ contentType?: string;
8
+ size?: number;
9
+ favorite?: boolean;
10
+ etag?: string;
11
+ fileId?: string;
12
+ isFolder: boolean;
13
+ lastModified?: string;
14
+ }
15
+ /** Raw DTO returned by the `/nextcloud/files/user/:userId` endpoint. */
16
+ export interface NextcloudDocumentResponse {
17
+ path: string;
18
+ displayname: string;
19
+ ownerDisplayName?: string;
20
+ contentType?: string;
21
+ size?: number;
22
+ favorite?: boolean;
23
+ etag?: string;
24
+ fileId?: string;
25
+ isFolder: boolean;
26
+ lastModified?: string;
27
+ }
@@ -1,21 +1,23 @@
1
+ import { AnalyticsService } from '../analytics/Service';
2
+ import { IAudienceService } from '../audience/interface';
1
3
  import { CacheService } from '../cache/Service';
2
4
  import { ConfService } from '../configure/Service';
5
+ import { DataService } from '../data/Service';
6
+ import { IDataService } from '../data/interface';
3
7
  import { DirectoryService } from '../directory/Service';
4
- import { HttpService } from '../transport/Service';
8
+ import { EmbedderService } from '../embedder/Service';
9
+ import { App, ResourceType } from '../globals';
10
+ import { IdiomService } from '../idiom/Service';
11
+ import { INotifyFramework } from '../notify/interfaces';
12
+ import { NextcloudService } from '../nextcloud/Service';
13
+ import { IBehaviourService, IResourceService, IWebResourceService } from '../resources/interface';
5
14
  import { RightService } from '../rights/Service';
6
15
  import { SessionService } from '../session/Service';
7
16
  import { ShareService } from '../share/Service';
8
- import { WorkspaceService } from '../workspace/Service';
9
- import { IdiomService } from '../idiom/Service';
10
- import { AnalyticsService } from '../analytics/Service';
11
- import { IAudienceService } from '../audience/interface';
17
+ import { HttpService } from '../transport/Service';
12
18
  import { VideoService } from '../video/Service';
13
- import { App, ResourceType } from '../globals';
14
- import { IBehaviourService, IResourceService, IWebResourceService } from '../resources/interface';
15
- import { EmbedderService } from '../embedder/Service';
16
- import { INotifyFramework } from '../notify/interfaces';
17
- import { DataService } from '../data/Service';
18
- import { IDataService } from '../data/interface';
19
+ import { WidgetService } from '../widget/Service';
20
+ import { WorkspaceService } from '../workspace/Service';
19
21
  export interface IOdeServices {
20
22
  analytics(): AnalyticsService;
21
23
  audience(application: App, resourceType: ResourceType): IAudienceService;
@@ -25,6 +27,7 @@ export interface IOdeServices {
25
27
  directory(): DirectoryService;
26
28
  http(): HttpService;
27
29
  idiom(): IdiomService;
30
+ nextcloud(): NextcloudService;
28
31
  notify(): INotifyFramework;
29
32
  resource(application: App, resourceType?: ResourceType): IResourceService & IWebResourceService;
30
33
  behaviour(application: App, resourceType: ResourceType): IBehaviourService;
@@ -32,6 +35,7 @@ export interface IOdeServices {
32
35
  session(): SessionService;
33
36
  share(): ShareService;
34
37
  video(): VideoService;
38
+ widget(): WidgetService;
35
39
  workspace(): WorkspaceService;
36
40
  embedder(): EmbedderService;
37
41
  }
@@ -43,11 +47,13 @@ export declare class OdeServices implements IOdeServices {
43
47
  private _directory;
44
48
  private _http;
45
49
  private _idiom;
50
+ private _nextcloud;
46
51
  private _notify;
47
52
  private _rights;
48
53
  private _session;
49
54
  private _share;
50
55
  private _video;
56
+ private _widget;
51
57
  private _workspace;
52
58
  private _embedder;
53
59
  constructor();
@@ -60,6 +66,7 @@ export declare class OdeServices implements IOdeServices {
60
66
  directory(): DirectoryService;
61
67
  http(): HttpService;
62
68
  idiom(): IdiomService;
69
+ nextcloud(): NextcloudService;
63
70
  notify(): INotifyFramework;
64
71
  resource(application: App, resourceType?: ResourceType): IResourceService & IWebResourceService;
65
72
  behaviour(application: App, resourceType: ResourceType): IBehaviourService;
@@ -67,6 +74,7 @@ export declare class OdeServices implements IOdeServices {
67
74
  session(): SessionService;
68
75
  share(): ShareService;
69
76
  video(): VideoService;
77
+ widget(): WidgetService;
70
78
  workspace(): WorkspaceService;
71
79
  embedder(): EmbedderService;
72
80
  }
@@ -1,10 +1,12 @@
1
1
  import { IOdeServices } from './OdeServices';
2
2
  export declare const odeServices: IOdeServices;
3
3
  export * from '../directory/interface';
4
+ export * from '../nextcloud/interface';
4
5
  export type { ILinkedResource } from '../resources/behaviours/AbstractBehaviourService';
5
6
  export * from '../resources/interface';
6
7
  export * from '../resources/ResourceService';
7
8
  export * from '../resources/SnipletsService';
8
9
  export * from '../rights/interface';
9
10
  export * from '../share/interface';
11
+ export type { IWidgetPreferences } from '../widget/Service';
10
12
  export * from '../workspace/interface';
@@ -30,6 +30,7 @@ export declare class SessionService {
30
30
  private loadDescription;
31
31
  private getBookmarks;
32
32
  getUserProfile(options?: Partial<GetUserProfileOptions>): Promise<UserProfile>;
33
+ private getPerson;
33
34
  isAdml(): Promise<boolean>;
34
35
  /**
35
36
  * Get details of an application if the user can access it.
@@ -80,7 +80,7 @@ export type School = {
80
80
  id: string;
81
81
  name: string;
82
82
  UAI: string;
83
- exports: string[];
83
+ exports: string[] | null;
84
84
  };
85
85
  export type UserProfile = Array<'Student' | 'Teacher' | 'Relative' | 'Personnel' | 'Guest'>;
86
86
  export interface IUserDescription {
@@ -263,7 +263,10 @@ export interface IGetSession {
263
263
  userProfile?: UserProfile;
264
264
  bookmarkedApps: IWebApp[];
265
265
  }
266
+ export type IPerson = Pick<IUserDescription, 'address' | 'birthdate' | 'displayName' | 'email' | 'id' | 'login' | 'mobile' | 'photo' | 'relatedId' | 'relatedName' | 'relatedType' | 'schools' | 'tel' | 'userId' | 'visibleInfos'> & {
267
+ type: UserProfile;
268
+ };
266
269
  export type PersonApiResult = {
267
270
  status: 'ok' | string;
268
- result: Array<IUserDescription>;
271
+ result: Array<IPerson>;
269
272
  };
@@ -0,0 +1,13 @@
1
+ import { IOdeServices } from '../services/OdeServices';
2
+ import { WidgetUserPref } from './interfaces';
3
+ export interface IWidgetPreferences {
4
+ [widgetName: string]: WidgetUserPref;
5
+ }
6
+ export declare class WidgetService {
7
+ private context;
8
+ constructor(context: IOdeServices);
9
+ private get session();
10
+ getSystemWidgets(): Promise<import('..').IWidgetModel[] | undefined>;
11
+ getPreferences(): Promise<IWidgetPreferences>;
12
+ setPreferences(prefs: IWidgetPreferences): Promise<void>;
13
+ }
@@ -50,4 +50,3 @@ export type WidgetUserPref = {
50
50
  } & {
51
51
  [pref in WidgetSpecificUserPrefs]?: any;
52
52
  };
53
- export * from './LastInfos.widget';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/client",
3
- "version": "2.5.24",
3
+ "version": "2.6.0-develop-integration.20260710151131",
4
4
  "description": "Edifice TypeScript Client",
5
5
  "keywords": [
6
6
  "typescript",
@@ -37,7 +37,7 @@
37
37
  "axios": "1.13.4",
38
38
  "core-js": "3.48.0",
39
39
  "ua-parser-js": "2.0.9",
40
- "@edifice.io/utilities": "2.5.24"
40
+ "@edifice.io/utilities": "2.6.0-develop-integration.20260710151131"
41
41
  },
42
42
  "devDependencies": {
43
43
  "@types/jasmine": "5.1.4",
@@ -49,7 +49,7 @@
49
49
  "typedoc-plugin-markdown": "3.17.1",
50
50
  "vite": "5.4.14",
51
51
  "vite-plugin-dts": "4.5.4",
52
- "@edifice.io/config": "2.5.24"
52
+ "@edifice.io/config": "2.6.0-develop-integration.20260710151131"
53
53
  },
54
54
  "scripts": {
55
55
  "build": "vite build",
@@ -1,15 +0,0 @@
1
- export interface ILastInfosModel {
2
- date: string;
3
- shared: [];
4
- thread_icon: string;
5
- thread_id: number;
6
- thread_title: string;
7
- title: string;
8
- username: string;
9
- _id: number;
10
- }
11
- export declare class LastInfosWidget {
12
- loadInfos(maxResults: number): Promise<ILastInfosModel[]>;
13
- getMaxResults(): Promise<number>;
14
- setMaxResults(maxResults: number): Promise<void>;
15
- }