Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • coscine/frontend/libraries/api-client
1 result
Select Git revision
Loading items
Show changes
Showing
with 1295 additions and 25 deletions
5.2.1
\ No newline at end of file
This diff is collapsed.
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.STS
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.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 = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.STS".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);
}
}
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.STS
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.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";
import { RequiredError, RequestArgs } from "./base";
import { AxiosInstance } from 'axios';
/**
*
* @export
*/
export const DUMMY_BASE_URL = 'https://example.com'
/**
*
* @throws {RequiredError}
* @export
*/
export const assertParamExists = function (functionName: string, paramName: string, paramValue: unknown) {
if (paramValue === null || paramValue === undefined) {
throw new RequiredError(paramName, `Required parameter ${paramName} was null or undefined when calling ${functionName}.`);
}
}
/**
*
* @export
*/
export const setApiKeyToObject = async function (object: any, keyParamName: string, configuration?: Configuration) {
if (configuration && configuration.apiKey) {
const localVarApiKeyValue = typeof configuration.apiKey === 'function'
? await configuration.apiKey(keyParamName)
: await configuration.apiKey;
object[keyParamName] = localVarApiKeyValue;
}
}
/**
*
* @export
*/
export const setBasicAuthToObject = function (object: any, configuration?: Configuration) {
if (configuration && (configuration.username || configuration.password)) {
object["auth"] = { username: configuration.username, password: configuration.password };
}
}
/**
*
* @export
*/
export const setBearerAuthToObject = async function (object: any, configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const accessToken = typeof configuration.accessToken === 'function'
? await configuration.accessToken()
: await configuration.accessToken;
object["Authorization"] = "Bearer " + accessToken;
}
}
/**
*
* @export
*/
export const setOAuthToObject = async function (object: any, name: string, scopes: string[], configuration?: Configuration) {
if (configuration && configuration.accessToken) {
const localVarAccessTokenValue = typeof configuration.accessToken === 'function'
? await configuration.accessToken(name, scopes)
: await configuration.accessToken;
object["Authorization"] = "Bearer " + localVarAccessTokenValue;
}
}
/**
*
* @export
*/
export const setSearchParams = function (url: URL, ...objects: any[]) {
const searchParams = new URLSearchParams(url.search);
for (const object of objects) {
for (const key in object) {
if (Array.isArray(object[key])) {
searchParams.delete(key);
for (const item of object[key]) {
searchParams.append(key, item);
}
} else {
searchParams.set(key, object[key]);
}
}
}
url.search = searchParams.toString();
}
/**
*
* @export
*/
export const serializeDataIfNeeded = function (value: any, requestOptions: any, configuration?: Configuration) {
const nonString = typeof value !== 'string';
const needsSerialization = nonString && configuration && configuration.isJsonMime
? configuration.isJsonMime(requestOptions.headers['Content-Type'])
: nonString;
return needsSerialization
? JSON.stringify(value !== undefined ? value : {})
: (value || "");
}
/**
*
* @export
*/
export const toPathString = function (url: URL) {
return url.pathname + url.search + url.hash
}
/**
*
* @export
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
return axios.request(axiosRequestArgs);
};
}
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.STS
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.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 interface ConfigurationParameters {
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
username?: string;
password?: string;
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
basePath?: string;
baseOptions?: any;
formDataCtor?: new () => any;
}
export class Configuration {
/**
* parameter for apiKey security
* @param name security name
* @memberof Configuration
*/
apiKey?: string | Promise<string> | ((name: string) => string) | ((name: string) => Promise<string>);
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
username?: string;
/**
* parameter for basic security
*
* @type {string}
* @memberof Configuration
*/
password?: string;
/**
* parameter for oauth2 security
* @param name security name
* @param scopes oauth2 scope
* @memberof Configuration
*/
accessToken?: string | Promise<string> | ((name?: string, scopes?: string[]) => string) | ((name?: string, scopes?: string[]) => Promise<string>);
/**
* override base path
*
* @type {string}
* @memberof Configuration
*/
basePath?: string;
/**
* base options for axios calls
*
* @type {any}
* @memberof Configuration
*/
baseOptions?: any;
/**
* The FormData constructor that will be used to create multipart form data
* requests. You can inject this here so that execution environments that
* do not support the FormData class can still run the generated client.
*
* @type {new () => FormData}
*/
formDataCtor?: new () => any;
constructor(param: ConfigurationParameters = {}) {
this.apiKey = param.apiKey;
this.username = param.username;
this.password = param.password;
this.accessToken = param.accessToken;
this.basePath = param.basePath;
this.baseOptions = param.baseOptions;
this.formDataCtor = param.formDataCtor;
}
/**
* Check if the given MIME is a JSON MIME.
* JSON MIME examples:
* application/json
* application/json; charset=UTF8
* APPLICATION/JSON
* application/vnd.company+json
* @param mime - MIME (Multipurpose Internet Mail Extensions)
* @return True if the given MIME is JSON, false otherwise.
*/
public isJsonMime(mime: string): boolean {
const jsonMime: RegExp = new RegExp('^(application\/json|[^;/ \t]+\/[^;/ \t]+[+]json)[ \t]*(;.*)?$', 'i');
return mime !== null && (jsonMime.test(mime) || mime.toLowerCase() === 'application/json-patch+json');
}
}
/* tslint:disable */
/* eslint-disable */
/**
* Coscine.Api.STS
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 0.0.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";
export * from "./configuration";
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Search
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* The version of the OpenAPI document: 1.5.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -80,7 +80,7 @@ export const SearchApiAxiosParamCreator = function (configuration?: Configuratio
return {
/**
*
* @summary Search
* @summary Search Elasticsearch
* @param {string} [query] Elasticsearch query
* @param {boolean} [user] Specify user or only public metadata records could be found
* @param {boolean} [adv] Set true for advanced Elasticsearch search syntax
......@@ -143,7 +143,7 @@ export const SearchApiFp = function(configuration?: Configuration) {
return {
/**
*
* @summary Search
* @summary Search Elasticsearch
* @param {string} [query] Elasticsearch query
* @param {boolean} [user] Specify user or only public metadata records could be found
* @param {boolean} [adv] Set true for advanced Elasticsearch search syntax
......@@ -167,7 +167,7 @@ export const SearchApiFactory = function (configuration?: Configuration, basePat
return {
/**
*
* @summary Search
* @summary Search Elasticsearch
* @param {string} [query] Elasticsearch query
* @param {boolean} [user] Specify user or only public metadata records could be found
* @param {boolean} [adv] Set true for advanced Elasticsearch search syntax
......@@ -190,7 +190,7 @@ export const SearchApiFactory = function (configuration?: Configuration, basePat
export class SearchApi extends BaseAPI {
/**
*
* @summary Search
* @summary Search Elasticsearch
* @param {string} [query] Elasticsearch query
* @param {boolean} [user] Specify user or only public metadata records could be found
* @param {boolean} [adv] Set true for advanced Elasticsearch search syntax
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Search
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* The version of the OpenAPI document: 1.5.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -18,7 +18,7 @@ import { Configuration } from "./configuration";
// @ts-ignore
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "https://d-sp23.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Search".replace(/\/+$/, "");
export const BASE_PATH = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Search".replace(/\/+$/, "");
/**
*
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Search
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* The version of the OpenAPI document: 1.5.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Search
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* The version of the OpenAPI document: 1.5.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Search
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 1.4.0
* The version of the OpenAPI document: 1.5.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Tree
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.8.3
* The version of the OpenAPI document: 2.8.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Tree
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.8.3
* The version of the OpenAPI document: 2.8.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Tree
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.8.3
* The version of the OpenAPI document: 2.8.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Tree
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.8.3
* The version of the OpenAPI document: 2.8.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Tree
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 2.8.3
* The version of the OpenAPI document: 2.8.5
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.User
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.0
* The version of the OpenAPI document: 3.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -160,10 +160,10 @@ export interface TitleObject {
export interface Tos {
/**
* The TOS version
* @type {string}
* @type {Array<string>}
* @memberof Tos
*/
version?: string | null;
version?: Array<string> | null;
}
/**
*
......@@ -625,6 +625,39 @@ export const TOSApiAxiosParamCreator = function (configuration?: Configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
return {
url: toPathString(localVarUrlObj),
options: localVarRequestOptions,
};
},
/**
*
* @summary Returns the TOS Versions accepted by the current user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tOSAcceptedTOSVersion: async (options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/TOS`;
// 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;
// authentication JWT token required
await setApiKeyToObject(localVarHeaderParameter, "Authorization", configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
......@@ -641,7 +674,7 @@ export const TOSApiAxiosParamCreator = function (configuration?: Configuration)
* @throws {RequiredError}
*/
tOSGetCurrentTOSVersion: async (options: any = {}): Promise<RequestArgs> => {
const localVarPath = `/TOS`;
const localVarPath = `/TOS/version`;
// use dummy base URL string because the URL constructor only accepts absolute URLs.
const localVarUrlObj = new URL(localVarPath, DUMMY_BASE_URL);
let baseOptions;
......@@ -683,17 +716,27 @@ export const TOSApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tOSAcceptCurrentTOSVersion(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<number>> {
async tOSAcceptCurrentTOSVersion(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.tOSAcceptCurrentTOSVersion(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Returns the TOS Versions accepted by the current user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tOSAcceptedTOSVersion(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Tos>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.tOSAcceptedTOSVersion(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
/**
*
* @summary Returns the current TOS Version.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async tOSGetCurrentTOSVersion(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<Tos>> {
async tOSGetCurrentTOSVersion(options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<string>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.tOSGetCurrentTOSVersion(options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -713,16 +756,25 @@ export const TOSApiFactory = function (configuration?: Configuration, basePath?:
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tOSAcceptCurrentTOSVersion(options?: any): AxiosPromise<number> {
tOSAcceptCurrentTOSVersion(options?: any): AxiosPromise<string> {
return localVarFp.tOSAcceptCurrentTOSVersion(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Returns the TOS Versions accepted by the current user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tOSAcceptedTOSVersion(options?: any): AxiosPromise<Tos> {
return localVarFp.tOSAcceptedTOSVersion(options).then((request) => request(axios, basePath));
},
/**
*
* @summary Returns the current TOS Version.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
tOSGetCurrentTOSVersion(options?: any): AxiosPromise<Tos> {
tOSGetCurrentTOSVersion(options?: any): AxiosPromise<string> {
return localVarFp.tOSGetCurrentTOSVersion(options).then((request) => request(axios, basePath));
},
};
......@@ -746,6 +798,17 @@ export class TOSApi extends BaseAPI {
return TOSApiFp(this.configuration).tOSAcceptCurrentTOSVersion(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Returns the TOS Versions accepted by the current user.
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof TOSApi
*/
public tOSAcceptedTOSVersion(options?: any) {
return TOSApiFp(this.configuration).tOSAcceptedTOSVersion(options).then((request) => request(this.axios, this.basePath));
}
/**
*
* @summary Returns the current TOS Version.
......
......@@ -4,7 +4,7 @@
* Coscine.Api.User
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.0
* The version of the OpenAPI document: 3.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
......@@ -4,7 +4,7 @@
* Coscine.Api.User
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.0
* The version of the OpenAPI document: 3.1.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......