Product
Introducing SSO
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
@vendasta/account-group-sdk
Advanced tools
Readme
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 18 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.
Product
Streamline your login process and enhance security by enabling Single Sign-On (SSO) on the Socket platform, now available for all customers on the Enterprise plan, supporting 20+ identity providers.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.