@energyweb/issuer-irec-api-wrapper / Exports / IRECAPIClient
Class: IRECAPIClient
Hierarchy
-
EventEmitter
↳ IRECAPIClient
Table of contents
Constructors
Properties
- axiosInstance
- config
- interceptorId
- captureRejectionSymbol
- captureRejections
- defaultMaxListeners
- errorMonitor
Accessors
Methods
- addListener
- applyTokens
- disableInterceptor
- emit
- enableErrorHandler
- enableInterceptor
- ensureNotExpired
- eventNames
- getMaxListeners
- listenerCount
- listeners
- login
- off
- on
- once
- prependListener
- prependOnceListener
- rawListeners
- redeem
- refreshAccessTokens
- removeAllListeners
- removeListener
- setMaxListeners
- transfer
- listenerCount
- on
- once
Constructors
constructor
+ new IRECAPIClient(endPointUrl
: string, accessTokens?
: AccessTokens): IRECAPIClient
Parameters:
Name | Type |
---|---|
endPointUrl |
string |
accessTokens? |
AccessTokens |
Returns: IRECAPIClient
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:43
Properties
axiosInstance
• Private
axiosInstance: AxiosInstance
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:43
config
• Private
config: AxiosRequestConfig
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:39
interceptorId
• Private
interceptorId: number
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:41
captureRejectionSymbol
▪ Static
Readonly
captureRejectionSymbol: typeof captureRejectionSymbol
Defined in: node_modules/@types/node/events.d.ts:35
captureRejections
▪ Static
captureRejections: boolean
Sets or gets the default captureRejection value for all emitters.
Defined in: node_modules/@types/node/events.d.ts:41
defaultMaxListeners
▪ Static
defaultMaxListeners: number
Defined in: node_modules/@types/node/events.d.ts:42
errorMonitor
▪ Static
Readonly
errorMonitor: typeof errorMonitor
This symbol shall be used to install a listener for only monitoring 'error'
events. Listeners installed using this symbol are called before the regular
'error'
listeners are called.
Installing a listener using this symbol does not change the behavior once an
'error'
event is emitted, therefore the process will still crash if no
regular 'error'
listener is installed.
Defined in: node_modules/@types/node/events.d.ts:34
Accessors
account
• get account(): object
Returns: object
Name | Type |
---|---|
get |
(code : string) => Promise<Account> |
getAll |
() => Promise<Account[]> |
getBalance |
(code : string) => Promise<AccountBalance[]> |
getItems |
(code : string) => Promise<AccountItem[]> |
getTransactions |
(code : string) => Promise<(Transaction | RedeemTransaction)[]> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:91
device
• get device(): object
Returns: object
Name | Type |
---|---|
approve |
(code : string, \_\_namedParameters : { fileIds? : string[] ; notes? : string }) => Promise<void> |
create |
(device : DeviceCreateParams) => Promise<Device> |
edit |
(code : string, device : Partial<DeviceUpdateParams>) => Promise<Device> |
get |
(code : string) => Promise<Device> |
getAll |
() => Promise<Device[]> |
refer |
(code : string, \_\_namedParameters : { fileIds? : string[] ; notes? : string }) => Promise<void> |
reject |
(code : string, \_\_namedParameters : { fileIds? : string[] ; notes? : string }) => Promise<void> |
submit |
(code : string, \_\_namedParameters : { fileIds? : string[] ; notes? : string }) => Promise<void> |
verify |
(code : string, \_\_namedParameters : { fileIds? : string[] ; notes? : string }) => Promise<void> |
withdraw |
(code : string, \_\_namedParameters : { notes? : string }) => Promise<void> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:269
file
• get file(): object
Returns: object
Name | Type |
---|---|
download |
(code : string) => Promise<string> |
upload |
(files : Blob[] | ReadStream[]) => Promise<string[]> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:242
fuel
• get fuel(): object
Returns: object
Name | Type |
---|---|
getAll |
() => Promise<Fuel[]> |
getAllTypes |
() => Promise<FuelType[]> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:381
issue
• get issue(): object
Returns: object
Name | Type |
---|---|
approve |
(code : string, approve : ApproveIssue) => Promise<void> |
create |
(issue : Issue) => Promise<string> |
get |
(code : string) => Promise<IssueWithStatus> |
getStatus |
(code : string) => Promise<IssueWithStatus> |
refer |
(code : string, notes? : string) => Promise<void> |
reject |
(code : string, notes? : string) => Promise<void> |
submit |
(code : string, notes? : string) => Promise<void> |
update |
(code : string, issue : Issue) => Promise<void> |
verify |
(code : string, notes? : string) => Promise<void> |
withdraw |
(code : string, notes? : string) => Promise<void> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:173
organisation
• get organisation(): object
Returns: object
Name | Type |
---|---|
get |
() => Promise<Organisation> |
getIssuers |
() => Promise<CodeName[]> |
getRegistrants |
() => Promise<CodeName[]> |
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:142
Methods
addListener
▸ addListener(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:636
applyTokens
▸ Private
applyTokens(accessToken
: string, refreshToken
: string, expiresIn
: number): void
Parameters:
Name | Type |
---|---|
accessToken |
string |
refreshToken |
string |
expiresIn |
number |
Returns: void
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:428
disableInterceptor
▸ Private
disableInterceptor(): void
Returns: void
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:491
emit
▸ emit(event
: string | symbol, ...args
: any[]): boolean
Parameters:
Name | Type |
---|---|
event |
string | symbol |
...args |
any[] |
Returns: boolean
Defined in: node_modules/@types/node/globals.d.ts:646
enableErrorHandler
▸ Private
enableErrorHandler(): void
Returns: void
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:500
enableInterceptor
▸ Private
enableInterceptor(): void
Returns: void
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:478
ensureNotExpired
▸ Private
ensureNotExpired(): Promise<void>
Returns: Promise<void>
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:469
eventNames
▸ eventNames(): (string | symbol)[]
Returns: (string | symbol)[]
Defined in: node_modules/@types/node/globals.d.ts:651
getMaxListeners
▸ getMaxListeners(): number
Returns: number
Defined in: node_modules/@types/node/globals.d.ts:643
listenerCount
▸ listenerCount(type
: string | symbol): number
Parameters:
Name | Type |
---|---|
type |
string | symbol |
Returns: number
Defined in: node_modules/@types/node/globals.d.ts:647
listeners
▸ listeners(event
: string | symbol): Function[]
Parameters:
Name | Type |
---|---|
event |
string | symbol |
Returns: Function[]
Defined in: node_modules/@types/node/globals.d.ts:644
login
▸ login(userName
: string, password
: string, clientId
: string, clientSecret
: string): Promise<AccessTokens>
Parameters:
Name | Type |
---|---|
userName |
string |
password |
string |
clientId |
string |
clientSecret |
string |
Returns: Promise<AccessTokens>
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:56
off
▸ off(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:640
on
▸ on(event
: tokensRefreshed, listener
: (accessTokens
: AccessTokens) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
tokensRefreshed |
listener |
(accessTokens : AccessTokens) => void |
Returns: IRECAPIClient
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:35
once
▸ once(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:638
prependListener
▸ prependListener(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:649
prependOnceListener
▸ prependOnceListener(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:650
rawListeners
▸ rawListeners(event
: string | symbol): Function[]
Parameters:
Name | Type |
---|---|
event |
string | symbol |
Returns: Function[]
Defined in: node_modules/@types/node/globals.d.ts:645
redeem
▸ redeem(redemption
: Redemption): Promise<RedeemTransactionResult>
Parameters:
Name | Type |
---|---|
redemption |
Redemption |
Returns: Promise<RedeemTransactionResult>
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:414
refreshAccessTokens
▸ Private
refreshAccessTokens(): Promise<AccessTokens>
Returns: Promise<AccessTokens>
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:442
removeAllListeners
▸ removeAllListeners(event?
: string | symbol): IRECAPIClient
Parameters:
Name | Type |
---|---|
event? |
string | symbol |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:641
removeListener
▸ removeListener(event
: string | symbol, listener
: (...args
: any[]) => void): IRECAPIClient
Parameters:
Name | Type |
---|---|
event |
string | symbol |
listener |
(...args : any[]) => void |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:639
setMaxListeners
▸ setMaxListeners(n
: number): IRECAPIClient
Parameters:
Name | Type |
---|---|
n |
number |
Returns: IRECAPIClient
Defined in: node_modules/@types/node/globals.d.ts:642
transfer
▸ transfer(transfer
: Transfer): Promise<TransactionResult>
Parameters:
Name | Type |
---|---|
transfer |
Transfer |
Returns: Promise<TransactionResult>
Defined in: packages/traceability/issuer-irec-api-wrapper/src/IRECAPIClient.ts:400
listenerCount
▸ Static
listenerCount(emitter
: EventEmitter, event
: string | symbol): number
deprecated
since v4.0.0
Parameters:
Name | Type |
---|---|
emitter |
EventEmitter |
event |
string | symbol |
Returns: number
Defined in: node_modules/@types/node/events.d.ts:23
on
▸ Static
on(emitter
: EventEmitter, event
: string): AsyncIterableIterator<any>
Parameters:
Name | Type |
---|---|
emitter |
EventEmitter |
event |
string |
Returns: AsyncIterableIterator<any>
Defined in: node_modules/@types/node/events.d.ts:20
once
▸ Static
once(emitter
: NodeEventTarget, event
: string | symbol): Promise<any[]>
Parameters:
Name | Type |
---|---|
emitter |
NodeEventTarget |
event |
string | symbol |
Returns: Promise<any[]>
Defined in: node_modules/@types/node/events.d.ts:18
▸ Static
once(emitter
: DOMEventTarget, event
: string): Promise<any[]>
Parameters:
Name | Type |
---|---|
emitter |
DOMEventTarget |
event |
string |
Returns: Promise<any[]>
Defined in: node_modules/@types/node/events.d.ts:19