@memberjunction/ng-shared-generic 6.2.0-edge.2 → 6.2.0-edge.4

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.
@@ -57,7 +57,7 @@ export declare class RecentAccessService {
57
57
  /** @deprecated Use {@link LogAccess}. */
58
58
  logAccess(entityName: string, recordId: string | CompositeKey, resourceType?: 'record' | 'view' | 'dashboard' | 'artifact' | 'report'): Promise<void>;
59
59
  /**
60
- * Loads recent access items for the current user using UserInfoEngine (cached).
60
+ * Loads recent access items for the current user from `MJ: User Record Logs`.
61
61
  * @param maxItems - Maximum number of items to return (default 15)
62
62
  * @param forceRefresh - Force refresh even if already loaded
63
63
  */
@@ -1 +1 @@
1
- {"version":3,"file":"recent-access.service.d.ts","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,iBAAiB,EAAqB,YAAY,EAAmC,MAAM,sBAAsB,CAAC;AAI3H,OAAO,EAAmB,UAAU,EAAE,MAAM,MAAM,CAAC;;AAEnD;;GAEG;AACH,MAAM,WAAW,gBAAgB;IAC/B,EAAE,EAAE,MAAM,CAAC;IACX,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,QAAQ,EAAE,MAAM,CAAC;IACjB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,QAAQ,EAAE,IAAI,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,6EAA6E;IAC7E,YAAY,EAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;CACvE;AAED;;;GAGG;AACH;;;GAGG;AACH,qBAGa,mBAAmB;IAC9B,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAuC;IAC9E,OAAO,CAAC,aAAa,CAA+C;IACpE,OAAO,CAAC,WAAW,CAAuC;IAC1D,OAAO,CAAC,SAAS,CAAS;IAE1B,OAAO,CAA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,OAAO,CAAC,CAE1C;IAED;;;;;;;OAOG;IACU,SAAS,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,YAAY,EAC/B,YAAY,GAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAmB,GAC/E,OAAO,CAAC,IAAI,CAAC;IAiEhB,yCAAyC;IAC5B,SAAS,CACpB,UAAU,EAAE,MAAM,EAClB,QAAQ,EAAE,MAAM,GAAG,YAAY,EAC/B,YAAY,GAAE,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAmB,GAC/E,OAAO,CAAC,IAAI,CAAC;IAIhB;;;;OAIG;IACU,eAAe,CAAC,QAAQ,GAAE,MAAW,EAAE,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IA+C/G,+CAA+C;IAClC,eAAe,CAAC,QAAQ,GAAE,MAAW,EAAE,YAAY,GAAE,OAAe,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC;IAI/G;;OAEG;IACU,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD,kDAAkD;IACrC,kBAAkB,IAAI,OAAO,CAAC,IAAI,CAAC;IAIhD;;;OAGG;YACW,kBAAkB;IA+BhC;;;;;OAKG;IACH,OAAO,CAAC,0BAA0B;IAsBlC;;OAEG;IACH,OAAO,CAAC,qBAAqB;IAI7B;;OAEG;IACI,UAAU,IAAI,IAAI;IAKzB,0CAA0C;IACnC,UAAU,IAAI,IAAI;yCAzRd,mBAAmB;6CAAnB,mBAAmB;CA4R/B"}
@@ -2,8 +2,8 @@ import { Injectable } from '@angular/core';
2
2
  import { Metadata, RunView, CompositeKey, LogError } from '@memberjunction/core';
3
3
  import { GetGlobalObjectStore } from '@memberjunction/global';
4
4
  import { UserInfoEngine } from '@memberjunction/core-entities';
5
- import { UUIDsEqual } from '@memberjunction/global';
6
5
  import { BehaviorSubject } from 'rxjs';
6
+ import { ResourceTypeForEntity } from './recent-resource-type';
7
7
  import * as i0 from "@angular/core";
8
8
  /**
9
9
  * Service for tracking and retrieving recently accessed resources.
@@ -125,7 +125,7 @@ export class RecentAccessService {
125
125
  return this.LogAccess(entityName, recordId, resourceType);
126
126
  }
127
127
  /**
128
- * Loads recent access items for the current user using UserInfoEngine (cached).
128
+ * Loads recent access items for the current user from `MJ: User Record Logs`.
129
129
  * @param maxItems - Maximum number of items to return (default 15)
130
130
  * @param forceRefresh - Force refresh even if already loaded
131
131
  */
@@ -136,11 +136,10 @@ export class RecentAccessService {
136
136
  try {
137
137
  this._isLoading$.next(true);
138
138
  const md = this.Provider;
139
- // Get recent records, limited to maxItems (already ordered by LatestAt DESC in engine)
140
- const userRecordLogs = UserInfoEngine.Instance.UserRecordLogs.slice(0, maxItems);
139
+ const userRecordLogs = await UserInfoEngine.Instance.LoadRecentRecordLogs(maxItems, md.CurrentUser, md);
141
140
  const items = [];
142
141
  for (const log of userRecordLogs) {
143
- const entityInfo = md.Entities.find(e => UUIDsEqual(e.ID, log.EntityID));
142
+ const entityInfo = md.EntityByID(log.EntityID);
144
143
  if (!entityInfo)
145
144
  continue;
146
145
  // Determine resource type based on entity name
@@ -248,20 +247,7 @@ export class RecentAccessService {
248
247
  * Determines the resource type based on entity name
249
248
  */
250
249
  determineResourceType(entityName) {
251
- const normalizedName = entityName.toLowerCase();
252
- if (normalizedName === 'user views') {
253
- return 'view';
254
- }
255
- if (normalizedName === 'dashboards') {
256
- return 'dashboard';
257
- }
258
- if (normalizedName === 'mj: conversation artifacts' || normalizedName === 'conversation artifacts') {
259
- return 'artifact';
260
- }
261
- if (normalizedName === 'reports') {
262
- return 'report';
263
- }
264
- return 'record';
250
+ return ResourceTypeForEntity(entityName);
265
251
  }
266
252
  /**
267
253
  * Clears the cached recent items (useful for logout)
@@ -1 +1 @@
1
- {"version":3,"file":"recent-access.service.js","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AAAA,OAAO,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AU;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,0CAA0C;IACnC,UAAU;QACf,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;6GA3SU,mBAAmB;gEAAnB,mBAAmB,WAAnB,mBAAmB,mBAFlB,MAAM;;iFAEP,mBAAmB;cAH/B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { IMetadataProvider, Metadata, RunView, CompositeKey, LogError, EntityRecordNameInput } from '@memberjunction/core';\nimport { GetGlobalObjectStore } from '@memberjunction/global';\nimport { MJUserRecordLogEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { UUIDsEqual } from '@memberjunction/global';\nimport { BehaviorSubject, Observable } from 'rxjs';\n\n/**\n * Represents a recently accessed resource\n */\nexport interface RecentAccessItem {\n id: string;\n entityId: string;\n entityName: string;\n recordId: string;\n recordName?: string;\n latestAt: Date;\n totalCount: number;\n /** Resource type for special handling (record, view, dashboard, artifact) */\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report';\n}\n\n/**\n * Service for tracking and retrieving recently accessed resources.\n * Uses the User Record Logs entity to persist access history.\n */\n/**\n * Multi-provider note: callers under a non-default provider should set\n * `service.Provider = component.ProviderToUse` before invoking any methods.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RecentAccessService {\n private static readonly _globalStoreKey = '___SINGLETON__RecentAccessService';\n private _recentItems$ = new BehaviorSubject<RecentAccessItem[]>([]);\n private _isLoading$ = new BehaviorSubject<boolean>(false);\n private _isLoaded = false;\n\n private _provider: IMetadataProvider | null = null;\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n constructor() {\n const g = GetGlobalObjectStore()!;\n if (g[RecentAccessService._globalStoreKey]) {\n return g[RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n g[RecentAccessService._globalStoreKey] = this;\n }\n\n public static get Instance(): RecentAccessService {\n return GetGlobalObjectStore()![RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n\n /**\n * Observable of recent access items, sorted by most recent first\n */\n public get RecentItems(): Observable<RecentAccessItem[]> {\n return this._recentItems$.asObservable();\n }\n\n /**\n * Current value of recent items\n */\n public get RecentItemsValue(): RecentAccessItem[] {\n return this._recentItems$.value;\n }\n\n /**\n * Observable loading state\n */\n public get IsLoading(): Observable<boolean> {\n return this._isLoading$.asObservable();\n }\n\n /**\n * Logs access to a record. Creates or updates the User Record Log entry.\n * This is a fire-and-forget operation - errors are logged but don't interrupt the user.\n *\n * @param entityName - The name of the entity being accessed\n * @param recordId - The record ID (single value or CompositeKey string)\n * @param resourceType - The type of resource being accessed\n */\n public async LogAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n try {\n const md = this.Provider;\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo) {\n console.warn(`RecentAccessService: Entity \"${entityName}\" not found in metadata`);\n return;\n }\n\n // Persist the key in the compact CompositeKey segment form — the bare value for a single-column\n // primary key (so existing rows and lookups are unchanged), \"F1|v1||F2|v2\" for a composite one.\n // That is the form CompositeKey.FromURLSegment reads back; the previous Values(',') dropped\n // the field names, so a composite key written here could never be re-opened.\n const recordIdString = recordId instanceof CompositeKey\n ? recordId.ToCompactURLSegment()\n : recordId;\n\n // Check if we already have a log entry for this user/entity/record combination\n const rv = RunView.FromMetadataProvider(this.Provider);\n const existingResult = await rv.RunView<MJUserRecordLogEntity>({\n EntityName: 'MJ: User Record Logs',\n ExtraFilter: `UserID='${md.CurrentUser.ID}' AND EntityID='${entityInfo.ID}' AND RecordID='${recordIdString}'`,\n ResultType: 'entity_object',\n MaxRows: 1\n });\n\n if (!existingResult.Success) {\n console.error('RecentAccessService: Failed to check existing log', existingResult.ErrorMessage);\n return;\n }\n\n if (existingResult.Results && existingResult.Results.length > 0) {\n // Update existing entry\n const existing = existingResult.Results[0];\n existing.LatestAt = new Date();\n existing.TotalCount = (existing.TotalCount || 0) + 1;\n\n const saveResult = await existing.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to update log entry');\n }\n } else {\n // Create new entry\n const newLog = await md.GetEntityObject<MJUserRecordLogEntity>('MJ: User Record Logs', md.CurrentUser);\n newLog.UserID = md.CurrentUser.ID;\n newLog.EntityID = entityInfo.ID;\n newLog.RecordID = recordIdString;\n // EarliestAt and LatestAt have default values of getdate() in the DB\n // TotalCount defaults to 0, so we set it to 1\n newLog.TotalCount = 1;\n\n const saveResult = await newLog.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to create log entry');\n }\n }\n\n // Refresh the recent items list in background\n this.RefreshRecentItems();\n } catch (error) {\n // Don't throw - this is non-critical functionality\n console.error('RecentAccessService: Error logging access', error);\n }\n }\n\n /** @deprecated Use {@link LogAccess}. */\n public async logAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n return this.LogAccess(entityName, recordId, resourceType);\n }\n\n /**\n * Loads recent access items for the current user using UserInfoEngine (cached).\n * @param maxItems - Maximum number of items to return (default 15)\n * @param forceRefresh - Force refresh even if already loaded\n */\n public async LoadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n if (this._isLoaded && !forceRefresh) {\n return this._recentItems$.value;\n }\n\n try {\n this._isLoading$.next(true);\n\n const md = this.Provider;\n\n // Get recent records, limited to maxItems (already ordered by LatestAt DESC in engine)\n const userRecordLogs = UserInfoEngine.Instance.UserRecordLogs.slice(0, maxItems);\n\n const items: RecentAccessItem[] = [];\n\n for (const log of userRecordLogs) {\n const entityInfo = md.Entities.find(e => UUIDsEqual(e.ID, log.EntityID));\n if (!entityInfo) continue;\n\n // Determine resource type based on entity name\n const resourceType = this.determineResourceType(entityInfo.Name);\n\n items.push({\n id: log.ID,\n entityId: log.EntityID,\n entityName: entityInfo.Name,\n recordId: log.RecordID,\n latestAt: log.LatestAt,\n totalCount: log.TotalCount,\n resourceType\n });\n }\n\n // Batch-resolve record names for all items\n await this.resolveRecordNames(items, md);\n\n this._recentItems$.next(items);\n this._isLoaded = true;\n\n return items;\n } catch (error) {\n LogError('RecentAccessService: Error loading recent items', undefined, error);\n return [];\n } finally {\n this._isLoading$.next(false);\n }\n }\n\n /** @deprecated Use {@link LoadRecentItems}. */\n public async loadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n return this.LoadRecentItems(maxItems, forceRefresh);\n }\n\n /**\n * Refresh recent items in background\n */\n public async RefreshRecentItems(): Promise<void> {\n await this.LoadRecentItems(15, true);\n }\n\n /** @deprecated Use {@link RefreshRecentItems}. */\n public async refreshRecentItems(): Promise<void> {\n return this.RefreshRecentItems();\n }\n\n /**\n * Batch-resolve record names for a list of recent access items using GetEntityRecordNames().\n * Mutates the items in-place to set recordName where resolved.\n */\n private async resolveRecordNames(items: RecentAccessItem[], md: IMetadataProvider): Promise<void> {\n const nameInputs: EntityRecordNameInput[] = [];\n const indexMap = new Map<string, number>();\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const compositeKey = this.buildCompositeKeyForRecord(item.entityName, item.recordId, md);\n if (!compositeKey) continue;\n\n nameInputs.push({ EntityName: item.entityName, CompositeKey: compositeKey });\n indexMap.set(`${item.entityName}||${compositeKey.ToConcatenatedString()}`, i);\n }\n\n if (nameInputs.length === 0) return;\n\n try {\n const nameResults = await md.GetEntityRecordNames(nameInputs);\n for (const result of nameResults) {\n if (result.Success && result.RecordName) {\n const key = `${result.EntityName}||${result.CompositeKey.ToConcatenatedString()}`;\n const index = indexMap.get(key);\n if (index !== undefined) {\n items[index].recordName = result.RecordName;\n }\n }\n }\n } catch (error) {\n console.warn('RecentAccessService: Failed to resolve record names', error);\n }\n }\n\n /**\n * Build a CompositeKey for a record. RecordID may be stored as either:\n * - Concatenated format: \"FieldName|Value\" or \"Field1|Val1||Field2|Val2\"\n * - Plain value: just the raw value (e.g. a GUID)\n * Detects the format and constructs the key accordingly.\n */\n private buildCompositeKeyForRecord(entityName: string, recordId: string, md: IMetadataProvider): CompositeKey | null {\n if (!recordId) return null;\n\n // If recordId contains '|', it's in concatenated format\n if (recordId.includes('|')) {\n try {\n const compositeKey = new CompositeKey();\n compositeKey.LoadFromConcatenatedString(recordId);\n if (compositeKey.KeyValuePairs.length > 0) return compositeKey;\n } catch {\n // Fall through to entity-based lookup\n }\n }\n\n // Plain value — map it onto the entity's real primary key column (whatever it is called).\n // FromURLSegment also re-parses a delimited segment, covering the case where the try above failed.\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo || entityInfo.PrimaryKeys.length === 0) return null;\n\n return CompositeKey.FromURLSegment(entityInfo, recordId);\n }\n\n /**\n * Determines the resource type based on entity name\n */\n private determineResourceType(entityName: string): 'record' | 'view' | 'dashboard' | 'artifact' | 'report' {\n const normalizedName = entityName.toLowerCase();\n\n if (normalizedName === 'user views') {\n return 'view';\n }\n if (normalizedName === 'dashboards') {\n return 'dashboard';\n }\n if (normalizedName === 'mj: conversation artifacts' || normalizedName === 'conversation artifacts') {\n return 'artifact';\n }\n if (normalizedName === 'reports') {\n return 'report';\n }\n\n return 'record';\n }\n\n /**\n * Clears the cached recent items (useful for logout)\n */\n public ClearCache(): void {\n this._recentItems$.next([]);\n this._isLoaded = false;\n }\n\n /** @deprecated Use {@link ClearCache}. */\n public clearCache(): void {\n return this.ClearCache();\n }\n}\n"]}
1
+ {"version":3,"file":"recent-access.service.js","sourceRoot":"","sources":["../../src/lib/recent-access.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAqB,QAAQ,EAAE,OAAO,E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AAI,CAAC;gBACH,MAAM,YAAY,GAAG,IAAI,YAAY,EAAE,CAAC;gBACxC,YAAY,CAAC,0BAA0B,CAAC,QAAQ,CAAC,CAAC;gBAClD,IAAI,YAAY,CAAC,aAAa,CAAC,MAAM,GAAG,CAAC;oBAAE,OAAO,YAAY,CAAC;YACjE,CAAC;YAAC,MAAM,CAAC;gBACP,sCAAsC;YACxC,CAAC;QACH,CAAC;QAED,0FAA0F;QAC1F,mGAAmG;QACnG,MAAM,UAAU,GAAG,EAAE,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,UAAU,CAAC,CAAC;QAChE,IAAI,CAAC,UAAU,IAAI,UAAU,CAAC,WAAW,CAAC,MAAM,KAAK,CAAC;YAAE,OAAO,IAAI,CAAC;QAEpE,OAAO,YAAY,CAAC,cAAc,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC;IAC3D,CAAC;IAED;;OAEG;IACK,qBAAqB,CAAC,UAAkB;QAC9C,OAAO,qBAAqB,CAAC,UAAU,CAAC,CAAC;IAC3C,CAAC;IAED;;OAEG;IACI,UAAU;QACf,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAC5B,IAAI,CAAC,SAAS,GAAG,KAAK,CAAC;IACzB,CAAC;IAED,0CAA0C;IACnC,UAAU;QACf,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;6GA3RU,mBAAmB;gEAAnB,mBAAmB,WAAnB,mBAAmB,mBAFlB,MAAM;;iFAEP,mBAAmB;cAH/B,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB","sourcesContent":["import { Injectable } from '@angular/core';\nimport { IMetadataProvider, Metadata, RunView, CompositeKey, LogError, EntityRecordNameInput } from '@memberjunction/core';\nimport { GetGlobalObjectStore } from '@memberjunction/global';\nimport { MJUserRecordLogEntity, UserInfoEngine } from '@memberjunction/core-entities';\nimport { BehaviorSubject, Observable } from 'rxjs';\nimport { ResourceTypeForEntity } from './recent-resource-type';\n\n/**\n * Represents a recently accessed resource\n */\nexport interface RecentAccessItem {\n id: string;\n entityId: string;\n entityName: string;\n recordId: string;\n recordName?: string;\n latestAt: Date;\n totalCount: number;\n /** Resource type for special handling (record, view, dashboard, artifact) */\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report';\n}\n\n/**\n * Service for tracking and retrieving recently accessed resources.\n * Uses the User Record Logs entity to persist access history.\n */\n/**\n * Multi-provider note: callers under a non-default provider should set\n * `service.Provider = component.ProviderToUse` before invoking any methods.\n */\n@Injectable({\n providedIn: 'root'\n})\nexport class RecentAccessService {\n private static readonly _globalStoreKey = '___SINGLETON__RecentAccessService';\n private _recentItems$ = new BehaviorSubject<RecentAccessItem[]>([]);\n private _isLoading$ = new BehaviorSubject<boolean>(false);\n private _isLoaded = false;\n\n private _provider: IMetadataProvider | null = null;\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n constructor() {\n const g = GetGlobalObjectStore()!;\n if (g[RecentAccessService._globalStoreKey]) {\n return g[RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n g[RecentAccessService._globalStoreKey] = this;\n }\n\n public static get Instance(): RecentAccessService {\n return GetGlobalObjectStore()![RecentAccessService._globalStoreKey] as RecentAccessService;\n }\n\n /**\n * Observable of recent access items, sorted by most recent first\n */\n public get RecentItems(): Observable<RecentAccessItem[]> {\n return this._recentItems$.asObservable();\n }\n\n /**\n * Current value of recent items\n */\n public get RecentItemsValue(): RecentAccessItem[] {\n return this._recentItems$.value;\n }\n\n /**\n * Observable loading state\n */\n public get IsLoading(): Observable<boolean> {\n return this._isLoading$.asObservable();\n }\n\n /**\n * Logs access to a record. Creates or updates the User Record Log entry.\n * This is a fire-and-forget operation - errors are logged but don't interrupt the user.\n *\n * @param entityName - The name of the entity being accessed\n * @param recordId - The record ID (single value or CompositeKey string)\n * @param resourceType - The type of resource being accessed\n */\n public async LogAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n try {\n const md = this.Provider;\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo) {\n console.warn(`RecentAccessService: Entity \"${entityName}\" not found in metadata`);\n return;\n }\n\n // Persist the key in the compact CompositeKey segment form — the bare value for a single-column\n // primary key (so existing rows and lookups are unchanged), \"F1|v1||F2|v2\" for a composite one.\n // That is the form CompositeKey.FromURLSegment reads back; the previous Values(',') dropped\n // the field names, so a composite key written here could never be re-opened.\n const recordIdString = recordId instanceof CompositeKey\n ? recordId.ToCompactURLSegment()\n : recordId;\n\n // Check if we already have a log entry for this user/entity/record combination\n const rv = RunView.FromMetadataProvider(this.Provider);\n const existingResult = await rv.RunView<MJUserRecordLogEntity>({\n EntityName: 'MJ: User Record Logs',\n ExtraFilter: `UserID='${md.CurrentUser.ID}' AND EntityID='${entityInfo.ID}' AND RecordID='${recordIdString}'`,\n ResultType: 'entity_object',\n MaxRows: 1\n });\n\n if (!existingResult.Success) {\n console.error('RecentAccessService: Failed to check existing log', existingResult.ErrorMessage);\n return;\n }\n\n if (existingResult.Results && existingResult.Results.length > 0) {\n // Update existing entry\n const existing = existingResult.Results[0];\n existing.LatestAt = new Date();\n existing.TotalCount = (existing.TotalCount || 0) + 1;\n\n const saveResult = await existing.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to update log entry');\n }\n } else {\n // Create new entry\n const newLog = await md.GetEntityObject<MJUserRecordLogEntity>('MJ: User Record Logs', md.CurrentUser);\n newLog.UserID = md.CurrentUser.ID;\n newLog.EntityID = entityInfo.ID;\n newLog.RecordID = recordIdString;\n // EarliestAt and LatestAt have default values of getdate() in the DB\n // TotalCount defaults to 0, so we set it to 1\n newLog.TotalCount = 1;\n\n const saveResult = await newLog.Save();\n if (!saveResult) {\n console.error('RecentAccessService: Failed to create log entry');\n }\n }\n\n // Refresh the recent items list in background\n this.RefreshRecentItems();\n } catch (error) {\n // Don't throw - this is non-critical functionality\n console.error('RecentAccessService: Error logging access', error);\n }\n }\n\n /** @deprecated Use {@link LogAccess}. */\n public async logAccess(\n entityName: string,\n recordId: string | CompositeKey,\n resourceType: 'record' | 'view' | 'dashboard' | 'artifact' | 'report' = 'record'\n ): Promise<void> {\n return this.LogAccess(entityName, recordId, resourceType);\n }\n\n /**\n * Loads recent access items for the current user from `MJ: User Record Logs`.\n * @param maxItems - Maximum number of items to return (default 15)\n * @param forceRefresh - Force refresh even if already loaded\n */\n public async LoadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n if (this._isLoaded && !forceRefresh) {\n return this._recentItems$.value;\n }\n\n try {\n this._isLoading$.next(true);\n\n const md = this.Provider;\n\n const userRecordLogs = await UserInfoEngine.Instance.LoadRecentRecordLogs(maxItems, md.CurrentUser, md);\n\n const items: RecentAccessItem[] = [];\n\n for (const log of userRecordLogs) {\n const entityInfo = md.EntityByID(log.EntityID);\n if (!entityInfo) continue;\n\n // Determine resource type based on entity name\n const resourceType = this.determineResourceType(entityInfo.Name);\n\n items.push({\n id: log.ID,\n entityId: log.EntityID,\n entityName: entityInfo.Name,\n recordId: log.RecordID,\n latestAt: log.LatestAt,\n totalCount: log.TotalCount,\n resourceType\n });\n }\n\n // Batch-resolve record names for all items\n await this.resolveRecordNames(items, md);\n\n this._recentItems$.next(items);\n this._isLoaded = true;\n\n return items;\n } catch (error) {\n LogError('RecentAccessService: Error loading recent items', undefined, error);\n return [];\n } finally {\n this._isLoading$.next(false);\n }\n }\n\n /** @deprecated Use {@link LoadRecentItems}. */\n public async loadRecentItems(maxItems: number = 15, forceRefresh: boolean = false): Promise<RecentAccessItem[]> {\n return this.LoadRecentItems(maxItems, forceRefresh);\n }\n\n /**\n * Refresh recent items in background\n */\n public async RefreshRecentItems(): Promise<void> {\n await this.LoadRecentItems(15, true);\n }\n\n /** @deprecated Use {@link RefreshRecentItems}. */\n public async refreshRecentItems(): Promise<void> {\n return this.RefreshRecentItems();\n }\n\n /**\n * Batch-resolve record names for a list of recent access items using GetEntityRecordNames().\n * Mutates the items in-place to set recordName where resolved.\n */\n private async resolveRecordNames(items: RecentAccessItem[], md: IMetadataProvider): Promise<void> {\n const nameInputs: EntityRecordNameInput[] = [];\n const indexMap = new Map<string, number>();\n\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n const compositeKey = this.buildCompositeKeyForRecord(item.entityName, item.recordId, md);\n if (!compositeKey) continue;\n\n nameInputs.push({ EntityName: item.entityName, CompositeKey: compositeKey });\n indexMap.set(`${item.entityName}||${compositeKey.ToConcatenatedString()}`, i);\n }\n\n if (nameInputs.length === 0) return;\n\n try {\n const nameResults = await md.GetEntityRecordNames(nameInputs);\n for (const result of nameResults) {\n if (result.Success && result.RecordName) {\n const key = `${result.EntityName}||${result.CompositeKey.ToConcatenatedString()}`;\n const index = indexMap.get(key);\n if (index !== undefined) {\n items[index].recordName = result.RecordName;\n }\n }\n }\n } catch (error) {\n console.warn('RecentAccessService: Failed to resolve record names', error);\n }\n }\n\n /**\n * Build a CompositeKey for a record. RecordID may be stored as either:\n * - Concatenated format: \"FieldName|Value\" or \"Field1|Val1||Field2|Val2\"\n * - Plain value: just the raw value (e.g. a GUID)\n * Detects the format and constructs the key accordingly.\n */\n private buildCompositeKeyForRecord(entityName: string, recordId: string, md: IMetadataProvider): CompositeKey | null {\n if (!recordId) return null;\n\n // If recordId contains '|', it's in concatenated format\n if (recordId.includes('|')) {\n try {\n const compositeKey = new CompositeKey();\n compositeKey.LoadFromConcatenatedString(recordId);\n if (compositeKey.KeyValuePairs.length > 0) return compositeKey;\n } catch {\n // Fall through to entity-based lookup\n }\n }\n\n // Plain value — map it onto the entity's real primary key column (whatever it is called).\n // FromURLSegment also re-parses a delimited segment, covering the case where the try above failed.\n const entityInfo = md.Entities.find(e => e.Name === entityName);\n if (!entityInfo || entityInfo.PrimaryKeys.length === 0) return null;\n\n return CompositeKey.FromURLSegment(entityInfo, recordId);\n }\n\n /**\n * Determines the resource type based on entity name\n */\n private determineResourceType(entityName: string): 'record' | 'view' | 'dashboard' | 'artifact' | 'report' {\n return ResourceTypeForEntity(entityName);\n }\n\n /**\n * Clears the cached recent items (useful for logout)\n */\n public ClearCache(): void {\n this._recentItems$.next([]);\n this._isLoaded = false;\n }\n\n /** @deprecated Use {@link ClearCache}. */\n public clearCache(): void {\n return this.ClearCache();\n }\n}\n"]}
@@ -0,0 +1,7 @@
1
+ export type RecentResourceType = 'record' | 'view' | 'dashboard' | 'artifact' | 'report';
2
+ /**
3
+ * Resource type for an entity name in the recents list. Accepts the `MJ: ` prefix and the legacy
4
+ * unprefixed names.
5
+ */
6
+ export declare function ResourceTypeForEntity(entityName: string): RecentResourceType;
7
+ //# sourceMappingURL=recent-resource-type.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recent-resource-type.d.ts","sourceRoot":"","sources":["../../src/lib/recent-resource-type.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,kBAAkB,GAAG,QAAQ,GAAG,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,QAAQ,CAAC;AAEzF;;;GAGG;AACH,wBAAgB,qBAAqB,CAAC,UAAU,EAAE,MAAM,GAAG,kBAAkB,CAO5E"}
@@ -0,0 +1,17 @@
1
+ /**
2
+ * Resource type for an entity name in the recents list. Accepts the `MJ: ` prefix and the legacy
3
+ * unprefixed names.
4
+ */
5
+ export function ResourceTypeForEntity(entityName) {
6
+ const normalized = (entityName || '').trim().toLowerCase().replace(/^mj:\s*/, '');
7
+ if (normalized === 'user views')
8
+ return 'view';
9
+ if (normalized === 'dashboards')
10
+ return 'dashboard';
11
+ if (normalized === 'conversation artifacts')
12
+ return 'artifact';
13
+ if (normalized === 'reports')
14
+ return 'report';
15
+ return 'record';
16
+ }
17
+ //# sourceMappingURL=recent-resource-type.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recent-resource-type.js","sourceRoot":"","sources":["../../src/lib/recent-resource-type.ts"],"names":[],"mappings":"AAEA;;;GAGG;AACH,MAAM,UAAU,qBAAqB,CAAC,UAAkB;IACtD,MAAM,UAAU,GAAG,CAAC,UAAU,IAAI,EAAE,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;IAClF,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,MAAM,CAAC;IAC/C,IAAI,UAAU,KAAK,YAAY;QAAE,OAAO,WAAW,CAAC;IACpD,IAAI,UAAU,KAAK,wBAAwB;QAAE,OAAO,UAAU,CAAC;IAC/D,IAAI,UAAU,KAAK,SAAS;QAAE,OAAO,QAAQ,CAAC;IAC9C,OAAO,QAAQ,CAAC;AAClB,CAAC","sourcesContent":["export type RecentResourceType = 'record' | 'view' | 'dashboard' | 'artifact' | 'report';\n\n/**\n * Resource type for an entity name in the recents list. Accepts the `MJ: ` prefix and the legacy\n * unprefixed names.\n */\nexport function ResourceTypeForEntity(entityName: string): RecentResourceType {\n const normalized = (entityName || '').trim().toLowerCase().replace(/^mj:\\s*/, '');\n if (normalized === 'user views') return 'view';\n if (normalized === 'dashboards') return 'dashboard';\n if (normalized === 'conversation artifacts') return 'artifact';\n if (normalized === 'reports') return 'report';\n return 'record';\n}\n"]}
@@ -1,5 +1,6 @@
1
1
  export * from './lib/module';
2
2
  export * from './lib/recent-access.service';
3
+ export * from './lib/recent-resource-type';
3
4
  export * from './lib/theme.service';
4
5
  export * from './lib/dom-utils';
5
6
  export * from './lib/ag-grid-theme-params';
@@ -1 +1 @@
1
- {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
1
+ {"version":3,"file":"public-api.d.ts","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAKA,cAAc,cAAc,CAAC;AAG7B,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAGpC,cAAc,iBAAiB,CAAC;AAGhC,cAAc,4BAA4B,CAAC;AAG3C,cAAc,iCAAiC,CAAC;AAGhD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC"}
@@ -5,6 +5,7 @@
5
5
  export * from './lib/module';
6
6
  // Services
7
7
  export * from './lib/recent-access.service';
8
+ export * from './lib/recent-resource-type';
8
9
  export * from './lib/theme.service';
9
10
  // DOM helpers
10
11
  export * from './lib/dom-utils';
@@ -1 +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,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,qBAAqB,CAAC;AAEpC,cAAc;AACd,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/theme.service';\n\n// DOM helpers\nexport * from './lib/dom-utils';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n"]}
1
+ {"version":3,"file":"public-api.js","sourceRoot":"","sources":["../src/public-api.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,SAAS;AACT,cAAc,cAAc,CAAC;AAE7B,WAAW;AACX,cAAc,6BAA6B,CAAC;AAC5C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,qBAAqB,CAAC;AAEpC,cAAc;AACd,cAAc,iBAAiB,CAAC;AAEhC,oBAAoB;AACpB,cAAc,4BAA4B,CAAC;AAE3C,aAAa;AACb,cAAc,iCAAiC,CAAC;AAEhD,mDAAmD;AACnD,cAAc,oCAAoC,CAAC;AACnD,cAAc,qCAAqC,CAAC","sourcesContent":["/*\n * Public API Surface for @memberjunction/ng-shared-generic\n */\n\n// Module\nexport * from './lib/module';\n\n// Services\nexport * from './lib/recent-access.service';\nexport * from './lib/recent-resource-type';\nexport * from './lib/theme.service';\n\n// DOM helpers\nexport * from './lib/dom-utils';\n\n// Theming constants\nexport * from './lib/ag-grid-theme-params';\n\n// Components\nexport * from './lib/loading/loading.component';\n\n// Rich-text rendering (safe HTML/SVG sanitization)\nexport * from './lib/rich-text/rich-text-sanitize';\nexport * from './lib/rich-text/safe-rich-html.pipe';\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/ng-shared-generic",
3
- "version": "6.2.0-edge.2",
3
+ "version": "6.2.0-edge.4",
4
4
  "description": "MemberJunction: Generic Angular Shared Package - utility services and reusable elements used in any Angular application.",
5
5
  "main": "./dist/public-api.js",
6
6
  "typings": "./dist/public-api.d.ts",
@@ -16,7 +16,7 @@
16
16
  "devDependencies": {
17
17
  "@angular/compiler": "21.2.22",
18
18
  "@angular/compiler-cli": "21.2.22",
19
- "@memberjunction/ng-test-utils": "6.2.0-edge.2",
19
+ "@memberjunction/ng-test-utils": "6.2.0-edge.4",
20
20
  "vitest": "^4.0.18"
21
21
  },
22
22
  "peerDependencies": {
@@ -26,11 +26,11 @@
26
26
  "rxjs": "^7.8.2"
27
27
  },
28
28
  "dependencies": {
29
- "@memberjunction/core": "6.2.0-edge.2",
30
- "@memberjunction/ng-base-types": "6.2.0-edge.2",
31
- "@memberjunction/core-entities": "6.2.0-edge.2",
32
- "@memberjunction/global": "6.2.0-edge.2",
33
- "@memberjunction/theme-engine": "6.2.0-edge.2",
29
+ "@memberjunction/core": "6.2.0-edge.4",
30
+ "@memberjunction/ng-base-types": "6.2.0-edge.4",
31
+ "@memberjunction/core-entities": "6.2.0-edge.4",
32
+ "@memberjunction/global": "6.2.0-edge.4",
33
+ "@memberjunction/theme-engine": "6.2.0-edge.4",
34
34
  "dompurify": "^3.3.0",
35
35
  "tslib": "^2.8.1"
36
36
  },