Members
AuthLoader :AuthLoader
This object manages loading and finding Handlers for auth.
Type:
- Source:
commands :function
stores all execution commands
Type:
- function
- Source:
(constant) FUNCTION :string
Type:
- string
- Source:
initialisers :Array
Functions executed with commands on start
Type:
- Array
- Source:
REQUEST_MODES :String
Different modes for a request body.
Type:
- String
Properties:
Name | Type | Description |
---|---|---|
RAW |
String | |
URLENCODED |
String | |
FORMDATA |
String | |
FILE |
String |
- Source:
Run :Run
Expose Run instance for testability
Type:
- Source:
triggers :Object
Stores all events that runner triggers
Type:
- Object
- Source:
Methods
(private) _extractField(string, regexp)
Extracts a Digest Auth field from a WWW-Authenticate header value using a given regexp.
Parameters:
Name | Type | Description |
---|---|---|
string |
String | |
regexp |
RegExp |
- Source:
(private) _getDigestAuthHeader(headers)
Returns the 'www-authenticate' header for Digest auth. Since a server can suport more than more auth-scheme, there can be more than one header with the same key. So need to loop over and check each one.
Parameters:
Name | Type | Description |
---|---|---|
headers |
VariableList |
- Source:
_lookup(options, hostLookup, hostname, callback)
Abstracts out the logic for domain resolution
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
options |
|||||||||||
hostLookup |
Properties
|
||||||||||
hostname |
|||||||||||
callback |
- Source:
(private) _schedule(action, payloadopt, argsopt, immediateopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
String | ||
payload |
Object |
<optional> |
|
args |
Array |
<optional> |
|
immediate |
Boolean |
<optional> |
- Source:
authorizeRequest(request, done) → {Request}
Creates a copy of request, with the appropriate auth headers or parameters added.
Parameters:
Name | Type | Description |
---|---|---|
request |
Request | |
done |
- Source:
Returns:
- Type
- Request
bof() → {Boolean}
- Source:
Returns:
- Type
- Boolean
bounds(lengthopt, cyclesopt, callbackopt, scopeopt)
Update length and cycle bounds
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
length |
Number |
<optional> |
0 | |
cycles |
Number |
<optional> |
1 | |
callback |
function |
<optional> |
receives |
|
scope |
Object |
<optional> |
- Source:
box(obj, boundsopt) → {Cursor}
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
obj |
Object | Cursor | ||||||||||||||
bounds |
Object |
<optional> |
Properties
|
- Source:
Returns:
- Type
- Cursor
clear(callbackopt, scopeopt)
Set everything to mnimum dimension
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
receives |
scope |
Object |
<optional> |
- Source:
connect(host, port, callback)
Tries to make a TCP connection to the given host and port. If successful, the connection is immediately destroyed.
Parameters:
Name | Type | Description |
---|---|---|
host |
||
port |
||
callback |
- Source:
cr() → {Boolean}
Is the current position going to trigger a new iteration on .next
?
- Source:
Returns:
- Type
- Boolean
create(lengthopt, cyclesopt, positionopt, iterationopt, refopt) → {Number}
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
length |
Number |
<optional> |
0 | |
cycles |
Number |
<optional> |
1 | |
position |
Number |
<optional> |
0 | |
iteration |
Number |
<optional> |
0 | |
ref |
String |
<optional> |
- Source:
Returns:
- Type
- Number
createItemContext(payload, defaultsopt) → {ItemContext}
Creates a context object to be used with http-request.command
extension.
Parameters:
Name | Type | Attributes | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
payload |
Object |
Properties
|
|||||||||||||
defaults |
Object |
<optional> |
Properties
|
- Source:
Returns:
- Type
- ItemContext
current() → {Object}
Current Cursor state
- Source:
Returns:
- Type
- Object
empty() → {Boolean}
- Source:
Returns:
- Type
- Boolean
eof() → {Boolean}
- Source:
Returns:
- Type
- Boolean
extractRunnableItems(collection, entrypointopt, nullable, callback)
Extracts all the items on a collection starting from the entrypoint.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collection |
Collection | ||||||||||||||||||||||
entrypoint |
Object |
<optional> <nullable> |
Properties
|
||||||||||||||||||||
callback |
function |
- Source:
findItemOrGroup(itemGroup, matchnullable) → {Item|ItemGroup|undefined}
Finds an item or item group based on id or name.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
itemGroup |
ItemGroup | ||
match |
String |
<nullable> |
- Source:
Returns:
- Type
- Item | ItemGroup | undefined
findItemsOrGroups(itemGroup, entrypointSubset, _continueAccumulation, _accumulatedItems) → {Object}
Finds items based on multiple ids or names provided.
Parameters:
Name | Type | Description |
---|---|---|
itemGroup |
ItemGroup | Composite list of Item or ItemGroup. |
entrypointSubset |
Object | Entry-points reference passed across multiple recursive calls. |
_continueAccumulation |
Boolean | Flag used to decide whether to accumulate items or not. |
_accumulatedItems |
Array.<String> | Found Items or ItemGroups. |
- Source:
Returns:
- Type
- Object
flattenNode(node) → {Array.<Item>}
Accumulate all items in order if entry point is a collection/folder. If an item is passed returns an array with that item.
Parameters:
Name | Type | Description |
---|---|---|
node |
ItemGroup | Item |
- Source:
Returns:
- Type
- Array.<Item>
hasChanged(coords) → {Boolean}
Check whether current position and iteration is not as the same specified
Parameters:
Name | Type | Description |
---|---|---|
coords |
Object |
- Source:
Returns:
- Type
- Boolean
immediate(action, payload)
Suspends current instruction and executes the given instruction.
This method explicitly chooses not to handle errors, to allow the caller to catch errors and continue execution without terminating the instruction queue. However, it is up to the caller to make sure errors are handled, or it will go unhandled.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
String | ||
payload |
Object | ||
args... |
* |
<optional> |
- Source:
interrupt(action, payloadopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
String | ||
payload |
Object |
<optional> |
|
args... |
* |
<optional> |
- Source:
load(state, callbackopt, scopeopt)
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
state |
Object |
Properties
|
|||||||||||||||||||||||||||||||
callback |
function |
<optional> |
receives |
||||||||||||||||||||||||||||||
scope |
Object |
<optional> |
- Source:
lookup(lookupOptions, hostname, options, callback)
Override DNS lookups in Node, to handle localhost as a special case. Chrome tries connecting to IPv6 by default, so we try the same thing.
Parameters:
Name | Type | Description | |||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
lookupOptions |
Properties
|
||||||||||||||||||||||||||||
hostname |
|||||||||||||||||||||||||||||
options |
|||||||||||||||||||||||||||||
callback |
- Source:
lookupByIdOrName(collection, options, callback)
Finds an item or group on a collection with a matching id or name.
Parameters:
Name | Type | Description | ||||||||
---|---|---|---|---|---|---|---|---|---|---|
collection |
Collection | |||||||||
options |
Object |
Properties
|
||||||||
callback |
function |
- Source:
lookupByPath(collection, options, callback)
Finds an item or group from a path. The path should be an array of ids from the parent chain.
Parameters:
Name | Type | Description | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collection |
Collection | |||||||||||||
options |
Object |
Properties
|
||||||||||||
callback |
function |
- Source:
meetExpectations(subject, expectations, defaultsopt) → {Object}
ensure the specified keys are functions in subject
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
subject |
Object | ||
expectations |
Array | ||
defaults |
Array |
<optional> |
- Source:
Returns:
- Type
- Object
next(callbackopt, scopeopt)
Seek one forward
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
receives |
scope |
Object |
<optional> |
- Source:
(private) normaliseIterationData(data, length) → {Array}
Parameters:
Name | Type | Description |
---|---|---|
data |
Array | |
length |
Number |
- Source:
Returns:
- Type
- Array
prepareLookupHash(items) → {Object}
Returns a hash of IDs and Names of items in an array
Parameters:
Name | Type | Description |
---|---|---|
items |
Array |
Returns:
- Type
- Object
prepareRunConfig(optionsopt)
Prepares run
config by combining runner
config with given run options.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
Object |
<optional> |
Properties
|
- Source:
queue(action, payloadopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
action |
String | ||
payload |
Object |
<optional> |
|
args... |
* |
<optional> |
- Source:
randomString(length)
Generates a random string of given length
Parameters:
Name | Type | Description |
---|---|---|
length |
Number |
- Source:
- To Do:
-
- Move this to util.js. After moving use that for hawk auth too
randomString(length)
Generates a random string of given length (useful for nonce generation, etc).
Parameters:
Name | Type | Description |
---|---|---|
length |
Number |
- Source:
reset(lengthopt, cyclesopt, positionopt, iterationopt, refopt, callbackopt, scopeopt)
Update length and cycle bounds
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
length |
Number |
<optional> |
0 | |
cycles |
Number |
<optional> |
1 | |
position |
Number |
<optional> |
0 | |
iteration |
Number |
<optional> |
0 | |
ref |
String |
<optional> |
||
callback |
function |
<optional> |
receives |
|
scope |
Object |
<optional> |
- Source:
(private) resolveCursor(cursor) → {Item}
Parameters:
Name | Type | Description |
---|---|---|
cursor |
Object | Cursor |
- Source:
Returns:
- Type
- Item
resolveVariables(context, payload)
Resolve variables in item and auth in context.
Parameters:
Name | Type | Description | ||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
context |
ItemContext |
Properties
|
||||||||||||||||||
payload |
Object |
Properties
|
run(collection, optionsopt, callback)
Runs a collection or a folder.
Parameters:
Name | Type | Attributes | Description | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
collection |
Collection | ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
options |
Object |
<optional> |
Properties
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
callback |
function |
- Source:
(private) sanitizeFiles(request, callback)
Removes files in Request body if any.
Parameters:
Name | Type | Description |
---|---|---|
request |
Request~definition | Request JSON representation to be sanitized |
callback |
function | function invoked with error, request and sanitisedFiles. sanitisedFiles is the list of files removed from request. |
seek(positionopt, iterationopt, callbackopt, scopeopt)
Seek to a specified Cursor
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
position |
Number |
<optional> |
|
iteration |
Number |
<optional> |
|
callback |
function |
<optional> |
receives |
scope |
Object |
<optional> |
- Source:
setCertificate(request, options, cb)
Gets the certificate from the options.certificate And appends it with the options provided
Parameters:
Name | Type | Description |
---|---|---|
request |
||
options |
||
cb |
- Source:
setProxy(request, options, cb)
Sets the Proxy and tunnel to the options
Parameters:
Name | Type | Description |
---|---|---|
request |
||
options |
||
cb |
- Source:
start(callback)
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Object |
- Source:
toChromeCookie(cookie) → {Object}
Creates a Chrome-compatible cookie from a tough-cookie compatible cookie.
Parameters:
Name | Type | Description |
---|---|---|
cookie |
- Source:
Returns:
- Type
- Object
transformMultiValueHeaders(acc, val, key) → {Object}
This method is used in conjunction with _.transform method to convert multi-value headers to multiple single value headers
Parameters:
Name | Type | Description |
---|---|---|
acc |
Array | |
val |
Array | String | |
key |
String |
- Source:
Returns:
- Type
- Object
transformRequestBody(accumulator, param) → {*}
An iterative helper to reduce formdata/urlencoded request bodies from object arrays to a singular aggregated object.
Parameters:
Name | Type | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
accumulator |
Object | The resultant aggregated object representation for the request body. |
|||||||||||||||
param |
Object | One of many request body elements. Properties
|
- Source:
Returns:
- Type
- *
(private) validate(num, min, maxopt) → {Number}
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
num |
Number | ||
min |
Number | [description] |
|
max |
Number |
<optional> |
- Source:
Returns:
- Type
- Number
valueOf() → {Object}
- Source:
Returns:
- Type
- Object
whatnext(coords) → {Object}
Tentative Cursor status, if we do .next()
Parameters:
Name | Type | Description |
---|---|---|
coords |
Object |
- Source:
Returns:
- Type
- Object
zero(callbackopt, scopeopt)
Set everything to minimum dimension
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
callback |
function |
<optional> |
receives |
scope |
Object |
<optional> |
- Source:
Type Definitions
ItemContext
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
coords |
Object | current cursor |
originalItem |
Item | reference to the item in the collection |
item |
Item | Holds a copy of the item given in the payload, so that it can be manipulated as necessary |
auth |
RequestAuthBase | undefined | If present, is the instance of Auth in the collection, which is changed as necessary using intermediate requests, etc. |
replayState |
ReplayState | has context on number of replays(if any) for this request |
- Source:
ReplayState
Defines the current replay state of a request.
By replay state, we mean the number of requests sent as part of one Collection requests. It can be intermediate requests, or replays of the same collection requests.
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
count |
Number | total number of requests, including Collection requests and replays |
- Source: