New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@xmpp/client-core

Package Overview
Dependencies
Maintainers
1
Versions
23
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@xmpp/client-core - npm Package Compare versions

Comparing version 0.0.2 to 0.2.0

lib/Client.js

78

index.js

@@ -1,73 +0,9 @@

const Connection = require('@xmpp/connection')
'use strict'
class Client extends Connection {
constructor (options) {
super(options)
this.transports = []
this.uri = ''
}
const Client = require('./lib/Client')
const xml = require('@xmpp/xml')
const jid = require('@xmpp/jid')
send (element, ...args) {
if (
(this.socket.NS && this.socket.NS !== 'jabber:client') &&
!element.attrs.xmlns &&
(element.is('iq') || element.is('message') || element.is('presence'))
) {
element.attrs.xmlns = 'jabber:client'
}
return super.send(element, ...args)
}
connect (uri) {
this.connectOptions = uri
let params
const Transport = this.transports.find(Transport => {
return params = Transport.match(uri) // eslint-disable-line no-return-assign
})
// FIXME callback?
if (!Transport) throw new Error('No transport found')
const sock = this.socket = new Transport()
;[
'error', 'close', 'connect', 'open',
'feature', 'element', 'stanza', 'send',
'nonza', 'fragment', 'online',
'authenticated', 'authenticate'
].forEach(e => {
sock.on(e, (...args) => this.emit(e, ...args))
})
return sock.connect(params)
}
write (...args) {
return this.socket.write(...args)
}
open (options) {
this.openOptions = options
return this.socket.open(options)
}
restart (...args) {
return this.socket.restart(...args)
}
close (...args) {
return this.socket.close(...args)
}
end (...args) {
return this.socket.end(...args)
}
stop (...args) {
return this.socket.stop(...args)
}
}
Client.prototype.NS = 'jabber:client'
module.exports = Client
module.exports.Client = Client
module.exports.xml = xml
module.exports.jid = jid

@@ -6,7 +6,9 @@ {

"bugs": "http://github.com/node-xmpp/node-xmpp/issues",
"version": "0.0.2",
"version": "0.2.0",
"license": "ISC",
"dependencies": {
"@xmpp/connection": "^0.0.6"
"@xmpp/connection": "^0.2.0",
"@xmpp/jid": "^0.2.0",
"@xmpp/xml": "^0.2.0"
}
}
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