Skip to content

Commit

Permalink
Merge branch 'main' into dependabot/npm_and_yarn/dependencies-f9951850c6
Browse files Browse the repository at this point in the history
  • Loading branch information
ewanharris authored Apr 9, 2024
2 parents 2dac02a + 06c579e commit 1f57002
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 5 deletions.
2 changes: 2 additions & 0 deletions .github/dependabot.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,3 +16,5 @@ updates:
dependencies:
patterns:
- "*"
exclude-patterns:
- "eslint"
7 changes: 7 additions & 0 deletions .madgerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"detectiveOptions": {
"ts": {
"skipTypeImports": true
}
}
}
1 change: 1 addition & 0 deletions .openapi-generator/FILES
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
.github/workflows/semgrep.yaml
.gitignore
.gitignore
.madgerc
.npmrc
CHANGELOG.md
CONTRIBUTING.md
Expand Down
8 changes: 3 additions & 5 deletions common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -180,15 +180,13 @@ export async function attemptHttpRequest<B, R>(
/**
* 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<any> => {
await setBearerAuthToObject(axiosArgs.options.headers, credentials!);

Expand Down

0 comments on commit 1f57002

Please sign in to comment.