UNPKG

@credo-ts/core

Version:

<p align="center"> <br /> <img alt="Credo Logo" src="https://github.com/openwallet-foundation/credo-ts/blob/c7886cb8377ceb8ee4efe8d264211e561a75072d/images/credo-logo.png" height="250px" /> </p> <h1 align="center"><b>Credo - Core</b></h1

1 lines • 1.96 kB
{"version":3,"file":"AgentConfig.mjs","names":[],"sources":["../../src/agent/AgentConfig.ts"],"sourcesContent":["import { DEFAULT_SKEW_TIME } from '../crypto/jose/jwt/JwtPayload'\nimport type { Logger } from '../logger'\nimport { ConsoleLogger, LogLevel } from '../logger'\nimport type { InitConfig } from '../types'\nimport type { AgentDependencies } from './AgentDependencies'\n\nexport class AgentConfig {\n private initConfig: InitConfig\n public logger: Logger\n public readonly agentDependencies: AgentDependencies\n\n public constructor(initConfig: InitConfig, agentDependencies: AgentDependencies) {\n this.initConfig = initConfig\n this.logger = initConfig.logger ?? new ConsoleLogger(LogLevel.Off)\n this.agentDependencies = agentDependencies\n }\n\n public get allowInsecureHttpUrls() {\n return this.initConfig.allowInsecureHttpUrls ?? false\n }\n\n public get autoUpdateStorageOnStartup() {\n return this.initConfig.autoUpdateStorageOnStartup ?? false\n }\n\n public get validitySkewSeconds() {\n return this.initConfig.validitySkewSeconds ?? DEFAULT_SKEW_TIME\n }\n\n public extend(config: Partial<InitConfig>): AgentConfig {\n return new AgentConfig({ ...this.initConfig, logger: this.logger, ...config }, this.agentDependencies)\n }\n\n public toJSON() {\n return {\n ...this.initConfig,\n logger: this.logger.logLevel,\n agentDependencies: Boolean(this.agentDependencies),\n }\n }\n}\n"],"mappings":";;;;;;;AAMA,IAAa,cAAb,MAAa,YAAY;CAKvB,AAAO,YAAY,YAAwB,mBAAsC;AAC/E,OAAK,aAAa;AAClB,OAAK,SAAS,WAAW,UAAU,IAAI,cAAc,SAAS,IAAI;AAClE,OAAK,oBAAoB;;CAG3B,IAAW,wBAAwB;AACjC,SAAO,KAAK,WAAW,yBAAyB;;CAGlD,IAAW,6BAA6B;AACtC,SAAO,KAAK,WAAW,8BAA8B;;CAGvD,IAAW,sBAAsB;AAC/B,SAAO,KAAK,WAAW,uBAAuB;;CAGhD,AAAO,OAAO,QAA0C;AACtD,SAAO,IAAI,YAAY;GAAE,GAAG,KAAK;GAAY,QAAQ,KAAK;GAAQ,GAAG;GAAQ,EAAE,KAAK,kBAAkB;;CAGxG,AAAO,SAAS;AACd,SAAO;GACL,GAAG,KAAK;GACR,QAAQ,KAAK,OAAO;GACpB,mBAAmB,QAAQ,KAAK,kBAAkB;GACnD"}