Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fh-sync

Package Overview
Dependencies
Maintainers
4
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fh-sync - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

index.js

4

package.json
{
"name": "fh-sync",
"version": "1.0.2",
"version": "1.0.3",
"description": "FeedHenry Data Synchronization Server",
"main": "lib/index.js",
"main": "index.js",
"dependencies": {

@@ -7,0 +7,0 @@ "async": "2.1.5",

@@ -128,187 +128,185 @@ // Type definitions for fh-sync

}
namespace api {
/**
* Connect sync server to mongo and redis
*
* @param mongoDBConnectionUrl
* @param mongoDBConnectionOption
* @param redisUrl
* @param cb
*/
function connect(mongoDBConnectionUrl: string, mongoDBConnectionOption: any, redisUrl: string, cb: StandardCb<void>): void;
/**
* Connect sync server to mongo and redis
*
* @param mongoDBConnectionUrl
* @param mongoDBConnectionOption
* @param redisUrl
* @param cb
*/
function connect(mongoDBConnectionUrl: string, mongoDBConnectionOption: any, redisUrl: string, cb: StandardCb<void>): void;
/**
* Initialize sync for specific dataset
*
* @param datasetId
* @param options
* @param callback
*/
function init(datasetId: string, options: SyncInitOptions, callback: StandardCb<void>): void;
/**
* Initialize sync for specific dataset
*
* @param datasetId
* @param options
* @param callback
*/
function init(datasetId: string, options: SyncInitOptions, callback: StandardCb<void>): void;
/**
* Internal method used to invoke sync methods. Used to handle json request from client.
* Supported operations 'sync', 'syncRecords', 'listCollisions', 'removeCollision'
*
* @param datasetId
* @param options
* @param callback
*/
function invoke(datasetId: string, options: any, callback: (err: any, result: any) => void): void;
/**
* Internal method used to invoke sync methods. Used to handle json request from client.
* Supported operations 'sync', 'syncRecords', 'listCollisions', 'removeCollision'
*
* @param datasetId
* @param options
* @param callback
*/
function invoke(datasetId: string, options: any, callback: (err: any, result: any) => void): void;
/**
* Stop sync loop for dataset
*
* @param datasetId
* @param onStop callback called when operation is finished
*/
function stop(datasetId: string, onStop: NoRespCb): void;
/**
* Stop sync loop for dataset
*
* @param datasetId
* @param onStop callback called when operation is finished
*/
function stop(datasetId: string, onStop: NoRespCb): void;
/**
* Stop sync loop for all datasets
*
* @param datasetId
* @param onStop callback called when operation is finished
*/
function stopAll(onStop: StandardCb<string[]>): void;
/**
* Stop sync loop for all datasets
*
* @param datasetId
* @param onStop callback called when operation is finished
*/
function stopAll(onStop: StandardCb<string[]>): void;
/**
* Handle list operation for specific dataset.
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleList(datasetId: string, onList: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle list operation for specific dataset.
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleList(datasetId: string, onList: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle list operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleList(onList: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle list operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleList(onList: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle create operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleCreate(datasetId: string, onCreate: (datasetId: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle create operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleCreate(datasetId: string, onCreate: (datasetId: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle create operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleCreate(onCreate: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle create operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleCreate(onCreate: (datasetId: string, params: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle read operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleRead(datasetId: string, onRead: (datasetId: string, uid: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle read operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleRead(datasetId: string, onRead: (datasetId: string, uid: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle read operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleRead(onRead: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle read operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleRead(onRead: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle update operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleUpdate(datasetId: string, onUpdate: (datasetId: string, uid: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle update operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleUpdate(datasetId: string, onUpdate: (datasetId: string, uid: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle update operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleUpdate(onCreate: (datasetId: string, uid: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle update operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleUpdate(onCreate: (datasetId: string, uid: string, data: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle delete operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleDelete(datasetId: string, onDelete: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle delete operation for specific dataset
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function handleDelete(datasetId: string, onDelete: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle delete operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleDelete(onDelete: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle delete operation for all datasets
* Method may be used to override default data handler to have control over how sync is retrieving and storing data
*/
function globalHandleDelete(onDelete: (datasetId: string, uid: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle data collision for specific dataset (when both entries were changed)
*
* @param datasetId
* @param onCollision method called on collision
*/
function handleCollision(datasetId: string, onCollision: (datasetId: string, hash: string, timestamp: any, uid: string, pre: any, post: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle data collision for specific dataset (when both entries were changed)
*
* @param datasetId
* @param onCollision method called on collision
*/
function handleCollision(datasetId: string, onCollision: (datasetId: string, hash: string, timestamp: any, uid: string, pre: any, post: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle data collision for all managed datasets (when both entries were changed)
*
* @param datasetId
* @param onCollision method called on collision
*/
function globalHandleCollision(onCollision: (datasetId: string, hash: string, timestamp: Date, uid: string, pre: any, post: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Handle data collision for all managed datasets (when both entries were changed)
*
* @param datasetId
* @param onCollision method called on collision
*/
function globalHandleCollision(onCollision: (datasetId: string, hash: string, timestamp: Date, uid: string, pre: any, post: any, metaData: any, callback: StandardCb<any>) => void): void;
/**
* List collisions for specific dataset
*
* @param datasetId
* @param onList
*/
function listCollisions(datasetId: string, onList: (datasetId: string, metaData: any, callback: StandardCb<{ [hash: string]: any }>) => void): void;
/**
* List collisions for specific dataset
*
* @param datasetId
* @param onList
*/
function listCollisions(datasetId: string, onList: (datasetId: string, metaData: any, callback: StandardCb<{ [hash: string]: any }>) => void): void;
/**
* List collisions for all datasets
*
* @param datasetId
* @param onList
*/
function globalListCollisions(onList: (datasetId: string, metaData: any, callback: StandardCb<{ [hash: string]: any }>) => void): void;
/**
* List collisions for all datasets
*
* @param datasetId
* @param onList
*/
function globalListCollisions(onList: (datasetId: string, metaData: any, callback: StandardCb<{ [hash: string]: any }>) => void): void;
/**
* Remove collision from dataset?
*/
function removeCollision(datasetId: string, onRemove: (datasetId: string, collision_hash: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Remove collision from dataset?
*/
function removeCollision(datasetId: string, onRemove: (datasetId: string, collision_hash: string, metaData: any, callback: StandardCb<any>) => void): void;
/**
* Request interceptor for dataset - allows to perform custom operations before executing sync method.
*/
function interceptRequest(datasetId: string, onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Request interceptor for dataset - allows to perform custom operations before executing sync method.
*/
function interceptRequest(datasetId: string, onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Response interceptor for dataset - allows to perform custom operations after executing sync method.
*/
function interceptResponse(datasetId: string, onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Response interceptor for dataset - allows to perform custom operations after executing sync method.
*/
function interceptResponse(datasetId: string, onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Set configuration for sync
*/
function setConfig(config: SyncGlobalOptions): void;
/**
* Set configuration for sync
*/
function setConfig(config: SyncGlobalOptions): void;
/**
* Request interceptor for all sync calls - allows to perform custom operations after executing sync method.
*/
function globalInterceptRequest(onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Request interceptor for all sync calls - allows to perform custom operations after executing sync method.
*/
function globalInterceptRequest(onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Response interceptor for all sync calls - allows to perform custom operations after executing sync method.
*/
function globalInterceptResponse(onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Response interceptor for all sync calls - allows to perform custom operations after executing sync method.
*/
function globalInterceptResponse(onIntercept: (datasetId: string, interceptorParams: SyncInterceptParams, callback: NoRespCb) => void): void;
/**
* Sets custom global hashing method for determining if objects were changed.
*
* @param datasetId
* @param hashFunction allows to perform hashing for array of hashes returned for specific datasets
*/
function setGlobalHashFn(datasetId: string, hashFunction: (target: string[]) => string): void;
/**
* Sets custom global hashing method for determining if objects were changed.
*
* @param datasetId
* @param hashFunction allows to perform hashing for array of hashes returned for specific datasets
*/
function setGlobalHashFn(datasetId: string, hashFunction: (target: string[]) => string): void;
/**
* Sets custom dataset hashing method for determining if objects were changed.
*
* @param datasetId
* @param hashFunction allows to perform hashing for dataset
*/
function setRecordHashFn(datasetId: string, hashFunction: (target: any) => string): void;
}
/**
* Sets custom dataset hashing method for determining if objects were changed.
*
* @param datasetId
* @param hashFunction allows to perform hashing for dataset
*/
function setRecordHashFn(datasetId: string, hashFunction: (target: any) => string): void;
}
export = SyncCloud;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc