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.
Files changed (104) 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/analytics/Service.d.ts +17 -0
  5. package/dist/{ts/apps → apps}/timeline/Framework.d.ts +0 -1
  6. package/dist/{ts/apps → apps}/timeline/Notification.model.d.ts +0 -1
  7. package/dist/{ts/apps → apps}/timeline/interfaces.d.ts +0 -1
  8. package/dist/cache/Service.d.ts +14 -0
  9. package/dist/configure/Analytics.d.ts +40 -0
  10. package/dist/{ts/configure → configure}/AppConf.d.ts +3 -1
  11. package/dist/{ts/configure → configure}/Framework.d.ts +1 -2
  12. package/dist/configure/Service.d.ts +17 -0
  13. package/dist/{ts/configure → configure}/Theme.d.ts +0 -1
  14. package/dist/{ts/configure → configure}/User.d.ts +0 -1
  15. package/dist/{ts/configure → configure}/interfaces.d.ts +24 -5
  16. package/dist/directory/Service.d.ts +17 -0
  17. package/dist/directory/interface.d.ts +53 -0
  18. package/dist/{ts/explore → explore}/Agent.d.ts +0 -1
  19. package/dist/{ts/explore → explore}/AgentLoader.d.ts +0 -2
  20. package/dist/{ts/explore → explore}/Bus.d.ts +0 -1
  21. package/dist/{ts/explore → explore}/Context.d.ts +3 -2
  22. package/dist/{ts/explore → explore}/Framework.d.ts +2 -2
  23. package/dist/{ts/explore → explore}/interfaces.d.ts +107 -28
  24. package/dist/{ts/globals.d.ts → globals.d.ts} +3 -3
  25. package/dist/{ts/configure → idiom}/Idiom.d.ts +6 -3
  26. package/dist/idiom/Service.d.ts +24 -0
  27. package/dist/idiom/interfaces.d.ts +22 -0
  28. package/dist/index.cjs.d.ts +1 -0
  29. package/dist/index.d.ts +10 -0
  30. package/dist/legacy/Behaviours.d.ts +35 -0
  31. package/dist/legacy/entcore.d.ts +7 -0
  32. package/dist/legacy/http.d.ts +24 -0
  33. package/dist/legacy/me.d.ts +12 -0
  34. package/dist/legacy/rights.d.ts +55 -0
  35. package/dist/{ts/notify → notify}/Framework.d.ts +0 -1
  36. package/dist/{ts/notify → notify}/interfaces.d.ts +2 -3
  37. package/dist/ode-ts-client.js +16 -15
  38. package/dist/ode-ts-client.js.map +1 -1
  39. package/dist/ode-ts-client.mjs +7824 -0
  40. package/dist/ode-ts-client.mjs.map +1 -0
  41. package/dist/resources/BlogResourceService.d.ts +11 -0
  42. package/dist/resources/ResourceService.d.ts +55 -0
  43. package/dist/resources/interface.d.ts +26 -0
  44. package/dist/rights/Service.d.ts +78 -0
  45. package/dist/rights/interface.d.ts +16 -0
  46. package/dist/services/OdeServices.d.ts +48 -0
  47. package/dist/services/index.d.ts +7 -0
  48. package/dist/{ts/session → session}/Framework.d.ts +2 -1
  49. package/dist/session/Service.d.ts +32 -0
  50. package/dist/{ts/session → session}/Session.d.ts +5 -3
  51. package/dist/{ts/session → session}/interfaces.d.ts +32 -4
  52. package/dist/share/Service.d.ts +18 -0
  53. package/dist/share/interface.d.ts +99 -0
  54. package/dist/{ts/transport → transport}/Framework.d.ts +0 -1
  55. package/dist/{ts/transport → transport}/Http.d.ts +0 -1
  56. package/dist/transport/Service.d.ts +25 -0
  57. package/dist/{ts/transport → transport}/interfaces.d.ts +3 -1
  58. package/dist/utils/FileTypeUtils.d.ts +6 -0
  59. package/dist/utils/MimeTypeUtils.d.ts +20 -0
  60. package/dist/utils/StringUtils.d.ts +3 -0
  61. package/dist/version.txt +1 -1
  62. package/dist/{ts/widget → widget}/Framework.d.ts +0 -1
  63. package/dist/{ts/widget → widget}/LastInfos.widget.d.ts +0 -1
  64. package/dist/{ts/widget → widget}/interfaces.d.ts +2 -2
  65. package/dist/workspace/Service.d.ts +12 -0
  66. package/dist/workspace/interface.d.ts +48 -0
  67. package/package.json +43 -29
  68. package/dist/test/Foundation.spec.d.ts +0 -2
  69. package/dist/test/Foundation.spec.d.ts.map +0 -1
  70. package/dist/test/mocks/agents/MockedAgentLoader.d.ts +0 -9
  71. package/dist/test/mocks/agents/MockedAgentLoader.d.ts.map +0 -1
  72. package/dist/test/mocks/agents/MockedFolderAgent.d.ts +0 -15
  73. package/dist/test/mocks/agents/MockedFolderAgent.d.ts.map +0 -1
  74. package/dist/ts/apps/timeline/Framework.d.ts.map +0 -1
  75. package/dist/ts/apps/timeline/Notification.model.d.ts.map +0 -1
  76. package/dist/ts/apps/timeline/interfaces.d.ts.map +0 -1
  77. package/dist/ts/configure/Analytics.d.ts +0 -19
  78. package/dist/ts/configure/Analytics.d.ts.map +0 -1
  79. package/dist/ts/configure/AppConf.d.ts.map +0 -1
  80. package/dist/ts/configure/Framework.d.ts.map +0 -1
  81. package/dist/ts/configure/Idiom.d.ts.map +0 -1
  82. package/dist/ts/configure/Theme.d.ts.map +0 -1
  83. package/dist/ts/configure/User.d.ts.map +0 -1
  84. package/dist/ts/configure/interfaces.d.ts.map +0 -1
  85. package/dist/ts/explore/Agent.d.ts.map +0 -1
  86. package/dist/ts/explore/AgentLoader.d.ts.map +0 -1
  87. package/dist/ts/explore/Bus.d.ts.map +0 -1
  88. package/dist/ts/explore/Context.d.ts.map +0 -1
  89. package/dist/ts/explore/Framework.d.ts.map +0 -1
  90. package/dist/ts/explore/interfaces.d.ts.map +0 -1
  91. package/dist/ts/globals.d.ts.map +0 -1
  92. package/dist/ts/index.d.ts +0 -12
  93. package/dist/ts/index.d.ts.map +0 -1
  94. package/dist/ts/notify/Framework.d.ts.map +0 -1
  95. package/dist/ts/notify/interfaces.d.ts.map +0 -1
  96. package/dist/ts/session/Framework.d.ts.map +0 -1
  97. package/dist/ts/session/Session.d.ts.map +0 -1
  98. package/dist/ts/session/interfaces.d.ts.map +0 -1
  99. package/dist/ts/transport/Framework.d.ts.map +0 -1
  100. package/dist/ts/transport/Http.d.ts.map +0 -1
  101. package/dist/ts/transport/interfaces.d.ts.map +0 -1
  102. package/dist/ts/widget/Framework.d.ts.map +0 -1
  103. package/dist/ts/widget/LastInfos.widget.d.ts.map +0 -1
  104. package/dist/ts/widget/interfaces.d.ts.map +0 -1
@@ -0,0 +1,11 @@
1
+ import { ResourceType } from "..";
2
+ import { BlogUpdate, UpdateResult } from "./interface";
3
+ import { ResourceService } from "./ResourceService";
4
+ export declare class BlogResourceService extends ResourceService {
5
+ update(parameters: BlogUpdate): Promise<UpdateResult>;
6
+ getResourceType(): ResourceType;
7
+ getApplication(): string;
8
+ getFormUrl(folderId?: string): string;
9
+ getViewUrl(resourceId: string): string;
10
+ getPrintUrl(resourceId: string, withComment?: boolean): string;
11
+ }
@@ -0,0 +1,55 @@
1
+ import { PublishParameters, PublishResult, GetContextParameters, GetContextResult, ISearchResults, CreateFolderParameters, MoveParameters, IActionResult, TrashParameters, CreateFolderResult, UpdateFolderParameters, ID, GetSubFoldersResult, DeleteParameters, ResourceType } from "..";
2
+ import { OdeServices } from "../services/OdeServices";
3
+ import { UpdateParameters, UpdateResult } from "./interface";
4
+ export declare abstract class ResourceService {
5
+ protected context: OdeServices;
6
+ private static registry;
7
+ static register({ application, resourceType, }: {
8
+ application: string;
9
+ resourceType: string;
10
+ }, service: (context: OdeServices) => ResourceService): void;
11
+ static findService({ application, resourceType, }: {
12
+ application: string;
13
+ resourceType: string;
14
+ }, context: OdeServices): ResourceService;
15
+ static findMainService({ application }: {
16
+ application: string;
17
+ }, context: OdeServices): ResourceService;
18
+ constructor(context: OdeServices);
19
+ protected get http(): import("../transport/Service").HttpService;
20
+ abstract getApplication(): string;
21
+ abstract getPrintUrl(resourceId: string, withComment?: boolean): string;
22
+ abstract getViewUrl(resourceId: string): string;
23
+ abstract getFormUrl(folderId?: string): string;
24
+ abstract update<T extends UpdateParameters>(parameters: T): Promise<UpdateResult>;
25
+ abstract getResourceType(): ResourceType;
26
+ getShareReadUrl(id: string): string;
27
+ getSaveShareUrl(id: string): string;
28
+ gotoPrint(resourceId: string, withComment?: boolean): void;
29
+ gotoView(resourceId: string): void;
30
+ gotoForm(folderId?: string): void;
31
+ publish(parameters: PublishParameters): Promise<PublishResult>;
32
+ /** Create a search context. */
33
+ createContext(parameters: GetContextParameters): Promise<GetContextResult>;
34
+ /** Search / paginate within a search context. */
35
+ searchContext(parameters: GetContextParameters): Promise<ISearchResults>;
36
+ /** Create a new folder. */
37
+ createFolder(parameters: CreateFolderParameters): Promise<CreateFolderResult>;
38
+ /** Update folder. */
39
+ updateFolder(parameters: UpdateFolderParameters): Promise<CreateFolderResult>;
40
+ /** Move resources/folders to a folder. */
41
+ moveToFolder(parameters: MoveParameters): Promise<IActionResult>;
42
+ /** List subfolders of a parent folder. */
43
+ listSubfolders(folderId: ID): Promise<GetSubFoldersResult>;
44
+ /** Delete folders and/or resources. */
45
+ deleteAll(parameters: DeleteParameters): Promise<IActionResult>;
46
+ /** Trash folders and/or resources. */
47
+ trashAll({ resourceType, ...parameters }: Omit<TrashParameters, "trash">): Promise<IActionResult>;
48
+ /** Trash folders and/or resources. */
49
+ restoreAll({ resourceType, ...parameters }: Omit<TrashParameters, "trash">): Promise<IActionResult>;
50
+ protected checkHttpResponse: <R>(result: R) => R;
51
+ protected getThumbnailPath(thumb: string | Blob | File | undefined): Promise<string | undefined>;
52
+ private toQueryParams;
53
+ private createFolderToBodyParams;
54
+ private moveToBodyParams;
55
+ }
@@ -0,0 +1,26 @@
1
+ import { IResource } from "..";
2
+ /**
3
+ * Parameters expected to update resource
4
+ */
5
+ export interface UpdateParameters {
6
+ entId: string;
7
+ trashed: boolean;
8
+ name: string;
9
+ thumbnail: string | Blob | File;
10
+ description: string;
11
+ public: boolean;
12
+ slug: string;
13
+ }
14
+ /**
15
+ * Response when updating resource
16
+ */
17
+ export interface UpdateResult {
18
+ entId: string;
19
+ thumbnail?: string;
20
+ }
21
+ export interface BlogUpdate extends UpdateParameters {
22
+ "publish-type"?: "RESTRAINT" | "IMMEDIATE";
23
+ }
24
+ export interface BlogResource extends IResource {
25
+ "publish-type": "RESTRAINT" | "IMMEDIATE";
26
+ }
@@ -0,0 +1,78 @@
1
+ import { RightStringified } from "../explore/interfaces";
2
+ import { OdeServices } from "../services/OdeServices";
3
+ import { ResourceRight, RightRole } from "./interface";
4
+ export declare class RightService {
5
+ private context;
6
+ constructor(context: OdeServices);
7
+ get session(): import("../session/Service").SessionService;
8
+ /**
9
+ * Parse right concat as "$TYPE:$ID:$RIGHT"
10
+ * $TYPE = user | group | creator
11
+ * $ID: id of the resource
12
+ * $RIGHT: read | contrib | manage
13
+ *
14
+ * @param right a concat right
15
+ * @returns Right parsed
16
+ */
17
+ parseResourceRight(right: RightStringified): ResourceRight | undefined;
18
+ /**
19
+ * Parse an array of rights concat as "$TYPE:$ID:$RIGHT"
20
+ * $TYPE = user | group | creator
21
+ * $ID: id of the resource
22
+ * $RIGHT: read | contrib | manage
23
+ *
24
+ * @param rights a list of concat rights
25
+ * @returns Array of Right parsed
26
+ */
27
+ parseResourceRights(rights: RightStringified[]): ResourceRight[];
28
+ /**
29
+ * Check wether a user has the expected right for a ressource
30
+ * @param user the userId and groupId concerned by the check
31
+ * @param expect the expected right to check
32
+ * @param rights array of Right for the resource
33
+ * @returns true if has rights
34
+ */
35
+ hasResourceRight({ id, groupIds }: {
36
+ id: string;
37
+ groupIds: string[];
38
+ }, expect: RightRole, rights: ResourceRight[] | RightStringified[]): boolean;
39
+ /**
40
+ * Check wether the current user have resource right
41
+ * @param expect the expected right to check
42
+ * @param rights array of Right for the resource
43
+ * @returns true if has rights
44
+ */
45
+ sessionHasResourceRight(expect: RightRole, rights: ResourceRight[] | RightStringified[]): Promise<boolean>;
46
+ /**
47
+ * Check wether the current user have at least one of resource right expected
48
+ * @param expects array of expected right to check
49
+ * @param rights array of Right for the resource
50
+ * @returns true if has rights
51
+ */
52
+ sessionHasAtLeastOneResourceRight(expects: RightRole[], rights: ResourceRight[] | RightStringified[]): Promise<boolean>;
53
+ /**
54
+ * Check wether the current user has resource right for each right list
55
+ * @param expect expected right to check
56
+ * @param rightsArray array of array of Right for multiple resources
57
+ * @returns true if has rights
58
+ */
59
+ sessionHasResourceRightForEachList(expect: RightRole, rightsArray: ResourceRight[][] | RightStringified[][]): Promise<boolean>;
60
+ /**
61
+ * Check wether the current user have at least one of resource right for each right list
62
+ * @param expects array of expected right to check
63
+ * @param rightsArray array of array of Right for multiple resources
64
+ * @returns true if has rights
65
+ */
66
+ sessionHasAtLeastOneResourceRightForEachList(expects: RightRole[], rightsArray: ResourceRight[][] | RightStringified[][]): Promise<boolean>;
67
+ hasWorkflowRight(expect: string, right: string[]): boolean;
68
+ /**
69
+ * @param expect a workflow right
70
+ * @returns true if current session has right on it
71
+ */
72
+ sessionHasWorkflowRight(expect: string): Promise<boolean>;
73
+ /**
74
+ * @param expect a workflow right
75
+ * @returns a record with right as key and boolean as value if current session has right on it
76
+ */
77
+ sessionHasWorkflowRights(expects: string[]): Promise<Record<string, boolean>>;
78
+ }
@@ -0,0 +1,16 @@
1
+ /**
2
+ * Identify the type of "user"
3
+ */
4
+ export declare type RightSubject = "user" | "group" | "creator";
5
+ /**
6
+ * Identify the role of the right
7
+ */
8
+ export declare type RightRole = "read" | "contrib" | "manager" | "creator";
9
+ /**
10
+ * Right of a resource
11
+ */
12
+ export interface ResourceRight {
13
+ type: RightSubject;
14
+ id: string;
15
+ right: RightRole;
16
+ }
@@ -0,0 +1,48 @@
1
+ import { CacheService } from "../cache/Service";
2
+ import { ConfService } from "../configure/Service";
3
+ import { DirectoryService } from "../directory/Service";
4
+ import { HttpService } from "../transport/Service";
5
+ import { ResourceService } from "../resources/ResourceService";
6
+ import { RightService } from "../rights/Service";
7
+ import { SessionService } from "../session/Service";
8
+ import { ShareService } from "../share/Service";
9
+ import { WorkspaceService } from "../workspace/Service";
10
+ import { IdiomService } from "../idiom/Service";
11
+ import { AnalyticsService } from "../analytics/Service";
12
+ export interface IOdeServices {
13
+ analytics(): AnalyticsService;
14
+ cache(): CacheService;
15
+ conf(): ConfService;
16
+ directory(): DirectoryService;
17
+ http(): HttpService;
18
+ idiom(): IdiomService;
19
+ resource(application: string, resourceType?: string): ResourceService;
20
+ rights(): RightService;
21
+ session(): SessionService;
22
+ share(): ShareService;
23
+ workspace(): WorkspaceService;
24
+ }
25
+ export declare class OdeServices implements IOdeServices {
26
+ private _analytics;
27
+ private _cache;
28
+ private _conf;
29
+ private _directory;
30
+ private _http;
31
+ private _idiom;
32
+ private _rights;
33
+ private _session;
34
+ private _share;
35
+ private _workspace;
36
+ constructor();
37
+ analytics(): AnalyticsService;
38
+ cache(): CacheService;
39
+ conf(): ConfService;
40
+ directory(): DirectoryService;
41
+ http(): HttpService;
42
+ idiom(): IdiomService;
43
+ resource(application: string, resourceType?: string): ResourceService;
44
+ rights(): RightService;
45
+ session(): SessionService;
46
+ share(): ShareService;
47
+ workspace(): WorkspaceService;
48
+ }
@@ -0,0 +1,7 @@
1
+ import { IOdeServices } from "./OdeServices";
2
+ export declare const odeServices: IOdeServices;
3
+ export * from "../directory/interface";
4
+ export * from "../resources/interface";
5
+ export * from "../rights/interface";
6
+ export * from "../share/interface";
7
+ export * from "../workspace/interface";
@@ -3,7 +3,8 @@ import { Session } from "./Session";
3
3
  export declare class SessionFramework implements ISessionFramework {
4
4
  session: Session;
5
5
  initialize(): Promise<void>;
6
+ login(email: string, password: string, rememberMe?: boolean, secureLocation?: boolean): Promise<void>;
7
+ logout(): Promise<void>;
6
8
  }
7
9
  /** The whole framework is a singleton. */
8
10
  export declare const session: SessionFramework;
9
- //# sourceMappingURL=Framework.d.ts.map
@@ -0,0 +1,32 @@
1
+ import { IGetSession, IQuotaAndUsage, IUserInfo, UserProfile } from "./interfaces";
2
+ import { IOdeServices } from "../services/OdeServices";
3
+ export declare class SessionService {
4
+ private context;
5
+ constructor(context: IOdeServices);
6
+ get http(): import("../transport/Service").HttpService;
7
+ get cache(): import("../cache/Service").CacheService;
8
+ /**
9
+ * Callback to call when user logout
10
+ */
11
+ onLogout(): void;
12
+ /**
13
+ * Callback to call when session change
14
+ */
15
+ onRefreshSession(): void;
16
+ getSession(): Promise<IGetSession>;
17
+ login(email: string, password: string, rememberMe?: boolean, secureLocation?: boolean): Promise<void>;
18
+ logout(): Promise<void>;
19
+ latestQuotaAndUsage(user: IUserInfo | undefined): Promise<IQuotaAndUsage>;
20
+ getCurrentLanguage(user: IUserInfo | undefined): Promise<string | undefined>;
21
+ private loadUserLanguage;
22
+ private loadDefaultLanguage;
23
+ getUser(): Promise<IUserInfo | undefined>;
24
+ hasWorkflow({ workflowName, user, }: {
25
+ workflowName: string;
26
+ user: IUserInfo;
27
+ }): boolean;
28
+ private loadDescription;
29
+ private getBookmarks;
30
+ getUserProfile(options?: any): Promise<UserProfile>;
31
+ isAdml(): Promise<boolean>;
32
+ }
@@ -1,10 +1,11 @@
1
- import { IEmailValidationInfos, IEmailValidationState, IMfaCodeState, IMfaInfos, IMobileValidationInfos, IMobileValidationState, IQuotaAndUsage, ISession, IUserDescription, IUserInfo } from "./interfaces";
1
+ import { IEmailValidationInfos, IEmailValidationState, IMfaCodeState, IMfaInfos, IMobileValidationInfos, IMobileValidationState, IQuotaAndUsage, ISession, IUserDescription, IUserInfo, UserProfile } from "./interfaces";
2
2
  import { App } from "../globals";
3
3
  export declare class Session implements ISession {
4
4
  private _me;
5
5
  private _currentLanguage;
6
6
  private _notLoggedIn;
7
7
  private _description?;
8
+ private _profile?;
8
9
  get currentLanguage(): string;
9
10
  get notLoggedIn(): boolean;
10
11
  get description(): IUserDescription;
@@ -18,8 +19,10 @@ export declare class Session implements ISession {
18
19
  get latestQuotaAndUsage(): Promise<IQuotaAndUsage>;
19
20
  private setCurrentLanguage;
20
21
  private loadDefaultLanguage;
21
- private loadUserLanguage;
22
22
  private loadDescription;
23
+ get profile(): UserProfile;
24
+ getUserProfile(): Promise<UserProfile>;
25
+ private loadUserLanguage;
23
26
  getEmailValidationInfos(): Promise<IEmailValidationInfos>;
24
27
  checkEmail(email: String): Promise<void>;
25
28
  tryEmailValidation(code: String): Promise<IEmailValidationState>;
@@ -29,4 +32,3 @@ export declare class Session implements ISession {
29
32
  getMfaInfos(): Promise<IMfaInfos>;
30
33
  tryMfaCode(code: String): Promise<IMfaCodeState>;
31
34
  }
32
- //# sourceMappingURL=Session.d.ts.map
@@ -4,8 +4,20 @@ export declare abstract class SessionFrameworkFactory {
4
4
  static instance(): ISessionFramework;
5
5
  }
6
6
  export interface ISessionFramework {
7
+ /** Initialize once before use. */
7
8
  initialize(): Promise<void>;
9
+ /** The current user session. */
8
10
  session: ISession;
11
+ /** Log the current user in. */
12
+ login(email: string, password: string, rememberMe?: boolean, secureLocation?: boolean): Promise<void>;
13
+ /** Close the current user session. */
14
+ logout(): Promise<void>;
15
+ }
16
+ export interface ILoginModel {
17
+ email: string;
18
+ password: string;
19
+ rememberMe?: boolean;
20
+ secureLocation?: boolean;
9
21
  }
10
22
  export interface ISession {
11
23
  /** Language code (2-letters) actually applied. */
@@ -14,6 +26,8 @@ export interface ISession {
14
26
  readonly notLoggedIn: boolean;
15
27
  /** Additional information about the connected user. */
16
28
  readonly description: IUserDescription;
29
+ /** Additional profile user information. */
30
+ readonly profile: UserProfile;
17
31
  /**
18
32
  * Get the connected user's avatar URL, or a default one.
19
33
  * Append a query parameter to this URL for it to get resized, for example "?thumbnail=48x48"
@@ -27,6 +41,8 @@ export interface ISession {
27
41
  readonly latestQuotaAndUsage: Promise<IQuotaAndUsage>;
28
42
  hasWorkflow(workflowName: string): boolean;
29
43
  hasRight(resource: any, right: any): boolean;
44
+ /** Get User Profile */
45
+ getUserProfile(): Promise<UserProfile>;
30
46
  /** Verify if the logged-in user has a valid email address. */
31
47
  getEmailValidationInfos(): Promise<IEmailValidationInfos>;
32
48
  /**
@@ -62,11 +78,12 @@ export declare type School = {
62
78
  UAI: string;
63
79
  exports: string[];
64
80
  };
81
+ export declare type UserProfile = Array<"Student" | "Teacher" | "Relative" | "Personnel" | "Guest">;
65
82
  export interface IUserDescription {
66
83
  alertSize: boolean;
67
84
  health: string;
68
85
  hobbies: Array<Hobby>;
69
- mood: 'default' | 'happy' | 'proud' | 'dreamy' | 'love' | 'tired' | 'angry' | 'worried' | 'sick' | 'joker' | 'sad';
86
+ mood: "default" | "happy" | "proud" | "dreamy" | "love" | "tired" | "angry" | "worried" | "sick" | "joker" | "sad";
70
87
  motto: string;
71
88
  oldPicture?: string;
72
89
  picture: string;
@@ -88,7 +105,7 @@ export interface IUserDescription {
88
105
  relatedType?: any;
89
106
  schools: Array<School>;
90
107
  tel: string;
91
- profiles: Array<"Student" | "Teacher" | "Relative" | "Personnel" | "Guest">;
108
+ profiles: UserProfile;
92
109
  userId: string;
93
110
  visibleInfos: Array<string>;
94
111
  }
@@ -149,7 +166,7 @@ export declare const WIDGET_POSITION: {
149
166
  readonly LEFT: "left";
150
167
  readonly RIGHT: "right";
151
168
  };
152
- export declare type WidgetPosition = typeof WIDGET_POSITION[keyof typeof WIDGET_POSITION];
169
+ export declare type WidgetPosition = (typeof WIDGET_POSITION)[keyof typeof WIDGET_POSITION];
153
170
  export interface IWidgetModel {
154
171
  application?: string;
155
172
  position?: WidgetPosition;
@@ -233,4 +250,15 @@ export interface IMfaCodeState {
233
250
  /** (optional) Remaining number of times a code can be typed in. */
234
251
  tries?: number;
235
252
  }
236
- //# sourceMappingURL=interfaces.d.ts.map
253
+ export interface IGetSession {
254
+ user: IUserInfo | undefined;
255
+ currentLanguage: string | undefined;
256
+ quotaAndUsage: IQuotaAndUsage;
257
+ userDescription: IUserDescription;
258
+ userProfile?: UserProfile;
259
+ bookmarkedApps: IWebApp[];
260
+ }
261
+ export declare type PersonApiResult = {
262
+ status: "ok" | string;
263
+ result: Array<IUserDescription>;
264
+ };
@@ -0,0 +1,18 @@
1
+ import { OdeServices } from "../services/OdeServices";
2
+ import { GetResourceRightPayload, ShareMapping, ShareRightWithVisibles, PutShareResponse, ShareSubject, ShareRight, ShareRightAction, ShareRightActionDisplayName } from "./interface";
3
+ export declare class ShareService {
4
+ protected context: OdeServices;
5
+ constructor(context: OdeServices);
6
+ get directory(): import("../directory/Service").DirectoryService;
7
+ get http(): import("../transport/Service").HttpService;
8
+ get cache(): import("../cache/Service").CacheService;
9
+ searchShareSubjects(app: string, resourceId: string, searchText: string): Promise<ShareSubject[]>;
10
+ getShareMapping(app: string): Promise<ShareMapping>;
11
+ getActionsAvailableFor({ id, type }: {
12
+ id: string;
13
+ type: "user" | "group";
14
+ }, payload: GetResourceRightPayload, mapping: ShareMapping): ShareRightActionDisplayName[];
15
+ getRightsForResource(app: string, resourceId: string): Promise<ShareRightWithVisibles>;
16
+ saveRights(app: string, resourceId: string, rights: ShareRight[]): Promise<PutShareResponse>;
17
+ getActionsForApp(app: string): Promise<ShareRightAction[]>;
18
+ }
@@ -0,0 +1,99 @@
1
+ import { Group, Bookmark, User } from "../directory/interface";
2
+ export interface ShareRight {
3
+ id: string;
4
+ type: ShareRightType;
5
+ displayName: string;
6
+ profile?: string;
7
+ avatarUrl: string;
8
+ directoryUrl: string;
9
+ actions: ShareRightAction[];
10
+ isBookmarkMember?: boolean;
11
+ users?: User[];
12
+ groups?: Group[];
13
+ }
14
+ /**
15
+ * Type of share right
16
+ * */
17
+ export declare type ShareRightType = "user" | "group" | "sharebookmark";
18
+ /**
19
+ * Type of action when sharing
20
+ * */
21
+ export interface ShareRightAction {
22
+ id: ShareRightActionDisplayName;
23
+ displayName: ShareRightActionDisplayName;
24
+ priority?: number;
25
+ requires?: ShareRightActionDisplayName[];
26
+ }
27
+ /**
28
+ * Name of current action when sharing
29
+ * */
30
+ export declare type ShareRightActionDisplayName = "read" | "contrib" | "manage" | "publish" | "manager" | "comment";
31
+ export declare type ShareRightActionDisplayNameExt = ShareRightActionDisplayName | "creator";
32
+ export declare type SharingRight = Record<ShareRightActionDisplayName, {
33
+ priority: number;
34
+ default: boolean;
35
+ requires: ShareRightActionDisplayName[];
36
+ }>;
37
+ export declare type ShareMapping = Record<ShareRightActionDisplayName, string[]>;
38
+ /**
39
+ * Payload of shared resource
40
+ * */
41
+ export interface GetResourceRightPayload {
42
+ actions: Array<{
43
+ name: string[];
44
+ displayName: string;
45
+ type: "RESOURCE";
46
+ }>;
47
+ groups: {
48
+ visibles: Array<{
49
+ id: string;
50
+ name: string;
51
+ groupDisplayName: string;
52
+ structureName: string;
53
+ }>;
54
+ checked: Record<string, string[]>;
55
+ };
56
+ users: {
57
+ visibles: Array<{
58
+ id: string;
59
+ login: string;
60
+ username: string;
61
+ lastName: string;
62
+ firstName: string;
63
+ profile: string;
64
+ }>;
65
+ checked: Record<string, string[]>;
66
+ };
67
+ }
68
+ /**
69
+ * Update payload of shared resource
70
+ * */
71
+ export interface PutSharePayload {
72
+ users: Record<string, string[]>;
73
+ groups: Record<string, string[]>;
74
+ bookmarks: Record<string, string[]>;
75
+ }
76
+ /**
77
+ * Response of shared resource
78
+ * */
79
+ export interface PutShareResponse {
80
+ "notify-timeline-array": Array<{
81
+ groupId: string;
82
+ } | {
83
+ userId: string;
84
+ }>;
85
+ }
86
+ export interface ShareSubject {
87
+ id: string;
88
+ displayName: string;
89
+ profile?: string;
90
+ avatarUrl: string;
91
+ directoryUrl: string;
92
+ type: "user" | "group" | "sharebookmark";
93
+ }
94
+ export interface ShareRightWithVisibles {
95
+ rights: ShareRight[];
96
+ visibleUsers: User[];
97
+ visibleGroups: Group[];
98
+ visibleBookmarks: Bookmark[];
99
+ }
@@ -7,4 +7,3 @@ declare class TransportFramework implements ITransportFramework {
7
7
  /** The whole framework is a singleton. */
8
8
  export declare const transport: TransportFramework;
9
9
  export {};
10
- //# sourceMappingURL=Framework.d.ts.map
@@ -23,4 +23,3 @@ export declare class Http implements IHttp {
23
23
  /**
24
24
  * Promisified HTTP
25
25
  */
26
- //# sourceMappingURL=Http.d.ts.map
@@ -0,0 +1,25 @@
1
+ import { IHttpResponse, IHttpParams } from "./interfaces";
2
+ import { OdeServices } from "../services/OdeServices";
3
+ export declare class HttpService {
4
+ private context;
5
+ private axios;
6
+ private _latestResponse;
7
+ constructor(context: OdeServices, params?: any);
8
+ setCdn(cdnUrl: string): void;
9
+ private toAxiosConfig;
10
+ private toCdnUrl;
11
+ private mapAxiosError;
12
+ private mapAxiosResponse;
13
+ get latestResponse(): IHttpResponse;
14
+ get<R = any>(url: string, params?: IHttpParams): Promise<R>;
15
+ post<R = any>(url: string, data?: any, params?: IHttpParams): Promise<R>;
16
+ postFile<R = any>(url: string, data: any, params?: IHttpParams): Promise<R>;
17
+ postJson<R = any>(url: string, json: any, params?: IHttpParams): Promise<R>;
18
+ put<R = any>(url: string, data?: any, params?: IHttpParams): Promise<R>;
19
+ putFile<R = any>(url: string, data: FormData, params?: IHttpParams): Promise<any>;
20
+ putJson<R = any>(url: string, json: any, params?: IHttpParams): Promise<R>;
21
+ delete<R = any>(url: string, params?: IHttpParams): Promise<R>;
22
+ deleteJson<R = any>(url: string, json: any): Promise<R>;
23
+ getScript<R = any>(url: string, params?: IHttpParams, variableName?: string): Promise<R>;
24
+ loadScript(url: string, params?: IHttpParams): Promise<void>;
25
+ }
@@ -44,6 +44,7 @@ export interface IHttp {
44
44
  loadScript(url: string, params?: IHttpParams): Promise<void>;
45
45
  setCdn(url: string): void;
46
46
  }
47
+ export declare type IHttpParamsResponseType = "arraybuffer" | "blob" | "document" | "json" | "text" | "stream";
47
48
  export declare type IHttpParams = {
48
49
  /** Request the API to send a notification when done. */
49
50
  readonly requestName?: string;
@@ -57,10 +58,11 @@ export declare type IHttpParams = {
57
58
  readonly queryParams?: {
58
59
  [key: string]: any;
59
60
  };
61
+ /** Response Type */
62
+ readonly responseType?: IHttpParamsResponseType;
60
63
  };
61
64
  export declare type IHttpResponse = {
62
65
  status: number;
63
66
  statusText: string;
64
67
  headers?: any;
65
68
  };
66
- //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1,6 @@
1
+ export declare class FileTypeUtils {
2
+ private static fileTypes;
3
+ static registerContentTypeToFileType(mapper: ContentTypeToFileType): void;
4
+ static getFileType(fileType: string, previewRole?: boolean, extension?: string): string;
5
+ }
6
+ export declare type ContentTypeToFileType = (contentType: string, previewRole: boolean) => string | undefined;
@@ -0,0 +1,20 @@
1
+ export declare class MimeTypeUtils {
2
+ static INSTANCE: MimeTypeUtils;
3
+ private wordExtensions;
4
+ private excelExtensions;
5
+ private pptExtensions;
6
+ private fileExtensionMap;
7
+ private csvContentType;
8
+ private csvExtensions;
9
+ private txtExtensions;
10
+ PDF: string;
11
+ OCTET_STREAM: string;
12
+ constructor();
13
+ getContentTypeForExtension(extension: string): string | undefined;
14
+ getExtensionForContentType(contentType: string): string | null;
15
+ isWordLike(contentType: string, originalExt?: string): boolean;
16
+ isExcelLike(contentType: string, originalExt?: string): boolean;
17
+ isCsvLike(contentType: string, originalExt?: string): boolean;
18
+ isPowerpointLike(contentType: string, originalExt?: string): boolean;
19
+ isTxtLike(contentType: string, originalExt?: string): boolean;
20
+ }
@@ -0,0 +1,3 @@
1
+ export declare class StringUtils {
2
+ static removeAccents(str: string): string;
3
+ }
package/dist/version.txt CHANGED
@@ -1 +1 @@
1
- ode-ts-client=1.1.4 05/04/2023 16:27:50
1
+ ode-ts-client=1.2.0 12/01/2024 12:21:41
@@ -29,4 +29,3 @@ interface IWidgetUserPrefs {
29
29
  /** The whole framework is a singleton. */
30
30
  export declare const widgets: WidgetFramework;
31
31
  export {};
32
- //# sourceMappingURL=Framework.d.ts.map
@@ -13,4 +13,3 @@ export declare class LastInfosWidget {
13
13
  getMaxResults(): Promise<number>;
14
14
  setMaxResults(maxResults: number): Promise<void>;
15
15
  }
16
- //# sourceMappingURL=LastInfos.widget.d.ts.map
@@ -18,8 +18,9 @@ export declare const WIDGET_NAME: {
18
18
  readonly UNIVERSALIS: "universalis-widget";
19
19
  readonly BRIEFME: "briefme-widget";
20
20
  readonly SCHOOL: "school-widget";
21
+ readonly EDUMALIN: "edumalin-widget";
21
22
  };
22
- export declare type WidgetName = typeof WIDGET_NAME[keyof typeof WIDGET_NAME];
23
+ export declare type WidgetName = (typeof WIDGET_NAME)[keyof typeof WIDGET_NAME];
23
24
  export declare abstract class WidgetFrameworkFactory {
24
25
  static instance(): IWidgetFramework;
25
26
  }
@@ -51,4 +52,3 @@ export declare type WidgetUserPref = {
51
52
  [pref in WidgetSpecificUserPrefs]?: any;
52
53
  };
53
54
  export * from "./LastInfos.widget";
54
- //# sourceMappingURL=interfaces.d.ts.map