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

EW-1060 redirected the common cartridge export to the cc-microservice #3457

Merged
merged 35 commits into from
Dec 18, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
f088756
EW-1060 added generate script for new common cartridge
Fshmit Nov 14, 2024
76459a0
EW-1060: Generate client.
mkreuzkam-cap Nov 15, 2024
bfb8619
EW-1060 changed endpoint of export to microservice
Fshmit Nov 15, 2024
19b137a
EW-1060 fixed export in a index file
Fshmit Nov 15, 2024
f1984e3
EW-1060 genereated the client of common cartridge new
Fshmit Nov 15, 2024
04297c4
EW-1060 changed a import in a index file
Fshmit Nov 15, 2024
9b2b73e
EW-1060 generated api client again after deleting the old export endp…
Fshmit Nov 15, 2024
5f74164
Merge branch 'main' into EW-1060
Fshmit Nov 21, 2024
d325a89
EW-1060 deleted options info point 2
Fshmit Nov 21, 2024
08ef9af
Merge branch 'main' into EW-1060
Fshmit Nov 22, 2024
878ed26
Merge branch 'main' into EW-1060
Fshmit Dec 10, 2024
5969f04
Merge branch 'main' into EW-1060
Fshmit Dec 11, 2024
eec722c
EW-1060 modifed download common cartridge test
Fshmit Dec 11, 2024
fa2d825
changing client generation
psachmann Dec 13, 2024
65e754f
Merge branch 'main' into EW-1060
Fshmit Dec 16, 2024
479db89
updating eslint config
psachmann Dec 16, 2024
1040c1b
Merge branch 'main' into EW-1060
psachmann Dec 16, 2024
e11da22
updating unit tests
psachmann Dec 16, 2024
178bc97
changing rimraf version
psachmann Dec 16, 2024
8d10d62
adding dev dependency
psachmann Dec 16, 2024
81d4faa
updating package.json
psachmann Dec 16, 2024
0578f51
fixing unit tests
psachmann Dec 16, 2024
fb8f5a7
updating sonarcloud properties
psachmann Dec 16, 2024
b6e402b
working on test coverage
psachmann Dec 17, 2024
4990c62
Merge branch 'main' into EW-1060
psachmann Dec 17, 2024
82ef11c
removing comments
psachmann Dec 17, 2024
055c627
updating sonar properties
psachmann Dec 17, 2024
1b8d184
Merge branch 'main' into EW-1060
Fshmit Dec 17, 2024
d9bfe2d
some logging
psachmann Dec 17, 2024
7e3b37f
adding some logging
psachmann Dec 17, 2024
4d93f64
try getter
Fshmit Dec 17, 2024
db92381
Merge branch 'EW-1060' of https://github.com/hpi-schul-cloud/nuxt-cli…
Fshmit Dec 17, 2024
7a62ddc
changing openapi generator version
psachmann Dec 18, 2024
9f15e8f
fixing unit tests
psachmann Dec 18, 2024
dd29b17
EW-1060 removed console logs
Fshmit Dec 18, 2024
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
1 change: 1 addition & 0 deletions eslint.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ module.exports = [
"src/serverApi/**",
"src/fileStorageApi/**",
"src/h5pEditorApi/**",
"src/commonCartridgeApi/**",
],
},
{
Expand Down
20 changes: 19 additions & 1 deletion openapitools.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,24 @@
"$schema": "node_modules/@openapitools/openapi-generator-cli/config.schema.json",
"spaces": 2,
"generator-cli": {
"version": "5.1.0"
"version": "5.1.0",
"generators": {
"common-cartridge-api": {
"generatorName": "typescript-axios",
"inputSpec": "http://localhost:3350/api/v3/docs-json/",
"output": "./src/commonCartridgeApi/v3",
"skipValidateSpec": true,
"enablePostProcessFile": true,
"additionalProperties": {
"apiPackage": "api",
"enumNameSuffix": "",
"enumPropertyNaming": "UPPERCASE",
"modelPackage": "models",
"supportsES6": true,
"withInterfaces": true,
"withSeparateModelsAndApi": true
}
}
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,8 @@
"lint:fix": "npx eslint 'src/**/*.{ts,js,vue}' --fix",
"generate-client:server": "node generate-client.js -c openapitools-for-server.json",
"generate-client:filestorage": "node generate-client.js -u 'http://localhost:4444/api/v3/docs-json/' -p 'src/fileStorageApi/v3' -c 'openapitools-for-file-storage.json'",
"generate-client:h5p-editor": "node generate-client.js -u 'http://localhost:4448/api/v3/docs-json/' -p 'src/h5pEditorApi/v3' -c 'openapitools-for-h5p-editor.json'"
"generate-client:h5p-editor": "node generate-client.js -u 'http://localhost:4448/api/v3/docs-json/' -p 'src/h5pEditorApi/v3' -c 'openapitools-for-h5p-editor.json'",
"generate-client:common-cartridge": "openapi-generator-cli generate -c ./openapitools.json --generator-key common-cartridge-api"
},
"dependencies": {
"@braintree/sanitize-url": "^6.0.4",
Expand Down
2 changes: 1 addition & 1 deletion sonar-project.properties
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
sonar.organization=schulcloud-verbund
sonar.projectKey=hpi-schul-cloud_nuxt-client
sonar.sources=.
sonar.exclusions=src/serverApi/**/*.*,src/fileStorageApi/**/*.*,src/h5pEditorApi/**/*.*,**/themes/**.ts
sonar.exclusions=src/serverApi/**/*.*,src/fileStorageApi/**/*.*,src/h5pEditorApi/**/*.*,src/commonCartridgeApi/**/*.*,**/themes/**.ts
sonar.coverage.exclusions=tests/**/*.*,**/*.unit.ts,**/*.unit.js,**/themes/**.ts,eslint.config.js,src/main.ts,src/plugins/vuetify.ts
sonar.cpd.exclusions=**/locales/**.ts,tests/**/*.*,**/*.unit.ts,**/*.unit.js,**/themes/**.ts
sonar.javascript.lcov.reportPaths=./coverage/lcov.info
4 changes: 4 additions & 0 deletions src/commonCartridgeApi/v3/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
wwwroot/*.js
node_modules
typings
dist
1 change: 1 addition & 0 deletions src/commonCartridgeApi/v3/.npmignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# empty npmignore to ensure all required files (e.g., in the dist folder) are published by npm
23 changes: 23 additions & 0 deletions src/commonCartridgeApi/v3/.openapi-generator-ignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# OpenAPI Generator Ignore
# Generated by openapi-generator https://github.com/openapitools/openapi-generator

# Use this file to prevent files from being overwritten by the generator.
# The patterns follow closely to .gitignore or .dockerignore.

# As an example, the C# client generator defines ApiClient.cs.
# You can make changes and tell OpenAPI Generator to ignore just this file by uncommenting the following line:
#ApiClient.cs

# You can match any string of characters against a directory, file or extension with a single asterisk (*):
#foo/*/qux
# The above matches foo/bar/qux and foo/baz/qux, but not foo/bar/baz/qux

# You can recursively match patterns against a directory, file or extension with a double asterisk (**):
#foo/**/qux
# This matches foo/bar/qux, foo/baz/qux, and foo/bar/baz/qux

# You can also negate patterns with an exclamation (!).
# For example, you can ignore all files in a docs folder with the file extension .md:
#docs/*.md
# Then explicitly reverse the ignore rule for a single file:
#!docs/README.md
12 changes: 12 additions & 0 deletions src/commonCartridgeApi/v3/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
api/common-cartridge-api.ts
base.ts
common.ts
configuration.ts
git_push.sh
index.ts
models/course-export-body-params.ts
models/index.ts
1 change: 1 addition & 0 deletions src/commonCartridgeApi/v3/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
5.1.0
18 changes: 18 additions & 0 deletions src/commonCartridgeApi/v3/api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
/* tslint:disable */
/* eslint-disable */
/**
* Schulcloud-Verbund-Software Server API
* This is v3 of Schulcloud-Verbund-Software Server. Checkout /docs for v1.
*
* The version of the OpenAPI document: 3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/



export * from './api/common-cartridge-api';

161 changes: 161 additions & 0 deletions src/commonCartridgeApi/v3/api/common-cartridge-api.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,161 @@
/* tslint:disable */
/* eslint-disable */
/**
* Schulcloud-Verbund-Software Server API
* This is v3 of Schulcloud-Verbund-Software Server. Checkout /docs for v1.
*
* The version of the OpenAPI document: 3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
import { Configuration } from '../configuration';
// Some imports not used depending on template conditions
// @ts-ignore
import { DUMMY_BASE_URL, assertParamExists, setApiKeyToObject, setBasicAuthToObject, setBearerAuthToObject, setOAuthToObject, setSearchParams, serializeDataIfNeeded, toPathString, createRequestFunction } from '../common';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from '../base';
// @ts-ignore
import { CourseExportBodyParams } from '../models';
/**
* CommonCartridgeApi - axios parameter creator
* @export
*/
export const CommonCartridgeApiAxiosParamCreator = function (configuration?: Configuration) {
return {
/**
*
* @param {string} courseId
* @param {'1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0'} version The version of CC export
* @param {CourseExportBodyParams} courseExportBodyParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
commonCartridgeControllerExportCourse: async (courseId: string, version: '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0', courseExportBodyParams: CourseExportBodyParams, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'courseId' is not null or undefined
assertParamExists('commonCartridgeControllerExportCourse', 'courseId', courseId)
// verify required parameter 'version' is not null or undefined
assertParamExists('commonCartridgeControllerExportCourse', 'version', version)
// verify required parameter 'courseExportBodyParams' is not null or undefined
assertParamExists('commonCartridgeControllerExportCourse', 'courseExportBodyParams', courseExportBodyParams)
const localVarPath = `/common-cartridge/export/{courseId}`
.replace(`{${"courseId"}}`, encodeURIComponent(String(courseId)));
// 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;

if (version !== undefined) {
localVarQueryParameter['version'] = version;
}



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(courseExportBodyParams, localVarRequestOptions, configuration)

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

/**
* CommonCartridgeApi - functional programming interface
* @export
*/
export const CommonCartridgeApiFp = function(configuration?: Configuration) {
const localVarAxiosParamCreator = CommonCartridgeApiAxiosParamCreator(configuration)
return {
/**
*
* @param {string} courseId
* @param {'1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0'} version The version of CC export
* @param {CourseExportBodyParams} courseExportBodyParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async commonCartridgeControllerExportCourse(courseId: string, version: '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0', courseExportBodyParams: CourseExportBodyParams, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<void>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.commonCartridgeControllerExportCourse(courseId, version, courseExportBodyParams, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
}
};

/**
* CommonCartridgeApi - factory interface
* @export
*/
export const CommonCartridgeApiFactory = function (configuration?: Configuration, basePath?: string, axios?: AxiosInstance) {
const localVarFp = CommonCartridgeApiFp(configuration)
return {
/**
*
* @param {string} courseId
* @param {'1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0'} version The version of CC export
* @param {CourseExportBodyParams} courseExportBodyParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
commonCartridgeControllerExportCourse(courseId: string, version: '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0', courseExportBodyParams: CourseExportBodyParams, options?: any): AxiosPromise<void> {
return localVarFp.commonCartridgeControllerExportCourse(courseId, version, courseExportBodyParams, options).then((request) => request(axios, basePath));
},
};
};

/**
* CommonCartridgeApi - interface
* @export
* @interface CommonCartridgeApi
*/
export interface CommonCartridgeApiInterface {
/**
*
* @param {string} courseId
* @param {'1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0'} version The version of CC export
* @param {CourseExportBodyParams} courseExportBodyParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommonCartridgeApiInterface
*/
commonCartridgeControllerExportCourse(courseId: string, version: '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0', courseExportBodyParams: CourseExportBodyParams, options?: any): AxiosPromise<void>;

}

/**
* CommonCartridgeApi - object-oriented interface
* @export
* @class CommonCartridgeApi
* @extends {BaseAPI}
*/
export class CommonCartridgeApi extends BaseAPI implements CommonCartridgeApiInterface {
/**
*
* @param {string} courseId
* @param {'1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0'} version The version of CC export
* @param {CourseExportBodyParams} courseExportBodyParams
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof CommonCartridgeApi
*/
public commonCartridgeControllerExportCourse(courseId: string, version: '1.0.0' | '1.1.0' | '1.2.0' | '1.3.0' | '1.4.0', courseExportBodyParams: CourseExportBodyParams, options?: any) {
return CommonCartridgeApiFp(this.configuration).commonCartridgeControllerExportCourse(courseId, version, courseExportBodyParams, options).then((request) => request(this.axios, this.basePath));
}
}
71 changes: 71 additions & 0 deletions src/commonCartridgeApi/v3/base.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
/* tslint:disable */
/* eslint-disable */
/**
* Schulcloud-Verbund-Software Server API
* This is v3 of Schulcloud-Verbund-Software Server. Checkout /docs for v1.
*
* The version of the OpenAPI document: 3.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*/


import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';

export const BASE_PATH = "http://localhost:3350/api/v3".replace(/\/+$/, "");

/**
*
* @export
*/
export const COLLECTION_FORMATS = {
csv: ",",
ssv: " ",
tsv: "\t",
pipes: "|",
};

/**
*
* @export
* @interface RequestArgs
*/
export interface RequestArgs {
url: string;
options: any;
}

/**
*
* @export
* @class BaseAPI
*/
export class BaseAPI {
protected configuration: Configuration | undefined;

constructor(configuration?: Configuration, protected basePath: string = BASE_PATH, protected axios: AxiosInstance = globalAxios) {
if (configuration) {
this.configuration = configuration;
this.basePath = configuration.basePath || this.basePath;
}
}
};

/**
*
* @export
* @class RequiredError
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
}
}
Loading
Loading