From b8fa4439acbf4af37840284b3eaecccf583f8b35 Mon Sep 17 00:00:00 2001 From: pamapa Date: Fri, 14 Jan 2022 10:20:59 +0100 Subject: [PATCH] feat: move ErrorResponse into error sub-dir --- src/JsonService.test.ts | 2 +- src/JsonService.ts | 2 +- src/OidcClient.test.ts | 2 +- src/OidcClient.ts | 2 +- src/ResponseValidator.test.ts | 2 +- src/ResponseValidator.ts | 2 +- src/UserManager.ts | 5 +++-- src/{ => errors}/ErrorResponse.test.ts | 0 src/{ => errors}/ErrorResponse.ts | 2 +- src/errors/index.ts | 1 + src/index.ts | 2 +- 11 files changed, 12 insertions(+), 10 deletions(-) rename src/{ => errors}/ErrorResponse.test.ts (100%) rename src/{ => errors}/ErrorResponse.ts (98%) create mode 100644 src/errors/index.ts diff --git a/src/JsonService.test.ts b/src/JsonService.test.ts index 830ff8af7..5c65f9d0e 100644 --- a/src/JsonService.test.ts +++ b/src/JsonService.test.ts @@ -1,7 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -import { ErrorResponse } from "./ErrorResponse"; +import { ErrorResponse } from "./errors"; import { JsonService } from "./JsonService"; import { mocked } from "jest-mock"; diff --git a/src/JsonService.ts b/src/JsonService.ts index 839a3e908..88fc7158c 100644 --- a/src/JsonService.ts +++ b/src/JsonService.ts @@ -1,7 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -import { ErrorResponse } from "./ErrorResponse"; +import { ErrorResponse } from "./errors"; import { Logger } from "./utils"; /** diff --git a/src/OidcClient.test.ts b/src/OidcClient.test.ts index 12ca89547..a8147f2cc 100644 --- a/src/OidcClient.test.ts +++ b/src/OidcClient.test.ts @@ -2,6 +2,7 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { JwtUtils } from "./utils"; +import type { ErrorResponse } from "./errors"; import type { JwtClaims } from "./Claims"; import { OidcClient } from "./OidcClient"; import { OidcClientSettingsStore } from "./OidcClientSettings"; @@ -10,7 +11,6 @@ import { State } from "./State"; import { SigninRequest } from "./SigninRequest"; import { SignoutRequest } from "./SignoutRequest"; import { SignoutResponse } from "./SignoutResponse"; -import type { ErrorResponse } from "./ErrorResponse"; import { RefreshState } from "./RefreshState"; import { SigninResponse } from "./SigninResponse"; diff --git a/src/OidcClient.ts b/src/OidcClient.ts index b422a590b..b566731c9 100644 --- a/src/OidcClient.ts +++ b/src/OidcClient.ts @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { Logger, UrlUtils } from "./utils"; +import { ErrorResponse } from "./errors"; import { OidcClientSettings, OidcClientSettingsStore } from "./OidcClientSettings"; import { ResponseValidator } from "./ResponseValidator"; import { MetadataService } from "./MetadataService"; -import { ErrorResponse } from "./ErrorResponse"; import type { RefreshState } from "./RefreshState"; import { SigninRequest } from "./SigninRequest"; import { SigninResponse } from "./SigninResponse"; diff --git a/src/ResponseValidator.test.ts b/src/ResponseValidator.test.ts index fa820fb61..687eba88e 100644 --- a/src/ResponseValidator.test.ts +++ b/src/ResponseValidator.test.ts @@ -2,12 +2,12 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { JwtUtils } from "./utils"; +import { ErrorResponse } from "./errors"; import { ResponseValidator } from "./ResponseValidator"; import { MetadataService } from "./MetadataService"; import type { SigninState } from "./SigninState"; import type { SigninResponse } from "./SigninResponse"; import type { SignoutResponse } from "./SignoutResponse"; -import { ErrorResponse } from "./ErrorResponse"; import type { UserProfile } from "./User"; import type { OidcClientSettingsStore } from "./OidcClientSettings"; import { mocked } from "jest-mock"; diff --git a/src/ResponseValidator.ts b/src/ResponseValidator.ts index 31eedf2e1..efc889b03 100644 --- a/src/ResponseValidator.ts +++ b/src/ResponseValidator.ts @@ -2,10 +2,10 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { Logger, JwtUtils } from "./utils"; +import { ErrorResponse } from "./errors"; import type { MetadataService } from "./MetadataService"; import { UserInfoService } from "./UserInfoService"; import { TokenClient } from "./TokenClient"; -import { ErrorResponse } from "./ErrorResponse"; import type { OidcClientSettingsStore } from "./OidcClientSettings"; import type { SigninState } from "./SigninState"; import type { SigninResponse } from "./SigninResponse"; diff --git a/src/UserManager.ts b/src/UserManager.ts index fed24e571..aae2cefff 100644 --- a/src/UserManager.ts +++ b/src/UserManager.ts @@ -2,7 +2,9 @@ // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. import { Logger } from "./utils"; -import { IFrameNavigator, NavigateResponse, PopupNavigator, RedirectNavigator, PopupWindowParams, IWindow, IFrameWindowParams, RedirectParams } from "./navigators"; +import { ErrorResponse } from "./errors"; +import { IFrameNavigator, NavigateResponse, PopupNavigator, RedirectNavigator, PopupWindowParams, + IWindow, IFrameWindowParams, RedirectParams } from "./navigators"; import { OidcClient, CreateSigninRequestArgs, CreateSignoutRequestArgs } from "./OidcClient"; import { UserManagerSettings, UserManagerSettingsStore } from "./UserManagerSettings"; import { User } from "./User"; @@ -11,7 +13,6 @@ import { SilentRenewService } from "./SilentRenewService"; import { SessionMonitor } from "./SessionMonitor"; import type { SessionStatus } from "./SessionStatus"; import type { SignoutResponse } from "./SignoutResponse"; -import { ErrorResponse } from "./ErrorResponse"; import type { MetadataService } from "./MetadataService"; import { RefreshState } from "./RefreshState"; diff --git a/src/ErrorResponse.test.ts b/src/errors/ErrorResponse.test.ts similarity index 100% rename from src/ErrorResponse.test.ts rename to src/errors/ErrorResponse.test.ts diff --git a/src/ErrorResponse.ts b/src/errors/ErrorResponse.ts similarity index 98% rename from src/ErrorResponse.ts rename to src/errors/ErrorResponse.ts index 8223d29a8..249b56f44 100644 --- a/src/ErrorResponse.ts +++ b/src/errors/ErrorResponse.ts @@ -1,7 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. -import { Logger } from "./utils"; +import { Logger } from "../utils"; /** * Error class thrown in case of an authentication error. diff --git a/src/errors/index.ts b/src/errors/index.ts new file mode 100644 index 000000000..3a1a3ec82 --- /dev/null +++ b/src/errors/index.ts @@ -0,0 +1 @@ +export * from "./ErrorResponse"; \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 4cd2d2cff..a711c01c6 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,6 +1,7 @@ // Copyright (c) Brock Allen & Dominick Baier. All rights reserved. // Licensed under the Apache License, Version 2.0. See LICENSE in the project root for license information. +export { ErrorResponse } from "./errors"; export type { IFrameWindowParams, PopupWindowParams, RedirectParams } from "./navigators"; export { Log, Logger } from "./utils"; export type { ILogger, PopupWindowFeatures } from "./utils"; @@ -9,7 +10,6 @@ export type { OidcAddressClaim, OidcStandardClaims, IdTokenClaims, JwtClaims } f export { AccessTokenEvents } from "./AccessTokenEvents"; export type { AccessTokenCallback } from "./AccessTokenEvents"; export { CheckSessionIFrame } from "./CheckSessionIFrame"; -export { ErrorResponse } from "./ErrorResponse"; export { InMemoryWebStorage } from "./InMemoryWebStorage"; export { MetadataService } from "./MetadataService"; export * from "./OidcClient";