Members
accessors
Launcher for gRPC Greeter example. This file creates and starts a server providing the service defined in the Greeter.proto file. The server listens on port 50051 of the local host. It then instantiates a composite accessor defined in the greeterTest.js file, which instantiates an accessor that is a Greeter service client.
assert
.assert(expression, message, negateMessage, expected, actual, showDiff)
Executes an expression and check expectations. Throws AssertionError for reporting if test doesn't pass.
EventEmitter
Module exports.
express
A device discovery listener for Node.js.
This program should be executed on the terra server.
This program starts a web server and listens for POSTs containing info about devices connected to a particular host. It prints the info to the screen and stores the info in a variable. It does not currently persist the data.
To test locally, see instructions at the bottom of the file.
Accessors: https://accessors.org/ Discovery: https://accessors.org/wiki/Version0/Discovery
Author: Elizabeth Latronico
grpc
Wrapper for a grpc service defined by the Greeter.proto file. This file can and should be generated automatically from the proto file. It defines an accessor that has one input port and one output port for each gRPC call defined in the Greeter service proto file. The name of the input is the name of the RPC call, and the name of the output is the same name with "Response" appended. The IP address and port of the service are given by a parameter.
FIXME: This is currently insecure, requiring no credentials.
httpClient
Registery for discovered accessors, allowing accessors to publish the accessors that they discover. Refinable (mutable) accessors can subscribe as listers so they get a callback whenever a new accessor becomes available.
httpClient
Registery for discovered accessors, allowing accessors to publish the accessors that they discover. Refinable (mutable) accessors can subscribe as listers so they get a callback whenever a new accessor becomes available.
nodeHost
This "swarmlet" example, running on node Host, illustrates the deterministric temporal semantics implementation
- Version:
- $$Id$$
- Source:
rules
These are the parse rules for the URL parser, it informs the parser about:
- The char it Needs to parse, if it's a string it should be done using indexOf, RegExp using exec and NaN means set as current value.
- The property we should set when parsing this value.
- Indication if it's backwards or forward parsing, when set as number it's the value of extra chars that should be split off.
- Inherit from location if non existing in the parser.
toLowerCase
the resulting value.
SpaceTypeEnum
Properties:
Name | Type | Description |
---|---|---|
EUCLIDEAN |
||
METRIC |
||
TOPOLOGICAL |
||
SET |
Methods
addObserver()
Adds an observer to the item of interest. Use an observer to monitor values produced by reacttoInputs().
Call after accessor DOM elements have been added to the page (see below).
The observer should change the successMessage and make nextButton visible.
You may optionally set successMessage to a hint if the solution is wrong.
addObserver()
Adds an observer to the item of interest. Use an observer to monitor values produced by reacttoInputs().
Call after accessor DOM elements have been added to the page (see below).
The observer should change the successMessage and make nextButton visible.
You may optionally set successMessage to a hint if the solution is wrong.
clearRepo() → {void}
Deletes all maps, entities, and coordinate transformations in the repo.
Returns:
- Clearing the repo always works.
- Type
- void
coordinateTransformationsToJSONString() → {string}
Returns the current state of the global coordinate transformations storage as a JSON string.
Returns:
- Type
- string
coordinateTransformationsToString() → {string}
Returns the current state of the global coordinate transformations storage as a string.
Returns:
- Type
- string
createApplication(args) → {function}
Create an api.ai application.
Parameters:
Name | Type | Description |
---|---|---|
args |
* | [description] |
Returns:
- Type
- function
createApplicationDeprecated(clientAccessToken, subscriptionKey, _options) → {Application}
Old version function for creation application instance.
Parameters:
Name | Type | Description |
---|---|---|
clientAccessToken |
string | Access token. You can get it on https://api.ai |
subscriptionKey |
string | Subscribtion key. It has not been used anymore. |
_options |
object | Default option for apllication. |
Returns:
[description]
- Type
- Application
createApplicationNew(clientAccessToken, subscriptionKey, _options) → {Application}
New version function for creation application instance.
Parameters:
Name | Type | Description |
---|---|---|
clientAccessToken |
string | Access token. You can get it on https://api.ai |
subscriptionKey |
string | Subscribtion key. It has not been used anymore. |
_options |
object | Default option for apllication. |
Returns:
[description]
- Type
- Application
decode(input) → {String}
Decode a URI encoded string.
Parameters:
Name | Type | Description |
---|---|---|
input |
String | The URI encoded string. |
- Source:
Returns:
The decoded string.
- Type
- String
drawMap(data)
Draw the map with the given data.
Parameters:
Name | Type | Description |
---|---|---|
data |
The lat, lng of each signpost and an array of time, temperature. |
- Source:
entitiesToJSONString() → {string}
Returns the current state of the global entities storage as a JSON string.
Returns:
- Type
- string
entitiesToString() → {string}
Returns the current state of the global entities storage as a string.
Returns:
- Type
- string
extractProtocol(address) → {ProtocolExtract}
Extract protocol information from a URL with/without double slash ("//").
Parameters:
Name | Type | Description |
---|---|---|
address |
String | URL we want to extract from. |
- Source:
Returns:
Extracted information.
- Type
- ProtocolExtract
findSignpost(marker)
Find the signpost that corresponds to this marker.
Parameters:
Name | Type | Description |
---|---|---|
marker |
The marker that was clicked on. |
- Source:
Returns:
The signpost associated with that marker, or null if none found.
getCoordinateTransformation(domainName, codomainName) → {boolean}
Retrieve a previously registered coordinate transformation from the global storage.
Parameters:
Name | Type | Description |
---|---|---|
domainName |
String | The name of domain coordinate system. |
codomainName |
String | The name of codomain coordinate system. |
Returns:
A function that takes one argument, a point in the domain, and returns a point in the codomain
- Type
- boolean
getResource(uri)
Get a resource. Below are the types of resources that are handled all other resources will cause an error. This is a copy from nodeHose.js so that this test file can run.
- $KEYSTORE is replaced with $HOME/.ptKeystore
Parameters:
Name | Type | Description |
---|---|---|
uri |
A specification for the resource. |
getSignposts()
Get signpost data and create content for info windows. This is called back from the .html file once the map is loaded.
- Source:
initialize()
Initialize the beacons-android library.
- Source:
localRepoToJSONString() → {string}
Returns the current state of the global in-memory maps storage as a JSON string. The object has properties: maps, coordinateTransformations, and entities.
Returns:
- Type
- string
lolcation(loc) → {Object}
The location object differs when your code is loaded through a normal page,
Worker or through a worker using a blob. And with the blobble begins the
trouble as the location object will contain the URL of the blob, not the
location of the page where our code is loaded in. The actual origin is
encoded in the pathname
so we can thankfully generate a good "default"
location from it so we can generate proper relative URL's again.
Parameters:
Name | Type | Description |
---|---|---|
loc |
Object | String | Optional default location object. |
Returns:
lolcation object.
- Type
- Object
mapsToJSONString() → {string}
Returns the current state of the global maps storage as a JSON string.
Returns:
- Type
- string
mapsToString() → {string}
Returns the current state of the global maps storage as a string.
Returns:
- Type
- string
module:lib/interfaces/common()
TDD-style interface:
exports.Array = {
'#indexOf()': {
'should return -1 when the value is not present': function(){
},
'should return the correct index when the value is present': function(){
}
}
};
module:lib/interfaces/common()
QUnit-style interface:
suite('Array');
test('#length', function(){
var arr = [1,2,3];
ok(arr.length == 3);
});
test('#indexOf()', function(){
var arr = [1,2,3];
ok(arr.indexOf(1) == 0);
ok(arr.indexOf(2) == 1);
ok(arr.indexOf(3) == 2);
});
suite('String');
test('#length', function(){
ok('foo'.length == 3);
});
module:lib/interfaces/common()
TDD-style interface:
suite('Array', function(){
suite('#indexOf()', function(){
suiteSetup(function(){
});
test('should return -1 when not present', function(){
});
test('should return the index when present', function(){
});
suiteTeardown(function(){
});
});
});
module:lib/interfaces/common(val, options) → {String|Number}
Parse or format the given val
.
Options:
long
verbose formatting [false]
Parameters:
Name | Type | Description |
---|---|---|
val |
String | Number | |
options |
Object |
Returns:
- Type
- String | Number
parseDataAudio(data, i)
Parse data received from the websocket.
Parameters:
Name | Type | Description |
---|---|---|
data |
The data received from the websocket. |
|
i |
The index of this signpost. |
- Source:
publish(url)
Publish a newly-discovered accessor. Subscribers will get a callback with the accessor's description (first argument) and the accessor's source (second argument). The description has a 'params' field that stores the parameters of the accessor.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL that points to the accessor. |
publish(url)
Publish a newly-discovered accessor. Subscribers will get a callback with the accessor's description (first argument) and the accessor's source (second argument). The description has a 'params' field that stores the parameters of the accessor.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL that points to the accessor. |
query() → {object}
Get all the available accessors.
Returns:
Available accessors indexed by their URL.
- Type
- object
query() → {object}
Get all the available accessors.
- Source:
Returns:
Available accessors indexed by their URL.
- Type
- object
querystring(query) → {Object}
Simple query string parser.
Parameters:
Name | Type | Description |
---|---|---|
query |
String | The query string that needs to be parsed. |
- Source:
Returns:
- Type
- Object
querystringify(obj, prefix) → {String}
Transform a query string to an object.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Object | Object that should be transformed. |
prefix |
String | Optional prefix. |
- Source:
Returns:
- Type
- String
registerAndReact()
Set up event listeners and react for the first time.
- Source:
registerCoordinateTransformation(domainName, codomainName, codomainName) → {boolean}
Before any coordinate transformation can be used by mapManager, it must first be registered so it can be placed in the global coordinate transformation storage.
Parameters:
Name | Type | Description |
---|---|---|
domainName |
String | The name of domain coordinate system. |
codomainName |
String | The name of codomain coordinate system. |
codomainName |
function | A function that takes one argument, a point in the domain, and returns a point in the codomain |
Returns:
if the coordinate transformation was successfully registered returns true, false otherwise.
- Type
- boolean
registerEntity(entity) → {boolean}
Before any entity can be used by mapManager, it must first be registered so it can be placed in the global entity storage.
Parameters:
Name | Type | Description |
---|---|---|
entity |
Entity | The entity object to be registered by the map manager. |
Returns:
if the entity was successfully registered returns true, false otherwise.
- Type
- boolean
registerMap(map) → {boolean}
Before any map can be used by mapManager, it must first be registered so it can be placed in the global map storage.
Parameters:
Name | Type | Description |
---|---|---|
map |
Map | The map object to be registered by the map manager. |
Returns:
if the map was successfully registered returns true, false otherwise.
- Type
- boolean
replaceRepo(repo) → {boolean}
Replaces the current values of maps, coordinateTransformations, and entities with the input. Currently does NOT check the input besides making sure it has "maps", "coordinateTransformations", and "entities" properties
Parameters:
Name | Type | Description |
---|---|---|
repo |
String | A JSON string of the format you would get calling localRepoToJSONString() |
Returns:
if the input was an acceptably formatted repo.
- Type
- boolean
resolve(relative, base) → {String}
Resolve a relative URL pathname against a base URL pathname.
Parameters:
Name | Type | Description |
---|---|---|
relative |
String | Pathname of the relative URL. |
base |
String | Pathname of the base URL. |
- Source:
Returns:
Resolved pathname.
- Type
- String
sayHelloImplementation()
Implement the sayHello RPC method of the service.
set(part, value, fn) → {URL}
This is convenience method for changing properties in the URL instance to insure that they all propagate correctly.
Parameters:
Name | Type | Description |
---|---|---|
part |
String | Property we need to adjust. |
value |
Mixed | The newly assigned value. |
fn |
Boolean | function | When setting the query, it will be the function used to parse the query. When setting the protocol, double slash will be removed from the final url if it is true. |
- Source:
Returns:
- Type
- URL
setup()
This accessor produces outputs periodically, at one second intervals, as long as the most recently received suppress input is not true. The 'output' is a count of the periods, starting with 1.
setup()
Composite containing one instance of the Greeter service wrapper. The request to the service is generated by the GenerateRequest accessor and the response is displayed by the TextDisplay accessor.
startEddystoneURLBeacon()
Start advertising Eddystone-URL beacon. Upon success, the supplied callback is invoked with one argument. The argument is a handle that can be used to stop the advertisement.
- Source:
stop()
Stop advertisement of particular beacon.
- Source:
stopAll()
Stop advertisement of all beacons.
- Source:
(static) stringify(obj, sep, eq, munge, name)
Converts an arbitrary value to a Query String representation.
Objects with cyclical references will trigger an exception.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Variant | any arbitrary value to convert to query string |
sep |
String | (optional) Character that should join param k=v pairs together. Default: "&" |
eq |
String | (optional) Character that should join keys to their values. Default: "=" |
munge |
Boolean | (optional) Indicate whether array/object params should be munged, PHP/Rails-style. Default: true |
name |
String | (optional) Name of the current key, for handling children recursively. |
- Source:
(static) stringify(obj, sep, eq, munge, name)
Converts an arbitrary value to a Query String representation.
Objects with cyclical references will trigger an exception.
Parameters:
Name | Type | Description |
---|---|---|
obj |
Variant | any arbitrary value to convert to query string |
sep |
String | (optional) Character that should join param k=v pairs together. Default: "&" |
eq |
String | (optional) Character that should join keys to their values. Default: "=" |
munge |
Boolean | (optional) Indicate whether array/object params should be munged, PHP/Rails-style. Default: true |
name |
String | (optional) Name of the current key, for handling children recursively. |
subscribe(callback) → {number}
Subscribe to updates regarding newly-discovered accessors. The first argument of the callback function will capture the accessor's description, the second will capture the its source code. The description is an object with two keys: 'url' and 'params'; together they uniquely identify a "Thing." Note that the accessor must indeed be instantiated using the given parameters, or else it will fail to connect to the appropriate "Thing."
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Function to call when a new accessor is discovered. |
Returns:
corresponding to the activated subscription.
- Type
- number
subscribe(callback) → {number}
Subscribe to updates regarding newly-discovered accessors. The first argument of the callback function will capture the accessor's description, the second will capture the its source code. The description is an object with two keys: 'url' and 'params'; together they uniquely identify a "Thing." Note that the accessor must indeed be instantiated using the given parameters, or else it will fail to connect to the appropriate "Thing."
Parameters:
Name | Type | Description |
---|---|---|
callback |
function | Function to call when a new accessor is discovered. |
Returns:
corresponding to the activated subscription.
- Type
- number
Testing()
Create a Testing object for managing tests.
Testing implements the following functions: loadTestFile(filename): Load the given test file. run(): Execute the loaded test file.
In the future, it would also be helpful to have: clearTests(): Clear all currently loaded tests. loadTests(string): Load the tests in the given string. setReporter(enum): Set the format of the output to one of the reporter choices.
Testing emits an 'end' event upon completion of all tests and supplies the results of the tests.
toString(stringify) → {String}
Transform the properties back in to a valid and full URL string.
Parameters:
Name | Type | Description |
---|---|---|
stringify |
function | Optional query stringify function. |
- Source:
Returns:
- Type
- String
unpublish(url)
Unpublish an accessor because it is no longer available.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL that points to the accessor. |
unpublish(url)
Unpublish an accessor because it is no longer available.
Parameters:
Name | Type | Description |
---|---|---|
url |
string | The URL that points to the accessor. |
unsubscribe(id)
Unsubscribe to updates regarding newly-discovered accessors.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | corresponding to an active subscription. |
unsubscribe(id)
Unsubscribe to updates regarding newly-discovered accessors.
Parameters:
Name | Type | Description |
---|---|---|
id |
number | corresponding to an active subscription. |
useSampleAudioData(i)
Use sample audio data for the given signpost.
Parameters:
Name | Type | Description |
---|---|---|
i |
The index of the signpost. |
- Source:
useSampleRFData(i)
Use sample RF data for the given signpost.
Parameters:
Name | Type | Description |
---|---|---|
i |
The index of the signpost. |
- Source:
Type Definitions
ProtocolExtract
Type:
- Object
Properties:
Name | Type | Description |
---|---|---|
protocol |
String | Protocol matched in the URL, in lowercase. |
slashes |
Boolean |
|
rest |
String | Rest of the URL that is not part of the protocol. |