@memberjunction/core-entities 2.128.0 → 2.129.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.
Files changed (60) hide show
  1. package/dist/custom/ResourcePermissions/ResourcePermissionEngine.d.ts.map +1 -1
  2. package/dist/custom/ResourcePermissions/ResourcePermissionEngine.js +14 -4
  3. package/dist/custom/ResourcePermissions/ResourcePermissionEngine.js.map +1 -1
  4. package/dist/engines/EncryptionEngineBase.d.ts +246 -0
  5. package/dist/engines/EncryptionEngineBase.d.ts.map +1 -0
  6. package/dist/engines/EncryptionEngineBase.js +355 -0
  7. package/dist/engines/EncryptionEngineBase.js.map +1 -0
  8. package/dist/engines/TypeTablesCache.d.ts.map +1 -1
  9. package/dist/engines/TypeTablesCache.js +2 -1
  10. package/dist/engines/TypeTablesCache.js.map +1 -1
  11. package/dist/engines/UserInfoEngine.d.ts +228 -0
  12. package/dist/engines/UserInfoEngine.d.ts.map +1 -0
  13. package/dist/engines/UserInfoEngine.js +599 -0
  14. package/dist/engines/UserInfoEngine.js.map +1 -0
  15. package/dist/engines/artifacts.d.ts.map +1 -1
  16. package/dist/engines/artifacts.js +2 -1
  17. package/dist/engines/artifacts.js.map +1 -1
  18. package/dist/engines/component-metadata.d.ts.map +1 -1
  19. package/dist/engines/component-metadata.js +10 -5
  20. package/dist/engines/component-metadata.js.map +1 -1
  21. package/dist/engines/dashboards.d.ts.map +1 -1
  22. package/dist/engines/dashboards.js +19 -6
  23. package/dist/engines/dashboards.js.map +1 -1
  24. package/dist/generated/entity_subclasses.d.ts +1504 -418
  25. package/dist/generated/entity_subclasses.d.ts.map +1 -1
  26. package/dist/generated/entity_subclasses.js +2852 -1188
  27. package/dist/generated/entity_subclasses.js.map +1 -1
  28. package/dist/index.d.ts +2 -7
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +2 -7
  31. package/dist/index.js.map +1 -1
  32. package/package.json +5 -5
  33. package/dist/custom/AIAgentExtended.d.ts +0 -13
  34. package/dist/custom/AIAgentExtended.d.ts.map +0 -1
  35. package/dist/custom/AIAgentExtended.js +0 -37
  36. package/dist/custom/AIAgentExtended.js.map +0 -1
  37. package/dist/custom/AIAgentRunExtended.d.ts +0 -32
  38. package/dist/custom/AIAgentRunExtended.d.ts.map +0 -1
  39. package/dist/custom/AIAgentRunExtended.js +0 -136
  40. package/dist/custom/AIAgentRunExtended.js.map +0 -1
  41. package/dist/custom/AIAgentRunStepExtended.d.ts +0 -48
  42. package/dist/custom/AIAgentRunStepExtended.d.ts.map +0 -1
  43. package/dist/custom/AIAgentRunStepExtended.js +0 -149
  44. package/dist/custom/AIAgentRunStepExtended.js.map +0 -1
  45. package/dist/custom/AIModelExtended.d.ts +0 -14
  46. package/dist/custom/AIModelExtended.d.ts.map +0 -1
  47. package/dist/custom/AIModelExtended.js +0 -36
  48. package/dist/custom/AIModelExtended.js.map +0 -1
  49. package/dist/custom/AIPromptCategoryExtended.d.ts +0 -7
  50. package/dist/custom/AIPromptCategoryExtended.d.ts.map +0 -1
  51. package/dist/custom/AIPromptCategoryExtended.js +0 -26
  52. package/dist/custom/AIPromptCategoryExtended.js.map +0 -1
  53. package/dist/custom/AIPromptExtended.d.ts +0 -51
  54. package/dist/custom/AIPromptExtended.d.ts.map +0 -1
  55. package/dist/custom/AIPromptExtended.js +0 -169
  56. package/dist/custom/AIPromptExtended.js.map +0 -1
  57. package/dist/custom/AIPromptRunEntityExtended.d.ts +0 -47
  58. package/dist/custom/AIPromptRunEntityExtended.d.ts.map +0 -1
  59. package/dist/custom/AIPromptRunEntityExtended.js +0 -156
  60. package/dist/custom/AIPromptRunEntityExtended.js.map +0 -1
@@ -0,0 +1 @@
1
+ {"version":3,"file":"EncryptionEngineBase.js","sourceRoot":"","sources":["../../src/engines/EncryptionEngineBase.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;GAsBG;;;;;;;;;AAEH,+CAA6H;AAC7H,mDAA2D;AAsB3D;;;;;;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E,CAAC;YACV,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,iCAAiC,GAAG,CAAC,IAAI,GAAG,EAAE,CAAC;QACnF,CAAC;QAED,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;YACnB,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,eAAe,MAAM,CAAC,IAAI,iBAAiB,EAAE,CAAC;QAClF,CAAC;QAED,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;IAC7B,CAAC;IAED;;;;;OAKG;IACI,YAAY,CAAC,KAAa;QAC7B,MAAM,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC;QACnC,OAAO,GAAG,EAAE,MAAM,IAAI,0BAAiB,CAAC;IAC5C,CAAC;CACJ,CAAA;AAlUY,oDAAoB;+BAApB,oBAAoB;IADhC,IAAA,yBAAkB,GAAE;GACR,oBAAoB,CAkUhC;AAED;;;GAGG;AACH,SAAgB,wBAAwB;IACpC,uEAAuE;AAC3E,CAAC;AAFD,4DAEC"}
@@ -1 +1 @@
1
- {"version":3,"file":"TypeTablesCache.d.ts","sourceRoot":"","sources":["../../src/engines/TypeTablesCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAE1F;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU,CAAC,eAAe,CAAC;IAC/C,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB;IAWhG,WAAkB,QAAQ,IAAI,eAAe,CAE5C;IAED,IAAW,mCAAmC,+CAE7C;IACD,OAAO,CAAC,oCAAoC,CAAkD;CACjG"}
1
+ {"version":3,"file":"TypeTablesCache.d.ts","sourceRoot":"","sources":["../../src/engines/TypeTablesCache.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAA4B,iBAAiB,EAAE,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AACzG,OAAO,EAAE,wCAAwC,EAAE,MAAM,gCAAgC,CAAC;AAE1F;;GAEG;AACH,qBAAa,eAAgB,SAAQ,UAAU,CAAC,eAAe,CAAC;IAC/C,MAAM,CAAC,YAAY,CAAC,EAAE,OAAO,EAAE,WAAW,CAAC,EAAE,QAAQ,EAAE,QAAQ,CAAC,EAAE,iBAAiB;IAYhG,WAAkB,QAAQ,IAAI,eAAe,CAE5C;IAED,IAAW,mCAAmC,+CAE7C;IACD,OAAO,CAAC,oCAAoC,CAAkD;CACjG"}
@@ -15,7 +15,8 @@ class TypeTablesCache extends core_1.BaseEngine {
15
15
  {
16
16
  Type: 'entity',
17
17
  EntityName: 'Entity Relationship Display Components',
18
- PropertyName: '_EntityRelationshipDisplayComponents'
18
+ PropertyName: '_EntityRelationshipDisplayComponents',
19
+ CacheLocal: true
19
20
  }
20
21
  ];
21
22
  await this.Load(c, provider, forceRefresh, contextUser);
@@ -1 +1 @@
1
- {"version":3,"file":"TypeTablesCache.js","sourceRoot":"","sources":["../../src/engines/TypeTablesCache.ts"],"names":[],"mappings":";;;AAAA,+CAAyG;AAGzG;;GAEG;AACH,MAAa,eAAgB,SAAQ,iBAA2B;IAAhE;;QAmBY,yCAAoC,GAA+C,EAAE,CAAC;IAClG,CAAC;IAnBU,KAAK,CAAC,MAAM,CAAC,YAAsB,EAAE,WAAsB,EAAE,QAA4B;QAC5F,MAAM,CAAC,GAAwC;YAC3C;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,wCAAwC;gBACpD,YAAY,EAAE,sCAAsC;aACvD;SACJ,CAAC;QACF,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAEM,MAAM,KAAK,QAAQ;QACtB,OAAO,KAAK,CAAC,WAAW,EAAmB,CAAC;IAChD,CAAC;IAED,IAAW,mCAAmC;QAC1C,OAAO,IAAI,CAAC,oCAAoC,CAAC;IACrD,CAAC;CAEJ;AApBD,0CAoBC"}
1
+ {"version":3,"file":"TypeTablesCache.js","sourceRoot":"","sources":["../../src/engines/TypeTablesCache.ts"],"names":[],"mappings":";;;AAAA,+CAAyG;AAGzG;;GAEG;AACH,MAAa,eAAgB,SAAQ,iBAA2B;IAAhE;;QAoBY,yCAAoC,GAA+C,EAAE,CAAC;IAClG,CAAC;IApBU,KAAK,CAAC,MAAM,CAAC,YAAsB,EAAE,WAAsB,EAAE,QAA4B;QAC5F,MAAM,CAAC,GAAwC;YAC3C;gBACI,IAAI,EAAE,QAAQ;gBACd,UAAU,EAAE,wCAAwC;gBACpD,YAAY,EAAE,sCAAsC;gBACpD,UAAU,EAAE,IAAI;aACnB;SACJ,CAAC;QACF,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,YAAY,EAAE,WAAW,CAAC,CAAC;IAC5D,CAAC;IAEM,MAAM,KAAK,QAAQ;QACtB,OAAO,KAAK,CAAC,WAAW,EAAmB,CAAC;IAChD,CAAC;IAED,IAAW,mCAAmC;QAC1C,OAAO,IAAI,CAAC,oCAAoC,CAAC;IACrD,CAAC;CAEJ;AArBD,0CAqBC"}
@@ -0,0 +1,228 @@
1
+ import { ApplicationInfo, BaseEngine, IMetadataProvider, UserInfo } from "@memberjunction/core";
2
+ /**
3
+ * Status indicating why a user can or cannot access an application.
4
+ * - 'installed_active': User has UserApplication record with IsActive=true
5
+ * - 'installed_inactive': User has UserApplication record with IsActive=false
6
+ * - 'not_installed': User has no UserApplication record for this app
7
+ */
8
+ export type UserApplicationAccessStatus = 'installed_active' | 'installed_inactive' | 'not_installed';
9
+ import { UserNotificationEntity, WorkspaceEntity, UserApplicationEntity, UserFavoriteEntity, UserRecordLogEntity, UserSettingEntity } from "../generated/entity_subclasses";
10
+ /**
11
+ * UserInfoEngine is a singleton engine that provides centralized access to user-specific data
12
+ * including notifications, workspaces, applications, favorites, and record logs.
13
+ *
14
+ * This engine consolidates multiple user-related RunView calls into a single batched load,
15
+ * improving performance and enabling local caching for faster subsequent access.
16
+ *
17
+ * Usage:
18
+ * ```typescript
19
+ * // Get the instance (auto-configured on startup)
20
+ * const engine = UserInfoEngine.Instance;
21
+ *
22
+ * // Access user data
23
+ * const notifications = engine.UserNotifications;
24
+ * const workspace = engine.CurrentWorkspace;
25
+ * const apps = engine.UserApplications;
26
+ * ```
27
+ *
28
+ * Note: This engine filters all data by the current user's ID automatically.
29
+ * On the server side, you must call Config() with contextUser to specify which user's data to load.
30
+ */
31
+ export declare class UserInfoEngine extends BaseEngine<UserInfoEngine> {
32
+ /**
33
+ * Returns the global instance of the class. This is a singleton class, so there is only one instance of it in the application.
34
+ * Do not directly create new instances of it, always use this method to get the instance.
35
+ */
36
+ static get Instance(): UserInfoEngine;
37
+ private _UserNotifications;
38
+ private _Workspaces;
39
+ private _UserApplications;
40
+ private _UserFavorites;
41
+ private _UserRecordLogs;
42
+ private _UserSettings;
43
+ private _loadedForUserId;
44
+ private _createDefaultAppsPromise;
45
+ /**
46
+ * Configures the engine by loading user-specific metadata from the database.
47
+ * All entities are filtered by the current user's ID and cached locally for performance.
48
+ *
49
+ * @param forceRefresh - If true, forces a refresh from the server even if data is cached
50
+ * @param contextUser - The user context (required for server-side, auto-detected on client)
51
+ * @param provider - Optional custom metadata provider
52
+ */
53
+ Config(forceRefresh?: boolean, contextUser?: UserInfo, provider?: IMetadataProvider): Promise<void>;
54
+ /**
55
+ * Get all notifications for the current user, ordered by creation date (newest first)
56
+ */
57
+ get UserNotifications(): UserNotificationEntity[];
58
+ /**
59
+ * Get all settings for the current user
60
+ */
61
+ get UserSettings(): UserSettingEntity[];
62
+ /**
63
+ * Get unread notifications for the current user
64
+ */
65
+ get UnreadNotifications(): UserNotificationEntity[];
66
+ /**
67
+ * Get the count of unread notifications
68
+ */
69
+ get UnreadNotificationCount(): number;
70
+ /**
71
+ * Get all workspaces for the current user
72
+ */
73
+ get Workspaces(): WorkspaceEntity[];
74
+ /**
75
+ * Get the current user's primary workspace (first one if multiple exist)
76
+ */
77
+ get CurrentWorkspace(): WorkspaceEntity | null;
78
+ /**
79
+ * Get all applications enabled for the current user, ordered by sequence then application name
80
+ */
81
+ get UserApplications(): UserApplicationEntity[];
82
+ /**
83
+ * Get all favorites for the current user, ordered by creation date (newest first)
84
+ */
85
+ get UserFavorites(): UserFavoriteEntity[];
86
+ /**
87
+ * Get all record logs for the current user (recent record access), ordered by LatestAt (most recent first)
88
+ */
89
+ get UserRecordLogs(): UserRecordLogEntity[];
90
+ /**
91
+ * Get ALL notifications in the cache (unfiltered by user).
92
+ * Useful for server-side admin scenarios.
93
+ */
94
+ get AllNotifications(): UserNotificationEntity[];
95
+ /**
96
+ * Get ALL user applications in the cache (unfiltered by user).
97
+ * Useful for server-side admin scenarios.
98
+ */
99
+ get AllUserApplications(): UserApplicationEntity[];
100
+ /**
101
+ * Get notifications for a specific user
102
+ * @param userId - The user ID to filter by
103
+ */
104
+ GetNotificationsForUser(userId: string): UserNotificationEntity[];
105
+ /**
106
+ * Get user applications for a specific user
107
+ * @param userId - The user ID to filter by
108
+ */
109
+ GetUserApplicationsForUser(userId: string): UserApplicationEntity[];
110
+ /**
111
+ * Get a notification by ID
112
+ * @param notificationId - The notification ID to find
113
+ */
114
+ GetNotificationById(notificationId: string): UserNotificationEntity | undefined;
115
+ /**
116
+ * Get a user application by application ID
117
+ * @param applicationId - The application ID to find
118
+ */
119
+ GetUserApplicationByAppId(applicationId: string): UserApplicationEntity | undefined;
120
+ /**
121
+ * Get favorites for a specific entity
122
+ * @param entityId - The entity ID to filter by
123
+ */
124
+ GetFavoritesForEntity(entityId: string): UserFavoriteEntity[];
125
+ /**
126
+ * Get recent record logs for a specific entity
127
+ * @param entityId - The entity ID to filter by
128
+ * @param maxItems - Maximum number of items to return (default: 10)
129
+ */
130
+ GetRecentRecordsForEntity(entityId: string, maxItems?: number): UserRecordLogEntity[];
131
+ /**
132
+ * Check if a record is in the user's favorites
133
+ * @param entityId - The entity ID
134
+ * @param recordId - The record ID
135
+ */
136
+ IsRecordFavorite(entityId: string, recordId: string): boolean;
137
+ /**
138
+ * Get the user ID this engine was loaded for
139
+ */
140
+ get LoadedForUserId(): string | null;
141
+ /**
142
+ * Check the user's access status for an application.
143
+ * @param applicationId - The application ID to check
144
+ * @returns The user's access status for this application
145
+ */
146
+ CheckUserApplicationAccess(applicationId: string): UserApplicationAccessStatus;
147
+ /**
148
+ * Check if an application is inactive in the system metadata.
149
+ * @param applicationId - The application ID to check
150
+ */
151
+ IsApplicationInactive(applicationId: string): boolean;
152
+ /**
153
+ * Get application info by ID from metadata.
154
+ * @param applicationId - The application ID to find
155
+ */
156
+ GetApplicationInfo(applicationId: string): ApplicationInfo | undefined;
157
+ /**
158
+ * Find application info by path or name (case-insensitive).
159
+ * @param pathOrName - The path or name to search for
160
+ */
161
+ FindApplicationByPathOrName(pathOrName: string): ApplicationInfo | undefined;
162
+ /**
163
+ * Force refresh all user data
164
+ * @param contextUser - Optional user context for server-side use
165
+ */
166
+ Refresh(contextUser?: UserInfo): Promise<void>;
167
+ /**
168
+ * Get only the active user applications (IsActive = true)
169
+ */
170
+ get ActiveUserApplications(): UserApplicationEntity[];
171
+ /**
172
+ * Check if user has a specific application installed (has UserApplication record)
173
+ * @param applicationId - The application ID to check
174
+ */
175
+ HasApplication(applicationId: string): boolean;
176
+ /**
177
+ * Check if user has a specific application active (installed AND IsActive = true)
178
+ * @param applicationId - The application ID to check
179
+ */
180
+ HasActiveApplication(applicationId: string): boolean;
181
+ /**
182
+ * Install an application for the current user by creating a UserApplication record.
183
+ * The new record is automatically added to the cached UserApplications array.
184
+ * @param applicationId - The application ID to install
185
+ * @param contextUser - Optional user context for server-side use
186
+ * @returns The newly created UserApplicationEntity, or null if failed
187
+ */
188
+ InstallApplication(applicationId: string, contextUser?: UserInfo): Promise<UserApplicationEntity | null>;
189
+ /**
190
+ * Enable a disabled application for the current user (set IsActive = true).
191
+ * @param applicationId - The application ID to enable
192
+ * @param contextUser - Optional user context for server-side use
193
+ * @returns true if successful, false otherwise
194
+ */
195
+ EnableApplication(applicationId: string, contextUser?: UserInfo): Promise<boolean>;
196
+ /**
197
+ * Disable an application for the current user (set IsActive = false).
198
+ * This does not delete the UserApplication record, just deactivates it.
199
+ * @param applicationId - The application ID to disable
200
+ * @param contextUser - Optional user context for server-side use
201
+ * @returns true if successful, false otherwise
202
+ */
203
+ DisableApplication(applicationId: string, contextUser?: UserInfo): Promise<boolean>;
204
+ /**
205
+ * Uninstall an application by deleting the UserApplication record.
206
+ * @param applicationId - The application ID to uninstall
207
+ * @param contextUser - Optional user context for server-side use
208
+ * @returns true if successful, false otherwise
209
+ */
210
+ UninstallApplication(applicationId: string, contextUser?: UserInfo): Promise<boolean>;
211
+ /**
212
+ * Create default UserApplication records for apps marked with DefaultForNewUser=true.
213
+ * This is called automatically when a user has no UserApplication records.
214
+ *
215
+ * This method is safe to call multiple times concurrently - it will return the same
216
+ * promise if already in progress, and will skip apps that already have UserApplication records.
217
+ *
218
+ * @param contextUser - Optional user context for server-side use
219
+ * @returns Array of created UserApplicationEntity records
220
+ */
221
+ CreateDefaultApplications(contextUser?: UserInfo): Promise<UserApplicationEntity[]>;
222
+ /**
223
+ * Internal implementation of CreateDefaultApplications.
224
+ * Separated to allow the public method to manage the promise state.
225
+ */
226
+ private doCreateDefaultApplications;
227
+ }
228
+ //# sourceMappingURL=UserInfoEngine.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"UserInfoEngine.d.ts","sourceRoot":"","sources":["../../src/engines/UserInfoEngine.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,eAAe,EAAE,UAAU,EAA4B,iBAAiB,EAAgC,QAAQ,EAAE,MAAM,sBAAsB,CAAC;AAExJ;;;;;GAKG;AACH,MAAM,MAAM,2BA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