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
  • APIv2
  • Experiment/esbuild
  • Fix/xxxx-OpenAPI630
  • Fix/xxxx-migrateLogin
  • Hotfix/1917-vocabCheck
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2427-adminTrouble
  • Hotfix/2611-feedback
  • Hotfix/2681-validationErrors
  • Hotfix/xxxx-release
  • Issue/1172-uploadProgress
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1740-ElasticSearchOnCoscineFrontend
  • Issue/1745-coscineConnection
  • Issue/1746-ApplicationProfileStoringMethod
  • Issue/1782-structualDataIntegration
  • Issue/1804-fixedValueFix
  • Issue/1833-newLogin
  • Issue/1861-searchMetadata
  • Issue/1863-paginationForSearch
  • Issue/1926-userProfile
  • Issue/1938-internalHandling
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1972-homeDepot
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2228-userOrganization
  • Issue/2257-proofOfConceptTest
  • Issue/2262-frontendWorkspace
  • Issue/2264-sortSearchResults
  • Issue/2309-docs
  • Issue/2373-fixPagination
  • Issue/2401-advisoryServiceUI2
  • Issue/2414-resourceTypesAffilAndAllocQuota
  • Issue/2434-searchAPI
  • Issue/2435-userApi
  • Issue/2436-projectApi
  • Issue/2438-adminApi
  • Issue/2439-noticeApi
  • Issue/2440-migrateTokenApi
  • Issue/2445-extractedMetadata
  • Issue/2446-addingResponsibleOrganization
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2469-hideDotCoscine
  • Issue/2489-addNotificationManagement
  • Issue/2586-migrateBlob
  • Issue/2587-migrateTreeApi
  • Issue/2589-metadataOrganizationAPI
  • Issue/2627-addPidRecord
  • Issue/2665-extractLogger
  • Issue/2672-fixSfbPidPointing
  • Issue/2732-updatedApiClient
  • Issue/2739-outputCache
  • Issue/2782-correctUsageRights
  • Issue/2829-useHrefProperty
  • Issue/2875-devcontainer
  • Issue/2881-messageController
  • Issue/2900-removeInsituteField
  • Issue/2921-changesToDataPublicationFeature
  • Issue/2926-regAppLogin
  • Issue/2981-dataPubInDb
  • Issue/3011-maintenanceMode
  • Issue/3043-DataStorageNrwResource
  • Issue/3085-useNewApiClient
  • Issue/3133-subProjectsChanges
  • Issue/xxxx-configurableApiHostname
  • Issue/xxxx-excludeModuleAPs
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2021-24
  • Sprint/2022-01
  • Sprint/2022-05
  • coscine/issues#2727
  • dev
  • main
  • main-testing
  • revert-3c6942bb
  • uiv2
  • x/setup
  • v1.0.0
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.3.0
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v2.0.0
  • v2.1.0
  • v2.10.0
  • v2.11.0
  • v2.12.0
  • v2.2.0
  • v2.3.0
  • v2.4.0
  • v2.5.0
  • v2.6.0
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.9.0
  • v2.9.1
  • v2.9.2
  • v3.0.0
  • v3.1.0
  • v3.10.0
  • v3.11.0
  • v3.12.0
  • v3.13.0
  • v3.14.0
  • v3.15.0
  • v3.16.0
  • v3.17.0
  • v3.18.0
  • v3.2.0
  • v3.2.1
  • v3.3.0
  • v3.3.1
  • v3.3.2-package.0
  • v3.4.0
  • v3.4.1
  • v3.4.2
  • v3.4.3
  • v3.5.0
  • v3.6.0
  • v3.7.0
  • v3.8.0
  • v3.9.0
133 results

Target

Select target project
  • coscine/frontend/libraries/api-client
1 result
Select Git revision
  • APIv2
  • Experiment/esbuild
  • Fix/xxxx-OpenAPI630
  • Fix/xxxx-migrateLogin
  • Hotfix/1917-vocabCheck
  • Hotfix/2258-saveButtonWorksAsExpected
  • Hotfix/2427-adminTrouble
  • Hotfix/2611-feedback
  • Hotfix/2681-validationErrors
  • Hotfix/xxxx-release
  • Issue/1172-uploadProgress
  • Issue/1321-pidEnquiryOverhaul
  • Issue/1740-ElasticSearchOnCoscineFrontend
  • Issue/1745-coscineConnection
  • Issue/1746-ApplicationProfileStoringMethod
  • Issue/1782-structualDataIntegration
  • Issue/1804-fixedValueFix
  • Issue/1833-newLogin
  • Issue/1861-searchMetadata
  • Issue/1863-paginationForSearch
  • Issue/1926-userProfile
  • Issue/1938-internalHandling
  • Issue/1951-quotaImplementation
  • Issue/1957-resourceAppMigrationNew
  • Issue/1971-projectEditCreateMigration
  • Issue/1972-homeDepot
  • Issue/2001-extendAnalyticsLogger
  • Issue/2008-quotaManagement
  • Issue/2072-wormResourceType
  • Issue/2101-gitLabResTypeUi
  • Issue/2228-userOrganization
  • Issue/2257-proofOfConceptTest
  • Issue/2262-frontendWorkspace
  • Issue/2264-sortSearchResults
  • Issue/2309-docs
  • Issue/2373-fixPagination
  • Issue/2401-advisoryServiceUI2
  • Issue/2414-resourceTypesAffilAndAllocQuota
  • Issue/2434-searchAPI
  • Issue/2435-userApi
  • Issue/2436-projectApi
  • Issue/2438-adminApi
  • Issue/2439-noticeApi
  • Issue/2440-migrateTokenApi
  • Issue/2445-extractedMetadata
  • Issue/2446-addingResponsibleOrganization
  • Issue/2449-GuidPidSlugToProjectSettings
  • Issue/2469-hideDotCoscine
  • Issue/2489-addNotificationManagement
  • Issue/2586-migrateBlob
  • Issue/2587-migrateTreeApi
  • Issue/2589-metadataOrganizationAPI
  • Issue/2627-addPidRecord
  • Issue/2665-extractLogger
  • Issue/2672-fixSfbPidPointing
  • Issue/2732-updatedApiClient
  • Issue/2739-outputCache
  • Issue/2782-correctUsageRights
  • Issue/2829-useHrefProperty
  • Issue/2875-devcontainer
  • Issue/2881-messageController
  • Issue/2900-removeInsituteField
  • Issue/2921-changesToDataPublicationFeature
  • Issue/2926-regAppLogin
  • Issue/2981-dataPubInDb
  • Issue/3011-maintenanceMode
  • Issue/3043-DataStorageNrwResource
  • Issue/3085-useNewApiClient
  • Issue/3133-subProjectsChanges
  • Issue/xxxx-configurableApiHostname
  • Issue/xxxx-excludeModuleAPs
  • Sprint/2021-2022
  • Sprint/2021-23
  • Sprint/2021-24
  • Sprint/2022-01
  • Sprint/2022-05
  • coscine/issues#2727
  • dev
  • main
  • main-testing
  • revert-3c6942bb
  • uiv2
  • x/setup
  • v1.0.0
  • v1.1.0
  • v1.1.1
  • v1.2.0
  • v1.3.0
  • v1.4.0
  • v1.5.0
  • v1.5.1
  • v1.5.2
  • v2.0.0
  • v2.1.0
  • v2.10.0
  • v2.11.0
  • v2.12.0
  • v2.2.0
  • v2.3.0
  • v2.4.0
  • v2.5.0
  • v2.6.0
  • v2.7.0
  • v2.8.0
  • v2.8.1
  • v2.9.0
  • v2.9.1
  • v2.9.2
  • v3.0.0
  • v3.1.0
  • v3.10.0
  • v3.11.0
  • v3.12.0
  • v3.13.0
  • v3.14.0
  • v3.15.0
  • v3.16.0
  • v3.17.0
  • v3.18.0
  • v3.2.0
  • v3.2.1
  • v3.3.0
  • v3.3.1
  • v3.3.2-package.0
  • v3.4.0
  • v3.4.1
  • v3.4.2
  • v3.4.3
  • v3.5.0
  • v3.6.0
  • v3.7.0
  • v3.8.0
  • v3.9.0
133 results
Show changes
Showing
with 162 additions and 339 deletions
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
......
6.3.0
\ No newline at end of file
5.2.1
\ No newline at end of file
......@@ -4,7 +4,7 @@
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.3
* The version of the OpenAPI document: 3.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,15 +13,13 @@
*/
import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
// 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';
import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
/**
* Retuned when searching for a project. Contains basic informations and quotas.
......@@ -34,25 +32,25 @@ export interface AdminProjectObject {
* @type {string}
* @memberof AdminProjectObject
*/
'id'?: string;
id?: string;
/**
* Project Name (full project name)
* @type {string}
* @memberof AdminProjectObject
*/
'projectName'?: string | null;
projectName?: string | null;
/**
* Project Display Name
* @type {string}
* @memberof AdminProjectObject
*/
'displayName'?: string | null;
displayName?: string | null;
/**
* List of the admin quotas (AdminQuotaReturnObject)
* @type {Array<AdminQuotaReturnObject>}
* @memberof AdminProjectObject
*/
'quotas'?: Array<AdminQuotaReturnObject> | null;
quotas?: Array<AdminQuotaReturnObject> | null;
}
/**
* Returned when searching for a project, as part of the AdminProjectObject. Contains quota informations.
......@@ -65,66 +63,38 @@ export interface AdminQuotaReturnObject {
* @type {string}
* @memberof AdminQuotaReturnObject
*/
'relationId'?: string;
relationId?: string;
/**
* Which resource type the quota is referring to.
* @type {string}
* @memberof AdminQuotaReturnObject
*/
'resourceType'?: string | null;
resourceType?: string | null;
/**
*
* @type {AdminQuotaReturnObjectTotalUsed}
* How much space is used by all files in all resources in total [Bytes].
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
'totalUsed'?: AdminQuotaReturnObjectTotalUsed | null;
totalUsed?: QuotaDimObject | null;
/**
*
* @type {AdminQuotaReturnObjectTotalReserved}
* How much space is reserved by resources in total [GiB]. Is equal to the sum of all resource quota reserved values.
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
'totalReserved'?: AdminQuotaReturnObjectTotalReserved | null;
totalReserved?: QuotaDimObject | null;
/**
*
* @type {AdminQuotaReturnObjectAllocated}
* How much space is currently allocated and is available to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'Quota\').
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
'allocated'?: AdminQuotaReturnObjectAllocated | null;
allocated?: QuotaDimObject | null;
/**
*
* @type {AdminQuotaReturnObjectMaximum}
* How much maximum space is possible to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'MaxQuota\').
* @type {QuotaDimObject}
* @memberof AdminQuotaReturnObject
*/
'maximum'?: AdminQuotaReturnObjectMaximum | null;
maximum?: QuotaDimObject | null;
}
/**
* @type AdminQuotaReturnObjectAllocated
* How much space is currently allocated and is available to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'Quota\').
* @export
*/
export type AdminQuotaReturnObjectAllocated = QuotaDimObject;
/**
* @type AdminQuotaReturnObjectMaximum
* How much maximum space is possible to be taken by resources [GiB] (See Database, Table \'ProjectQuotas\', Column \'MaxQuota\').
* @export
*/
export type AdminQuotaReturnObjectMaximum = QuotaDimObject;
/**
* @type AdminQuotaReturnObjectTotalReserved
* How much space is reserved by resources in total [GiB]. Is equal to the sum of all resource quota reserved values.
* @export
*/
export type AdminQuotaReturnObjectTotalReserved = QuotaDimObject;
/**
* @type AdminQuotaReturnObjectTotalUsed
* How much space is used by all files in all resources in total [Bytes].
* @export
*/
export type AdminQuotaReturnObjectTotalUsed = QuotaDimObject;
/**
*
* @export
......@@ -136,33 +106,28 @@ export interface QuotaDimObject {
* @type {number}
* @memberof QuotaDimObject
*/
'value'?: number;
value?: number;
/**
*
* @type {QuotaUnit}
* @memberof QuotaDimObject
*/
'unit'?: QuotaUnit;
unit?: QuotaUnit;
}
/**
*
* @export
* @enum {string}
*/
export const QuotaUnit = {
Byte: 'https://qudt.org/vocab/unit/BYTE',
KibiByte: 'https://qudt.org/vocab/unit/KibiBYTE',
MebiByte: 'https://qudt.org/vocab/unit/MebiBYTE',
GibiByte: 'https://qudt.org/vocab/unit/GibiBYTE',
TebiByte: 'https://qudt.org/vocab/unit/TebiBYTE',
PebiByte: 'https://qudt.org/vocab/unit/PebiBYTE'
} as const;
export type QuotaUnit = typeof QuotaUnit[keyof typeof QuotaUnit];
export enum QuotaUnit {
Byte = 'https://qudt.org/vocab/unit/BYTE',
KibiByte = 'https://qudt.org/vocab/unit/KibiBYTE',
MebiByte = 'https://qudt.org/vocab/unit/MebiBYTE',
GibiByte = 'https://qudt.org/vocab/unit/GibiBYTE',
TebiByte = 'https://qudt.org/vocab/unit/TebiBYTE',
PebiByte = 'https://qudt.org/vocab/unit/PebiBYTE'
}
/**
* Data send to update the project quota.
......@@ -175,7 +140,7 @@ export interface UpdateQuotaParameterObject {
* @type {number}
* @memberof UpdateQuotaParameterObject
*/
'maximumGiB'?: number;
maximumGiB?: number;
}
/**
......@@ -191,7 +156,7 @@ export const AdminApiAxiosParamCreator = function (configuration?: Configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminGetProject: async (projectString: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
adminGetProject: async (projectString: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'projectString' is not null or undefined
assertParamExists('adminGetProject', 'projectString', projectString)
const localVarPath = `/Admin/{projectString}`
......@@ -212,7 +177,7 @@ export const AdminApiAxiosParamCreator = function (configuration?: Configuration
setSearchParams(localVarUrlObj, localVarQueryParameter);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
......@@ -230,7 +195,7 @@ export const AdminApiAxiosParamCreator = function (configuration?: Configuration
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminUpdateQuota: async (projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
adminUpdateQuota: async (projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'projectId' is not null or undefined
assertParamExists('adminUpdateQuota', 'projectId', projectId)
// verify required parameter 'resourceTypeId' is not null or undefined
......@@ -258,7 +223,7 @@ export const AdminApiAxiosParamCreator = function (configuration?: Configuration
localVarHeaderParameter['Content-Type'] = 'application/json';
setSearchParams(localVarUrlObj, localVarQueryParameter);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = serializeDataIfNeeded(updateQuotaParameterObject, localVarRequestOptions, configuration)
......@@ -285,7 +250,7 @@ export const AdminApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async adminGetProject(projectString: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminProjectObject>> {
async adminGetProject(projectString: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<AdminProjectObject>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.adminGetProject(projectString, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -298,7 +263,7 @@ export const AdminApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
async adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -331,7 +296,7 @@ export const AdminApiFactory = function (configuration?: Configuration, basePath
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any): AxiosPromise<File> {
adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any): AxiosPromise<any> {
return localVarFp.adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options).then((request) => request(axios, basePath));
},
};
......@@ -352,7 +317,7 @@ export class AdminApi extends BaseAPI {
* @throws {RequiredError}
* @memberof AdminApi
*/
public adminGetProject(projectString: string, options?: AxiosRequestConfig) {
public adminGetProject(projectString: string, options?: any) {
return AdminApiFp(this.configuration).adminGetProject(projectString, options).then((request) => request(this.axios, this.basePath));
}
......@@ -366,7 +331,7 @@ export class AdminApi extends BaseAPI {
* @throws {RequiredError}
* @memberof AdminApi
*/
public adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: AxiosRequestConfig) {
public adminUpdateQuota(projectId: string, resourceTypeId: string, updateQuotaParameterObject: UpdateQuotaParameterObject, options?: any) {
return AdminApiFp(this.configuration).adminUpdateQuota(projectId, resourceTypeId, updateQuotaParameterObject, options).then((request) => request(this.axios, this.basePath));
}
}
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.3
* The version of the OpenAPI document: 3.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,11 +13,10 @@
*/
import type { Configuration } from './configuration';
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Admin".replace(/\/+$/, "");
......@@ -39,7 +38,7 @@ export const COLLECTION_FORMATS = {
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
options: any;
}
/**
......@@ -65,8 +64,8 @@ export class BaseAPI {
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}
......@@ -4,7 +4,7 @@
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.3
* The version of the OpenAPI document: 3.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,10 +13,9 @@
*/
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";
import { Configuration } from "./configuration";
import { RequiredError, RequestArgs } from "./base";
import { AxiosInstance } from 'axios';
/**
*
......@@ -84,35 +83,24 @@ export const setOAuthToObject = async function (object: any, name: string, scope
}
}
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {
if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
}
else {
Object.keys(parameter).forEach(currentKey =>
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
);
}
}
else {
if (urlSearchParams.has(key)) {
urlSearchParams.append(key, parameter);
}
else {
urlSearchParams.set(key, parameter);
}
}
}
/**
*
* @export
*/
export const setSearchParams = function (url: URL, ...objects: any[]) {
const searchParams = new URLSearchParams(url.search);
setFlattenedQueryParams(searchParams, objects);
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();
}
......@@ -143,8 +131,8 @@ export const toPathString = function (url: URL) {
* @export
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
return axios.request(axiosRequestArgs);
};
}
......@@ -4,7 +4,7 @@
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.3
* The version of the OpenAPI document: 3.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
......@@ -4,7 +4,7 @@
* Coscine.Api.Admin
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.0.3
* The version of the OpenAPI document: 3.0.2
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
......
6.3.0
\ No newline at end of file
5.2.1
\ No newline at end of file
......@@ -4,7 +4,7 @@
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.2
* The version of the OpenAPI document: 3.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,15 +13,13 @@
*/
import type { Configuration } from './configuration';
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
import { Configuration } from './configuration';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
// 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';
import type { RequestArgs } from './base';
// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS, BaseAPI, RequiredError } from './base';
import { BASE_PATH, COLLECTION_FORMATS, RequestArgs, BaseAPI, RequiredError } from './base';
/**
......@@ -38,7 +36,7 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobDeleteFileWithParameter: async (resourceId: string, path?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
blobDeleteFileWithParameter: async (resourceId: string, path?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobDeleteFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
......@@ -63,7 +61,7 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
......@@ -80,7 +78,7 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobGetFileWithParameter: async (resourceId: string, path?: string, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
blobGetFileWithParameter: async (resourceId: string, path?: string, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobGetFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
......@@ -105,7 +103,7 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
setSearchParams(localVarUrlObj, localVarQueryParameter);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
......@@ -119,11 +117,11 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<File>} [files]
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobUploadFileWithParameter: async (resourceId: string, path?: string, files?: Array<File>, options: AxiosRequestConfig = {}): Promise<RequestArgs> => {
blobUploadFileWithParameter: async (resourceId: string, path?: string, files?: Array<any>, options: any = {}): Promise<RequestArgs> => {
// verify required parameter 'resourceId' is not null or undefined
assertParamExists('blobUploadFileWithParameter', 'resourceId', resourceId)
const localVarPath = `/Blob/{resourceId}`
......@@ -157,7 +155,7 @@ export const BlobApiAxiosParamCreator = function (configuration?: Configuration)
localVarHeaderParameter['Content-Type'] = 'multipart/form-data';
setSearchParams(localVarUrlObj, localVarQueryParameter);
setSearchParams(localVarUrlObj, localVarQueryParameter, options.query);
let headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
localVarRequestOptions.headers = {...localVarHeaderParameter, ...headersFromBaseOptions, ...options.headers};
localVarRequestOptions.data = localVarFormParams;
......@@ -185,7 +183,7 @@ export const BlobApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobDeleteFileWithParameter(resourceId: string, path?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
async blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobDeleteFileWithParameter(resourceId, path, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -197,7 +195,7 @@ export const BlobApiFp = function(configuration?: Configuration) {
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobGetFileWithParameter(resourceId: string, path?: string, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
async blobGetFileWithParameter(resourceId: string, path?: string, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobGetFileWithParameter(resourceId, path, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -206,11 +204,11 @@ export const BlobApiFp = function(configuration?: Configuration) {
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<File>} [files]
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
async blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<File>, options?: AxiosRequestConfig): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<File>> {
async blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any): Promise<(axios?: AxiosInstance, basePath?: string) => AxiosPromise<any>> {
const localVarAxiosArgs = await localVarAxiosParamCreator.blobUploadFileWithParameter(resourceId, path, files, options);
return createRequestFunction(localVarAxiosArgs, globalAxios, BASE_PATH, configuration);
},
......@@ -232,7 +230,7 @@ export const BlobApiFactory = function (configuration?: Configuration, basePath?
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<File> {
blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<any> {
return localVarFp.blobDeleteFileWithParameter(resourceId, path, options).then((request) => request(axios, basePath));
},
/**
......@@ -243,7 +241,7 @@ export const BlobApiFactory = function (configuration?: Configuration, basePath?
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobGetFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<File> {
blobGetFileWithParameter(resourceId: string, path?: string, options?: any): AxiosPromise<any> {
return localVarFp.blobGetFileWithParameter(resourceId, path, options).then((request) => request(axios, basePath));
},
/**
......@@ -251,11 +249,11 @@ export const BlobApiFactory = function (configuration?: Configuration, basePath?
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<File>} [files]
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
*/
blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<File>, options?: any): AxiosPromise<File> {
blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any): AxiosPromise<any> {
return localVarFp.blobUploadFileWithParameter(resourceId, path, files, options).then((request) => request(axios, basePath));
},
};
......@@ -277,7 +275,7 @@ export class BlobApi extends BaseAPI {
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobDeleteFileWithParameter(resourceId: string, path?: string, options?: AxiosRequestConfig) {
public blobDeleteFileWithParameter(resourceId: string, path?: string, options?: any) {
return BlobApiFp(this.configuration).blobDeleteFileWithParameter(resourceId, path, options).then((request) => request(this.axios, this.basePath));
}
......@@ -290,7 +288,7 @@ export class BlobApi extends BaseAPI {
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobGetFileWithParameter(resourceId: string, path?: string, options?: AxiosRequestConfig) {
public blobGetFileWithParameter(resourceId: string, path?: string, options?: any) {
return BlobApiFp(this.configuration).blobGetFileWithParameter(resourceId, path, options).then((request) => request(this.axios, this.basePath));
}
......@@ -299,12 +297,12 @@ export class BlobApi extends BaseAPI {
* @summary This method uploads a given File
* @param {string} resourceId Id of the resource
* @param {string} [path] Path to the file
* @param {Array<File>} [files]
* @param {Array<any>} [files]
* @param {*} [options] Override http request option.
* @throws {RequiredError}
* @memberof BlobApi
*/
public blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<File>, options?: AxiosRequestConfig) {
public blobUploadFileWithParameter(resourceId: string, path?: string, files?: Array<any>, options?: any) {
return BlobApiFp(this.configuration).blobUploadFileWithParameter(resourceId, path, files, options).then((request) => request(this.axios, this.basePath));
}
}
......
......@@ -4,7 +4,7 @@
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.2
* The version of the OpenAPI document: 3.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,11 +13,10 @@
*/
import type { Configuration } from './configuration';
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Blob".replace(/\/+$/, "");
......@@ -39,7 +38,7 @@ export const COLLECTION_FORMATS = {
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
options: any;
}
/**
......@@ -65,8 +64,8 @@ export class BaseAPI {
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}
......@@ -4,7 +4,7 @@
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.2
* The version of the OpenAPI document: 3.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......@@ -13,10 +13,9 @@
*/
import type { Configuration } from "./configuration";
import type { RequestArgs } from "./base";
import type { AxiosInstance, AxiosResponse } from 'axios';
import { RequiredError } from "./base";
import { Configuration } from "./configuration";
import { RequiredError, RequestArgs } from "./base";
import { AxiosInstance } from 'axios';
/**
*
......@@ -84,35 +83,24 @@ export const setOAuthToObject = async function (object: any, name: string, scope
}
}
function setFlattenedQueryParams(urlSearchParams: URLSearchParams, parameter: any, key: string = ""): void {
if (parameter == null) return;
if (typeof parameter === "object") {
if (Array.isArray(parameter)) {
(parameter as any[]).forEach(item => setFlattenedQueryParams(urlSearchParams, item, key));
}
else {
Object.keys(parameter).forEach(currentKey =>
setFlattenedQueryParams(urlSearchParams, parameter[currentKey], `${key}${key !== '' ? '.' : ''}${currentKey}`)
);
}
}
else {
if (urlSearchParams.has(key)) {
urlSearchParams.append(key, parameter);
}
else {
urlSearchParams.set(key, parameter);
}
}
}
/**
*
* @export
*/
export const setSearchParams = function (url: URL, ...objects: any[]) {
const searchParams = new URLSearchParams(url.search);
setFlattenedQueryParams(searchParams, objects);
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();
}
......@@ -143,8 +131,8 @@ export const toPathString = function (url: URL) {
* @export
*/
export const createRequestFunction = function (axiosArgs: RequestArgs, globalAxios: AxiosInstance, BASE_PATH: string, configuration?: Configuration) {
return <T = unknown, R = AxiosResponse<T>>(axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
return (axios: AxiosInstance = globalAxios, basePath: string = BASE_PATH) => {
const axiosRequestArgs = {...axiosArgs.options, url: (configuration?.basePath || basePath) + axiosArgs.url};
return axios.request<T, R>(axiosRequestArgs);
return axios.request(axiosRequestArgs);
};
}
......@@ -4,7 +4,7 @@
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.2
* The version of the OpenAPI document: 3.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
#!/bin/sh
# ref: https://help.github.com/articles/adding-an-existing-project-to-github-using-the-command-line/
#
# Usage example: /bin/sh ./git_push.sh wing328 openapi-petstore-perl "minor update" "gitlab.com"
git_user_id=$1
git_repo_id=$2
release_note=$3
git_host=$4
if [ "$git_host" = "" ]; then
git_host="github.com"
echo "[INFO] No command line input provided. Set \$git_host to $git_host"
fi
if [ "$git_user_id" = "" ]; then
git_user_id="GIT_USER_ID"
echo "[INFO] No command line input provided. Set \$git_user_id to $git_user_id"
fi
if [ "$git_repo_id" = "" ]; then
git_repo_id="GIT_REPO_ID"
echo "[INFO] No command line input provided. Set \$git_repo_id to $git_repo_id"
fi
if [ "$release_note" = "" ]; then
release_note="Minor update"
echo "[INFO] No command line input provided. Set \$release_note to $release_note"
fi
# Initialize the local directory as a Git repository
git init
# Adds the files in the local repository and stages them for commit.
git add .
# Commits the tracked changes and prepares them to be pushed to a remote repository.
git commit -m "$release_note"
# Sets the new remote
git_remote=$(git remote)
if [ "$git_remote" = "" ]; then # git remote not defined
if [ "$GIT_TOKEN" = "" ]; then
echo "[INFO] \$GIT_TOKEN (environment variable) is not set. Using the git credential in your environment."
git remote add origin https://${git_host}/${git_user_id}/${git_repo_id}.git
else
git remote add origin https://${git_user_id}:"${GIT_TOKEN}"@${git_host}/${git_user_id}/${git_repo_id}.git
fi
fi
git pull origin master
# Pushes (Forces) the changes in the local repository up to the remote repository
echo "Git pushing to https://${git_host}/${git_user_id}/${git_repo_id}.git"
git push origin master 2>&1 | grep -v 'To https'
......@@ -4,7 +4,7 @@
* Coscine.Api.Blob
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
*
* The version of the OpenAPI document: 3.1.2
* The version of the OpenAPI document: 3.0.1
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
......
.gitignore
.npmignore
.openapi-generator-ignore
api.ts
base.ts
common.ts
......
6.3.0
\ No newline at end of file
5.2.1
\ No newline at end of file
This diff is collapsed.
......@@ -13,11 +13,10 @@
*/
import type { Configuration } from './configuration';
import { Configuration } from "./configuration";
// Some imports not used depending on template conditions
// @ts-ignore
import type { AxiosPromise, AxiosInstance, AxiosRequestConfig } from 'axios';
import globalAxios from 'axios';
import globalAxios, { AxiosPromise, AxiosInstance } from 'axios';
export const BASE_PATH = "https://d-sp16.devlef.campus.rwth-aachen.de/coscine/api/Coscine.Api.Metadata".replace(/\/+$/, "");
......@@ -39,7 +38,7 @@ export const COLLECTION_FORMATS = {
*/
export interface RequestArgs {
url: string;
options: AxiosRequestConfig;
options: any;
}
/**
......@@ -65,8 +64,8 @@ export class BaseAPI {
* @extends {Error}
*/
export class RequiredError extends Error {
name: "RequiredError" = "RequiredError";
constructor(public field: string, msg?: string) {
super(msg);
this.name = "RequiredError"
}
}