{ "version": 3, "sources": ["src/app/fax/models/fax.models.ts", "src/app/fax/services/fax.service.ts"], "sourcesContent": ["import { Contact } from '@app/contacts/models/contact';\n\nexport enum CoverPageOptions {\n None = 'none',\n Compose = 'compose',\n File = 'file',\n}\n\nexport enum SentFaxStatus {\n Answered = 'answered',\n Pending = 'pending',\n Success = 'success',\n Failed = 'failed',\n Error = 'error',\n}\n\nexport interface SendFaxData {\n coverPage: CoverPageOptions;\n coverPageText: string | undefined;\n coverPageUrl: FaxUrlResponse | undefined;\n urls: FaxUrlResponse[];\n callerId: string;\n destination: string;\n}\n\nexport const ALLOWED_FAX_FILES: string[] = ['.html', '.pdf', '.doc', '.docx', '.jpg', '.png', '.tiff', '.txt'];\n\nexport interface FaxMessage {\n id: string;\n caller_id: string;\n destination: number;\n created_by?: string;\n created_at: string;\n pages: number;\n pdf?: string;\n thumbnail?: string;\n confirmation?: string;\n status: string;\n transcription?: string;\n direction: 'inbound' | 'outbound';\n alias?: string;\n unread: boolean | false;\n contact?: Contact;\n read?: boolean;\n}\n\nexport interface FaxMessageResponse {\n data: FaxMessage[];\n links: FaxLinks;\n}\n\nexport interface FaxLinks {\n first?: string;\n last?: string;\n prev?: string | undefined;\n next: string | null;\n}\n\nexport const AllLocalFaxNumber: LocalFaxNumber = {\n number: 'all',\n};\n\nexport interface ListFaxNumbersResponse {\n success: boolean;\n message: string;\n data: LocalFaxNumber[];\n}\n\nexport interface LocalFaxNumber {\n number: string;\n callback_url?: string[];\n email_address?: string[];\n description?: string;\n shared?: boolean;\n}\n\nexport interface FaxUrlResponse {\n filename: string;\n key: string;\n url: string;\n}\n", "import { HttpClient } from '@angular/common/http';\nimport { Injectable } from '@angular/core';\nimport { NavigationEnd, PRIMARY_OUTLET, Router, UrlSegment } from '@angular/router';\nimport { EventName } from '@app/core/models/event-bus.models';\nimport { SnackBarType } from '@app/core/models/snack-bar-data.model';\nimport { BaseStateService } from '@app/core/services/base.state.service';\nimport { EventBusService } from '@app/core/services/event-bus.service';\nimport { LocalStorageService } from '@app/core/services/local-storage.service';\nimport { SnackbarService } from '@app/core/services/snack-bar.service';\nimport { WsService } from '@app/core/services/ws.service';\nimport { NotificationKeyBackend } from '@app/preferences/models/settings.models';\nimport { NotificationService } from '@app/preferences/services/notification.service';\nimport { environment } from '@environment/environment';\nimport { saveAs } from 'file-saver-es';\nimport {\n BehaviorSubject,\n catchError,\n filter,\n finalize,\n firstValueFrom,\n forkJoin,\n map,\n Observable,\n of,\n tap,\n} from 'rxjs';\n\nimport {\n AllLocalFaxNumber,\n FaxLinks,\n FaxMessage,\n FaxMessageResponse,\n FaxUrlResponse,\n ListFaxNumbersResponse,\n LocalFaxNumber,\n} from '../models/fax.models';\n\nexport type DataLoadState = 'initial' | 'loading' | 'loaded';\nexport const DEFAULT_FAX_CALLER_ID = '13214246840';\n\n@Injectable({\n providedIn: 'root',\n})\nexport class FaxService extends BaseStateService {\n // USE WRONG ONE WHICH WILL BE REPLACED LATER\n path = '';\n protected override baseUrl = `${environment.faxHubGateway}/{me}/faxes`;\n\n public sendingSubject = new BehaviorSubject(false);\n public sending$ = this.sendingSubject.asObservable();\n\n public readonly dataLoadStateSubject = new BehaviorSubject('initial');\n public readonly dataLoadState$ = this.dataLoadStateSubject.asObservable();\n\n public readonly localFaxNumbersSubject = new BehaviorSubject(null);\n public readonly localFaxNumbers$ = this.localFaxNumbersSubject.asObservable();\n public readonly hasLocalFaxNumbersSubject = new BehaviorSubject(false);\n public readonly hasLocalFaxNumbers$ = this.hasLocalFaxNumbersSubject.asObservable();\n\n /**\n * Every time our URL changes (i.e. when we receive a `NavigationEnd` event),\n * update the selectedLocalNumber based on whatever is in the url. If the url contains\n * a number that doesn't belong to the user, set the value to undefined.\n */\n public readonly selectedFaxLocalNumberSubject = new BehaviorSubject(null);\n public readonly selectedFaxLocalNumber$ = this.selectedFaxLocalNumberSubject.asObservable();\n\n public faxBlobPdfData: Map = new Map();\n // Maps message id to message object.\n private faxMessageMap: Map = new Map();\n\n private currentUrl: string;\n private faxLinks: Map = new Map();\n\n // ========== Getters / Setters ==========\n\n public get allLocalNumber(): LocalFaxNumber {\n return AllLocalFaxNumber;\n }\n\n // ========== Lifecycle ===========\n\n constructor(\n httpClient: HttpClient,\n private wsService: WsService,\n eventBusService: EventBusService,\n private router: Router,\n private snackbar: SnackbarService,\n private notificationService: NotificationService,\n private storage: LocalStorageService\n ) {\n super(httpClient);\n\n eventBusService.on(EventName.Logout, () => {\n this.dataLoadStateSubject.next('initial');\n this.localFaxNumbersSubject.next(null);\n this.selectedFaxLocalNumberSubject.next(null);\n });\n\n const selectedFaxLocalNumberStorageKey = 'selectedFaxLocalNumberStorageKey';\n const lastStoredLocalNumber = this.storage.get(selectedFaxLocalNumberStorageKey);\n if (lastStoredLocalNumber) {\n this.selectedFaxLocalNumberSubject.next(lastStoredLocalNumber);\n }\n\n // Always persist the selectedLocalNumber to localStorage\n this.selectedFaxLocalNumber$.subscribe((value) => {\n if (value === null) {\n this.storage.delete(selectedFaxLocalNumberStorageKey);\n } else {\n this.storage.set(selectedFaxLocalNumberStorageKey, value);\n }\n });\n\n this.localFaxNumbers$.subscribe((localNumbers) => {\n const hasLocalNumbers = (localNumbers && localNumbers.length > 0) || false;\n this.hasLocalFaxNumbersSubject.next(hasLocalNumbers);\n });\n\n // Observe outbound messages\n this.wsService.socket.on('FaxSent', (message: FaxMessage) => {\n this.processFaxMessage(message, 'outbound');\n });\n\n // Observe inbound messages\n this.wsService.socket.on('FaxReceived', (message: FaxMessage) => {\n this.processFaxMessage(message, 'inbound');\n this.snackbar.open('New Fax Received');\n this.notificationService.showNotification(\n { title: 'New fax received', body: message.contact?.fullName ? `from ${message.contact?.fullName}` : '' },\n NotificationKeyBackend['Incoming Fax']\n );\n });\n\n router.events\n .pipe(\n filter((event) => event instanceof NavigationEnd),\n map((event) => event as NavigationEnd)\n )\n .subscribe((navigationEndEvent) => {\n this.currentUrl = navigationEndEvent.url;\n this.setLocalNumberFromUrl();\n });\n }\n\n getFaxes(direction: FaxMessage['direction']): Observable {\n if (this.faxLinks.get(direction)?.next === null) {\n return of([]);\n }\n const link = this.generateFaxLink(direction);\n return this.get(`${link}`).pipe(\n catchError(() => {\n return of({ data: [], links: { next: null } });\n }),\n\n map((faxMessages) => {\n return faxMessages.data.map((faxMessage) => {\n this.faxLinks.set(direction, faxMessages.links);\n const msg = { ...faxMessage, direction: direction };\n this.faxMessageMap.set(msg.id, msg);\n return msg;\n });\n })\n );\n }\n\n private generateFaxLink(direction: FaxMessage['direction']) {\n return this.faxLinks.has(direction) ? `${direction}${this.faxLinks.get(direction)?.next}` : `${direction}`;\n }\n\n getLocalNumbers(): Observable {\n return this.get(`numberlist`);\n }\n\n override getHttpData(): Observable {\n this.dataLoadStateSubject.next('loading');\n return forkJoin([this.getFaxes('inbound'), this.getFaxes('outbound'), this.getLocalNumbers()]).pipe(\n map(([inboundFaxes, outboundFaxes, localNumbers]) => {\n console.log(`fax inbound: got ${inboundFaxes.length} messages`);\n console.log(`fax outbound: got ${outboundFaxes.length} messages`);\n console.log(`fax localNumbers: ${localNumbers.data.length}`);\n this.localFaxNumbersSubject.next(localNumbers.data);\n this.setLocalNumberFromUrl();\n return [...outboundFaxes, ...inboundFaxes];\n }),\n tap(() => {\n this.dataLoadStateSubject.next('loaded');\n })\n );\n }\n\n private setLocalNumberFromUrl() {\n const tree = this.router.parseUrl(this.currentUrl);\n const urlSegments: UrlSegment[] | undefined = tree.root.children[PRIMARY_OUTLET]?.segments;\n if (!urlSegments) {\n return;\n }\n\n const faxSegmentIndex = urlSegments.findIndex((segment) => segment.path === 'fax');\n if (faxSegmentIndex !== -1 && faxSegmentIndex + 1 < urlSegments.length) {\n const numberInPath = urlSegments[faxSegmentIndex + 1];\n const localNumber = [this.allLocalNumber, ...(this.localFaxNumbersSubject.value || [])].find(\n (number) => number.number === numberInPath.path\n );\n console.log(`fax: setting local number with value ${localNumber?.number}`);\n this.selectedFaxLocalNumberSubject.next(localNumber || this.allLocalNumber);\n }\n }\n\n private processFaxMessage(message: FaxMessage, direction: 'inbound' | 'outbound') {\n const normalizedFaxMessage: FaxMessage = {\n ...message,\n direction: direction,\n unread: direction == 'inbound',\n };\n\n if (this.faxMessageMap.has(message.id)) {\n this.faxMessageMap.set(message.id, normalizedFaxMessage);\n } else {\n // move the new fax on the top of the direction list\n this.faxMessageMap = new Map([[message.id, normalizedFaxMessage], ...this.faxMessageMap]);\n }\n this.setData([...this.faxMessageMap.values()]);\n }\n\n loadFaxMessages(tabSelected: number) {\n const direction: FaxMessage['direction'] = tabSelected === 0 ? 'inbound' : 'outbound';\n this.getFaxes(direction).subscribe(() => {\n this.setData([...this.faxMessageMap.values()]);\n });\n }\n\n setUnreadMark(message: FaxMessage) {\n if (this.faxMessageMap.has(message.id)) {\n const normalizedFaxMessage: FaxMessage = {\n ...message,\n unread: false,\n };\n this.faxMessageMap.set(message.id, normalizedFaxMessage);\n this.setData([...this.faxMessageMap.values()]);\n }\n }\n\n getThumbnail(id: string) {\n return this.get(`${id}/thumbnail`, {\n responseType: 'blob' as 'json',\n }).pipe(\n tap((response) => {\n return response;\n })\n );\n }\n\n downloadPDF(id: string) {\n return this.get(`${id}/pdf`, {\n responseType: 'blob' as 'json',\n }).pipe(\n tap((response) => {\n this.faxBlobPdfData.set(id, response);\n return response;\n })\n );\n }\n\n downloadConfirmation(id: string) {\n return this.get(`${id}/confirmation`, {\n responseType: 'blob' as 'json',\n }).pipe(\n tap((response) => {\n return response;\n })\n );\n }\n\n public deleteFax(id: string) {\n return this.post(`${id}/delete`, {}).pipe(\n map((response) => {\n if (response.success) {\n //remove deleted item from fax list\n this.removeItem(id);\n this.faxMessageMap.delete(id);\n } else {\n console.warn(response.message);\n }\n return response;\n })\n );\n }\n\n downloadFax(id) {\n const isLoaded = this.faxBlobPdfData.get(id);\n if (isLoaded) {\n saveAs(isLoaded, `fax-${id}.pdf`);\n } else {\n this.downloadPDF(id).subscribe((response) => {\n saveAs(response, `fax-${id}.pdf`);\n });\n }\n }\n\n downloadFaxConfirmation(id) {\n this.downloadConfirmation(id).subscribe((response) => {\n saveAs(response, `fax-confrmation${id}.pdf`);\n });\n }\n\n printFax(id) {\n const isLoaded = this.faxBlobPdfData.get(id);\n if (isLoaded) {\n const pdfFile = new Blob([isLoaded], { type: 'application/pdf' });\n window.open(URL.createObjectURL(pdfFile), '');\n } else {\n this.downloadPDF(id).subscribe((response) => {\n const pdfFile = new Blob([response], { type: 'application/pdf' });\n window.open(URL.createObjectURL(pdfFile), '');\n });\n }\n }\n\n async addFaxUrl(file: File): Promise {\n try {\n const response = await firstValueFrom(\n this.httpClient.post(`${environment.faxHubGateway}/{me}/upload/url`, {\n filename: file.name,\n type: 'fax',\n access: 'private',\n })\n );\n await firstValueFrom(this.httpClient.put(response.url, file));\n return response;\n } catch (error) {\n if (error.message) {\n this.snackbar.open(error.message, undefined, { panelClass: SnackBarType.ERROR });\n }\n throw new Error('failed to add fax url');\n }\n }\n\n sendFax(formData: FormData): Observable {\n this.sendingSubject.next(true);\n return this.post('send', formData).pipe(finalize(() => this.sendingSubject.next(false)));\n }\n\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n protected override updateField(id: string, field: string, state: string | number | boolean): void {\n // Do nothing. We don't want behavior from the base class.\n // TODO: Remove reliance on base class for this service\n }\n\n // ========== Helpers ==========\n public isAllLocalNumber(number: string | LocalFaxNumber | null | undefined) {\n if (!number) {\n return false;\n }\n\n return typeof number === 'string'\n ? number === this.allLocalNumber.number\n : number.number === this.allLocalNumber.number;\n }\n\n isAllDataLoaded(direction: FaxMessage['direction']) {\n return this.faxLinks.get(direction)?.next === null;\n }\n}\n\nclass FaxDeleteResponse {\n success: boolean;\n message: string;\n}\n"], "mappings": "kVAEA,IAAYA,EAAZ,SAAYA,EAAgB,CAC1BA,OAAAA,EAAA,KAAA,OACAA,EAAA,QAAA,UACAA,EAAA,KAAA,OAHUA,CAIZ,EAJYA,GAAgB,CAAA,CAAA,EAMhBC,EAAZ,SAAYA,EAAa,CACvBA,OA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GhC,OAAS,IAChD,iDA/TWnC,GAAUwJ,EAAAC,CAAA,EAAAD,EAAAE,CAAA,EAAAF,EAAAG,CAAA,EAAAH,EAAAI,CAAA,EAAAJ,EAAAK,CAAA,EAAAL,EAAAM,CAAA,EAAAN,EAAAO,CAAA,CAAA,CAAA,CAAA,iCAAV/J,EAAUgK,QAAVhK,EAAUiK,UAAAC,WAFT,MAAM,CAAA,CAAA,SAEPlK,CAAW,GAAA", "names": ["CoverPageOptions", "SentFaxStatus", "ALLOWED_FAX_FILES", "AllLocalFaxNumber", "number", "DEFAULT_FAX_CALLER_ID", "FaxService", "BaseStateService", "allLocalNumber", "AllLocalFaxNumber", "constructor", "httpClient", "wsService", "eventBusService", "router", "snackbar", "notificationService", "storage", "path", "baseUrl", "environment", "faxHubGateway", "sendingSubject", "BehaviorSubject", "sending$", "asObservable", "dataLoadStateSubject", "dataLoadState$", "localFaxNumbersSubject", "localFaxNumbers$", "hasLocalFaxNumbersSubject", "hasLocalFaxNumbers$", "selectedFaxLocalNumberSubject", "selectedFaxLocalNumber$", "faxBlobPdfData", "Map", "faxMessageMap", "faxLinks", "on", "EventName", "Logout", "next", "selectedFaxLocalNumberStorageKey", "lastStoredLocalNumber", "get", "subscribe", "value", "delete", "set", "localNumbers", "hasLocalNumbers", "length", "socket", "message", "processFaxMessage", "open", "showNotification", "title", "body", "contact", "fullName", "NotificationKeyBackend", "events", "pipe", "filter", "event", "NavigationEnd", "map", "navigationEndEvent", "currentUrl", "url", "setLocalNumberFromUrl", "getFaxes", "direction", "of", "link", "generateFaxLink", "catchError", "data", "links", "faxMessages", "faxMessage", "msg", "__spreadProps", "__spreadValues", "id", "has", "getLocalNumbers", "getHttpData", "forkJoin", "inboundFaxes", "outboundFaxes", "console", "log", "tap", "urlSegments", "parseUrl", "root", "children", "PRIMARY_OUTLET", "segments", "faxSegmentIndex", "findIndex", "segment", "numberInPath", "localNumber", "find", "number", "normalizedFaxMessage", "unread", "setData", "values", "loadFaxMessages", "tabSelected", "setUnreadMark", "getThumbnail", "responseType", "response", "downloadPDF", "downloadConfirmation", "deleteFax", "post", "success", "removeItem", "warn", "downloadFax", "isLoaded", "saveAs", "downloadFaxConfirmation", "printFax", "pdfFile", "Blob", "type", "window", "URL", "createObjectURL", "addFaxUrl", "file", "__async", "firstValueFrom", "filename", "name", "access", "put", "error", "undefined", "panelClass", "SnackBarType", "ERROR", "Error", "sendFax", "formData", "finalize", "updateField", "field", "state", "isAllLocalNumber", "isAllDataLoaded", "\u0275\u0275inject", "HttpClient", "WsService", "EventBusService", "Router", "SnackbarService", "NotificationService", "LocalStorageService", "factory", "\u0275fac", "providedIn"] }