Some checks failed
Release Workflow / determine-release-type (push) Has been cancelled
Release Workflow / checks (push) Has been cancelled
Release Workflow / e2e-tests (push) Has been cancelled
Release Workflow / build-images (push) Has been cancelled
Release Workflow / publish-release (push) Has been cancelled
* chore(deps): bump the minor-patch group with 6 updates Bumps the minor-patch group with 6 updates: | Package | From | To | | --- | --- | --- | | @scalar/hono-api-reference | `0.9.44` | `0.9.45` | | @tanstack/react-router | `1.162.8` | `1.162.9` | | @tanstack/react-router-ssr-query | `1.162.8` | `1.162.9` | | @tanstack/react-start | `1.162.8` | `1.162.9` | | @hey-api/openapi-ts | `0.92.4` | `0.93.0` | | oxlint-tsgolint | `0.14.2` | `0.15.0` | Updates `@scalar/hono-api-reference` from 0.9.44 to 0.9.45 Updates `@tanstack/react-router` from 1.162.8 to 1.162.9 Updates `@tanstack/react-router-ssr-query` from 1.162.8 to 1.162.9 Updates `@tanstack/react-start` from 1.162.8 to 1.162.9 Updates `@hey-api/openapi-ts` from 0.92.4 to 0.93.0 Updates `oxlint-tsgolint` from 0.14.2 to 0.15.0 --- updated-dependencies: - dependency-name: "@scalar/hono-api-reference" dependency-version: 0.9.45 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch - dependency-name: "@tanstack/react-router" dependency-version: 1.162.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch - dependency-name: "@tanstack/react-router-ssr-query" dependency-version: 1.162.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch - dependency-name: "@tanstack/react-start" dependency-version: 1.162.9 dependency-type: direct:production update-type: version-update:semver-patch dependency-group: minor-patch - dependency-name: "@hey-api/openapi-ts" dependency-version: 0.93.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-patch - dependency-name: oxlint-tsgolint dependency-version: 0.15.0 dependency-type: direct:development update-type: version-update:semver-minor dependency-group: minor-patch ... Signed-off-by: dependabot[bot] <support@github.com> * chore: gen-api client --------- Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Nicolas Meienberger <github@thisprops.com>
42 lines
845 B
TypeScript
42 lines
845 B
TypeScript
// @ts-nocheck
|
|
// This file is auto-generated by @hey-api/openapi-ts
|
|
|
|
export type AuthToken = string | undefined;
|
|
|
|
export interface Auth {
|
|
/**
|
|
* Which part of the request do we use to send the auth?
|
|
*
|
|
* @default 'header'
|
|
*/
|
|
in?: "header" | "query" | "cookie";
|
|
/**
|
|
* Header or query parameter name.
|
|
*
|
|
* @default 'Authorization'
|
|
*/
|
|
name?: string;
|
|
scheme?: "basic" | "bearer";
|
|
type: "apiKey" | "http";
|
|
}
|
|
|
|
export const getAuthToken = async (
|
|
auth: Auth,
|
|
callback: ((auth: Auth) => Promise<AuthToken> | AuthToken) | AuthToken,
|
|
): Promise<string | undefined> => {
|
|
const token = typeof callback === "function" ? await callback(auth) : callback;
|
|
|
|
if (!token) {
|
|
return;
|
|
}
|
|
|
|
if (auth.scheme === "bearer") {
|
|
return `Bearer ${token}`;
|
|
}
|
|
|
|
if (auth.scheme === "basic") {
|
|
return `Basic ${btoa(token)}`;
|
|
}
|
|
|
|
return token;
|
|
};
|