@microsoft/windows-admin-center-sdk 2.523.1 → 2.538.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 (67) hide show
  1. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js +88 -41
  2. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.js.map +1 -1
  3. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js +1 -1
  4. package/angular/bundles/microsoft-windows-admin-center-sdk-angular.umd.min.js.map +1 -1
  5. package/angular/esm2015/src/controls/data-table/data-table.component.js +6 -2
  6. package/angular/esm2015/src/controls/dialog/dialog.component.js +11 -11
  7. package/angular/esm2015/src/controls/dialog/extension-dialog/extension-dialog.component.js +7 -7
  8. package/angular/esm2015/src/controls/header/header.component.js +52 -14
  9. package/angular/esm2015/src/controls/layout/layout-config.js +1 -2
  10. package/angular/esm2015/src/controls/query-editor/query-editor.component.js +4 -4
  11. package/angular/esm2015/src/controls/snap-in-extension/snap-in-extension.component.js +1 -1
  12. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js +75 -34
  13. package/angular/fesm2015/microsoft-windows-admin-center-sdk-angular.js.map +1 -1
  14. package/angular/src/controls/header/header.component.d.ts +14 -1
  15. package/angular/src/controls/query-editor/query-editor.component.d.ts +1 -1
  16. package/core/data/active-directory/active-directory.js +2 -2
  17. package/core/data/active-directory/active-directory.js.map +1 -1
  18. package/core/data/powershell.d.ts +2 -2
  19. package/core/data/powershell.js +2 -2
  20. package/core/data/powershell.js.map +1 -1
  21. package/core/notification/notification-manager.d.ts +18 -0
  22. package/core/notification/notification-manager.js +55 -10
  23. package/core/notification/notification-manager.js.map +1 -1
  24. package/core/notification/notification-message.d.ts +41 -0
  25. package/core/notification/notification-message.js +3 -0
  26. package/core/notification/notification-message.js.map +1 -0
  27. package/core/notification/notification.d.ts +10 -1
  28. package/core/notification/notification.js +30 -33
  29. package/core/notification/notification.js.map +1 -1
  30. package/core/notification/powershell-notification.d.ts +15 -15
  31. package/core/notification/powershell-notification.js +19 -8
  32. package/core/notification/powershell-notification.js.map +1 -1
  33. package/core/notification/socket-signalr.d.ts +8 -14
  34. package/core/notification/socket-signalr.js +18 -19
  35. package/core/notification/socket-signalr.js.map +1 -1
  36. package/core/notification/work-item-manager.d.ts +4 -0
  37. package/core/notification/work-item-manager.js +76 -20
  38. package/core/notification/work-item-manager.js.map +1 -1
  39. package/e2e/assets/strings/cs-CZ/strings.json +1 -1
  40. package/e2e/assets/strings/de-DE/strings.json +1 -1
  41. package/e2e/assets/strings/es-ES/strings.json +1 -1
  42. package/e2e/assets/strings/fr-FR/strings.json +1 -1
  43. package/e2e/assets/strings/hu-HU/strings.json +1 -1
  44. package/e2e/assets/strings/id-ID/strings.json +1 -1
  45. package/e2e/assets/strings/it-IT/strings.json +1 -1
  46. package/e2e/assets/strings/ja-JP/strings.json +1 -1
  47. package/e2e/assets/strings/ko-KR/strings.json +1 -1
  48. package/e2e/assets/strings/nl-NL/strings.json +1 -1
  49. package/e2e/assets/strings/pl-PL/strings.json +1 -1
  50. package/e2e/assets/strings/pt-BR/strings.json +1 -1
  51. package/e2e/assets/strings/pt-PT/strings.json +1 -1
  52. package/e2e/assets/strings/ru-RU/strings.json +1 -1
  53. package/e2e/assets/strings/strings.json +1 -1
  54. package/e2e/assets/strings/sv-SE/strings.json +1 -1
  55. package/e2e/assets/strings/tr-TR/strings.json +1 -1
  56. package/e2e/assets/strings/zh-CN/strings.json +1 -1
  57. package/e2e/assets/strings/zh-TW/strings.json +1 -1
  58. package/package.json +3 -6
  59. package/styles/css/main-v2.css +1 -1
  60. package/tools/test-runner/index.js +12 -2
  61. package/tools/test-runner/index.js.map +1 -1
  62. package/tools/wac-cli/templates/internal/package.json +0 -4
  63. package/tools/wac-cli/templates/library/angular.json +0 -3
  64. package/tools/wac-cli/templates/library/tsconfig.lib.json +1 -1
  65. package/tools/wac-cli/templates/wac-template/angular.json +0 -3
  66. package/tools/wac-cli/templates/wac-template/package.json +0 -4
  67. package/tools/wac-cli/templates/wac-template/tsconfig.base.json +23 -24
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/notification/notification-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAc,aAAa,EAAgB,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AAGnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAEvG,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAqB,MAAM,gBAAgB,CAAC;AAC1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKzD;;GAEG;AACH,MAAM,OAAO,aAAa;CASzB;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAW5B;;;;OAIG;IACH,YAAoB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;QAdpB,mCAA8B,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3D,mCAA8B,GAAG,IAAI,GAAG,EAAkB,CAAC;QAc/D,IAAI,CAAC,mBAAmB,GAAG,IAAI,aAAa,CAAoB,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,qBAAqB,CAAC,aAAkB;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACvC,CAAC;IAED;;OAEG;IACH,IAAW,KAAK;QACZ,MAAM,KAAK,GAAmB,EAAE,CAAC;QACjC,KAAK,MAAM,IAAI,IAAI,IAAI,CAAC,UAAU,EAAE;YAChC,IAAI,IAAI,CA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AA2B;QAC9E,iGAAiG;QACjG,MAAM,gBAAgB,GAAG,EAAE,CAAC;QAC5B,IAAI,YAAY,EAAE;YACd,OAAO,CAAC,qBAAqB,CAAC,gBAAgB,EAAE,YAAY,CAAC,CAAC;SACjE;QAED,IAAI,CAAC,mBAAmB,CAAC,IAAI,CAAoB,EAAE,YAAY,EAAE,gBAAgB,EAAE,WAAW,EAAE,WAAW,EAAE,CAAC,CAAC;QAC/G,mBAAmB;QACnB,OAAO,CAAC,GAAG,CAAC;YACR,MAAM,EAAE,cAAc;YACtB,KAAK,EAAE,QAAQ,CAAC,OAAO;YACvB,OAAO,EAAE,YAAY,CAAC,CAAC;gBACnB,kCAAkC,CAAC,MAAM,CACrC,uBAAuB,CAAC,WAAW,CAAC,EACpC,iBAAiB,CAAC,YAAY,CAAC,KAAK,CAAC,EACrC,YAAY,CAAC,KAAK,EAClB,YAAY,CAAC,OAAO,EACpB,YAAY,CAAC,IAAI,CAAC;gBACtB,CAAC,CAAC,eAAe,CAAC,MAAM,CAAC,uBAAuB,CAAC,WAAW,CAAC,CAAC;SACrE,CAAC,CAAC;IACP,CAAC;CACJ","file":"notification-manager.js","sourcesContent":["import { empty, Observable, ReplaySubject, Subscription } from 'rxjs';\r\nimport { Net } from '../data/net';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { Strings } from '../generated/strings';\r\nimport { RpcNotification } from '../rpc/notification/rpc-notification-model';\r\nimport { RpcNotificationSubjectServer } from '../rpc/notification/rpc-notification-subject-server';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { RpcWorkItemFind, RpcWorkItemFindResult } from '../rpc/work-item-find/rpc-work-item-find-model';\r\nimport { RpcWorkItemFindSubjectServer } from '../rpc/work-item-find/rpc-work-item-find-subject-server';\r\nimport { RpcWorkItem } from '../rpc/work-item/rpc-work-item-model';\r\nimport { Notification, NotificationChangeEvent, NotificationEvent } from './notification';\r\nimport { NotificationState } from './notification-state';\r\nimport { PowerShellWorkItemMessage } from './powershell-notification';\r\nimport { SocketMessage } from './socket-signalr';\r\nimport { RecoveredWorkItem, WorkItemResult } from './work-item-request';\r\n\r\n/**\r\n * Mock the IFrameService class in app folder\r\n */\r\nexport class IFrameService {\r\n public getActiveToolIFrameData: () => {\r\n entryPoint: {\r\n name: string;\r\n parentModule: {\r\n name: string;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Notification manager class.\r\n */\r\nexport class NotificationManager {\r\n private collection: { [id: string]: Notification };\r\n private psSessionIdToNotificationIdMap = new Map<string, string>();\r\n private notificationIdToPsSessionIdMap = new Map<string, string>();\r\n private rpcNotifySubscription: Subscription;\r\n private rpcQuerySubscription: Subscription;\r\n private changedEventSubject: ReplaySubject<NotificationEvent>;\r\n private rpcWorkItemFindSubjectServer: RpcWorkItemFindSubjectServer;\r\n private rpcNotificationSubjectServer: RpcNotificationSubjectServer;\r\n private iFrameService: IFrameService;\r\n\r\n /**\r\n * Initializes a new instance of the NotificationManager class.\r\n *\r\n * @param rpc the RPC object.\r\n */\r\n constructor(private rpc: Rpc) {\r\n this.changedEventSubject = new ReplaySubject<NotificationEvent>(1);\r\n this.initialize();\r\n }\r\n\r\n /**\r\n * register iframe service from shell\r\n * @param iFrameService the iframe service from shell\r\n */\r\n public registerIFrameService(iFrameService: any) {\r\n this.iFrameService = iFrameService;\r\n }\r\n\r\n /**\r\n * Gets the items from current notification collection including dismissed.\r\n */\r\n public get items(): Notification[] {\r\n const items: Notification[] = [];\r\n for (const item in this.collection) {\r\n if (this.collection.hasOwnProperty(item)) {\r\n items.push(this.collection[item]);\r\n }\r\n }\r\n\r\n return items;\r\n }\r\n\r\n /**\r\n * Gets the subject of notification changed event.\r\n */\r\n public get changed(): ReplaySubject<NotificationEvent> {\r\n return this.changedEventSubject;\r\n }\r\n\r\n /**\r\n * Initializes the rpc notification call.\r\n */\r\n public initialize(): void {\r\n this.collection = {};\r\n\r\n // notification request from rpc...\r\n this.rpcNotificationSubjectServer = new RpcNotificationSubjectServer(this.rpc);\r\n this.rpcNotifySubscription = this.rpcNotificationSubjectServer.subject\r\n .subscribe(\r\n item => {\r\n this.notify(item.data).toPromise().then(item.deferred.resolve, item.deferred.reject);\r\n },\r\n error => {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationRpcInitialization.message;\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Error,\r\n message: message.format(Net.getErrorMessage(error))\r\n });\r\n });\r\n this.rpcWorkItemFindSubjectServer = new RpcWorkItemFindSubjectServer(this.rpc);\r\n this.rpcQuerySubscription = this.rpcWorkItemFindSubjectServer.subject\r\n .subscribe(\r\n item => {\r\n item.deferred.resolve(this.workItemFind(item.data));\r\n },\r\n error => {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationRpcInitialization.message;\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Error,\r\n message: message.format(Net.getErrorMessage(error))\r\n });\r\n });\r\n this.addEvent(NotificationChangeEvent.Initialized);\r\n }\r\n\r\n /**\r\n * Stop the notification manager.\r\n */\r\n public uninitialize(): void {\r\n if (this.rpcNotifySubscription) {\r\n this.rpcNotifySubscription.unsubscribe();\r\n this.rpcNotifySubscription = null;\r\n }\r\n\r\n if (this.rpcQuerySubscription) {\r\n this.rpcQuerySubscription.unsubscribe();\r\n this.rpcQuerySubscription = null;\r\n }\r\n }\r\n\r\n /**\r\n * Find a notification.\r\n *\r\n * @param id the notification id.\r\n */\r\n public find(id: string): Notification {\r\n const notificationId = this.psSessionIdToNotificationIdMap[id] || id;\r\n return this.collection[notificationId];\r\n }\r\n\r\n /**\r\n * Remove a notification.\r\n * There is no dismiss API on the gateway, this just remove from the list.\r\n * Don't remove active notification. Use dismiss api instead, so it doesn't displays to .items property.\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if removed.\r\n */\r\n public remove(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n const psSessionId = this.notificationIdToPsSessionIdMap[id];\r\n delete this.psSessionIdToNotificationIdMap[psSessionId];\r\n delete this.notificationIdToPsSessionIdMap[id];\r\n delete this.collection[id];\r\n this.addEvent(NotificationChangeEvent.Remove, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Dismiss a notification to mark dismiss property.\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if dismissed.\r\n */\r\n public dismiss(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n notification.dismissed = true;\r\n this.addEvent(NotificationChangeEvent.Remove, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Set dismissed to false for notification updated that was previously dismissed\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if undismissed.\r\n */\r\n public undismiss(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n notification.dismissed = false;\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add notification from WorkItem.\r\n *\r\n * @param psSessionId the psSession ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public addFromWorkItem(notificationId: string, workItem: RpcWorkItem, state: NotificationState): void {\r\n const notification = Notification.createFromWorkItem(notificationId, workItem, state, this.iFrameService);\r\n const existingNotification = this.find(notificationId);\r\n this.collection[notificationId] = notification;\r\n\r\n if (!notification.isDisabled) {\r\n if (existingNotification) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n } else {\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update an existing work item with psSession Id information.\r\n *\r\n * @param notificationId the id of the notification.\r\n * @param psSessionId the psSession ID.\r\n * @param workItem the work item.\r\n * @param state the state of the work item.\r\n * @param object the object from query result.\r\n */\r\n public updateWorkItemWithPsSession(\r\n notificationId: string,\r\n psSessionId: string,\r\n workItem: RpcWorkItem,\r\n state: NotificationState,\r\n object: any): boolean {\r\n\r\n const notification = this.find(notificationId);\r\n this.psSessionIdToNotificationIdMap[psSessionId] = notificationId;\r\n this.notificationIdToPsSessionIdMap[notificationId] = psSessionId;\r\n\r\n if (notification) {\r\n if (notification.updateFromWorkItem(notificationId, workItem, state, object)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add notification from Recover.\r\n *\r\n * @param id the notification ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public addFromRecover(recover: RecoveredWorkItem): void {\r\n const notification = Notification.createFromRecover(recover, this.iFrameService);\r\n this.collection[recover.id] = notification;\r\n this.psSessionIdToNotificationIdMap[recover.id] = recover.id;\r\n this.notificationIdToPsSessionIdMap[recover.id] = recover.id;\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n }\r\n\r\n /**\r\n * Update notification from socket message.\r\n *\r\n * @param psSessionId the psSession ID.\r\n * @param message the socket message.\r\n */\r\n public updateFromMessage(psSessionId: string, message: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n const notificationId = this.psSessionIdToNotificationIdMap[psSessionId];\r\n const notification = this.find(notificationId);\r\n if (notification) {\r\n if (notification.updateFromMessage(message)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add or update client notification.\r\n *\r\n * @param clientNotification the client notification object.\r\n * @param Observable the observable of void.\r\n */\r\n public notify(clientNotification: RpcNotification): Observable<any> {\r\n // convert alert into notification\r\n if (MsftSme.isNullOrWhiteSpace(clientNotification.title)) {\r\n clientNotification.title = clientNotification.message;\r\n clientNotification.message = null;\r\n }\r\n\r\n SmeWebTelemetry.traceClientNotification(clientNotification);\r\n\r\n let notification = this.find(clientNotification.id);\r\n if (notification) {\r\n if (notification.updateFromClient(clientNotification)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n\r\n return empty();\r\n }\r\n\r\n notification = Notification.createFromClient(clientNotification, this.iFrameService);\r\n this.collection[clientNotification.id] = notification;\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n return empty();\r\n }\r\n\r\n /**\r\n * Find current work item by the typeId/sourceName/nodeName.\r\n *\r\n * @param workItemFind the query notification object.\r\n * @param RpcWorkItemFindResult the result of query.\r\n */\r\n public workItemFind(workItemFind: RpcWorkItemFind): RpcWorkItemFindResult {\r\n const keys = Object.keys(this.collection);\r\n const results: WorkItemResult[] = keys\r\n .map(key => <any>{ key: key, notification: this.collection[key] })\r\n .filter(data => data.notification.moduleName === workItemFind.moduleName\r\n && data.notification.nodeName === workItemFind.nodeName\r\n && data.notification.typeId === workItemFind.typeId)\r\n .map(data => <WorkItemResult>{\r\n id: data.key,\r\n state: data.notification.state,\r\n percent: data.notification.percent,\r\n error: data.notification.error,\r\n object: data.notification.object\r\n });\r\n\r\n const notificationResult: RpcWorkItemFindResult = {\r\n results: results,\r\n typeId: workItemFind.typeId,\r\n moduleName: workItemFind.moduleName,\r\n nodeName: workItemFind.nodeName\r\n };\r\n return notificationResult;\r\n }\r\n\r\n /**\r\n * Add an event to report the change of notification data or collection.\r\n *\r\n * @param changeEvent the changed event.\r\n * @param notification the notification object. (optional)\r\n */\r\n private addEvent(changeEvent: NotificationChangeEvent, notification?: Notification): void {\r\n // need to copy otherwise every change to original notification will be shown on UI without event\r\n const notificationCopy = {};\r\n if (notification) {\r\n MsftSme.shallowCopyFromObject(notificationCopy, notification);\r\n }\r\n\r\n this.changedEventSubject.next(<NotificationEvent>{ notification: notificationCopy, changeEvent: changeEvent });\r\n // no localization.\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Verbose,\r\n message: notification ?\r\n 'addEvent: {0}/{1}\\n{2}\\n{3}\\n{4}'.format(\r\n NotificationChangeEvent[changeEvent],\r\n NotificationState[notification.state],\r\n notification.title,\r\n notification.message,\r\n notification.link)\r\n : 'addEvent: {0}'.format(NotificationChangeEvent[changeEvent])\r\n });\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/notification/notification-manager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,EAAc,aAAa,EAAgB,MAAM,MAAM,CAAC;AACtE,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,kCAAkC,CAAC;AAGnE,OAAO,EAAE,4BAA4B,EAAE,MAAM,qDAAqD,CAAC;AAGnG,OAAO,EAAE,4BAA4B,EAAE,MAAM,yDAAyD,CAAC;AAEvG,OAAO,EAAE,YAAY,EAAE,uBAAuB,EAAqB,MAAM,gBAAgB,CAAC;AAE1F,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AAKzD;;GAEG;AACH,MAAM,OAAO,aAAa;CASzB;AAED;;GAEG;AACH,MAAM,OAAO,mBAAmB;IAW5B;;;;OAIG;IACH,YAAoB,GAAQ;QAAR,QAAG,GAAH,GAAG,CAAK;QAdpB,mCAA8B,GAAG,IAAI,GAAG,EAAkB,CAAC;QAC3D,mCAA8B,GAAG,IAAI,GAAG,EAAkB,CAAC;QAc/D,IAAI,CAAC,mBAAmB,GAAG,IAAI,aAAa,CAAoB,CAAC,CAAC,CAAC;QACnE,IAAI,CAAC,UAAU,EAAE,CAAC;IACtB,CAAC;IAED;;;OAGG;IACI,qBAAqB,CAAC,aAAkB;QAC3C,IAAI,CAAC,aAAa,GAAG,aAAa,CAA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subscription } from 'rxjs';\r\nimport { Globalization } from '../data/globalization';\r\nimport { Net } from '../data/net';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { SmeWebTelemetry } from '../diagnostics/sme-web-telemetry';\r\nimport { Strings } from '../generated/strings';\r\nimport { RpcNotification } from '../rpc/notification/rpc-notification-model';\r\nimport { RpcNotificationSubjectServer } from '../rpc/notification/rpc-notification-subject-server';\r\nimport { Rpc } from '../rpc/rpc';\r\nimport { RpcWorkItemFind, RpcWorkItemFindResult } from '../rpc/work-item-find/rpc-work-item-find-model';\r\nimport { RpcWorkItemFindSubjectServer } from '../rpc/work-item-find/rpc-work-item-find-subject-server';\r\nimport { RpcWorkItem } from '../rpc/work-item/rpc-work-item-model';\r\nimport { Notification, NotificationChangeEvent, NotificationEvent } from './notification';\r\nimport { NotificationMessage } from './notification-message';\r\nimport { NotificationState } from './notification-state';\r\nimport { PowerShellWorkItemMessage } from './powershell-notification';\r\nimport { SocketMessage } from './socket-signalr';\r\nimport { RecoveredWorkItem, WorkItemResult } from './work-item-request';\r\n\r\n/**\r\n * Mock the IFrameService class in app folder\r\n */\r\nexport class IFrameService {\r\n public getActiveToolIFrameData: () => {\r\n entryPoint: {\r\n name: string;\r\n parentModule: {\r\n name: string;\r\n }\r\n }\r\n };\r\n}\r\n\r\n/**\r\n * Notification manager class.\r\n */\r\nexport class NotificationManager {\r\n private collection: { [id: string]: Notification };\r\n private psSessionIdToNotificationIdMap = new Map<string, string>();\r\n private notificationIdToPsSessionIdMap = new Map<string, string>();\r\n private rpcNotifySubscription: Subscription;\r\n private rpcQuerySubscription: Subscription;\r\n private changedEventSubject: ReplaySubject<NotificationEvent>;\r\n private rpcWorkItemFindSubjectServer: RpcWorkItemFindSubjectServer;\r\n private rpcNotificationSubjectServer: RpcNotificationSubjectServer;\r\n private iFrameService: IFrameService;\r\n\r\n /**\r\n * Initializes a new instance of the NotificationManager class.\r\n *\r\n * @param rpc the RPC object.\r\n */\r\n constructor(private rpc: Rpc) {\r\n this.changedEventSubject = new ReplaySubject<NotificationEvent>(1);\r\n this.initialize();\r\n }\r\n\r\n /**\r\n * register iframe service from shell\r\n * @param iFrameService the iframe service from shell\r\n */\r\n public registerIFrameService(iFrameService: any) {\r\n this.iFrameService = iFrameService;\r\n }\r\n\r\n /**\r\n * Gets the items from current notification collection including dismissed.\r\n */\r\n public get items(): Notification[] {\r\n const items: Notification[] = [];\r\n for (const item in this.collection) {\r\n if (this.collection.hasOwnProperty(item)) {\r\n items.push(this.collection[item]);\r\n }\r\n }\r\n\r\n return items;\r\n }\r\n\r\n /**\r\n * Gets the subject of notification changed event.\r\n */\r\n public get changed(): ReplaySubject<NotificationEvent> {\r\n return this.changedEventSubject;\r\n }\r\n\r\n /**\r\n * Initializes the rpc notification call.\r\n */\r\n public initialize(): void {\r\n this.collection = {};\r\n\r\n // notification request from rpc...\r\n this.rpcNotificationSubjectServer = new RpcNotificationSubjectServer(this.rpc);\r\n this.rpcNotifySubscription = this.rpcNotificationSubjectServer.subject\r\n .subscribe(\r\n item => {\r\n this.notify(item.data).toPromise().then(item.deferred.resolve, item.deferred.reject);\r\n },\r\n error => {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationRpcInitialization.message;\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Error,\r\n message: message.format(Net.getErrorMessage(error))\r\n });\r\n });\r\n this.rpcWorkItemFindSubjectServer = new RpcWorkItemFindSubjectServer(this.rpc);\r\n this.rpcQuerySubscription = this.rpcWorkItemFindSubjectServer.subject\r\n .subscribe(\r\n item => {\r\n item.deferred.resolve(this.workItemFind(item.data));\r\n },\r\n error => {\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationRpcInitialization.message;\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Error,\r\n message: message.format(Net.getErrorMessage(error))\r\n });\r\n });\r\n this.addEvent(NotificationChangeEvent.Initialized);\r\n }\r\n\r\n /**\r\n * Stop the notification manager.\r\n */\r\n public uninitialize(): void {\r\n if (this.rpcNotifySubscription) {\r\n this.rpcNotifySubscription.unsubscribe();\r\n this.rpcNotifySubscription = null;\r\n }\r\n\r\n if (this.rpcQuerySubscription) {\r\n this.rpcQuerySubscription.unsubscribe();\r\n this.rpcQuerySubscription = null;\r\n }\r\n }\r\n\r\n /**\r\n * Find a notification.\r\n *\r\n * @param id the notification id.\r\n */\r\n public find(id: string): Notification {\r\n const notificationId = this.psSessionIdToNotificationIdMap[id] || id;\r\n return this.collection[notificationId];\r\n }\r\n\r\n /**\r\n * Remove a notification.\r\n * There is no dismiss API on the gateway, this just remove from the list.\r\n * Don't remove active notification. Use dismiss api instead, so it doesn't displays to .items property.\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if removed.\r\n */\r\n public remove(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n const psSessionId = this.notificationIdToPsSessionIdMap[id];\r\n delete this.psSessionIdToNotificationIdMap[psSessionId];\r\n delete this.notificationIdToPsSessionIdMap[id];\r\n delete this.collection[id];\r\n this.addEvent(NotificationChangeEvent.Remove, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Dismiss a notification to mark dismiss property.\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if dismissed.\r\n */\r\n public dismiss(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n notification.dismissed = true;\r\n this.addEvent(NotificationChangeEvent.Remove, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Set dismissed to false for notification updated that was previously dismissed\r\n *\r\n * @param id the session id (notification id).\r\n * @return boolean true if undismissed.\r\n */\r\n public undismiss(id: string): boolean {\r\n const notification: Notification = this.find(id);\r\n if (notification) {\r\n notification.dismissed = false;\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add notification from WorkItem.\r\n *\r\n * @param psSessionId the psSession ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public addFromWorkItem(notificationId: string, workItem: RpcWorkItem, state: NotificationState): void {\r\n const notification = Notification.createFromWorkItem(notificationId, workItem, state, this.iFrameService);\r\n const existingNotification = this.find(notificationId);\r\n this.collection[notificationId] = notification;\r\n\r\n if (!notification.isDisabled) {\r\n if (existingNotification) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n } else {\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n }\r\n }\r\n }\r\n\r\n /**\r\n * Update an existing work item with psSession Id information.\r\n *\r\n * @param notificationId the id of the notification.\r\n * @param psSessionId the psSession ID.\r\n * @param workItem the work item.\r\n * @param state the state of the work item.\r\n * @param object the object from query result.\r\n */\r\n public updateWorkItemWithPsSession(\r\n notificationId: string,\r\n psSessionId: string,\r\n workItem: RpcWorkItem,\r\n state: NotificationState,\r\n object: any): boolean {\r\n\r\n const notification = this.find(notificationId);\r\n this.psSessionIdToNotificationIdMap[psSessionId] = notificationId;\r\n this.notificationIdToPsSessionIdMap[notificationId] = psSessionId;\r\n\r\n if (notification) {\r\n if (notification.updateFromWorkItem(notificationId, workItem, state, object)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add notification from Recover.\r\n *\r\n * @param id the notification ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public addFromRecover(recover: RecoveredWorkItem): void {\r\n const notification = Notification.createFromRecover(recover, this.iFrameService);\r\n this.collection[recover.id] = notification;\r\n this.psSessionIdToNotificationIdMap[recover.id] = recover.id;\r\n this.notificationIdToPsSessionIdMap[recover.id] = recover.id;\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n }\r\n\r\n /**\r\n * Add initial notification for Message Notification.\r\n *\r\n * @param id the notification ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public addForNotificationMessage(state: NotificationState, message: NotificationMessage): boolean {\r\n if (this.collection[message.id]) {\r\n return false;\r\n }\r\n\r\n const notification = new Notification(message.id);\r\n const now = new Date();\r\n notification.isFromRecover = true;\r\n notification.state = state;\r\n notification.object = {};\r\n notification.nodeName = message.sourceName;\r\n notification.moduleDisplayName = message.sourceName;\r\n notification.startTimestamp = Globalization.timeOnly(now);\r\n notification.changedTimestamp = Globalization.timeOnly(now);\r\n notification.changedTimestampValue = now.getTime();\r\n notification.description = null;\r\n notification.typeId = null;\r\n notification.title = message.title;\r\n notification.message = message.message;\r\n this.collection[message.id] = notification;\r\n this.psSessionIdToNotificationIdMap[message.id] = message.id;\r\n this.notificationIdToPsSessionIdMap[message.id] = message.id;\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n return true;\r\n }\r\n\r\n /**\r\n * Update notification from socket message.\r\n *\r\n * @param psSessionId the psSession ID.\r\n * @param message the socket message.\r\n */\r\n public updateFromMessage(psSessionId: string, message: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n const notificationId = this.psSessionIdToNotificationIdMap[psSessionId];\r\n const notification = this.find(notificationId);\r\n if (notification) {\r\n if (notification.updateFromMessage(message)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Update notification from socket message.\r\n *\r\n * @param psSessionId the psSession ID.\r\n * @param message the socket message.\r\n */\r\n public updateFromNotificationMessage(state: NotificationState, item: NotificationMessage): boolean {\r\n const notification = this.find(item.id);\r\n if (notification) {\r\n notification.updateFromNotificationMessage(state, item);\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n /**\r\n * Add or update client notification.\r\n *\r\n * @param clientNotification the client notification object.\r\n * @param Observable the observable of void.\r\n */\r\n public notify(clientNotification: RpcNotification): Observable<any> {\r\n // convert alert into notification\r\n if (MsftSme.isNullOrWhiteSpace(clientNotification.title)) {\r\n clientNotification.title = clientNotification.message;\r\n clientNotification.message = null;\r\n }\r\n\r\n SmeWebTelemetry.traceClientNotification(clientNotification);\r\n\r\n let notification = this.find(clientNotification.id);\r\n if (notification) {\r\n if (notification.updateFromClient(clientNotification)) {\r\n this.addEvent(NotificationChangeEvent.Change, notification);\r\n }\r\n\r\n return EMPTY;\r\n }\r\n\r\n notification = Notification.createFromClient(clientNotification, this.iFrameService);\r\n this.collection[clientNotification.id] = notification;\r\n this.addEvent(NotificationChangeEvent.Add, notification);\r\n return EMPTY;\r\n }\r\n\r\n /**\r\n * Find current work item by the typeId/sourceName/nodeName.\r\n *\r\n * @param workItemFind the query notification object.\r\n * @param RpcWorkItemFindResult the result of query.\r\n */\r\n public workItemFind(workItemFind: RpcWorkItemFind): RpcWorkItemFindResult {\r\n const keys = Object.keys(this.collection);\r\n const results: WorkItemResult[] = keys\r\n .map(key => <any>{ key: key, notification: this.collection[key] })\r\n .filter(data => data.notification.moduleName === workItemFind.moduleName\r\n && data.notification.nodeName === workItemFind.nodeName\r\n && data.notification.typeId === workItemFind.typeId)\r\n .map(data => <WorkItemResult>{\r\n id: data.key,\r\n state: data.notification.state,\r\n percent: data.notification.percent,\r\n error: data.notification.error,\r\n object: data.notification.object\r\n });\r\n\r\n const notificationResult: RpcWorkItemFindResult = {\r\n results: results,\r\n typeId: workItemFind.typeId,\r\n moduleName: workItemFind.moduleName,\r\n nodeName: workItemFind.nodeName\r\n };\r\n return notificationResult;\r\n }\r\n\r\n /**\r\n * Add an event to report the change of notification data or collection.\r\n *\r\n * @param changeEvent the changed event.\r\n * @param notification the notification object. (optional)\r\n */\r\n private addEvent(changeEvent: NotificationChangeEvent, notification?: Notification): void {\r\n // need to copy otherwise every change to original notification will be shown on UI without event\r\n const notificationCopy = {};\r\n if (notification) {\r\n MsftSme.shallowCopyFromObject(notificationCopy, notification);\r\n }\r\n\r\n this.changedEventSubject.next(<NotificationEvent>{ notification: notificationCopy, changeEvent: changeEvent });\r\n // no localization.\r\n Logging.logVerbose(\r\n 'Notification',\r\n notification ?\r\n 'addEvent: {0}/{1}\\n{2}\\n{3}\\n{4}'.format(\r\n NotificationChangeEvent[changeEvent],\r\n NotificationState[notification.state],\r\n notification.title,\r\n notification.message,\r\n notification.link)\r\n : 'addEvent: {0}'.format(NotificationChangeEvent[changeEvent]));\r\n }\r\n}\r\n"]}
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Notification message come directly from IFeatureMessageClient on the gateway.
3
+ */
4
+ export interface NotificationMessage {
5
+ /**
6
+ * Gets or sets the identity of notification message.
7
+ */
8
+ id: string;
9
+ /**
10
+ * Gets or sets the started time. Set only when initially created a notification otherwise set to null.
11
+ */
12
+ beginTime?: string;
13
+ /**
14
+ * Gets or sets the instance time. Set always with current source time.
15
+ */
16
+ instanceTime: string;
17
+ /**
18
+ * Gets or sets the completed time. Set when the notification message is completed or error'ed out.
19
+ */
20
+ endTime?: string;
21
+ /**
22
+ * Gets or sets the notification error level.
23
+ */
24
+ errorLevel: number | string;
25
+ /**
26
+ * The title.
27
+ */
28
+ title: string;
29
+ /**
30
+ * The message.
31
+ */
32
+ message: string;
33
+ /**
34
+ * The notification source type.
35
+ */
36
+ sourceType: number;
37
+ /** <summary>
38
+ * The notification source name.
39
+ */
40
+ sourceName: string;
41
+ }
@@ -0,0 +1,3 @@
1
+ export {};
2
+
3
+ //# sourceMappingURL=notification-message.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../../../packages/core/notification/notification-message.ts"],"names":[],"mappings":"","file":"notification-message.js","sourcesContent":["/**\r\n * Notification message come directly from IFeatureMessageClient on the gateway.\r\n */\r\nexport interface NotificationMessage {\r\n /**\r\n * Gets or sets the identity of notification message.\r\n */\r\n id: string;\r\n\r\n /**\r\n * Gets or sets the started time. Set only when initially created a notification otherwise set to null.\r\n */\r\n beginTime?: string;\r\n\r\n /**\r\n * Gets or sets the instance time. Set always with current source time.\r\n */\r\n instanceTime: string;\r\n\r\n /**\r\n * Gets or sets the completed time. Set when the notification message is completed or error'ed out.\r\n */\r\n endTime?: string;\r\n\r\n /**\r\n * Gets or sets the notification error level.\r\n */\r\n errorLevel: number | string;\r\n\r\n /**\r\n * The title.\r\n */\r\n title: string;\r\n\r\n /**\r\n * The message.\r\n */\r\n message: string;\r\n\r\n /**\r\n * The notification source type.\r\n */\r\n sourceType: number;\r\n\r\n /** <summary>\r\n * The notification source name.\r\n */\r\n sourceName: string;\r\n}\r\n\r\n\r\n"]}
@@ -2,6 +2,7 @@ import { RpcNotification } from '../rpc/notification/rpc-notification-model';
2
2
  import { RpcWorkItem } from '../rpc/work-item/rpc-work-item-model';
3
3
  import { NotificationLinkType } from './notification-link-type';
4
4
  import { IFrameService } from './notification-manager';
5
+ import { NotificationMessage } from './notification-message';
5
6
  import { NotificationState } from './notification-state';
6
7
  import { PowerShellWorkItemMessage } from './powershell-notification';
7
8
  import { SocketMessage } from './socket-signalr';
@@ -157,7 +158,7 @@ export declare class Notification {
157
158
  /**
158
159
  * Create notification from instant request.
159
160
  *
160
- * @param client the RPC notication request.
161
+ * @param client the RPC notification request.
161
162
  * @return notification the notification object.
162
163
  */
163
164
  static createFromClient(client: RpcNotification, iFrameService: IFrameService): Notification;
@@ -182,6 +183,14 @@ export declare class Notification {
182
183
  * @return boolean the changed status.
183
184
  */
184
185
  updateFromMessage(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
186
+ /**
187
+ * Update the notification by socket message from the gateway.
188
+ *
189
+ * @param state the state of notification.
190
+ * @param item the socket message.
191
+ * @return boolean the changed status.
192
+ */
193
+ updateFromNotificationMessage(state: NotificationState, item: NotificationMessage): boolean;
185
194
  /**
186
195
  * Update the notification by instant notification message from the client.
187
196
  *
@@ -1,5 +1,4 @@
1
1
  import { Globalization } from '../data/globalization';
2
- import { LogLevel } from '../diagnostics/log-level';
3
2
  import { Logging } from '../diagnostics/logging';
4
3
  import { NotificationLinkType } from './notification-link-type';
5
4
  import { NotificationState } from './notification-state';
@@ -80,10 +79,7 @@ export class Notification {
80
79
  notification.isFromRecover = true;
81
80
  if (recoveredWorkItem.failed) {
82
81
  notification.state = NotificationState.Error;
83
- notification.object = {
84
- errorType: 'WorkItemRecover',
85
- message: recoveredWorkItem.errorMessage
86
- };
82
+ notification.object = { errorType: 'WorkItemRecover', message: recoveredWorkItem.errorMessage };
87
83
  }
88
84
  else {
89
85
  notification.state = NotificationState.InProgress;
@@ -95,7 +91,7 @@ export class Notification {
95
91
  /**
96
92
  * Create notification from instant request.
97
93
  *
98
- * @param client the RPC notication request.
94
+ * @param client the RPC notification request.
99
95
  * @return notification the notification object.
100
96
  */
101
97
  static createFromClient(client, iFrameService) {
@@ -137,11 +133,7 @@ export class Notification {
137
133
  let changed = false;
138
134
  const now = Date.now();
139
135
  if (PowerShellNotification.hasError(item)) {
140
- Logging.log({
141
- source: 'Notification',
142
- level: LogLevel.Debug,
143
- message: '{0}/Error/{1}'.format(this.id, JSON.stringify(item.message.errors))
144
- });
136
+ Logging.logDebug('Notification', '{0}/Error/{1}'.format(this.id, JSON.stringify(item.message.errors)));
145
137
  if (this.updateState(NotificationState.Error)) {
146
138
  this.changedTimestampValue = now;
147
139
  this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);
@@ -152,11 +144,7 @@ export class Notification {
152
144
  return !this.isDisabled;
153
145
  }
154
146
  if (PowerShellNotification.hasException(item)) {
155
- Logging.log({
156
- source: 'Notification',
157
- level: LogLevel.Debug,
158
- message: '{0}/Exception/{1}'.format(this.id, item.message.exception)
159
- });
147
+ Logging.logDebug('Notification', '{0}/Exception/{1}'.format(this.id, item.message.exception));
160
148
  if (this.updateState(NotificationState.Error)) {
161
149
  this.changedTimestampValue = now;
162
150
  this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);
@@ -167,18 +155,14 @@ export class Notification {
167
155
  return !this.isDisabled;
168
156
  }
169
157
  if (PowerShellNotification.hasProgress(item)) {
170
- Logging.log({
171
- source: 'Notification',
172
- level: LogLevel.Debug,
173
- message: '{0}/Progress/{1}'.format(this.id, JSON.stringify(item.message.progress))
174
- });
158
+ Logging.logDebug('Notification', '{0}/Progress/{1}'.format(this.id, JSON.stringify(item.message.progress)));
175
159
  if (this.updateState(NotificationState.InProgress)) {
176
160
  this.changedTimestampValue = now;
177
161
  this.changedTimestamp = this.getGlobalizedTimestamp(now);
178
162
  }
179
163
  this.object = item.message.progress && MsftSme.last(item.message.progress);
180
- if (this.object && this.object.hasOwnProperty('percent')) {
181
- this.progressPercent = this.object && this.object.percent;
164
+ if (this.object && this.object.hasOwnProperty('percentComplete')) {
165
+ this.progressPercent = this.object && this.object.percentComplete;
182
166
  }
183
167
  if ((this.progressPercent == null || this.progressPercent < 0)
184
168
  && this.workItem.progressMessage && this.workItem.progressMessage.indexOf('{{percent}}') >= 0) {
@@ -187,20 +171,12 @@ export class Notification {
187
171
  changed = true;
188
172
  }
189
173
  if (PowerShellNotification.hasData(item)) {
190
- Logging.log({
191
- source: 'Notification',
192
- level: LogLevel.Debug,
193
- message: '{0}/Data/{1}'.format(this.id, JSON.stringify(item.message.results))
194
- });
174
+ Logging.logDebug('Notification', '{0}/Data/{1}'.format(this.id, JSON.stringify(item.message.results)));
195
175
  this.object = item.message.results && MsftSme.last(item.message.results);
196
176
  changed = true;
197
177
  }
198
178
  if (PowerShellNotification.hasCompleted(item)) {
199
- Logging.log({
200
- source: 'Notification',
201
- level: LogLevel.Debug,
202
- message: '{0}/Completed'.format(this.id)
203
- });
179
+ Logging.logDebug('Notification', '{0}/Completed'.format(this.id));
204
180
  if (this.updateState(NotificationState.Success)) {
205
181
  this.changedTimestampValue = now;
206
182
  this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);
@@ -210,6 +186,27 @@ export class Notification {
210
186
  this.updateMessageAndLinkAndTitle(this.workItem);
211
187
  return !this.isDisabled && changed;
212
188
  }
189
+ /**
190
+ * Update the notification by socket message from the gateway.
191
+ *
192
+ * @param state the state of notification.
193
+ * @param item the socket message.
194
+ * @return boolean the changed status.
195
+ */
196
+ updateFromNotificationMessage(state, item) {
197
+ const now = Date.now();
198
+ this.title = item.title;
199
+ this.message = item.message;
200
+ this.state = state;
201
+ this.changedTimestampValue = now;
202
+ if (state === NotificationState.InProgress) {
203
+ this.changedTimestamp = this.getGlobalizedTimestamp(now);
204
+ }
205
+ else {
206
+ this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);
207
+ }
208
+ return true;
209
+ }
213
210
  /**
214
211
  * Update the notification by instant notification message from the client.
215
212
  *
@@ -1 +1 @@
1
- {"version":3,"sources":["../../../packages/core/notification/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAEhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAA6B,MAAM,2BAA2B,CAAC;AAI9F;;GAEG;AACH,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IAC/B,mFAAW,CAAA;IACX,qGAAoB,CAAA;IACpB,mEAAG,CAAA;IACH,yEAAM,CAAA;IACN,yEAAM,CAAA;AACV,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAUD;;;GAGG;AACH,MAAM,OAAO,YAAY;IAoMrB;;;;OAIG;IACH,YAAmB,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;QAxMrB,YAAO,GAAY,OAAO,CAAC,UAAU,EAAW,CAAC;QA8DzD;;WAEG;QACI,kBAAa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,KAAK,CAAC,CAAC,CAAC;aACtC;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,iBAAiB,CAAC,OAAe,EAAE,UAAoB;QAC3D,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE;YAC5B,IAAI,KAAK,KAAK,SAAS,EAAE;gBACrB,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;oBAC1C,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;iBAC1E;aACJ;iBAAM,IAAI,KAAK,KAAK,YAAY,EAAE;gBAC/B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;oBAC3C,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;iBAC5E;aACJ;iBAAM;gBACH,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;oBACzB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;wBACxB,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;4BACb,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;yBACxB;6BAAM;4BACH,MAAM,GAAG,IAAI,CAAC;4BACd,MAAM;yBACT;qBACJ;oBAED,IAAI,MAAM,EAAE;wBACR,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;qBAClE;iBACJ;aACJ;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","file":"notification.js","sourcesContent":["import { Globalization } from '../data/globalization';\r\nimport { LogLevel } from '../diagnostics/log-level';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { RpcNotification } from '../rpc/notification/rpc-notification-model';\r\nimport { RpcWorkItem } from '../rpc/work-item/rpc-work-item-model';\r\nimport { NotificationLinkType } from './notification-link-type';\r\nimport { IFrameService } from './notification-manager';\r\nimport { NotificationState } from './notification-state';\r\nimport { PowerShellNotification, PowerShellWorkItemMessage } from './powershell-notification';\r\nimport { SocketMessage } from './socket-signalr';\r\nimport { RecoveredWorkItem } from './work-item-request';\r\n\r\n/**\r\n * Notification changed event type.\r\n */\r\nexport enum NotificationChangeEvent {\r\n Initialized,\r\n InitializationFailed,\r\n Add,\r\n Remove,\r\n Change\r\n}\r\n\r\n/**\r\n * Notification changed event packet.\r\n */\r\nexport interface NotificationEvent {\r\n changeEvent: NotificationChangeEvent;\r\n notification?: Notification;\r\n}\r\n\r\n/**\r\n * Internal notification object converted from ClientNotification object.\r\n * Contains data to track notifications.\r\n */\r\nexport class Notification {\r\n private strings: Strings = MsftSme.getStrings<Strings>();\r\n\r\n /**\r\n * Work item passed from RPC or client on shell.\r\n */\r\n private workItem: RpcWorkItem;\r\n\r\n /**\r\n * The type ID of work item.\r\n */\r\n public typeId: string;\r\n\r\n /**\r\n * The node name.\r\n */\r\n public nodeName: string;\r\n\r\n /**\r\n * The module name.\r\n */\r\n public moduleName: string;\r\n\r\n /**\r\n * The entry point name within the module\r\n */\r\n public entryPointName: string;\r\n\r\n /**\r\n * The module display name.\r\n */\r\n public moduleDisplayName: string;\r\n\r\n /**\r\n * Object included last response.\r\n */\r\n public object: any;\r\n\r\n /**\r\n * The state of notification.\r\n */\r\n public state: NotificationState;\r\n\r\n /**\r\n * The title of work item to display user. (localized)\r\n */\r\n public title: string;\r\n\r\n /**\r\n * The description of work item to display user. (localized)\r\n */\r\n public description: string;\r\n\r\n /**\r\n * The message. (localized)\r\n */\r\n public message: string;\r\n\r\n /**\r\n * Possible solution message to address error. (localized)\r\n */\r\n public solutionMessage: string;\r\n\r\n /**\r\n * True if the notification was created from recover, updates from messages should be taken\r\n */\r\n public isFromRecover = false;\r\n\r\n /**\r\n * True if the notification is disabled and should not be shown to the user\r\n */\r\n public isDisabled = false;\r\n\r\n /**\r\n * The start timestamp as a formatted globalized string\r\n */\r\n public startTimestamp: string;\r\n\r\n /**\r\n * The last changed timestamp as a formatted globalized string\r\n */\r\n public changedTimestamp: string;\r\n\r\n /**\r\n * The last changed timestamp as a number\r\n */\r\n public changedTimestampValue: number;\r\n\r\n /**\r\n * The end timestamp as a formatted globalized string\r\n */\r\n public endTimestamp: string;\r\n\r\n /**\r\n * The progress percent.\r\n */\r\n public progressPercent: number;\r\n\r\n /**\r\n * The success link to navigate to the object view. (optional)\r\n * At default, it brings to the home page of the module.\r\n */\r\n public link: string;\r\n\r\n /**\r\n * the notification link type of the link\r\n */\r\n public linkType: NotificationLinkType;\r\n\r\n /**\r\n * True if we should show the link in the notification's alert\r\n * We will show the link if there is a custom link or it is a long running request\r\n */\r\n public showLinkInAlert = false;\r\n\r\n /**\r\n * Marked it's no longer display to include list of notifications.\r\n */\r\n public dismissed = false;\r\n\r\n /**\r\n * The parent URI window.location.pathname.\r\n */\r\n public locationPathname: string;\r\n\r\n /**\r\n * The parent URI window.location.search\r\n */\r\n public locationSearch: string;\r\n\r\n /**\r\n *\r\n * Tracks if the notification has been read.\r\n */\r\n public isUnread = true;\r\n\r\n /**\r\n * Create notification from WorkItem.\r\n *\r\n * @param id the notification ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public static createFromWorkItem(\r\n id: string, workItem: RpcWorkItem, state: NotificationState, iFrameService: IFrameService, object?: any): Notification {\r\n const notification = new Notification(id);\r\n notification.workItem = workItem;\r\n\r\n notification.state = state;\r\n notification.object = object;\r\n notification.initializeFromWorkItem(workItem, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Create notification from recovered work item.\r\n *\r\n * @param recoveredWorkItem the recovered work item.\r\n * @return notification the notification object.\r\n */\r\n public static createFromRecover(recoveredWorkItem: RecoveredWorkItem, iFrameService: IFrameService): Notification {\r\n const notification = new Notification(recoveredWorkItem.id);\r\n notification.workItem = recoveredWorkItem.metadata;\r\n notification.isFromRecover = true;\r\n\r\n if (recoveredWorkItem.failed) {\r\n notification.state = NotificationState.Error;\r\n notification.object = {\r\n errorType: 'WorkItemRecover',\r\n message: recoveredWorkItem.errorMessage\r\n };\r\n } else {\r\n notification.state = NotificationState.InProgress;\r\n notification.object = {};\r\n }\r\n\r\n notification.initializeFromWorkItem(recoveredWorkItem.metadata, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Create notification from instant request.\r\n *\r\n * @param client the RPC notication request.\r\n * @return notification the notification object.\r\n */\r\n public static createFromClient(client: RpcNotification, iFrameService: IFrameService): Notification {\r\n const notification = new Notification(client.id);\r\n notification.locationPathname = window.location.pathname;\r\n notification.locationSearch = window.location.search;\r\n notification.initializeFromInstant(client, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the Notification class.\r\n *\r\n * @param id the notification ID.\r\n */\r\n constructor(public id: string) { }\r\n\r\n /**\r\n * Update a notification by work item from RPC.\r\n * @param id the notification id.\r\n * @param workItem the work item.\r\n * @param state the state of the notification.\r\n * @param object the object from query result.\r\n */\r\n public updateFromWorkItem(id: string, workItem: RpcWorkItem, state: NotificationState, object?: any) {\r\n let changed = false;\r\n\r\n if (this.updateState(state)) {\r\n changed = true;\r\n const now = Date.now();\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n if (this.object !== object) {\r\n changed = true;\r\n this.object = object;\r\n }\r\n\r\n this.updateMessageAndLinkAndTitle(workItem);\r\n return !this.isDisabled && changed;\r\n }\r\n\r\n /**\r\n * Update the notification by socket message from the gateway.\r\n *\r\n * @param item the socket message.\r\n * @return boolean the changed status.\r\n */\r\n public updateFromMessage(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n let changed = false;\r\n const now = Date.now();\r\n if (PowerShellNotification.hasError(item)) {\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Debug,\r\n message: '{0}/Error/{1}'.format(this.id, JSON.stringify(item.message.errors))\r\n });\r\n if (this.updateState(NotificationState.Error)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = item.message.errors && MsftSme.first(item.message.errors);\r\n changed = true;\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled;\r\n }\r\n\r\n if (PowerShellNotification.hasException(item)) {\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Debug,\r\n message: '{0}/Exception/{1}'.format(this.id, item.message.exception)\r\n });\r\n if (this.updateState(NotificationState.Error)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = { message: item.message.exception };\r\n changed = true;\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled;\r\n }\r\n\r\n if (PowerShellNotification.hasProgress(item)) {\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Debug,\r\n message: '{0}/Progress/{1}'.format(this.id, JSON.stringify(item.message.progress))\r\n });\r\n if (this.updateState(NotificationState.InProgress)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = item.message.progress && MsftSme.last(item.message.progress);\r\n if (this.object && this.object.hasOwnProperty('percent')) {\r\n this.progressPercent = this.object && this.object.percent;\r\n }\r\n\r\n if ((this.progressPercent == null || this.progressPercent < 0)\r\n && this.workItem.progressMessage && this.workItem.progressMessage.indexOf('{{percent}}') >= 0) {\r\n return false;\r\n }\r\n\r\n changed = true;\r\n }\r\n\r\n if (PowerShellNotification.hasData(item)) {\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Debug,\r\n message: '{0}/Data/{1}'.format(this.id, JSON.stringify(item.message.results))\r\n });\r\n this.object = item.message.results && MsftSme.last(item.message.results);\r\n changed = true;\r\n }\r\n\r\n if (PowerShellNotification.hasCompleted(item)) {\r\n Logging.log({\r\n source: 'Notification',\r\n level: LogLevel.Debug,\r\n message: '{0}/Completed'.format(this.id)\r\n });\r\n if (this.updateState(NotificationState.Success)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n changed = true;\r\n }\r\n\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled && changed;\r\n }\r\n\r\n /**\r\n * Update the notification by instant notification message from the client.\r\n *\r\n * @param client the instant notification object.\r\n * @param boolean the changed status.\r\n */\r\n public updateFromClient(client: RpcNotification): boolean {\r\n let changed = false;\r\n const title = client.title;\r\n if (this.title !== title) {\r\n changed = true;\r\n this.title = title;\r\n }\r\n\r\n if (this.description !== client.description) {\r\n changed = true;\r\n this.description = client.description;\r\n }\r\n\r\n if (this.updateState(client.state)) {\r\n const now = Date.now();\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.getGlobalizedTimestamp(now);\r\n changed = true;\r\n if (this.state !== NotificationState.InProgress) {\r\n this.endTimestamp = this.changedTimestamp;\r\n }\r\n }\r\n\r\n const link = this.formatLink(client.link, client.linkType);\r\n if (this.link !== link) {\r\n changed = true;\r\n this.link = link;\r\n this.linkType = client.linkType;\r\n }\r\n\r\n if (this.message !== client.message) {\r\n changed = true;\r\n this.message = client.message;\r\n }\r\n\r\n if (this.solutionMessage !== client.solutionMessage) {\r\n changed = true;\r\n this.solutionMessage = client.solutionMessage;\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Gets the module display name.\r\n */\r\n private getModuleDisplayName(iFrameService: IFrameService, sourceName: string, sourceSubName: string): string {\r\n const activeIFrame = iFrameService ? iFrameService.getActiveToolIFrameData() : null;\r\n if (activeIFrame && activeIFrame.entryPoint) {\r\n const entryPoint = activeIFrame.entryPoint;\r\n this.entryPointName = entryPoint.name;\r\n\r\n if (entryPoint.parentModule) {\r\n this.moduleName = entryPoint.parentModule.name;\r\n }\r\n } else {\r\n // fallback see if we can get any info from RPC\r\n this.moduleName = sourceName;\r\n if (sourceSubName) {\r\n this.entryPointName = MsftSme.first(sourceSubName.split('#'));\r\n }\r\n }\r\n\r\n const environment = MsftSme.self().Environment;\r\n\r\n // if moduleName === environment.name then the source is Shell. Return null to use generic module name\r\n if (this.moduleName && this.moduleName !== environment.name) {\r\n const module: EnvironmentModule = MsftSme.find(\r\n <EnvironmentModule[]>environment.modules,\r\n value => value.name === this.moduleName);\r\n if (module) {\r\n if (this.entryPointName) {\r\n const entryPoint = MsftSme.find(module.entryPoints, ep => ep.name === this.entryPointName);\r\n if (entryPoint) {\r\n return entryPoint.displayName;\r\n }\r\n }\r\n\r\n return module.displayName;\r\n }\r\n\r\n return this.moduleName;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Update the state.\r\n *\r\n * @param state the new state.\r\n * @return boolean the changed state.\r\n */\r\n private updateState(state: NotificationState): boolean {\r\n if (this.state !== state) {\r\n this.state = state;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private initializeFromWorkItem(item: RpcWorkItem, iFrameService: IFrameService): void {\r\n this.nodeName = item.nodeName;\r\n this.moduleDisplayName = this.getModuleDisplayName(iFrameService, item.sourceName, item.sourceSubName);\r\n this.startTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n this.changedTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n this.changedTimestampValue = item.timestamp;\r\n this.description = item.description;\r\n this.typeId = item.typeId;\r\n this.updateMessageAndLinkAndTitle(item);\r\n }\r\n\r\n private updateMessageAndLinkAndTitle(item: RpcWorkItem): void {\r\n let template: string;\r\n this.isDisabled = !this.isFromRecover && item.disableAllNotifications;\r\n switch (this.state) {\r\n case NotificationState.Submitted:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.submittedMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Started:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.startedMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Error:\r\n this.title = item.errorTitle || item.title;\r\n this.isDisabled = !this.isFromRecover && item.disableErrorNotification;\r\n this.endTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n template = item.errorMessage;\r\n this.link = this.formatLink(item.errorLink, item.errorLinkType);\r\n this.linkType = item.errorLinkType;\r\n this.showLinkInAlert = true;\r\n this.moduleDisplayName = item.errorLinkText || this.moduleDisplayName;\r\n break;\r\n case NotificationState.InProgress:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.progressMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Success:\r\n this.title = item.successTitle || item.title;\r\n this.endTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n template = item.successMessage;\r\n this.link = this.formatLink(item.successLink, item.successLinkType);\r\n this.linkType = item.successLinkType;\r\n this.moduleDisplayName = item.successLinkText || this.moduleDisplayName;\r\n this.showLinkInAlert = true;\r\n break;\r\n default:\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationUnsupportedState.message;\r\n throw new Error(message);\r\n }\r\n\r\n this.message = this.formatMessage(template);\r\n }\r\n\r\n private initializeFromInstant(client: RpcNotification, iFrameService: IFrameService): void {\r\n this.nodeName = client.nodeName;\r\n this.moduleDisplayName = client.linkText ?\r\n client.linkText\r\n : this.getModuleDisplayName(iFrameService, client.sourceName, client.sourceSubName);\r\n this.startTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n this.changedTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n this.changedTimestampValue = client.timestamp;\r\n this.title = client.title;\r\n this.description = client.description;\r\n this.state = client.state;\r\n this.link = this.formatLink(client.link, client.linkType);\r\n this.linkType = client.linkType;\r\n this.message = client.message;\r\n this.solutionMessage = client.solutionMessage;\r\n if (this.state !== NotificationState.Started && this.state !== NotificationState.InProgress) {\r\n this.endTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n }\r\n }\r\n\r\n private getGlobalizedTimestamp(timestamp: number): string {\r\n return Globalization.timeOnly(new Date(timestamp));\r\n }\r\n\r\n private formatLink(link: string, linkType?: NotificationLinkType): string {\r\n // tslint:disable-next-line:max-line-length\r\n // href example:\r\n // tslint:disable-next-line:max-line-length\r\n // \"http://localhost:4400/apps/msft.sme.server-manager!servers/tools/msft.sme.module-seed!main?connection=sme-full1.redmond.corp.microsoft.com\"\r\n\r\n if (linkType === NotificationLinkType.Absolute) {\r\n return link;\r\n }\r\n\r\n // null linkType behaves like NotificationLinkType.RelativeToTool\r\n const pathname = linkType === NotificationLinkType.RelativeToRoot ?\r\n '/'\r\n : this.locationPathname || this.workItem && this.workItem.locationPathname;\r\n\r\n if (link && pathname) {\r\n this.showLinkInAlert = true;\r\n return MsftSme.trimEnd(pathname, '/') + '/' + MsftSme.trimStart(link, '/');\r\n }\r\n\r\n this.showLinkInAlert = false;\r\n return pathname;\r\n }\r\n\r\n private formatMessage(template: string): string {\r\n const parameters = this.findParameters(template);\r\n const message = this.replaceParameters(template, parameters);\r\n return message;\r\n }\r\n\r\n private findParameters(template: string): string[] {\r\n const results: string[] = [];\r\n if (!template) {\r\n return results;\r\n }\r\n\r\n const segments = template.split('{{');\r\n for (const seg of segments) {\r\n const index = seg.indexOf('}}');\r\n if (index > 0) {\r\n results.push(seg.substr(0, index));\r\n }\r\n }\r\n\r\n return results;\r\n }\r\n\r\n private replaceParameters(message: string, parameters: string[]): string {\r\n for (const param of parameters) {\r\n if (param === 'percent') {\r\n if (typeof this.progressPercent === 'number') {\r\n message = message.replaceAll('{{percent}}', '' + this.progressPercent);\r\n }\r\n } else if (param === 'objectName') {\r\n if (this.workItem && this.workItem.objectName) {\r\n message = message.replaceAll('{{objectName}}', this.workItem.objectName);\r\n }\r\n } else {\r\n if (this.object) {\r\n const segments = param.split('.');\r\n let target = this.object;\r\n for (const seg of segments) {\r\n if (target[seg]) {\r\n target = target[seg];\r\n } else {\r\n target = null;\r\n break;\r\n }\r\n }\r\n\r\n if (target) {\r\n message = message.replaceAll('{{' + param + '}}', '' + target);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return message;\r\n }\r\n}\r\n"]}
1
+ {"version":3,"sources":["../../../packages/core/notification/notification.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACtD,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAKjD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAC;AAGhE,OAAO,EAAE,iBAAiB,EAAE,MAAM,sBAAsB,CAAC;AACzD,OAAO,EAAE,sBAAsB,EAA6B,MAAM,2BAA2B,CAAC;AAI9F;;GAEG;AACH,MAAM,CAAN,IAAY,uBAMX;AAND,WAAY,uBAAuB;IAC/B,mFAAW,CAAA;IACX,qGAAoB,CAAA;IACpB,mEAAG,CAAA;IACH,yEAAM,CAAA;IACN,yEAAM,CAAA;AACV,CAAC,EANW,uBAAuB,KAAvB,uBAAuB,QAMlC;AAUD;;;GAGG;AACH,MAAM,OAAO,YAAY;IAiMrB;;;;OAIG;IACH,YAAmB,EAAU;QAAV,OAAE,GAAF,EAAE,CAAQ;QArMrB,YAAO,GAAY,OAAO,CAAC,UAAU,EAAW,CAAC;QA8DzD;;WAEG;QACI,kBAAa,GAAG,KAAK,CAAC;QAE7B;;WAEG;QACI,eAAU,GAAG,KAAK,CAAC;QAsC1B;;;WAGG;QACI,oBAAe,GAAG,KAAK,CAAC;QAE/B;;WAEG;QACI,cAAS,GAAG,KAAK,CAAC;QAYzB;;;WAGG;QACI,aAAQ,GAAG,IAAI,CAAC;IAgEU,CAAC;IA9DlC;;;;;;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AK,CAAC,CAAC,CAAC;aACtC;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;IAEO,iBAAiB,CAAC,OAAe,EAAE,UAAoB;QAC3D,KAAK,MAAM,KAAK,IAAI,UAAU,EAAE;YAC5B,IAAI,KAAK,KAAK,SAAS,EAAE;gBACrB,IAAI,OAAO,IAAI,CAAC,eAAe,KAAK,QAAQ,EAAE;oBAC1C,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,aAAa,EAAE,EAAE,GAAG,IAAI,CAAC,eAAe,CAAC,CAAC;iBAC1E;aACJ;iBAAM,IAAI,KAAK,KAAK,YAAY,EAAE;gBAC/B,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,UAAU,EAAE;oBAC3C,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,gBAAgB,EAAE,IAAI,CAAC,QAAQ,CAAC,UAAU,CAAC,CAAC;iBAC5E;aACJ;iBAAM;gBACH,IAAI,IAAI,CAAC,MAAM,EAAE;oBACb,MAAM,QAAQ,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;oBAClC,IAAI,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC;oBACzB,KAAK,MAAM,GAAG,IAAI,QAAQ,EAAE;wBACxB,IAAI,MAAM,CAAC,GAAG,CAAC,EAAE;4BACb,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC;yBACxB;6BAAM;4BACH,MAAM,GAAG,IAAI,CAAC;4BACd,MAAM;yBACT;qBACJ;oBAED,IAAI,MAAM,EAAE;wBACR,OAAO,GAAG,OAAO,CAAC,UAAU,CAAC,IAAI,GAAG,KAAK,GAAG,IAAI,EAAE,EAAE,GAAG,MAAM,CAAC,CAAC;qBAClE;iBACJ;aACJ;SACJ;QAED,OAAO,OAAO,CAAC;IACnB,CAAC;CACJ","file":"notification.js","sourcesContent":["import { Globalization } from '../data/globalization';\r\nimport { Logging } from '../diagnostics/logging';\r\nimport { Strings } from '../generated/strings';\r\nimport { EnvironmentModule } from '../manifest/environment-modules';\r\nimport { RpcNotification } from '../rpc/notification/rpc-notification-model';\r\nimport { RpcWorkItem } from '../rpc/work-item/rpc-work-item-model';\r\nimport { NotificationLinkType } from './notification-link-type';\r\nimport { IFrameService } from './notification-manager';\r\nimport { NotificationMessage } from './notification-message';\r\nimport { NotificationState } from './notification-state';\r\nimport { PowerShellNotification, PowerShellWorkItemMessage } from './powershell-notification';\r\nimport { SocketMessage } from './socket-signalr';\r\nimport { RecoveredWorkItem } from './work-item-request';\r\n\r\n/**\r\n * Notification changed event type.\r\n */\r\nexport enum NotificationChangeEvent {\r\n Initialized,\r\n InitializationFailed,\r\n Add,\r\n Remove,\r\n Change\r\n}\r\n\r\n/**\r\n * Notification changed event packet.\r\n */\r\nexport interface NotificationEvent {\r\n changeEvent: NotificationChangeEvent;\r\n notification?: Notification;\r\n}\r\n\r\n/**\r\n * Internal notification object converted from ClientNotification object.\r\n * Contains data to track notifications.\r\n */\r\nexport class Notification {\r\n private strings: Strings = MsftSme.getStrings<Strings>();\r\n\r\n /**\r\n * Work item passed from RPC or client on shell.\r\n */\r\n private workItem: RpcWorkItem;\r\n\r\n /**\r\n * The type ID of work item.\r\n */\r\n public typeId: string;\r\n\r\n /**\r\n * The node name.\r\n */\r\n public nodeName: string;\r\n\r\n /**\r\n * The module name.\r\n */\r\n public moduleName: string;\r\n\r\n /**\r\n * The entry point name within the module\r\n */\r\n public entryPointName: string;\r\n\r\n /**\r\n * The module display name.\r\n */\r\n public moduleDisplayName: string;\r\n\r\n /**\r\n * Object included last response.\r\n */\r\n public object: any;\r\n\r\n /**\r\n * The state of notification.\r\n */\r\n public state: NotificationState;\r\n\r\n /**\r\n * The title of work item to display user. (localized)\r\n */\r\n public title: string;\r\n\r\n /**\r\n * The description of work item to display user. (localized)\r\n */\r\n public description: string;\r\n\r\n /**\r\n * The message. (localized)\r\n */\r\n public message: string;\r\n\r\n /**\r\n * Possible solution message to address error. (localized)\r\n */\r\n public solutionMessage: string;\r\n\r\n /**\r\n * True if the notification was created from recover, updates from messages should be taken\r\n */\r\n public isFromRecover = false;\r\n\r\n /**\r\n * True if the notification is disabled and should not be shown to the user\r\n */\r\n public isDisabled = false;\r\n\r\n /**\r\n * The start timestamp as a formatted globalized string\r\n */\r\n public startTimestamp: string;\r\n\r\n /**\r\n * The last changed timestamp as a formatted globalized string\r\n */\r\n public changedTimestamp: string;\r\n\r\n /**\r\n * The last changed timestamp as a number\r\n */\r\n public changedTimestampValue: number;\r\n\r\n /**\r\n * The end timestamp as a formatted globalized string\r\n */\r\n public endTimestamp: string;\r\n\r\n /**\r\n * The progress percent.\r\n */\r\n public progressPercent: number;\r\n\r\n /**\r\n * The success link to navigate to the object view. (optional)\r\n * At default, it brings to the home page of the module.\r\n */\r\n public link: string;\r\n\r\n /**\r\n * the notification link type of the link\r\n */\r\n public linkType: NotificationLinkType;\r\n\r\n /**\r\n * True if we should show the link in the notification's alert\r\n * We will show the link if there is a custom link or it is a long running request\r\n */\r\n public showLinkInAlert = false;\r\n\r\n /**\r\n * Marked it's no longer display to include list of notifications.\r\n */\r\n public dismissed = false;\r\n\r\n /**\r\n * The parent URI window.location.pathname.\r\n */\r\n public locationPathname: string;\r\n\r\n /**\r\n * The parent URI window.location.search\r\n */\r\n public locationSearch: string;\r\n\r\n /**\r\n *\r\n * Tracks if the notification has been read.\r\n */\r\n public isUnread = true;\r\n\r\n /**\r\n * Create notification from WorkItem.\r\n *\r\n * @param id the notification ID.\r\n * @param workItem the RPC work item.\r\n * @param state the initial state.\r\n * @param object the object from query result.\r\n * @return notification the notification object.\r\n */\r\n public static createFromWorkItem(\r\n id: string, workItem: RpcWorkItem, state: NotificationState, iFrameService: IFrameService, object?: any): Notification {\r\n const notification = new Notification(id);\r\n notification.workItem = workItem;\r\n\r\n notification.state = state;\r\n notification.object = object;\r\n notification.initializeFromWorkItem(workItem, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Create notification from recovered work item.\r\n *\r\n * @param recoveredWorkItem the recovered work item.\r\n * @return notification the notification object.\r\n */\r\n public static createFromRecover(recoveredWorkItem: RecoveredWorkItem, iFrameService: IFrameService): Notification {\r\n const notification = new Notification(recoveredWorkItem.id);\r\n notification.workItem = recoveredWorkItem.metadata;\r\n notification.isFromRecover = true;\r\n\r\n if (recoveredWorkItem.failed) {\r\n notification.state = NotificationState.Error;\r\n notification.object = { errorType: 'WorkItemRecover', message: recoveredWorkItem.errorMessage };\r\n } else {\r\n notification.state = NotificationState.InProgress;\r\n notification.object = {};\r\n }\r\n\r\n notification.initializeFromWorkItem(recoveredWorkItem.metadata, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Create notification from instant request.\r\n *\r\n * @param client the RPC notification request.\r\n * @return notification the notification object.\r\n */\r\n public static createFromClient(client: RpcNotification, iFrameService: IFrameService): Notification {\r\n const notification = new Notification(client.id);\r\n notification.locationPathname = window.location.pathname;\r\n notification.locationSearch = window.location.search;\r\n notification.initializeFromInstant(client, iFrameService);\r\n return notification;\r\n }\r\n\r\n /**\r\n * Initializes a new instance of the Notification class.\r\n *\r\n * @param id the notification ID.\r\n */\r\n constructor(public id: string) { }\r\n\r\n /**\r\n * Update a notification by work item from RPC.\r\n * @param id the notification id.\r\n * @param workItem the work item.\r\n * @param state the state of the notification.\r\n * @param object the object from query result.\r\n */\r\n public updateFromWorkItem(id: string, workItem: RpcWorkItem, state: NotificationState, object?: any) {\r\n let changed = false;\r\n\r\n if (this.updateState(state)) {\r\n changed = true;\r\n const now = Date.now();\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n if (this.object !== object) {\r\n changed = true;\r\n this.object = object;\r\n }\r\n\r\n this.updateMessageAndLinkAndTitle(workItem);\r\n return !this.isDisabled && changed;\r\n }\r\n\r\n /**\r\n * Update the notification by socket message from the gateway.\r\n *\r\n * @param item the socket message.\r\n * @return boolean the changed status.\r\n */\r\n public updateFromMessage(item: SocketMessage<PowerShellWorkItemMessage>): boolean {\r\n let changed = false;\r\n const now = Date.now();\r\n if (PowerShellNotification.hasError(item)) {\r\n Logging.logDebug('Notification', '{0}/Error/{1}'.format(this.id, JSON.stringify(item.message.errors)));\r\n if (this.updateState(NotificationState.Error)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = item.message.errors && MsftSme.first(item.message.errors);\r\n changed = true;\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled;\r\n }\r\n\r\n if (PowerShellNotification.hasException(item)) {\r\n Logging.logDebug('Notification', '{0}/Exception/{1}'.format(this.id, item.message.exception));\r\n if (this.updateState(NotificationState.Error)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = { message: item.message.exception };\r\n changed = true;\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled;\r\n }\r\n\r\n if (PowerShellNotification.hasProgress(item)) {\r\n Logging.logDebug('Notification', '{0}/Progress/{1}'.format(this.id, JSON.stringify(item.message.progress)));\r\n if (this.updateState(NotificationState.InProgress)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n this.object = item.message.progress && MsftSme.last(item.message.progress);\r\n if (this.object && this.object.hasOwnProperty('percentComplete')) {\r\n this.progressPercent = this.object && this.object.percentComplete;\r\n }\r\n\r\n if ((this.progressPercent == null || this.progressPercent < 0)\r\n && this.workItem.progressMessage && this.workItem.progressMessage.indexOf('{{percent}}') >= 0) {\r\n return false;\r\n }\r\n\r\n changed = true;\r\n }\r\n\r\n if (PowerShellNotification.hasData(item)) {\r\n Logging.logDebug('Notification', '{0}/Data/{1}'.format(this.id, JSON.stringify(item.message.results)));\r\n this.object = item.message.results && MsftSme.last(item.message.results);\r\n changed = true;\r\n }\r\n\r\n if (PowerShellNotification.hasCompleted(item)) {\r\n Logging.logDebug('Notification', '{0}/Completed'.format(this.id));\r\n if (this.updateState(NotificationState.Success)) {\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n changed = true;\r\n }\r\n\r\n this.updateMessageAndLinkAndTitle(this.workItem);\r\n return !this.isDisabled && changed;\r\n }\r\n\r\n /**\r\n * Update the notification by socket message from the gateway.\r\n *\r\n * @param state the state of notification.\r\n * @param item the socket message.\r\n * @return boolean the changed status.\r\n */\r\n public updateFromNotificationMessage(state: NotificationState, item: NotificationMessage): boolean {\r\n const now = Date.now();\r\n this.title = item.title;\r\n this.message = item.message;\r\n this.state = state;\r\n this.changedTimestampValue = now;\r\n if (state === NotificationState.InProgress) {\r\n this.changedTimestamp = this.getGlobalizedTimestamp(now);\r\n } else {\r\n this.changedTimestamp = this.endTimestamp = this.getGlobalizedTimestamp(now);\r\n }\r\n\r\n return true;\r\n }\r\n\r\n /**\r\n * Update the notification by instant notification message from the client.\r\n *\r\n * @param client the instant notification object.\r\n * @param boolean the changed status.\r\n */\r\n public updateFromClient(client: RpcNotification): boolean {\r\n let changed = false;\r\n const title = client.title;\r\n if (this.title !== title) {\r\n changed = true;\r\n this.title = title;\r\n }\r\n\r\n if (this.description !== client.description) {\r\n changed = true;\r\n this.description = client.description;\r\n }\r\n\r\n if (this.updateState(client.state)) {\r\n const now = Date.now();\r\n this.changedTimestampValue = now;\r\n this.changedTimestamp = this.getGlobalizedTimestamp(now);\r\n changed = true;\r\n if (this.state !== NotificationState.InProgress) {\r\n this.endTimestamp = this.changedTimestamp;\r\n }\r\n }\r\n\r\n const link = this.formatLink(client.link, client.linkType);\r\n if (this.link !== link) {\r\n changed = true;\r\n this.link = link;\r\n this.linkType = client.linkType;\r\n }\r\n\r\n if (this.message !== client.message) {\r\n changed = true;\r\n this.message = client.message;\r\n }\r\n\r\n if (this.solutionMessage !== client.solutionMessage) {\r\n changed = true;\r\n this.solutionMessage = client.solutionMessage;\r\n }\r\n\r\n return changed;\r\n }\r\n\r\n /**\r\n * Gets the module display name.\r\n */\r\n private getModuleDisplayName(iFrameService: IFrameService, sourceName: string, sourceSubName: string): string {\r\n const activeIFrame = iFrameService ? iFrameService.getActiveToolIFrameData() : null;\r\n if (activeIFrame && activeIFrame.entryPoint) {\r\n const entryPoint = activeIFrame.entryPoint;\r\n this.entryPointName = entryPoint.name;\r\n\r\n if (entryPoint.parentModule) {\r\n this.moduleName = entryPoint.parentModule.name;\r\n }\r\n } else {\r\n // fallback see if we can get any info from RPC\r\n this.moduleName = sourceName;\r\n if (sourceSubName) {\r\n this.entryPointName = MsftSme.first(sourceSubName.split('#'));\r\n }\r\n }\r\n\r\n const environment = MsftSme.self().Environment;\r\n\r\n // if moduleName === environment.name then the source is Shell. Return null to use generic module name\r\n if (this.moduleName && this.moduleName !== environment.name) {\r\n const module: EnvironmentModule = MsftSme.find(\r\n <EnvironmentModule[]>environment.modules,\r\n value => value.name === this.moduleName);\r\n if (module) {\r\n if (this.entryPointName) {\r\n const entryPoint = MsftSme.find(module.entryPoints, ep => ep.name === this.entryPointName);\r\n if (entryPoint) {\r\n return entryPoint.displayName;\r\n }\r\n }\r\n\r\n return module.displayName;\r\n }\r\n\r\n return this.moduleName;\r\n }\r\n\r\n return null;\r\n }\r\n\r\n /**\r\n * Update the state.\r\n *\r\n * @param state the new state.\r\n * @return boolean the changed state.\r\n */\r\n private updateState(state: NotificationState): boolean {\r\n if (this.state !== state) {\r\n this.state = state;\r\n return true;\r\n }\r\n\r\n return false;\r\n }\r\n\r\n private initializeFromWorkItem(item: RpcWorkItem, iFrameService: IFrameService): void {\r\n this.nodeName = item.nodeName;\r\n this.moduleDisplayName = this.getModuleDisplayName(iFrameService, item.sourceName, item.sourceSubName);\r\n this.startTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n this.changedTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n this.changedTimestampValue = item.timestamp;\r\n this.description = item.description;\r\n this.typeId = item.typeId;\r\n this.updateMessageAndLinkAndTitle(item);\r\n }\r\n\r\n private updateMessageAndLinkAndTitle(item: RpcWorkItem): void {\r\n let template: string;\r\n this.isDisabled = !this.isFromRecover && item.disableAllNotifications;\r\n switch (this.state) {\r\n case NotificationState.Submitted:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.submittedMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Started:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.startedMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Error:\r\n this.title = item.errorTitle || item.title;\r\n this.isDisabled = !this.isFromRecover && item.disableErrorNotification;\r\n this.endTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n template = item.errorMessage;\r\n this.link = this.formatLink(item.errorLink, item.errorLinkType);\r\n this.linkType = item.errorLinkType;\r\n this.showLinkInAlert = true;\r\n this.moduleDisplayName = item.errorLinkText || this.moduleDisplayName;\r\n break;\r\n case NotificationState.InProgress:\r\n this.title = item.inProgressTitle || item.title;\r\n template = item.progressMessage;\r\n this.link = this.formatLink(null);\r\n break;\r\n case NotificationState.Success:\r\n this.title = item.successTitle || item.title;\r\n this.endTimestamp = this.getGlobalizedTimestamp(item.timestamp);\r\n template = item.successMessage;\r\n this.link = this.formatLink(item.successLink, item.successLinkType);\r\n this.linkType = item.successLinkType;\r\n this.moduleDisplayName = item.successLinkText || this.moduleDisplayName;\r\n this.showLinkInAlert = true;\r\n break;\r\n default:\r\n const message = MsftSme.getStrings<Strings>().MsftSmeShell.Core.Error.NotificationUnsupportedState.message;\r\n throw new Error(message);\r\n }\r\n\r\n this.message = this.formatMessage(template);\r\n }\r\n\r\n private initializeFromInstant(client: RpcNotification, iFrameService: IFrameService): void {\r\n this.nodeName = client.nodeName;\r\n this.moduleDisplayName = client.linkText ?\r\n client.linkText\r\n : this.getModuleDisplayName(iFrameService, client.sourceName, client.sourceSubName);\r\n this.startTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n this.changedTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n this.changedTimestampValue = client.timestamp;\r\n this.title = client.title;\r\n this.description = client.description;\r\n this.state = client.state;\r\n this.link = this.formatLink(client.link, client.linkType);\r\n this.linkType = client.linkType;\r\n this.message = client.message;\r\n this.solutionMessage = client.solutionMessage;\r\n if (this.state !== NotificationState.Started && this.state !== NotificationState.InProgress) {\r\n this.endTimestamp = this.getGlobalizedTimestamp(client.timestamp);\r\n }\r\n }\r\n\r\n private getGlobalizedTimestamp(timestamp: number): string {\r\n return Globalization.timeOnly(new Date(timestamp));\r\n }\r\n\r\n private formatLink(link: string, linkType?: NotificationLinkType): string {\r\n // tslint:disable-next-line:max-line-length\r\n // href example:\r\n // tslint:disable-next-line:max-line-length\r\n // \"http://localhost:4400/apps/msft.sme.server-manager!servers/tools/msft.sme.module-seed!main?connection=sme-full1.redmond.corp.microsoft.com\"\r\n\r\n if (linkType === NotificationLinkType.Absolute) {\r\n return link;\r\n }\r\n\r\n // null linkType behaves like NotificationLinkType.RelativeToTool\r\n const pathname = linkType === NotificationLinkType.RelativeToRoot ?\r\n '/'\r\n : this.locationPathname || this.workItem && this.workItem.locationPathname;\r\n\r\n if (link && pathname) {\r\n this.showLinkInAlert = true;\r\n return MsftSme.trimEnd(pathname, '/') + '/' + MsftSme.trimStart(link, '/');\r\n }\r\n\r\n this.showLinkInAlert = false;\r\n return pathname;\r\n }\r\n\r\n private formatMessage(template: string): string {\r\n const parameters = this.findParameters(template);\r\n const message = this.replaceParameters(template, parameters);\r\n return message;\r\n }\r\n\r\n private findParameters(template: string): string[] {\r\n const results: string[] = [];\r\n if (!template) {\r\n return results;\r\n }\r\n\r\n const segments = template.split('{{');\r\n for (const seg of segments) {\r\n const index = seg.indexOf('}}');\r\n if (index > 0) {\r\n results.push(seg.substr(0, index));\r\n }\r\n }\r\n\r\n return results;\r\n }\r\n\r\n private replaceParameters(message: string, parameters: string[]): string {\r\n for (const param of parameters) {\r\n if (param === 'percent') {\r\n if (typeof this.progressPercent === 'number') {\r\n message = message.replaceAll('{{percent}}', '' + this.progressPercent);\r\n }\r\n } else if (param === 'objectName') {\r\n if (this.workItem && this.workItem.objectName) {\r\n message = message.replaceAll('{{objectName}}', this.workItem.objectName);\r\n }\r\n } else {\r\n if (this.object) {\r\n const segments = param.split('.');\r\n let target = this.object;\r\n for (const seg of segments) {\r\n if (target[seg]) {\r\n target = target[seg];\r\n } else {\r\n target = null;\r\n break;\r\n }\r\n }\r\n\r\n if (target) {\r\n message = message.replaceAll('{{' + param + '}}', '' + target);\r\n }\r\n }\r\n }\r\n }\r\n\r\n return message;\r\n }\r\n}\r\n"]}
@@ -1,7 +1,7 @@
1
- /// <reference types="jquery" />
2
- import { Observable, Subject } from 'rxjs';
1
+ import { Observable } from 'rxjs';
3
2
  import { NodeConnection, NodeRequestOptions } from '../data/node-connection';
4
3
  import { PowerShellCommand } from '../data/powershell';
4
+ import { NotificationMessage } from './notification-message';
5
5
  import { NotificationState } from './notification-state';
6
6
  import { SocketMessage, SocketSignalR } from './socket-signalr';
7
7
  import { WorkItemResult } from './work-item-request';
@@ -28,18 +28,17 @@ export interface PowerShellWorkItemMessage {
28
28
  /**
29
29
  * The PowerShell script based notification class.
30
30
  */
31
- export declare class PowerShellNotification extends SocketSignalR<PowerShellWorkItemMessage> {
31
+ export declare class PowerShellNotification extends SocketSignalR<PowerShellWorkItemMessage | NotificationMessage> {
32
32
  private static connectionUrl;
33
- private static proxyName;
34
33
  private static notify;
35
34
  private static subscribe;
36
35
  private subjectInternal;
37
- static hasConnectionError(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
38
- static hasError(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
39
- static hasException(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
40
- static hasCompleted(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
41
- static hasData(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
42
- static hasProgress(item: SocketMessage<PowerShellWorkItemMessage>): boolean;
36
+ static hasConnectionError(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
37
+ static hasError(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
38
+ static hasException(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
39
+ static hasCompleted(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
40
+ static hasData(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
41
+ static hasProgress(item: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): boolean;
43
42
  /**
44
43
  * Initializes a new instance of the GatewaySocket class.
45
44
  */
@@ -47,7 +46,7 @@ export declare class PowerShellNotification extends SocketSignalR<PowerShellWork
47
46
  /**
48
47
  * Gets the subject observable to get notifications.
49
48
  */
50
- get subject(): Subject<SocketMessage<PowerShellWorkItemMessage>>;
49
+ get subject(): Observable<SocketMessage<PowerShellWorkItemMessage | NotificationMessage>>;
51
50
  /**
52
51
  * Submit PowerShell command as a work item.
53
52
  *
@@ -62,7 +61,7 @@ export declare class PowerShellNotification extends SocketSignalR<PowerShellWork
62
61
  /**
63
62
  * Initialize to subscribe the web socket connection.
64
63
  */
65
- initialize(): JQueryPromise<any>;
64
+ initialize(): Promise<any>;
66
65
  /**
67
66
  * Uninitialize to subscribe the web socket connection.
68
67
  */
@@ -73,18 +72,19 @@ export declare class PowerShellNotification extends SocketSignalR<PowerShellWork
73
72
  * @param id the session ID of work item.
74
73
  * @return Promise the promise object.
75
74
  */
76
- subscribeSession(id: string): JQueryPromise<any>;
75
+ subscribeSession(id: string): Promise<PowerShellWorkItemMessage | NotificationMessage>;
77
76
  /**
78
77
  * The client handler to process message.
79
78
  *
80
79
  * @param notification the message notification.
81
80
  */
82
- protected clientHandler(notification: SocketMessage<PowerShellWorkItemMessage>): void;
81
+ protected clientHandler(notification: SocketMessage<PowerShellWorkItemMessage | NotificationMessage>): void;
83
82
  /**
84
83
  * Process the message.
85
84
  *
86
85
  * @param messages the messages.
87
86
  */
88
87
  protected processMessage(message: string): void;
89
- private processData;
88
+ private processPowerShellData;
89
+ private processMessageData;
90
90
  }