From ebeadda9fa91c2052057d658365df0ad073ae660 Mon Sep 17 00:00:00 2001 From: Jacob Overgaard <752371+iOvergaard@users.noreply.github.com> Date: Mon, 5 Feb 2024 14:45:57 +0100 Subject: [PATCH] model to hold openapi configuration --- .../auth/models/openApiConfiguration.ts | 32 +++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 src/Umbraco.Web.UI.Client/src/shared/auth/models/openApiConfiguration.ts diff --git a/src/Umbraco.Web.UI.Client/src/shared/auth/models/openApiConfiguration.ts b/src/Umbraco.Web.UI.Client/src/shared/auth/models/openApiConfiguration.ts new file mode 100644 index 0000000000..0bdc8ea97a --- /dev/null +++ b/src/Umbraco.Web.UI.Client/src/shared/auth/models/openApiConfiguration.ts @@ -0,0 +1,32 @@ +/** + * Configuration for the OpenAPI (Umbraco) server. This is used to communicate with the Management API. + * This is useful if you want to configure your Fetch, Axios or other HTTP client to communicate with the Management API. + * If you use the recommended resource generator [openapi-typescript-codegen](https://github.com/ferdikoomen/openapi-typescript-codegen) this can be used to configure the `OpenAPI` object. + */ +export interface UmbOpenApiConfiguration { + /** + * The base URL of the OpenAPI (Umbraco) server. + */ + readonly base: string; + + /** + * The configured version of the Management API to use. + */ + readonly version: string; + + /** + * The `withCredentials` option for the Fetch API. + */ + readonly withCredentials: boolean; + + /** + * The `credentials` option for the Fetch API. + */ + readonly credentials: 'include' | 'omit' | 'same-origin'; + + /** + * The token to use for the Authorization header. + * @returns A resolver for the token to use for the Authorization header. + */ + readonly token: () => Promise; +}