@memberjunction/ng-list-management 0.0.1 → 3.0.0
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/lib/components/list-management-dialog/list-management-dialog.component.d.ts +170 -0
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.js +943 -0
- package/dist/lib/components/list-management-dialog/list-management-dialog.component.js.map +1 -0
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts +137 -0
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.d.ts.map +1 -0
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.js +658 -0
- package/dist/lib/components/list-share-dialog/list-share-dialog.component.js.map +1 -0
- package/dist/lib/models/list-management.models.d.ts +206 -0
- package/dist/lib/models/list-management.models.d.ts.map +1 -0
- package/dist/lib/models/list-management.models.js +2 -0
- package/dist/lib/models/list-management.models.js.map +1 -0
- package/dist/lib/models/list-sharing.models.d.ts +193 -0
- package/dist/lib/models/list-sharing.models.d.ts.map +1 -0
- package/dist/lib/models/list-sharing.models.js +2 -0
- package/dist/lib/models/list-sharing.models.js.map +1 -0
- package/dist/lib/module.d.ts +44 -0
- package/dist/lib/module.d.ts.map +1 -0
- package/dist/lib/module.js +101 -0
- package/dist/lib/module.js.map +1 -0
- package/dist/lib/services/list-management.service.d.ts +69 -0
- package/dist/lib/services/list-management.service.d.ts.map +1 -0
- package/dist/lib/services/list-management.service.js +411 -0
- package/dist/lib/services/list-management.service.js.map +1 -0
- package/dist/lib/services/list-sharing.service.d.ts +98 -0
- package/dist/lib/services/list-sharing.service.d.ts.map +1 -0
- package/dist/lib/services/list-sharing.service.js +483 -0
- package/dist/lib/services/list-sharing.service.js.map +1 -0
- package/dist/public-api.d.ts +13 -0
- package/dist/public-api.d.ts.map +1 -0
- package/dist/public-api.js +23 -0
- package/dist/public-api.js.map +1 -0
- package/package.json +48 -6
- package/README.md +0 -45
|
@@ -0,0 +1,483 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { Metadata, RunView } from '@memberjunction/core';
|
|
3
|
+
import { BehaviorSubject } from 'rxjs';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
/**
|
|
6
|
+
* Known List ResourceType ID from the database
|
|
7
|
+
*/
|
|
8
|
+
const LIST_RESOURCE_TYPE_ID = 'E64D433E-F36B-1410-8560-0041FA62858A';
|
|
9
|
+
/**
|
|
10
|
+
* Service for managing list sharing using the existing ResourcePermission system.
|
|
11
|
+
* Lists are already registered as a ResourceType, so we use ResourcePermissions
|
|
12
|
+
* to share lists with users and roles.
|
|
13
|
+
*/
|
|
14
|
+
export class ListSharingService {
|
|
15
|
+
loadingSubject = new BehaviorSubject(false);
|
|
16
|
+
loading$ = this.loadingSubject.asObservable();
|
|
17
|
+
// Cache for users and roles (for autocomplete)
|
|
18
|
+
usersCache = null;
|
|
19
|
+
rolesCache = null;
|
|
20
|
+
constructor() { }
|
|
21
|
+
/**
|
|
22
|
+
* Get the ResourceType ID for Lists
|
|
23
|
+
*/
|
|
24
|
+
getListResourceTypeId() {
|
|
25
|
+
return LIST_RESOURCE_TYPE_ID;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Get all shares for a specific list
|
|
29
|
+
*/
|
|
30
|
+
async getListShares(listId) {
|
|
31
|
+
this.loadingSubject.next(true);
|
|
32
|
+
try {
|
|
33
|
+
const rv = new RunView();
|
|
34
|
+
const result = await rv.RunView({
|
|
35
|
+
EntityName: 'Resource Permissions',
|
|
36
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND ResourceRecordID = '${listId}'`,
|
|
37
|
+
ResultType: 'entity_object'
|
|
38
|
+
});
|
|
39
|
+
if (!result.Success || !result.Results) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
// Convert to ListShareInfo objects with user/role details
|
|
43
|
+
const shares = [];
|
|
44
|
+
for (const permission of result.Results) {
|
|
45
|
+
const shareInfo = await this.convertToListShareInfo(permission);
|
|
46
|
+
if (shareInfo) {
|
|
47
|
+
shares.push(shareInfo);
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
return shares;
|
|
51
|
+
}
|
|
52
|
+
finally {
|
|
53
|
+
this.loadingSubject.next(false);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* Get permission level for a specific user on a specific list
|
|
58
|
+
*/
|
|
59
|
+
async getUserPermissionLevel(listId, userId) {
|
|
60
|
+
const rv = new RunView();
|
|
61
|
+
// Check direct user permission
|
|
62
|
+
const userResult = await rv.RunView({
|
|
63
|
+
EntityName: 'Resource Permissions',
|
|
64
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND ResourceRecordID = '${listId}' AND Type = 'User' AND UserID = '${userId}' AND Status = 'Approved'`,
|
|
65
|
+
ResultType: 'entity_object'
|
|
66
|
+
});
|
|
67
|
+
if (userResult.Success && userResult.Results && userResult.Results.length > 0) {
|
|
68
|
+
return userResult.Results[0].PermissionLevel;
|
|
69
|
+
}
|
|
70
|
+
// If no direct permission, could check role-based permissions
|
|
71
|
+
// For now, return null
|
|
72
|
+
return null;
|
|
73
|
+
}
|
|
74
|
+
/**
|
|
75
|
+
* Share a list with a user
|
|
76
|
+
*/
|
|
77
|
+
async shareListWithUser(listId, userId, permissionLevel, sharedByUserId) {
|
|
78
|
+
try {
|
|
79
|
+
const md = new Metadata();
|
|
80
|
+
// Check if share already exists
|
|
81
|
+
const existing = await this.findExistingShare(listId, 'User', userId);
|
|
82
|
+
if (existing) {
|
|
83
|
+
// Update existing share
|
|
84
|
+
existing.PermissionLevel = permissionLevel;
|
|
85
|
+
existing.Status = 'Approved';
|
|
86
|
+
const saved = await existing.Save();
|
|
87
|
+
return {
|
|
88
|
+
success: saved,
|
|
89
|
+
shareId: existing.ID,
|
|
90
|
+
message: saved ? 'Share updated successfully' : 'Failed to update share'
|
|
91
|
+
};
|
|
92
|
+
}
|
|
93
|
+
// Create new share
|
|
94
|
+
const permission = await md.GetEntityObject('Resource Permissions');
|
|
95
|
+
permission.NewRecord();
|
|
96
|
+
permission.ResourceTypeID = LIST_RESOURCE_TYPE_ID;
|
|
97
|
+
permission.ResourceRecordID = listId;
|
|
98
|
+
permission.Type = 'User';
|
|
99
|
+
permission.UserID = userId;
|
|
100
|
+
permission.PermissionLevel = permissionLevel;
|
|
101
|
+
permission.Status = 'Approved';
|
|
102
|
+
const saved = await permission.Save();
|
|
103
|
+
return {
|
|
104
|
+
success: saved,
|
|
105
|
+
shareId: permission.ID,
|
|
106
|
+
message: saved ? 'List shared successfully' : 'Failed to share list'
|
|
107
|
+
};
|
|
108
|
+
}
|
|
109
|
+
catch (error) {
|
|
110
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
111
|
+
return {
|
|
112
|
+
success: false,
|
|
113
|
+
message: `Error sharing list: ${errorMessage}`
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Share a list with a role
|
|
119
|
+
*/
|
|
120
|
+
async shareListWithRole(listId, roleId, permissionLevel, sharedByUserId) {
|
|
121
|
+
try {
|
|
122
|
+
const md = new Metadata();
|
|
123
|
+
// Check if share already exists
|
|
124
|
+
const existing = await this.findExistingShare(listId, 'Role', roleId);
|
|
125
|
+
if (existing) {
|
|
126
|
+
// Update existing share
|
|
127
|
+
existing.PermissionLevel = permissionLevel;
|
|
128
|
+
existing.Status = 'Approved';
|
|
129
|
+
const saved = await existing.Save();
|
|
130
|
+
return {
|
|
131
|
+
success: saved,
|
|
132
|
+
shareId: existing.ID,
|
|
133
|
+
message: saved ? 'Share updated successfully' : 'Failed to update share'
|
|
134
|
+
};
|
|
135
|
+
}
|
|
136
|
+
// Create new share
|
|
137
|
+
const permission = await md.GetEntityObject('Resource Permissions');
|
|
138
|
+
permission.NewRecord();
|
|
139
|
+
permission.ResourceTypeID = LIST_RESOURCE_TYPE_ID;
|
|
140
|
+
permission.ResourceRecordID = listId;
|
|
141
|
+
permission.Type = 'Role';
|
|
142
|
+
permission.RoleID = roleId;
|
|
143
|
+
permission.PermissionLevel = permissionLevel;
|
|
144
|
+
permission.Status = 'Approved';
|
|
145
|
+
const saved = await permission.Save();
|
|
146
|
+
return {
|
|
147
|
+
success: saved,
|
|
148
|
+
shareId: permission.ID,
|
|
149
|
+
message: saved ? 'List shared with role successfully' : 'Failed to share list with role'
|
|
150
|
+
};
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
154
|
+
return {
|
|
155
|
+
success: false,
|
|
156
|
+
message: `Error sharing list: ${errorMessage}`
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* Update permission level for an existing share
|
|
162
|
+
*/
|
|
163
|
+
async updateSharePermission(shareId, newPermissionLevel) {
|
|
164
|
+
try {
|
|
165
|
+
const md = new Metadata();
|
|
166
|
+
const permission = await md.GetEntityObject('Resource Permissions');
|
|
167
|
+
const loaded = await permission.Load(shareId);
|
|
168
|
+
if (!loaded) {
|
|
169
|
+
return {
|
|
170
|
+
success: false,
|
|
171
|
+
message: 'Share not found'
|
|
172
|
+
};
|
|
173
|
+
}
|
|
174
|
+
permission.PermissionLevel = newPermissionLevel;
|
|
175
|
+
const saved = await permission.Save();
|
|
176
|
+
return {
|
|
177
|
+
success: saved,
|
|
178
|
+
shareId: permission.ID,
|
|
179
|
+
message: saved ? 'Permission updated successfully' : 'Failed to update permission'
|
|
180
|
+
};
|
|
181
|
+
}
|
|
182
|
+
catch (error) {
|
|
183
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
184
|
+
return {
|
|
185
|
+
success: false,
|
|
186
|
+
message: `Error updating permission: ${errorMessage}`
|
|
187
|
+
};
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Remove a share (revoke access)
|
|
192
|
+
*/
|
|
193
|
+
async removeShare(shareId) {
|
|
194
|
+
try {
|
|
195
|
+
const md = new Metadata();
|
|
196
|
+
const permission = await md.GetEntityObject('Resource Permissions');
|
|
197
|
+
const loaded = await permission.Load(shareId);
|
|
198
|
+
if (!loaded) {
|
|
199
|
+
return {
|
|
200
|
+
success: false,
|
|
201
|
+
message: 'Share not found'
|
|
202
|
+
};
|
|
203
|
+
}
|
|
204
|
+
const deleted = await permission.Delete();
|
|
205
|
+
return {
|
|
206
|
+
success: deleted,
|
|
207
|
+
message: deleted ? 'Share removed successfully' : 'Failed to remove share'
|
|
208
|
+
};
|
|
209
|
+
}
|
|
210
|
+
catch (error) {
|
|
211
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
212
|
+
return {
|
|
213
|
+
success: false,
|
|
214
|
+
message: `Error removing share: ${errorMessage}`
|
|
215
|
+
};
|
|
216
|
+
}
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Get lists shared with the current user (that they don't own)
|
|
220
|
+
*/
|
|
221
|
+
async getListsSharedWithUser(userId) {
|
|
222
|
+
const rv = new RunView();
|
|
223
|
+
const result = await rv.RunView({
|
|
224
|
+
EntityName: 'Resource Permissions',
|
|
225
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND Type = 'User' AND UserID = '${userId}' AND Status = 'Approved'`,
|
|
226
|
+
Fields: ['ResourceRecordID'],
|
|
227
|
+
ResultType: 'simple'
|
|
228
|
+
});
|
|
229
|
+
if (!result.Success || !result.Results) {
|
|
230
|
+
return [];
|
|
231
|
+
}
|
|
232
|
+
return result.Results.map((r) => r.ResourceRecordID);
|
|
233
|
+
}
|
|
234
|
+
/**
|
|
235
|
+
* Get lists that the user has shared with others
|
|
236
|
+
*/
|
|
237
|
+
async getListsSharedByUser(userId) {
|
|
238
|
+
// First get all lists owned by the user
|
|
239
|
+
const rv = new RunView();
|
|
240
|
+
const listsResult = await rv.RunView({
|
|
241
|
+
EntityName: 'Lists',
|
|
242
|
+
ExtraFilter: `UserID = '${userId}'`,
|
|
243
|
+
Fields: ['ID'],
|
|
244
|
+
ResultType: 'simple'
|
|
245
|
+
});
|
|
246
|
+
if (!listsResult.Success || !listsResult.Results || listsResult.Results.length === 0) {
|
|
247
|
+
return new Map();
|
|
248
|
+
}
|
|
249
|
+
const listIds = listsResult.Results.map((l) => l.ID);
|
|
250
|
+
const listIdFilter = listIds.map((id) => `'${id}'`).join(',');
|
|
251
|
+
// Get all shares for these lists
|
|
252
|
+
const sharesResult = await rv.RunView({
|
|
253
|
+
EntityName: 'Resource Permissions',
|
|
254
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND ResourceRecordID IN (${listIdFilter}) AND Status = 'Approved'`,
|
|
255
|
+
Fields: ['ResourceRecordID'],
|
|
256
|
+
ResultType: 'simple'
|
|
257
|
+
});
|
|
258
|
+
const shareCountMap = new Map();
|
|
259
|
+
if (sharesResult.Success && sharesResult.Results) {
|
|
260
|
+
for (const share of sharesResult.Results) {
|
|
261
|
+
const typedShare = share;
|
|
262
|
+
const current = shareCountMap.get(typedShare.ResourceRecordID) || 0;
|
|
263
|
+
shareCountMap.set(typedShare.ResourceRecordID, current + 1);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return shareCountMap;
|
|
267
|
+
}
|
|
268
|
+
/**
|
|
269
|
+
* Check if user can share a list (must be owner or have Owner permission)
|
|
270
|
+
*/
|
|
271
|
+
async canUserShareList(listId, userId) {
|
|
272
|
+
const rv = new RunView();
|
|
273
|
+
// Check if user is the owner
|
|
274
|
+
const listResult = await rv.RunView({
|
|
275
|
+
EntityName: 'Lists',
|
|
276
|
+
ExtraFilter: `ID = '${listId}' AND UserID = '${userId}'`,
|
|
277
|
+
ResultType: 'simple'
|
|
278
|
+
});
|
|
279
|
+
if (listResult.Success && listResult.Results && listResult.Results.length > 0) {
|
|
280
|
+
return true;
|
|
281
|
+
}
|
|
282
|
+
// Check if user has Owner permission
|
|
283
|
+
const permissionLevel = await this.getUserPermissionLevel(listId, userId);
|
|
284
|
+
return permissionLevel === 'Owner';
|
|
285
|
+
}
|
|
286
|
+
/**
|
|
287
|
+
* Search users for sharing autocomplete
|
|
288
|
+
*/
|
|
289
|
+
async searchUsers(searchTerm, limit = 10) {
|
|
290
|
+
const rv = new RunView();
|
|
291
|
+
const result = await rv.RunView({
|
|
292
|
+
EntityName: 'Users',
|
|
293
|
+
ExtraFilter: `(Name LIKE '%${searchTerm}%' OR Email LIKE '%${searchTerm}%') AND IsActive = 1`,
|
|
294
|
+
OrderBy: 'Name',
|
|
295
|
+
MaxRows: limit,
|
|
296
|
+
ResultType: 'entity_object'
|
|
297
|
+
});
|
|
298
|
+
if (!result.Success || !result.Results) {
|
|
299
|
+
return [];
|
|
300
|
+
}
|
|
301
|
+
return result.Results.map(user => ({
|
|
302
|
+
id: user.ID,
|
|
303
|
+
name: user.Name,
|
|
304
|
+
email: user.Email,
|
|
305
|
+
type: 'User'
|
|
306
|
+
}));
|
|
307
|
+
}
|
|
308
|
+
/**
|
|
309
|
+
* Search roles for sharing autocomplete
|
|
310
|
+
*/
|
|
311
|
+
async searchRoles(searchTerm, limit = 10) {
|
|
312
|
+
const rv = new RunView();
|
|
313
|
+
const result = await rv.RunView({
|
|
314
|
+
EntityName: 'Roles',
|
|
315
|
+
ExtraFilter: `Name LIKE '%${searchTerm}%'`,
|
|
316
|
+
OrderBy: 'Name',
|
|
317
|
+
MaxRows: limit,
|
|
318
|
+
ResultType: 'entity_object'
|
|
319
|
+
});
|
|
320
|
+
if (!result.Success || !result.Results) {
|
|
321
|
+
return [];
|
|
322
|
+
}
|
|
323
|
+
return result.Results.map(role => ({
|
|
324
|
+
id: role.ID,
|
|
325
|
+
name: role.Name,
|
|
326
|
+
type: 'Role'
|
|
327
|
+
}));
|
|
328
|
+
}
|
|
329
|
+
/**
|
|
330
|
+
* Get all available users (cached)
|
|
331
|
+
*/
|
|
332
|
+
async getAllUsers(forceRefresh = false) {
|
|
333
|
+
if (!forceRefresh && this.usersCache) {
|
|
334
|
+
return this.usersCache;
|
|
335
|
+
}
|
|
336
|
+
const rv = new RunView();
|
|
337
|
+
const result = await rv.RunView({
|
|
338
|
+
EntityName: 'Users',
|
|
339
|
+
ExtraFilter: 'IsActive = 1',
|
|
340
|
+
OrderBy: 'Name',
|
|
341
|
+
ResultType: 'entity_object'
|
|
342
|
+
});
|
|
343
|
+
if (result.Success && result.Results) {
|
|
344
|
+
this.usersCache = result.Results;
|
|
345
|
+
return result.Results;
|
|
346
|
+
}
|
|
347
|
+
return [];
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Get all available roles (cached)
|
|
351
|
+
*/
|
|
352
|
+
async getAllRoles(forceRefresh = false) {
|
|
353
|
+
if (!forceRefresh && this.rolesCache) {
|
|
354
|
+
return this.rolesCache;
|
|
355
|
+
}
|
|
356
|
+
const rv = new RunView();
|
|
357
|
+
const result = await rv.RunView({
|
|
358
|
+
EntityName: 'Roles',
|
|
359
|
+
OrderBy: 'Name',
|
|
360
|
+
ResultType: 'entity_object'
|
|
361
|
+
});
|
|
362
|
+
if (result.Success && result.Results) {
|
|
363
|
+
this.rolesCache = result.Results;
|
|
364
|
+
return result.Results;
|
|
365
|
+
}
|
|
366
|
+
return [];
|
|
367
|
+
}
|
|
368
|
+
/**
|
|
369
|
+
* Helper to find existing share
|
|
370
|
+
*/
|
|
371
|
+
async findExistingShare(listId, type, recipientId) {
|
|
372
|
+
const rv = new RunView();
|
|
373
|
+
const idField = type === 'User' ? 'UserID' : 'RoleID';
|
|
374
|
+
const result = await rv.RunView({
|
|
375
|
+
EntityName: 'Resource Permissions',
|
|
376
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND ResourceRecordID = '${listId}' AND Type = '${type}' AND ${idField} = '${recipientId}'`,
|
|
377
|
+
ResultType: 'entity_object'
|
|
378
|
+
});
|
|
379
|
+
if (result.Success && result.Results && result.Results.length > 0) {
|
|
380
|
+
return result.Results[0];
|
|
381
|
+
}
|
|
382
|
+
return null;
|
|
383
|
+
}
|
|
384
|
+
/**
|
|
385
|
+
* Convert ResourcePermissionEntity to ListShareInfo
|
|
386
|
+
*/
|
|
387
|
+
async convertToListShareInfo(permission) {
|
|
388
|
+
const rv = new RunView();
|
|
389
|
+
if (permission.Type === 'User' && permission.UserID) {
|
|
390
|
+
const userResult = await rv.RunView({
|
|
391
|
+
EntityName: 'Users',
|
|
392
|
+
ExtraFilter: `ID = '${permission.UserID}'`,
|
|
393
|
+
ResultType: 'entity_object'
|
|
394
|
+
});
|
|
395
|
+
if (userResult.Success && userResult.Results && userResult.Results.length > 0) {
|
|
396
|
+
const user = userResult.Results[0];
|
|
397
|
+
return {
|
|
398
|
+
shareId: permission.ID,
|
|
399
|
+
listId: permission.ResourceRecordID,
|
|
400
|
+
type: 'User',
|
|
401
|
+
recipientId: permission.UserID,
|
|
402
|
+
recipientName: user.Name,
|
|
403
|
+
recipientEmail: user.Email,
|
|
404
|
+
permissionLevel: permission.PermissionLevel,
|
|
405
|
+
status: permission.Status,
|
|
406
|
+
startSharingAt: permission.StartSharingAt ? new Date(permission.StartSharingAt) : undefined,
|
|
407
|
+
endSharingAt: permission.EndSharingAt ? new Date(permission.EndSharingAt) : undefined
|
|
408
|
+
};
|
|
409
|
+
}
|
|
410
|
+
}
|
|
411
|
+
else if (permission.Type === 'Role' && permission.RoleID) {
|
|
412
|
+
const roleResult = await rv.RunView({
|
|
413
|
+
EntityName: 'Roles',
|
|
414
|
+
ExtraFilter: `ID = '${permission.RoleID}'`,
|
|
415
|
+
ResultType: 'entity_object'
|
|
416
|
+
});
|
|
417
|
+
if (roleResult.Success && roleResult.Results && roleResult.Results.length > 0) {
|
|
418
|
+
const role = roleResult.Results[0];
|
|
419
|
+
return {
|
|
420
|
+
shareId: permission.ID,
|
|
421
|
+
listId: permission.ResourceRecordID,
|
|
422
|
+
type: 'Role',
|
|
423
|
+
recipientId: permission.RoleID,
|
|
424
|
+
recipientName: role.Name,
|
|
425
|
+
permissionLevel: permission.PermissionLevel,
|
|
426
|
+
status: permission.Status,
|
|
427
|
+
startSharingAt: permission.StartSharingAt ? new Date(permission.StartSharingAt) : undefined,
|
|
428
|
+
endSharingAt: permission.EndSharingAt ? new Date(permission.EndSharingAt) : undefined
|
|
429
|
+
};
|
|
430
|
+
}
|
|
431
|
+
}
|
|
432
|
+
return null;
|
|
433
|
+
}
|
|
434
|
+
/**
|
|
435
|
+
* Get sharing summary for a single list
|
|
436
|
+
*/
|
|
437
|
+
async getListSharingSummary(listId) {
|
|
438
|
+
const rv = new RunView();
|
|
439
|
+
const result = await rv.RunView({
|
|
440
|
+
EntityName: 'Resource Permissions',
|
|
441
|
+
ExtraFilter: `ResourceTypeID = '${LIST_RESOURCE_TYPE_ID}' AND ResourceRecordID = '${listId}' AND Status = 'Approved'`,
|
|
442
|
+
Fields: ['ID', 'Type'],
|
|
443
|
+
ResultType: 'simple'
|
|
444
|
+
});
|
|
445
|
+
let userShares = 0;
|
|
446
|
+
let roleShares = 0;
|
|
447
|
+
if (result.Success && result.Results) {
|
|
448
|
+
for (const share of result.Results) {
|
|
449
|
+
const typedShare = share;
|
|
450
|
+
if (typedShare.Type === 'User') {
|
|
451
|
+
userShares++;
|
|
452
|
+
}
|
|
453
|
+
else if (typedShare.Type === 'Role') {
|
|
454
|
+
roleShares++;
|
|
455
|
+
}
|
|
456
|
+
}
|
|
457
|
+
}
|
|
458
|
+
return {
|
|
459
|
+
listId,
|
|
460
|
+
totalShares: userShares + roleShares,
|
|
461
|
+
userShares,
|
|
462
|
+
roleShares,
|
|
463
|
+
isSharedWithMe: false, // Would need current user context to determine
|
|
464
|
+
isSharedByMe: userShares + roleShares > 0
|
|
465
|
+
};
|
|
466
|
+
}
|
|
467
|
+
/**
|
|
468
|
+
* Clear internal caches
|
|
469
|
+
*/
|
|
470
|
+
clearCache() {
|
|
471
|
+
this.usersCache = null;
|
|
472
|
+
this.rolesCache = null;
|
|
473
|
+
}
|
|
474
|
+
static ɵfac = function ListSharingService_Factory(__ngFactoryType__) { return new (__ngFactoryType__ || ListSharingService)(); };
|
|
475
|
+
static ɵprov = /*@__PURE__*/ i0.ɵɵdefineInjectable({ token: ListSharingService, factory: ListSharingService.ɵfac, providedIn: 'root' });
|
|
476
|
+
}
|
|
477
|
+
(() => { (typeof ngDevMode === "undefined" || ngDevMode) && i0.ɵsetClassMetadata(ListSharingService, [{
|
|
478
|
+
type: Injectable,
|
|
479
|
+
args: [{
|
|
480
|
+
providedIn: 'root'
|
|
481
|
+
}]
|
|
482
|
+
}], () => [], null); })();
|
|
483
|
+
//# sourceMappingURL=list-sharing.service.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-sharing.service.js","sourceRoot":"","sources":["../../../src/lib/services/list-sharing.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAY,MAAM,sBAAsB,CAAC;AAQnE,OAAO,EAAE,eAAe,EAAc,MAAM,MAAM,CAAC;;AAGnD;;GAEG;AACH,MAAM,qBAAqB,GAAG,sCAAsC,CAAC;AAErE;;;;GAIG;AAIH,MAAM,OAAO,kBAAkB;IACrB,cAAc,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;IACtD,QAAQ,GAAwB,IAAI,CAAC,cAAc,CAAC,YAAY,EAAE,CAAC;IAE1E,+CAA+C;IACvC,UAAU,GAAwB,IAAI,CAAC;IACvC,UAAU,GAAwB,IAAI,CAAC;IAE/C,gBAAe,CAAC;IAEhB;;OAEG;IACH,qBAAqB;QACnB,OAAO,qBAAqB,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CAAC,MAAc;QAChC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,CAA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EAAE,CAAC;gBACf,CAAC;qBAAM,IAAI,UAAU,CAAC,IAAI,KAAK,MAAM,EAAE,CAAC;oBACtC,UAAU,EAAE,CAAC;gBACf,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO;YACL,MAAM;YACN,WAAW,EAAE,UAAU,GAAG,UAAU;YACpC,UAAU;YACV,UAAU;YACV,cAAc,EAAE,KAAK,EAAE,+CAA+C;YACtE,YAAY,EAAE,UAAU,GAAG,UAAU,GAAG,CAAC;SAC1C,CAAC;IACJ,CAAC;IAED;;OAEG;IACH,UAAU;QACR,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;QACvB,IAAI,CAAC,UAAU,GAAG,IAAI,CAAC;IACzB,CAAC;4GAniBU,kBAAkB;gEAAlB,kBAAkB,WAAlB,kBAAkB,mBAFjB,MAAM;;iFAEP,kBAAkB;cAH9B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
export * from './lib/module';
|
|
2
|
+
export * from './lib/components/list-management-dialog/list-management-dialog.component';
|
|
3
|
+
export * from './lib/components/list-share-dialog/list-share-dialog.component';
|
|
4
|
+
export * from './lib/services/list-management.service';
|
|
5
|
+
export * from './lib/services/list-sharing.service';
|
|
6
|
+
export * from './lib/models/list-management.models';
|
|
7
|
+
export * from './lib/models/list-sharing.models';
|
|
8
|
+
/**
|
|
9
|
+
* Tree-shaking prevention function.
|
|
10
|
+
* Call this from the consuming module to ensure the components are included.
|
|
11
|
+
*/
|
|
12
|
+
export declare function LoadListManagement(): void;
|
|
13
|
+
//# sourceMappingURL=public-api.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,0EAA0E,CAAC;AACzF,cAAc,gEAAgE,CAAC;AAG/E,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AAGpD,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD;;;GAGG;AACH,wBAAgB,kBAAkB,IAAI,IAAI,CAGzC"}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Public API Surface for @memberjunction/ng-list-management
|
|
3
|
+
*/
|
|
4
|
+
// Module
|
|
5
|
+
export * from './lib/module';
|
|
6
|
+
// Components
|
|
7
|
+
export * from './lib/components/list-management-dialog/list-management-dialog.component';
|
|
8
|
+
export * from './lib/components/list-share-dialog/list-share-dialog.component';
|
|
9
|
+
// Services
|
|
10
|
+
export * from './lib/services/list-management.service';
|
|
11
|
+
export * from './lib/services/list-sharing.service';
|
|
12
|
+
// Models
|
|
13
|
+
export * from './lib/models/list-management.models';
|
|
14
|
+
export * from './lib/models/list-sharing.models';
|
|
15
|
+
/**
|
|
16
|
+
* Tree-shaking prevention function.
|
|
17
|
+
* Call this from the consuming module to ensure the components are included.
|
|
18
|
+
*/
|
|
19
|
+
export function LoadListManagement() {
|
|
20
|
+
// This function exists solely to prevent tree-shaking
|
|
21
|
+
// of the list management components
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=public-api.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,aAAa;AACb,cAAc,0EAA0E,CAAC;AACzF,cAAc,gEAAgE,CAAC;AAE/E,WAAW;AACX,cAAc,wCAAwC,CAAC;AACvD,cAAc,qCAAqC,CAAC;AAEpD,SAAS;AACT,cAAc,qCAAqC,CAAC;AACpD,cAAc,kCAAkC,CAAC;AAEjD;;;GAGG;AACH,MAAM,UAAU,kBAAkB;IAChC,sDAAsD;IACtD,oCAAoC;AACtC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,10 +1,52 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-list-management",
|
|
3
|
-
"version": "0.0
|
|
4
|
-
"description": "
|
|
3
|
+
"version": "3.0.0",
|
|
4
|
+
"description": "MemberJunction: Angular Components for managing entity list membership with beautiful, responsive UI",
|
|
5
|
+
"main": "./dist/public-api.js",
|
|
6
|
+
"typings": "./dist/public-api.d.ts",
|
|
7
|
+
"files": [
|
|
8
|
+
"/dist"
|
|
9
|
+
],
|
|
10
|
+
"scripts": {
|
|
11
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
12
|
+
"build": "ngc"
|
|
13
|
+
},
|
|
5
14
|
"keywords": [
|
|
6
|
-
"
|
|
7
|
-
"
|
|
8
|
-
"
|
|
9
|
-
|
|
15
|
+
"MemberJunction",
|
|
16
|
+
"Angular",
|
|
17
|
+
"Lists",
|
|
18
|
+
"Entity Management"
|
|
19
|
+
],
|
|
20
|
+
"author": "",
|
|
21
|
+
"license": "ISC",
|
|
22
|
+
"devDependencies": {
|
|
23
|
+
"@angular/compiler": "18.2.14",
|
|
24
|
+
"@angular/compiler-cli": "18.2.14"
|
|
25
|
+
},
|
|
26
|
+
"peerDependencies": {
|
|
27
|
+
"@angular/common": "18.2.14",
|
|
28
|
+
"@angular/core": "18.2.14",
|
|
29
|
+
"@angular/forms": "18.2.14",
|
|
30
|
+
"@angular/router": "18.2.14",
|
|
31
|
+
"@progress/kendo-angular-buttons": "16.2.0",
|
|
32
|
+
"@progress/kendo-angular-dialog": "16.2.0",
|
|
33
|
+
"@progress/kendo-angular-inputs": "16.2.0",
|
|
34
|
+
"@progress/kendo-angular-layout": "16.2.0",
|
|
35
|
+
"@progress/kendo-angular-dropdowns": "16.2.0",
|
|
36
|
+
"rxjs": "^7.8.1"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"@memberjunction/core": "3.0.0",
|
|
40
|
+
"@memberjunction/core-entities": "3.0.0",
|
|
41
|
+
"@memberjunction/global": "3.0.0",
|
|
42
|
+
"@memberjunction/ng-container-directives": "3.0.0",
|
|
43
|
+
"@memberjunction/ng-shared": "3.0.0",
|
|
44
|
+
"@memberjunction/ng-shared-generic": "3.0.0",
|
|
45
|
+
"tslib": "^2.3.0"
|
|
46
|
+
},
|
|
47
|
+
"sideEffects": false,
|
|
48
|
+
"repository": {
|
|
49
|
+
"type": "git",
|
|
50
|
+
"url": "https://github.com/MemberJunction/MJ"
|
|
51
|
+
}
|
|
10
52
|
}
|
package/README.md
DELETED
|
@@ -1,45 +0,0 @@
|
|
|
1
|
-
# @memberjunction/ng-list-management
|
|
2
|
-
|
|
3
|
-
## ⚠️ IMPORTANT NOTICE ⚠️
|
|
4
|
-
|
|
5
|
-
**This package is created solely for the purpose of setting up OIDC (OpenID Connect) trusted publishing with npm.**
|
|
6
|
-
|
|
7
|
-
This is **NOT** a functional package and contains **NO** code or functionality beyond the OIDC setup configuration.
|
|
8
|
-
|
|
9
|
-
## Purpose
|
|
10
|
-
|
|
11
|
-
This package exists to:
|
|
12
|
-
1. Configure OIDC trusted publishing for the package name `@memberjunction/ng-list-management`
|
|
13
|
-
2. Enable secure, token-less publishing from CI/CD workflows
|
|
14
|
-
3. Establish provenance for packages published under this name
|
|
15
|
-
|
|
16
|
-
## What is OIDC Trusted Publishing?
|
|
17
|
-
|
|
18
|
-
OIDC trusted publishing allows package maintainers to publish packages directly from their CI/CD workflows without needing to manage npm access tokens. Instead, it uses OpenID Connect to establish trust between the CI/CD provider (like GitHub Actions) and npm.
|
|
19
|
-
|
|
20
|
-
## Setup Instructions
|
|
21
|
-
|
|
22
|
-
To properly configure OIDC trusted publishing for this package:
|
|
23
|
-
|
|
24
|
-
1. Go to [npmjs.com](https://www.npmjs.com/) and navigate to your package settings
|
|
25
|
-
2. Configure the trusted publisher (e.g., GitHub Actions)
|
|
26
|
-
3. Specify the repository and workflow that should be allowed to publish
|
|
27
|
-
4. Use the configured workflow to publish your actual package
|
|
28
|
-
|
|
29
|
-
## DO NOT USE THIS PACKAGE
|
|
30
|
-
|
|
31
|
-
This package is a placeholder for OIDC configuration only. It:
|
|
32
|
-
- Contains no executable code
|
|
33
|
-
- Provides no functionality
|
|
34
|
-
- Should not be installed as a dependency
|
|
35
|
-
- Exists only for administrative purposes
|
|
36
|
-
|
|
37
|
-
## More Information
|
|
38
|
-
|
|
39
|
-
For more details about npm's trusted publishing feature, see:
|
|
40
|
-
- [npm Trusted Publishing Documentation](https://docs.npmjs.com/generating-provenance-statements)
|
|
41
|
-
- [GitHub Actions OIDC Documentation](https://docs.github.com/en/actions/deployment/security-hardening-your-deployments/about-security-hardening-with-openid-connect)
|
|
42
|
-
|
|
43
|
-
---
|
|
44
|
-
|
|
45
|
-
**Maintained for OIDC setup purposes only**
|