Module: instance-creator

This module creates the initial Instance and Person (for the instance owner) objects.

Source:

Methods

(async, static) createInstance(options) → {Promise.<Array.<ObjectCreation>>}

Parameters:
Name Type Description
options InstanceUpdaterOptions

Use this module through instance.registerRecipes for your convenience. It provides the name and owner from the active instance and registers any given Recipes with the currently running instance, which this function does not do since you could create or update an inactive instance. Note that recipes are not added to the runtime, since you might be updating an inactive Instance object.

Source:
Returns:

Returns the result of creating the Instance object and, if provided Recipe and Module objects. The Instance object creation result always is in the first position and always exists. The Person object creation result is in second place, but it only exists if the Person object had to be created. Recipe and Module creation results only exist if any recipes or modules were provided.

Type: Promise.<Array.<ObjectCreation>>

Type Definitions

InstanceUpdateOptions

Type:
  • object
Properties:
Name Type Attributes Default Description
name string

The name given to the instance is part of the instance ID

email string

The uniquely identifying email address of the instance owner

ownerName string <optional>

The name of the owner (optional)

personEncryptionKeyPair KeyPair <optional>

Encryption keypair used for instance owner. If provided, all four keys must be provided together. In that case no new keys will be created upon instance creation, instead these keys will be used. The keys are only used for a new instance. If they are provided but an instance already exists nothing will happen.

personSignKeyPair SignKeyPair <optional>

Sign keypair used for instance owner. Also see the description for personEncryptionKeyPair.

instanceEncryptionKeyPair KeyPair <optional>

Encryption keypair used for instance. Also see the description for personEncryptionKeyPair.

instanceSignKeyPair SignKeyPair <optional>

Sign keypair used for instance. Also see the description for personEncryptionKeyPair.

secret string

A secret known to the owner. It is used to derive a key to encrypt the private keys created (only!) during initial instance creation. The string will be normalized.

recipes Array.<Recipe> <optional>
[]
enabledReverseMapTypes Map.<OneObjectTypeNames, (undefined|Array.<string>)> <optional>
new Map()
enabledReverseMapTypesForIdObjects Map.<OneObjectTypeNames, (undefined|Array.<string>)> <optional>
new Map()
Source: