@memberjunction/ng-shared 5.49.0 → 5.50.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.
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.service.d.ts","sourceRoot":"","sources":["../../src/lib/shared.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAc,QAAQ,EAAE,MAAM,eAAe,CAAC;AACjE,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAyD,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAqE,oBAAoB,EAAE,wBAAwB,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAKlL,OAAO,EAAW,UAAU,EAAmC,MAAM,MAAM,CAAC;AAE5E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;;AAGzE,qBAGa,aAAa;IAUtB,OAAO,CAAC,sBAAsB;IAC9B,OAAO,CAAC,QAAQ;IAVlB,OAAO,CAAC,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAiC;IACxE,OAAO,CAAC,MAAM,CAAC,OAAO,CAAkB;IACxC,OAAO,CAAC,MAAM,CAAC,cAAc,CAA8B;IAC3D,OAAO,CAAC,MAAM,CAAC,UAAU,CAAuC;IAChE,OAAO,CAAC,SAAS,CAAiB;IAClC,UAAU,sBAAiC;IAC3C,OAAO,CAAC,kBAAkB,CAAkC;gBAGlD,sBAAsB,EAAE,qBAAqB,EAC7C,QAAQ,EAAE,QAAQ;IA8B5B,WAAkB,QAAQ,IAAI,aAAa,CAE1C;IAED;;;;OAIG;IACH,OAAO,CAAC,SAAS,CAAkC;IAEnD,IAAW,QAAQ,CAAC,KAAK,EAAE,iBAAiB,GAAG,IAAI,EAElD;IAED,IAAW,QAAQ,IAAI,iBAAiB,CAEvC;IAED;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;
|
|
1
|
+
{"version":3,"file":"shared.service.d.ts","sourceRoot":"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EAAE,qBAAqB,EAAE,GAAG,GAAG,IAAI,EAAE,aAAa,GAAG,OAAc,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAIrO;;OAEG;WACiB,wBAAwB;IAI5C;;;;;;OAMG;IACI,wBAAwB,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,GAAE,MAAM,GAAG,SAAS,GAAG,OAAO,GAAG,SAAS,GAAG,MAAkB,EAAE,SAAS,CAAC,EAAE,MAAM;IAMzI,OAAO,CAAC,gBAAgB,CASvB;IACD;;;;OAIG;IACI,iCAAiC,CAAC,gBAAgB,EAAE,MAAM;IAQjE;;;;OAIG;IACI,iCAAiC,CAAC,oBAAoB,EAAE,MAAM;IAQrE;;;OAGG;IACI,gBAAgB,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,YAAY;yCAjVzD,aAAa;6CAAb,aAAa;CA4VzB;AAED,eAAO,MAAM,YAAY;;;CAGf,CAAC;AAEX,MAAM,MAAM,YAAY,GAAG,OAAO,YAAY,CAAC,MAAM,OAAO,YAAY,CAAC,CAAC;AAG1E,eAAO,MAAM,UAAU;;;;;;;;;;;;;;;;CAgBb,CAAC;AAEX,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,CAAC,MAAM,OAAO,UAAU,CAAC,CAAC"}
|
|
@@ -72,8 +72,10 @@ export class SharedService {
|
|
|
72
72
|
// AIEngineBase is the slowest - loads agents, models, prompts, etc.
|
|
73
73
|
// Critical for Conversations feature
|
|
74
74
|
AIEngineBase.Instance.Config(false).catch(err => LogError(`Failed to pre-warm AIEngineBase: ${err}`));
|
|
75
|
-
// ArtifactMetadataEngine
|
|
76
|
-
//
|
|
75
|
+
// ArtifactMetadataEngine.Config() loads only the artifact-type registry —
|
|
76
|
+
// a small, fixed set. Artifacts and versions (whose Content can be huge) are
|
|
77
|
+
// fetched on demand per-artifact, so this pre-warm stays cheap and bounded.
|
|
78
|
+
// Used by Conversations and the Artifact viewer.
|
|
77
79
|
ArtifactMetadataEngine.Instance.Config(false).catch(err => LogError(`Failed to pre-warm ArtifactMetadataEngine: ${err}`));
|
|
78
80
|
// DashboardEngine loads dashboard metadata
|
|
79
81
|
// Used when viewing dashboards
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.service.js","sourceRoot":"","sources":["../../src/lib/shared.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAY,MAAM,eAAe,CAAC;AACjE,OAAO,EAAsD,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,wBAAwB,EAAkE,MAAM,+BAA+B,CAAC;AAClL,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,+BAA+B,EAAE,kBAAkB,EAAE,UAAU,EAAE,oBAAoB,EAAE,MAAM,wBAAwB,CAAC;AAEtJ,OAAO,EAAE,OAAO,EAAc,eAAe,EAAE,cAAc,EAAE,MAAM,MAAM,CAAC;AAC5E,OAAO,EAAE,KAAK,EAAE,GAAG,EAAE,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AACzE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;;;AAKzD,MAAM,OAAO,aAAa;IAUd;IACA;IAVF,MAAM,CAAU,eAAe,GAAG,6BAA6B,CAAC;IAChE,MAAM,CAAC,OAAO,GAAY,KAAK,CAAC;IAChC,MAAM,CAAC,cAAc,GAA2B,EAAE,CAAC;IACnD,MAAM,CAAC,UAAU,GAAG,IAAI,eAAe,CAAU,KAAK,CAAC,CAAC;IACxD,SAAS,GAAG,IAAI,OAAO,EAAE,CAAC;IAClC,UAAU,GAAG,IAAI,CAAC,SAAS,CAAC,YAAY,EAAE,CAAC;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AC,GAAG,CAAC,wCAAwC,EAAE,UAAU,EAAE,UAAU,CAAC,YAAY,EAAE,CAAC,CAAC;YAC7F,oDAAoD;YACpD,IAAI,CAAC,iBAAiB,CAAC,gBAAgB,CAAC,UAAU,EAAE,UAAU,CAAC,CAAC;QAClE,CAAC;QACD,OAAO,CAAC,EAAE,CAAC;YACT,OAAO,CAAC,KAAK,CAAC,4BAA4B,EAAE,CAAC,CAAC,CAAC;YAC/C,QAAQ,CAAC,CAAC,CAAC,CAAC;QACd,CAAC;IACH,CAAC;uGAzVU,aAAa;gEAAb,aAAa,WAAb,aAAa,mBAFZ,MAAM;;iFAEP,aAAa;cAHzB,UAAU;eAAC;gBACV,UAAU,EAAE,MAAM;aACnB;;AA6VD,MAAM,CAAC,MAAM,YAAY,GAAG;IAC1B,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;CACV,CAAC;AAKX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW,EAAE,aAAa;IAC1B,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,iBAAiB,EAAE,mBAAmB;IACtC,iBAAiB,EAAE,mBAAmB;IACtC,wBAAwB,EAAE,0BAA0B;IACpD,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;CACtB,CAAC","sourcesContent":["import { ElementRef, Injectable, Injector } from '@angular/core';\nimport { CompositeKey, IMetadataProvider, LocalCacheManager, LogError, Metadata, StartupManager } from '@memberjunction/core';\nimport { ArtifactMetadataEngine, DashboardEngine, ResourcePermissionEngine, MJResourceTypeEntity, MJUserNotificationEntity, ViewColumnInfo } from '@memberjunction/core-entities';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { EntityCommunicationsEngineBase } from \"@memberjunction/entity-communications-base\";\nimport { MJEventType, MJGlobal, ConvertMarkdownStringToHtmlList, InvokeManualResize, UUIDsEqual, GetGlobalObjectStore } from '@memberjunction/global';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { Subject, Observable, BehaviorSubject, firstValueFrom } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { NavigationService } from './navigation.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SharedService {\n private static readonly _globalStoreKey = '___SINGLETON__SharedService';\n private static _loaded: boolean = false;\n private static _resourceTypes: MJResourceTypeEntity[] = [];\n private static isLoading$ = new BehaviorSubject<boolean>(false);\n private tabChange = new Subject();\n tabChange$ = this.tabChange.asObservable();\n private _navigationService: NavigationService | null = null;\n\n constructor(\n private mjNotificationsService: MJNotificationService,\n private injector: Injector\n ) {\n const g = GetGlobalObjectStore()!;\n if (g[SharedService._globalStoreKey]) {\n return g[SharedService._globalStoreKey] as SharedService;\n }\n g[SharedService._globalStoreKey] = this;\n\n MJGlobal.Instance.GetEventListener(true).subscribe(async (event) => {\n switch (event.event) {\n case MJEventType.LoggedIn:\n if (SharedService._loaded === false) {\n // Pre-warm non-critical engines IMMEDIATELY on LoggedIn, before\n // StartupManager.Startup() completes. These engines only need\n // Metadata.Provider (set during setupGraphQLClient's provider.Config()).\n // Firing them here allows their RunViews calls to be coalesced with\n // the startup engines' calls into fewer mega-batched GraphQL requests.\n SharedService.preWarmEngines();\n\n // Handle app startup — joins the same Startup() promise that\n // setupGraphQLClient kicked off.\n await StartupManager.Instance.Startup();\n\n await SharedService.RefreshData(false);\n }\n break;\n }\n }); \n }\n\n public static get Instance(): SharedService {\n return GetGlobalObjectStore()![SharedService._globalStoreKey] as SharedService;\n }\n\n /**\n * Optional explicit metadata provider. Set via `setProvider()` from a caller\n * with provider context (e.g. the shell). Falls back to `Metadata.Provider`\n * when not set.\n */\n private _provider: IMetadataProvider | null = null;\n\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Pre-warms commonly used engines in the background after login.\n * This reduces perceived latency when users navigate to features like\n * Conversations, Dashboards, or Artifacts. Fire-and-forget pattern -\n * errors are logged but don't block the UI.\n */\n private static preWarmEngines(): void {\n // AIEngineBase is the slowest - loads agents, models, prompts, etc.\n // Critical for Conversations feature\n AIEngineBase.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm AIEngineBase: ${err}`)\n );\n\n // ArtifactMetadataEngine is lightweight (just artifact types)\n // Used by Conversations and Artifact viewer\n ArtifactMetadataEngine.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm ArtifactMetadataEngine: ${err}`)\n );\n\n // DashboardEngine loads dashboard metadata\n // Used when viewing dashboards\n DashboardEngine.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm DashboardEngine: ${err}`)\n );\n\n EntityCommunicationsEngineBase.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm DashboardEngine: ${err}`)\n );\n }\n\n /**\n * Get the NavigationService singleton instance\n * Lazy-loaded to avoid circular dependency issues\n */\n private get navigationService(): NavigationService {\n if (!this._navigationService) {\n this._navigationService = this.injector.get(NavigationService);\n }\n return this._navigationService;\n }\n\n /**\n * Get the neutral color used for system-wide resources\n */\n public get ExplorerAppColor(): string {\n return this.navigationService.ExplorerAppColor;\n }\n\n /**\n * Returns the current session ID, which is automatically created when the service is instantiated.\n */\n public get SessionId(): string {\n return (<GraphQLDataProvider>this.Provider).sessionId;\n }\n\n public get ResourceTypes(): MJResourceTypeEntity[] {\n return SharedService._resourceTypes;\n }\n public get ViewResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'user views')!;\n }\n public get RecordResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'records')!;\n }\n public get DashboardResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'dashboards')!;\n }\n public get ReportResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'reports')!;\n }\n public get SearchResultsResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'search results')!;\n }\n public get ListResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'lists')!;\n }\n public ResourceTypeByID(id: string): MJResourceTypeEntity | undefined {\n return SharedService._resourceTypes.find(rt => UUIDsEqual(rt.ID, id));\n }\n public ResourceTypeByName(name: string): MJResourceTypeEntity | undefined {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === name.trim().toLowerCase());\n }\n\n /**\n * Refreshes the data for the service. If OnlyIfNeeded is true, then the data is only refreshed if it hasn't been loaded yet.\n */\n public static async RefreshData(OnlyIfNeeded: boolean = false) {\n if (OnlyIfNeeded && SharedService._loaded) {\n return;\n }\n\n const canProceed$ = SharedService.isLoading$.pipe(\n first(isLoading => !isLoading),\n tap(() => SharedService.isLoading$.next(true))\n );\n\n await firstValueFrom(canProceed$);\n\n try {\n // After waiting for the current loading operation to complete, check again\n // if _loaded is true and OnlyIfNeeded is true, return early\n if (OnlyIfNeeded && SharedService._loaded) {\n return;\n }\n\n await SharedService.handleDataLoading();\n\n // Mark as loaded\n SharedService._loaded = true;\n } finally {\n // Ensure we always reset the loading flag\n SharedService.isLoading$.next(false);\n }\n }\n\n private static async handleDataLoading() {\n // make sure startup is done\n await StartupManager.Instance.Startup();\n\n this._resourceTypes = ResourcePermissionEngine.Instance.ResourceTypes;\n\n // Note: RefreshUserNotifications() removed here because MJNotificationService\n // already handles it via its own MJEventType.LoggedIn subscription. Calling it\n // from both places caused a duplicate User Notifications GraphQL request on login.\n } \n\n FormatColumnValue(col: ViewColumnInfo, value: any, maxLength: number = 0, trailingChars: string = \"...\") {\n if (value === null || value === undefined)\n return value;\n\n try {\n const retVal = col.EntityField.FormatValue(value, 0);\n if (maxLength > 0 && retVal && retVal.length > maxLength)\n return retVal.substring(0, maxLength) + trailingChars;\n else\n return retVal;\n }\n catch (e) {\n LogError(e);\n return value;\n }\n }\n\n public ConvertMarkdownStringToHtmlList(listType: HtmlListType, text: string): string {\n return ConvertMarkdownStringToHtmlList(listType, text) ?? text;\n }\n\n \n public InvokeManualResize(delay: number = 50) {\n return InvokeManualResize(delay, this);\n }\n\n public PushStatusUpdates(): Observable<string> {\n const gp: GraphQLDataProvider = <GraphQLDataProvider>this.Provider;\n return gp.PushStatusUpdates();\n }\n\n private _currentUserImage: string | Blob = '/assets/user.png';\n public get CurrentUserImage(): string | Blob {\n return this._currentUserImage;\n }\n public set CurrentUserImage(value: string | Blob) {\n this._currentUserImage = value;\n }\n\n /**\n * @deprecated Use MJNotificationService.UserNotifications instead\n */\n public static get UserNotifications(): MJUserNotificationEntity[] {\n return MJNotificationService.UserNotifications;\n }\n /**\n * @deprecated Use MJNotificationService.UnreadUserNotifications instead\n */\n public static get UnreadUserNotifications(): MJUserNotificationEntity[] {\n return MJNotificationService.UnreadUserNotifications;\n }\n /**\n * @deprecated Use MJNotificationService.UnreadUserNotificationCount instead\n */\n public static get UnreadUserNotificationCount(): number {\n return MJNotificationService.UnreadUserNotificationCount;\n }\n\n /**\n * Utility method that returns true if child is a descendant of parent, false otherwise. \n */\n public static IsDescendant(parent: ElementRef, child: ElementRef) {\n if (parent && child && parent.nativeElement && child.nativeElement) {\n let node = child.nativeElement.parentNode;\n while (node != null) {\n if (node == parent.nativeElement) {\n return true;\n }\n node = node.parentNode;\n }\n }\n return false;\n }\n\n\n /**\n * Creates a notification in the database and refreshes the UI. Returns the notification object.\n * @param title \n * @param message \n * @param resourceTypeId \n * @param resourceRecordId \n * @param resourceConfiguration Any object, it is converted to a string by JSON.stringify and stored in the database\n * @returns \n * @deprecated Use MJNotificationService.CreateNotification instead\n */\n public async CreateNotification(title: string, message: string, resourceTypeId: string | null, resourceRecordId: string | null, resourceConfiguration: any | null, displayToUser : boolean = true): Promise<MJUserNotificationEntity> {\n return this.mjNotificationsService.CreateNotification(title, message, resourceTypeId, resourceRecordId, resourceConfiguration, displayToUser);\n }\n\n /**\n * @deprecated Use MJNotificationService.RefreshUserNotifications instead\n */\n public static async RefreshUserNotifications() {\n MJNotificationService.RefreshUserNotifications();\n }\n\n /**\n * Creates a message that is not saved to the User Notifications table, but is displayed to the user.\n * @param message - text to display\n * @param style - display styling\n * @param hideAfter - option to auto hide after the specified delay in milliseconds\n * @deprecated Use MJNotificationService.CreateSimpleNotification instead\n */\n public CreateSimpleNotification(message: string, style: \"none\" | \"success\" | \"error\" | \"warning\" | \"info\" = \"success\", hideAfter?: number) {\n return this.mjNotificationsService.CreateSimpleNotification(message, style, hideAfter);\n }\n\n\n\n private _resourceTypeMap = [\n { routeSegment: 'record', name: 'records' },\n { routeSegment: 'view', name: 'user views' },\n { routeSegment: 'search', name: 'search results' },\n { routeSegment: 'report', name: 'reports' },\n { routeSegment: 'query', name: 'queries' },\n { routeSegment: 'dashboard', name: 'dashboards' },\n { routeSegment: 'list', name: 'lists' },\n \n ]\n /**\n * Maps a Resource Type record Name column to the corresponding route segment\n * @param resourceTypeName \n * @returns \n */\n public mapResourceTypeNameToRouteSegment(resourceTypeName: string) {\n const item = this._resourceTypeMap.find(rt => rt.name.trim().toLowerCase() === resourceTypeName.trim().toLowerCase());\n if (item)\n return item.routeSegment;\n else\n return null \n }\n\n /**\n * Maps a route segment to the corresponding Resource Type record Name column\n * @param resourceRouteSegment \n * @returns \n */\n public mapResourceTypeRouteSegmentToName(resourceRouteSegment: string) {\n const item = this._resourceTypeMap.find(rt => rt.routeSegment.trim().toLowerCase() === resourceRouteSegment.trim().toLowerCase());\n if (item)\n return item.name;\n else\n return null \n }\n\n /**\n * Opens an entity record in a new or existing tab\n * Uses the modern NavigationService for tab-based navigation\n */\n public OpenEntityRecord(entityName: string, recordPkey: CompositeKey) {\n try {\n console.log('SharedService.OpenEntityRecord called:', entityName, recordPkey.ToURLSegment());\n // Use NavigationService to open in new tab-based UX\n this.navigationService.OpenEntityRecord(entityName, recordPkey);\n }\n catch (e) {\n console.error('Error in OpenEntityRecord:', e);\n LogError(e);\n }\n }\n}\n\nexport const HtmlListType = {\n Unordered: 'Unordered',\n Ordered: 'Ordered',\n} as const;\n\nexport type HtmlListType = typeof HtmlListType[keyof typeof HtmlListType];\n\n\nexport const EventCodes = {\n ViewClicked: \"ViewClicked\",\n EntityRecordClicked: \"EntityRecordClicked\",\n AddDashboard: \"AddDashboard\",\n AddReport: \"AddReport\",\n AddQuery: \"AddQuery\",\n ViewCreated: \"ViewCreated\",\n ViewUpdated: \"ViewUpdated\",\n RunSearch: \"RunSearch\",\n ViewNotifications: \"ViewNotifications\",\n PushStatusUpdates: \"PushStatusUpdates\",\n UserNotificationsUpdated: \"UserNotificationsUpdated\",\n CloseCurrentTab: \"CloseCurrentTab\",\n ListCreated: \"ListCreated\",\n ListClicked: 'ListClicked',\n AvatarUpdated: 'AvatarUpdated'\n} as const;\n\nexport type EventCodes = typeof EventCodes[keyof typeof EventCodes];"]}
|
|
1
|
+
{"version":3,"file":"shared.service.js","sourceRoot":"","sources":["../../src/lib/shared.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,UAAU,EAAY,MAAM,eAAe,CAAC;AACjE,OAAO,EAAsD,QAAQ,EAAE,QAAQ,EAAE,cAAc,EAAE,MAAM,sBAAsB,CAAC;AAC9H,OAAO,EAAE,sBAAsB,EAAE,eAAe,EAAE,wBAAwB,EAAkE,MAAM,+BAA+B,CAAC;AAClL,OAAO,EAAE,YAAY,EAAE,MAAM,gCAAgC,CAAC;AAC9D,OAAO,EAAE,8BAA8B,EAAE,MAAM,4CAA4C,CAAC;AAC5F,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,+BA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C;AAKX,MAAM,CAAC,MAAM,UAAU,GAAG;IACxB,WAAW,EAAE,aAAa;IAC1B,mBAAmB,EAAE,qBAAqB;IAC1C,YAAY,EAAE,cAAc;IAC5B,SAAS,EAAE,WAAW;IACtB,QAAQ,EAAE,UAAU;IACpB,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,SAAS,EAAE,WAAW;IACtB,iBAAiB,EAAE,mBAAmB;IACtC,iBAAiB,EAAE,mBAAmB;IACtC,wBAAwB,EAAE,0BAA0B;IACpD,eAAe,EAAE,iBAAiB;IAClC,WAAW,EAAE,aAAa;IAC1B,WAAW,EAAE,aAAa;IAC1B,aAAa,EAAE,eAAe;CACtB,CAAC","sourcesContent":["import { ElementRef, Injectable, Injector } from '@angular/core';\nimport { CompositeKey, IMetadataProvider, LocalCacheManager, LogError, Metadata, StartupManager } from '@memberjunction/core';\nimport { ArtifactMetadataEngine, DashboardEngine, ResourcePermissionEngine, MJResourceTypeEntity, MJUserNotificationEntity, ViewColumnInfo } from '@memberjunction/core-entities';\nimport { AIEngineBase } from '@memberjunction/ai-engine-base';\nimport { EntityCommunicationsEngineBase } from \"@memberjunction/entity-communications-base\";\nimport { MJEventType, MJGlobal, ConvertMarkdownStringToHtmlList, InvokeManualResize, UUIDsEqual, GetGlobalObjectStore } from '@memberjunction/global';\nimport { GraphQLDataProvider } from '@memberjunction/graphql-dataprovider';\nimport { Subject, Observable, BehaviorSubject, firstValueFrom } from 'rxjs';\nimport { first, tap } from 'rxjs/operators';\nimport { MJNotificationService } from '@memberjunction/ng-notifications';\nimport { NavigationService } from './navigation.service';\n\n@Injectable({\n providedIn: 'root'\n})\nexport class SharedService {\n private static readonly _globalStoreKey = '___SINGLETON__SharedService';\n private static _loaded: boolean = false;\n private static _resourceTypes: MJResourceTypeEntity[] = [];\n private static isLoading$ = new BehaviorSubject<boolean>(false);\n private tabChange = new Subject();\n tabChange$ = this.tabChange.asObservable();\n private _navigationService: NavigationService | null = null;\n\n constructor(\n private mjNotificationsService: MJNotificationService,\n private injector: Injector\n ) {\n const g = GetGlobalObjectStore()!;\n if (g[SharedService._globalStoreKey]) {\n return g[SharedService._globalStoreKey] as SharedService;\n }\n g[SharedService._globalStoreKey] = this;\n\n MJGlobal.Instance.GetEventListener(true).subscribe(async (event) => {\n switch (event.event) {\n case MJEventType.LoggedIn:\n if (SharedService._loaded === false) {\n // Pre-warm non-critical engines IMMEDIATELY on LoggedIn, before\n // StartupManager.Startup() completes. These engines only need\n // Metadata.Provider (set during setupGraphQLClient's provider.Config()).\n // Firing them here allows their RunViews calls to be coalesced with\n // the startup engines' calls into fewer mega-batched GraphQL requests.\n SharedService.preWarmEngines();\n\n // Handle app startup — joins the same Startup() promise that\n // setupGraphQLClient kicked off.\n await StartupManager.Instance.Startup();\n\n await SharedService.RefreshData(false);\n }\n break;\n }\n }); \n }\n\n public static get Instance(): SharedService {\n return GetGlobalObjectStore()![SharedService._globalStoreKey] as SharedService;\n }\n\n /**\n * Optional explicit metadata provider. Set via `setProvider()` from a caller\n * with provider context (e.g. the shell). Falls back to `Metadata.Provider`\n * when not set.\n */\n private _provider: IMetadataProvider | null = null;\n\n public set Provider(value: IMetadataProvider | null) {\n this._provider = value;\n }\n\n public get Provider(): IMetadataProvider {\n return this._provider ?? Metadata.Provider;\n }\n\n /**\n * Pre-warms commonly used engines in the background after login.\n * This reduces perceived latency when users navigate to features like\n * Conversations, Dashboards, or Artifacts. Fire-and-forget pattern -\n * errors are logged but don't block the UI.\n */\n private static preWarmEngines(): void {\n // AIEngineBase is the slowest - loads agents, models, prompts, etc.\n // Critical for Conversations feature\n AIEngineBase.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm AIEngineBase: ${err}`)\n );\n\n // ArtifactMetadataEngine.Config() loads only the artifact-type registry —\n // a small, fixed set. Artifacts and versions (whose Content can be huge) are\n // fetched on demand per-artifact, so this pre-warm stays cheap and bounded.\n // Used by Conversations and the Artifact viewer.\n ArtifactMetadataEngine.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm ArtifactMetadataEngine: ${err}`)\n );\n\n // DashboardEngine loads dashboard metadata\n // Used when viewing dashboards\n DashboardEngine.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm DashboardEngine: ${err}`)\n );\n\n EntityCommunicationsEngineBase.Instance.Config(false).catch(err =>\n LogError(`Failed to pre-warm DashboardEngine: ${err}`)\n );\n }\n\n /**\n * Get the NavigationService singleton instance\n * Lazy-loaded to avoid circular dependency issues\n */\n private get navigationService(): NavigationService {\n if (!this._navigationService) {\n this._navigationService = this.injector.get(NavigationService);\n }\n return this._navigationService;\n }\n\n /**\n * Get the neutral color used for system-wide resources\n */\n public get ExplorerAppColor(): string {\n return this.navigationService.ExplorerAppColor;\n }\n\n /**\n * Returns the current session ID, which is automatically created when the service is instantiated.\n */\n public get SessionId(): string {\n return (<GraphQLDataProvider>this.Provider).sessionId;\n }\n\n public get ResourceTypes(): MJResourceTypeEntity[] {\n return SharedService._resourceTypes;\n }\n public get ViewResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'user views')!;\n }\n public get RecordResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'records')!;\n }\n public get DashboardResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'dashboards')!;\n }\n public get ReportResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'reports')!;\n }\n public get SearchResultsResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'search results')!;\n }\n public get ListResourceType(): MJResourceTypeEntity {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === 'lists')!;\n }\n public ResourceTypeByID(id: string): MJResourceTypeEntity | undefined {\n return SharedService._resourceTypes.find(rt => UUIDsEqual(rt.ID, id));\n }\n public ResourceTypeByName(name: string): MJResourceTypeEntity | undefined {\n return SharedService._resourceTypes.find(rt => rt.Name.trim().toLowerCase() === name.trim().toLowerCase());\n }\n\n /**\n * Refreshes the data for the service. If OnlyIfNeeded is true, then the data is only refreshed if it hasn't been loaded yet.\n */\n public static async RefreshData(OnlyIfNeeded: boolean = false) {\n if (OnlyIfNeeded && SharedService._loaded) {\n return;\n }\n\n const canProceed$ = SharedService.isLoading$.pipe(\n first(isLoading => !isLoading),\n tap(() => SharedService.isLoading$.next(true))\n );\n\n await firstValueFrom(canProceed$);\n\n try {\n // After waiting for the current loading operation to complete, check again\n // if _loaded is true and OnlyIfNeeded is true, return early\n if (OnlyIfNeeded && SharedService._loaded) {\n return;\n }\n\n await SharedService.handleDataLoading();\n\n // Mark as loaded\n SharedService._loaded = true;\n } finally {\n // Ensure we always reset the loading flag\n SharedService.isLoading$.next(false);\n }\n }\n\n private static async handleDataLoading() {\n // make sure startup is done\n await StartupManager.Instance.Startup();\n\n this._resourceTypes = ResourcePermissionEngine.Instance.ResourceTypes;\n\n // Note: RefreshUserNotifications() removed here because MJNotificationService\n // already handles it via its own MJEventType.LoggedIn subscription. Calling it\n // from both places caused a duplicate User Notifications GraphQL request on login.\n } \n\n FormatColumnValue(col: ViewColumnInfo, value: any, maxLength: number = 0, trailingChars: string = \"...\") {\n if (value === null || value === undefined)\n return value;\n\n try {\n const retVal = col.EntityField.FormatValue(value, 0);\n if (maxLength > 0 && retVal && retVal.length > maxLength)\n return retVal.substring(0, maxLength) + trailingChars;\n else\n return retVal;\n }\n catch (e) {\n LogError(e);\n return value;\n }\n }\n\n public ConvertMarkdownStringToHtmlList(listType: HtmlListType, text: string): string {\n return ConvertMarkdownStringToHtmlList(listType, text) ?? text;\n }\n\n \n public InvokeManualResize(delay: number = 50) {\n return InvokeManualResize(delay, this);\n }\n\n public PushStatusUpdates(): Observable<string> {\n const gp: GraphQLDataProvider = <GraphQLDataProvider>this.Provider;\n return gp.PushStatusUpdates();\n }\n\n private _currentUserImage: string | Blob = '/assets/user.png';\n public get CurrentUserImage(): string | Blob {\n return this._currentUserImage;\n }\n public set CurrentUserImage(value: string | Blob) {\n this._currentUserImage = value;\n }\n\n /**\n * @deprecated Use MJNotificationService.UserNotifications instead\n */\n public static get UserNotifications(): MJUserNotificationEntity[] {\n return MJNotificationService.UserNotifications;\n }\n /**\n * @deprecated Use MJNotificationService.UnreadUserNotifications instead\n */\n public static get UnreadUserNotifications(): MJUserNotificationEntity[] {\n return MJNotificationService.UnreadUserNotifications;\n }\n /**\n * @deprecated Use MJNotificationService.UnreadUserNotificationCount instead\n */\n public static get UnreadUserNotificationCount(): number {\n return MJNotificationService.UnreadUserNotificationCount;\n }\n\n /**\n * Utility method that returns true if child is a descendant of parent, false otherwise. \n */\n public static IsDescendant(parent: ElementRef, child: ElementRef) {\n if (parent && child && parent.nativeElement && child.nativeElement) {\n let node = child.nativeElement.parentNode;\n while (node != null) {\n if (node == parent.nativeElement) {\n return true;\n }\n node = node.parentNode;\n }\n }\n return false;\n }\n\n\n /**\n * Creates a notification in the database and refreshes the UI. Returns the notification object.\n * @param title \n * @param message \n * @param resourceTypeId \n * @param resourceRecordId \n * @param resourceConfiguration Any object, it is converted to a string by JSON.stringify and stored in the database\n * @returns \n * @deprecated Use MJNotificationService.CreateNotification instead\n */\n public async CreateNotification(title: string, message: string, resourceTypeId: string | null, resourceRecordId: string | null, resourceConfiguration: any | null, displayToUser : boolean = true): Promise<MJUserNotificationEntity> {\n return this.mjNotificationsService.CreateNotification(title, message, resourceTypeId, resourceRecordId, resourceConfiguration, displayToUser);\n }\n\n /**\n * @deprecated Use MJNotificationService.RefreshUserNotifications instead\n */\n public static async RefreshUserNotifications() {\n MJNotificationService.RefreshUserNotifications();\n }\n\n /**\n * Creates a message that is not saved to the User Notifications table, but is displayed to the user.\n * @param message - text to display\n * @param style - display styling\n * @param hideAfter - option to auto hide after the specified delay in milliseconds\n * @deprecated Use MJNotificationService.CreateSimpleNotification instead\n */\n public CreateSimpleNotification(message: string, style: \"none\" | \"success\" | \"error\" | \"warning\" | \"info\" = \"success\", hideAfter?: number) {\n return this.mjNotificationsService.CreateSimpleNotification(message, style, hideAfter);\n }\n\n\n\n private _resourceTypeMap = [\n { routeSegment: 'record', name: 'records' },\n { routeSegment: 'view', name: 'user views' },\n { routeSegment: 'search', name: 'search results' },\n { routeSegment: 'report', name: 'reports' },\n { routeSegment: 'query', name: 'queries' },\n { routeSegment: 'dashboard', name: 'dashboards' },\n { routeSegment: 'list', name: 'lists' },\n \n ]\n /**\n * Maps a Resource Type record Name column to the corresponding route segment\n * @param resourceTypeName \n * @returns \n */\n public mapResourceTypeNameToRouteSegment(resourceTypeName: string) {\n const item = this._resourceTypeMap.find(rt => rt.name.trim().toLowerCase() === resourceTypeName.trim().toLowerCase());\n if (item)\n return item.routeSegment;\n else\n return null \n }\n\n /**\n * Maps a route segment to the corresponding Resource Type record Name column\n * @param resourceRouteSegment \n * @returns \n */\n public mapResourceTypeRouteSegmentToName(resourceRouteSegment: string) {\n const item = this._resourceTypeMap.find(rt => rt.routeSegment.trim().toLowerCase() === resourceRouteSegment.trim().toLowerCase());\n if (item)\n return item.name;\n else\n return null \n }\n\n /**\n * Opens an entity record in a new or existing tab\n * Uses the modern NavigationService for tab-based navigation\n */\n public OpenEntityRecord(entityName: string, recordPkey: CompositeKey) {\n try {\n console.log('SharedService.OpenEntityRecord called:', entityName, recordPkey.ToURLSegment());\n // Use NavigationService to open in new tab-based UX\n this.navigationService.OpenEntityRecord(entityName, recordPkey);\n }\n catch (e) {\n console.error('Error in OpenEntityRecord:', e);\n LogError(e);\n }\n }\n}\n\nexport const HtmlListType = {\n Unordered: 'Unordered',\n Ordered: 'Ordered',\n} as const;\n\nexport type HtmlListType = typeof HtmlListType[keyof typeof HtmlListType];\n\n\nexport const EventCodes = {\n ViewClicked: \"ViewClicked\",\n EntityRecordClicked: \"EntityRecordClicked\",\n AddDashboard: \"AddDashboard\",\n AddReport: \"AddReport\",\n AddQuery: \"AddQuery\",\n ViewCreated: \"ViewCreated\",\n ViewUpdated: \"ViewUpdated\",\n RunSearch: \"RunSearch\",\n ViewNotifications: \"ViewNotifications\",\n PushStatusUpdates: \"PushStatusUpdates\",\n UserNotificationsUpdated: \"UserNotificationsUpdated\",\n CloseCurrentTab: \"CloseCurrentTab\",\n ListCreated: \"ListCreated\",\n ListClicked: 'ListClicked',\n AvatarUpdated: 'AvatarUpdated'\n} as const;\n\nexport type EventCodes = typeof EventCodes[keyof typeof EventCodes];"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/ng-shared",
|
|
3
|
-
"version": "5.
|
|
3
|
+
"version": "5.50.0",
|
|
4
4
|
"description": "MemberJunction: MJ Explorer Angular Shared Package - utility functions and other reusable elements used across other MJ Angular packages within the MJ Explorer App - do not use outside of MJ Explorer.",
|
|
5
5
|
"main": "./dist/public-api.js",
|
|
6
6
|
"typings": "./dist/public-api.d.ts",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
},
|
|
30
30
|
"dependencies": {
|
|
31
31
|
"@angular/platform-browser": "21.1.3",
|
|
32
|
-
"@memberjunction/ai-core-plus": "5.
|
|
33
|
-
"@memberjunction/ai-engine-base": "5.
|
|
34
|
-
"@memberjunction/core": "5.
|
|
35
|
-
"@memberjunction/core-entities": "5.
|
|
36
|
-
"@memberjunction/entity-communications-base": "5.
|
|
37
|
-
"@memberjunction/global": "5.
|
|
38
|
-
"@memberjunction/graphql-dataprovider": "5.
|
|
39
|
-
"@memberjunction/ng-base-application": "5.
|
|
40
|
-
"@memberjunction/ng-base-types": "5.
|
|
41
|
-
"@memberjunction/ng-notifications": "5.
|
|
42
|
-
"@memberjunction/ng-shared-generic": "5.
|
|
32
|
+
"@memberjunction/ai-core-plus": "5.50.0",
|
|
33
|
+
"@memberjunction/ai-engine-base": "5.50.0",
|
|
34
|
+
"@memberjunction/core": "5.50.0",
|
|
35
|
+
"@memberjunction/core-entities": "5.50.0",
|
|
36
|
+
"@memberjunction/entity-communications-base": "5.50.0",
|
|
37
|
+
"@memberjunction/global": "5.50.0",
|
|
38
|
+
"@memberjunction/graphql-dataprovider": "5.50.0",
|
|
39
|
+
"@memberjunction/ng-base-application": "5.50.0",
|
|
40
|
+
"@memberjunction/ng-base-types": "5.50.0",
|
|
41
|
+
"@memberjunction/ng-notifications": "5.50.0",
|
|
42
|
+
"@memberjunction/ng-shared-generic": "5.50.0",
|
|
43
43
|
"html-to-image": "^1.11.11",
|
|
44
44
|
"tslib": "^2.8.1"
|
|
45
45
|
},
|