Remove dependency on dom library from admin client (#35968)

Closes #25085

Signed-off-by: Jan Melcher <jan.melcher@aeb.com>
This commit is contained in:
Jan Melcher 2025-01-14 12:22:01 +01:00 committed by GitHub
parent 6322554da0
commit 8ddf94ca3b
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 5 additions and 4 deletions

View File

@ -36,7 +36,7 @@ export interface RequestArgs {
* Keys to be ignored, meaning that they will not be filtered out of the request payload even if they are a part of `urlParamKeys` or `queryParamKeys`,
*/
ignoredKeys?: string[];
headers?: HeadersInit;
headers?: [string, string][] | Record<string, string> | Headers;
}
const pick = (value: Record<string, unknown>, keys: string[]) =>
@ -197,7 +197,7 @@ export class Agent {
catchNotFound: boolean;
payloadKey?: string;
returnResourceIdInLocationHeader?: { field: string };
headers?: HeadersInit;
headers?: [string, string][] | Record<string, string> | Headers;
}) {
const newPath = urlJoin(this.#basePath, path);

View File

@ -116,6 +116,6 @@ export const getToken = async (settings: Settings): Promise<TokenResponse> => {
body: payload,
});
const data: TokenResponseRaw = await response.json();
const data = (await response.json()) as TokenResponseRaw;
return camelize(data);
};

View File

@ -14,7 +14,7 @@ export class NetworkError extends Error {
}
export async function fetchWithError(
input: RequestInfo | URL,
input: Request | string | URL,
init?: RequestInit,
) {
const response = await fetch(input, init);

View File

@ -2,6 +2,7 @@
"extends": "../../tsconfig.json",
"include": ["src"],
"compilerOptions": {
"lib": ["ESNext"],
"module": "Node16",
"moduleResolution": "Node16",
"outDir": "lib",