From 29a8ebac075a1e3abd0012dd01e85729cbffa1da Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:36:36 +0100 Subject: [PATCH 1/3] fix(js-sdk): resolve circular import --- config/clients/js/template/common.mustache | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/config/clients/js/template/common.mustache b/config/clients/js/template/common.mustache index 835c292c..aafa4ddd 100644 --- a/config/clients/js/template/common.mustache +++ b/config/clients/js/template/common.mustache @@ -3,7 +3,7 @@ import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios"; import { Configuration } from "./configuration"; -import { Credentials } from "./credentials"; +import type { Credentials } from "./credentials"; import { FgaApiError, FgaApiInternalError, @@ -169,15 +169,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 5ba49d5d053d37f0e58f09997042925020fa3351 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:48:07 +0100 Subject: [PATCH 2/3] chore(js-sdk): ignore type imports --- config/clients/js/config.overrides.json | 3 ++- config/clients/js/template/.madgerc | 7 +++++++ 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 config/clients/js/template/.madgerc diff --git a/config/clients/js/config.overrides.json b/config/clients/js/config.overrides.json index 44ba030f..2c15b98d 100644 --- a/config/clients/js/config.overrides.json +++ b/config/clients/js/config.overrides.json @@ -117,6 +117,7 @@ "example/example1/package.json.mustache": { "destinationFilename": "example/example1/package.json", "templateType": "SupportingFiles" - } + }, + ".madgerc": {} } } diff --git a/config/clients/js/template/.madgerc b/config/clients/js/template/.madgerc new file mode 100644 index 00000000..0646516f --- /dev/null +++ b/config/clients/js/template/.madgerc @@ -0,0 +1,7 @@ +{ + "detectiveOptions": { + "ts": { + "skipTypeImports": true + } + } +} \ No newline at end of file From 54808b50b9f356c4eb187b079307d1646a953297 Mon Sep 17 00:00:00 2001 From: Ewan Harris Date: Tue, 9 Apr 2024 14:58:45 +0100 Subject: [PATCH 3/3] ci(js-sdk): ignore eslint for now --- config/clients/js/template/.github/dependabot.yaml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/config/clients/js/template/.github/dependabot.yaml b/config/clients/js/template/.github/dependabot.yaml index 045feb13..7ce60d74 100644 --- a/config/clients/js/template/.github/dependabot.yaml +++ b/config/clients/js/template/.github/dependabot.yaml @@ -16,3 +16,5 @@ updates: dependencies: patterns: - "*" + exclude-patterns: + - "eslint"