Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
@covalent/http
Advanced tools
It is a framework of decorators on top of the angular [HttpClient] or covalent [TdHttpService] to enhance your services and give them Http capabilities.
Example:
import { Injectable } from '@angular/core';
import { HttpHeaders, HttpResponse } from '@angular/common/http';
import { Observable } from 'rxjs';
import { map, catchError } from 'rxjs/operators';
import {
mixinHttp,
TdGET,
TdPOST,
TdBody,
TdParam,
TdResponse,
TdQueryParams,
} from '@covalent/http';
/**
* mixinHttp can use TdHttpService and HttpClient
*/
@Injectable()
export class TestHttpService extends mixinHttp(class {}, {
baseUrl: 'www.mybaseurl.com',
baseHeaders: new HttpHeaders({ 'Accept': 'application/json' }),
}) { // or }, HttpClient) {
/**
* Generates http request [www.mybaseurl.com/myitems] GET and returns an HttpResponse object
*/
@TdGET({
path: '/myitems',
options: {
observe: 'response',
},
})
getResponse(): Observable<HttpResponse<any>> { return; }
/**
* Assuming queryParams = {q: 1}
* Generates http request [www.mybaseurl.com/myitems?q=1] GET and returns the response body parsed in JSON
*/
@TdGET({
path: '/myitems',
})
getParsedResponse(@TdQueryParams() queryParams?: HttpParams): Observable<HttpResponse<any>> { return; }
/**
* Generates http request [www.mybaseurl.com/myitems] GET and returns the number of items after we use `map` of the response body
*/
@TdGET({
path: '/myitems',
})
getMappedResponse(@TdResponse() response?: Observable<HttpResponse<any>>): Observable<number> {
return response.pipe(
map((data: any) => {
return data.items.length;
}),
);
}
/**
* Assuming `id` = 1234
* Generates http request [www.mybaseurl.com/myitems/1234] GET and returns the response body parsed in JSON
*/
@TdGET({
path: '/myitems/:id',
})
get(@TdParam('id') id: string,
@TdResponse() response?: Observable<HttpResponse<any>>): Observable<any> { return; }
/**
* Generates http request [www.mybaseurl.com/myitems] POST with a request body and returns the response body parsed in JSON
*/
@POST({
path: '/myitems',
})
create(@TdBody() body: any,
@TdResponse() response?: Observable<HttpResponse<any>>): Observable<any> {
return response.pipe(
map((data: any) => {
return {
name: data.MyName,
};
}),
);
}
}
FAQs
Teradata UI Platform HttpClient Helper Module
The npm package @covalent/http receives a total of 165 weekly downloads. As such, @covalent/http popularity was classified as not popular.
We found that @covalent/http demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.