From 8fa27cda200e3bf7f44e237a05a17dfa3d485eb0 Mon Sep 17 00:00:00 2001 From: Greg Richardson Date: Mon, 23 Dec 2024 12:30:59 -0700 Subject: [PATCH] fix: tsup cjs transpile errors --- packages/pg-gateway/src/auth/cert.ts | 3 ++- packages/pg-gateway/src/auth/md5.ts | 4 +++- packages/pg-gateway/src/auth/password.ts | 4 +++- packages/pg-gateway/src/auth/sasl/scram-sha-256.ts | 4 +++- 4 files changed, 11 insertions(+), 4 deletions(-) diff --git a/packages/pg-gateway/src/auth/cert.ts b/packages/pg-gateway/src/auth/cert.ts index 94e3528..cf7cf0d 100644 --- a/packages/pg-gateway/src/auth/cert.ts +++ b/packages/pg-gateway/src/auth/cert.ts @@ -21,7 +21,7 @@ export class CertAuthFlow extends BaseAuthFlow { validateCredentials: NonNullable; }; private username: string; - private completed = false; + private completed: boolean; constructor(params: { auth: CertAuthOptions; @@ -32,6 +32,7 @@ export class CertAuthFlow extends BaseAuthFlow { }) { super(params); + this.completed = false; this.auth = { ...params.auth, validateCredentials: diff --git a/packages/pg-gateway/src/auth/md5.ts b/packages/pg-gateway/src/auth/md5.ts index fe3f558..5bb7683 100644 --- a/packages/pg-gateway/src/auth/md5.ts +++ b/packages/pg-gateway/src/auth/md5.ts @@ -32,7 +32,7 @@ export class Md5AuthFlow extends BaseAuthFlow { }; private username: string; private salt: Uint8Array; - private completed = false; + private completed: boolean; constructor(params: { auth: Md5AuthOptions; @@ -42,6 +42,8 @@ export class Md5AuthFlow extends BaseAuthFlow { connectionState: ConnectionState; }) { super(params); + + this.completed = false; this.auth = { ...params.auth, validateCredentials: diff --git a/packages/pg-gateway/src/auth/password.ts b/packages/pg-gateway/src/auth/password.ts index 0344ab6..43b8868 100644 --- a/packages/pg-gateway/src/auth/password.ts +++ b/packages/pg-gateway/src/auth/password.ts @@ -31,7 +31,7 @@ export class PasswordAuthFlow extends BaseAuthFlow { validateCredentials: NonNullable; }; private username: string; - private completed = false; + private completed: boolean; constructor(params: { auth: PasswordAuthOptions; @@ -41,6 +41,8 @@ export class PasswordAuthFlow extends BaseAuthFlow { connectionState: ConnectionState; }) { super(params); + + this.completed = false; this.auth = { ...params.auth, validateCredentials: diff --git a/packages/pg-gateway/src/auth/sasl/scram-sha-256.ts b/packages/pg-gateway/src/auth/sasl/scram-sha-256.ts index 04e186e..0960f24 100644 --- a/packages/pg-gateway/src/auth/sasl/scram-sha-256.ts +++ b/packages/pg-gateway/src/auth/sasl/scram-sha-256.ts @@ -102,7 +102,7 @@ export class ScramSha256AuthFlow extends SaslMechanism implements AuthFlow { clientFirstMessageBare?: string; serverFirstMessage?: string; serverNonce?: string; - step: ScramSha256Step = ScramSha256Step.Initial; + step: ScramSha256Step; reader: BufferReader; scramSha256Data?: ScramSha256Data; connectionState: ConnectionState; @@ -115,6 +115,8 @@ export class ScramSha256AuthFlow extends SaslMechanism implements AuthFlow { connectionState: ConnectionState; }) { super({ writer: params.writer }); + + this.step = ScramSha256Step.Initial; this.username = params.username; this.auth = { ...params.auth,