Skip to content

Commits on Source 6

......@@ -14,6 +14,7 @@ test:
- npm test
except:
refs:
- master
- tags
variables:
- $GITLAB_USER_ID == $GIT_BOT_USER_ID
......@@ -22,6 +23,7 @@ publish:
stage: publish
script:
- npm run build
- npm test
- npx semantic-release
only:
- master
......
{
"name": "@coscine/api-connection",
"version": "1.20.0",
"version": "1.21.0",
"lockfileVersion": 1,
"requires": true,
"dependencies": {
......
{
"name": "@coscine/api-connection",
"version": "1.21.0",
"version": "1.22.0",
"description": "This library provides methods to connect to CoScInE Apis with JavaScript.",
"keywords": [
"coscine",
......
......@@ -6,6 +6,7 @@ export { LicenseApi } from './requests/license-api';
export { MetadataApi } from './requests/metadata-api';
export { NoticeApi } from './requests/notice-api';
export { OrganizationApi } from './requests/organization-api';
export { PIDApi } from './requests/pid-api';
export { ProjectApi } from './requests/project-api';
export { ProjectRoleApi } from './requests/project-role-api';
export { ResourceApi } from './requests/resource-api';
......
......@@ -2,7 +2,22 @@ const axios = require('axios');
const authHeaderKey = 'Authorization';
const clientCorrolationIdKey = 'X-Coscine-Logging-CorrelationId';
axios.interceptors.request.use((request: any) => {
if ((typeof coscine !== "undefined") && (typeof coscine.loading !== "undefined") && (typeof coscine.loading.counter !== "undefined")) {
coscine.loading.counter++;
}
return request;
}, (error: any) => {
return Promise.reject(error);
});
axios.interceptors.response.use(function (response: any) {
if ((typeof coscine !== "undefined") && (typeof coscine.loading !== "undefined") && (typeof coscine.loading.counter !== "undefined")) {
coscine.loading.counter--;
}
return response;
}, function (error: any) {
return Promise.reject(error);
});
export default {
getHostName() {
let hostName = window.location.hostname;
......
const axios = require('axios');
import apiConnectionBasic from '../basic/api-connection-basic';
function getPIDApiUrl() {
return (
'https://' + apiConnectionBasic.getHostName() + '/coscine/api/Coscine.Api.Pid/Pid/'
);
}
export class PIDApi {
public static sendMailToOwner(
body: any,
thenHandler: any = apiConnectionBasic.defaultThenHandler,
catchHandler: any = apiConnectionBasic.defaultOnCatch
) {
return axios
.post(getPIDApiUrl() + 'sendMailToOwner', body)
.then(thenHandler)
.catch(catchHandler);
}
}
......@@ -5,6 +5,9 @@ declare var coscine: {
clientcorrolation: {
id: string;
};
loading: {
counter: number ;
}
};
declare var _spPageContextInfo: any;