Skip to the content.

@goodwaygroup/lib-tradedesk - v1.3.1 / DataProvider

Class: DataProvider

Table of contents

Constructors

Properties

Methods

Constructors

constructor

+ new DataProvider(secretKey: string, options?: DataProviderOptions): DataProvider

Parameters

Name Type
secretKey string
options DataProviderOptions

Returns: DataProvider

Defined in: src/dataProvider.ts:54

Properties

options

options: DataProviderOptions

Options used to make requests

Defined in: src/dataProvider.ts:49


secretKey

Private secretKey: string

Provider Provisioned Secret Key

Defined in: src/dataProvider.ts:54

Methods

createSignature

createSignature(body: string): string

Creates a HMAC SHA1 Signature

Parameters

Name Type
body string

Returns: string

Defined in: src/dataProvider.ts:80


makeUrl

Private makeUrl(uri: string): string

Make URL by combining the apiUrl and the given uri

Parameters

Name Type
uri string

Returns: string

Defined in: src/dataProvider.ts:89


post

post(uri: string, payload: Record<string, unknown>, options?: RequestInit): Promise<Response>

Create a POST request

Parameters

Name Type
uri string
payload Record<string, unknown>
options RequestInit

Returns: Promise<Response>

Defined in: src/dataProvider.ts:153


request

Private request(uri: string, options: RequestInit, attempts?: number): Promise<Response>

Make a http request with node-fetch with builtin retries

Parameters

Name Type Default value
uri string -
options RequestInit -
attempts number 0

Returns: Promise<Response>

Defined in: src/dataProvider.ts:96


setApiUrl

setApiUrl(url: string): DataProvider

Set the API Url to an explicit url

Parameters

Name Type
url string

Returns: DataProvider

Defined in: src/dataProvider.ts:70