Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
quasar-app-extension-api-wrapper
Advanced tools
===
An easy to use out of the box API wrapper tha use axios in its core
Note: The extension can be used as an
npm
package, using: api-client-wrapper
This extension was designed to wrap up the most common features of an api client implementation, in an effort to have a quick and stable tool for each project.
The present features in the extension are:
Easy global access: The extension came with a boot script that put an $api object available at global scope for any component: this.$api
Base API url: The url that will be used as a root for any call that contains a relative path this.$api.baseURL
. Note: If a call contains a full path (one with http or https protocol) it will be called as is without baseURL concatenation.
Homogeneous response: Each request is a promise that resolve with an homogeneous response object: {success:Boolean, attempts:int, data:Object, info:string, error:Error}
. For more details refer to the Response Schema section on this readme.
Concurrent requests: All the requests could be made simultaneously. By default the limit is configured to 5 concurrent requests, but it could be changed at this.$api.simultaneousCalls
Timeout and retry: In the case of a timeout response a request could be configured to try again with: this.$api.maxAttemptsPerCall
the default value is 1. Each attempt will be executed transparently and it will be just one response so the code for a request with a single attempt will be the same as for a request with multiple attempts.
Masive requests: There is out of the box support for bulk calls that allows multiple requests in a single call. for more information refer to the How To use it section on this readme.
Vuex integration: The extension came with Vuex store integration for state monitoring. During boot phase a module is registered to Vuex with the next information:
this.$store.state.APIwrapper.working
GET
this.$store.state.APIwrapper.uploading
GET
this.$store.state.APIwrapper.downloading
this.$store.state.APIwrapper.request_count
this.$store.state.APIwrapper.executing_count
Note: It is possible to have the store configured out of the boot phase using
this.$api.setStore(Vuex_instance)
. Refer to the How to use it section.
quasar ext add api-wrapper
Quasar CLI will retrieve it from NPM and install the extension.
quasar ext remove my-ext <- change name
GET
requestlet result = await this.$api.get('path');
//or
this.$api.get('path').then(result->{});
POST
requestlet result = await this.$api.post('path', {data});
//or
this.$api.post('path', {data}).then(result->{});
get(path='', conf = {})
post(path='', data = {}, conf = {})
patch(path='', data = {}, conf = {})
put(path='', data = {}, conf = {})
delete(path='', conf = {})
Note that each method has a final argument that is a custom configuration for the request, this configuration takes precedence over the global configuration. For the supported properties please refer to the Configuration section.
Each method has a bulk counterpart that allows for bulk calls
let result = await bulkGet(['paths' or {configs}], continueWithFailure:Boolean, onProgress)
let result = await bulkPost(['paths' or {configs}], continueWithFailure:Boolean, onProgress)
let result = await bulkPatch(['paths' or {configs}], continueWithFailure:Boolean, onProgress)
let result = await bulkPut(['paths' or {configs}], continueWithFailure:Boolean, onProgress)
let result = await bulkDelete(['paths' or {configs}], continueWithFailure:Boolean, onProgress)
//or the global method that allows bulk calls with different methods
let result = await bulkCall([{configs}], continueWithFailure:Boolean, onProgress)
false
The request will be considered failed when any of it subrequests fail and it will stop any further execution (there could be some sub-requests that never get executed if some other request failed before). true
All the requests are executed, it doesn´t matter if some of them failed.FAQs
A Quasar App Extension designed to wrap up the most common features of an api client implementation
The npm package quasar-app-extension-api-wrapper receives a total of 0 weekly downloads. As such, quasar-app-extension-api-wrapper popularity was classified as not popular.
We found that quasar-app-extension-api-wrapper demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.