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.
@vendasta/account-group-sdk
Advanced tools
This provides a typescript implementation of the account group microservice
To setup the sdk you will need to:
Install the sdk to your project
npm install @vendasta/account-group-sdk --save
Next, you will need to import and setup your navigation module (generally in app.module.ts
)
import { AccountGroupModule } from "@vendasta/account-group-sdk";
…
@NgModule({
…
imports: [
…, AccountGroupModule, …
]
})
The Account Group sdk requires the following vendasta packages to be implemented by the project:
EnvironmentService
(https://www.npmjs.com/package/@vendasta/environment-service)PartnerService
(https://www.npmjs.com/package/@vendasta/partner-service)SessionService
(https://www.npmjs.com/package/@vendasta/session-service)Please follow their instructions on how to set those packages up.
Inject the AccountGroupService into your component and you will be able to start using it!
import {AccountGroupService} from '@vendasta/account-group-sdk';
@Component({
selector: '…',
template: '…',
styles: '…'
})
export class …Component {
constructor(private accountGroupService: AccountGroupService) {
}
}
Every call to the account group microservice requires a ProjectionFilter. A projection filter tells the microservice what data to return. By default all fields are false.
interface ProjectionFilterInterface {
accounts?: boolean;
listingDistribution?: boolean;
listingSyncPro?: boolean;
associations?: boolean;
accountGroupExternalIdentifiers?: boolean;
socialUrls?: boolean;
hoursOfOperation?: boolean;
contactDetails?: boolean;
snapshotReports?: boolean;
legacyProductDetails?: boolean;
richData?: boolean;
}
During construction, you can pass in all of the properties you want the api call to return:
import {ProjectionFilter} from '@vendasta/account-group-sdk'
let pf = new ProjectionFilter({accounts: true, socialUrls: true, richData: true});
Or you can call enableAll
to return all data.
import {ProjectionFilter} from '@vendasta/account-group-sdk'
let pf = new ProjectionFilter().enableAll();
lookup(projectionFilter: ProjectionFilter, marketIds: string[] = null, searchTerm: string = null, filters: LookupFilter = null, pageSize: number = 10): Observable<AccountGroup[]>
Lookup returns many account groups matching the criteria specified. To fetch the next set of paged results from a lookup, call loadMore
passing in the same criteria that was used in the original lookup
.
loadMore(projectionFilter: ProjectionFilter, marketIds: string[], searchTerm: string, filters: LookupFilter, pageSize: number = 10): Observable<AccountGroup[]>
The list of account groups returned by loadMore
will include the previous account groups fetched - there is no need to keep track of the list of account groups in your component.
Lookup provides some helper observables you can subscribe to:
get hasMore(): Observable<boolean>
Whether or not there are more account groups to fetch
get accountGroups(): Observable<AccountGroup[]>
The current list of account groups fetched
get totalResults(): Observable<number>
How many results are there total to fetch
get loading(): Observable<boolean>
Whether or not the service is currently talking to the microservice
get(accountGroupId: string, projectionFilter: ProjectionFilter): Observable<AccountGroup>
Fetch a single account group by its ID
getMulti(accountGroupIds: string[], projectionFilter: ProjectionFilter): Observable<AccountGroup[]>
Fetch many account groups by their IDs
bulkUpdate(accountGroupId: string, updateOperations: UpdateOperations): Observable<Response>
To use the bulkUpdate function you will need to construct an UpdateOperations object and add the update operations you want to do to the account group.
There are 10 operations to choose from:
NapUpdateOperation
SnapshotsUpdateOperation
ListingDistributionDetailsUpdateOperation
ListingSyncProUpdateOperation
AccountGroupExternalIdentifiersUpdateOperation
SocialURLsUpdateOperation
HoursOfOperationUpdateOperation
ContactDetailsUpdateOperation
LegacyProductDetailsUpdateOperation
RichDataUpdateOperation
import {UpdateOperations} from '@vendasta/account-group-sdk'
let operations: UpdateOperations = new UpdateOperations();
operations.addUpdateOperation(new NapUpdateOperation({key: value...}));
operations.addUpdateOperation(new SnapshotsUpdateOperation({key: value...}));
operations.addUpdateOperation(new ListingDistributionDetailsUpdateOperation({key: value...}));
operations.addUpdateOperation(new ListingSyncProUpdateOperation({key: value...}));
operations.addUpdateOperation(new AccountGroupExternalIdentifiersUpdateOperation({key: value...}));
operations.addUpdateOperation(new SocialURLsUpdateOperation({key: value...}));
operations.addUpdateOperation(new HoursOfOperationUpdateOperation({key: value...}));
operations.addUpdateOperation(new ContactDetailsUpdateOperation({key: value...}));
operations.addUpdateOperation(new LegacyProductDetailsUpdateOperation({key: value...}));
operations.addUpdateOperation(new RichDataUpdateOperation({key: value...}));
Only fields specified will be altered on the account group.
FAQs
Account Group Microservice typescript sdk.
The npm package @vendasta/account-group-sdk receives a total of 3 weekly downloads. As such, @vendasta/account-group-sdk popularity was classified as not popular.
We found that @vendasta/account-group-sdk 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
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.