Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SPSH-1387 #372

Open
wants to merge 8 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
239 changes: 239 additions & 0 deletions src/api-client/generated/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -865,6 +865,25 @@ export const EmailAddressStatus = {
export type EmailAddressStatus = typeof EmailAddressStatus[keyof typeof EmailAddressStatus];


/**
*
* @export
* @interface FeatureFlagResponse
*/
export interface FeatureFlagResponse {
/**
*
* @type {boolean}
* @memberof FeatureFlagResponse
*/
'rolleBearbeitenEnabled': boolean;
/**
*
* @type {boolean}
* @memberof FeatureFlagResponse
*/
'befristungBearbeitenEnabled': boolean;
}
/**
*
* @export
Expand Down Expand Up @@ -3996,6 +4015,116 @@ export class Class2FAApi extends BaseAPI implements Class2FAApiInterface {
}


/**
* ConfigApi - axios parameter creator
* @export
*/
export const ConfigApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
configControllerGetFeatureFlags: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/config`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};

/**
* ConfigApi - functional programming interface
* @export
*/
export const ConfigApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = ConfigApiAxiosParamCreator(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async configControllerGetFeatureFlags(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<FeatureFlagResponse>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.configControllerGetFeatureFlags(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* ConfigApi - factory interface
* @export
*/
export const ConfigApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = ConfigApiFp(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
configControllerGetFeatureFlags(options?: any): AxiosPromise<FeatureFlagResponse> {
return localVarFp.configControllerGetFeatureFlags(options).then((request) => request(axios, basePath));
},
};
};

/**
* ConfigApi - interface
* @export
* @interface ConfigApi
*/
export interface ConfigApiInterface {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigApiInterface
*/
configControllerGetFeatureFlags(options?: AxiosRequestConfig): AxiosPromise<FeatureFlagResponse>;

}

/**
* ConfigApi - object-oriented interface
* @export
* @class ConfigApi
* @extends {BaseAPI}
*/
export class ConfigApi extends BaseAPI implements ConfigApiInterface {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof ConfigApi
*/
public configControllerGetFeatureFlags(options?: AxiosRequestConfig) {
return ConfigApiFp(this.configuration).configControllerGetFeatureFlags(options).then((request) => request(this.axios, this.basePath));
}
}


/**
* CronApi - axios parameter creator
* @export
Expand Down Expand Up @@ -10085,3 +10214,113 @@ export class RolleApi extends BaseAPI implements RolleApiInterface {
}


/**
* StatusApi - axios parameter creator
* @export
*/
export const StatusApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
statusControllerGetStatus: async (options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
const localVarPath = `/api/status`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
if (configuration) {
baseOptions = configuration.baseOptions;
}

const localVarRequestOptions = { method: 'GET', ...baseOptions, ...options};
const localVarHeaderParameter = {} as any;
const localVarQueryParameter = {} as any;



setSearchParams(localVarUrlObj, localVarQueryParameter);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};

return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
}
};

/**
* StatusApi - functional programming interface
* @export
*/
export const StatusApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = StatusApiAxiosParamCreator(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async statusControllerGetStatus(options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.statusControllerGetStatus(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* StatusApi - factory interface
* @export
*/
export const StatusApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = StatusApiFp(configuration)
return {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
statusControllerGetStatus(options?: any): AxiosPromise<void> {
return localVarFp.statusControllerGetStatus(options).then((request) => request(axios, basePath));
},
};
};

/**
* StatusApi - interface
* @export
* @interface StatusApi
*/
export interface StatusApiInterface {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof StatusApiInterface
*/
statusControllerGetStatus(options?: AxiosRequestConfig): AxiosPromise<void>;

}

/**
* StatusApi - object-oriented interface
* @export
* @class StatusApi
* @extends {BaseAPI}
*/
export class StatusApi extends BaseAPI implements StatusApiInterface {
/**
*
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof StatusApi
*/
public statusControllerGetStatus(options?: AxiosRequestConfig) {
return StatusApiFp(this.configuration).statusControllerGetStatus(options).then((request) => request(this.axios, this.basePath));
}
}


53 changes: 53 additions & 0 deletions src/api-client/openapispec.json
Original file line number Diff line number Diff line change
Expand Up @@ -4447,6 +4447,44 @@
}
]
}
},
"/api/status": {
"get": {
"operationId": "StatusController_getStatus",
"parameters": [],
"responses": {
"200": {
"description": ""
}
},
"tags": [
"status"
]
}
},
"/api/config": {
"get": {
"operationId": "ConfigController_getFeatureFlags",
"parameters": [],
"responses": {
"200": {
"description": "The feature flag config was successfully returned.",
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/FeatureFlagResponse"
}
}
}
},
"500": {
"description": "Internal server error while getting the config."
}
},
"tags": [
"config"
]
}
}
},
"info": {
Expand Down Expand Up @@ -6843,6 +6881,21 @@
"i18nKey",
"code"
]
},
"FeatureFlagResponse": {
"type": "object",
"properties": {
"rolleBearbeitenEnabled": {
"type": "boolean"
},
"befristungBearbeitenEnabled": {
"type": "boolean"
}
},
"required": [
"rolleBearbeitenEnabled",
"befristungBearbeitenEnabled"
]
}
}
}
Expand Down
12 changes: 9 additions & 3 deletions src/main.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,20 @@
import { createApp } from 'vue';
import { createApp, type App as VueApp } from 'vue';
import App from './App.vue';
import i18n from './plugins/i18n';
import router from './router';
import vuetify from './plugins/vuetify';
import pinia from './plugins/pinia';
import { useConfigStore, type ConfigStore } from './stores/ConfigStore';

// prettier-ignore
createApp(App)
const app: VueApp<Element> = createApp(App)
.use(i18n)
.use(pinia)
.use(router)
.use(vuetify)
.mount('#app')

// Fetch feature flags on app startup
const configStore: ConfigStore = useConfigStore();
configStore.getFeatureFlags();

app.mount('#app');
Loading
Loading