mirror of
https://github.com/arsvendg/Stirling-PDF.git
synced 2026-07-17 11:45:05 +02:00
Fix any type usage in proprietary/ (#5949)
# Description of Changes Follow on from #5934, expanding `any` type usage ban to the `proprietary/` folder
This commit is contained in:
@@ -2,7 +2,7 @@ import { describe, it, expect, beforeEach, vi, afterEach } from 'vitest';
|
||||
import { springAuth } from '@app/auth/springAuthClient';
|
||||
import { startOAuthNavigation } from '@app/extensions/oauthNavigation';
|
||||
import apiClient from '@app/services/apiClient';
|
||||
import { AxiosError } from 'axios';
|
||||
import { AxiosError, type AxiosResponse, type InternalAxiosRequestConfig } from 'axios';
|
||||
|
||||
// Mock apiClient
|
||||
vi.mock('@app/services/apiClient');
|
||||
@@ -45,7 +45,7 @@ describe('SpringAuthClient', () => {
|
||||
vi.mocked(apiClient.get).mockResolvedValueOnce({
|
||||
status: 200,
|
||||
data: { user: mockUser },
|
||||
} as any);
|
||||
} as unknown as AxiosResponse);
|
||||
|
||||
const result = await springAuth.getSession();
|
||||
|
||||
@@ -74,7 +74,7 @@ describe('SpringAuthClient', () => {
|
||||
statusText: 'Unauthorized',
|
||||
data: {},
|
||||
headers: {},
|
||||
config: {} as any,
|
||||
config: {} as InternalAxiosRequestConfig,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -102,7 +102,7 @@ describe('SpringAuthClient', () => {
|
||||
statusText: 'Forbidden',
|
||||
data: {},
|
||||
headers: {},
|
||||
config: {} as any,
|
||||
config: {} as InternalAxiosRequestConfig,
|
||||
}
|
||||
);
|
||||
|
||||
@@ -141,7 +141,7 @@ describe('SpringAuthClient', () => {
|
||||
expires_in: 3600,
|
||||
},
|
||||
},
|
||||
} as any);
|
||||
} as unknown as AxiosResponse);
|
||||
|
||||
// Spy on window.dispatchEvent
|
||||
const dispatchEventSpy = vi.spyOn(window, 'dispatchEvent');
|
||||
@@ -208,7 +208,7 @@ describe('SpringAuthClient', () => {
|
||||
vi.mocked(apiClient.post).mockResolvedValueOnce({
|
||||
status: 200,
|
||||
data: { user: mockUser },
|
||||
} as any);
|
||||
} as unknown as AxiosResponse);
|
||||
|
||||
const result = await springAuth.signUp(credentials);
|
||||
|
||||
@@ -259,7 +259,7 @@ describe('SpringAuthClient', () => {
|
||||
vi.mocked(apiClient.post).mockResolvedValueOnce({
|
||||
status: 200,
|
||||
data: {},
|
||||
} as any);
|
||||
} as unknown as AxiosResponse);
|
||||
|
||||
const result = await springAuth.signOut();
|
||||
|
||||
@@ -308,7 +308,7 @@ describe('SpringAuthClient', () => {
|
||||
expires_in: 3600,
|
||||
},
|
||||
},
|
||||
} as any);
|
||||
} as unknown as AxiosResponse);
|
||||
|
||||
const result = await springAuth.refreshSession();
|
||||
|
||||
|
||||
@@ -85,7 +85,7 @@ export interface User {
|
||||
is_anonymous?: boolean;
|
||||
isFirstLogin?: boolean;
|
||||
authenticationType?: string;
|
||||
app_metadata?: Record<string, any>;
|
||||
app_metadata?: Record<string, unknown>;
|
||||
}
|
||||
|
||||
export interface Session {
|
||||
@@ -447,7 +447,7 @@ class SpringAuthClient {
|
||||
*/
|
||||
async signInWithOAuth(params: {
|
||||
provider: OAuthProvider;
|
||||
options?: { redirectTo?: string; queryParams?: Record<string, any> };
|
||||
options?: { redirectTo?: string; queryParams?: Record<string, string> };
|
||||
}): Promise<{ error: AuthError | null }> {
|
||||
try {
|
||||
const redirectPath = normalizeRedirectPath(params.options?.redirectTo);
|
||||
|
||||
Reference in New Issue
Block a user