@anglr/common 17.0.0 → 18.0.0-beta.20230823095018
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.
- package/changelog.md +125 -0
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js +7 -22
- package/es2022/floating-ui/src/services/floatingUiDomPosition.service.js.map +1 -1
- package/es2022/src/index.js +4 -3
- package/es2022/src/index.js.map +1 -1
- package/es2022/src/modules/castPipes/pipes/castType/castType.pipe.js.map +1 -1
- package/es2022/src/modules/logger/components/console/console.component.animations.js.map +1 -0
- package/es2022/src/modules/logger/components/console/console.component.js +106 -0
- package/es2022/src/modules/logger/components/console/console.component.js.map +1 -0
- package/es2022/src/modules/logger/components/index.js +3 -0
- package/es2022/src/modules/logger/components/index.js.map +1 -0
- package/es2022/src/modules/logger/decorators/index.js +2 -0
- package/es2022/src/modules/logger/decorators/index.js.map +1 -0
- package/es2022/src/modules/logger/decorators/loggerSink.decorator.js +28 -0
- package/es2022/src/modules/logger/decorators/loggerSink.decorator.js.map +1 -0
- package/es2022/src/modules/logger/index.js +7 -0
- package/es2022/src/modules/logger/index.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/index.js +7 -0
- package/es2022/src/modules/logger/interfaces/index.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerConfiguration.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerConfiguration.interface.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerConsoleComponent.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerConsoleComponent.interface.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerEnricher.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerEnricher.interface.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerFilter.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerFilter.interface.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerRest.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerRest.interface.js.map +1 -0
- package/es2022/src/modules/logger/interfaces/loggerSink.interface.js +2 -0
- package/es2022/src/modules/logger/interfaces/loggerSink.interface.js.map +1 -0
- package/es2022/src/modules/logger/misc/index.js +5 -0
- package/es2022/src/modules/logger/misc/index.js.map +1 -0
- package/es2022/src/modules/logger/misc/providers.js +56 -0
- package/es2022/src/modules/logger/misc/providers.js.map +1 -0
- package/es2022/src/modules/logger/misc/tokens.js +11 -0
- package/es2022/src/modules/logger/misc/tokens.js.map +1 -0
- package/es2022/src/modules/logger/misc/types.js +2 -0
- package/es2022/src/modules/logger/misc/types.js.map +1 -0
- package/es2022/src/modules/logger/misc/utils.js +24 -0
- package/es2022/src/modules/logger/misc/utils.js.map +1 -0
- package/es2022/src/modules/logger/services/console/consoleComponent.sink.js +67 -0
- package/es2022/src/modules/logger/services/console/consoleComponent.sink.js.map +1 -0
- package/es2022/src/modules/logger/services/console/consoleComponentSink.options.js +31 -0
- package/es2022/src/modules/logger/services/console/consoleComponentSink.options.js.map +1 -0
- package/es2022/src/modules/logger/services/developmentConsoleSink/developmentConsole.sink.js +68 -0
- package/es2022/src/modules/logger/services/developmentConsoleSink/developmentConsole.sink.js.map +1 -0
- package/es2022/src/modules/logger/services/index.js +11 -0
- package/es2022/src/modules/logger/services/index.js.map +1 -0
- package/es2022/src/modules/logger/services/logLevelEnricher/logLevelEnricher.enricher.js +52 -0
- package/es2022/src/modules/logger/services/logLevelEnricher/logLevelEnricher.enricher.js.map +1 -0
- package/es2022/src/modules/logger/services/logger/logger.interface.js.map +1 -0
- package/es2022/src/modules/logger/services/logger/logger.service.js +107 -0
- package/es2022/src/modules/logger/services/logger/logger.service.js.map +1 -0
- package/es2022/src/modules/logger/services/rest/rest.sink.js +100 -0
- package/es2022/src/modules/logger/services/rest/rest.sink.js.map +1 -0
- package/es2022/src/modules/logger/services/rest/restSink.options.js +43 -0
- package/es2022/src/modules/logger/services/rest/restSink.options.js.map +1 -0
- package/es2022/src/modules/logger/services/subLoggerSink/subLogger.sink.js +46 -0
- package/es2022/src/modules/logger/services/subLoggerSink/subLogger.sink.js.map +1 -0
- package/es2022/src/modules/logger/services/timestampEnricher/timestamp.enricher.js +14 -0
- package/es2022/src/modules/logger/services/timestampEnricher/timestamp.enricher.js.map +1 -0
- package/es2022/src/modules/logger/types/index.js +4 -0
- package/es2022/src/modules/logger/types/index.js.map +1 -0
- package/es2022/src/modules/logger/types/logLevel.enum.js +35 -0
- package/es2022/src/modules/logger/types/logLevel.enum.js.map +1 -0
- package/es2022/src/modules/logger/types/loggerConfiguration.js +114 -0
- package/es2022/src/modules/logger/types/loggerConfiguration.js.map +1 -0
- package/es2022/src/modules/logger/types/loggerOptions.js +41 -0
- package/es2022/src/modules/logger/types/loggerOptions.js.map +1 -0
- package/es2022/src/modules/logger/types/messageLog.js +55 -0
- package/es2022/src/modules/logger/types/messageLog.js.map +1 -0
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js +13 -27
- package/es2022/src/services/permanentStorage/cookiePermanentStorage.service.js.map +1 -1
- package/es2022/src/services/permanentStorage/permanentStorage.interface.js.map +1 -1
- package/es2022/src/services/position/position.interface.js.map +1 -1
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js +5 -5
- package/es2022/src/services/stringLocalization/noStringLocalization.service.js.map +1 -1
- package/es2022/src/services/stringLocalization/stringLocalization.interface.js.map +1 -1
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js +5 -5
- package/es2022/src/services/temporaryStorage/memoryTemporaryStorage.service.js.map +1 -1
- package/es2022/src/services/temporaryStorage/temporaryStorage.interface.js.map +1 -1
- package/es2022/src/types/providers.js.map +1 -1
- package/es2022/src/types/tokens.js +7 -7
- package/es2022/src/types/tokens.js.map +1 -1
- package/es2022/store/src/index.js +1 -1
- package/es2022/store/src/index.js.map +1 -1
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js +13 -27
- package/es2022/store/src/services/permanentStorage/localPermanentStorage.service.js.map +1 -1
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js +11 -26
- package/es2022/store/src/services/temporaryStorage/sessionTemporaryStorage.service.js.map +1 -1
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts +1 -5
- package/floating-ui/src/services/floatingUiDomPosition.service.d.ts.map +1 -1
- package/package.json +4 -30
- package/readme.md +0 -2
- package/src/index.d.ts +4 -4
- package/src/index.d.ts.map +1 -1
- package/src/modules/castPipes/pipes/castType/castType.pipe.d.ts +1 -1
- package/src/modules/castPipes/pipes/castType/castType.pipe.d.ts.map +1 -1
- package/src/modules/logger/components/console/console.component.d.ts +56 -0
- package/src/modules/logger/components/console/console.component.d.ts.map +1 -0
- package/src/modules/logger/components/index.d.ts +3 -0
- package/src/modules/logger/components/index.d.ts.map +1 -0
- package/src/modules/logger/decorators/index.d.ts +2 -0
- package/{positions/src → src/modules/logger/decorators}/index.d.ts.map +1 -1
- package/src/modules/logger/decorators/loggerSink.decorator.d.ts +11 -0
- package/src/modules/logger/decorators/loggerSink.decorator.d.ts.map +1 -0
- package/src/modules/logger/index.d.ts +7 -0
- package/src/modules/logger/index.d.ts.map +1 -0
- package/src/modules/logger/interfaces/index.d.ts +7 -0
- package/src/modules/logger/interfaces/index.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerConfiguration.interface.d.ts +39 -0
- package/src/modules/logger/interfaces/loggerConfiguration.interface.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerConsoleComponent.interface.d.ts +36 -0
- package/src/modules/logger/interfaces/loggerConsoleComponent.interface.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerEnricher.interface.d.ts +19 -0
- package/src/modules/logger/interfaces/loggerEnricher.interface.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerFilter.interface.d.ts +13 -0
- package/src/modules/logger/interfaces/loggerFilter.interface.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerRest.interface.d.ts +29 -0
- package/src/modules/logger/interfaces/loggerRest.interface.d.ts.map +1 -0
- package/src/modules/logger/interfaces/loggerSink.interface.d.ts +35 -0
- package/src/modules/logger/interfaces/loggerSink.interface.d.ts.map +1 -0
- package/src/modules/logger/misc/index.d.ts +5 -0
- package/src/modules/logger/misc/index.d.ts.map +1 -0
- package/src/modules/logger/misc/providers.d.ts +25 -0
- package/src/modules/logger/misc/providers.d.ts.map +1 -0
- package/src/modules/logger/misc/tokens.d.ts +11 -0
- package/src/modules/logger/misc/tokens.d.ts.map +1 -0
- package/src/modules/logger/misc/types.d.ts +20 -0
- package/src/modules/logger/misc/types.d.ts.map +1 -0
- package/src/modules/logger/misc/utils.d.ts +15 -0
- package/src/modules/logger/misc/utils.d.ts.map +1 -0
- package/src/modules/logger/services/console/consoleComponent.sink.d.ts +38 -0
- package/src/modules/logger/services/console/consoleComponent.sink.d.ts.map +1 -0
- package/src/modules/logger/services/console/consoleComponentSink.options.d.ts +14 -0
- package/src/modules/logger/services/console/consoleComponentSink.options.d.ts.map +1 -0
- package/src/modules/logger/services/developmentConsoleSink/developmentConsole.sink.d.ts +18 -0
- package/src/modules/logger/services/developmentConsoleSink/developmentConsole.sink.d.ts.map +1 -0
- package/src/modules/logger/services/index.d.ts +11 -0
- package/src/modules/logger/services/index.d.ts.map +1 -0
- package/src/modules/logger/services/logLevelEnricher/logLevelEnricher.enricher.d.ts +12 -0
- package/src/modules/logger/services/logLevelEnricher/logLevelEnricher.enricher.d.ts.map +1 -0
- package/src/modules/logger/services/logger/logger.interface.d.ts +42 -0
- package/src/modules/logger/services/logger/logger.interface.d.ts.map +1 -0
- package/src/modules/logger/services/logger/logger.service.d.ts +44 -0
- package/src/modules/logger/services/logger/logger.service.d.ts.map +1 -0
- package/src/modules/logger/services/rest/rest.sink.d.ts +42 -0
- package/src/modules/logger/services/rest/rest.sink.d.ts.map +1 -0
- package/{structured-log/src → src/modules/logger}/services/rest/restSink.options.d.ts +6 -7
- package/src/modules/logger/services/rest/restSink.options.d.ts.map +1 -0
- package/src/modules/logger/services/subLoggerSink/subLogger.sink.d.ts +27 -0
- package/src/modules/logger/services/subLoggerSink/subLogger.sink.d.ts.map +1 -0
- package/src/modules/logger/services/timestampEnricher/timestamp.enricher.d.ts +12 -0
- package/src/modules/logger/services/timestampEnricher/timestamp.enricher.d.ts.map +1 -0
- package/src/modules/logger/types/index.d.ts +4 -0
- package/src/modules/logger/types/index.d.ts.map +1 -0
- package/src/modules/logger/types/logLevel.enum.d.ts +34 -0
- package/src/modules/logger/types/logLevel.enum.d.ts.map +1 -0
- package/src/modules/logger/types/loggerConfiguration.d.ts +54 -0
- package/src/modules/logger/types/loggerConfiguration.d.ts.map +1 -0
- package/src/modules/logger/types/loggerOptions.d.ts +35 -0
- package/src/modules/logger/types/loggerOptions.d.ts.map +1 -0
- package/src/modules/logger/types/messageLog.d.ts +34 -0
- package/src/modules/logger/types/messageLog.d.ts.map +1 -0
- package/src/services/permanentStorage/cookiePermanentStorage.service.d.ts +4 -8
- package/src/services/permanentStorage/cookiePermanentStorage.service.d.ts.map +1 -1
- package/src/services/permanentStorage/permanentStorage.interface.d.ts +0 -6
- package/src/services/permanentStorage/permanentStorage.interface.d.ts.map +1 -1
- package/src/services/position/position.interface.d.ts +0 -6
- package/src/services/position/position.interface.d.ts.map +1 -1
- package/src/services/stringLocalization/noStringLocalization.service.d.ts +3 -3
- package/src/services/stringLocalization/noStringLocalization.service.d.ts.map +1 -1
- package/src/services/stringLocalization/stringLocalization.interface.d.ts +0 -6
- package/src/services/stringLocalization/stringLocalization.interface.d.ts.map +1 -1
- package/src/services/temporaryStorage/memoryTemporaryStorage.service.d.ts +3 -3
- package/src/services/temporaryStorage/memoryTemporaryStorage.service.d.ts.map +1 -1
- package/src/services/temporaryStorage/temporaryStorage.interface.d.ts +0 -6
- package/src/services/temporaryStorage/temporaryStorage.interface.d.ts.map +1 -1
- package/src/types/providers.d.ts +11 -11
- package/src/types/providers.d.ts.map +1 -1
- package/src/types/tokens.d.ts +1 -1
- package/src/types/tokens.d.ts.map +1 -1
- package/store/src/index.d.ts +1 -1
- package/store/src/index.d.ts.map +1 -1
- package/store/src/services/permanentStorage/localPermanentStorage.service.d.ts +4 -8
- package/store/src/services/permanentStorage/localPermanentStorage.service.d.ts.map +1 -1
- package/store/src/services/temporaryStorage/sessionTemporaryStorage.service.d.ts +4 -8
- package/store/src/services/temporaryStorage/sessionTemporaryStorage.service.d.ts.map +1 -1
- package/version.bak +1 -1
- package/es2022/positions/src/index.js +0 -2
- package/es2022/positions/src/index.js.map +0 -1
- package/es2022/positions/src/misc/utils.js +0 -109
- package/es2022/positions/src/misc/utils.js.map +0 -1
- package/es2022/src/services/logger/index.js +0 -3
- package/es2022/src/services/logger/index.js.map +0 -1
- package/es2022/src/services/logger/logger.interface.js.map +0 -1
- package/es2022/src/services/logger/logger.service.js +0 -18
- package/es2022/src/services/logger/logger.service.js.map +0 -1
- package/es2022/structured-log/src/components/console/console.component.animations.js.map +0 -1
- package/es2022/structured-log/src/components/console/console.component.js +0 -103
- package/es2022/structured-log/src/components/console/console.component.js.map +0 -1
- package/es2022/structured-log/src/index.js +0 -15
- package/es2022/structured-log/src/index.js.map +0 -1
- package/es2022/structured-log/src/misc/providers.js +0 -12
- package/es2022/structured-log/src/misc/providers.js.map +0 -1
- package/es2022/structured-log/src/misc/utils.js +0 -39
- package/es2022/structured-log/src/misc/utils.js.map +0 -1
- package/es2022/structured-log/src/modules/consoleLog.module.js +0 -28
- package/es2022/structured-log/src/modules/consoleLog.module.js.map +0 -1
- package/es2022/structured-log/src/services/console/consoleComponentSink.service.js +0 -98
- package/es2022/structured-log/src/services/console/consoleComponentSink.service.js.map +0 -1
- package/es2022/structured-log/src/services/console/consoleSinkConfig.service.js +0 -47
- package/es2022/structured-log/src/services/console/consoleSinkConfig.service.js.map +0 -1
- package/es2022/structured-log/src/services/developerConsole/developerConsoleSink.options.js +0 -18
- package/es2022/structured-log/src/services/developerConsole/developerConsoleSink.options.js.map +0 -1
- package/es2022/structured-log/src/services/developerConsole/developerConsoleSink.service.js +0 -124
- package/es2022/structured-log/src/services/developerConsole/developerConsoleSink.service.js.map +0 -1
- package/es2022/structured-log/src/services/logger.service.js +0 -71
- package/es2022/structured-log/src/services/logger.service.js.map +0 -1
- package/es2022/structured-log/src/services/rest/restSink.options.js +0 -40
- package/es2022/structured-log/src/services/rest/restSink.options.js.map +0 -1
- package/es2022/structured-log/src/services/rest/restSink.service.js +0 -136
- package/es2022/structured-log/src/services/rest/restSink.service.js.map +0 -1
- package/es2022/structured-log/src/types/logger.interface.js +0 -2
- package/es2022/structured-log/src/types/logger.interface.js.map +0 -1
- package/es2022/structured-log/src/types/tokens.js +0 -56
- package/es2022/structured-log/src/types/tokens.js.map +0 -1
- package/positions/package.json +0 -8
- package/positions/src/index.d.ts +0 -2
- package/positions/src/misc/utils.d.ts +0 -22
- package/positions/src/misc/utils.d.ts.map +0 -1
- package/src/services/logger/index.d.ts +0 -3
- package/src/services/logger/index.d.ts.map +0 -1
- package/src/services/logger/logger.interface.d.ts +0 -90
- package/src/services/logger/logger.interface.d.ts.map +0 -1
- package/src/services/logger/logger.service.d.ts +0 -85
- package/src/services/logger/logger.service.d.ts.map +0 -1
- package/structured-log/package.json +0 -8
- package/structured-log/src/components/console/console.component.d.ts +0 -55
- package/structured-log/src/components/console/console.component.d.ts.map +0 -1
- package/structured-log/src/index.d.ts +0 -15
- package/structured-log/src/index.d.ts.map +0 -1
- package/structured-log/src/misc/providers.d.ts +0 -6
- package/structured-log/src/misc/providers.d.ts.map +0 -1
- package/structured-log/src/misc/utils.d.ts +0 -14
- package/structured-log/src/misc/utils.d.ts.map +0 -1
- package/structured-log/src/modules/consoleLog.module.d.ts +0 -12
- package/structured-log/src/modules/consoleLog.module.d.ts.map +0 -1
- package/structured-log/src/services/console/consoleComponentSink.service.d.ts +0 -45
- package/structured-log/src/services/console/consoleComponentSink.service.d.ts.map +0 -1
- package/structured-log/src/services/console/consoleSinkConfig.service.d.ts +0 -18
- package/structured-log/src/services/console/consoleSinkConfig.service.d.ts.map +0 -1
- package/structured-log/src/services/developerConsole/developerConsoleSink.options.d.ts +0 -12
- package/structured-log/src/services/developerConsole/developerConsoleSink.options.d.ts.map +0 -1
- package/structured-log/src/services/developerConsole/developerConsoleSink.service.d.ts +0 -39
- package/structured-log/src/services/developerConsole/developerConsoleSink.service.d.ts.map +0 -1
- package/structured-log/src/services/logger.service.d.ts +0 -98
- package/structured-log/src/services/logger.service.d.ts.map +0 -1
- package/structured-log/src/services/rest/restSink.options.d.ts.map +0 -1
- package/structured-log/src/services/rest/restSink.service.d.ts +0 -47
- package/structured-log/src/services/rest/restSink.service.d.ts.map +0 -1
- package/structured-log/src/types/logger.interface.d.ts +0 -63
- package/structured-log/src/types/logger.interface.d.ts.map +0 -1
- package/structured-log/src/types/tokens.d.ts +0 -38
- package/structured-log/src/types/tokens.d.ts.map +0 -1
- package/typings/positions/index.d.ts +0 -41
- package/typings/structured-log/index.d.ts +0 -391
- /package/es2022/{structured-log/src → src/modules/logger}/components/console/console.component.animations.js +0 -0
- /package/es2022/src/{services → modules/logger/services}/logger/logger.interface.js +0 -0
- /package/{structured-log/src → src/modules/logger}/components/console/console.component.animations.d.ts +0 -0
- /package/{structured-log/src → src/modules/logger}/components/console/console.component.animations.d.ts.map +0 -0
- /package/{structured-log/src → src/modules/logger}/components/console/console.component.css +0 -0
- /package/{structured-log/src → src/modules/logger}/components/console/console.component.html +0 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rest.sink.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/rest/rest.sink.ts"],"names":[],"mappings":";AAAA,OAAO,EAAC,MAAM,EAAC,MAAM,eAAe,CAAC;AACrC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AACzC,OAAO,EAAC,aAAa,EAAC,MAAM,MAAM,CAAC;AAEnC,OAAO,EAAC,eAAe,EAAC,MAAM,oBAAoB,CAAC;AACnD,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,C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 'rxjs';\n\nimport {RestSinkOptions} from './restSink.options';\nimport {SinkType} from '../../decorators';\nimport {LoggerRestClient, LoggerSink, RestLog} from '../../interfaces';\nimport {APP_STABLE} from '../../../../utils';\nimport {LOGGER_REST_CLIENT, loggerEnabled} from '../../misc';\nimport {LogLevel, LoggerOptions, MessageLog} from '../../types';\n\n/**\n * Sink that is used for storing logs using REST\n */\n@SinkType()\nexport class RestSink implements LoggerSink\n{\n //######################### protected fields #########################\n\n /**\n * Array of unflushed logs\n */\n protected logs: RestLog[] = [];\n\n /**\n * Interval timer id\n */\n protected timer: number|undefined|null;\n\n /**\n * Configuration options for rest sink\n */\n protected options: RestSinkOptions = inject(RestSinkOptions);\n\n /**\n * Indication whether is app stable\n */\n protected isStable: Promise<void> = inject(APP_STABLE);\n\n /**\n * Rest client used for sending logs through REST\n */\n protected restClient: LoggerRestClient = inject(LOGGER_REST_CLIENT);\n\n //######################### constructor #########################\n constructor()\n {\n if(!(this.options instanceof RestSinkOptions))\n {\n this.options = new RestSinkOptions();\n }\n\n this.isStable.then(() =>\n {\n this.timer = setInterval(() =>\n {\n this.flush();\n }, (this.options.secondsToFlushAfter ?? 0) * 1000) as any;\n });\n }\n\n //######################### public methods - implementation of OnDestroy #########################\n \n /**\n * Called when component is destroyed\n */\n public ngOnDestroy(): void\n {\n if(isPresent(this.timer))\n {\n clearInterval(this.timer);\n }\n\n this.flush();\n }\n\n //######################### public methods - implementation of Sink #########################\n\n /**\n * @inheritdoc\n */\n public log(options: LoggerOptions, loggerProperties: Record<string, unknown>, messageLog: MessageLog): void\n {\n let forceFlush = false;\n\n const fullMessage = `${messageLog.buildMessage(options.messageTemplate ?? '{{messageLog}}', loggerProperties)}`;\n\n this.logs.push(\n {\n logLevel: LogLevel[messageLog.logLevel],\n message: fullMessage,\n timestamp: messageLog.timestamp,\n });\n\n if(loggerEnabled(() => this.options.immediateFlushMinLevel, messageLog.logLevel))\n {\n forceFlush = true;\n }\n\n //flush if number of records is bigger than max or flush is required\n if(forceFlush || this.logs.length >= this.options.flushAfterNumberOfLogs)\n {\n this.flush();\n }\n }\n\n /**\n * Flushes logs\n */\n protected flush(): Promise<void>\n {\n let promise: Promise<void>|undefined;\n\n //no logs available\n if(!this.logs.length)\n {\n return Promise.resolve();\n }\n\n try\n {\n promise = lastValueFrom(this.restClient.log(this.logs));\n }\n catch(e)\n {\n console.log(e);\n }\n\n this.logs = [];\n\n return promise ?? Promise.resolve();\n }\n}"]}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { isPresent } from '@jscrpt/common';
|
|
3
|
+
import { LogLevel } from '../../types';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
import * as i1 from "../../types";
|
|
6
|
+
/**
|
|
7
|
+
* Options for rest sink
|
|
8
|
+
*/
|
|
9
|
+
class RestSinkOptions {
|
|
10
|
+
//######################### public properties #########################
|
|
11
|
+
/**
|
|
12
|
+
* Number of seconds after which should be flush called
|
|
13
|
+
*/
|
|
14
|
+
secondsToFlushAfter = 300;
|
|
15
|
+
/**
|
|
16
|
+
* Number of logs after which should be flush called
|
|
17
|
+
*/
|
|
18
|
+
flushAfterNumberOfLogs = 50;
|
|
19
|
+
/**
|
|
20
|
+
* Minimal log level that will be flushed immediately
|
|
21
|
+
*/
|
|
22
|
+
immediateFlushMinLevel = LogLevel.Error;
|
|
23
|
+
//######################### constructor #########################
|
|
24
|
+
constructor(secondsToFlushAfter, flushAfterNumberOfLogs, immediateFlushMinLevel) {
|
|
25
|
+
if (isPresent(secondsToFlushAfter)) {
|
|
26
|
+
this.secondsToFlushAfter = secondsToFlushAfter;
|
|
27
|
+
}
|
|
28
|
+
if (isPresent(flushAfterNumberOfLogs)) {
|
|
29
|
+
this.flushAfterNumberOfLogs = flushAfterNumberOfLogs;
|
|
30
|
+
}
|
|
31
|
+
if (isPresent(immediateFlushMinLevel)) {
|
|
32
|
+
this.immediateFlushMinLevel = immediateFlushMinLevel;
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkOptions, deps: "invalid", target: i0.ɵɵFactoryTarget.Injectable });
|
|
36
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkOptions, providedIn: 'root', useFactory: () => new RestSinkOptions() });
|
|
37
|
+
}
|
|
38
|
+
export { RestSinkOptions };
|
|
39
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: RestSinkOptions, decorators: [{
|
|
40
|
+
type: Injectable,
|
|
41
|
+
args: [{ providedIn: 'root', useFactory: () => new RestSinkOptions() }]
|
|
42
|
+
}], ctorParameters: function () { return [{ type: undefined }, { type: undefined }, { type: i1.LogLevel }]; } });
|
|
43
|
+
//# sourceMappingURL=restSink.options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"restSink.options.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/rest/restSink.options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAEzC,OAAO,EAAC,QAAQ,EAAC,MAAM,aAAa,CAAC;;;AAErC;;GAEG;AACH,MACa,eAAe;IAExB,uEAAuE;IAEvE;;OAEG;IACI,mBAAmB,GAAW,GAAG,CAAC;IAEzC;;OAEG;IACI,sBAAsB,GAAW,EAAE,CAAC;IAE3C;;OAEG;IACI,sBAAsB,GAAa,QAAQ,CAAC,KAAK,CAAC;IAEzD,iEAAiE;IACjE,YAAY,mBAA4B,EAC5B,sBAA+B,EAC/B,sBAAiC;QAEzC,IAAG,SAAS,CAAC,mBAAmB,CAAC,EACjC;YACI,IAAI,CAAC,mBAAmB,GAAG,mBAAmB,CAAC;SAClD;QAED,IAAG,SAAS,CAAC,sBAAsB,CAAC,EACpC;YACI,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;SACxD;QAED,IAAG,SAAS,CAAC,sBAAsB,CAAC,EACpC;YACI,IAAI,CAAC,sBAAsB,GAAG,sBAAsB,CAAC;SACxD;IACL,CAAC;uGAtCQ,eAAe;2GAAf,eAAe,cADH,MAAM,cAAc,GAAG,EAAE,CAAC,IAAI,eAAe,EAAE;;SAC3D,eAAe;2FAAf,eAAe;kBAD3B,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,GAAG,EAAE,CAAC,qBAAqB,EAAC","sourcesContent":["import {Injectable} from '@angular/core';\nimport {isPresent} from '@jscrpt/common';\n\nimport {LogLevel} from '../../types';\n\n/**\n * Options for rest sink\n */\n@Injectable({providedIn: 'root', useFactory: () => new RestSinkOptions()})\nexport class RestSinkOptions\n{\n //######################### public properties #########################\n\n /**\n * Number of seconds after which should be flush called\n */\n public secondsToFlushAfter: number = 300;\n\n /**\n * Number of logs after which should be flush called\n */\n public flushAfterNumberOfLogs: number = 50;\n\n /**\n * Minimal log level that will be flushed immediately\n */\n public immediateFlushMinLevel: LogLevel = LogLevel.Error;\n\n //######################### constructor #########################\n constructor(secondsToFlushAfter?: number,\n flushAfterNumberOfLogs?: number,\n immediateFlushMinLevel?: LogLevel,)\n {\n if(isPresent(secondsToFlushAfter))\n {\n this.secondsToFlushAfter = secondsToFlushAfter;\n }\n\n if(isPresent(flushAfterNumberOfLogs))\n {\n this.flushAfterNumberOfLogs = flushAfterNumberOfLogs;\n }\n\n if(isPresent(immediateFlushMinLevel))\n {\n this.immediateFlushMinLevel = immediateFlushMinLevel;\n }\n }\n}\n"]}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Sink that is used as sub logger
|
|
3
|
+
*/
|
|
4
|
+
export class SubLoggerSink {
|
|
5
|
+
loggerOptions;
|
|
6
|
+
//######################### public properties - implementation of LoggerSink #########################
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
get enrichers() {
|
|
11
|
+
return this.loggerOptions.enrichers;
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* @inheritdoc
|
|
15
|
+
*/
|
|
16
|
+
get filter() {
|
|
17
|
+
return this.loggerOptions.filter;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* @inheritdoc
|
|
21
|
+
*/
|
|
22
|
+
get minimumLogLevel() {
|
|
23
|
+
return this.loggerOptions.minimumLogLevel;
|
|
24
|
+
}
|
|
25
|
+
//######################### constructor #########################
|
|
26
|
+
constructor(loggerOptions) {
|
|
27
|
+
this.loggerOptions = loggerOptions;
|
|
28
|
+
}
|
|
29
|
+
//######################### public methods - implementation of LoggerSink #########################
|
|
30
|
+
/**
|
|
31
|
+
* @inheritdoc
|
|
32
|
+
*/
|
|
33
|
+
log(options, loggerProperties, messageLog) {
|
|
34
|
+
for (const sink of this.loggerOptions.loggerSinks) {
|
|
35
|
+
sink.log({
|
|
36
|
+
enrichers: [],
|
|
37
|
+
filter: undefined,
|
|
38
|
+
loggerSinks: [],
|
|
39
|
+
messageLengthLimit: this.loggerOptions.messageLengthLimit ?? options.messageLengthLimit,
|
|
40
|
+
messageTemplate: this.loggerOptions.messageTemplate ?? options.messageTemplate,
|
|
41
|
+
minimumLogLevel: undefined,
|
|
42
|
+
}, loggerProperties, messageLog);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
//# sourceMappingURL=subLogger.sink.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"subLogger.sink.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/subLoggerSink/subLogger.sink.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,MAAM,OAAO,aAAa;IA6BA;IA3BtB,sGAAsG;IAEtG;;OAEG;IACH,IAAW,SAAS;QAEhB,OAAO,IAAI,CAAC,aAAa,CAAC,SAAS,CAAC;IACxC,CAAC;IAED;;OAEG;IACH,IAAW,MAAM;QAEb,OAAO,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC;IACrC,CAAC;IAED;;OAEG;IACH,IAAW,eAAe;QAEtB,OAAO,IAAI,CAAC,aAAa,CAAC,eAAe,CAAC;IAC9C,CAAC;IAED,iEAAiE;IACjE,YAAsB,aAA4B;QAA5B,kBAAa,GAAb,aAAa,CAAe;IAGlD,CAAC;IAED,mGAAmG;IAEnG;;OAEG;IACI,GAAG,CAAC,OAAsB,EAAE,gBAAyC,EAAE,UAA+C;QAEzH,KAAI,MAAM,IAAI,IAAI,IAAI,CAAC,aAAa,CAAC,WAAW,EAChD;YACI,IAAI,CAAC,GAAG,CAAC;gBACI,SAAS,EAAE,EAAE;gBACb,MAAM,EAAE,SAAS;gBACjB,WAAW,EAAE,EAAE;gBACf,kBAAkB,EAAE,IAAI,CAAC,aAAa,CAAC,kBAAkB,IAAI,OAAO,CAAC,kBAAkB;gBACvF,eAAe,EAAE,IAAI,CAAC,aAAa,CAAC,eAAe,IAAI,OAAO,CAAC,eAAe;gBAC9E,eAAe,EAAE,SAAS;aAC7B,EACD,gBAAgB,EAChB,UAAU,CAAE,CAAC;SACzB;IACL,CAAC;CACJ","sourcesContent":["import {LoggerEnricher, LoggerFilter, LoggerSink} from '../../interfaces';\nimport {MinLogLevelGetter} from '../../misc';\nimport {LoggerOptions, MessageLog} from '../../types';\n\n/**\n * Sink that is used as sub logger\n */\nexport class SubLoggerSink implements LoggerSink\n{\n //######################### public properties - implementation of LoggerSink #########################\n\n /**\n * @inheritdoc\n */\n public get enrichers(): LoggerEnricher[]\n {\n return this.loggerOptions.enrichers;\n }\n\n /**\n * @inheritdoc\n */\n public get filter(): LoggerFilter|undefined|null\n {\n return this.loggerOptions.filter;\n }\n\n /**\n * @inheritdoc\n */\n public get minimumLogLevel(): MinLogLevelGetter|undefined|null\n {\n return this.loggerOptions.minimumLogLevel;\n }\n\n //######################### constructor #########################\n constructor(protected loggerOptions: LoggerOptions,)\n {\n\n }\n\n //######################### public methods - implementation of LoggerSink #########################\n\n /**\n * @inheritdoc\n */\n public log(options: LoggerOptions, loggerProperties: Record<string, unknown>, messageLog: MessageLog<Record<string, unknown>>): void\n {\n for(const sink of this.loggerOptions.loggerSinks)\n {\n sink.log({\n enrichers: [],\n filter: undefined,\n loggerSinks: [],\n messageLengthLimit: this.loggerOptions.messageLengthLimit ?? options.messageLengthLimit,\n messageTemplate: this.loggerOptions.messageTemplate ?? options.messageTemplate,\n minimumLogLevel: undefined,\n },\n loggerProperties,\n messageLog,);\n }\n }\n}"]}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const TIMESTAMP = 'timestamp';
|
|
2
|
+
/**
|
|
3
|
+
* Enricher used for adding timestamp as iso datetime with current date time
|
|
4
|
+
*/
|
|
5
|
+
export class TimestampEnricher {
|
|
6
|
+
//######################### public methods - implementation of LoggerEnricher #########################
|
|
7
|
+
/**
|
|
8
|
+
* @inheritdoc
|
|
9
|
+
*/
|
|
10
|
+
enrich(properties, messageLog) {
|
|
11
|
+
properties[TIMESTAMP] = messageLog.timestamp;
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=timestamp.enricher.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"timestamp.enricher.js","sourceRoot":"","sources":["../../../../../../src/modules/logger/services/timestampEnricher/timestamp.enricher.ts"],"names":[],"mappings":"AAGA,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B;;GAEG;AACH,MAAM,OAAO,iBAAiB;IAE1B,uGAAuG;IAEvG;;OAEG;IACI,MAAM,CAAC,UAAmC,EAAE,UAA+C;QAE9F,UAAU,CAAC,SAAS,CAAC,GAAG,UAAU,CAAC,SAAS,CAAC;IACjD,CAAC;CACJ","sourcesContent":["import {LoggerEnricher} from '../../interfaces';\nimport {MessageLog} from '../../types';\n\nconst TIMESTAMP = 'timestamp';\n\n/**\n * Enricher used for adding timestamp as iso datetime with current date time\n */\nexport class TimestampEnricher implements LoggerEnricher\n{\n //######################### public methods - implementation of LoggerEnricher #########################\n\n /**\n * @inheritdoc\n */\n public enrich(properties: Record<string, unknown>, messageLog: MessageLog<Record<string, unknown>>): void\n {\n properties[TIMESTAMP] = messageLog.timestamp;\n }\n}"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../src/modules/logger/types/index.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,cAAc,CAAC","sourcesContent":["export * from './loggerOptions';\nexport * from './logLevel.enum';\nexport * from './messageLog';\n"]}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Log level for built in logger
|
|
3
|
+
*/
|
|
4
|
+
export var LogLevel;
|
|
5
|
+
(function (LogLevel) {
|
|
6
|
+
/**
|
|
7
|
+
* Verbose logs used for tracking
|
|
8
|
+
*/
|
|
9
|
+
LogLevel[LogLevel["Verbose"] = 0] = "Verbose";
|
|
10
|
+
/**
|
|
11
|
+
* Debugging logs used for debugging
|
|
12
|
+
*/
|
|
13
|
+
LogLevel[LogLevel["Debug"] = 1] = "Debug";
|
|
14
|
+
/**
|
|
15
|
+
* Informative log
|
|
16
|
+
*/
|
|
17
|
+
LogLevel[LogLevel["Information"] = 2] = "Information";
|
|
18
|
+
/**
|
|
19
|
+
* Warning log
|
|
20
|
+
*/
|
|
21
|
+
LogLevel[LogLevel["Warning"] = 3] = "Warning";
|
|
22
|
+
/**
|
|
23
|
+
* Error log
|
|
24
|
+
*/
|
|
25
|
+
LogLevel[LogLevel["Error"] = 4] = "Error";
|
|
26
|
+
/**
|
|
27
|
+
* Fatal error log
|
|
28
|
+
*/
|
|
29
|
+
LogLevel[LogLevel["Fatal"] = 5] = "Fatal";
|
|
30
|
+
/**
|
|
31
|
+
* Logging is disabled
|
|
32
|
+
*/
|
|
33
|
+
LogLevel[LogLevel["Off"] = 6] = "Off";
|
|
34
|
+
})(LogLevel || (LogLevel = {}));
|
|
35
|
+
//# sourceMappingURL=logLevel.enum.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logLevel.enum.js","sourceRoot":"","sources":["../../../../../src/modules/logger/types/logLevel.enum.ts"],"names":[],"mappings":"AAAA;;GAEG;AACH,MAAM,CAAN,IAAY,QAoCX;AApCD,WAAY,QAAQ;IAEhB;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,yCAAS,CAAA;IAET;;OAEG;IACH,qDAAe,CAAA;IAEf;;OAEG;IACH,6CAAW,CAAA;IAEX;;OAEG;IACH,yCAAS,CAAA;IAET;;OAEG;IACH,yCAAS,CAAA;IAET;;OAEG;IACH,qCAAO,CAAA;AACX,CAAC,EApCW,QAAQ,KAAR,QAAQ,QAoCnB","sourcesContent":["/**\n * Log level for built in logger\n */\nexport enum LogLevel\n{\n /**\n * Verbose logs used for tracking\n */\n Verbose = 0,\n\n /**\n * Debugging logs used for debugging\n */\n Debug = 1,\n\n /**\n * Informative log\n */\n Information = 2,\n\n /**\n * Warning log\n */\n Warning = 3,\n\n /**\n * Error log\n */\n Error = 4,\n\n /**\n * Fatal error log\n */\n Fatal = 5,\n\n /**\n * Logging is disabled\n */\n Off = 6,\n}"]}
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { isFunction, isPresent } from '@jscrpt/common';
|
|
2
|
+
import { LoggerOptions } from './loggerOptions';
|
|
3
|
+
import { isLoggerSinkType } from '../decorators';
|
|
4
|
+
import { SubLoggerSink } from '../services';
|
|
5
|
+
/**
|
|
6
|
+
* Implementation of logger configuration
|
|
7
|
+
*/
|
|
8
|
+
export class LoggerConfigurationImpl {
|
|
9
|
+
//######################### protected fields #########################
|
|
10
|
+
/**
|
|
11
|
+
* Configuration for minimum log level
|
|
12
|
+
*/
|
|
13
|
+
config;
|
|
14
|
+
/**
|
|
15
|
+
* Logger enricher types
|
|
16
|
+
*/
|
|
17
|
+
loggerEnricherTypes = [];
|
|
18
|
+
/**
|
|
19
|
+
* Array of logger sinks configs
|
|
20
|
+
*/
|
|
21
|
+
sinks = [];
|
|
22
|
+
/**
|
|
23
|
+
* Options that are currently configured
|
|
24
|
+
*/
|
|
25
|
+
options;
|
|
26
|
+
//######################### constructor #########################
|
|
27
|
+
constructor(options = new LoggerOptions()) {
|
|
28
|
+
this.options = options;
|
|
29
|
+
}
|
|
30
|
+
//######################### public methods - implementation of LoggerConfiguration #########################
|
|
31
|
+
/**
|
|
32
|
+
* @inheritdoc
|
|
33
|
+
*/
|
|
34
|
+
minimumLevel(config) {
|
|
35
|
+
this.config = config;
|
|
36
|
+
return this;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* @inheritdoc
|
|
40
|
+
*/
|
|
41
|
+
messageTemplate(template) {
|
|
42
|
+
this.options.messageTemplate = template;
|
|
43
|
+
return this;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* @inheritdoc
|
|
47
|
+
*/
|
|
48
|
+
messageLengthLimit(limit) {
|
|
49
|
+
this.options.messageLengthLimit = limit;
|
|
50
|
+
return this;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* @inheritdoc
|
|
54
|
+
*/
|
|
55
|
+
enrichWith(loggerEnricherType) {
|
|
56
|
+
this.loggerEnricherTypes.push(loggerEnricherType);
|
|
57
|
+
return this;
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* @inheritdoc
|
|
61
|
+
*/
|
|
62
|
+
filter(filter) {
|
|
63
|
+
this.options.filter = filter;
|
|
64
|
+
return this;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* @inheritdoc
|
|
68
|
+
*/
|
|
69
|
+
writeTo(config) {
|
|
70
|
+
this.sinks.push(config);
|
|
71
|
+
return this;
|
|
72
|
+
}
|
|
73
|
+
//######################### public methods #########################
|
|
74
|
+
/**
|
|
75
|
+
* Builds logger options from configuration
|
|
76
|
+
*/
|
|
77
|
+
buildOptions() {
|
|
78
|
+
if (isPresent(this.config)) {
|
|
79
|
+
const config = this.config;
|
|
80
|
+
if (isFunction(config)) {
|
|
81
|
+
const minLevelCfg = config();
|
|
82
|
+
if (isFunction(minLevelCfg)) {
|
|
83
|
+
this.options.minimumLogLevel = minLevelCfg;
|
|
84
|
+
}
|
|
85
|
+
else {
|
|
86
|
+
this.options.minimumLogLevel = () => minLevelCfg;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
this.options.minimumLogLevel = () => config;
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
this.options.enrichers.push(...this.loggerEnricherTypes.map(type => new type()));
|
|
94
|
+
this.options.loggerSinks.push(...this.sinks.map(config => {
|
|
95
|
+
if (isLoggerSinkType(config)) {
|
|
96
|
+
return new config();
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
const cfg = new LoggerConfigurationImpl({
|
|
100
|
+
enrichers: [],
|
|
101
|
+
loggerSinks: [],
|
|
102
|
+
filter: undefined,
|
|
103
|
+
messageLengthLimit: undefined,
|
|
104
|
+
messageTemplate: undefined,
|
|
105
|
+
minimumLogLevel: undefined,
|
|
106
|
+
});
|
|
107
|
+
config(cfg);
|
|
108
|
+
return new SubLoggerSink(cfg.buildOptions());
|
|
109
|
+
}
|
|
110
|
+
}));
|
|
111
|
+
return this.options;
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
//# sourceMappingURL=loggerConfiguration.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loggerConfiguration.js","sourceRoot":"","sources":["../../../../../src/modules/logger/types/loggerConfiguration.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAE,SAAS,EAAC,MAAM,gBAAgB,CAAC;AAIrD,OAAO,EAAC,aAAa,EAAC,MAAM,iBAAiB,CAAC;A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AAO,IAAI,CAAC,OAAO,CAAC;IACxB,CAAC;CACJ","sourcesContent":["import {isFunction, isPresent} from '@jscrpt/common';\n\nimport {LoggerConfiguration, LoggerEnricherType, LoggerFilter} from '../interfaces';\nimport {MinimumLevelConfig, WriteToConfig} from '../misc';\nimport {LoggerOptions} from './loggerOptions';\nimport {isLoggerSinkType} from '../decorators';\nimport {SubLoggerSink} from '../services';\n\n/**\n * Implementation of logger configuration\n */\nexport class LoggerConfigurationImpl implements LoggerConfiguration\n{\n //######################### protected fields #########################\n\n /**\n * Configuration for minimum log level\n */\n protected config: MinimumLevelConfig|undefined|null;\n\n /**\n * Logger enricher types\n */\n protected loggerEnricherTypes: LoggerEnricherType[] = [];\n\n /**\n * Array of logger sinks configs\n */\n protected sinks: WriteToConfig[] = [];\n\n /**\n * Options that are currently configured\n */\n protected options: LoggerOptions;\n\n //######################### constructor #########################\n constructor(options: LoggerOptions = new LoggerOptions())\n {\n this.options = options;\n }\n\n //######################### public methods - implementation of LoggerConfiguration #########################\n\n /**\n * @inheritdoc\n */\n public minimumLevel(config: MinimumLevelConfig): LoggerConfiguration\n {\n this.config = config;\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public messageTemplate(template: string): LoggerConfiguration\n {\n this.options.messageTemplate = template;\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public messageLengthLimit(limit: number|null|undefined): LoggerConfiguration\n {\n this.options.messageLengthLimit = limit;\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public enrichWith(loggerEnricherType: LoggerEnricherType): LoggerConfiguration\n {\n this.loggerEnricherTypes.push(loggerEnricherType);\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public filter(filter: LoggerFilter|null|undefined): LoggerConfiguration\n {\n this.options.filter = filter;\n\n return this;\n }\n\n /**\n * @inheritdoc\n */\n public writeTo(config: WriteToConfig): LoggerConfiguration\n {\n this.sinks.push(config);\n\n return this;\n }\n\n //######################### public methods #########################\n\n /**\n * Builds logger options from configuration\n */\n public buildOptions(): LoggerOptions\n {\n if(isPresent(this.config))\n {\n const config = this.config;\n\n if(isFunction(config))\n {\n const minLevelCfg = config();\n\n if(isFunction(minLevelCfg))\n {\n this.options.minimumLogLevel = minLevelCfg;\n }\n else\n {\n this.options.minimumLogLevel = () => minLevelCfg;\n }\n }\n else\n {\n this.options.minimumLogLevel = () => config;\n }\n }\n\n this.options.enrichers.push(...this.loggerEnricherTypes.map(type => new type()));\n\n this.options.loggerSinks.push(...this.sinks.map(config =>\n {\n if(isLoggerSinkType(config))\n {\n return new config();\n }\n else\n {\n const cfg = new LoggerConfigurationImpl(\n {\n enrichers: [],\n loggerSinks: [],\n filter: undefined,\n messageLengthLimit: undefined,\n messageTemplate: undefined,\n minimumLogLevel: undefined,\n });\n\n config(cfg);\n\n return new SubLoggerSink(cfg.buildOptions());\n }\n }));\n\n return this.options;\n }\n}"]}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import { Injectable } from '@angular/core';
|
|
2
|
+
import { LogLevel } from './logLevel.enum';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
/**
|
|
5
|
+
* Options for logger that are used during logging
|
|
6
|
+
*/
|
|
7
|
+
class LoggerOptions {
|
|
8
|
+
//######################### public properties #########################
|
|
9
|
+
/**
|
|
10
|
+
* Minimal log level, that is used for logging, logs with lower log level are ignored
|
|
11
|
+
*/
|
|
12
|
+
minimumLogLevel = () => LogLevel.Information;
|
|
13
|
+
/**
|
|
14
|
+
* Maximal allowed length of message, if it is exceeded it is trimmed
|
|
15
|
+
*/
|
|
16
|
+
messageLengthLimit = 500;
|
|
17
|
+
/**
|
|
18
|
+
* Logger message template that is used for creating message log, message log itself is inside `messageLog` property
|
|
19
|
+
*/
|
|
20
|
+
messageTemplate = '{{messageLog}}';
|
|
21
|
+
/**
|
|
22
|
+
* Array of enrichers that allows extending logger properties
|
|
23
|
+
*/
|
|
24
|
+
enrichers = [];
|
|
25
|
+
/**
|
|
26
|
+
* Filter that filters out message logs
|
|
27
|
+
*/
|
|
28
|
+
filter = undefined;
|
|
29
|
+
/**
|
|
30
|
+
* Array of logger sinks that do actual logging
|
|
31
|
+
*/
|
|
32
|
+
loggerSinks = [];
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoggerOptions, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
34
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoggerOptions, providedIn: 'root' });
|
|
35
|
+
}
|
|
36
|
+
export { LoggerOptions };
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: LoggerOptions, decorators: [{
|
|
38
|
+
type: Injectable,
|
|
39
|
+
args: [{ providedIn: 'root' }]
|
|
40
|
+
}] });
|
|
41
|
+
//# sourceMappingURL=loggerOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loggerOptions.js","sourceRoot":"","sources":["../../../../../src/modules/logger/types/loggerOptions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAIzC,OAAO,EAAC,QAAQ,EAAC,MAAM,iBAAiB,CAAC;;AAEzC;;GAEG;AACH,MACa,aAAa;IAEtB,uEAAuE;IAEvE;;OAEG;IACI,eAAe,GAAqC,GAAG,EAAE,CAAC,QAAQ,CAAC,WAAW,CAAC;IAEtF;;OAEG;IACI,kBAAkB,GAA0B,GAAG,CAAC;IAEvD;;OAEG;IACI,eAAe,GAA0B,gBAAgB,CAAC;IAEjE;;OAEG;IACI,SAAS,GAAqB,EAAE,CAAC;IAExC;;OAEG;IACI,MAAM,GAAgC,SAAS,CAAC;IAEvD;;OAEG;IACI,WAAW,GAAiB,EAAE,CAAC;uGAhC7B,aAAa;2GAAb,aAAa,cADD,MAAM;;SAClB,aAAa;2FAAb,aAAa;kBADzB,UAAU;mBAAC,EAAC,UAAU,EAAE,MAAM,EAAC","sourcesContent":["import {Injectable} from '@angular/core';\n\nimport {LoggerEnricher, LoggerFilter, LoggerSink} from '../interfaces';\nimport {MinLogLevelGetter} from '../misc';\nimport {LogLevel} from './logLevel.enum';\n\n/**\n * Options for logger that are used during logging\n */\n@Injectable({providedIn: 'root'})\nexport class LoggerOptions\n{\n //######################### public properties #########################\n\n /**\n * Minimal log level, that is used for logging, logs with lower log level are ignored\n */\n public minimumLogLevel: MinLogLevelGetter|undefined|null = () => LogLevel.Information;\n\n /**\n * Maximal allowed length of message, if it is exceeded it is trimmed\n */\n public messageLengthLimit: number|undefined|null = 500;\n\n /**\n * Logger message template that is used for creating message log, message log itself is inside `messageLog` property\n */\n public messageTemplate: string|undefined|null = '{{messageLog}}';\n\n /**\n * Array of enrichers that allows extending logger properties\n */\n public enrichers: LoggerEnricher[] = [];\n\n /**\n * Filter that filters out message logs\n */\n public filter: LoggerFilter|undefined|null = undefined;\n\n /**\n * Array of logger sinks that do actual logging\n */\n public loggerSinks: LoggerSink[] = [];\n}"]}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { formatString } from '@jscrpt/common';
|
|
2
|
+
/**
|
|
3
|
+
* Message log that contains all information that are used for displaying log
|
|
4
|
+
*/
|
|
5
|
+
export class MessageLog {
|
|
6
|
+
//######################### protected fields #########################
|
|
7
|
+
/**
|
|
8
|
+
* Datetime when was message created
|
|
9
|
+
*/
|
|
10
|
+
now = new Date();
|
|
11
|
+
//######################### public properties #########################
|
|
12
|
+
/**
|
|
13
|
+
* Message that is used as message template for log itself
|
|
14
|
+
*/
|
|
15
|
+
message;
|
|
16
|
+
/**
|
|
17
|
+
* Log level of current message log
|
|
18
|
+
*/
|
|
19
|
+
logLevel;
|
|
20
|
+
/**
|
|
21
|
+
* Properties that are "replaced" inside message
|
|
22
|
+
*/
|
|
23
|
+
properties;
|
|
24
|
+
/**
|
|
25
|
+
* Gets timestamp as ISO string
|
|
26
|
+
*/
|
|
27
|
+
get timestamp() {
|
|
28
|
+
return this.now.toISOString();
|
|
29
|
+
}
|
|
30
|
+
//######################### constructor #########################
|
|
31
|
+
constructor(message, logLevel, properties) {
|
|
32
|
+
this.message = message;
|
|
33
|
+
this.logLevel = logLevel;
|
|
34
|
+
this.properties = properties;
|
|
35
|
+
}
|
|
36
|
+
//######################### public methods #########################
|
|
37
|
+
/**
|
|
38
|
+
* Builds message that will be logged in logger sink
|
|
39
|
+
* @param messageTemplate - Global message template for log
|
|
40
|
+
* @param loggerProperties - Properties that are coming from logger itself
|
|
41
|
+
*/
|
|
42
|
+
buildMessage(messageTemplate, loggerProperties) {
|
|
43
|
+
const properties = { ...this.properties };
|
|
44
|
+
for (const property in loggerProperties) {
|
|
45
|
+
//only add new properties, do not replace existing ones
|
|
46
|
+
if (!(property in properties)) {
|
|
47
|
+
properties[property] = loggerProperties[property];
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
const messageLog = formatString(this.message, properties);
|
|
51
|
+
loggerProperties.messageLog = messageLog;
|
|
52
|
+
return formatString(messageTemplate, loggerProperties);
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
//# sourceMappingURL=messageLog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"messageLog.js","sourceRoot":"","sources":["../../../../../src/modules/logger/types/messageLog.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAI5C;;GAEG;AACH,MAAM,OAAO,UAAU;IAEnB,sEAAsE;IAEtE;;OAEG;IACO,GAAG,GAAS,IAAI,IAAI,EAAE,CAAC;IAEjC,uEAAuE;IAEvE;;OAEG;IACa,OAAO,CAAS;IAEhC;;OAEG;IACa,QAAQ,CAAW;IAEnC;;OAEG;IACa,UAAU,CAAc;IAExC;;OAEG;IACH,IAAW,SAAS;QAEhB,OAAO,IAAI,CAAC,GAAG,CAAC,WAAW,EAAE,CAAC;IAClC,CAAC;IAED,iEAAiE;IACjE,YAAY,OAAe,EAAE,QAAkB,EAAE,UAAuB;QAEpE,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QACzB,IAAI,CAAC,UAAU,GAAG,UAAU,CAAC;IACjC,CAAC;IAED,oEAAoE;IAEpE;;;;OAIG;IACI,YAAY,CAAC,eAAuB,EAAE,gBAAyC;QAElF,MAAM,UAAU,GAAG,EAAC,GAAG,IAAI,CAAC,UAAU,EAAC,CAAC;QAExC,KAAI,MAAM,QAAQ,IAAI,gBAAgB,EACtC;YACI,uDAAuD;YACvD,IAAG,CAAC,CAAC,QAAQ,IAAI,UAAU,CAAC,EAC5B;gBACK,UAAsC,CAAC,QAAQ,CAAC,GAAG,gBAAgB,CAAC,QAAQ,CAAC,CAAC;aAClF;SACJ;QAED,MAAM,UAAU,GAAG,YAAY,CAAC,IAAI,CAAC,OAAO,EAAE,UAAU,CAAC,CAAC;QAC1D,gBAAgB,CAAC,UAAU,GAAG,UAAU,CAAC;QAEzC,OAAO,YAAY,CAAC,eAAe,EAAE,gBAAgB,CAAC,CAAC;IAC3D,CAAC;CACJ","sourcesContent":["import {formatString} from '@jscrpt/common';\n\nimport {LogLevel} from './logLevel.enum';\n\n/**\n * Message log that contains all information that are used for displaying log\n */\nexport class MessageLog<TProperties extends Record<string, unknown> = Record<string, unknown>>\n{\n //######################### protected fields #########################\n\n /**\n * Datetime when was message created\n */\n protected now: Date = new Date();\n\n //######################### public properties #########################\n\n /**\n * Message that is used as message template for log itself\n */\n public readonly message: string;\n\n /**\n * Log level of current message log\n */\n public readonly logLevel: LogLevel;\n\n /**\n * Properties that are \"replaced\" inside message\n */\n public readonly properties: TProperties;\n\n /**\n * Gets timestamp as ISO string\n */\n public get timestamp(): string\n {\n return this.now.toISOString();\n }\n\n //######################### constructor #########################\n constructor(message: string, logLevel: LogLevel, properties: TProperties)\n {\n this.message = message;\n this.logLevel = logLevel;\n this.properties = properties;\n }\n\n //######################### public methods #########################\n\n /**\n * Builds message that will be logged in logger sink\n * @param messageTemplate - Global message template for log\n * @param loggerProperties - Properties that are coming from logger itself\n */\n public buildMessage(messageTemplate: string, loggerProperties: Record<string, unknown>): string\n {\n const properties = {...this.properties};\n\n for(const property in loggerProperties)\n {\n //only add new properties, do not replace existing ones\n if(!(property in properties))\n {\n (properties as Record<string, unknown>)[property] = loggerProperties[property];\n }\n }\n\n const messageLog = formatString(this.message, properties);\n loggerProperties.messageLog = messageLog;\n \n return formatString(messageTemplate, loggerProperties);\n }\n}"]}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
import {
|
|
1
|
+
var CookiePermanentStorage_1;
|
|
2
|
+
import { __decorate, __metadata } from "tslib";
|
|
3
|
+
import { Injectable, forwardRef } from '@angular/core';
|
|
3
4
|
import { CookieService } from '../cookies/cookies.service';
|
|
4
5
|
import { PERMANENT_STORAGE } from '../../types/tokens';
|
|
5
6
|
import { TypeProvider } from '../../types/providerDecoratedType';
|
|
@@ -8,7 +9,7 @@ import * as i1 from "../cookies/cookies.service";
|
|
|
8
9
|
/**
|
|
9
10
|
* Implementation of permanent storage using cookies
|
|
10
11
|
*/
|
|
11
|
-
class
|
|
12
|
+
let CookiePermanentStorage = CookiePermanentStorage_1 = class CookiePermanentStorage {
|
|
12
13
|
_cookies;
|
|
13
14
|
//######################### constructor #########################
|
|
14
15
|
constructor(_cookies) {
|
|
@@ -38,30 +39,15 @@ class CookiePermanentStorageService {
|
|
|
38
39
|
remove(name) {
|
|
39
40
|
this._cookies.deleteCookie(name, '/');
|
|
40
41
|
}
|
|
41
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
42
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
|
|
42
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CookiePermanentStorage, deps: [{ token: i1.CookieService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CookiePermanentStorage });
|
|
44
|
+
};
|
|
45
|
+
CookiePermanentStorage = CookiePermanentStorage_1 = __decorate([
|
|
46
|
+
TypeProvider({ provide: PERMANENT_STORAGE, useClass: forwardRef(() => CookiePermanentStorage_1) }),
|
|
47
|
+
__metadata("design:paramtypes", [CookieService])
|
|
48
|
+
], CookiePermanentStorage);
|
|
49
|
+
export { CookiePermanentStorage };
|
|
50
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: CookiePermanentStorage, decorators: [{
|
|
46
51
|
type: Injectable
|
|
47
52
|
}], ctorParameters: function () { return [{ type: i1.CookieService }]; } });
|
|
48
|
-
/**
|
|
49
|
-
* Provider for permanent storage that is using cookie storage implementation
|
|
50
|
-
*/
|
|
51
|
-
const COOKIE_PERMANENT_STORAGE = {
|
|
52
|
-
provide: PERMANENT_STORAGE,
|
|
53
|
-
useClass: CookiePermanentStorageService
|
|
54
|
-
};
|
|
55
|
-
/**
|
|
56
|
-
* Type that contains provider for cookie permanent storage when used with `providePermanentStorage`
|
|
57
|
-
*/
|
|
58
|
-
let CookiePermanentStorageType = class CookiePermanentStorageType {
|
|
59
|
-
};
|
|
60
|
-
CookiePermanentStorageType = __decorate([
|
|
61
|
-
TypeProvider(COOKIE_PERMANENT_STORAGE)
|
|
62
|
-
], CookiePermanentStorageType);
|
|
63
|
-
/**
|
|
64
|
-
* Sets permanent storage to use cookie permanent storage when used with `providePermanentStorage`
|
|
65
|
-
*/
|
|
66
|
-
export const CookiePermanentStorage = CookiePermanentStorageType;
|
|
67
53
|
//# sourceMappingURL=cookiePermanentStorage.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cookiePermanentStorage.service.js","sourceRoot":"","sources":["../../../../src/services/permanentStorage/cookiePermanentStorage.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cookiePermanentStorage.service.js","sourceRoot":"","sources":["../../../../src/services/permanentStorage/cookiePermanentStorage.service.ts"],"names":[],"mappings":";;AAAA,OAAO,EAAC,UAAU,EAAE,UAAU,EAAC,MAAM,eAAe,CAAC;AAGrD,OAAO,EAAC,aAAa,EAAC,MAAM,4BAA4B,CAAC;AACzD,OAAO,EAAC,iBAAiB,EAAC,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;;;AAE/D;;GAEG;AACH,IAEa,sBAAsB,8BAFnC,MAEa,sBAAsB;IAGX;IADpB,iEAAiE;IACjE,YAAoB,QAAuB;QAAvB,aAAQ,GAAR,QAAQ,CAAe;IAE3C,CAAC;IAED,2GAA2G;IAE3G;;;OAGG;IACI,GAAG,CAAU,IAAY;QAE5B,OAAO,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;IACzC,CAAC;IAiBD;;;;;OAKG;IACI,GAAG,CAAC,IAAY,EAAE,KAAU,EAAE,OAAc;QAE/C,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,IAAI,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAClF,CAAC;IAED;;;OAGG;IACI,MAAM,CAAC,IAAY;QAEtB,IAAI,CAAC,QAAQ,CAAC,YAAY,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC;IAC1C,CAAC;uGAnDQ,sBAAsB;2GAAtB,sBAAsB;;AAAtB,sBAAsB;IADlC,YAAY,CAAC,EAAC,OAAO,EAAE,iBAAiB,EAAE,QAAQ,EAAE,UAAU,CAAC,GAAG,EAAE,CAAC,wBAAsB,CAAC,EAAC,CAAC;qCAI7D,aAAa;GAHlC,sBAAsB,CAoDlC;SApDY,sBAAsB;2FAAtB,sBAAsB;kBAFlC,UAAU","sourcesContent":["import {Injectable, forwardRef} from '@angular/core';\n\nimport {PermanentStorage} from './permanentStorage.interface';\nimport {CookieService} from '../cookies/cookies.service';\nimport {PERMANENT_STORAGE} from '../../types/tokens';\nimport {TypeProvider} from '../../types/providerDecoratedType';\n\n/**\n * Implementation of permanent storage using cookies\n */\n@Injectable()\n@TypeProvider({provide: PERMANENT_STORAGE, useClass: forwardRef(() => CookiePermanentStorage)})\nexport class CookiePermanentStorage implements PermanentStorage\n{\n //######################### constructor #########################\n constructor(private _cookies: CookieService)\n {\n }\n\n //######################### public methods - implementation of StringLocalization #########################\n\n /**\n * Gets value that was stored with 'name' from permanent storage\n * @param name - Name with which was value stored\n */\n public get<TResult>(name: string): TResult\n {\n return this._cookies.getCookie(name);\n }\n\n /**\n * Sets value that will be stored with 'name'e in permanent storage\n * @param name - Name with which will be value stored\n * @param value - Value to be stored\n */\n public set(name: string, value: any): void;\n\n /**\n * Sets value that will be stored with 'name' in permanent storage until expiration date\n * @param name - Name with which will be value stored\n * @param value - Value to be stored\n * @param expires - Time when value should expire\n */\n public set(name: string, value: any, expires: Date): void;\n\n /**\n * Sets value that will be stored with 'name' in permanent storage until expiration date\n * @param name - Name with which will be value stored\n * @param value - Value to be stored\n * @param expires - Time when value should expire\n */\n public set(name: string, value: any, expires?: Date): void\n {\n this._cookies.setCookie(name, value, expires ? expires.valueOf() : null, '/');\n }\n\n /**\n * Removes value stored with 'name' from permanent storage\n * @param name - Name of stored value that will be removed\n */\n public remove(name: string): void\n {\n this._cookies.deleteCookie(name, '/');\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permanentStorage.interface.js","sourceRoot":"","sources":["../../../../src/services/permanentStorage/permanentStorage.interface.ts"],"names":[],"mappings":"","sourcesContent":["
|
|
1
|
+
{"version":3,"file":"permanentStorage.interface.js","sourceRoot":"","sources":["../../../../src/services/permanentStorage/permanentStorage.interface.ts"],"names":[],"mappings":"","sourcesContent":["/**\n * Provides api for implementing permanent storage\n */\nexport interface PermanentStorage\n{\n /**\n * Gets value that was stored with 'name' from permanent storage\n * @param name - Name with which was value stored\n */\n get<TResult>(name: string): TResult;\n\n /**\n * Sets value that will be stored with 'name'e in permanent storage\n * @param name - Name with which will be value stored\n * @param value - Value to be stored\n */\n set(name: string, value: any): void;\n\n /**\n * Sets value that will be stored with 'name' in permanent storage until expiration date\n * @param name - Name with which will be value stored\n * @param value - Value to be stored\n * @param expires - Time when value should expire\n */\n set(name: string, value: any, expires: Date): void;\n\n /**\n * Removes value stored with 'name' from permanent storage\n * @param name - Name of stored value that will be removed\n */\n remove(name: string): void;\n}"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"position.interface.js","sourceRoot":"","sources":["../../../../src/services/position/position.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Func1} from '@jscrpt/common';\nimport {Observable} from 'rxjs';\n\nimport {PositionOffsetString, PositionPlacement} from './position.types';\n\n/**\n * Options for autoupdate specific functionality\n */\nexport interface AutoUpdateOptions\n{\n /**\n * Indication whether update position when ancestor scroll changes\n */\n ancestorScroll: boolean;\n\n /**\n * Indication whether update position when ancestor size changes\n */\n ancestorResize: boolean;\n\n /**\n * Indication whether update position when target element changes size\n */\n elementResize: boolean;\n}\n\n/**\n * Defines object which describes offsets for positioned element\n */\nexport interface PositionOffsets\n{\n /**\n * Distance between positioned and reference element.\n */\n mainAxis?: number;\n\n /**\n * Skidding between floating and reference element.\n */\n crossAxis?: number;\n\n /**\n * Works on the same axis as crossAxis but applies only to aligned placements and works logically. The offset is inverted for -end alignments.\n */\n alignmentAxis?: number|null;\n}\n\n/**\n * Stores positioned element and reference element\n */\nexport interface PositionElements<TElement extends Element = Element>\n{\n /**\n * Reference element against which is object positioned\n */\n reference: TElement;\n\n /**\n * Element that is positioned\n */\n floating: TElement;\n}\n\n/**\n * Arguments that are passed during positioning\n */\nexport interface PositionArguments<TElement extends Element = Element>\n{\n /**\n * X coordinate of positioned element\n */\n x: number;\n\n /**\n * Y coordinate of positioned element\n */\n y: number;\n\n /**\n * Elements that are being used during positioning\n */\n elements: PositionElements<TElement>;\n}\n\n/**\n * Options that are passed to position service\n */\nexport interface PositionOptions\n{\n //######################### properties #########################\n\n /**\n * Placement of target element against source element\n */\n placement: PositionPlacement;\n\n /**\n * Offset which allows moving target element along the cross axis of placement, or any chosed direction\n */\n offset: PositionOffsetString|number|PositionOffsets|Func1<number|PositionOffsets, PositionArguments>;\n\n /**\n * Indication whether perform flip in case of collision (with view boundaries)\n */\n flip: boolean;\n\n /**\n * Indication whether set up 'auto updating' of position\n */\n autoUpdate: boolean|AutoUpdateOptions;\n\n /**\n * Mouse event that occured when positioning was called\n */\n mouseEvent?: MouseEvent;\n}\n\n/**\n * Result of positioning process, storing new coordinates\n */\nexport interface PositionResult<TElement extends Element = any>\n{\n /**\n * Target element to be positioned\n */\n target: TElement;\n\n /**\n * X coordinate of position of target\n */\n x: number;\n\n /**\n * Y coordinate of position of target\n */\n y: number;\n\n /**\n * Indication whether there was flip applied\n */\n flip: boolean;\n\n /**\n * Disposes instance of engine used for positioning\n */\n dispose(): void;\n}\n\n/**\n * Service that is used for positioning two elements against each other\n */\nexport interface Position\n{\n //######################### methods #########################\n\n /**\n * Places target element relatively to source element according options and returns result storing information about new position\n * @param target - Target element to be placed\n * @param source - Source element to be placed against\n * @param options - Optional options with informations about new position\n */\n placeElement(target: Element, source: Element, options?: Partial<PositionOptions>): Observable<PositionResult>;\n}"]}
|
|
@@ -5,7 +5,7 @@ import * as i0 from "@angular/core";
|
|
|
5
5
|
/**
|
|
6
6
|
* Default implementation of StringLocalization, which uses 'key' as localization text
|
|
7
7
|
*/
|
|
8
|
-
class
|
|
8
|
+
class NoStringLocalization {
|
|
9
9
|
//######################### private fields #########################
|
|
10
10
|
/**
|
|
11
11
|
* Subject used for emitting when indication that locale has changes and strings should be obtained again, because they have changed
|
|
@@ -30,11 +30,11 @@ class NoStringLocalizationService {
|
|
|
30
30
|
}
|
|
31
31
|
return formatString(key, interpolateParams);
|
|
32
32
|
}
|
|
33
|
-
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
34
|
-
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
33
|
+
static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: NoStringLocalization, deps: [], target: i0.ɵɵFactoryTarget.Injectable });
|
|
34
|
+
static ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: NoStringLocalization });
|
|
35
35
|
}
|
|
36
|
-
export {
|
|
37
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type:
|
|
36
|
+
export { NoStringLocalization };
|
|
37
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.1.4", ngImport: i0, type: NoStringLocalization, decorators: [{
|
|
38
38
|
type: Injectable
|
|
39
39
|
}] });
|
|
40
40
|
//# sourceMappingURL=noStringLocalization.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"noStringLocalization.service.js","sourceRoot":"","sources":["../../../../src/services/stringLocalization/noStringLocalization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAa,MAAM,MAAM,CAAC;;AAIzC;;GAEG;AACH,MACa,
|
|
1
|
+
{"version":3,"file":"noStringLocalization.service.js","sourceRoot":"","sources":["../../../../src/services/stringLocalization/noStringLocalization.service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AACzC,OAAO,EAAC,YAAY,EAAC,MAAM,gBAAgB,CAAC;AAC5C,OAAO,EAAC,OAAO,EAAa,MAAM,MAAM,CAAC;;AAIzC;;GAEG;AACH,MACa,oBAAoB;IAE7B,oEAAoE;IAEpE;;OAEG;IACK,mBAAmB,GAAkB,IAAI,OAAO,EAAQ,CAAC;IAEjE,8GAA8G;IAE9G;;OAEG;IACH,IAAW,WAAW;QAElB,OAAO,IAAI,CAAC,mBAAmB,CAAC,YAAY,EAAE,CAAC;IACnD,CAAC;IAED,2GAA2G;IAE3G;;;;OAIG;IACI,GAAG,CAAC,GAAW,EAAE,iBAA2C;QAE/D,IAAG,CAAC,iBAAiB,EACrB;YACI,OAAO,GAAG,CAAC;SACd;QAED,OAAO,YAAY,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC;IAChD,CAAC;uGAlCQ,oBAAoB;2GAApB,oBAAoB;;SAApB,oBAAoB;2FAApB,oBAAoB;kBADhC,UAAU","sourcesContent":["import {Injectable} from '@angular/core';\nimport {formatString} from '@jscrpt/common';\nimport {Subject, Observable} from 'rxjs';\n\nimport {StringLocalization} from './stringLocalization.interface';\n\n/**\n * Default implementation of StringLocalization, which uses 'key' as localization text\n */\n@Injectable()\nexport class NoStringLocalization implements StringLocalization\n{\n //######################### private fields #########################\n\n /**\n * Subject used for emitting when indication that locale has changes and strings should be obtained again, because they have changed\n */\n private _textsChangeSubject: Subject<void> = new Subject<void>();\n\n //######################### public properties - implementation of StringLocalization #########################\n\n /**\n * Occurs when indication that locale has changes and strings should be obtained again, because they have changed\n */\n public get textsChange(): Observable<void>\n {\n return this._textsChangeSubject.asObservable();\n }\n\n //######################### public methods - implementation of StringLocalization #########################\n\n /**\n * Gets localized string for specified key, interpolation might be used\n * @param key - Key to be localized\n * @param interpolateParams - Optional object storing interpolation parameters\n */\n public get(key: string, interpolateParams?: Record<string, unknown>): string\n {\n if(!interpolateParams)\n {\n return key;\n }\n\n return formatString(key, interpolateParams);\n }\n}\n"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"stringLocalization.interface.js","sourceRoot":"","sources":["../../../../src/services/stringLocalization/stringLocalization.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {
|
|
1
|
+
{"version":3,"file":"stringLocalization.interface.js","sourceRoot":"","sources":["../../../../src/services/stringLocalization/stringLocalization.interface.ts"],"names":[],"mappings":"","sourcesContent":["import {Observable} from 'rxjs';\n\n/**\n * Provides api to localize strings\n */\nexport interface StringLocalization\n{\n /**\n * Occurs when indication that locale has changes and strings should be obtained again, because they have changed\n */\n readonly textsChange: Observable<void>;\n\n /**\n * Gets localized string for specified key, interpolation might be used\n * @param key - Key to be localized\n * @param interpolateParams - Optional object storing interpolation parameters\n */\n get(key: string, interpolateParams?: Object): string;\n}\n"]}
|