Skip to content
Snippets Groups Projects
Select Git revision
  • Experiment/esbuild
  • main default protected
  • Issue/3133-subProjectsChanges
  • dev protected
  • Issue/2489-addNotificationManagement
  • Issue/3085-useNewApiClient
  • Issue/3043-DataStorageNrwResource
  • Issue/3011-maintenanceMode
  • Issue/2446-addingResponsibleOrganization
  • Issue/2900-removeInsituteField
  • Issue/2981-dataPubInDb
  • Issue/2881-messageController
  • Issue/2921-changesToDataPublicationFeature
  • Issue/2926-regAppLogin
  • Issue/2672-fixSfbPidPointing
  • Issue/2875-devcontainer
  • Issue/2401-advisoryServiceUI2
  • Issue/2445-extractedMetadata
  • Issue/2829-useHrefProperty
  • Issue/xxxx-configurableApiHostname
  • Issue/2627-addPidRecord
  • v3.17.0
  • v3.16.0
  • v3.15.0
  • v3.14.0
  • v3.13.0
  • v3.12.0
  • v3.11.0
  • v3.10.0
  • v3.9.0
  • v3.8.0
  • v3.7.0
  • v3.6.0
  • v3.5.0
  • v3.4.3
  • v3.4.2
  • v3.4.1
  • v3.4.0
  • v3.3.2-package.0
  • v3.3.1
  • v3.3.0
41 results

common.ts

Blame
  • Code owners
    Assign users and groups as approvers for specific file changes. Learn more.
    common.ts 4.12 KiB
    /* tslint:disable */
    /* eslint-disable */
    /**
     * Coscine.Api.ActivatedFeatures
     * No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
     *
     * The version of the OpenAPI document: 2.0.3
     * 
     *
     * 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;
        }