![Introducing Enhanced Alert Actions and Triage Functionality](https://cdn.sanity.io/images/cgdhsj6q/production/fe71306d515f85de6139b46745ea7180362324f0-2530x946.png?w=800&fit=max&auto=format)
Product
Introducing Enhanced Alert Actions and Triage Functionality
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
@xtreamr/cla-request
Advanced tools
``` yarn add @xtreamr/cla-request //or npm install @xtreamr/cla-request --save-dev ```
Readme
yarn add @xtreamr/cla-request
//or
npm install @xtreamr/cla-request --save-dev
import Request from '@xtreamr/cla-request'
export const request = new Request()
request.init({ apiUrl: 'www.someapiurl.com' })
request.setBearer({ bearer: 'auth-token' }) // set as authorization header
// - Path: path to build the final end point with apiUrl. If path is: /product/1 -> www.someapiurl.com/product/1
// - Options: same options as vanilla fetch: https://developer.mozilla.org/es/docs/Web/API/Fetch_API
// with some changes. Body should be an object and it is using as default content type header: 'application/json'.
// Add two new options to cache responses: cache and refreshCache (to force refresh cache data).
request.fetch(path, options)
To mock data into development you could configure the request with two paremeters into constructor:
const mockData = {
// use query, parameters and optionsFetch to mock the api
// use async functions to not include this code into the final bundle
'/product/{id}': async ({
query, // query parameters
parameters, // path parameters (id in this case), show path '/product/{id}' into mockOptions
optionsFetch // fetch options { method, mode, headers, body...} https://developer.mozilla.org/es/docs/Web/API/Fetch_API/Using_Fetch
}) => {
return {
id: 1,
name: 'tv'
}
},
'/products': async () => {
return [
{
id: 1,
name: 'tv'
},
{
id: 2,
name: 'computer'
}
]
},
}
const mockOptions = {
disabled: false, // if is disable the rest of keys haven't any effect
delay: 10, // delay of response
all: false, // all path mock = true
paths: { // to enable or disable by path
'/product/{id}': true, // enabled
'/products': false, // disabled
},
},
export const request = new Request({
mockData,
mockOptions
})
FAQs
``` yarn add @xtreamr/cla-request //or npm install @xtreamr/cla-request --save-dev ```
The npm package @xtreamr/cla-request receives a total of 1 weekly downloads. As such, @xtreamr/cla-request popularity was classified as not popular.
We found that @xtreamr/cla-request demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 14 open source maintainers 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.
Product
Socket now supports four distinct alert actions instead of the previous two, and alert triaging allows users to override the actions taken for all individual alerts.
Security News
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.