forked from JonathanBennett/AkamaiOPEN-edgegrid-node
-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #94 from akamai/release/v3.2.0
Release/v3.2.0
- Loading branch information
Showing
6 changed files
with
2,031 additions
and
197 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
import { AxiosError, AxiosResponse } from "axios"; | ||
|
||
declare class EdgeGrid { | ||
constructor(clientTokenOrOptions: string | object, | ||
clientSecret?: string, | ||
accessToken?: string, | ||
host?: string, | ||
debug?: boolean); | ||
|
||
request: object; | ||
config: object; | ||
|
||
/** | ||
* Sends the request and invokes the callback function. | ||
* | ||
* @param {Function} callback The callback function. | ||
* @return EdgeGrid object (self) | ||
*/ | ||
send(callback: (error: AxiosError, response?: AxiosResponse, body?: string) => void): EdgeGrid; | ||
|
||
/** | ||
* Builds the request using the properties of the local config Object. | ||
* | ||
* @param {Object} req The request Object. Can optionally contain a | ||
* 'headersToSign' property: An ordered list header names | ||
* that will be included in the signature. This will be | ||
* provided by specific APIs. | ||
* @return EdgeGrid object (self) | ||
*/ | ||
auth(req: object): EdgeGrid; | ||
} | ||
|
||
export = EdgeGrid; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
import { expectType } from 'tsd'; | ||
import EdgeGrid = require('.') | ||
|
||
const eg = new EdgeGrid({ | ||
path: '/path/to/.edgerc', | ||
section: 'section-name' | ||
}); | ||
|
||
expectType<EdgeGrid>(eg) | ||
|
||
var req = { | ||
path: '/diagnostic-tools/v1/locations', | ||
method: 'GET', | ||
headers: {}, | ||
body: 'bodyData' | ||
} | ||
expectType<EdgeGrid>(eg.auth(req)) | ||
|
||
expectType<EdgeGrid>(eg.send((error, resp, body) => console.log(body))) |
Oops, something went wrong.