@edifice.io/client 2.5.4-develop-b2school.20251215115453 → 2.5.4-develop-pedago.20251217124252

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.
@@ -25,7 +25,7 @@ export declare class RightService {
25
25
  */
26
26
  parseResourceRights(rights: RightStringified[]): ResourceRight[];
27
27
  /**
28
- * Check wether a user has the expected right for a resource
28
+ * Check wether a user has the expected right for a ressource
29
29
  * @param user the userId and groupId concerned by the check
30
30
  * @param expect the expected right to check
31
31
  * @param rights array of Right for the resource
@@ -1,19 +1,18 @@
1
1
  import { IOdeServices } from '../services/OdeServices';
2
- import { GetResourceRightPayload, PutSharePayload, PutShareResponse, ShareMapping, ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles, ShareSubject, ShareUrls } from './interface';
2
+ import { GetResourceRightPayload, PutShareResponse, ShareMapping, ShareRight, ShareRightAction, ShareRightActionDisplayName, ShareRightWithVisibles, ShareSubject } from './interface';
3
3
  export declare class ShareService {
4
4
  protected context: IOdeServices;
5
5
  constructor(context: IOdeServices);
6
6
  get directory(): import('../directory/Service').DirectoryService;
7
7
  get http(): import('../transport/Service').HttpService;
8
8
  get cache(): import('../cache/Service').CacheService;
9
- searchShareSubjects(app: string, resourceId: string, searchText: string, urlResourceRights?: string): Promise<ShareSubject[]>;
10
- getShareMapping(app: string, urlShareMapping?: string): Promise<ShareMapping>;
9
+ searchShareSubjects(app: string, resourceId: string, searchText: string): Promise<ShareSubject[]>;
10
+ getShareMapping(app: string): Promise<ShareMapping>;
11
11
  getActionsAvailableFor({ id, type }: {
12
12
  id: string;
13
13
  type: 'user' | 'group';
14
14
  }, payload: GetResourceRightPayload, mapping: ShareMapping): ShareRightActionDisplayName[];
15
- getRightsForResource(app: string, resourceId: string, shareUrls?: ShareUrls): Promise<ShareRightWithVisibles>;
16
- getPutSharePayload(app: string, rights: ShareRight[], urlGetShareMapping?: string): Promise<PutSharePayload>;
17
- saveRights(app: string, resourceId: string, rights: ShareRight[], urls?: ShareUrls): Promise<PutShareResponse>;
18
- getActionsForApp(app: string, urlShareMapping?: string): Promise<ShareRightAction[]>;
15
+ getRightsForResource(app: string, resourceId: string): Promise<ShareRightWithVisibles>;
16
+ saveRights(app: string, resourceId: string, rights: ShareRight[]): Promise<PutShareResponse>;
17
+ getActionsForApp(app: string): Promise<ShareRightAction[]>;
19
18
  }
@@ -1,19 +1,4 @@
1
- import { Bookmark, Group, User } from '../directory/interface';
2
- /**
3
- * Represents a share right for a user, group, or bookmark with associated permissions and metadata.
4
- *
5
- * @interface ShareRight
6
- * @property {string} id - Unique identifier for the share right
7
- * @property {ShareRightType} type - Type of entity being shared with (user, group, or sharebookmark)
8
- * @property {string} displayName - Human-readable name for display purposes
9
- * @property {string} [profile] - User profile information (only applicable when type is 'user')
10
- * @property {string} avatarUrl - URL to the entity's avatar image
11
- * @property {string} directoryUrl - URL to the entity's directory page
12
- * @property {ShareRightAction[]} actions - Array of available actions/permissions for this share right
13
- * @property {boolean} [isBookmarkMember] - Indicates if the entity is a member of a bookmark
14
- * @property {User[]} [users] - Array of users associated with a bookmark (when type is 'sharebookmark')
15
- * @property {Group[]} [groups] - Array of groups associated with a bookmark (when type is 'sharebookmark')
16
- */
1
+ import { Group, Bookmark, User } from '../directory/interface';
17
2
  export interface ShareRight {
18
3
  id: string;
19
4
  type: ShareRightType;
@@ -26,13 +11,6 @@ export interface ShareRight {
26
11
  users?: User[];
27
12
  groups?: Group[];
28
13
  }
29
- /**
30
- * Parameters for sharing operations containing resource ID and associated rights.
31
- *
32
- * @interface ShareParameters
33
- * @property {string} id - Unique identifier of the resource being shared
34
- * @property {ShareRight[]} rights - Array of share rights defining who has access and what permissions they have
35
- */
36
14
  export interface ShareParameters {
37
15
  id: string;
38
16
  rights: ShareRight[];
@@ -42,14 +20,8 @@ export interface ShareParameters {
42
20
  * */
43
21
  export type ShareRightType = 'user' | 'group' | 'sharebookmark';
44
22
  /**
45
- * Represents an action that can be performed on a shared resource.
46
- *
47
- * @interface ShareRightAction
48
- * @property {ShareRightActionDisplayName} id - Unique identifier for the action
49
- * @property {ShareRightActionDisplayName} displayName - Display name for the action
50
- * @property {number} [priority] - Priority level of the action (higher values indicate higher priority)
51
- * @property {ShareRightActionDisplayName[]} [requires] - Array of action names that are required as prerequisites for this action
52
- */
23
+ * Type of action when sharing
24
+ * */
53
25
  export interface ShareRightAction {
54
26
  id: ShareRightActionDisplayName;
55
27
  displayName: ShareRightActionDisplayName;
@@ -61,35 +33,15 @@ export interface ShareRightAction {
61
33
  * */
62
34
  export type ShareRightActionDisplayName = 'read' | 'contrib' | 'manage' | 'publish' | 'manager' | 'comment';
63
35
  export type ShareRightActionDisplayNameExt = ShareRightActionDisplayName | 'creator';
64
- /**
65
- * Configuration object defining sharing rights with their properties including priority, default status, and dependencies.
66
- *
67
- * @type {SharingRight}
68
- * @description Record mapping each ShareRightActionDisplayName to an object containing:
69
- * - priority: Numeric priority level
70
- * - default: Whether this right is selected by default
71
- * - requires: Array of prerequisite action names
72
- */
73
36
  export type SharingRight = Record<ShareRightActionDisplayName, {
74
37
  priority: number;
75
38
  default: boolean;
76
39
  requires: ShareRightActionDisplayName[];
77
40
  }>;
78
- /**
79
- * Mapping of share right actions to their corresponding backend permission strings.
80
- *
81
- * @type {ShareMapping}
82
- * @description Record mapping each ShareRightActionDisplayName to an array of backend permission strings
83
- */
84
41
  export type ShareMapping = Record<ShareRightActionDisplayName, string[]>;
85
42
  /**
86
- * Payload structure returned when fetching resource rights information.
87
- *
88
- * @interface GetResourceRightPayload
89
- * @property {Array} actions - Available actions with their metadata including name arrays, display names, and type
90
- * @property {Object} groups - Group information including visible groups and their checked permissions
91
- * @property {Object} users - User information including visible users and their checked permissions
92
- */
43
+ * Payload of shared resource
44
+ * */
93
45
  export interface GetResourceRightPayload {
94
46
  actions: Array<{
95
47
  name: string[];
@@ -119,24 +71,16 @@ export interface GetResourceRightPayload {
119
71
  };
120
72
  }
121
73
  /**
122
- * Payload structure for updating shared resource permissions.
123
- *
124
- * @interface PutSharePayload
125
- * @property {Record<string, string[]>} users - Mapping of user IDs to their assigned permission arrays
126
- * @property {Record<string, string[]>} groups - Mapping of group IDs to their assigned permission arrays
127
- * @property {Record<string, string[]>} bookmarks - Mapping of bookmark IDs to their assigned permission arrays
128
- */
74
+ * Update payload of shared resource
75
+ * */
129
76
  export interface PutSharePayload {
130
77
  users: Record<string, string[]>;
131
78
  groups: Record<string, string[]>;
132
79
  bookmarks: Record<string, string[]>;
133
80
  }
134
81
  /**
135
- * Response structure returned after updating shared resource permissions.
136
- *
137
- * @interface PutShareResponse
138
- * @property {Array} notify-timeline-array - Array of notification objects containing either groupId or userId for timeline notifications
139
- */
82
+ * Response of shared resource
83
+ * */
140
84
  export interface PutShareResponse {
141
85
  'notify-timeline-array': Array<{
142
86
  groupId: string;
@@ -144,18 +88,6 @@ export interface PutShareResponse {
144
88
  userId: string;
145
89
  }>;
146
90
  }
147
- /**
148
- * Represents a subject (user, group, or bookmark) that can be involved in sharing operations.
149
- *
150
- * @interface ShareSubject
151
- * @property {string} id - Unique identifier
152
- * @property {string} displayName - Human-readable display name
153
- * @property {string} [profile] - Profile information (applicable for users)
154
- * @property {string} avatarUrl - URL to avatar image
155
- * @property {string} directoryUrl - URL to directory page
156
- * @property {'user' | 'group' | 'sharebookmark'} type - Type of subject
157
- * @property {string} [structureName] - Name of the organizational structure (applicable for groups)
158
- */
159
91
  export interface ShareSubject {
160
92
  id: string;
161
93
  displayName: string;
@@ -165,51 +97,9 @@ export interface ShareSubject {
165
97
  type: 'user' | 'group' | 'sharebookmark';
166
98
  structureName?: string;
167
99
  }
168
- /**
169
- * Extended structure containing share rights along with all visible entities that can be shared with.
170
- *
171
- * @interface ShareRightWithVisibles
172
- * @property {ShareRight[]} rights - Current share rights configuration
173
- * @property {User[]} visibleUsers - Array of users available for sharing
174
- * @property {Group[]} visibleGroups - Array of groups available for sharing
175
- * @property {Bookmark[]} visibleBookmarks - Array of bookmarks available for sharing
176
- */
177
100
  export interface ShareRightWithVisibles {
178
101
  rights: ShareRight[];
179
102
  visibleUsers: User[];
180
103
  visibleGroups: Group[];
181
104
  visibleBookmarks: Bookmark[];
182
105
  }
183
- /**
184
- * Configuration object containing URLs for various sharing-related API endpoints.
185
- *
186
- * @type {ShareUrls}
187
- * @property {string} [getResourceRights] - Optional URL endpoint for fetching resource rights
188
- * @property {string} [saveResourceRights] - Optional URL endpoint for saving/updating resource rights
189
- * @property {string} [getShareMapping] - Optional URL endpoint for retrieving share action mappings
190
- *
191
- * @example Example related to sharing thread resources:
192
- * ```ts
193
- * const shareUrls: ShareUrls = {
194
- * getResourceRights: '/api/V1/thread/shares', (get endpoint)
195
- * saveResourceRights: '/api/V1/thread/shares', (put endpoint)
196
- * getShareMapping: '/api/V1/rights/sharing'
197
- * }
198
- * };
199
- * ```
200
- *
201
- * @example Example related to sharing info resources:
202
- * ```ts
203
- * const shareUrls: ShareUrls = {
204
- * getResourceRights: '/api/V1/info/shares', (get endpoint)
205
- * saveResourceRights: '/api/V1/info/shares', (put endpoint)
206
- * getShareMapping: '/api/V1/rights/sharing'
207
- * }
208
- * };
209
- * ```
210
- */
211
- export type ShareUrls = {
212
- getResourceRights?: string;
213
- saveResourceRights?: string;
214
- getShareMapping?: string;
215
- };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edifice.io/client",
3
- "version": "2.5.4-develop-b2school.20251215115453",
3
+ "version": "2.5.4-develop-pedago.20251217124252",
4
4
  "description": "Edifice TypeScript Client",
5
5
  "keywords": [
6
6
  "typescript",
@@ -36,7 +36,7 @@
36
36
  "dependencies": {
37
37
  "axios": "^1.7.7",
38
38
  "core-js": "^3.35.1",
39
- "@edifice.io/utilities": "2.5.4-develop-b2school.20251215115453"
39
+ "@edifice.io/utilities": "2.5.4-develop-pedago.20251217124252"
40
40
  },
41
41
  "devDependencies": {
42
42
  "@types/jasmine": "5.1.4",
@@ -48,7 +48,7 @@
48
48
  "typedoc-plugin-markdown": "3.17.1",
49
49
  "vite": "^5.4.11",
50
50
  "vite-plugin-dts": "^4.1.0",
51
- "@edifice.io/config": "2.5.4-develop-b2school.20251215115453"
51
+ "@edifice.io/config": "2.5.4-develop-pedago.20251217124252"
52
52
  },
53
53
  "scripts": {
54
54
  "build": "vite build",