forked from minio/operator
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Daniel Valdivia <[email protected]>
- Loading branch information
Showing
64 changed files
with
3,475 additions
and
4,458 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# Ignore git items | ||
.gitignore | ||
.git/ | ||
:include .gitignore | ||
|
||
# Common large paths | ||
node_modules/ | ||
portal-ui/node_modules/ | ||
build/ | ||
dist/ | ||
.idea/ | ||
vendor/ | ||
.env/ | ||
.venv/ | ||
.tox/ | ||
*.min.js | ||
|
||
# Common test paths | ||
test/ | ||
tests/ | ||
*_test.go | ||
|
||
# Semgrep rules folder | ||
.semgrep | ||
|
||
# Semgrep-action log folder | ||
.semgrep_logs/ | ||
|
||
# Ignore VsCode files | ||
.vscode/ | ||
*.code-workspace | ||
*~ | ||
.eslintcache | ||
|
||
operatorApi.ts |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { Api, Error, FullRequestParams, HttpResponse } from "./operatorApi"; | ||
|
||
export let api = new Api(); | ||
const internalRequestFunc = api.request; | ||
api.request = async <T = any, E = any>({ | ||
body, | ||
secure, | ||
path, | ||
type, | ||
query, | ||
format, | ||
baseUrl, | ||
cancelToken, | ||
...params | ||
}: FullRequestParams): Promise<HttpResponse<T, E>> => { | ||
const internalResp = internalRequestFunc({ | ||
body, | ||
secure, | ||
path, | ||
type, | ||
query, | ||
format, | ||
baseUrl, | ||
cancelToken, | ||
...params, | ||
}); | ||
return internalResp.then(CommonAPIValidation); | ||
}; | ||
|
||
export function CommonAPIValidation<D, E>( | ||
res: HttpResponse<D, E> | ||
): HttpResponse<D, E> { | ||
const err = res.error as Error; | ||
if (err && err.code === 403 && err.message === "invalid session") { | ||
document.location = "/"; | ||
} | ||
return res; | ||
} |
Oops, something went wrong.