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; +}