Represents state of command.
  • CommandState.SENDING: commands is sedning.
  • CommandState.DELIVERED: commands is delivered.
  • CommandState.INCOMPLETE: commands is incompleted.
  • CommandState.DONE: commands is handled.


Represents types of error
  • Errors.ArgumentError: error caused by invalid arguments.
  • Errors.HttpError: error caused when doing http request to kii server.
  • Errors.IlllegalStateError: error caseud of illlegal states.
  • Errors.NetworkError: error caseud of network connection.


Represent source to fire trigger.
  • EventSource.STATES: fire trigger based on states.
  • EventSource.SCHEDULE: fire trigger based on schedule.
  • EventSource.SCHEDULE_ONCE: fire trigger based on schedule only once.


Represents field type
  • FieldType.INTEGER: integer field type.
  • FieldType.DECIMAL: decimal field type.
  • FieldType.BOOLEAN: boolean field type.
  • FieldType.OBJECTSG: object field type.
  • FieldType.ARRAY: array field type.


AggreationType will be used to create type of aggreation when querying history states.
  • AggregationType.COUNT: count function.
  • AggregationType.SUM: sum function.
  • AggregationType.MAX: max function.
  • AggregationType.MIN: min function.
  • AggregationType.MEAN: mean function.


Represent layout of thing
  • LayoutPosition.GATEWAY: when thing is gateway.
  • LayoutPosition.ENDNODE: when thing is endnode.
  • LayoutPosition.STANDALONE: when thing is not either gateway nor endnode.


Represents log level.
  • LogLevel.Error: error level.
  • LogLevel.Warn: warn level.
  • LogLevel.Info: info level.
  • LogLevel.Verbose: verbose level.
  • LogLevel.Debug: debug level.
  • LogLevel.Silly: silly level.


Represents KiiCloud server location.
  • Site.US: use cloud in US.
  • Site.JP: use cloud in Japan.
  • Site.CN3: use cloud in cn3 site of China.
  • Site.SG: use cloud in Singapore.
  • Site.EU: use cloud in EU.


Represents Action type of the trigger.
  • TriggersWhat.COMMAND: Execute a command when trigger is fired.
  • TriggersWhat.SERVER_CODE: Call a server code when trigger is fired.


Represents the type of condition to fire a trigger.
  • TriggersWhen.CONDITION_TRUE: Always fires when the Condition is evaluated as true.
  • TriggersWhen.CONDITION_FALSE_TO_TRUE: Fires when previous State is evaluated as false and current State is evaluated as true.
  • TriggersWhen.CONDITION_CHANGED: Fires when the previous State and current State is evaluated as different value. i.e. false to true, true to false.


Represents Types
  • Types.Group: use group type.
  • Types.User: use user type.
  • Types.Thing: use thing type.


default_1(options, onCompletionopt) → {Promise}

Perform an asynchronous HTTP request.
Name Type Attributes Description
options Object
  • method:The HTTP method to use for the request (e.g. "POST", "GET", "PUT").
  • url:A string containing the URL to which the request is sent.
  • body:Data to be sent to the server.
  • headers:An object of http header key/value pairs to send along with requests.
onCompletion onCompletion <optional>
callback function when completed
promise object