From 3cd1c5b7f1130983572fe636a2643301e11bb457 Mon Sep 17 00:00:00 2001 From: Thomas Feldtkeller Date: Fri, 26 Jan 2024 16:20:58 +0100 Subject: [PATCH] update api for administration api for student and school creation (#3050) --- jsconfig.json | 176 +++++++++++++++++++ src/serverApi/v3/api.ts | 374 +++++++++++++++++++++++++++++++++++++++- 2 files changed, 548 insertions(+), 2 deletions(-) create mode 100644 jsconfig.json diff --git a/jsconfig.json b/jsconfig.json new file mode 100644 index 0000000000..759d796865 --- /dev/null +++ b/jsconfig.json @@ -0,0 +1,176 @@ +{ + "baseUrl": ".", + "include": ["src/**/*"], + "compilerOptions": { + "baseUrl": ".", + "target": "esnext", + "module": "es2015", + "paths": { + "@components/legacy/TheFooter/*": [ + "./src/themes/default/components/legacy/TheFooter.vue/*" + ], + "@components/legacy/TheFooter": [ + "./src/themes/default/components/legacy/TheFooter.vue/index.js", + "./src/themes/default/components/legacy/TheFooter.vue/index.json", + "./src/themes/default/components/legacy/TheFooter.vue/index.vue", + "./src/themes/default/components/legacy/TheFooter.vue/index.scss", + "./src/themes/default/components/legacy/TheFooter.vue/index.css" + ], + "@/*": ["src/*"], + "@": [ + "src/index.js", + "src/index.json", + "src/index.vue", + "src/index.scss", + "src/index.css" + ], + "@@/*": ["./*"], + "@@": [ + "./index.js", + "./index.json", + "./index.vue", + "./index.scss", + "./index.css" + ], + "@locale/*": ["locale/*"], + "@locale": [ + "locale/index.js", + "locale/index.json", + "locale/index.vue", + "locale/index.scss", + "locale/index.css" + ], + "@assets/*": ["src/assets/*"], + "@assets": [ + "src/assets/index.js", + "src/assets/index.json", + "src/assets/index.vue", + "src/assets/index.scss", + "src/assets/index.css" + ], + "@components/*": ["src/components/*"], + "@components": [ + "src/components/index.js", + "src/components/index.json", + "src/components/index.vue", + "src/components/index.scss", + "src/components/index.css" + ], + "@basecomponents/*": ["src/components/base/*"], + "@basecomponents": [ + "src/components/base/index.js", + "src/components/base/index.json", + "src/components/base/index.vue", + "src/components/base/index.scss", + "src/components/base/index.css" + ], + "@docs/*": ["docs/*"], + "@docs": [ + "docs/index.js", + "docs/index.json", + "docs/index.vue", + "docs/index.scss", + "docs/index.css" + ], + "@layouts/*": ["src/layouts/*"], + "@layouts": [ + "src/layouts/index.js", + "src/layouts/index.json", + "src/layouts/index.vue", + "src/layouts/index.scss", + "src/layouts/index.css" + ], + "@middleware/*": ["src/middleware/*"], + "@middleware": [ + "src/middleware/index.js", + "src/middleware/index.json", + "src/middleware/index.vue", + "src/middleware/index.scss", + "src/middleware/index.css" + ], + "@mixins/*": ["src/mixins/*"], + "@mixins": [ + "src/mixins/index.js", + "src/mixins/index.json", + "src/mixins/index.vue", + "src/mixins/index.scss", + "src/mixins/index.css" + ], + "@pages/*": ["src/pages/*"], + "@pages": [ + "src/pages/index.js", + "src/pages/index.json", + "src/pages/index.vue", + "src/pages/index.scss", + "src/pages/index.css" + ], + "@utils/*": ["src/utils/*"], + "@utils": [ + "src/utils/index.js", + "src/utils/index.json", + "src/utils/index.vue", + "src/utils/index.scss", + "src/utils/index.css" + ], + "@plugins/*": ["src/plugins/*"], + "@plugins": [ + "src/plugins/index.js", + "src/plugins/index.json", + "src/plugins/index.vue", + "src/plugins/index.scss", + "src/plugins/index.css" + ], + "@serverMiddleware/*": ["src/serverMiddleware/*"], + "@serverMiddleware": [ + "src/serverMiddleware/index.js", + "src/serverMiddleware/index.json", + "src/serverMiddleware/index.vue", + "src/serverMiddleware/index.scss", + "src/serverMiddleware/index.css" + ], + "@store/*": ["src/store/*"], + "@store": [ + "src/store/index.js", + "src/store/index.json", + "src/store/index.vue", + "src/store/index.scss", + "src/store/index.css" + ], + "@static/*": ["src/themes/default/static/*"], + "@static": [ + "src/themes/default/static/index.js", + "src/themes/default/static/index.json", + "src/themes/default/static/index.vue", + "src/themes/default/static/index.scss", + "src/themes/default/static/index.css" + ], + "@theme/*": ["src/themes/default/*"], + "@theme": [ + "src/themes/default/index.js", + "src/themes/default/index.json", + "src/themes/default/index.vue", + "src/themes/default/index.scss", + "src/themes/default/index.css" + ], + "@styles/*": ["src/themes/default/styles/index.scss/*"], + "@styles": ["src/themes/default/styles/index.scss"], + "@styles-base/*": ["src/themes/base/styles/*"], + "@styles-base": [ + "src/themes/base/styles/index.js", + "src/themes/base/styles/index.json", + "src/themes/base/styles/index.vue", + "src/themes/base/styles/index.scss", + "src/themes/base/styles/index.css" + ], + "@variables/*": ["src/themes/default/styles/variables.scss/*"], + "@variables": [ + "src/themes/default/styles/variables.scss/index.js", + "src/themes/default/styles/variables.scss/index.json", + "src/themes/default/styles/variables.scss/index.vue", + "src/themes/default/styles/variables.scss/index.scss", + "src/themes/default/styles/variables.scss/index.css" + ] + } + }, + "exclude": ["node_modules", ".nuxt", "dist"] +} diff --git a/src/serverApi/v3/api.ts b/src/serverApi/v3/api.ts index 514960746f..3654c5d2d1 100644 --- a/src/serverApi/v3/api.ts +++ b/src/serverApi/v3/api.ts @@ -114,6 +114,93 @@ export interface AccountSearchListResponse { */ limit: number; } +/** + * + * @export + * @interface AdminApiSchoolCreateResponseDto + */ +export interface AdminApiSchoolCreateResponseDto { + /** + * + * @type {string} + * @memberof AdminApiSchoolCreateResponseDto + */ + id: string; + /** + * + * @type {string} + * @memberof AdminApiSchoolCreateResponseDto + */ + name: string; +} +/** + * + * @export + * @interface AdminApiUserCreateBodyParams + */ +export interface AdminApiUserCreateBodyParams { + /** + * The mail adress of the new user. Will also be used as username. + * @type {string} + * @memberof AdminApiUserCreateBodyParams + */ + email: string; + /** + * + * @type {string} + * @memberof AdminApiUserCreateBodyParams + */ + firstName: string; + /** + * + * @type {string} + * @memberof AdminApiUserCreateBodyParams + */ + lastName: string; + /** + * The roles of the new user + * @type {Array} + * @memberof AdminApiUserCreateBodyParams + */ + roleNames: Array; + /** + * id of the school the user should be created in + * @type {string} + * @memberof AdminApiUserCreateBodyParams + */ + schoolId: string; +} +/** + * + * @export + * @interface AdminApiUserCreateResponse + */ +export interface AdminApiUserCreateResponse { + /** + * + * @type {string} + * @memberof AdminApiUserCreateResponse + */ + userId: string; + /** + * + * @type {string} + * @memberof AdminApiUserCreateResponse + */ + accountId: string; + /** + * + * @type {string} + * @memberof AdminApiUserCreateResponse + */ + username: string; + /** + * + * @type {string} + * @memberof AdminApiUserCreateResponse + */ + initialPassword: string; +} /** * * @export @@ -4130,6 +4217,33 @@ export interface RichTextElementResponse { */ timestamps: TimestampsResponse; } +/** + * + * @export + * @enum {string} + */ +export enum RoleName { + Administrator = 'administrator', + CourseAdministrator = 'courseAdministrator', + CourseStudent = 'courseStudent', + CourseSubstitutionTeacher = 'courseSubstitutionTeacher', + CourseTeacher = 'courseTeacher', + Demo = 'demo', + DemoStudent = 'demoStudent', + DemoTeacher = 'demoTeacher', + Expert = 'expert', + Helpdesk = 'helpdesk', + Student = 'student', + Superhero = 'superhero', + Teacher = 'teacher', + Teamadministrator = 'teamadministrator', + Teamexpert = 'teamexpert', + Teamleader = 'teamleader', + Teammember = 'teammember', + Teamowner = 'teamowner', + User = 'user' +} + /** * * @export @@ -4457,6 +4571,12 @@ export interface SchoolResponse { * @memberof SchoolResponse */ systemIds: Array; + /** + * + * @type {boolean} + * @memberof SchoolResponse + */ + inUserMigration?: boolean; /** * * @type {boolean} @@ -5527,7 +5647,7 @@ export interface UserLoginMigrationMandatoryParams { */ export interface UserLoginMigrationResponse { /** - * + * Id of the migration * @type {string} * @memberof UserLoginMigrationResponse */ @@ -5576,7 +5696,7 @@ export interface UserLoginMigrationResponse { */ export interface UserLoginMigrationSearchListResponse { /** - * The items for the current page. + * Contains user login migration responses * @type {Array} * @memberof UserLoginMigrationSearchListResponse */ @@ -6462,6 +6582,256 @@ export class AccountApi extends BaseAPI implements AccountApiInterface { } +/** + * AdminApiUsersApi - axios parameter creator + * @export + */ +export const AdminApiUsersApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary create a user together with an account + * @param {AdminApiUserCreateBodyParams} adminApiUserCreateBodyParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + adminApiUsersControllerCreateSchool: async (adminApiUserCreateBodyParams: AdminApiUserCreateBodyParams, options: any = {}): Promise => { + // verify required parameter 'adminApiUserCreateBodyParams' is not null or undefined + assertParamExists('adminApiUsersControllerCreateSchool', 'adminApiUserCreateBodyParams', adminApiUserCreateBodyParams) + const localVarPath = `/admin/users`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(adminApiUserCreateBodyParams, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * AdminApiUsersApi - functional programming interface + * @export + */ +export const AdminApiUsersApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AdminApiUsersApiAxiosParamCreator(configuration) + return { + /** + * + * @summary create a user together with an account + * @param {AdminApiUserCreateBodyParams} adminApiUserCreateBodyParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams: AdminApiUserCreateBodyParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * AdminApiUsersApi - factory interface + * @export + */ +export const AdminApiUsersApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AdminApiUsersApiFp(configuration) + return { + /** + * + * @summary create a user together with an account + * @param {AdminApiUserCreateBodyParams} adminApiUserCreateBodyParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams: AdminApiUserCreateBodyParams, options?: any): AxiosPromise { + return localVarFp.adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AdminApiUsersApi - interface + * @export + * @interface AdminApiUsersApi + */ +export interface AdminApiUsersApiInterface { + /** + * + * @summary create a user together with an account + * @param {AdminApiUserCreateBodyParams} adminApiUserCreateBodyParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AdminApiUsersApiInterface + */ + adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams: AdminApiUserCreateBodyParams, options?: any): AxiosPromise; + +} + +/** + * AdminApiUsersApi - object-oriented interface + * @export + * @class AdminApiUsersApi + * @extends {BaseAPI} + */ +export class AdminApiUsersApi extends BaseAPI implements AdminApiUsersApiInterface { + /** + * + * @summary create a user together with an account + * @param {AdminApiUserCreateBodyParams} adminApiUserCreateBodyParams + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AdminApiUsersApi + */ + public adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams: AdminApiUserCreateBodyParams, options?: any) { + return AdminApiUsersApiFp(this.configuration).adminApiUsersControllerCreateSchool(adminApiUserCreateBodyParams, options).then((request) => request(this.axios, this.basePath)); + } +} + + +/** + * AdminSchoolApi - axios parameter creator + * @export + */ +export const AdminSchoolApiAxiosParamCreator = function (configuration?: Configuration) { + return { + /** + * + * @summary create an empty school + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + adminApiSchoolsControllerCreateSchool: async (body: object, options: any = {}): Promise => { + // verify required parameter 'body' is not null or undefined + assertParamExists('adminApiSchoolsControllerCreateSchool', 'body', body) + const localVarPath = `/admin/schools`; + // 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: 'POST', ...baseOptions, ...options}; + const localVarHeaderParameter = {} as any; + const localVarQueryParameter = {} as any; + + + + localVarHeaderParameter['Content-Type'] = 'application/json'; + + setSearchParams(localVarUrlObj, localVarQueryParameter, options.query); + let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {}; + localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers}; + localVarRequestOptions.data = serializeDataIfNeeded(body, localVarRequestOptions, configuration) + + return { + url: toPathString(localVarUrlObj), + options: localVarRequestOptions, + }; + }, + } +}; + +/** + * AdminSchoolApi - functional programming interface + * @export + */ +export const AdminSchoolApiFp = function(configuration?: Configuration) { + const localVarAxiosParamCreator = AdminSchoolApiAxiosParamCreator(configuration) + return { + /** + * + * @summary create an empty school + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + async adminApiSchoolsControllerCreateSchool(body: object, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise> { + const localVarAxiosArgs = await localVarAxiosParamCreator.adminApiSchoolsControllerCreateSchool(body, options); + return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration); + }, + } +}; + +/** + * AdminSchoolApi - factory interface + * @export + */ +export const AdminSchoolApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) { + const localVarFp = AdminSchoolApiFp(configuration) + return { + /** + * + * @summary create an empty school + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + */ + adminApiSchoolsControllerCreateSchool(body: object, options?: any): AxiosPromise { + return localVarFp.adminApiSchoolsControllerCreateSchool(body, options).then((request) => request(axios, basePath)); + }, + }; +}; + +/** + * AdminSchoolApi - interface + * @export + * @interface AdminSchoolApi + */ +export interface AdminSchoolApiInterface { + /** + * + * @summary create an empty school + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AdminSchoolApiInterface + */ + adminApiSchoolsControllerCreateSchool(body: object, options?: any): AxiosPromise; + +} + +/** + * AdminSchoolApi - object-oriented interface + * @export + * @class AdminSchoolApi + * @extends {BaseAPI} + */ +export class AdminSchoolApi extends BaseAPI implements AdminSchoolApiInterface { + /** + * + * @summary create an empty school + * @param {object} body + * @param {*} [options] Override http request option. + * @throws {RequiredError} + * @memberof AdminSchoolApi + */ + public adminApiSchoolsControllerCreateSchool(body: object, options?: any) { + return AdminSchoolApiFp(this.configuration).adminApiSchoolsControllerCreateSchool(body, options).then((request) => request(this.axios, this.basePath)); + } +} + + /** * AuthenticationApi - axios parameter creator * @export