From 1708f0e1c59400f7b4012d2c8b4ab7a8e204f58d Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:38:38 +0100 Subject: [PATCH 1/3] fix: resolve circular import --- common.ts | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/common.ts b/common.ts index a8b2587..2f054bd 100644 --- a/common.ts +++ b/common.ts @@ -14,7 +14,7 @@ import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios"; import { Configuration } from "./configuration"; -import { Credentials } from "./credentials"; +import type { Credentials } from "./credentials"; import { FgaApiError, FgaApiInternalError, @@ -180,15 +180,13 @@ export async function attemptHttpRequest( /** * creates an axios request function */ -export const createRequestFunction = function (axiosArgs: RequestArgs, axiosInstance: AxiosInstance, configuration: Configuration, credentials?: Credentials) { +export const createRequestFunction = function (axiosArgs: RequestArgs, axiosInstance: AxiosInstance, configuration: Configuration, credentials: Credentials) { configuration.isValid(); const retryParams = axiosArgs.options?.retryParams ? axiosArgs.options?.retryParams : configuration.retryParams; const maxRetry:number = retryParams ? retryParams.maxRetry : 0; const minWaitInMs:number = retryParams ? retryParams.minWaitInMs : 0; - if (!credentials) { - credentials = Credentials.init(configuration); - } + return async (axios: AxiosInstance = axiosInstance) : PromiseResult => { await setBearerAuthToObject(axiosArgs.options.headers, credentials!); From 3ac69f299213293aeef9bfd165db562c520dba8f Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:47:46 +0100 Subject: [PATCH 2/3] chore: ignore type imports --- .madgerc | 7 +++++++ .openapi-generator/FILES | 1 + 2 files changed, 8 insertions(+) create mode 100644 .madgerc diff --git a/.madgerc b/.madgerc new file mode 100644 index 0000000..0646516 --- /dev/null +++ b/.madgerc @@ -0,0 +1,7 @@ +{ + "detectiveOptions": { + "ts": { + "skipTypeImports": true + } + } +} \ No newline at end of file diff --git a/.openapi-generator/FILES b/.openapi-generator/FILES index 3bdd2bf..7ddd706 100644 --- a/.openapi-generator/FILES +++ b/.openapi-generator/FILES @@ -11,6 +11,7 @@ .github/workflows/semgrep.yaml .gitignore .gitignore +.madgerc .npmrc CHANGELOG.md CONTRIBUTING.md From 34533c2aabf45ad08b658a56c585440853456540 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:56:48 +0100 Subject: [PATCH 3/3] ci(dependabot): ignore eslint for now --- .github/dependabot.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/dependabot.yaml b/.github/dependabot.yaml index 045feb1..7ce60d7 100644 --- a/.github/dependabot.yaml +++ b/.github/dependabot.yaml @@ -16,3 +16,5 @@ updates: dependencies: patterns: - "*" + exclude-patterns: + - "eslint"