@o3r/application
Version: 
This module provides development help to monitor your Otter Application
1 lines • 21.6 kB
Source Map (JSON)
{"version":3,"file":"o3r-application.mjs","sources":["../../src/browser-preference/helper.ts","../../src/devkit/application-devkit.interface.ts","../../src/devkit/application-devtools.token.ts","../../src/devkit/application-devtools.service.ts","../../src/devkit/application-devtools.console.service.ts","../../src/devkit/application-devtools.message.service.ts","../../src/devkit/application-devtools.module.ts","../../src/o3r-application.ts"],"sourcesContent":["/**\n * Method that returns the setting of the user regarding animations.\n * This setting is generally set in the Operating System settings, and it is used by browsers.\n * Refer to: https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion\n */\nexport function prefersReducedMotion(): boolean {\n  const mediaQueryList = window.matchMedia('(prefers-reduced-motion)');\n\n  return mediaQueryList.matches;\n}\n","import type {\n  ConnectContentMessage,\n  DevtoolsCommonOptions,\n  MessageDataTypes,\n  OtterMessageContent,\n  RequestMessagesContentMessage,\n} from '@o3r/core';\n\nexport interface ApplicationDevtoolsServiceOptions extends DevtoolsCommonOptions {\n  /**\n   * Application name\n   */\n  appName?: string;\n  /**\n   * CSS classname applied to an HTML tag to hide it, ignore it, in the e2e visual testing process\n   */\n  e2eIgnoreClass?: string;\n}\n\n/**\n * Session information used to track all the calls done by one or several APIs of the SDK.\n */\nexport interface SessionInformation {\n  /**\n   * The session ID\n   */\n  id: string;\n  /**\n   * The generated time\n   */\n  generatedTime: Date;\n}\n\n/** Information relative loaded application */\nexport interface ApplicationInformation {\n  /**\n   * Application name\n   */\n  appName: string;\n  /** Application Version */\n  appVersion: string;\n  /**\n   * Session Information\n   * @note This is a session ID will be provided only with the Amadeus Otter implementation of the application package.\n   */\n  session?: SessionInformation;\n  /**\n   * Log Link\n   * @note This a link to Alf logs, it will be provided only with the Amadeus Otter implementation of the application package.\n   */\n  logLink?: string;\n  /** Is Production Environment */\n  isProduction: boolean;\n}\n\n/** Toggle Visual Testing */\nexport interface ToggleVisualTestingMessage extends OtterMessageContent<'toggleVisualTesting'> {\n  /** Toggle the visual testing mode */\n  toggle?: boolean;\n}\n\n/** Application Information Message Content */\nexport interface ApplicationInformationContentMessage extends ApplicationInformation, OtterMessageContent<'applicationInformation'> {\n}\n\n/** State selection message */\nexport interface StateSelectionContentMessage extends OtterMessageContent<'stateSelection'> {\n  /** Name of the state */\n  stateName: string;\n  /** Color of the state */\n  stateColor: string;\n  /** Contrast color of the state */\n  stateColorContrast: string;\n}\n\n/** Unselect state message */\nexport interface UnselectStateContentMessage extends OtterMessageContent<'unselectState'> {}\n\ntype ApplicationMessageContents = ApplicationInformationContentMessage\n  | StateSelectionContentMessage\n  | UnselectStateContentMessage\n  | ToggleVisualTestingMessage;\n\n/** List of possible DataTypes for Application messages */\nexport type ApplicationMessageDataTypes = MessageDataTypes<ApplicationMessageContents>;\n\n/** List of all messages for application purpose */\nexport type AvailableApplicationMessageContents = ApplicationMessageContents\n  | ConnectContentMessage\n  | RequestMessagesContentMessage<ApplicationMessageDataTypes>;\n\n/**\n * Determine if the given message is a Application message\n * @param message message to check\n */\nexport const isApplicationMessage = (message: any): message is AvailableApplicationMessageContents => {\n  return message && (\n    message.dataType === 'toggleVisualTesting'\n    || message.dataType === 'stateSelection'\n    || message.dataType === 'applicationInformation'\n    || message.dataType === 'unselectState'\n    || message.dataType === 'requestMessages'\n    || message.dataType === 'connect');\n};\n","import {\n  InjectionToken,\n} from '@angular/core';\nimport {\n  ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\n\nexport const OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS: Readonly<ApplicationDevtoolsServiceOptions> = {\n  isActivatedOnBootstrap: false\n} as const;\n\nexport const OTTER_APPLICATION_DEVTOOLS_OPTIONS = new InjectionToken<ApplicationDevtoolsServiceOptions>('Otter Application Devtools options');\n","import {\n  DOCUMENT,\n  inject,\n  Injectable,\n} from '@angular/core';\nimport {\n  type Dataset,\n  isProductionEnvironment,\n} from '@o3r/core';\nimport {\n  ENVIRONMENT_CONFIG_TOKEN,\n} from '@o3r/routing';\nimport type {\n  ApplicationInformation,\n} from './application-devkit.interface';\nimport {\n  OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({ providedIn: 'root' })\nexport class OtterApplicationDevtools {\n  private readonly options = inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });\n  private readonly document = inject(DOCUMENT, { optional: true });\n  private readonly env = inject(ENVIRONMENT_CONFIG_TOKEN, { optional: true });\n\n  public getApplicationInformation(): ApplicationInformation {\n    return {\n      appName: this.options?.appName || 'unknown',\n      appVersion: this.env?.APP_VERSION || 'unknown',\n      isProduction: isProductionEnvironment(this.document?.body.dataset as Dataset)\n    };\n  }\n}\n","/* eslint-disable no-console -- purpose of the service is to log in the console */\nimport {\n  inject,\n  Injectable,\n} from '@angular/core';\nimport type {\n  DevtoolsServiceInterface,\n  WindowWithDevtools,\n} from '@o3r/core';\nimport {\n  ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n  OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n  OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n  OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class ApplicationDevtoolsConsoleService implements DevtoolsServiceInterface {\n  /** Name of the Window property to access to the devtools */\n  public static readonly windowModuleName = 'application';\n\n  private readonly applicationDevtools = inject(OtterApplicationDevtools);\n  private readonly options: ApplicationDevtoolsServiceOptions;\n\n  constructor() {\n    const options = inject<ApplicationDevtoolsServiceOptions>(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true });\n\n    this.options = { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options };\n\n    if (this.options.isActivatedOnBootstrap) {\n      this.activate();\n    }\n  }\n\n  /** @inheritDoc */\n  public activate() {\n    const windowWithDevtools: WindowWithDevtools = window;\n    windowWithDevtools._OTTER_DEVTOOLS_ ||= {};\n    windowWithDevtools._OTTER_DEVTOOLS_[ApplicationDevtoolsConsoleService.windowModuleName] = this;\n\n    console.info(`Otter Application Devtools is now accessible via the _OTTER_DEVTOOLS_.${ApplicationDevtoolsConsoleService.windowModuleName} variable`);\n  }\n\n  /** Display the information relative to the running application */\n  public displayApplicationInfo() {\n    console.info('Application info', this.applicationDevtools.getApplicationInformation());\n  }\n}\n","import {\n  DestroyRef,\n  DOCUMENT,\n  inject,\n  Injectable,\n} from '@angular/core';\nimport {\n  takeUntilDestroyed,\n} from '@angular/core/rxjs-interop';\nimport {\n  DevtoolsServiceInterface,\n  filterMessageContent,\n  sendOtterMessage,\n} from '@o3r/core';\nimport {\n  LoggerService,\n} from '@o3r/logger';\nimport {\n  fromEvent,\n} from 'rxjs';\nimport {\n  type ApplicationDevtoolsServiceOptions,\n  type ApplicationMessageDataTypes,\n  type AvailableApplicationMessageContents,\n  isApplicationMessage,\n  type StateSelectionContentMessage,\n} from './application-devkit.interface';\nimport {\n  OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n  OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n  OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\nconst OTTER_STATE_RIBBON_ID = 'otter-devtools-state-ribbon';\n\n@Injectable({\n  providedIn: 'root'\n})\nexport class ApplicationDevtoolsMessageService implements DevtoolsServiceInterface {\n  private readonly document = inject(DOCUMENT);\n  private readonly options: ApplicationDevtoolsServiceOptions;\n  private readonly sendMessage = sendOtterMessage<AvailableApplicationMessageContents>;\n  private readonly destroyRef = inject(DestroyRef);\n  private readonly logger = inject(LoggerService);\n  private readonly applicationDevtools = inject(OtterApplicationDevtools);\n\n  constructor() {\n    this.options = {\n      ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n      ...inject(OTTER_APPLICATION_DEVTOOLS_OPTIONS, { optional: true })\n    };\n\n    if (this.options.isActivatedOnBootstrap) {\n      this.activate();\n    }\n  }\n\n  private sendApplicationInformation() {\n    this.sendMessage('applicationInformation', this.applicationDevtools.getApplicationInformation());\n  }\n\n  /**\n   * Function to connect the plugin to the Otter DevTools extension\n   */\n  private connectPlugin() {\n    this.logger.debug('Otter DevTools is plugged to application service of the application');\n    void this.sendApplicationInformation();\n  }\n\n  /**\n   * Function to trigger a re-send a requested messages to the Otter Chrome DevTools extension\n   * @param only restricted list of messages to re-send\n   */\n  private handleReEmitRequest(only?: ApplicationMessageDataTypes[]) {\n    if (!only || only.includes('applicationInformation')) {\n      this.sendApplicationInformation();\n    }\n  }\n\n  /**\n   * Function to handle the incoming messages from Otter Chrome DevTools extension\n   * @param message\n   */\n  private async handleEvents(message: AvailableApplicationMessageContents) {\n    this.logger.debug('Message handling by the application service', message);\n\n    switch (message.dataType) {\n      case 'connect': {\n        this.connectPlugin();\n        break;\n      }\n      case 'requestMessages': {\n        this.handleReEmitRequest(message.only);\n        break;\n      }\n      case 'toggleVisualTesting': {\n        await this.toggleVisualTestingRender(message.toggle);\n        break;\n      }\n      case 'stateSelection': {\n        this.onStateSelection(message);\n        break;\n      }\n      case 'unselectState': {\n        this.unselectState();\n        break;\n      }\n      default: {\n        this.logger.warn('Message ignored by the application service', message);\n      }\n    }\n  }\n\n  private unselectState() {\n    const ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n    if (ribbonElement) {\n      ribbonElement.remove();\n    }\n  }\n\n  private onStateSelection(message: StateSelectionContentMessage) {\n    let ribbonElement = this.document.body.querySelector<HTMLDivElement>(`#${OTTER_STATE_RIBBON_ID}`);\n    if (!ribbonElement) {\n      ribbonElement = this.document.createElement('div');\n      ribbonElement.id = OTTER_STATE_RIBBON_ID;\n      this.document.body.append(ribbonElement);\n    }\n    if (message.stateName) {\n      ribbonElement.innerHTML = message.stateName;\n      ribbonElement.style.background = message.stateColor;\n      ribbonElement.style.color = message.stateColorContrast;\n      ribbonElement.style.position = 'fixed';\n      ribbonElement.style.bottom = '0';\n      ribbonElement.style.right = '0';\n      ribbonElement.style.transform = 'translate(calc(100% * (1 - cos(45deg)))) rotate(-45deg)';\n      ribbonElement.style.transformOrigin = 'bottom left';\n      ribbonElement.style.clipPath = 'inset(0 -100%)';\n      ribbonElement.style.boxShadow = `0px 0px 0px 999px ${message.stateColor}`;\n    } else {\n      ribbonElement.style.display = 'none';\n    }\n  }\n\n  /**\n   * Toggle visual testing rendering\n   * @param enabled activate or deactivate the visual testing mode\n   */\n  private async toggleVisualTestingRender(enabled?: boolean) {\n    try {\n      const visualTestUtils = await import('@o3r/testing/visual-test/utils');\n      const isEnabled = enabled ?? visualTestUtils.isVisualTestingEnabled();\n      visualTestUtils.toggleVisualTestingRender(isEnabled);\n    } catch (err) {\n      this.logger.warn('Visual testing utilities are not available:', err);\n    }\n  }\n\n  /** @inheritDoc */\n  public activate() {\n    fromEvent(window, 'message').pipe(\n      takeUntilDestroyed(this.destroyRef),\n      filterMessageContent(isApplicationMessage)\n    ).subscribe((e) => this.handleEvents(e));\n    import('@o3r/testing/visual-test/utils')\n      .then((visualTestUtils) => visualTestUtils.prepareVisualTesting(this.options.e2eIgnoreClass))\n      .catch((err) => this.logger.warn('Visual testing utilities are not available:', err));\n    this.sendApplicationInformation();\n  }\n}\n","import {\n  ModuleWithProviders,\n  NgModule,\n} from '@angular/core';\nimport type {\n  ApplicationDevtoolsServiceOptions,\n} from './application-devkit.interface';\nimport {\n  ApplicationDevtoolsConsoleService,\n} from './application-devtools.console.service';\nimport {\n  ApplicationDevtoolsMessageService,\n} from './application-devtools.message.service';\nimport {\n  OtterApplicationDevtools,\n} from './application-devtools.service';\nimport {\n  OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS,\n  OTTER_APPLICATION_DEVTOOLS_OPTIONS,\n} from './application-devtools.token';\n\n@NgModule({\n  providers: [\n    { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS },\n    ApplicationDevtoolsMessageService,\n    ApplicationDevtoolsConsoleService,\n    OtterApplicationDevtools\n  ]\n})\nexport class ApplicationDevtoolsModule {\n  /**\n   * Initialize Otter Devtools\n   * @param options\n   */\n  public static instrument(options: Partial<ApplicationDevtoolsServiceOptions>): ModuleWithProviders<ApplicationDevtoolsModule> {\n    return {\n      ngModule: ApplicationDevtoolsModule,\n      providers: [\n        { provide: OTTER_APPLICATION_DEVTOOLS_OPTIONS, useValue: { ...OTTER_APPLICATION_DEVTOOLS_DEFAULT_OPTIONS, ...options }, multi: false },\n        ApplicationDevtoolsMessageService,\n        ApplicationDevtoolsConsoleService,\n        OtterApplicationDevtools\n      ]\n    };\n  }\n}\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public_api';\n"],"names":[],"mappings":";;;;;;;;AAAA;;;;AAIG;SACa,oBAAoB,GAAA;IAClC,MAAM,cAAc,GAAG,MAAM,CAAC,UAAU,CAAC,0BAA0B,CAAC;IAEpE,OAAO,cAAc,CAAC,OAAO;AAC/B;;ACkFA;;;AAGG;AACI,MAAM,oBAAoB,GAAG,CAAC,OAAY,KAAoD;AACnG,IAAA,OAAO,OAAO,KACZ,OAAO,CAAC,QAAQ,KAAK;WAClB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;WACrB,OAAO,CAAC,QAAQ,KAAK;AACrB,WAAA,OAAO,CAAC,QAAQ,KAAK,SAAS,CAAC;AACtC;;AChGO,MAAM,0CAA0C,GAAgD;AACrG,IAAA,sBAAsB,EAAE;;MAGb,kCAAkC,GAAG,IAAI,cAAc,CAAoC,oCAAoC;;MCS/H,wBAAwB,CAAA;AADrC,IAAA,WAAA,GAAA;QAEmB,IAAA,CAAA,OAAO,GAAG,MAAM,CAAC,kCAAkC,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;QACxE,IAAA,CAAA,QAAQ,GAAG,MAAM,CAAC,Q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