Home Manual Reference Source

Function

Static Public Summary
public

Creates a authorized context instance.

public

Get the entities assembly if it has one

public

getAuthToken(username: string, password: string, config: object): Promise<object>

Obtains a user access token and refresh_token.

public

Determine if the entity has an assembly

public

setAssembly(entity: BidEntity, assembly: Assembly | string): BidEntity

Set the entity's assembly reference. Omitting or passing null for the assembly will UNSET the assembly reference

Static Public

public createContext(config: object): PVBidContext source

import {createContext} from 'pvbid-sdk/src/pvbid.js'

Creates a authorized context instance.

Params:

NameTypeAttributeDescription
config object
config.token string

The auth token to access account data..

config.base_uri string
  • optional
  • default: https://api.pvbid.com/v2

Return:

PVBidContext

public getAssembly(entity: BidEntity): Assembly | undefined source

Get the entities assembly if it has one

Params:

NameTypeAttributeDescription
entity BidEntity

Return:

Assembly | undefined

public getAuthToken(username: string, password: string, config: object): Promise<object> source

import {getAuthToken} from 'pvbid-sdk/src/pvbid.js'

Obtains a user access token and refresh_token.

Params:

NameTypeAttributeDescription
username string

The user's email address is used

password string
config object
config.base_uri string
  • optional
  • default: https://api.pvbid.com/v2

Return:

Promise<object>

Return Properties:

NameTypeAttributeDescription
token_type string
expires_in number

Unix timestamp

access_token string
refresh_token string

public hasAssembly(entity: BidEntity): boolean source

Determine if the entity has an assembly

Params:

NameTypeAttributeDescription
entity BidEntity

Return:

boolean

public setAssembly(entity: BidEntity, assembly: Assembly | string): BidEntity source

Set the entity's assembly reference. Omitting or passing null for the assembly will UNSET the assembly reference

Params:

NameTypeAttributeDescription
entity BidEntity
assembly Assembly | string
  • optional

The assembly reference id OR the assembly entity.

Return:

BidEntity