{"version":3,"file":"stores-BGB1SDes.js","sources":["../../src/stores/deployment-store/deployment-store.types.ts","../../src/stores/deployment-store/DeploymentStore.ts","../../src/stores/FeedbackStore.ts","../../src/stores/RootStore.ts","../../src/stores/StoresProvider.tsx"],"sourcesContent":["import {\n SiteComponentArgs,\n SiteComponentStateArgs,\n SiteComponentVersionArgs,\n SiteDatabaseCommandArgs\n} from \"@libs/api/gateways/sia/sia-ops-gateway.hooks\";\nimport { DateTime } from \"@bps/utils\";\nimport { UseMutationResult } from \"react-query\";\n\nexport enum DeploymentAction {\n SetDesiredVersion = \"setDesiredVersion\",\n AgentDownloadDesiredVersion = \"agentDownloadDesiredVersion\",\n AgentInstallDesiredVersion = \"agentInstallDesiredVersion\",\n AgentUpdateDesiredVersion = \"agentUpdateDesiredVersion\",\n ManagerCheckUpdate = \"managerCheckUpdate\",\n InstallUpdateProsDb = \"installUpdateProsDB\",\n EnableProsDb = \"enableProsDB\",\n SendPing = \"sendPing\"\n}\n\nexport enum DeploymentStatus {\n Pending = \"pending\",\n InProgress = \"inProgress\",\n Complete = \"complete\",\n Cancelled = \"cancelled\",\n Error = \"error\"\n}\n\nexport enum DeploymentLogLevel {\n Info = \"info\",\n Warning = \"warning\",\n Error = \"error\"\n}\n\nexport interface DeploymentLog {\n level: DeploymentLogLevel;\n text: string;\n}\n\nexport interface DeploymentData {\n [DeploymentAction.SetDesiredVersion]: SiteComponentVersionArgs;\n [DeploymentAction.AgentDownloadDesiredVersion]: SiteComponentStateArgs;\n [DeploymentAction.AgentInstallDesiredVersion]: SiteComponentStateArgs;\n [DeploymentAction.AgentUpdateDesiredVersion]: SiteComponentStateArgs;\n [DeploymentAction.ManagerCheckUpdate]: string;\n [DeploymentAction.InstallUpdateProsDb]: SiteDatabaseCommandArgs;\n [DeploymentAction.EnableProsDb]: SiteDatabaseCommandArgs;\n [DeploymentAction.SendPing]: SiteComponentArgs;\n}\n\nexport interface Deployment {\n id: string;\n action: T;\n data: DeploymentData[T];\n startTime?: DateTime;\n endTime?: DateTime;\n status: DeploymentStatus;\n mutation?: UseMutationResult;\n error?: string;\n}\n","import { computed, makeObservable, observable, runInAction } from \"mobx\";\nimport { UseMutationResult } from \"react-query\";\n\nimport { DATE_FORMATS, DateTime, newGuid } from \"@bps/utils\";\nimport { SiteDatabaseCommandArgs } from \"@libs/api/gateways/sia/sia-ops-gateway.hooks\";\n\nimport { Tenant } from \"@libs/api/gateways/plt/plt-gateway.dtos\";\nimport {\n Deployment,\n DeploymentAction,\n DeploymentData,\n DeploymentLog,\n DeploymentLogLevel,\n DeploymentStatus\n} from \"./deployment-store.types\";\n\nexport class DeploymentStore {\n constructor() {\n makeObservable(this, {\n progressCompleted: computed,\n progressTotal: computed,\n progressPercentage: computed,\n isDeploying: computed\n });\n }\n\n public logs = observable([], { deep: false });\n\n public deployments = observable.map({}, { deep: true });\n public selectedTenants = observable([], { deep: true });\n\n public setSelectedTenents = (tenants: Tenant[]) => {\n runInAction(() => {\n this.selectedTenants.replace(tenants);\n });\n };\n\n public clearDeployments = () => {\n runInAction(() => {\n this.deployments.clear();\n });\n };\n\n public addDeployment = async (\n action: T,\n mutation: UseMutationResult,\n data: DeploymentData[T]\n ) => {\n const id = newGuid();\n const deployment: Deployment = {\n id,\n action,\n data,\n status: DeploymentStatus.Pending,\n mutation,\n startTime: DateTime.now()\n };\n\n runInAction(() => {\n this.deployments.set(id, deployment);\n });\n\n const endTime = DateTime.now();\n const updated: Deployment = {\n ...deployment,\n endTime\n };\n\n try {\n this.createStartLog(updated);\n const mutateResult = await mutation.mutateAsync(data);\n this.createMutationLog(mutateResult, endTime);\n updated.status = DeploymentStatus.Complete;\n } catch (e) {\n updated.error = String(e);\n updated.status = DeploymentStatus.Error;\n } finally {\n runInAction(() => {\n this.updateDeployment(id, updated);\n this.createEndLog(updated);\n });\n }\n };\n\n private createMutationLog = (mutateResult: unknown, endTime: DateTime) => {\n if (!mutateResult) return;\n\n let result = \"\";\n if (typeof mutateResult === \"object\") {\n result = JSON.stringify(mutateResult);\n } else {\n result = `${mutateResult}`;\n }\n\n const level =\n result.includes(\"Error\") || result.includes(\"BadRequest\")\n ? DeploymentLogLevel.Error\n : DeploymentLogLevel.Info;\n\n const timestamp = `> [${endTime.toFormat(\n DATE_FORMATS.DETAILED_DATE_TIME\n )}]`;\n\n const message = `${timestamp} Output: ${result}`;\n this.addLog({\n level,\n text: message\n });\n };\n\n public createEndLog = (\n deployment: Deployment\n ) => {\n const { endTime } = deployment;\n\n if (!endTime) {\n return;\n }\n let text = \"Unknown\";\n const level =\n deployment.status === DeploymentStatus.Error\n ? DeploymentLogLevel.Error\n : DeploymentLogLevel.Info;\n let updateText = \"\";\n let tenantId = \"\";\n let prosDbArgs: SiteDatabaseCommandArgs;\n\n const timestamp = `> [${endTime.toFormat(\n DATE_FORMATS.DETAILED_DATE_TIME\n )}]`;\n\n switch (deployment.action) {\n case DeploymentAction.SetDesiredVersion:\n const desiredData = deployment.data as DeploymentData[DeploymentAction.SetDesiredVersion];\n updateText = `${\n desiredData.component\n } desired version to ${desiredData.version || \"\"} for tenant ${\n desiredData.siteId\n }`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating ${updateText} (${deployment.error})`;\n } else {\n text = `${timestamp} Sucessfully updated ${updateText}`;\n }\n break;\n\n case DeploymentAction.AgentDownloadDesiredVersion:\n const downloadData = deployment.data as DeploymentData[DeploymentAction.AgentDownloadDesiredVersion];\n updateText = `${downloadData.componentType} for tenant ${downloadData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${downloadData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Sucessfully downloaded ${updateText}`;\n }\n break;\n\n case DeploymentAction.AgentInstallDesiredVersion:\n const installData = deployment.data as DeploymentData[DeploymentAction.AgentInstallDesiredVersion];\n updateText = `${installData.componentType} for tenant ${installData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${installData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Sucessfully installed ${updateText}`;\n }\n break;\n\n case DeploymentAction.AgentUpdateDesiredVersion:\n const updateData = deployment.data as DeploymentData[DeploymentAction.AgentUpdateDesiredVersion];\n updateText = `${updateData.componentType} for tenant ${updateData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${updateData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Sucessfully updated ${updateText}`;\n }\n break;\n\n case DeploymentAction.ManagerCheckUpdate:\n tenantId = deployment.data as DeploymentData[DeploymentAction.ManagerCheckUpdate];\n updateText = `site manager update on tenant ${tenantId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when checking for ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} Sucessfully checked for ${updateText}`;\n }\n break;\n\n case DeploymentAction.InstallUpdateProsDb:\n prosDbArgs = deployment.data as DeploymentData[DeploymentAction.InstallUpdateProsDb];\n updateText = `Installing/Updating PrOS database for tenant ${prosDbArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} Completed: ${updateText}`;\n }\n break;\n\n case DeploymentAction.EnableProsDb:\n prosDbArgs = deployment.data as DeploymentData[DeploymentAction.EnableProsDb];\n updateText = `Enabling PrOS database for tenant ${prosDbArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} Completed: ${updateText}`;\n }\n break;\n\n case DeploymentAction.SendPing:\n const pingArgs = deployment.data as DeploymentData[DeploymentAction.SendPing];\n updateText = `Sending ping to ${pingArgs.componentType} with tenantId ${pingArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} Completed: ${updateText}`;\n }\n break;\n }\n\n this.addLog({\n level,\n text\n });\n };\n\n public createStartLog = (\n deployment: Deployment\n ) => {\n const { endTime } = deployment;\n\n if (!endTime) {\n return;\n }\n\n let text = \"Unknown\";\n const level =\n deployment.status === DeploymentStatus.Error\n ? DeploymentLogLevel.Error\n : DeploymentLogLevel.Info;\n let updateText = \"\";\n let tenantId = \"\";\n let prosDbArgs: SiteDatabaseCommandArgs;\n\n const timestamp = `> [${endTime.toFormat(\n DATE_FORMATS.DETAILED_DATE_TIME\n )}]`;\n switch (deployment.action) {\n case DeploymentAction.SetDesiredVersion:\n const desiredData = deployment.data as DeploymentData[DeploymentAction.SetDesiredVersion];\n updateText = `${\n desiredData.component\n } desired version to ${desiredData.version || \"\"} for tenant ${\n desiredData.siteId\n }`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating ${updateText} (${deployment.error})`;\n } else {\n text = `${timestamp} Updated ${updateText}`;\n }\n break;\n\n case DeploymentAction.AgentDownloadDesiredVersion:\n const downloadData = deployment.data as DeploymentData[DeploymentAction.AgentDownloadDesiredVersion];\n updateText = `${downloadData.componentType} for tenant ${downloadData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${downloadData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Downloading ${updateText}...`;\n }\n break;\n\n case DeploymentAction.AgentInstallDesiredVersion:\n const installData = deployment.data as DeploymentData[DeploymentAction.AgentInstallDesiredVersion];\n updateText = `${installData.componentType} for tenant ${installData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${installData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Installing ${updateText}...`;\n }\n break;\n\n case DeploymentAction.AgentUpdateDesiredVersion:\n const updateData = deployment.data as DeploymentData[DeploymentAction.AgentUpdateDesiredVersion];\n updateText = `${updateData.componentType} for tenant ${updateData.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error updating component: ${updateText}. Last known state is: ${updateData.state} (${deployment.error})`;\n } else {\n text = `${timestamp} Updating ${updateText}...`;\n }\n break;\n\n case DeploymentAction.ManagerCheckUpdate:\n tenantId = deployment.data as DeploymentData[DeploymentAction.ManagerCheckUpdate];\n updateText = `Checking for site manager update on tenant ${tenantId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} ${updateText}`;\n }\n break;\n\n case DeploymentAction.InstallUpdateProsDb:\n prosDbArgs = deployment.data as DeploymentData[DeploymentAction.InstallUpdateProsDb];\n updateText = `Installing/Updating PrOS database for tenant ${prosDbArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} ${updateText}`;\n }\n break;\n\n case DeploymentAction.EnableProsDb:\n prosDbArgs = deployment.data as DeploymentData[DeploymentAction.EnableProsDb];\n updateText = `Enabling PrOS database for tenant ${prosDbArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} ${updateText}`;\n }\n break;\n\n case DeploymentAction.SendPing:\n const pingArgs = deployment.data as DeploymentData[DeploymentAction.SendPing];\n updateText = `Sending ping to ${pingArgs.componentType} with tenantId ${pingArgs.siteId}`;\n\n if (deployment.status === DeploymentStatus.Error) {\n text = `${timestamp} Error when ${updateText}. (${deployment.error})`;\n } else {\n text = `${timestamp} ${updateText}`;\n }\n break;\n }\n\n this.addLog({\n level,\n text\n });\n };\n\n public addLog = (log: DeploymentLog) => {\n runInAction(() => {\n this.logs.push(log);\n });\n };\n\n public setLogs = (logs: DeploymentLog[]) => {\n runInAction(() => {\n this.logs.replace(logs);\n });\n };\n\n public updateDeployment = (id: string, updated: Partial) => {\n runInAction(() => {\n const deployment = this.deployments.get(id);\n if (!deployment) {\n return;\n }\n this.deployments.set(id, { ...deployment, ...updated });\n });\n };\n\n get pendingDeployments() {\n return this.getDeploymentsByStatus(DeploymentStatus.Pending);\n }\n\n get isDeploying() {\n return this.pendingDeployments.length > 0;\n }\n\n get progressTotal() {\n return this.deployments.size;\n }\n\n get progressCompleted() {\n return this.getDeploymentsByStatus(DeploymentStatus.Complete).length;\n }\n\n get progressPercentage() {\n return this.progressCompleted > 0 && this.progressTotal > 0\n ? this.progressCompleted / this.progressTotal\n : 0;\n }\n\n public getDeploymentsByStatus = (\n status: DeploymentStatus | DeploymentStatus[]\n ) => {\n const _deployments: Deployment[] = [];\n this.deployments.forEach(deployment => {\n if (Array.isArray(status)) {\n if (status.includes(deployment.status)) {\n _deployments.push(deployment);\n }\n } else {\n if (deployment.status === status) {\n _deployments.push(deployment);\n }\n }\n });\n return _deployments;\n };\n}\n","import { action, makeObservable, observable, runInAction } from \"mobx\";\nimport { ReactNode } from \"react\";\nimport { HttpError } from \"@bps/http-client\";\nimport { getErrorAlertMessage } from \"@libs/api/types/error.utils\";\n\nexport type NotificationType = \"info\" | \"success\" | \"error\" | \"warning\";\n\nexport interface Notification {\n message: ReactNode;\n type: NotificationType;\n key: string;\n duration?: number;\n}\n\nexport class FeedbackStore {\n private keyCounter = 0;\n\n constructor(public config = { notificationDuration: 4000 }) {\n makeObservable(this, {\n close: action,\n notify: action\n });\n }\n\n public notifications = observable([], { deep: false });\n\n public close = (key: string) => {\n const notification = this.notifications.find(x => x.key === key);\n if (notification) {\n return this.notifications.remove(notification);\n }\n return false;\n };\n\n public notify = (args: Omit): string => {\n const notification = { ...args, key: `${this.keyCounter++}` };\n this.notifications.push(notification);\n\n setTimeout(() => {\n // ⚠️ remove will not work unless notifications is created with deep: false option\n runInAction(() => {\n this.notifications.remove(notification);\n });\n }, args.duration || this.config.notificationDuration);\n\n return notification.key;\n };\n\n public error = (\n error: HttpError | ReactNode,\n options: { duration?: number } = {}\n ) =>\n this.notify({\n message: getErrorAlertMessage(error),\n type: \"error\",\n duration: !options.duration ? 3000 : options.duration\n });\n\n public info = (message: ReactNode, options: { duration?: number } = {}) =>\n this.notify({\n message,\n type: \"info\",\n duration: options.duration\n });\n\n public success = (message: ReactNode, options: { duration?: number } = {}) =>\n this.notify({\n message,\n type: \"success\",\n duration: options.duration\n });\n\n public warn = (message: ReactNode, options: { duration?: number } = {}) =>\n this.notify({\n message,\n type: \"warning\",\n duration: options.duration\n });\n}\n","import { config } from \"@libs/config/config\";\nimport { DeploymentStore } from \"./deployment-store/DeploymentStore\";\nimport { FeedbackStore } from \"./FeedbackStore\";\n\nexport interface IRootStore {\n feedback: FeedbackStore;\n deployment: DeploymentStore;\n}\n\nexport class RootStore implements IRootStore {\n constructor() {\n this.feedback = new FeedbackStore({\n notificationDuration: config.notificationDuration\n });\n\n this.deployment = new DeploymentStore();\n }\n\n public readonly feedback: FeedbackStore;\n public readonly deployment: DeploymentStore;\n}\n","import { createContext, PropsWithChildren, useContext } from \"react\";\nimport { IRootStore, RootStore } from \"./RootStore\";\n\nconst rootStore = new RootStore();\nconst StoreContext = createContext(rootStore);\nexport const StoresProvider = ({ children }: PropsWithChildren) => {\n return (\n {children}\n );\n};\n\nexport const useRootStore = () => useContext(StoreContext);\n"],"names":["DeploymentAction","DeploymentStatus","DeploymentLogLevel","DeploymentStore","__publicField","observable","tenants","runInAction","action","mutation","data","id","newGuid","deployment","DateTime","endTime","updated","mutateResult","e","result","level","message","DATE_FORMATS","text","updateText","tenantId","prosDbArgs","timestamp","desiredData","downloadData","installData","updateData","pingArgs","log","logs","status","_deployments","makeObservable","computed","FeedbackStore","config","key","notification","x","args","error","options","getErrorAlertMessage","RootStore","rootStore","StoreContext","createContext","StoresProvider","children","useRootStore","useContext"],"mappings":"kTASY,IAAAA,GAAAA,IACVA,EAAA,kBAAoB,oBACpBA,EAAA,4BAA8B,8BAC9BA,EAAA,2BAA6B,6BAC7BA,EAAA,0BAA4B,4BAC5BA,EA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