fix(core): update
This commit is contained in:
		
							
								
								
									
										46
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							
							
						
						
									
										46
									
								
								package-lock.json
									
									
									
										generated
									
									
									
								
							| @@ -305,20 +305,23 @@ | |||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "@pushrocks/smartrx": { |     "@pushrocks/smartrx": { | ||||||
|       "version": "2.0.3", |       "version": "2.0.5", | ||||||
|       "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.3.tgz", |       "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartrx/-/smartrx-2.0.5.tgz", | ||||||
|       "integrity": "sha512-OWxagu+CBdPaq76AIg91hJyrNhDTlEpesj01ooWCeVIaLY3G7yvFkqHsEKNOwPUG1LzCWmjq1l1dHQx9p2vJ9A==", |       "integrity": "sha512-BOlIJmnCO8pxqu9f18D9UV5rIsyrmKeK/mWNMiAe/NH2OTeRPNLpgmhZBkXSKNVD8tSsD8aazs4BcACgYOg1FQ==", | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@pushrocks/lik": "^3.0.2", |         "@pushrocks/lik": "^3.0.11", | ||||||
|         "@pushrocks/smartevent": "^2.0.3", |         "@pushrocks/smartevent": "^2.0.3", | ||||||
|         "@pushrocks/smartpromise": "^2.0.5", |         "@pushrocks/smartpromise": "^3.0.2", | ||||||
|         "rxjs": "^6.3.3" |         "rxjs": "^6.5.3" | ||||||
|       }, |       }, | ||||||
|       "dependencies": { |       "dependencies": { | ||||||
|         "@pushrocks/smartpromise": { |         "rxjs": { | ||||||
|           "version": "2.0.5", |           "version": "6.5.3", | ||||||
|           "resolved": "https://verdaccio.lossless.one/@pushrocks%2fsmartpromise/-/smartpromise-2.0.5.tgz", |           "resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.5.3.tgz", | ||||||
|           "integrity": "sha512-9j/chLtIiNkR0MDw7Mpxg9slxAVvAQwUZuiaPYX5KpHdKxQaHLI1VZ8IN0vPhwlfgNO4i4vGXV0wB8BvSDj03g==" |           "integrity": "sha512-wuYsAYYFdWTAnAaPoKGNhfpWwKZbJW+HgAJ+mImp+Epl7BG8oNWBCTyRM8gba9k4lk8BgWdoYm21Mo/RYhhbgA==", | ||||||
|  |           "requires": { | ||||||
|  |             "tslib": "^1.9.0" | ||||||
|  |           } | ||||||
|         } |         } | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
| @@ -1240,7 +1243,7 @@ | |||||||
|     }, |     }, | ||||||
|     "esutils": { |     "esutils": { | ||||||
|       "version": "2.0.3", |       "version": "2.0.3", | ||||||
|       "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", |       "resolved": "https://verdaccio.lossless.one/esutils/-/esutils-2.0.3.tgz", | ||||||
|       "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", |       "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
| @@ -1946,7 +1949,7 @@ | |||||||
|     }, |     }, | ||||||
|     "minimist": { |     "minimist": { | ||||||
|       "version": "0.0.8", |       "version": "0.0.8", | ||||||
|       "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", |       "resolved": "https://verdaccio.lossless.one/minimist/-/minimist-0.0.8.tgz", | ||||||
|       "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", |       "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", | ||||||
|       "dev": true |       "dev": true | ||||||
|     }, |     }, | ||||||
| @@ -2361,7 +2364,7 @@ | |||||||
|     }, |     }, | ||||||
|     "resolve": { |     "resolve": { | ||||||
|       "version": "1.12.0", |       "version": "1.12.0", | ||||||
|       "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.0.tgz", |       "resolved": "https://verdaccio.lossless.one/resolve/-/resolve-1.12.0.tgz", | ||||||
|       "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", |       "integrity": "sha512-B/dOmuoAik5bKcD6s6nXDCjzUKnaDvdkRyAk6rsmsKLipWj4797iothd7jmmUhWTfinVMU+wc56rYKsit2Qy4w==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
| @@ -2382,6 +2385,7 @@ | |||||||
|       "version": "6.4.0", |       "version": "6.4.0", | ||||||
|       "resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz", |       "resolved": "https://verdaccio.lossless.one/rxjs/-/rxjs-6.4.0.tgz", | ||||||
|       "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", |       "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", | ||||||
|  |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "tslib": "^1.9.0" |         "tslib": "^1.9.0" | ||||||
|       } |       } | ||||||
| @@ -2769,16 +2773,16 @@ | |||||||
|       "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" |       "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==" | ||||||
|     }, |     }, | ||||||
|     "tslint": { |     "tslint": { | ||||||
|       "version": "5.19.0", |       "version": "5.20.0", | ||||||
|       "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.19.0.tgz", |       "resolved": "https://verdaccio.lossless.one/tslint/-/tslint-5.20.0.tgz", | ||||||
|       "integrity": "sha512-1LwwtBxfRJZnUvoS9c0uj8XQtAnyhWr9KlNvDIdB+oXyT+VpsOAaEhEgKi1HrZ8rq0ki/AAnbGSv4KM6/AfVZw==", |       "integrity": "sha512-2vqIvkMHbnx8acMogAERQ/IuINOq6DFqgF8/VDvhEkBqQh/x6SP0Y+OHnKth9/ZcHQSroOZwUQSN18v8KKF0/g==", | ||||||
|       "dev": true, |       "dev": true, | ||||||
|       "requires": { |       "requires": { | ||||||
|         "@babel/code-frame": "^7.0.0", |         "@babel/code-frame": "^7.0.0", | ||||||
|         "builtin-modules": "^1.1.1", |         "builtin-modules": "^1.1.1", | ||||||
|         "chalk": "^2.3.0", |         "chalk": "^2.3.0", | ||||||
|         "commander": "^2.12.1", |         "commander": "^2.12.1", | ||||||
|         "diff": "^3.2.0", |         "diff": "^4.0.1", | ||||||
|         "glob": "^7.1.1", |         "glob": "^7.1.1", | ||||||
|         "js-yaml": "^3.13.1", |         "js-yaml": "^3.13.1", | ||||||
|         "minimatch": "^3.0.4", |         "minimatch": "^3.0.4", | ||||||
| @@ -2787,14 +2791,6 @@ | |||||||
|         "semver": "^5.3.0", |         "semver": "^5.3.0", | ||||||
|         "tslib": "^1.8.0", |         "tslib": "^1.8.0", | ||||||
|         "tsutils": "^2.29.0" |         "tsutils": "^2.29.0" | ||||||
|       }, |  | ||||||
|       "dependencies": { |  | ||||||
|         "diff": { |  | ||||||
|           "version": "3.5.0", |  | ||||||
|           "resolved": "https://verdaccio.lossless.one/diff/-/diff-3.5.0.tgz", |  | ||||||
|           "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", |  | ||||||
|           "dev": true |  | ||||||
|         } |  | ||||||
|       } |       } | ||||||
|     }, |     }, | ||||||
|     "tslint-config-prettier": { |     "tslint-config-prettier": { | ||||||
|   | |||||||
| @@ -18,7 +18,7 @@ | |||||||
|     "@gitzone/tstest": "^1.0.24", |     "@gitzone/tstest": "^1.0.24", | ||||||
|     "@pushrocks/tapbundle": "^3.0.13", |     "@pushrocks/tapbundle": "^3.0.13", | ||||||
|     "@types/node": "^12.7.4", |     "@types/node": "^12.7.4", | ||||||
|     "tslint": "^5.19.0", |     "tslint": "^5.20.0", | ||||||
|     "tslint-config-prettier": "^1.18.0" |     "tslint-config-prettier": "^1.18.0" | ||||||
|   }, |   }, | ||||||
|   "peerDependencies": { |   "peerDependencies": { | ||||||
| @@ -33,7 +33,7 @@ | |||||||
|     "@pushrocks/smartlog": "^2.0.19", |     "@pushrocks/smartlog": "^2.0.19", | ||||||
|     "@pushrocks/smartpromise": "^3.0.2", |     "@pushrocks/smartpromise": "^3.0.2", | ||||||
|     "@pushrocks/smartrequest": "^1.1.27", |     "@pushrocks/smartrequest": "^1.1.27", | ||||||
|     "@pushrocks/smartrx": "^2.0.3", |     "@pushrocks/smartrx": "^2.0.5", | ||||||
|     "@pushrocks/smartsocket": "^1.1.49", |     "@pushrocks/smartsocket": "^1.1.49", | ||||||
|     "@pushrocks/smarttime": "^3.0.12", |     "@pushrocks/smarttime": "^3.0.12", | ||||||
|     "@pushrocks/smartunique": "^3.0.1" |     "@pushrocks/smartunique": "^3.0.1" | ||||||
|   | |||||||
| @@ -59,7 +59,7 @@ export class UniverseCache { | |||||||
|     UniverseChannel.authorizeAMessageForAChannel(this, messageArg); |     UniverseChannel.authorizeAMessageForAChannel(this, messageArg); | ||||||
|     this.messageMap.add(messageArg); |     this.messageMap.add(messageArg); | ||||||
|     messageArg.universeChannelList.forEach(universeChannel => { |     messageArg.universeChannelList.forEach(universeChannel => { | ||||||
|       universeChannel.pushToClients(messageArg); |       universeChannel.push(messageArg); | ||||||
|     }); |     }); | ||||||
|   } |   } | ||||||
|  |  | ||||||
|   | |||||||
| @@ -85,6 +85,7 @@ export class UniverseChannel { | |||||||
|    */ |    */ | ||||||
|   public name: string; |   public name: string; | ||||||
|   public universeRef: Universe; |   public universeRef: Universe; | ||||||
|  |   private subject = new plugins.smartrx.rxjs.Subject<UniverseMessage>(); | ||||||
|  |  | ||||||
|   /** |   /** | ||||||
|    * the passphrase for the channel |    * the passphrase for the channel | ||||||
| @@ -113,7 +114,8 @@ export class UniverseChannel { | |||||||
|    * pushes a message to clients |    * pushes a message to clients | ||||||
|    * @param messageArg |    * @param messageArg | ||||||
|    */ |    */ | ||||||
|   public async pushToClients(messageArg: UniverseMessage) { |   public async push(messageArg: UniverseMessage) { | ||||||
|  |     this.subject.next(messageArg); | ||||||
|     const universeConnectionsWithChannelAccess: UniverseConnection[] = []; |     const universeConnectionsWithChannelAccess: UniverseConnection[] = []; | ||||||
|     this.universeRef.universeCache.connectionMap.forEach(async socketConnection => { |     this.universeRef.universeCache.connectionMap.forEach(async socketConnection => { | ||||||
|       if (socketConnection.authenticatedChannels.includes(this)) { |       if (socketConnection.authenticatedChannels.includes(this)) { | ||||||
| @@ -139,4 +141,25 @@ export class UniverseChannel { | |||||||
|       ); |       ); | ||||||
|     } |     } | ||||||
|   } |   } | ||||||
|  |  | ||||||
|  |   // functions to interact with a channel locally | ||||||
|  |   public async subscribe(observer: plugins.smartrx.rxjs.Observer<any>) { | ||||||
|  |     return this.subject.subscribe(observer); | ||||||
|  |   } | ||||||
|  |  | ||||||
|  |   /** | ||||||
|  |    * sends a message to the channel | ||||||
|  |    */ | ||||||
|  |   public async sendMessage(messageDescriptor: interfaces.IMessageCreator) { | ||||||
|  |     const messageToSend = new UniverseMessage({ | ||||||
|  |       id: plugins.smartunique.shortId(), | ||||||
|  |       messageText: messageDescriptor.messageText, | ||||||
|  |       payload: messageDescriptor.payload, | ||||||
|  |       payloadStringType: messageDescriptor.payloadStringType, | ||||||
|  |       targetChannelName: this.name, | ||||||
|  |       passphrase: this.passphrase, | ||||||
|  |       timestamp: Date.now() | ||||||
|  |     }); | ||||||
|  |     this.push(messageToSend); | ||||||
|  |   } | ||||||
| } | } | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user