From 468d32f18433fdfd66c11113ec0088588f279a01 Mon Sep 17 00:00:00 2001 From: BlueSkiesAndGreenPastures Date: Fri, 20 Jun 2025 12:30:51 -0500 Subject: [PATCH] adjusted things for feedback/clarity --- bskylink/src/cache/cache.ts | 2 +- bskylink/src/cache/ozoneAgent.ts | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/bskylink/src/cache/cache.ts b/bskylink/src/cache/cache.ts index ae98197596..1f8ee7b8ea 100644 --- a/bskylink/src/cache/cache.ts +++ b/bskylink/src/cache/cache.ts @@ -7,7 +7,7 @@ let cacheCursor: string | undefined export class EventCache { private rules = new Map() - private cfg: ServiceConfig | undefined = undefined + private cfg: ServiceConfig private pollInterval = 1 * 1000 // start at 1 second constructor(cfg: ServiceConfig) { diff --git a/bskylink/src/cache/ozoneAgent.ts b/bskylink/src/cache/ozoneAgent.ts index 4bbbd4865b..80ae41d289 100644 --- a/bskylink/src/cache/ozoneAgent.ts +++ b/bskylink/src/cache/ozoneAgent.ts @@ -5,12 +5,12 @@ import {type ServiceConfig} from '../config' export class OzoneAgent { public session: CredentialSession public agent: AtpAgent - private cfg?: ServiceConfig + private cfg: ServiceConfig constructor(cfg: ServiceConfig) { this.cfg = cfg this.session = new CredentialSession( - new URL(cfg?.ozoneUrl || 'http://localhost:2583'), + new URL(cfg.ozoneUrl || 'http://localhost:2583'), ) this.agent = new AtpAgent(this.session) } @@ -23,14 +23,14 @@ export class OzoneAgent { } public async getAgent(): Promise { - if (!this.cfg?.ozoneAgentHandle && !this.cfg?.ozoneAgentPass) { + if (!this.cfg.ozoneAgentHandle && !this.cfg.ozoneAgentPass) { throw new Error( 'OZONE_AGENT_HANDLE and OZONE_AGENT_PASS environment variables must be set', ) } - const identifier = this.cfg?.ozoneAgentHandle || 'did:plc:invalid' - const password = this.cfg?.ozoneAgentPass || 'invalid' + const identifier = this.cfg.ozoneAgentHandle || 'did:plc:invalid' + const password = this.cfg.ozoneAgentPass || 'invalid' if (!this.session.hasSession) { await this.session.login({identifier, password})