@coscine/api-connection
Advanced tools
Comparing version 1.17.1 to 1.18.0
@@ -117,2 +117,12 @@ var axios = require('axios'); | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
return BlobApi.getDownloadObject(resourceId, path, function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
FileSaver_min.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}, catchHandler); | ||
}; | ||
BlobApi.getDownloadObject = function (resourceId, path, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
apiConnectionBasic.setHeader(); | ||
@@ -123,8 +133,3 @@ return axios$2 | ||
}) | ||
.then(function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
FileSaver_min.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}) | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
@@ -469,2 +474,11 @@ }; | ||
}; | ||
ProjectRoleApi.leaveProject = function (projectId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
apiConnectionBasic.setHeader(); | ||
return axios$9 | ||
.delete(getProjectRoleApiUrl() + 'project/' + projectId + '/user') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
return ProjectRoleApi; | ||
@@ -542,3 +556,3 @@ }()); | ||
return axios$b | ||
.get(getResourceTypeApiUrl()) | ||
.get(getResourceTypeApiUrl() + 'types') | ||
.then(thenHandler) | ||
@@ -552,7 +566,7 @@ .catch(catchHandler); | ||
return axios$b | ||
.get(getResourceTypeApiUrl() + 'enabled') | ||
.get(getResourceTypeApiUrl() + 'types/-/enabled') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
ResourceTypeApi.getFields = function (resourceTypeId, thenHandler, catchHandler) { | ||
ResourceTypeApi.getResourceType = function (resourceTypeId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
@@ -562,3 +576,3 @@ if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
return axios$b | ||
.get(getResourceTypeApiUrl() + resourceTypeId + '/fields') | ||
.get(getResourceTypeApiUrl() + 'types/' + resourceTypeId) | ||
.then(thenHandler) | ||
@@ -565,0 +579,0 @@ .catch(catchHandler); |
(function (global, factory) { | ||
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) : | ||
typeof define === 'function' && define.amd ? define(['exports'], factory) : | ||
(global = global || self, factory(global.apiConnection = {})); | ||
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.apiConnection = {})); | ||
}(this, (function (exports) { 'use strict'; | ||
@@ -123,2 +123,12 @@ | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
return BlobApi.getDownloadObject(resourceId, path, function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
FileSaver_min.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}, catchHandler); | ||
}; | ||
BlobApi.getDownloadObject = function (resourceId, path, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
apiConnectionBasic.setHeader(); | ||
@@ -129,8 +139,3 @@ return axios$2 | ||
}) | ||
.then(function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
FileSaver_min.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}) | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
@@ -475,2 +480,11 @@ }; | ||
}; | ||
ProjectRoleApi.leaveProject = function (projectId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
apiConnectionBasic.setHeader(); | ||
return axios$9 | ||
.delete(getProjectRoleApiUrl() + 'project/' + projectId + '/user') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
return ProjectRoleApi; | ||
@@ -548,3 +562,3 @@ }()); | ||
return axios$b | ||
.get(getResourceTypeApiUrl()) | ||
.get(getResourceTypeApiUrl() + 'types') | ||
.then(thenHandler) | ||
@@ -558,7 +572,7 @@ .catch(catchHandler); | ||
return axios$b | ||
.get(getResourceTypeApiUrl() + 'enabled') | ||
.get(getResourceTypeApiUrl() + 'types/-/enabled') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
ResourceTypeApi.getFields = function (resourceTypeId, thenHandler, catchHandler) { | ||
ResourceTypeApi.getResourceType = function (resourceTypeId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = apiConnectionBasic.defaultThenHandler; } | ||
@@ -568,3 +582,3 @@ if (catchHandler === void 0) { catchHandler = apiConnectionBasic.defaultOnCatch; } | ||
return axios$b | ||
.get(getResourceTypeApiUrl() + resourceTypeId + '/fields') | ||
.get(getResourceTypeApiUrl() + 'types/' + resourceTypeId) | ||
.then(thenHandler) | ||
@@ -571,0 +585,0 @@ .catch(catchHandler); |
@@ -15,2 +15,12 @@ "use strict"; | ||
if (catchHandler === void 0) { catchHandler = api_connection_basic_1.default.defaultOnCatch; } | ||
return BlobApi.getDownloadObject(resourceId, path, function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
file_saver_1.default.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}, catchHandler); | ||
}; | ||
BlobApi.getDownloadObject = function (resourceId, path, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = api_connection_basic_1.default.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = api_connection_basic_1.default.defaultOnCatch; } | ||
api_connection_basic_1.default.setHeader(); | ||
@@ -21,8 +31,3 @@ return axios | ||
}) | ||
.then(function (response) { | ||
// Let the user save the file. | ||
// The data is cached until the response is completed! | ||
file_saver_1.default.saveAs(response.data, name); | ||
window.location.hash = window.location.hash.substring(0, window.location.hash.lastIndexOf('/')); | ||
}) | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
@@ -29,0 +34,0 @@ }; |
@@ -54,2 +54,11 @@ "use strict"; | ||
}; | ||
ProjectRoleApi.leaveProject = function (projectId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = api_connection_basic_1.default.defaultThenHandler; } | ||
if (catchHandler === void 0) { catchHandler = api_connection_basic_1.default.defaultOnCatch; } | ||
api_connection_basic_1.default.setHeader(); | ||
return axios | ||
.delete(getProjectRoleApiUrl() + 'project/' + projectId + '/user') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
return ProjectRoleApi; | ||
@@ -56,0 +65,0 @@ }()); |
@@ -19,3 +19,3 @@ "use strict"; | ||
return axios | ||
.get(getResourceTypeApiUrl()) | ||
.get(getResourceTypeApiUrl() + 'types') | ||
.then(thenHandler) | ||
@@ -29,7 +29,7 @@ .catch(catchHandler); | ||
return axios | ||
.get(getResourceTypeApiUrl() + 'enabled') | ||
.get(getResourceTypeApiUrl() + 'types/-/enabled') | ||
.then(thenHandler) | ||
.catch(catchHandler); | ||
}; | ||
ResourceTypeApi.getFields = function (resourceTypeId, thenHandler, catchHandler) { | ||
ResourceTypeApi.getResourceType = function (resourceTypeId, thenHandler, catchHandler) { | ||
if (thenHandler === void 0) { thenHandler = api_connection_basic_1.default.defaultThenHandler; } | ||
@@ -39,3 +39,3 @@ if (catchHandler === void 0) { catchHandler = api_connection_basic_1.default.defaultOnCatch; } | ||
return axios | ||
.get(getResourceTypeApiUrl() + resourceTypeId + '/fields') | ||
.get(getResourceTypeApiUrl() + 'types/' + resourceTypeId) | ||
.then(thenHandler) | ||
@@ -42,0 +42,0 @@ .catch(catchHandler); |
export declare class BlobApi { | ||
static downloadObject(resourceId: any, path: string, name: string, catchHandler?: any): any; | ||
static getDownloadObject(resourceId: any, path: string, thenHandler?: any, catchHandler?: any): any; | ||
static deleteObject(resourceId: any, path: any, thenHandler?: any, catchHandler?: any): any; | ||
@@ -4,0 +5,0 @@ static uploadObject(resourceId: any, path: any, mimetype: any, data: any, thenHandler?: any, catchHandler?: any): any; |
@@ -7,2 +7,3 @@ export declare class ProjectRoleApi { | ||
static deleteUser(parentId: any, userId: any, roleId: any, thenHandler?: any, catchHandler?: any): any; | ||
static leaveProject(projectId: any, thenHandler?: any, catchHandler?: any): any; | ||
} |
export declare class ResourceTypeApi { | ||
static getResourceTypes(thenHandler?: any, catchHandler?: any): any; | ||
static getEnabledResourceTypes(thenHandler?: any, catchHandler?: any): any; | ||
static getFields(resourceTypeId: any, thenHandler?: any, catchHandler?: any): any; | ||
static getResourceType(resourceTypeId: any, thenHandler?: any, catchHandler?: any): any; | ||
} |
{ | ||
"name": "@coscine/api-connection", | ||
"version": "1.17.1", | ||
"version": "1.18.0", | ||
"description": "This library provides methods to connect to CoScInE Apis with JavaScript.", | ||
@@ -87,4 +87,4 @@ "keywords": [ | ||
"devDependencies": { | ||
"@commitlint/cli": "^8.3.5", | ||
"@commitlint/config-conventional": "^8.3.4", | ||
"@commitlint/cli": "^9.1.2", | ||
"@commitlint/config-conventional": "^9.1.1", | ||
"@hutson/semantic-delivery-gitlab": "^9.1.0", | ||
@@ -96,4 +96,4 @@ "@semantic-release/commit-analyzer": "^8.0.1", | ||
"@semantic-release/release-notes-generator": "^9.0.1", | ||
"@types/jest": "^26.0.0", | ||
"@types/node": "^14.0.13", | ||
"@types/jest": "^26.0.9", | ||
"@types/node": "^14.0.27", | ||
"colors": "^1.4.0", | ||
@@ -105,8 +105,8 @@ "commitizen": "^4.1.2", | ||
"cz-conventional-changelog": "^3.2.0", | ||
"eslint": "^7.2.0", | ||
"eslint": "^7.6.0", | ||
"eslint-config-google": "^0.14.0", | ||
"eslint-plugin-vue": "^6.2.2", | ||
"husky": "^4.2.5", | ||
"jest": "^26.0.1", | ||
"jest-config": "^26.0.1", | ||
"jest": "^26.4.0", | ||
"jest-config": "^26.4.0", | ||
"lint-staged": "^10.2.11", | ||
@@ -118,3 +118,3 @@ "lodash.camelcase": "^4.3.0", | ||
"rimraf": "^3.0.2", | ||
"rollup": "^2.17.1", | ||
"rollup": "^2.23.1", | ||
"rollup-plugin-commonjs": "^10.1.0", | ||
@@ -124,12 +124,12 @@ "rollup-plugin-json": "^4.0.0", | ||
"rollup-plugin-sourcemaps": "^0.6.2", | ||
"rollup-plugin-typescript2": "^0.27.1", | ||
"semantic-release": "^17.0.8", | ||
"rollup-plugin-typescript2": "^0.27.2", | ||
"semantic-release": "^17.1.1", | ||
"shelljs": "^0.8.4", | ||
"ts-jest": "^26.1.0", | ||
"ts-jest": "^26.2.0", | ||
"ts-node": "^8.10.2", | ||
"tslint": "^6.1.2", | ||
"tslint": "^6.1.3", | ||
"tslint-config-prettier": "^1.18.0", | ||
"tslint-config-standard": "^9.0.0", | ||
"typedoc": "^0.17.7", | ||
"typescript": "^3.9.5" | ||
"typedoc": "^0.18.0", | ||
"typescript": "^3.9.7" | ||
}, | ||
@@ -136,0 +136,0 @@ "publishConfig": { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Native code
Supply chain riskContains native code (e.g., compiled binaries or shared libraries). Including native code can obscure malicious behavior.
Found 1 instance in 1 package
350586
2752