From 9778b04a8448d25695ebf4d5249b3f67b1cdadee Mon Sep 17 00:00:00 2001 From: sevenbitbyte Date: Tue, 27 Jun 2023 04:37:29 +0000 Subject: [PATCH 1/3] cleanup await config.read --- docs/CloudDocument.html | 2 +- docs/LokiQuery.html | 2 +- docs/MongoQuery.html | 2 +- docs/bouncer_db_loki-db.js.html | 4 ++-- docs/bouncer_db_tingo-db.js.html | 4 ++-- docs/bouncer_db_zango-db.js.html | 4 ++-- docs/bouncer_icrufler.js.html | 4 ++-- docs/bouncer_idb.js.html | 4 ++-- docs/bouncer_index.js.html | 4 ++-- docs/bouncer_ischema.js.html | 4 ++-- docs/bouncer_mongo-query.js.html | 4 ++-- docs/comms_ble-socket.js.html | 4 ++-- docs/comms_i2p-socket-comms.js.html | 4 ++-- docs/comms_index.js.html | 4 ++-- docs/comms_isocket-comms.js.html | 4 ++-- docs/comms_loopback-channel.js.html | 4 ++-- docs/comms_loopback-comms.js.html | 4 ++-- docs/comms_loopback-socket.js.html | 4 ++-- docs/comms_peer-comms.js.html | 4 ++-- docs/comms_rest-comms.js.html | 14 +++++++------- docs/comms_rtc-socket-comms.js.html | 4 ++-- docs/comms_websocket-comms.js.html | 4 ++-- docs/config_iconfig.js.html | 4 ++-- docs/config_index.js.html | 4 ++-- docs/config_json-file.js.html | 4 ++-- docs/config_local-storage.js.html | 4 ++-- docs/config_memory.js.html | 4 ++-- docs/config_nconf.js.html | 4 ++-- docs/config_secure-config.js.html | 8 ++++---- docs/global.html | 2 +- docs/index.html | 4 ++-- docs/module-Comms.BLEPeerClient.html | 2 +- docs/module-Comms.I2pSocketComms.html | 2 +- docs/module-Comms.ISocketComms.html | 2 +- docs/module-Comms.LoopbackChannel.html | 2 +- docs/module-Comms.LoopbackComms.html | 2 +- docs/module-Comms.LoopbackSocket.html | 2 +- docs/module-Comms.PeerComms.html | 2 +- docs/module-Comms.RTCSocketComms.html | 2 +- docs/module-Comms.RestComms.html | 2 +- docs/module-Comms.WebsocketComms.html | 2 +- docs/module-Comms.html | 2 +- docs/module-Config.IConfig.html | 2 +- docs/module-Config.JsonFileConfig.html | 2 +- docs/module-Config.LocalStorageConfig.html | 2 +- docs/module-Config.MemoryConfig.html | 2 +- docs/module-Config.NconfConfig.html | 2 +- docs/module-Config.SecureConfig.html | 2 +- docs/module-Config.html | 2 +- docs/module-Db.IDb.html | 2 +- docs/module-Db.ISchema.html | 2 +- docs/module-Db.LokiDb.html | 2 +- docs/module-Db.TingoDb.html | 2 +- docs/module-Db.ZangoDb.html | 2 +- docs/module-Db.html | 2 +- docs/module-Party.CloudParty.html | 2 +- docs/module-Party.DocumentFactory.html | 2 +- docs/module-Party.IDocument.html | 2 +- docs/module-Party.IParty.html | 2 +- docs/module-Party.LokiCache.html | 2 +- docs/module-Party.LokiParty.html | 2 +- docs/module-Party.MongoParty.html | 2 +- docs/module-Party.PeerParty.html | 2 +- docs/module-Party.Query.html | 2 +- docs/module-Party.TingoParty.html | 2 +- docs/module-Party.ZangoParty.html | 2 +- docs/module-Party.html | 2 +- docs/module-Service.EndpointContext.html | 2 +- docs/module-Service.IEndpoint.html | 2 +- docs/module-Service.IMiddleware.html | 2 +- docs/module-Service.ISandboxRunner.html | 2 +- docs/module-Service.IService.html | 2 +- docs/module-Service.ITask.html | 2 +- docs/module-Service.RunnerRouter.html | 2 +- docs/module-Service.ServiceHost.html | 2 +- docs/module-Service.ServiceRunner.html | 2 +- docs/module-Service.ServiceRunnerNode.html | 2 +- docs/module-Service.html | 2 +- docs/module-Topics.LocalTopicHost.html | 2 +- docs/module-Topics.html | 2 +- docs/party_cloud_cloud-document.js.html | 4 ++-- docs/party_cloud_cloud-party.js.html | 4 ++-- docs/party_document-factory.js.html | 4 ++-- docs/party_idocument.js.html | 4 ++-- docs/party_index.js.html | 4 ++-- docs/party_iparty.js.html | 10 ++++++---- docs/party_local_loki-party.js.html | 4 ++-- docs/party_local_loki-query.js.html | 4 ++-- docs/party_local_tingo-party.js.html | 4 ++-- docs/party_local_zango-party.js.html | 4 ++-- docs/party_loki-cache.js.html | 4 ++-- docs/party_mongo_mongo-party.js.html | 4 ++-- docs/party_peer_peer-party.js.html | 4 ++-- docs/party_query.js.html | 4 ++-- docs/service_endpoint-context.js.html | 4 ++-- docs/service_iendpoint.js.html | 4 ++-- docs/service_imiddleware.js.html | 4 ++-- docs/service_index.js.html | 4 ++-- docs/service_isandbox-runner.js.html | 4 ++-- docs/service_ischema.js.html | 4 ++-- docs/service_iservice.js.html | 4 ++-- docs/service_itask.js.html | 4 ++-- docs/service_runner-router.js.html | 4 ++-- docs/service_service-host.js.html | 4 ++-- docs/service_service-runner-node.js.html | 4 ++-- docs/service_service-runner.js.html | 4 ++-- docs/topics_index.js.html | 4 ++-- docs/topics_local-topic-host.js.html | 4 ++-- docs/tutorial-implementing-services.html | 4 ++-- docs/tutorial-local-party.html | 4 ++-- docs/tutorial-peer-to-peer.html | 4 ++-- docs/tutorial-service-task.html | 4 ++-- package.json | 2 +- scripts/build-docs.sh | 2 +- src/comms/rest-comms.js | 10 +++++----- src/config/secure-config.js | 4 ++-- src/party/iparty.js | 6 ++++-- src/venue/schema/group.js | 8 ++++++++ src/venue/schema/party-service.js | 8 ++++++++ src/venue/schema/party.js | 8 +++++++- src/venue/schema/trust.js | 3 ++- 121 files changed, 220 insertions(+), 193 deletions(-) create mode 100644 src/venue/schema/group.js create mode 100644 src/venue/schema/party-service.js diff --git a/docs/CloudDocument.html b/docs/CloudDocument.html index a4a3628..52b6a3c 100644 --- a/docs/CloudDocument.html +++ b/docs/CloudDocument.html @@ -1,3 +1,3 @@ Interface: CloudDocument
On this page

CloudDocument

Represents a cloud document with cloud change notifications, multi-tenant ownership and ganular access controls

Members

owner :IdObj

CloudDocument owner as an IdObj

Type:

Methods

(async) acl() → {Acl}

Get this document's Acl

Returns:
Type: 
Acl

(async) grantAccess(action, actor, field, allowed)

Allow access to this document or a subfield

Parameters:
NameTypeDefaultDescription
actionstring

CRUFL operation

actorIdObj

Actor object

fieldstring

Document subfield

allowedstringtrue

Allow/deny named actor access

\ No newline at end of file +
On this page

CloudDocument

Represents a cloud document with cloud change notifications, multi-tenant ownership and ganular access controls

Members

owner :IdObj

CloudDocument owner as an IdObj

Type:

Methods

(async) acl() → {Acl}

Get this document's Acl

Returns:
Type: 
Acl

(async) grantAccess(action, actor, field, allowed)

Allow access to this document or a subfield

Parameters:
NameTypeDefaultDescription
actionstring

CRUFL operation

actorIdObj

Actor object

fieldstring

Document subfield

allowedstringtrue

Allow/deny named actor access

\ No newline at end of file diff --git a/docs/LokiQuery.html b/docs/LokiQuery.html index a7b2ec5..cf63915 100644 --- a/docs/LokiQuery.html +++ b/docs/LokiQuery.html @@ -1,3 +1,3 @@ Class: LokiQuery
On this page

LokiQuery

new LokiQuery(spec)

generates a mongodb query doc from a dataparty query spec

Parameters:
NameTypeDescription
spec

dataparty query spec (wire format for data party queries)

Methods

getQueryDoc()

build mongo query doc from spec match tree

  • explicitly 'and' top level of match tree
  • search only returns msg metadata
\ No newline at end of file +
On this page

LokiQuery

new LokiQuery(spec)

generates a mongodb query doc from a dataparty query spec

Parameters:
NameTypeDescription
spec

dataparty query spec (wire format for data party queries)

Methods

getQueryDoc()

build mongo query doc from spec match tree

  • explicitly 'and' top level of match tree
  • search only returns msg metadata
\ No newline at end of file diff --git a/docs/MongoQuery.html b/docs/MongoQuery.html index f74d3c3..ce73592 100644 --- a/docs/MongoQuery.html +++ b/docs/MongoQuery.html @@ -1,3 +1,3 @@ Class: MongoQuery
On this page

MongoQuery

new MongoQuery(spec)

generates a mongodb query doc from a dataparty query spec

Parameters:
NameTypeDescription
spec

dataparty query spec (wire format for data party queries)

Methods

getQueryDoc()

build mongo query doc from spec match tree

  • explicitly 'and' top level of match tree
  • search only returns msg metadata
\ No newline at end of file +
On this page

MongoQuery

new MongoQuery(spec)

generates a mongodb query doc from a dataparty query spec

Parameters:
NameTypeDescription
spec

dataparty query spec (wire format for data party queries)

Methods

getQueryDoc()

build mongo query doc from spec match tree

  • explicitly 'and' top level of match tree
  • search only returns msg metadata
\ No newline at end of file diff --git a/docs/bouncer_db_loki-db.js.html b/docs/bouncer_db_loki-db.js.html index 950e5cc..3f00c22 100644 --- a/docs/bouncer_db_loki-db.js.html +++ b/docs/bouncer_db_loki-db.js.html @@ -1,6 +1,6 @@ Source: bouncer/db/loki-db.js
On this page

bouncer_db_loki-db.js

'use strict'
+    
On this page

bouncer_db_loki-db.js

'use strict'
 
 const IDb = require('../idb')
 const Hoek = require('@hapi/hoek')
@@ -418,4 +418,4 @@
   }
   */
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/bouncer_db_tingo-db.js.html b/docs/bouncer_db_tingo-db.js.html index a8ad032..9d29df2 100644 --- a/docs/bouncer_db_tingo-db.js.html +++ b/docs/bouncer_db_tingo-db.js.html @@ -1,6 +1,6 @@ Source: bouncer/db/tingo-db.js
On this page

bouncer_db_tingo-db.js

'use strict'
+    
On this page

bouncer_db_tingo-db.js

'use strict'
 
 
 const IDb = require('../idb')
@@ -304,4 +304,4 @@
     return finalObj
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/bouncer_db_zango-db.js.html b/docs/bouncer_db_zango-db.js.html index 87a5cb7..b094f3d 100644 --- a/docs/bouncer_db_zango-db.js.html +++ b/docs/bouncer_db_zango-db.js.html @@ -1,6 +1,6 @@ Source: bouncer/db/zango-db.js
On this page

bouncer_db_zango-db.js

'use strict'
+    
On this page

bouncer_db_zango-db.js

'use strict'
 
 const IDb = require('../idb')
 const Hoek = require('@hapi/hoek')
@@ -239,4 +239,4 @@
     return finalObj
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/bouncer_icrufler.js.html b/docs/bouncer_icrufler.js.html index a58168f..7902fbb 100644 --- a/docs/bouncer_icrufler.js.html +++ b/docs/bouncer_icrufler.js.html @@ -1,6 +1,6 @@ Source: bouncer/icrufler.js
On this page

bouncer_icrufler.js


+    
On this page

bouncer_icrufler.js


 module.exports = class ICrufler {
   constructor({db, context}){
     this.db = db
@@ -20,4 +20,4 @@
   async applyRemove(crufl){ throw new Error('not implemented') }
   async applyUpdate(crufl){ throw new Error('not implemented') }
   async applyFind(crufl, includeData = false){ throw new Error('not implemented') }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/bouncer_idb.js.html b/docs/bouncer_idb.js.html index 4f54f11..c5e099b 100644 --- a/docs/bouncer_idb.js.html +++ b/docs/bouncer_idb.js.html @@ -1,6 +1,6 @@ Source: bouncer/idb.js
On this page

bouncer_idb.js


+    
On this page

bouncer_idb.js


 const reach = require('../utils/reach')
 const debug = require('debug')('bouncer.idb')
 const EventEmitter = require('eventemitter3')
@@ -102,4 +102,4 @@
 
 }
 
-module.exports = IDb
\ No newline at end of file +module.exports = IDb
\ No newline at end of file diff --git a/docs/bouncer_index.js.html b/docs/bouncer_index.js.html index 923b61a..096b8ac 100644 --- a/docs/bouncer_index.js.html +++ b/docs/bouncer_index.js.html @@ -1,6 +1,6 @@ Source: bouncer/index.js
On this page

bouncer_index.js

/**
+    
On this page

bouncer_index.js

/**
  * @module Db
  */
 
@@ -13,4 +13,4 @@
 exports.ZangoDb= require('./db/zango-db')
 
 
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/bouncer_ischema.js.html b/docs/bouncer_ischema.js.html index 50a3f7f..b6208e3 100644 --- a/docs/bouncer_ischema.js.html +++ b/docs/bouncer_ischema.js.html @@ -1,6 +1,6 @@ Source: bouncer/ischema.js
On this page

bouncer_ischema.js

const debug = require('debug')('bouncer.ISchema')
+    
On this page

bouncer_ischema.js

const debug = require('debug')('bouncer.ISchema')
 const MgoUtils = require('../utils/mongoose-scheme-utils')
 
 module.exports = class ISchema {
@@ -105,4 +105,4 @@
     }
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/bouncer_mongo-query.js.html b/docs/bouncer_mongo-query.js.html index 1d4b636..55f8c2d 100644 --- a/docs/bouncer_mongo-query.js.html +++ b/docs/bouncer_mongo-query.js.html @@ -1,6 +1,6 @@ Source: bouncer/mongo-query.js
On this page

bouncer_mongo-query.js

'use strict'
+    
On this page

bouncer_mongo-query.js

'use strict'
 
 const ObjectId = require('bson-objectid')
 const debug = require('debug')('bouncer.mongo-query')
@@ -194,4 +194,4 @@
   throw new Error(`unrecognized query op: ${node.op}`)
 }
 
-module.exports = MongoQuery
\ No newline at end of file +module.exports = MongoQuery
\ No newline at end of file diff --git a/docs/comms_ble-socket.js.html b/docs/comms_ble-socket.js.html index f8644db..8c1ff22 100644 --- a/docs/comms_ble-socket.js.html +++ b/docs/comms_ble-socket.js.html @@ -1,6 +1,6 @@ Source: comms/ble-socket.js
On this page

comms_ble-socket.js

'use strict'
+    
On this page

comms_ble-socket.js

'use strict'
 
 const debug = require('debug')('dataparty.comms.ble-peer')
 const EventEmitter = require('eventemitter3')
@@ -261,4 +261,4 @@
 }
 
 module.exports = BLEPeerClient
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/comms_i2p-socket-comms.js.html b/docs/comms_i2p-socket-comms.js.html index c60c9fb..251abf8 100644 --- a/docs/comms_i2p-socket-comms.js.html +++ b/docs/comms_i2p-socket-comms.js.html @@ -1,6 +1,6 @@ Source: comms/i2p-socket-comms.js
On this page

comms_i2p-socket-comms.js

const debug = require('debug')('dataparty.comms.i2psocket')
+    
On this page

comms_i2p-socket-comms.js

const debug = require('debug')('dataparty.comms.i2psocket')
 const debugShim = require('debug')('dataparty.comms.i2psocket-shim')
 
 const SAM = require('@diva.exchange/i2p-sam')
@@ -127,4 +127,4 @@
 
 
 module.exports = I2pSocketComms
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/comms_index.js.html b/docs/comms_index.js.html index 8a88bd1..e286d1b 100644 --- a/docs/comms_index.js.html +++ b/docs/comms_index.js.html @@ -1,6 +1,6 @@ Source: comms/index.js
On this page

comms_index.js


+    
On this page

comms_index.js


 /**
  *  @module Comms 
  */
@@ -18,4 +18,4 @@
 exports.RTCSocketComms = require('./rtc-socket-comms')
 exports.I2pSocketComms = require('./i2p-socket-comms')
 exports.SocketOp = require('./isocket-comms')
-exports.WebsocketOp = require('./websocket-op')
\ No newline at end of file +exports.WebsocketOp = require('./websocket-op')
\ No newline at end of file diff --git a/docs/comms_isocket-comms.js.html b/docs/comms_isocket-comms.js.html index 1973e33..150662c 100644 --- a/docs/comms_isocket-comms.js.html +++ b/docs/comms_isocket-comms.js.html @@ -1,6 +1,6 @@ Source: comms/isocket-comms.js
On this page

comms_isocket-comms.js

'use strict'
+    
On this page

comms_isocket-comms.js

'use strict'
 
 const debug = require('debug')('dataparty.comms.socketcomms')
 const EventEmitter = require('eventemitter3')
@@ -158,4 +158,4 @@
     }
 }
 
-module.exports = ISocketComms
\ No newline at end of file +module.exports = ISocketComms
\ No newline at end of file diff --git a/docs/comms_loopback-channel.js.html b/docs/comms_loopback-channel.js.html index 602e6ff..3b2f70c 100644 --- a/docs/comms_loopback-channel.js.html +++ b/docs/comms_loopback-channel.js.html @@ -1,6 +1,6 @@ Source: comms/loopback-channel.js
On this page

comms_loopback-channel.js

const debug = require('debug')('dataparty.comms.loopback-channel')
+    
On this page

comms_loopback-channel.js

const debug = require('debug')('dataparty.comms.loopback-channel')
 const EventEmitter = require("eventemitter3")
 
 
@@ -23,4 +23,4 @@
 
     this.port1.peer = this.port2
   }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/comms_loopback-comms.js.html b/docs/comms_loopback-comms.js.html index c005c06..7cf11b7 100644 --- a/docs/comms_loopback-comms.js.html +++ b/docs/comms_loopback-comms.js.html @@ -1,6 +1,6 @@ Source: comms/loopback-comms.js
On this page

comms_loopback-comms.js

const debug = require('debug')('dataparty.comms.loopback-comms')
+    
On this page

comms_loopback-comms.js

const debug = require('debug')('dataparty.comms.loopback-comms')
 
 const PeerComms = require('./peer-comms')
 const LoopbackSocket = require('./loopback-socket')
@@ -34,4 +34,4 @@
 }
 
 
-module.exports = LoopbackComms
\ No newline at end of file +module.exports = LoopbackComms
\ No newline at end of file diff --git a/docs/comms_loopback-socket.js.html b/docs/comms_loopback-socket.js.html index 5841631..33fcce1 100644 --- a/docs/comms_loopback-socket.js.html +++ b/docs/comms_loopback-socket.js.html @@ -1,6 +1,6 @@ Source: comms/loopback-socket.js
On this page

comms_loopback-socket.js

const debug = require('debug')('dataparty.comms.loopback-socket')
+    
On this page

comms_loopback-socket.js

const debug = require('debug')('dataparty.comms.loopback-socket')
 const EventEmitter = require('eventemitter3')
 
 /**
@@ -96,4 +96,4 @@
       this.channel.post('close', true)
     }
   }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/comms_peer-comms.js.html b/docs/comms_peer-comms.js.html index 56decb4..f6e743d 100644 --- a/docs/comms_peer-comms.js.html +++ b/docs/comms_peer-comms.js.html @@ -1,6 +1,6 @@ Source: comms/peer-comms.js
On this page

comms_peer-comms.js

const debug = require('debug')('dataparty.comms.peercomms')
+    
On this page

comms_peer-comms.js

const debug = require('debug')('dataparty.comms.peercomms')
 const uuidv4 = require('uuid/v4')
 const HttpMocks = require('node-mocks-http')
 
@@ -380,4 +380,4 @@
 }
 
 
-module.exports = PeerComms
\ No newline at end of file +module.exports = PeerComms
\ No newline at end of file diff --git a/docs/comms_rest-comms.js.html b/docs/comms_rest-comms.js.html index fcf529e..6019558 100644 --- a/docs/comms_rest-comms.js.html +++ b/docs/comms_rest-comms.js.html @@ -1,6 +1,6 @@ Source: comms/rest-comms.js
On this page

comms_rest-comms.js

const axios = require('axios')
+    
On this page

comms_rest-comms.js

const axios = require('axios')
 const EventEmitter = require('eventemitter3')
 const debug = require('debug')('dataparty.comms.rest')
 
@@ -85,8 +85,8 @@
   }
 
   async loadCloud() {
-    this.uri = this.config.read('cloud.uri')
-    this.wsUri = this.config.read('cloud.wsUri')
+    this.uri = await this.config.read('cloud.uri')
+    this.wsUri = await this.config.read('cloud.wsUri')
 
     if (this.uri && this.uri[this.uri.length - 1] !== '/') {
       this.uri = this.uri + '/'
@@ -97,9 +97,9 @@
     //
   }
 
-  storeSession() {
+  async storeSession() {
     const path = this.cfgPrefix + '.rest-session'
-    this.config.write(path, { id: this.sessionId })
+    await this.config.write(path, { id: this.sessionId })
   }
 
   async call(path, data, 
@@ -318,7 +318,7 @@
 
       this.sessionId = reply.session
       this.authed = true
-      this.storeSession()
+      await this.storeSession()
 
       await this.syncActors()
       this.emit('open')
@@ -383,4 +383,4 @@
 }
 
 module.exports = RestComms
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/comms_rtc-socket-comms.js.html b/docs/comms_rtc-socket-comms.js.html index c936a81..f386f56 100644 --- a/docs/comms_rtc-socket-comms.js.html +++ b/docs/comms_rtc-socket-comms.js.html @@ -1,6 +1,6 @@ Source: comms/rtc-socket-comms.js
On this page

comms_rtc-socket-comms.js

const debug = require('debug')('dataparty.comms.rtcsocketcomms')
+    
On this page

comms_rtc-socket-comms.js

const debug = require('debug')('dataparty.comms.rtcsocketcomms')
 
 const SimplePeer = require('simple-peer')
 const PeerComms = require('./peer-comms')
@@ -31,4 +31,4 @@
 }
 
 
-module.exports = RTCSocketComms
\ No newline at end of file +module.exports = RTCSocketComms
\ No newline at end of file diff --git a/docs/comms_websocket-comms.js.html b/docs/comms_websocket-comms.js.html index 82ba035..2f7d4fd 100644 --- a/docs/comms_websocket-comms.js.html +++ b/docs/comms_websocket-comms.js.html @@ -1,6 +1,6 @@ Source: comms/websocket-comms.js
On this page

comms_websocket-comms.js

const debug = require('debug')('dataparty.comms.websocket')
+    
On this page

comms_websocket-comms.js

const debug = require('debug')('dataparty.comms.websocket')
 
 const WebSocket = global.WebSocket ? global.WebSocket : require('ws')
 
@@ -45,4 +45,4 @@
 }
 
 
-module.exports = WebsocketComms
\ No newline at end of file +module.exports = WebsocketComms
\ No newline at end of file diff --git a/docs/config_iconfig.js.html b/docs/config_iconfig.js.html index 44e02ec..070fc39 100644 --- a/docs/config_iconfig.js.html +++ b/docs/config_iconfig.js.html @@ -1,6 +1,6 @@ Source: config/iconfig.js
On this page

config_iconfig.js

const EventEmitter = require('eventemitter3')
+    
On this page

config_iconfig.js

const EventEmitter = require('eventemitter3')
 
 /**
  * @interface module:Config.IConfig
@@ -57,4 +57,4 @@
     async save(){ throw 'not implemented' }
 }
 
-module.exports = IConfig
\ No newline at end of file +module.exports = IConfig
\ No newline at end of file diff --git a/docs/config_index.js.html b/docs/config_index.js.html index ca6aa19..59d0f0d 100644 --- a/docs/config_index.js.html +++ b/docs/config_index.js.html @@ -1,6 +1,6 @@ Source: config/index.js
On this page

config_index.js


+    
On this page

config_index.js


 
 /**
 * @module Config
@@ -11,4 +11,4 @@
 exports.JsonFileConfig = require('./json-file')
 exports.LocalStorageConfig = require('./local-storage')
 
-exports.SecureConfig = require('./secure-config')
\ No newline at end of file +exports.SecureConfig = require('./secure-config')
\ No newline at end of file diff --git a/docs/config_json-file.js.html b/docs/config_json-file.js.html index d5b2b08..7d39fc3 100644 --- a/docs/config_json-file.js.html +++ b/docs/config_json-file.js.html @@ -1,6 +1,6 @@ Source: config/json-file.js
On this page

config_json-file.js

'use strict';
+    
On this page

config_json-file.js

'use strict';
 
 const fs = require('fs')
 const Path = require('path')
@@ -102,4 +102,4 @@
   }
 }
 
-module.exports = JsonFileConfig
\ No newline at end of file +module.exports = JsonFileConfig
\ No newline at end of file diff --git a/docs/config_local-storage.js.html b/docs/config_local-storage.js.html index 417c6b7..1b86b94 100644 --- a/docs/config_local-storage.js.html +++ b/docs/config_local-storage.js.html @@ -1,6 +1,6 @@ Source: config/local-storage.js
On this page

config_local-storage.js

'use strict';
+    
On this page

config_local-storage.js

'use strict';
 
 const deepSet = require('lodash').set
 const reach = require('../utils/reach')
@@ -72,4 +72,4 @@
   }
 }
 
-module.exports = LocalStorageConfig
\ No newline at end of file +module.exports = LocalStorageConfig
\ No newline at end of file diff --git a/docs/config_memory.js.html b/docs/config_memory.js.html index f17f16f..ba1f24e 100644 --- a/docs/config_memory.js.html +++ b/docs/config_memory.js.html @@ -1,6 +1,6 @@ Source: config/memory.js
On this page

config_memory.js

'use strict';
+    
On this page

config_memory.js

'use strict';
 
 const deepSet = require('lodash').set
 const reach = require('../utils/reach')
@@ -63,4 +63,4 @@
   }
 }
 
-module.exports = MemoryConfig
\ No newline at end of file +module.exports = MemoryConfig
\ No newline at end of file diff --git a/docs/config_nconf.js.html b/docs/config_nconf.js.html index 22ef761..18ef95e 100644 --- a/docs/config_nconf.js.html +++ b/docs/config_nconf.js.html @@ -1,6 +1,6 @@ Source: config/nconf.js
On this page

config_nconf.js

'use strict';
+    
On this page

config_nconf.js

'use strict';
 
 const fs = require('fs')
 const os = require('os')
@@ -189,4 +189,4 @@
   }
 }
 
-module.exports = NconfConfig
\ No newline at end of file +module.exports = NconfConfig
\ No newline at end of file diff --git a/docs/config_secure-config.js.html b/docs/config_secure-config.js.html index 60fa9c0..99d1e9e 100644 --- a/docs/config_secure-config.js.html +++ b/docs/config_secure-config.js.html @@ -1,6 +1,6 @@ Source: config/secure-config.js
On this page

config_secure-config.js

const dataparty_crypto = require('@dataparty/crypto')
+    
On this page

config_secure-config.js

const dataparty_crypto = require('@dataparty/crypto')
 
 const debug = require('debug')('dataparty.config.secure-config')
 const deepSet = require('lodash').set
@@ -217,7 +217,7 @@
         if(await this.isInitialized()){ throw new Error('already initialized') }
 
         const settings = {
-            key_type: 'key'
+            type: 'key'
         }
 
         await this.initialize(key, defaults, settings)
@@ -225,7 +225,7 @@
 
 
     async initialize(key, defaults, settings){
-        debug('initialize - type:', settings.key_type)
+        debug('initialize - type:', settings.type)
         if(await this.isInitialized()){ throw new Error('already initialized') }
 
         const pwIdentity = new dataparty_crypto.Identity({
@@ -535,4 +535,4 @@
     }
 }
 
-module.exports = SecureConfig
\ No newline at end of file +module.exports = SecureConfig
\ No newline at end of file diff --git a/docs/global.html b/docs/global.html index 68d909d..50ce32c 100644 --- a/docs/global.html +++ b/docs/global.html @@ -1,3 +1,3 @@ Global
On this page

Type Definitions

IdObj

Type:
  • Object
Properties
NameTypeDescription
idstring

mongo-id or UUID

typestring

Document type

\ No newline at end of file +
On this page

Type Definitions

IdObj

Type:
  • Object
Properties
NameTypeDescription
idstring

mongo-id or UUID

typestring

Document type

\ No newline at end of file diff --git a/docs/index.html b/docs/index.html index bde848e..0d662ee 100644 --- a/docs/index.html +++ b/docs/index.html @@ -1,6 +1,6 @@ decentralized cloud framework for the web 3.0 generation
On this page

@dataparty/api

experimentallicense

decentralized cloud framework for the Web3.0 generation.

Design Goal

Dataparty services are able to run on servers, edge devices, or even directly in the browser or app. This means users of dataparty based apps can frequently run their own backend from within an app. By building this peer-to-peer functionality directly into the database ORM, dataparty/api saves significant effort for app makers.

Plugable

For many domains the exact performance characteristics of the database, communications and security matter a lot. All major systems are fairly pluggable so that additional drivers (db, comms etc) can be developed.

Features

Feature Roadmap 2023

A dataparty app/service typically consists of these parts:

  • Comms
    • We support everything from WebRTC, Websockets, HTTP to BLE and i2p/tor.
  • Config
    • Persist configuration in a number of ways.
  • Db
    • Select the database that makes sense for you, see database selection
    • Use one scheme across all db's
  • Party
    • The primary query interface. Abstracts the DBs into a common realtime-db interface. Partys can interact with local, remote and even peer-to-peer hosted DBs. Select the type of party that makes sense for you. See party selection
  • Service
    • RESTful endpoints and middleware, code once run everywhere. Expressjs style interface. Each endpoint can be run in its own sandbox, various types of isolation are supported and more are planned.
  • Topics
    • Streaming pub/sub that runs everywhere. Compatible with the ROS rosbridge 2.0 protocol.

Database Selection

DatabaseBrowserCordovaElectronEmbedded LinuxNode
LokijsyyyNR*NR*
ZangodbyyyP*P*
TingonP*yyy
MongonP*yyy

*NR - Not Recommended, but supported *P - Possibly. We're looking into it.

Example


+    
On this page

@dataparty/api

experimentallicense

decentralized cloud framework for the Web3.0 generation.

Design Goal

Dataparty services are able to run on servers, edge devices, or even directly in the browser or app. This means users of dataparty based apps can frequently run their own backend from within an app. By building this peer-to-peer functionality directly into the database ORM, dataparty/api saves significant effort for app makers.

Plugable

For many domains the exact performance characteristics of the database, communications and security matter a lot. All major systems are fairly pluggable so that additional drivers (db, comms etc) can be developed.

Features

Feature Roadmap 2023

A dataparty app/service typically consists of these parts:

  • Comms
    • We support everything from WebRTC, Websockets, HTTP to BLE and i2p/tor.
  • Config
    • Persist configuration in a number of ways.
  • Db
    • Select the database that makes sense for you, see database selection
    • Use one scheme across all db's
  • Party
    • The primary query interface. Abstracts the DBs into a common realtime-db interface. Partys can interact with local, remote and even peer-to-peer hosted DBs. Select the type of party that makes sense for you. See party selection
  • Service
    • RESTful endpoints and middleware, code once run everywhere. Expressjs style interface. Each endpoint can be run in its own sandbox, various types of isolation are supported and more are planned.
  • Topics
    • Streaming pub/sub that runs everywhere. Compatible with the ROS rosbridge 2.0 protocol.

Database Selection

DatabaseBrowserCordovaElectronEmbedded LinuxNode
LokijsyyyNR*NR*
ZangodbyyyP*P*
TingonP*yyy
MongonP*yyy

*NR - Not Recommended, but supported *P - Possibly. We're looking into it.

Example


 const Dataparty = require('@dataparty/api')
 
 
@@ -62,4 +62,4 @@
   console.log(await getUser('renamed-tester'))
 
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/module-Comms.BLEPeerClient.html b/docs/module-Comms.BLEPeerClient.html index 60db786..39d5404 100644 --- a/docs/module-Comms.BLEPeerClient.html +++ b/docs/module-Comms.BLEPeerClient.html @@ -1,3 +1,3 @@ Class: BLEPeerClient
On this page

Comms. BLEPeerClient

\ No newline at end of file +
On this page

Comms. BLEPeerClient

\ No newline at end of file diff --git a/docs/module-Comms.I2pSocketComms.html b/docs/module-Comms.I2pSocketComms.html index 0f78ad6..c6f7643 100644 --- a/docs/module-Comms.I2pSocketComms.html +++ b/docs/module-Comms.I2pSocketComms.html @@ -1,3 +1,3 @@ Class: I2pSocketComms
On this page

Comms. I2pSocketComms

\ No newline at end of file +
On this page

Comms. I2pSocketComms

\ No newline at end of file diff --git a/docs/module-Comms.ISocketComms.html b/docs/module-Comms.ISocketComms.html index ee4d997..9b03736 100644 --- a/docs/module-Comms.ISocketComms.html +++ b/docs/module-Comms.ISocketComms.html @@ -1,3 +1,3 @@ Interface: ISocketComms
On this page

Comms. ISocketComms

\ No newline at end of file +
On this page

Comms. ISocketComms

\ No newline at end of file diff --git a/docs/module-Comms.LoopbackChannel.html b/docs/module-Comms.LoopbackChannel.html index c5b9efb..35f7171 100644 --- a/docs/module-Comms.LoopbackChannel.html +++ b/docs/module-Comms.LoopbackChannel.html @@ -1,3 +1,3 @@ Class: LoopbackChannel
On this page

Comms. LoopbackChannel

\ No newline at end of file +
On this page

Comms. LoopbackChannel

\ No newline at end of file diff --git a/docs/module-Comms.LoopbackComms.html b/docs/module-Comms.LoopbackComms.html index ff97ac3..0920636 100644 --- a/docs/module-Comms.LoopbackComms.html +++ b/docs/module-Comms.LoopbackComms.html @@ -1,3 +1,3 @@ Class: LoopbackComms
On this page

Comms. LoopbackComms

\ No newline at end of file +
On this page

Comms. LoopbackComms

\ No newline at end of file diff --git a/docs/module-Comms.LoopbackSocket.html b/docs/module-Comms.LoopbackSocket.html index 64378e5..2281c45 100644 --- a/docs/module-Comms.LoopbackSocket.html +++ b/docs/module-Comms.LoopbackSocket.html @@ -1,3 +1,3 @@ Class: LoopbackSocket
On this page

Comms. LoopbackSocket

\ No newline at end of file +
On this page

Comms. LoopbackSocket

\ No newline at end of file diff --git a/docs/module-Comms.PeerComms.html b/docs/module-Comms.PeerComms.html index f941463..fc8aa22 100644 --- a/docs/module-Comms.PeerComms.html +++ b/docs/module-Comms.PeerComms.html @@ -1,3 +1,3 @@ Class: PeerComms
On this page

Comms. PeerComms

\ No newline at end of file +
On this page

Comms. PeerComms

\ No newline at end of file diff --git a/docs/module-Comms.RTCSocketComms.html b/docs/module-Comms.RTCSocketComms.html index 79e52ee..1aca198 100644 --- a/docs/module-Comms.RTCSocketComms.html +++ b/docs/module-Comms.RTCSocketComms.html @@ -1,3 +1,3 @@ Class: RTCSocketComms
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Comms.RestComms.html b/docs/module-Comms.RestComms.html index af09428..3f5ce36 100644 --- a/docs/module-Comms.RestComms.html +++ b/docs/module-Comms.RestComms.html @@ -1,3 +1,3 @@ Class: RestComms
On this page

Comms. RestComms

\ No newline at end of file +
On this page

Comms. RestComms

\ No newline at end of file diff --git a/docs/module-Comms.WebsocketComms.html b/docs/module-Comms.WebsocketComms.html index e9847b1..81990db 100644 --- a/docs/module-Comms.WebsocketComms.html +++ b/docs/module-Comms.WebsocketComms.html @@ -1,3 +1,3 @@ Class: WebsocketComms
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Comms.html b/docs/module-Comms.html index 03bfaeb..0262d9d 100644 --- a/docs/module-Comms.html +++ b/docs/module-Comms.html @@ -1,3 +1,3 @@ Module: Comms
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Config.IConfig.html b/docs/module-Config.IConfig.html index 9a10505..ddb9cd0 100644 --- a/docs/module-Config.IConfig.html +++ b/docs/module-Config.IConfig.html @@ -1,3 +1,3 @@ Interface: IConfig
On this page

Config. IConfig

Methods

(async, static) clear()

(async, static) exists(key)

Parameters:
NameTypeDescription
keystring

(async, static) read(key)

Parameters:
NameTypeDescription
keystring

(async, static) readAll() → {object}

Returns:
Type: 
object

(async, static) save()

(async, static) start()

(async, static) write(key, data)

Parameters:
NameTypeDescription
keystring
dataobject
\ No newline at end of file +
On this page

Config. IConfig

Methods

(async, static) clear()

(async, static) exists(key)

Parameters:
NameTypeDescription
keystring

(async, static) read(key)

Parameters:
NameTypeDescription
keystring

(async, static) readAll() → {object}

Returns:
Type: 
object

(async, static) save()

(async, static) start()

(async, static) write(key, data)

Parameters:
NameTypeDescription
keystring
dataobject
\ No newline at end of file diff --git a/docs/module-Config.JsonFileConfig.html b/docs/module-Config.JsonFileConfig.html index 26f730c..3c9ce52 100644 --- a/docs/module-Config.JsonFileConfig.html +++ b/docs/module-Config.JsonFileConfig.html @@ -1,3 +1,3 @@ Class: JsonFileConfig
On this page

Config. JsonFileConfig

\ No newline at end of file +
On this page

Config. JsonFileConfig

\ No newline at end of file diff --git a/docs/module-Config.LocalStorageConfig.html b/docs/module-Config.LocalStorageConfig.html index ca34c9e..4ce6bec 100644 --- a/docs/module-Config.LocalStorageConfig.html +++ b/docs/module-Config.LocalStorageConfig.html @@ -1,3 +1,3 @@ Class: LocalStorageConfig
On this page

Config. LocalStorageConfig

\ No newline at end of file +
On this page

Config. LocalStorageConfig

\ No newline at end of file diff --git a/docs/module-Config.MemoryConfig.html b/docs/module-Config.MemoryConfig.html index 6bc5565..522117e 100644 --- a/docs/module-Config.MemoryConfig.html +++ b/docs/module-Config.MemoryConfig.html @@ -1,3 +1,3 @@ Class: MemoryConfig
On this page

Config. MemoryConfig

\ No newline at end of file +
On this page

Config. MemoryConfig

\ No newline at end of file diff --git a/docs/module-Config.NconfConfig.html b/docs/module-Config.NconfConfig.html index 09007bf..9124b0a 100644 --- a/docs/module-Config.NconfConfig.html +++ b/docs/module-Config.NconfConfig.html @@ -1,3 +1,3 @@ Class: NconfConfig
On this page

Config. NconfConfig

\ No newline at end of file +
On this page

Config. NconfConfig

\ No newline at end of file diff --git a/docs/module-Config.SecureConfig.html b/docs/module-Config.SecureConfig.html index 909df0d..de10596 100644 --- a/docs/module-Config.SecureConfig.html +++ b/docs/module-Config.SecureConfig.html @@ -1,3 +1,3 @@ Class: SecureConfig
On this page

Config. SecureConfig

new SecureConfig(id, config, timeoutMs, includeActivity, argon)

A secure configuration. This uses an underlying IConfig for storage. Multiple secure configs can be placed within the same IConfig so long as different id is set. By default pbkdf2 is used to generate NaCl keys. If argon is provided then argon2 will be used to generate the NaCl keys. Applications should use argon2.

Parameters:
NameTypeDescription
idstring

The id of this secure config. Multiple secure configs can be stored within a single IConfig

configIConfig

The underlying IConfig to use for storage

timeoutMsnumber

Timeout since last unlock, after which the config will be locked. Defaults to 5 minutes.

includeActivityboolean

When set to true the timeout is reset after any read/write activity. Defaults to true

argonArgon2

Instance of argon2 from either npm:argon2 or npm:argon2-browser

Methods

(async, static) clear()

(async, static) isInitialized() → {boolean}

Checks if the secure config has initialized with a password or key

Returns:
Type: 
boolean

(static) isLocked() → {boolean}

Checks if the secure config is locked. If not locked the secure config can be used without blocking waiting for user to unlock.

Returns:
Type: 
boolean

(static) lock()

Locks the secure config

(async, static) read(key)

Parameters:
NameTypeDescription
keystring

(async, static) readAll() → {object}

Returns:
Type: 
object

(async, static) save()

(async, static) setIdentity(key, defaults)

Initialize the secure config with a key

Parameters:
NameTypeDescription
keydataparty_crypto/IKey
defaultsobject

(async, static) setPassword(password, defaults)

Initialize the secure config with a password

Parameters:
NameTypeDescription
passwordstring
defaultsobject

(async, static) start()

Start the secure storage

(async, static) unlock(password)

Unlocks the secure config

Parameters:
NameTypeDescription
passwordstring

(async, static) waitForUnlocked(reason)

Wait for config to be unlocked

Parameters:
NameTypeDescription
reasonstring

Optional reason message if config is locked

(async, static) write(key, data)

Parameters:
NameTypeDescription
keystring
dataobject

Events

blocked

An read/write operation has been blocked due to the secure config being locked.

intialized

The secure config has been successfully initialized with a passowrd or key.

locked

The secure config has been locked

ready

Ready event. The secure config is ready to be unlocked and have configuration values read or written.

setup-required

Setup required event. The secure config has not yet has a password or key configured.

unlocked

The secure config has been unlocked

\ No newline at end of file +
On this page

Config. SecureConfig

new SecureConfig(id, config, timeoutMs, includeActivity, argon)

A secure configuration. This uses an underlying IConfig for storage. Multiple secure configs can be placed within the same IConfig so long as different id is set. By default pbkdf2 is used to generate NaCl keys. If argon is provided then argon2 will be used to generate the NaCl keys. Applications should use argon2.

Parameters:
NameTypeDescription
idstring

The id of this secure config. Multiple secure configs can be stored within a single IConfig

configIConfig

The underlying IConfig to use for storage

timeoutMsnumber

Timeout since last unlock, after which the config will be locked. Defaults to 5 minutes.

includeActivityboolean

When set to true the timeout is reset after any read/write activity. Defaults to true

argonArgon2

Instance of argon2 from either npm:argon2 or npm:argon2-browser

Methods

(async, static) clear()

(async, static) isInitialized() → {boolean}

Checks if the secure config has initialized with a password or key

Returns:
Type: 
boolean

(static) isLocked() → {boolean}

Checks if the secure config is locked. If not locked the secure config can be used without blocking waiting for user to unlock.

Returns:
Type: 
boolean

(static) lock()

Locks the secure config

(async, static) read(key)

Parameters:
NameTypeDescription
keystring

(async, static) readAll() → {object}

Returns:
Type: 
object

(async, static) save()

(async, static) setIdentity(key, defaults)

Initialize the secure config with a key

Parameters:
NameTypeDescription
keydataparty_crypto/IKey
defaultsobject

(async, static) setPassword(password, defaults)

Initialize the secure config with a password

Parameters:
NameTypeDescription
passwordstring
defaultsobject

(async, static) start()

Start the secure storage

(async, static) unlock(password)

Unlocks the secure config

Parameters:
NameTypeDescription
passwordstring

(async, static) waitForUnlocked(reason)

Wait for config to be unlocked

Parameters:
NameTypeDescription
reasonstring

Optional reason message if config is locked

(async, static) write(key, data)

Parameters:
NameTypeDescription
keystring
dataobject

Events

blocked

An read/write operation has been blocked due to the secure config being locked.

intialized

The secure config has been successfully initialized with a passowrd or key.

locked

The secure config has been locked

ready

Ready event. The secure config is ready to be unlocked and have configuration values read or written.

setup-required

Setup required event. The secure config has not yet has a password or key configured.

unlocked

The secure config has been unlocked

\ No newline at end of file diff --git a/docs/module-Config.html b/docs/module-Config.html index 4ad9271..5c57b70 100644 --- a/docs/module-Config.html +++ b/docs/module-Config.html @@ -1,3 +1,3 @@ Module: Config
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Db.IDb.html b/docs/module-Db.IDb.html index 30a0510..ff0bd9d 100644 --- a/docs/module-Db.IDb.html +++ b/docs/module-Db.IDb.html @@ -1,3 +1,3 @@ Interface: IDb
On this page

Db. IDb

\ No newline at end of file +
On this page

Db. IDb

\ No newline at end of file diff --git a/docs/module-Db.ISchema.html b/docs/module-Db.ISchema.html index cb5083d..3004060 100644 --- a/docs/module-Db.ISchema.html +++ b/docs/module-Db.ISchema.html @@ -1,3 +1,3 @@ Interface: ISchema
On this page

Db. ISchema

\ No newline at end of file +
On this page

Db. ISchema

\ No newline at end of file diff --git a/docs/module-Db.LokiDb.html b/docs/module-Db.LokiDb.html index 8483933..dedf6ff 100644 --- a/docs/module-Db.LokiDb.html +++ b/docs/module-Db.LokiDb.html @@ -1,3 +1,3 @@ Class: LokiDb
On this page

Db. LokiDb

\ No newline at end of file +
On this page

Db. LokiDb

\ No newline at end of file diff --git a/docs/module-Db.TingoDb.html b/docs/module-Db.TingoDb.html index 0ba8469..5cd0745 100644 --- a/docs/module-Db.TingoDb.html +++ b/docs/module-Db.TingoDb.html @@ -1,3 +1,3 @@ Class: TingoDb
On this page

Db. TingoDb

new TingoDb()

Ideal for extremely large datasets with frequent document additions. Has a very efficient append-only file system driver which is ideal for embedded platforms. All database indexes must fit into RAM and are re-computed at db load time.

Extends

\ No newline at end of file +
On this page

Db. TingoDb

new TingoDb()

Ideal for extremely large datasets with frequent document additions. Has a very efficient append-only file system driver which is ideal for embedded platforms. All database indexes must fit into RAM and are re-computed at db load time.

Extends

\ No newline at end of file diff --git a/docs/module-Db.ZangoDb.html b/docs/module-Db.ZangoDb.html index 6be6f6e..4456c4b 100644 --- a/docs/module-Db.ZangoDb.html +++ b/docs/module-Db.ZangoDb.html @@ -1,3 +1,3 @@ Class: ZangoDb
On this page

Db. ZangoDb

\ No newline at end of file +
On this page

Db. ZangoDb

\ No newline at end of file diff --git a/docs/module-Db.html b/docs/module-Db.html index 859a6ed..965bd5e 100644 --- a/docs/module-Db.html +++ b/docs/module-Db.html @@ -1,3 +1,3 @@ Module: Db
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Party.CloudParty.html b/docs/module-Party.CloudParty.html index ebb0022..7d9de3a 100644 --- a/docs/module-Party.CloudParty.html +++ b/docs/module-Party.CloudParty.html @@ -1,3 +1,3 @@ Class: CloudParty
On this page

Party. CloudParty

\ No newline at end of file +
On this page

Party. CloudParty

\ No newline at end of file diff --git a/docs/module-Party.DocumentFactory.html b/docs/module-Party.DocumentFactory.html index 0e9941f..12ab88f 100644 --- a/docs/module-Party.DocumentFactory.html +++ b/docs/module-Party.DocumentFactory.html @@ -1,3 +1,3 @@ Class: DocumentFactory
On this page

Party. DocumentFactory

new DocumentFactory()

Represents document schemas mapped to contructor claasses which extend IDocument

Extends

  • EventEmitter

Methods

(static) addFactory(type, factory)

Parameters:
NameTypeDescription
type*
factory*

(static) getDocument(type, id, data) → {module:Party.IDocument}

Parameters:
NameTypeDescription
typestring
idstring
dataObject
Returns:
Type: 
module:Party.IDocument

(static) getFactories()

(static) getFactory(type)

Parameters:
NameTypeDescription
type*

(static) getTypes()

(static) getValidators()

(async, static) hydrate(found)

Parameters:
NameTypeDescription
found*

(async, static) validate(type, data)

Parameters:
NameTypeDescription
type*
data*
\ No newline at end of file +
On this page

Party. DocumentFactory

new DocumentFactory()

Represents document schemas mapped to contructor claasses which extend IDocument

Extends

  • EventEmitter

Methods

(static) addFactory(type, factory)

Parameters:
NameTypeDescription
type*
factory*

(static) getDocument(type, id, data) → {module:Party.IDocument}

Parameters:
NameTypeDescription
typestring
idstring
dataObject
Returns:
Type: 
module:Party.IDocument

(static) getFactories()

(static) getFactory(type)

Parameters:
NameTypeDescription
type*

(static) getTypes()

(static) getValidators()

(async, static) hydrate(found)

Parameters:
NameTypeDescription
found*

(async, static) validate(type, data)

Parameters:
NameTypeDescription
type*
data*
\ No newline at end of file diff --git a/docs/module-Party.IDocument.html b/docs/module-Party.IDocument.html index ac61c6a..a834806 100644 --- a/docs/module-Party.IDocument.html +++ b/docs/module-Party.IDocument.html @@ -1,3 +1,3 @@ Class: IDocument
On this page

Party. IDocument

new IDocument(options)

Represents a document with caching and local+remote change notifications

Parameters:
NameTypeDescription
optionsobject
Properties
NameTypeDescription
partyDataParty
idstring
typestring
dataobject
followcacheboolean

Extends

  • EventEmitter

Members

(static) cleanData :object

document data with no library added fields

Type:
  • object

(static) data :object

entire document

Type:
  • object

(static) Document :IDocument

Type:
  • IDocument

(static) id :string

Document mongo-id

Type:
  • string

(static) idObj :IdObj

Document id object

Type:

(static) idString :sting

Document id string in format <type>:<mongo-id>

Type:
  • sting

(static) revision :string

Document revision string

Type:
  • string

(static) type :string

Document type string

Type:
  • string

Methods

(async, static) create(party, document)

Parameters:
NameTypeDescription
partymoddule:Party.IParty
document*
Returns:

(static) getData()

(async, static) mergeData(input) → {object}

Parameters:
NameTypeDescription
inputobject
Returns:
Type: 
object

(async, static) pull(flushcache)

Parameters:
NameTypeDescription
flushcacheboolean

Update local cache as well

(async, static) remove()

(async, static) save()

(async, static) setData(input) → {object}

Parameters:
NameTypeDescription
inputobject
Returns:
Type: 
object

(static) unwatch(cbopt)

Stop watching for remote document changes

Parameters:
NameTypeAttributesDescription
cbfunction<optional>

Optional Change event callback function

(async, static) watch(autopull, flushcache, cbopt)

Parameters:
NameTypeAttributesDescription
autopullboolean
flushcacheboolean
cbfunction<optional>

Optional Change event callback function

(static) watchField(field, valueopt, cb)

Watch a field for changes. If value is supplied watches for field and value to match.

Parameters:
NameTypeAttributesDescription
fieldstring

Field path to watch for changes

value*<optional>

Match value

cbfunction

Callback function

Events

change

Document change Event - This is event is triggered when a document has been modified on the remote service

Type:
  • object

create

Document create Event - This event is triggered after a document has been created and applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

field

Field change event. This is emitted as field.[FIELD_PATH]

Type:
  • object
Properties
NameTypeDescription
doc

The changed document

field

The changed FIELDPATH

old

The old field value

new

The new field value

expected

The expected field value

remove

Document remove Event - This event is triggered after a document has been removed and applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

update

Document update Event - This event is triggered after a change has been applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

value

Document value Event - This event is triggered after a change has been applied to the backing cache of Document.data. Only fired when Document.followcache is true.

Type:
  • Document
\ No newline at end of file +
On this page

Party. IDocument

new IDocument(options)

Represents a document with caching and local+remote change notifications

Parameters:
NameTypeDescription
optionsobject
Properties
NameTypeDescription
partyDataParty
idstring
typestring
dataobject
followcacheboolean

Extends

  • EventEmitter

Members

(static) cleanData :object

document data with no library added fields

Type:
  • object

(static) data :object

entire document

Type:
  • object

(static) Document :IDocument

Type:
  • IDocument

(static) id :string

Document mongo-id

Type:
  • string

(static) idObj :IdObj

Document id object

Type:

(static) idString :sting

Document id string in format <type>:<mongo-id>

Type:
  • sting

(static) revision :string

Document revision string

Type:
  • string

(static) type :string

Document type string

Type:
  • string

Methods

(async, static) create(party, document)

Parameters:
NameTypeDescription
partymoddule:Party.IParty
document*
Returns:

(static) getData()

(async, static) mergeData(input) → {object}

Parameters:
NameTypeDescription
inputobject
Returns:
Type: 
object

(async, static) pull(flushcache)

Parameters:
NameTypeDescription
flushcacheboolean

Update local cache as well

(async, static) remove()

(async, static) save()

(async, static) setData(input) → {object}

Parameters:
NameTypeDescription
inputobject
Returns:
Type: 
object

(static) unwatch(cbopt)

Stop watching for remote document changes

Parameters:
NameTypeAttributesDescription
cbfunction<optional>

Optional Change event callback function

(async, static) watch(autopull, flushcache, cbopt)

Parameters:
NameTypeAttributesDescription
autopullboolean
flushcacheboolean
cbfunction<optional>

Optional Change event callback function

(static) watchField(field, valueopt, cb)

Watch a field for changes. If value is supplied watches for field and value to match.

Parameters:
NameTypeAttributesDescription
fieldstring

Field path to watch for changes

value*<optional>

Match value

cbfunction

Callback function

Events

change

Document change Event - This is event is triggered when a document has been modified on the remote service

Type:
  • object

create

Document create Event - This event is triggered after a document has been created and applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

field

Field change event. This is emitted as field.[FIELD_PATH]

Type:
  • object
Properties
NameTypeDescription
doc

The changed document

field

The changed FIELDPATH

old

The old field value

new

The new field value

expected

The expected field value

remove

Document remove Event - This event is triggered after a document has been removed and applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

update

Document update Event - This event is triggered after a change has been applied to the backing cache of Document.data. If Document.followcache is true the document doc has also accepted the change.

Type:
  • module:Party.IDocument.Event

value

Document value Event - This event is triggered after a change has been applied to the backing cache of Document.data. Only fired when Document.followcache is true.

Type:
  • Document
\ No newline at end of file diff --git a/docs/module-Party.IParty.html b/docs/module-Party.IParty.html index bde8ed5..7e9bed7 100644 --- a/docs/module-Party.IParty.html +++ b/docs/module-Party.IParty.html @@ -1,3 +1,3 @@ Class: IParty
On this page

Party. IParty

new IParty()

Parameters:
NameTypeDescription
options.configmodule:Config.IConfig
options.cachemodule:Party.LokiCache
options.noCacheboolean
options.commsmodule:Comms.ISocketComms
options.modelObject
options.factoriesObject
options.documentClassmodule:Party.IDocument
options.qbmodule:Party.Qb

Members

(static) actor :IdObj

Type:

(static) actors :Array.<IdObj>

Type:

(static) Document :IDocument

Type:
  • IDocument

(static) factory :DocumentFactory

Type:
  • DocumentFactory

(static) identity :module:dataparty/Types.Identity

Type:
  • module:dataparty/Types.Identity

(static) privateIdentity :module:dataparty/Types.Identity

Type:
  • module:dataparty/Types.Identity

(static) ROSLIB :ROSLIB

Type:
  • ROSLIB

(static) types

Methods

(async, static) call()

(async, static) create()

(async, static) createDocument()

(async, static) decrypt(reply, expectedSender, expectClearTextReply)

Parameters:
NameTypeDescription
replydataparty_crypto.Message
expectedSenderdataparty_crypto.Identity
expectClearTextReplyboolean

(async, static) encrypt(data, to) → {dataparty_crypto.Message}

Parameters:
NameTypeDescription
dataany
todataparty_crypto.Identity
Returns:
Type: 
dataparty_crypto.Message

(static) find() → {module:Party.Query}

Starts a query

Returns:
Type: 
module:Party.Query

(static) hasActor()

(static) hasIdentity()

(async, static) loadActor()

(async, static) loadIdentity()

(async, static) remove()

(async, static) resetIdentity()

(async, static) start()

(async, static) update()

\ No newline at end of file +
On this page

Party. IParty

new IParty()

Parameters:
NameTypeDescription
options.configmodule:Config.IConfig
options.cachemodule:Party.LokiCache
options.noCacheboolean
options.commsmodule:Comms.ISocketComms
options.modelObject
options.factoriesObject
options.documentClassmodule:Party.IDocument
options.qbmodule:Party.Qb

Members

(static) actor :IdObj

Type:

(static) actors :Array.<IdObj>

Type:

(static) Document :IDocument

Type:
  • IDocument

(static) factory :DocumentFactory

Type:
  • DocumentFactory

(static) identity :module:dataparty/Types.Identity

Type:
  • module:dataparty/Types.Identity

(static) privateIdentity :module:dataparty/Types.Identity

Type:
  • module:dataparty/Types.Identity

(static) ROSLIB :ROSLIB

Type:
  • ROSLIB

(static) types

Methods

(async, static) call()

(async, static) create()

(async, static) createDocument()

(async, static) decrypt(reply, expectedSender, expectClearTextReply)

Parameters:
NameTypeDescription
replydataparty_crypto.Message
expectedSenderdataparty_crypto.Identity
expectClearTextReplyboolean

(async, static) encrypt(data, to) → {dataparty_crypto.Message}

Parameters:
NameTypeDescription
dataany
todataparty_crypto.Identity
Returns:
Type: 
dataparty_crypto.Message

(static) find() → {module:Party.Query}

Starts a query

Returns:
Type: 
module:Party.Query

(static) hasActor()

(static) hasIdentity()

(async, static) loadActor()

(async, static) loadIdentity()

(async, static) remove()

(async, static) resetIdentity()

(async, static) start()

(async, static) update()

\ No newline at end of file diff --git a/docs/module-Party.LokiCache.html b/docs/module-Party.LokiCache.html index 16c86a6..e7c71ae 100644 --- a/docs/module-Party.LokiCache.html +++ b/docs/module-Party.LokiCache.html @@ -1,3 +1,3 @@ Class: LokiCache
On this page

Party. LokiCache

\ No newline at end of file +
On this page

Party. LokiCache

\ No newline at end of file diff --git a/docs/module-Party.LokiParty.html b/docs/module-Party.LokiParty.html index 41e8c7b..7210703 100644 --- a/docs/module-Party.LokiParty.html +++ b/docs/module-Party.LokiParty.html @@ -1,3 +1,3 @@ Class: LokiParty
On this page

Party. LokiParty

new LokiParty(path, dbAdapter, lokiOptions)

A local party based on LokiJS.

Works great for front end. Doesn't scale well for centralized server use and does not have efficient file system representation for many embedded applications. Overall this driver is RAM bound holds the entire DB in memory. When running on filesystems this driver re-writes the entire collection during save operations.

Parameters:
NameTypeDescription
pathstring

Path on filesystem to lokijs db file

dbAdapterLokiAdapater

Lokijs db adapter, see: http://techfort.github.io/LokiJS/tutorial-Persistence%20Adapters.html

lokiOptionsObject

Options to pass to lokijs see: http://techfort.github.io/LokiJS/Loki.html

Extends

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file +
On this page

Party. LokiParty

new LokiParty(path, dbAdapter, lokiOptions)

A local party based on LokiJS.

Works great for front end. Doesn't scale well for centralized server use and does not have efficient file system representation for many embedded applications. Overall this driver is RAM bound holds the entire DB in memory. When running on filesystems this driver re-writes the entire collection during save operations.

Parameters:
NameTypeDescription
pathstring

Path on filesystem to lokijs db file

dbAdapterLokiAdapater

Lokijs db adapter, see: http://techfort.github.io/LokiJS/tutorial-Persistence%20Adapters.html

lokiOptionsObject

Options to pass to lokijs see: http://techfort.github.io/LokiJS/Loki.html

Extends

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file diff --git a/docs/module-Party.MongoParty.html b/docs/module-Party.MongoParty.html index 88f9629..6d54c1b 100644 --- a/docs/module-Party.MongoParty.html +++ b/docs/module-Party.MongoParty.html @@ -1,3 +1,3 @@ Class: MongoParty
On this page

Party. MongoParty

\ No newline at end of file +
On this page

Party. MongoParty

\ No newline at end of file diff --git a/docs/module-Party.PeerParty.html b/docs/module-Party.PeerParty.html index 39e267a..1403271 100644 --- a/docs/module-Party.PeerParty.html +++ b/docs/module-Party.PeerParty.html @@ -1,3 +1,3 @@ Class: PeerParty
On this page

Party. PeerParty

new PeerParty()

Parameters:
NameTypeDescription
options.commsmodule:Comms.ISocketComms
options.hostPartyboolean

Is this instance the host of the peer connection?

options.hostRunnermodule:Service.HostRunner
options.qbOptions.debounceInteger

Amount of milliseconds to wait before sending a query. More than one query can be sent to the server in a single exchange. This defaults to 10ms.

options.qbOptions.find_dedupboolean

Set if duplicate queries should be merged into a single network request. Defaults to true

options.qbOptions.timeoutInteger

Time in milliseconds before a query is considered timedout. Defaults to 10seconds

Extends

\ No newline at end of file +
On this page

Party. PeerParty

new PeerParty()

Parameters:
NameTypeDescription
options.commsmodule:Comms.ISocketComms
options.hostPartyboolean

Is this instance the host of the peer connection?

options.hostRunnermodule:Service.HostRunner
options.qbOptions.debounceInteger

Amount of milliseconds to wait before sending a query. More than one query can be sent to the server in a single exchange. This defaults to 10ms.

options.qbOptions.find_dedupboolean

Set if duplicate queries should be merged into a single network request. Defaults to true

options.qbOptions.timeoutInteger

Time in milliseconds before a query is considered timedout. Defaults to 10seconds

Extends

\ No newline at end of file diff --git a/docs/module-Party.Query.html b/docs/module-Party.Query.html index fb72e1d..c83f476 100644 --- a/docs/module-Party.Query.html +++ b/docs/module-Party.Query.html @@ -1,3 +1,3 @@ Class: Query
On this page

Party. Query

new Query(qb, model)

Parameters:
NameTypeDescription
qbmodule:Party.qb
modelmodule:Party.DocumentFactory

Methods

(static) all()

matches a list that is a superset of given list

Parameters:
TypeDescription

(static) and()

following path segments will be anded (default behavior)

Returns:

(static) contains(value)

Check if field contains value

Parameters:
NameTypeDescription
value*
Returns:

(static) dna()

Closes scope of most recent and

Returns:

(static) elem()

list operators -> subtype of match tree nodes -> most recent .where('param') path must be list for these to match searches for a single element of list matching all following conditions between elem .. mele nodes where('path') calls are relative to param path scope at opening of element match

(static) equals(value)

Check if field equals value

Parameters:
NameTypeDescription
value*
Returns:

(async, static) exec(hydrate)

return a promise resolving to result of query

Parameters:
NameTypeDescription
hydrateboolean
Returns:

(static) exists(flag)

Check if field exists

Parameters:
NameTypeDescription
flag*
Returns:

(static) gt(value)

Check if field is greater than value

Parameters:
NameTypeDescription
value*
Returns:

(static) id(id)

query for single msg by given id prereq -> type (not types) all other query ops (except type) will be ignored

Parameters:
NameTypeDescription
idstring

(static) ids(…ids)

query for a list of msgs by given ids prereq -> type (not types) all other query ops (except type) will be ignored

Parameters:
NameTypeAttributesDescription
idsany<repeatable>
Returns:

(static) in(…values)

Check if field is in list of values

Parameters:
NameTypeAttributesDescription
valuesany<repeatable>
Returns:

(static) limit(count)

limit # of msgs returned by query to a maximum of count

Parameters:
NameTypeDescription
count*
Returns:

(static) lt(value)

Check if field is less than value

Parameters:
NameTypeDescription
value*
Returns:

(static) mele()

Close elem function stack

(static) or()

The following path segments will be or'ed

Returns:

(static) owner(type, id)

restrict query to msgs with owner matching given type, id pair

Parameters:
NameTypeDescription
type*
id*
Returns:

(static) regex(value)

Check if field is matched by regex

Parameters:
NameTypeDescription
value*
Returns:

(static) ro()

Close scope of most recent or

Returns:

(static) seelct(filter)

filter fields from parameters of returned msgs

Parameters:
NameTypeDescription
filter*
Returns:

(static) size(count)

matches list with exactly count items

Parameters:
NameTypeDescription
countInteger

(static) sort(param, direction)

sort returned msgs on given param path (leading '-' reverses sort)

Parameters:
NameTypeDescription
param*
direction*
Returns:

(static) toJSON() → {Object}

Returns:
Type: 
Object

(static) type(type) → {module:Party.Query}

restrict query to msgs of given type

Parameters:
NameTypeDescription
typestring

Type name

Returns:
Type: 
module:Party.Query

(static) types(…types)

restrict query to msgs of given types not compatible with type

Parameters:
NameTypeAttributesDescription
typesstring<repeatable>
Returns:

(static) where(param)

sets context for following operations to given param path

Parameters:
NameTypeDescription
paramstring

Path to field

\ No newline at end of file +
On this page

Party. Query

new Query(qb, model)

Parameters:
NameTypeDescription
qbmodule:Party.qb
modelmodule:Party.DocumentFactory

Methods

(static) all()

matches a list that is a superset of given list

Parameters:
TypeDescription

(static) and()

following path segments will be anded (default behavior)

Returns:

(static) contains(value)

Check if field contains value

Parameters:
NameTypeDescription
value*
Returns:

(static) dna()

Closes scope of most recent and

Returns:

(static) elem()

list operators -> subtype of match tree nodes -> most recent .where('param') path must be list for these to match searches for a single element of list matching all following conditions between elem .. mele nodes where('path') calls are relative to param path scope at opening of element match

(static) equals(value)

Check if field equals value

Parameters:
NameTypeDescription
value*
Returns:

(async, static) exec(hydrate)

return a promise resolving to result of query

Parameters:
NameTypeDescription
hydrateboolean
Returns:

(static) exists(flag)

Check if field exists

Parameters:
NameTypeDescription
flag*
Returns:

(static) gt(value)

Check if field is greater than value

Parameters:
NameTypeDescription
value*
Returns:

(static) id(id)

query for single msg by given id prereq -> type (not types) all other query ops (except type) will be ignored

Parameters:
NameTypeDescription
idstring

(static) ids(…ids)

query for a list of msgs by given ids prereq -> type (not types) all other query ops (except type) will be ignored

Parameters:
NameTypeAttributesDescription
idsany<repeatable>
Returns:

(static) in(…values)

Check if field is in list of values

Parameters:
NameTypeAttributesDescription
valuesany<repeatable>
Returns:

(static) limit(count)

limit # of msgs returned by query to a maximum of count

Parameters:
NameTypeDescription
count*
Returns:

(static) lt(value)

Check if field is less than value

Parameters:
NameTypeDescription
value*
Returns:

(static) mele()

Close elem function stack

(static) or()

The following path segments will be or'ed

Returns:

(static) owner(type, id)

restrict query to msgs with owner matching given type, id pair

Parameters:
NameTypeDescription
type*
id*
Returns:

(static) regex(value)

Check if field is matched by regex

Parameters:
NameTypeDescription
value*
Returns:

(static) ro()

Close scope of most recent or

Returns:

(static) seelct(filter)

filter fields from parameters of returned msgs

Parameters:
NameTypeDescription
filter*
Returns:

(static) size(count)

matches list with exactly count items

Parameters:
NameTypeDescription
countInteger

(static) sort(param, direction)

sort returned msgs on given param path (leading '-' reverses sort)

Parameters:
NameTypeDescription
param*
direction*
Returns:

(static) toJSON() → {Object}

Returns:
Type: 
Object

(static) type(type) → {module:Party.Query}

restrict query to msgs of given type

Parameters:
NameTypeDescription
typestring

Type name

Returns:
Type: 
module:Party.Query

(static) types(…types)

restrict query to msgs of given types not compatible with type

Parameters:
NameTypeAttributesDescription
typesstring<repeatable>
Returns:

(static) where(param)

sets context for following operations to given param path

Parameters:
NameTypeDescription
paramstring

Path to field

\ No newline at end of file diff --git a/docs/module-Party.TingoParty.html b/docs/module-Party.TingoParty.html index a43138a..953ef7c 100644 --- a/docs/module-Party.TingoParty.html +++ b/docs/module-Party.TingoParty.html @@ -1,3 +1,3 @@ Class: TingoParty
On this page

Party. TingoParty

new TingoParty(string, tingoOptions)

A local party implementation based on TingoDB Ideal for extremely large datasets with frequent document additions. Has a very efficient append-only file system driver which is ideal for embedded platforms. All database indexes must fit into RAM and are re-computed at db load time.

Parameters:
NameTypeDescription
string

path Path to a directory on the file system to store tingo db

tingoOptionsObject

O ptions to pass to tingodb. Defaults to {nativeObjectID: true}. See: https://github.com/sergeyksv/tingodb#requiretingodboptions

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file +
On this page

Party. TingoParty

new TingoParty(string, tingoOptions)

A local party implementation based on TingoDB Ideal for extremely large datasets with frequent document additions. Has a very efficient append-only file system driver which is ideal for embedded platforms. All database indexes must fit into RAM and are re-computed at db load time.

Parameters:
NameTypeDescription
string

path Path to a directory on the file system to store tingo db

tingoOptionsObject

O ptions to pass to tingodb. Defaults to {nativeObjectID: true}. See: https://github.com/sergeyksv/tingodb#requiretingodboptions

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file diff --git a/docs/module-Party.ZangoParty.html b/docs/module-Party.ZangoParty.html index 4c85e75..4501f87 100644 --- a/docs/module-Party.ZangoParty.html +++ b/docs/module-Party.ZangoParty.html @@ -1,3 +1,3 @@ Class: ZangoParty
On this page

Party. ZangoParty

new ZangoParty(string)

A local party implementation based on IndexedDb via ZangoDB

Ideal for frontend apps with large datasets (larger then total RAM). This is an IndexedDb based driver so it span to nearly 1/3 of total system storage spave available to the browser/app.

Parameters:
NameTypeDescription
string

dbName

Extends

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file +
On this page

Party. ZangoParty

new ZangoParty(string)

A local party implementation based on IndexedDb via ZangoDB

Ideal for frontend apps with large datasets (larger then total RAM). This is an IndexedDb based driver so it span to nearly 1/3 of total system storage spave available to the browser/app.

Parameters:
NameTypeDescription
string

dbName

Extends

Methods

(static) handleCall(ask)

Parameters:
NameTypeDescription
askObject
Returns:

(static) start()

\ No newline at end of file diff --git a/docs/module-Party.html b/docs/module-Party.html index 49d4b39..79908d3 100644 --- a/docs/module-Party.html +++ b/docs/module-Party.html @@ -1,3 +1,3 @@ Module: Party
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Service.EndpointContext.html b/docs/module-Service.EndpointContext.html index db475ab..22aeb50 100644 --- a/docs/module-Service.EndpointContext.html +++ b/docs/module-Service.EndpointContext.html @@ -1,3 +1,3 @@ Class: EndpointContext
On this page

Service. EndpointContext

new EndpointContext()

Parameters:
NameTypeDescription
options.partymodule:Party.IParty

The party handling the request

options.endpointmodule:Service.IEndpoint

The endpoint being executed

options.reqExpress.Request

Express js request object

options.resExpress.Response

Express js response object

options.input*

Raw input from client

options.debugDebug

Debug constructor (defaults to npm:Debug)

options.sendFullErrorsboolean

Enables sending full stack traces to client (defaults to false)

Members

(static) actor

(static) debug

(static) endpoint

(static) identity :dataparty_crypto.Identity

Effective root of trust

Type:
  • dataparty_crypto.Identity

(static) input :Object

Type:
  • Object

(static) MiddlewareConfig

(static) output

(static) req

(static) res

(static) senderKey :dataparty_crypto.Identity

Key used to encrypt content. This may be an ephermal key or a long lived key.

Type:
  • dataparty_crypto.Identity

(static) session

(static) stats

Methods

(static) debug(msg, …args)

Parameters:
NameTypeAttributesDescription
msg*
argsany<repeatable>

(static) setSendFullErrors(value)

Parameters:
NameTypeDescription
value*
\ No newline at end of file +
On this page

Service. EndpointContext

new EndpointContext()

Parameters:
NameTypeDescription
options.partymodule:Party.IParty

The party handling the request

options.endpointmodule:Service.IEndpoint

The endpoint being executed

options.reqExpress.Request

Express js request object

options.resExpress.Response

Express js response object

options.input*

Raw input from client

options.debugDebug

Debug constructor (defaults to npm:Debug)

options.sendFullErrorsboolean

Enables sending full stack traces to client (defaults to false)

Members

(static) actor

(static) debug

(static) endpoint

(static) identity :dataparty_crypto.Identity

Effective root of trust

Type:
  • dataparty_crypto.Identity

(static) input :Object

Type:
  • Object

(static) MiddlewareConfig

(static) output

(static) req

(static) res

(static) senderKey :dataparty_crypto.Identity

Key used to encrypt content. This may be an ephermal key or a long lived key.

Type:
  • dataparty_crypto.Identity

(static) session

(static) stats

Methods

(static) debug(msg, …args)

Parameters:
NameTypeAttributesDescription
msg*
argsany<repeatable>

(static) setSendFullErrors(value)

Parameters:
NameTypeDescription
value*
\ No newline at end of file diff --git a/docs/module-Service.IEndpoint.html b/docs/module-Service.IEndpoint.html index 2c8ac4f..abbc09d 100644 --- a/docs/module-Service.IEndpoint.html +++ b/docs/module-Service.IEndpoint.html @@ -1,3 +1,3 @@ Interface: IEndpoint
On this page

Service. IEndpoint

Members

(static) Description :string

Type:
  • string

(static) info :module:Service.IEndpoint.EndpointInfo

(static) MiddlewareConfig :Object

A collection of pre and post middleware configurations

Type:
  • Object
Properties
NameTypeDescription
preObject.<string, Object>

A collection of pre-middleware configuration by name

postObject.<string, Object>

A collection of post-middleware configuration by name

/** Collection of configurations to be passed to middleware. Any middleware that is to true or an Object will be enabled and will be passed the config assigned here.

(static) Name :string

Type:
  • string

Methods

(async, static) run(context)

Parameters:
NameTypeDescription
context*
options.Package*

(static) start(party)

Parameters:
NameTypeDescription
party*

Type Definitions

EndpointInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Descriptionstring
MiddlewareConfigmodule:Service.IEndpoint.EndpointMiddlewareConfig
\ No newline at end of file +
On this page

Service. IEndpoint

Members

(static) Description :string

Type:
  • string

(static) info :module:Service.IEndpoint.EndpointInfo

(static) MiddlewareConfig :Object

A collection of pre and post middleware configurations

Type:
  • Object
Properties
NameTypeDescription
preObject.<string, Object>

A collection of pre-middleware configuration by name

postObject.<string, Object>

A collection of post-middleware configuration by name

/** Collection of configurations to be passed to middleware. Any middleware that is to true or an Object will be enabled and will be passed the config assigned here.

(static) Name :string

Type:
  • string

Methods

(async, static) run(context)

Parameters:
NameTypeDescription
context*
options.Package*

(static) start(party)

Parameters:
NameTypeDescription
party*

Type Definitions

EndpointInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Descriptionstring
MiddlewareConfigmodule:Service.IEndpoint.EndpointMiddlewareConfig
\ No newline at end of file diff --git a/docs/module-Service.IMiddleware.html b/docs/module-Service.IMiddleware.html index 8d8e9cb..06bff38 100644 --- a/docs/module-Service.IMiddleware.html +++ b/docs/module-Service.IMiddleware.html @@ -1,3 +1,3 @@ Interface: IMiddleware
On this page

Service. IMiddleware

Members

(static) ConfigSchema :Object

Joi validator that describes any expected config for this middleware

Type:
  • Object

(static) Description :string

Type:
  • string

(static) info :module:Service.IMiddleware.MiddlewareInfo

(static) Name :string

Type:
  • string

(static) Type

Type of middleware. Allowed values are pre or post

Methods

(async, static) run(context)

Parameters:
NameTypeDescription
contextmodule:Service.EndpointContext
options.Config*

The config options set for this instance of middleware

(async, static) start(party)

Parameters:
NameTypeDescription
partymodule:Party.IParty

Type Definitions

MiddlewareInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Typestring
Descriptionstring
ConfigSchemaObject
\ No newline at end of file +
On this page

Service. IMiddleware

Members

(static) ConfigSchema :Object

Joi validator that describes any expected config for this middleware

Type:
  • Object

(static) Description :string

Type:
  • string

(static) info :module:Service.IMiddleware.MiddlewareInfo

(static) Name :string

Type:
  • string

(static) Type

Type of middleware. Allowed values are pre or post

Methods

(async, static) run(context)

Parameters:
NameTypeDescription
contextmodule:Service.EndpointContext
options.Config*

The config options set for this instance of middleware

(async, static) start(party)

Parameters:
NameTypeDescription
partymodule:Party.IParty

Type Definitions

MiddlewareInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Typestring
Descriptionstring
ConfigSchemaObject
\ No newline at end of file diff --git a/docs/module-Service.ISandboxRunner.html b/docs/module-Service.ISandboxRunner.html index 1b69aeb..47fd205 100644 --- a/docs/module-Service.ISandboxRunner.html +++ b/docs/module-Service.ISandboxRunner.html @@ -1,3 +1,3 @@ Class: ISandboxRunner
On this page

Service. ISandboxRunner

new ISandboxRunner()

Parameters:
NameTypeDescription
options.info*
options.exec*
options.start*

Members

(static) start

Methods

(async, static) getInfo()

Returns:

(async, static) run(context, static_ctx)

Parameters:
NameTypeDescription
context*
static_ctx*
Returns:

(async, static) self()

Returns:

module:Serivce.ISandboxRunner

(async, static) start(serviceContext)

Parameters:
NameTypeDescription
serviceContext*
Returns:
\ No newline at end of file +
On this page

Service. ISandboxRunner

new ISandboxRunner()

Parameters:
NameTypeDescription
options.info*
options.exec*
options.start*

Members

(static) start

Methods

(async, static) getInfo()

Returns:

(async, static) run(context, static_ctx)

Parameters:
NameTypeDescription
context*
static_ctx*
Returns:

(async, static) self()

Returns:

module:Serivce.ISandboxRunner

(async, static) start(serviceContext)

Parameters:
NameTypeDescription
serviceContext*
Returns:
\ No newline at end of file diff --git a/docs/module-Service.IService.html b/docs/module-Service.IService.html index 24cb4a9..a6a0d40 100644 --- a/docs/module-Service.IService.html +++ b/docs/module-Service.IService.html @@ -1,3 +1,3 @@ Class: IService
On this page

Service. IService

new IService(build)

A service with schema, documents, endpoints, middleware and tasks. Provide either paths to source files for compilation or provided a pre-built service to import.

Parameters:
NameTypeDescription
options.name*
options.version*
options.githash*
options.branch*
build*

Methods

(static) addDocument(document_path)

Add a document class implementation to the service

Parameters:
NameTypeDescription
document_pathstring

(static) addEndpoint(endpoint_path)

Add a dataparty endpoint to the service by pather

Parameters:
NameTypeDescription
endpoint_pathstring

(static) addEndpoint(middleware_path)

Add a middleware to this service

Parameters:
NameTypeDescription
middleware_pathstring

(static) addSchema(schema_path)

Add a dataparty schema implementation to the service

Parameters:
NameTypeDescription
schema_pathmodule:Service.IService

(static) addTask(task_path)

Add a tasker task implementation to the service

Parameters:
NameTypeDescription
task_pathstring

(async, static) compile(outputPath, writeFile)

Compile a service. This will build two output files, one for host usage -service.json and another for client usage -schema.json.

Parameters:
NameTypeDescription
outputPathstring

Path where the built service should be written

writeFileboolean

When true, files will be written. Defaults to true

Returns:

(static) importBuild(buildOutput)

Import a pre-build service

Parameters:
NameTypeDescription
buildOutputObject
\ No newline at end of file +
On this page

Service. IService

new IService(build)

A service with schema, documents, endpoints, middleware and tasks. Provide either paths to source files for compilation or provided a pre-built service to import.

Parameters:
NameTypeDescription
options.name*
options.version*
options.githash*
options.branch*
build*

Methods

(static) addDocument(document_path)

Add a document class implementation to the service

Parameters:
NameTypeDescription
document_pathstring

(static) addEndpoint(endpoint_path)

Add a dataparty endpoint to the service by pather

Parameters:
NameTypeDescription
endpoint_pathstring

(static) addEndpoint(middleware_path)

Add a middleware to this service

Parameters:
NameTypeDescription
middleware_pathstring

(static) addSchema(schema_path)

Add a dataparty schema implementation to the service

Parameters:
NameTypeDescription
schema_pathmodule:Service.IService

(static) addTask(task_path)

Add a tasker task implementation to the service

Parameters:
NameTypeDescription
task_pathstring

(async, static) compile(outputPath, writeFile)

Compile a service. This will build two output files, one for host usage -service.json and another for client usage -schema.json.

Parameters:
NameTypeDescription
outputPathstring

Path where the built service should be written

writeFileboolean

When true, files will be written. Defaults to true

Returns:

(static) importBuild(buildOutput)

Import a pre-build service

Parameters:
NameTypeDescription
buildOutputObject
\ No newline at end of file diff --git a/docs/module-Service.ITask.html b/docs/module-Service.ITask.html index d0f3e39..8742c1d 100644 --- a/docs/module-Service.ITask.html +++ b/docs/module-Service.ITask.html @@ -1,3 +1,3 @@ Interface: ITask
On this page

Service. ITask

Interface class for supporting tasker tasks in dataparty. To add a task to dataparty service extend this class and implement the Name, Description and Config members.

Extends

  • tasker.Task

Members

(static) Config :module:Service.ITask.TaskConfig

(static) Description :string

Type:
  • string

(static) info :module:Service.ITask.TaskInfo

Returns the task's Name, Description, and Config

(static) Name :string

Type:
  • string

Type Definitions

TaskConfig

Type:
  • Object
Properties
NameTypeDescription
backgroundboolean

Set to true if this is a background task

autostartboolean

Set to true if this task should be run at service start time

TaskInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Descriptionstring
Configmodule:Service.ITask.TaskConfig
\ No newline at end of file +
On this page

Service. ITask

Interface class for supporting tasker tasks in dataparty. To add a task to dataparty service extend this class and implement the Name, Description and Config members.

Extends

  • tasker.Task

Members

(static) Config :module:Service.ITask.TaskConfig

(static) Description :string

Type:
  • string

(static) info :module:Service.ITask.TaskInfo

Returns the task's Name, Description, and Config

(static) Name :string

Type:
  • string

Type Definitions

TaskConfig

Type:
  • Object
Properties
NameTypeDescription
backgroundboolean

Set to true if this is a background task

autostartboolean

Set to true if this task should be run at service start time

TaskInfo

Type:
  • Object
Properties
NameTypeDescription
Namestring
Descriptionstring
Configmodule:Service.ITask.TaskConfig
\ No newline at end of file diff --git a/docs/module-Service.RunnerRouter.html b/docs/module-Service.RunnerRouter.html index ca5730c..d867112 100644 --- a/docs/module-Service.RunnerRouter.html +++ b/docs/module-Service.RunnerRouter.html @@ -1,3 +1,3 @@ Class: RunnerRouter
On this page

Service. RunnerRouter

new RunnerRouter(defaultRunner)

A multi-domain drop in replacement for anywhere we use origin-router.Router. By creating multiple dataparty ServiceRunners you can manage multiple parties and multiple services and merge them into either a single combined service. Or host them as multiple seperate domains. Essentially, this allows the ServiceHost to be multi-tenant.

Parameters:
NameTypeDescription
defaultRunnermodule:Service.ServiceRunner

The default runner to use if no others match. Required

Methods

(static) addRunner()

Parameters:
NameTypeDescription
options.domainstring
options.runnermodule:Service.ServiceRunner

(static) getRunnerByDomain(domain) → {module:Service.ServiceRunner}

Parameters:
NameTypeDescription
domainstring

(static) getRunnerByHostIdentity(identity) → {module:Service.ServiceRunner}

Parameters:
NameTypeDescription
identitydataparty_crypto.Identity

(async, static) start()

Returns:
\ No newline at end of file +
On this page

Service. RunnerRouter

new RunnerRouter(defaultRunner)

A multi-domain drop in replacement for anywhere we use origin-router.Router. By creating multiple dataparty ServiceRunners you can manage multiple parties and multiple services and merge them into either a single combined service. Or host them as multiple seperate domains. Essentially, this allows the ServiceHost to be multi-tenant.

Parameters:
NameTypeDescription
defaultRunnermodule:Service.ServiceRunner

The default runner to use if no others match. Required

Methods

(static) addRunner()

Parameters:
NameTypeDescription
options.domainstring
options.runnermodule:Service.ServiceRunner

(static) getRunnerByDomain(domain) → {module:Service.ServiceRunner}

Parameters:
NameTypeDescription
domainstring

(static) getRunnerByHostIdentity(identity) → {module:Service.ServiceRunner}

Parameters:
NameTypeDescription
identitydataparty_crypto.Identity

(async, static) start()

Returns:
\ No newline at end of file diff --git a/docs/module-Service.ServiceHost.html b/docs/module-Service.ServiceHost.html index 11e6d70..022cc84 100644 --- a/docs/module-Service.ServiceHost.html +++ b/docs/module-Service.ServiceHost.html @@ -1,3 +1,3 @@ Class: ServiceHost
On this page

Service. ServiceHost

new ServiceHost()

Parameters:
NameTypeDescription
options.corsObject

Cors to be passed to express via the cors package

options.trust_proxyboolean

When true, the server will parse forwarding headers. This should be set when running behind a load-balancer for accurate error messages and logging

options.listenUristring

The uri of the host interface to tell express to listen on. Defaults to `http://0.0.0.0:4001

options.i2pEnabledboolean

When true, this server will be available over i2p

options.i2pSamHoststring

The hostname of the i2p SAM control API. Defaults to 127.0.0.1

options.i2pSamPortInteger

The port of the i2p SAM control API. Defaults to 7656

options.i2pForwardHoststring

Override i2p forward host. This defaults to localhost and typically doesn't need to be changed

options.i2pForwardPortInteger

Override i2p forward post. This defaults to the port supplied in options.listenUri.

options.i2pKeystring

When set this i2p key will be used to host the service. If not set a new i2p key will be generated. Defaults to null

options.wsEnabledboolean

When true the server will host a dataparty websocket service. Defaults to true

options.wsPortInteger

Port for the websocket service to listen on. Defaults to null, using the same port as the http server.

options.wsUpgradePathstring

The path within the http server to host an upgradeable websocket. Defaults to /ws

options.runnermodule:Service.ServiceRunner

A pre-configured runner

Members

(static) apiApp :Express

Express app

Type:
  • Express

(static) router :Router

The router

Type:
  • Router

(static) runner :module:Service.ServiceRunner

Dataparty service runner

Methods

(async, static) start()

Start hosting services

(async, static) stop()

Stop hosting services

\ No newline at end of file +
On this page

Service. ServiceHost

new ServiceHost()

Parameters:
NameTypeDescription
options.corsObject

Cors to be passed to express via the cors package

options.trust_proxyboolean

When true, the server will parse forwarding headers. This should be set when running behind a load-balancer for accurate error messages and logging

options.listenUristring

The uri of the host interface to tell express to listen on. Defaults to `http://0.0.0.0:4001

options.i2pEnabledboolean

When true, this server will be available over i2p

options.i2pSamHoststring

The hostname of the i2p SAM control API. Defaults to 127.0.0.1

options.i2pSamPortInteger

The port of the i2p SAM control API. Defaults to 7656

options.i2pForwardHoststring

Override i2p forward host. This defaults to localhost and typically doesn't need to be changed

options.i2pForwardPortInteger

Override i2p forward post. This defaults to the port supplied in options.listenUri.

options.i2pKeystring

When set this i2p key will be used to host the service. If not set a new i2p key will be generated. Defaults to null

options.wsEnabledboolean

When true the server will host a dataparty websocket service. Defaults to true

options.wsPortInteger

Port for the websocket service to listen on. Defaults to null, using the same port as the http server.

options.wsUpgradePathstring

The path within the http server to host an upgradeable websocket. Defaults to /ws

options.runnermodule:Service.ServiceRunner

A pre-configured runner

Members

(static) apiApp :Express

Express app

Type:
  • Express

(static) router :Router

The router

Type:
  • Router

(static) runner :module:Service.ServiceRunner

Dataparty service runner

Methods

(async, static) start()

Start hosting services

(async, static) stop()

Stop hosting services

\ No newline at end of file diff --git a/docs/module-Service.ServiceRunner.html b/docs/module-Service.ServiceRunner.html index bf1c4bf..cbeedea 100644 --- a/docs/module-Service.ServiceRunner.html +++ b/docs/module-Service.ServiceRunner.html @@ -1,3 +1,3 @@ Class: ServiceRunner
On this page

Service. ServiceRunner

new ServiceRunner()

Sandboxed service runner. This runner uses the vm2 package to run end points in a fully isolated context. Endpoints, pre-middleware and post-middleware all run as independant precompiled VMScripts.

Parameters:
NameTypeDescription
options.servicemodule:Service.IService

The service to load endpoints from

options.partymodule:Party.IParty

The party to pass to the endpoints

options.sendFullErrorsboolean

If true send full stack traces to clients. Defaults to false

options.prefixstring

A prefix to apply to all endpoint paths

options.routerRouter

Router, defaults to origin-router

Methods

(static) onRequest(req, res)

Expressjs style way of calling an endpoint. The req will be passed to the router to select the appropritate endpoint

Parameters:
NameTypeDescription
reqExpress.Request
resExpress.Response
Returns:
\ No newline at end of file +
On this page

Service. ServiceRunner

new ServiceRunner()

Sandboxed service runner. This runner uses the vm2 package to run end points in a fully isolated context. Endpoints, pre-middleware and post-middleware all run as independant precompiled VMScripts.

Parameters:
NameTypeDescription
options.servicemodule:Service.IService

The service to load endpoints from

options.partymodule:Party.IParty

The party to pass to the endpoints

options.sendFullErrorsboolean

If true send full stack traces to clients. Defaults to false

options.prefixstring

A prefix to apply to all endpoint paths

options.routerRouter

Router, defaults to origin-router

Methods

(static) onRequest(req, res)

Expressjs style way of calling an endpoint. The req will be passed to the router to select the appropritate endpoint

Parameters:
NameTypeDescription
reqExpress.Request
resExpress.Response
Returns:
\ No newline at end of file diff --git a/docs/module-Service.ServiceRunnerNode.html b/docs/module-Service.ServiceRunnerNode.html index 6035ba4..189c2e3 100644 --- a/docs/module-Service.ServiceRunnerNode.html +++ b/docs/module-Service.ServiceRunnerNode.html @@ -1,3 +1,3 @@ Class: ServiceRunnerNode
On this page

Service. ServiceRunnerNode

new ServiceRunnerNode()

Unsafe service runner. This service runner uses eval to run services, endpoints and tasks. This provides only simple context seperation and does not do effective context isolation. This should only be used where the service is knwon trustworthy. When the useNative option is set to true the service will run in the same context as this class with no isolation at all.

Parameters:
NameTypeDescription
options.servicemodule:Service.IService

The service to load endpoints from

options.partymodule:Party.IParty

The party to pass to the endpoints

options.sendFullErrorsboolean

If true send full stack traces to clients. Defaults to false

options.prefixstring

A prefix to apply to all endpoint paths

options.routerRouter

Router, defaults to origin-router

options.useNativeboolean

Methods

(static) onRequest(req, res)

Expressjs style way of calling an endpoint. The req will be passed to the router to select the appropritate endpoint

Parameters:
NameTypeDescription
reqExpress.Request
resExpress.Response
Returns:
\ No newline at end of file +
On this page

Service. ServiceRunnerNode

new ServiceRunnerNode()

Unsafe service runner. This service runner uses eval to run services, endpoints and tasks. This provides only simple context seperation and does not do effective context isolation. This should only be used where the service is knwon trustworthy. When the useNative option is set to true the service will run in the same context as this class with no isolation at all.

Parameters:
NameTypeDescription
options.servicemodule:Service.IService

The service to load endpoints from

options.partymodule:Party.IParty

The party to pass to the endpoints

options.sendFullErrorsboolean

If true send full stack traces to clients. Defaults to false

options.prefixstring

A prefix to apply to all endpoint paths

options.routerRouter

Router, defaults to origin-router

options.useNativeboolean

Methods

(static) onRequest(req, res)

Expressjs style way of calling an endpoint. The req will be passed to the router to select the appropritate endpoint

Parameters:
NameTypeDescription
reqExpress.Request
resExpress.Response
Returns:
\ No newline at end of file diff --git a/docs/module-Service.html b/docs/module-Service.html index 4630e34..9c019c1 100644 --- a/docs/module-Service.html +++ b/docs/module-Service.html @@ -1,3 +1,3 @@ Module: Service
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/module-Topics.LocalTopicHost.html b/docs/module-Topics.LocalTopicHost.html index 65c8fdf..1da0101 100644 --- a/docs/module-Topics.LocalTopicHost.html +++ b/docs/module-Topics.LocalTopicHost.html @@ -1,3 +1,3 @@ Class: LocalTopicHost
On this page

Topics. LocalTopicHost

new LocalTopicHost()

Implementation of ROS style pub/sub topics. This runs on a single thread/peer and can be shared to other peers. However, this is a centralized implementation. So if the hosting node stops all topic traffic will halt as well.

\ No newline at end of file +
On this page

Topics. LocalTopicHost

new LocalTopicHost()

Implementation of ROS style pub/sub topics. This runs on a single thread/peer and can be shared to other peers. However, this is a centralized implementation. So if the hosting node stops all topic traffic will halt as well.

\ No newline at end of file diff --git a/docs/module-Topics.html b/docs/module-Topics.html index f9b1046..53fc0a6 100644 --- a/docs/module-Topics.html +++ b/docs/module-Topics.html @@ -1,3 +1,3 @@ Module: Topics
On this page
\ No newline at end of file +
On this page
\ No newline at end of file diff --git a/docs/party_cloud_cloud-document.js.html b/docs/party_cloud_cloud-document.js.html index e1a4b38..836139a 100644 --- a/docs/party_cloud_cloud-document.js.html +++ b/docs/party_cloud_cloud-document.js.html @@ -1,6 +1,6 @@ Source: party/cloud/cloud-document.js
On this page

party_cloud_cloud-document.js

'use strict'
+    
On this page

party_cloud_cloud-document.js

'use strict'
 
 const reach = require('../../utils/reach')
 const debug = require('debug')('dataparty.cloud.document')
@@ -92,4 +92,4 @@
 }
 
 module.exports = CloudDocument
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_cloud_cloud-party.js.html b/docs/party_cloud_cloud-party.js.html index a784f21..caea56f 100644 --- a/docs/party_cloud_cloud-party.js.html +++ b/docs/party_cloud_cloud-party.js.html @@ -1,6 +1,6 @@ Source: party/cloud/cloud-party.js
On this page

party_cloud_cloud-party.js

const debug = require('debug')('dataparty.cloud-party')
+    
On this page

party_cloud_cloud-party.js

const debug = require('debug')('dataparty.cloud-party')
 
 const Qb = require('../qb')
 const Query = require('../query')
@@ -148,4 +148,4 @@
 }
 
 module.exports = CloudParty
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_document-factory.js.html b/docs/party_document-factory.js.html index f374b09..feea742 100644 --- a/docs/party_document-factory.js.html +++ b/docs/party_document-factory.js.html @@ -1,6 +1,6 @@ Source: party/document-factory.js
On this page

party_document-factory.js

const Ajv = require('ajv')
+    
On this page

party_document-factory.js

const Ajv = require('ajv')
 const debug = require('debug')('dataparty.document-factory')
 const IDocument = require('./idocument')
 
@@ -162,4 +162,4 @@
 }
 
 module.exports = DocumentFactory
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_idocument.js.html b/docs/party_idocument.js.html index d131fe5..77f63af 100644 --- a/docs/party_idocument.js.html +++ b/docs/party_idocument.js.html @@ -1,6 +1,6 @@ Source: party/idocument.js
On this page

party_idocument.js

'use strict'
+    
On this page

party_idocument.js

'use strict'
 
 const reach = require('../utils/reach')
 const debug = require('debug')('dataparty.idocument')
@@ -440,4 +440,4 @@
 }
 
 module.exports = IDocument
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_index.js.html b/docs/party_index.js.html index c769702..c29de66 100644 --- a/docs/party_index.js.html +++ b/docs/party_index.js.html @@ -1,6 +1,6 @@ Source: party/index.js
On this page

party_index.js

/** @module Party */
+    
On this page

party_index.js

/** @module Party */
 exports.IParty = require('./iparty')
 exports.PeerParty = require('./peer/peer-party')
 exports.CloudParty = require('./cloud/cloud-party')
@@ -11,4 +11,4 @@
 exports.IDocument = require('./idocument')
 exports.DocumentFactory = require('./document-factory')
 exports.CloudDocument = require('./cloud/cloud-document')
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_iparty.js.html b/docs/party_iparty.js.html index d9182bf..dfbebe3 100644 --- a/docs/party_iparty.js.html +++ b/docs/party_iparty.js.html @@ -1,6 +1,6 @@ Source: party/iparty.js
On this page

party_iparty.js

const debug = require('debug')('dataparty.iparty')
+    
On this page

party_iparty.js

const debug = require('debug')('dataparty.iparty')
 const dataparty_crypto = require('@dataparty/crypto')
 
 const ROSLIB = require('roslib')
@@ -215,6 +215,8 @@
     this._actor.type = primaryActor.type
 
     const path = 'actor'
+
+    //! @hack & @todo - this needs to be `await` so this accessor probably should be removed
     this.config.write(path, this._actor)
   }
 
@@ -240,7 +242,7 @@
    */
   async loadIdentity(){
     const path = 'identity'
-    const cfgIdenStr = this.config.read(path)
+    const cfgIdenStr = await this.config.read(path)
 
     if (!cfgIdenStr){
       debug('generated new identity')
@@ -272,7 +274,7 @@
    */
   async loadActor(){
     const path = 'actor'
-    const localActorObj = this.config.read(path)
+    const localActorObj = await this.config.read(path)
 
     if (!localActorObj){ return }
 
@@ -343,4 +345,4 @@
   }
 }
 
-module.exports = IParty
\ No newline at end of file +module.exports = IParty
\ No newline at end of file diff --git a/docs/party_local_loki-party.js.html b/docs/party_local_loki-party.js.html index 1aef060..28c7a21 100644 --- a/docs/party_local_loki-party.js.html +++ b/docs/party_local_loki-party.js.html @@ -1,6 +1,6 @@ Source: party/local/loki-party.js
On this page

party_local_loki-party.js

'use strict'
+    
On this page

party_local_loki-party.js

'use strict'
 
 const debug = require('debug')('dataparty.loki-party')
 
@@ -70,4 +70,4 @@
   }
 }
 
-module.exports = LokiParty
\ No newline at end of file +module.exports = LokiParty
\ No newline at end of file diff --git a/docs/party_local_loki-query.js.html b/docs/party_local_loki-query.js.html index 880612e..36a36f1 100644 --- a/docs/party_local_loki-query.js.html +++ b/docs/party_local_loki-query.js.html @@ -1,6 +1,6 @@ Source: party/local/loki-query.js
On this page

party_local_loki-query.js

'use strict'
+    
On this page

party_local_loki-query.js

'use strict'
 
 const ObjectId = require('bson-objectid')
 const debug = require('debug')('bouncer-db.loki-query')
@@ -190,4 +190,4 @@
   throw new Error(`unrecognized query op: ${node.op}`)
 }
 
-module.exports = LokiQuery
\ No newline at end of file +module.exports = LokiQuery
\ No newline at end of file diff --git a/docs/party_local_tingo-party.js.html b/docs/party_local_tingo-party.js.html index aef9968..040d109 100644 --- a/docs/party_local_tingo-party.js.html +++ b/docs/party_local_tingo-party.js.html @@ -1,6 +1,6 @@ Source: party/local/tingo-party.js
On this page

party_local_tingo-party.js

'use strict'
+    
On this page

party_local_tingo-party.js

'use strict'
 
 const debug = require('debug')('dataparty.tingo-party')
 
@@ -61,4 +61,4 @@
   }
 }
 
-module.exports = TingoParty
\ No newline at end of file +module.exports = TingoParty
\ No newline at end of file diff --git a/docs/party_local_zango-party.js.html b/docs/party_local_zango-party.js.html index e153b49..72a533e 100644 --- a/docs/party_local_zango-party.js.html +++ b/docs/party_local_zango-party.js.html @@ -1,6 +1,6 @@ Source: party/local/zango-party.js
On this page

party_local_zango-party.js

 
+    
On this page

party_local_zango-party.js

 
 'use strict'
 
 const debug = require('debug')('dataparty.zango-party')
@@ -65,4 +65,4 @@
 }
 
 module.exports = ZangoParty
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_loki-cache.js.html b/docs/party_loki-cache.js.html index 3a8aca7..580eedc 100644 --- a/docs/party_loki-cache.js.html +++ b/docs/party_loki-cache.js.html @@ -1,6 +1,6 @@ Source: party/loki-cache.js
On this page

party_loki-cache.js

'use strict'
+    
On this page

party_loki-cache.js

'use strict'
 
 const cloneDeep = require('lodash/cloneDeep')
 const Loki = require('lokijs')
@@ -192,4 +192,4 @@
     })
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_mongo_mongo-party.js.html b/docs/party_mongo_mongo-party.js.html index 90e83a8..d5b561a 100644 --- a/docs/party_mongo_mongo-party.js.html +++ b/docs/party_mongo_mongo-party.js.html @@ -1,6 +1,6 @@ Source: party/mongo/mongo-party.js
On this page

party_mongo_mongo-party.js

'use strict'
+    
On this page

party_mongo_mongo-party.js

'use strict'
 
 const BouncerDb = require('@dataparty/bouncer-db')
 const debug = require('debug')('dataparty.mongo-party')
@@ -55,4 +55,4 @@
   }
 }
 
-module.exports = MongoParty
\ No newline at end of file +module.exports = MongoParty
\ No newline at end of file diff --git a/docs/party_peer_peer-party.js.html b/docs/party_peer_peer-party.js.html index 0219ea8..42bef98 100644 --- a/docs/party_peer_peer-party.js.html +++ b/docs/party_peer_peer-party.js.html @@ -1,6 +1,6 @@ Source: party/peer/peer-party.js
On this page

party_peer_peer-party.js

'use strict'
+    
On this page

party_peer_peer-party.js

'use strict'
 
 const debug = require('debug')('dataparty.peer-party')
 
@@ -75,4 +75,4 @@
 }
 
 module.exports = PeerParty
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/party_query.js.html b/docs/party_query.js.html index 6adfaac..7f2f62c 100644 --- a/docs/party_query.js.html +++ b/docs/party_query.js.html @@ -1,6 +1,6 @@ Source: party/query.js
On this page

party_query.js

'use strict'
+    
On this page

party_query.js

'use strict'
 
 const debug=require('debug')('dataparty.query')
 const cloneDeep = require('lodash/cloneDeep')
@@ -510,4 +510,4 @@
     return param.split('.')
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/service_endpoint-context.js.html b/docs/service_endpoint-context.js.html index 8ff12c4..9051286 100644 --- a/docs/service_endpoint-context.js.html +++ b/docs/service_endpoint-context.js.html @@ -1,6 +1,6 @@ Source: service/endpoint-context.js
On this page

service_endpoint-context.js

const Debug = require('debug')
+    
On this page

service_endpoint-context.js

const Debug = require('debug')
 
 const DeltaTime = require('../utils/delta-time')
 
@@ -180,4 +180,4 @@
   }
 }
 
-module.exports = EndpointContext
\ No newline at end of file +module.exports = EndpointContext
\ No newline at end of file diff --git a/docs/service_iendpoint.js.html b/docs/service_iendpoint.js.html index 4bc54b4..3d7d49d 100644 --- a/docs/service_iendpoint.js.html +++ b/docs/service_iendpoint.js.html @@ -1,6 +1,6 @@ Source: service/iendpoint.js
On this page

service_iendpoint.js

const debug = require('debug')('dataparty.service.IEndpoint')
+    
On this page

service_iendpoint.js

const debug = require('debug')('dataparty.service.IEndpoint')
 
 /**
  * @interface module:Service.IEndpoint
@@ -79,4 +79,4 @@
       MiddlewareConfig: this.MiddlewareConfig
     }
   }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/service_imiddleware.js.html b/docs/service_imiddleware.js.html index ee65b82..3878e79 100644 --- a/docs/service_imiddleware.js.html +++ b/docs/service_imiddleware.js.html @@ -1,6 +1,6 @@ Source: service/imiddleware.js
On this page

service_imiddleware.js

const debug = require('debug')('dataparty.service.IMiddleware')
+    
On this page

service_imiddleware.js

const debug = require('debug')('dataparty.service.IMiddleware')
 
 /**
  * @interface module:Service.IMiddleware
@@ -82,4 +82,4 @@
       ConfigSchema: this.ConfigSchema
     }
   }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/service_index.js.html b/docs/service_index.js.html index 26f2f3d..8e6e890 100644 --- a/docs/service_index.js.html +++ b/docs/service_index.js.html @@ -1,6 +1,6 @@ Source: service/index.js
On this page

service_index.js

const Path = require('path')
+    
On this page

service_index.js

const Path = require('path')
 
 /**
  * @module Service
@@ -53,4 +53,4 @@
   secureecho: Path.join(__dirname, './endpoints/secure-echo.js'),
   identity: Path.join(__dirname, './endpoints/service-identity.js'),
   version: Path.join(__dirname, './endpoints/service-version.js')
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/service_isandbox-runner.js.html b/docs/service_isandbox-runner.js.html index f01c901..8542aab 100644 --- a/docs/service_isandbox-runner.js.html +++ b/docs/service_isandbox-runner.js.html @@ -1,6 +1,6 @@ Source: service/isandbox-runner.js
On this page

service_isandbox-runner.js

const Hoek = require('@hapi/hoek')
+    
On this page

service_isandbox-runner.js

const Hoek = require('@hapi/hoek')
 const debug = require('debug')('dataparty.ISandboxRunner')
 
 class ISandboxRunner {
@@ -74,4 +74,4 @@
   }
 }
 
-module.exports = ISandboxRunner
\ No newline at end of file +module.exports = ISandboxRunner
\ No newline at end of file diff --git a/docs/service_ischema.js.html b/docs/service_ischema.js.html index 876b8d7..80d9bb3 100644 --- a/docs/service_ischema.js.html +++ b/docs/service_ischema.js.html @@ -1,6 +1,6 @@ Source: service/ischema.js
On this page

service_ischema.js

const debug = require('debug')('dataparty.service.ISchema')
+    
On this page

service_ischema.js

const debug = require('debug')('dataparty.service.ISchema')
 const MgoUtils = require('../utils/mongoose-scheme-utils')
 
 module.exports = class ISchema {
@@ -71,4 +71,4 @@
     }
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/service_iservice.js.html b/docs/service_iservice.js.html index d2565de..6802b9c 100644 --- a/docs/service_iservice.js.html +++ b/docs/service_iservice.js.html @@ -1,6 +1,6 @@ Source: service/iservice.js
On this page

service_iservice.js

const fs = require('fs')
+    
On this page

service_iservice.js

const fs = require('fs')
 const Path = require('path')
 //const NCC = require('@vercel/ncc')
 const NCC = require('@zeit/ncc')
@@ -357,4 +357,4 @@
     if(buildTypeScript){ await Promise.all(tsWrites) }
   }
 }
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/service_itask.js.html b/docs/service_itask.js.html index debaf23..fd54399 100644 --- a/docs/service_itask.js.html +++ b/docs/service_itask.js.html @@ -1,6 +1,6 @@ Source: service/itask.js
On this page

service_itask.js

const debug = require('debug')('dataparty.service.ITask')
+    
On this page

service_itask.js

const debug = require('debug')('dataparty.service.ITask')
 const tasker = require('@dataparty/tasker')
 
 
@@ -70,4 +70,4 @@
       Config: this.Config
     }
   }
-}
\ No newline at end of file +}
\ No newline at end of file diff --git a/docs/service_runner-router.js.html b/docs/service_runner-router.js.html index 7fd6908..989c496 100644 --- a/docs/service_runner-router.js.html +++ b/docs/service_runner-router.js.html @@ -1,6 +1,6 @@ Source: service/runner-router.js
On this page

service_runner-router.js

const Debug = require('debug')
+    
On this page

service_runner-router.js

const Debug = require('debug')
 const debug = Debug('dataparty.service.runner-router')
 
 class RunnerRouter {
@@ -109,4 +109,4 @@
   }
 }
 
-module.exports = RunnerRouter
\ No newline at end of file +module.exports = RunnerRouter
\ No newline at end of file diff --git a/docs/service_service-host.js.html b/docs/service_service-host.js.html index 85b5fe8..8c04840 100644 --- a/docs/service_service-host.js.html +++ b/docs/service_service-host.js.html @@ -1,6 +1,6 @@ Source: service/service-host.js
On this page

service_service-host.js

const CORS = require('cors')
+    
On this page

service_service-host.js

const CORS = require('cors')
 const {URL} = require('url')
 const http = require('http')
 const https = require('https')
@@ -253,4 +253,4 @@
 
 
 module.exports = ServiceHost
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/service_service-runner-node.js.html b/docs/service_service-runner-node.js.html index be180d1..a012079 100644 --- a/docs/service_service-runner-node.js.html +++ b/docs/service_service-runner-node.js.html @@ -1,6 +1,6 @@ Source: service/service-runner-node.js
On this page

service_service-runner-node.js

const Path = require('path')
+    
On this page

service_service-runner-node.js

const Path = require('path')
 const Joi = require('joi')
 const Hoek = require('@hapi/hoek')
 const Debug = require('debug')
@@ -381,4 +381,4 @@
   }
 }
 
-module.exports = ServiceRunnerNode
\ No newline at end of file +module.exports = ServiceRunnerNode
\ No newline at end of file diff --git a/docs/service_service-runner.js.html b/docs/service_service-runner.js.html index a3dffc6..55dff24 100644 --- a/docs/service_service-runner.js.html +++ b/docs/service_service-runner.js.html @@ -1,6 +1,6 @@ Source: service/service-runner.js
On this page

service_service-runner.js

const Path = require('path')
+    
On this page

service_service-runner.js

const Path = require('path')
 const Joi = require('joi')
 const Hoek = require('@hapi/hoek')
 const {VM, VMScript} = require('vm2')
@@ -262,4 +262,4 @@
   }
 }
 
-module.exports = ServiceRunner
\ No newline at end of file +module.exports = ServiceRunner
\ No newline at end of file diff --git a/docs/topics_index.js.html b/docs/topics_index.js.html index b1d5f14..e32ece4 100644 --- a/docs/topics_index.js.html +++ b/docs/topics_index.js.html @@ -1,4 +1,4 @@ Source: topics/index.js
On this page

topics_index.js

/** @module Topics */
-exports.LocalTopicHost = require('./local-topic-host')
\ No newline at end of file +
On this page

topics_index.js

/** @module Topics */
+exports.LocalTopicHost = require('./local-topic-host')
\ No newline at end of file diff --git a/docs/topics_local-topic-host.js.html b/docs/topics_local-topic-host.js.html index b75b6b1..7c35979 100644 --- a/docs/topics_local-topic-host.js.html +++ b/docs/topics_local-topic-host.js.html @@ -1,6 +1,6 @@ Source: topics/local-topic-host.js
On this page

topics_local-topic-host.js

'use strict'
+    
On this page

topics_local-topic-host.js

'use strict'
 
 const Path = require('path')
 const debug = require('debug')('dataparty.topics.LocalTopicHost')
@@ -155,4 +155,4 @@
   }
 }
 
-module.exports = LocalTopicHost
\ No newline at end of file +module.exports = LocalTopicHost
\ No newline at end of file diff --git a/docs/tutorial-implementing-services.html b/docs/tutorial-implementing-services.html index b8102d4..8825ec9 100644 --- a/docs/tutorial-implementing-services.html +++ b/docs/tutorial-implementing-services.html @@ -1,6 +1,6 @@ Tutorial: implementing-services
On this page

implementing-services

Example restful service implementation

File: ./example-service.js


+    
On this page

implementing-services

Example restful service implementation

File: ./example-service.js


 const Dataparty = require('@dataparty/api')
 const debug = require('debug')('example.service')
 
@@ -239,4 +239,4 @@
   console.error('CRASH')
   console.error(err)
 })
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/tutorial-local-party.html b/docs/tutorial-local-party.html index fad8ca5..5a23006 100644 --- a/docs/tutorial-local-party.html +++ b/docs/tutorial-local-party.html @@ -1,6 +1,6 @@ Tutorial: local-party
On this page

local-party

Simple local party

File: ./local-party.js


+    
On this page

local-party

Simple local party

File: ./local-party.js


     const fs = require('fs/promises')
     const debug = require('debug')('example.tingo-db')
     const ExampleServiceBuild = require('./dataparty/example-service.json')
@@ -65,4 +65,4 @@
     main().catch(err=>{
       console.error(err)
     })
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/tutorial-peer-to-peer.html b/docs/tutorial-peer-to-peer.html index 1ca1349..8d0e8d3 100644 --- a/docs/tutorial-peer-to-peer.html +++ b/docs/tutorial-peer-to-peer.html @@ -1,6 +1,6 @@ Tutorial: peer-to-peer
On this page

peer-to-peer

Simple peer-to-peer service

File: ./example-service.js


+    
On this page

peer-to-peer

Simple peer-to-peer service

File: ./example-service.js


 const Dataparty = require('@dataparty/api')
 const debug = require('debug')('example.service')
 
@@ -157,4 +157,4 @@
   main().catch(err=>{
     console.error(err)
   })
-
\ No newline at end of file +
\ No newline at end of file diff --git a/docs/tutorial-service-task.html b/docs/tutorial-service-task.html index baf3aa1..8019b57 100644 --- a/docs/tutorial-service-task.html +++ b/docs/tutorial-service-task.html @@ -1,6 +1,6 @@ Tutorial: service-task
On this page

service-task

Service task

File: ./service-host.js


+    
On this page

service-task

Service task

File: ./service-host.js


 const Path = require('path')
 const debug = require('debug')('test.server-db')
 const Dataparty = require('../src')
@@ -125,4 +125,4 @@
   }
   
   module.exports = StatusDisplayTask
-
\ No newline at end of file +
\ No newline at end of file diff --git a/package.json b/package.json index 0a3f0fe..a5318eb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@dataparty/api", "private": false, - "version": "1.2.24", + "version": "1.2.25", "main": "dist/dataparty.js", "frontend": "dist/dataparty-browser.js", "backend": "dist/dataparty.js", diff --git a/scripts/build-docs.sh b/scripts/build-docs.sh index 6858cc1..063529e 100755 --- a/scripts/build-docs.sh +++ b/scripts/build-docs.sh @@ -4,5 +4,5 @@ set -x rm -rf docs npm run generate-docs -mv docs/@dataparty/api/1.2.24/* docs/ +mv docs/@dataparty/api/1.2.25/* docs/ cp -r images/ docs diff --git a/src/comms/rest-comms.js b/src/comms/rest-comms.js index 8062d0e..ba83fd6 100644 --- a/src/comms/rest-comms.js +++ b/src/comms/rest-comms.js @@ -83,8 +83,8 @@ class RestComms extends EventEmitter { } async loadCloud() { - this.uri = this.config.read('cloud.uri') - this.wsUri = this.config.read('cloud.wsUri') + this.uri = await this.config.read('cloud.uri') + this.wsUri = await this.config.read('cloud.wsUri') if (this.uri && this.uri[this.uri.length - 1] !== '/') { this.uri = this.uri + '/' @@ -95,9 +95,9 @@ class RestComms extends EventEmitter { // } - storeSession() { + async storeSession() { const path = this.cfgPrefix + '.rest-session' - this.config.write(path, { id: this.sessionId }) + await this.config.write(path, { id: this.sessionId }) } async call(path, data, @@ -316,7 +316,7 @@ class RestComms extends EventEmitter { this.sessionId = reply.session this.authed = true - this.storeSession() + await this.storeSession() await this.syncActors() this.emit('open') diff --git a/src/config/secure-config.js b/src/config/secure-config.js index 57dbac9..939685a 100644 --- a/src/config/secure-config.js +++ b/src/config/secure-config.js @@ -215,7 +215,7 @@ class SecureConfig extends IConfig { if(await this.isInitialized()){ throw new Error('already initialized') } const settings = { - key_type: 'key' + type: 'key' } await this.initialize(key, defaults, settings) @@ -223,7 +223,7 @@ class SecureConfig extends IConfig { async initialize(key, defaults, settings){ - debug('initialize - type:', settings.key_type) + debug('initialize - type:', settings.type) if(await this.isInitialized()){ throw new Error('already initialized') } const pwIdentity = new dataparty_crypto.Identity({ diff --git a/src/party/iparty.js b/src/party/iparty.js index cfc08d5..0894eaa 100644 --- a/src/party/iparty.js +++ b/src/party/iparty.js @@ -213,6 +213,8 @@ class IParty { this._actor.type = primaryActor.type const path = 'actor' + + //! @hack & @todo - this needs to be `await` so this accessor probably should be removed this.config.write(path, this._actor) } @@ -238,7 +240,7 @@ class IParty { */ async loadIdentity(){ const path = 'identity' - const cfgIdenStr = this.config.read(path) + const cfgIdenStr = await this.config.read(path) if (!cfgIdenStr){ debug('generated new identity') @@ -270,7 +272,7 @@ class IParty { */ async loadActor(){ const path = 'actor' - const localActorObj = this.config.read(path) + const localActorObj = await this.config.read(path) if (!localActorObj){ return } diff --git a/src/venue/schema/group.js b/src/venue/schema/group.js new file mode 100644 index 0000000..3ad035b --- /dev/null +++ b/src/venue/schema/group.js @@ -0,0 +1,8 @@ +{ + owner: [User, Party], + name: String, + identity:{ + type: [NaCl], + + } +} \ No newline at end of file diff --git a/src/venue/schema/party-service.js b/src/venue/schema/party-service.js new file mode 100644 index 0000000..bce2709 --- /dev/null +++ b/src/venue/schema/party-service.js @@ -0,0 +1,8 @@ +{ + party: [Party], + visibility: ['Public', 'Private', 'Group'], + serviceUUID: String, //! Service UUID + serviceHash: String, //! Hash of service + prefix: String, + disabled: Boolean +} \ No newline at end of file diff --git a/src/venue/schema/party.js b/src/venue/schema/party.js index ab98187..462f273 100644 --- a/src/venue/schema/party.js +++ b/src/venue/schema/party.js @@ -6,7 +6,13 @@ type: [NaCl] hash: String }, + rootOfTrust: { + + nacl: NaClIdentityObject[], + wallet: WalletIdentityObject[], + pgp: String[] + } unlisted: Boolean private: Boolean //! Only show to people who party.identity has trusted - type: ['External', 'SharedHosted', 'Internal'] + type: ['External', 'SharedHost', 'ContainerHost', 'Internal'] } diff --git a/src/venue/schema/trust.js b/src/venue/schema/trust.js index 4cc015d..fdab21b 100644 --- a/src/venue/schema/trust.js +++ b/src/venue/schema/trust.js @@ -1,11 +1,12 @@ { owner: [User | Host], from: Identity, + timestamp: Date, + expiry: Date, target: { id: String, type: String, hash: String host: String //! Host identity hash } - } \ No newline at end of file From eb1ac283602a1cfc0f1c867cd2eb414c4ba25acd Mon Sep 17 00:00:00 2001 From: 7bit <662932+sevenbitbyte@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:25:36 -0700 Subject: [PATCH 2/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index a5318eb..ef3394f 100644 --- a/package.json +++ b/package.json @@ -91,7 +91,7 @@ "morgan": "^1.10.0", "multer": "^1.4.5-lts.1", "nconf": "^0.10.0", - "noble": "npm:@abandonware/noble@^1.9.2-20", + "noble": "npm:@abandonware/noble@^1.9.2-23", "node-mocks-http": "^1.12.1", "node-persist": "^3.0.1", "origin-router": "^1.6.4", From 2503a687cde3e63ef9a8b628c4380891a1507708 Mon Sep 17 00:00:00 2001 From: 7bit <662932+sevenbitbyte@users.noreply.github.com> Date: Fri, 29 Sep 2023 19:27:58 -0700 Subject: [PATCH 3/3] Update package.json --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ef3394f..a8bd4d9 100644 --- a/package.json +++ b/package.json @@ -67,7 +67,7 @@ "@zeit/ncc": "^0.22.3", "ajv": "6.9.1", "axios": "^0.27.2", - "bleno": "npm:@abandonware/bleno@^0.5.1-4", + "bleno": "npm:@abandonware/bleno@^0.6.1", "body-parser": "^1.19.0", "bson": "^4.6.1", "bson-objectid": "^1.3.0",