{"_id":"strophejs-plugin-disco","_rev":"7-8665126f1288e54df2685c220712cfdc","name":"strophejs-plugin-disco","description":"A strophe.js plugin for XEP-0030 Service Discovery","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.1":{"name":"strophejs-plugin-disco","version":"0.0.1","description":"A strophe.js plugin for XEP-0030 Service Discovery","main":"strophe.disco.js","scripts":{"test":"jasmine mon"},"repository":{"type":"git","url":"git+https://github.com/strophe/strophejs-plugin-disco.git"},"keywords":["xmpp","strophe","strophe.js"],"author":{"name":"The strophe plugin developers"},"license":"MIT","bugs":{"url":"https://github.com/strophe/strophejs-plugin-disco/issues"},"homepage":"https://github.com/strophe/strophejs-plugin-disco#readme","dependencies":{"strophe.js":"^1.2.12"},"gitHead":"c8ede09a93575db6ecdb3067ab3a1be8620e9714","_id":"strophejs-plugin-disco@0.0.1","_shasum":"255a1776c64314e9d9e4ec52d5733eeaf516c7f9","_from":".","_npmVersion":"4.1.2","_nodeVersion":"7.5.0","_npmUser":{"name":"strophe","email":"jc@opkode.com"},"dist":{"shasum":"255a1776c64314e9d9e4ec52d5733eeaf516c7f9","tarball":"https://registry.npmjs.org/strophejs-plugin-disco/-/strophejs-plugin-disco-0.0.1.tgz","integrity":"sha512-jvz21w1uTnRhlMsl5EKiLrBkIDUQ86IZ9SSWnRZ3kfUdjSGxCln/uauhiMK3yoDsllJ31JWiKtsymzcWQ5FXcw==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIADCHdejZJPHTtCBNe5EVeKycWymrklUkGMSRVUrIl0tAiB3XHbmFlfMezhcwjHfISrkzfc1jCugLhgeuwLZvT+moQ=="}]},"maintainers":[{"name":"strophe","email":"jc@opkode.com"}],"_npmOperationalInternal":{"host":"packages-18-east.internal.npmjs.com","tmp":"tmp/strophejs-plugin-disco-0.0.1.tgz_1487245735590_0.29039364447817206"}},"0.0.2":{"name":"strophejs-plugin-disco","version":"0.0.2","description":"A strophe.js plugin for XEP-0030 Service Discovery","main":"lib/strophe.disco.js","scripts":{"build":"rollup src/strophe.disco.js -f umd -g strophe.js:window -o lib/strophe.disco.js -m","prepublish":"npm run --silent build","test":"jasmine mon"},"repository":{"type":"git","url":"git+https://github.com/strophe/strophejs-plugin-disco.git"},"keywords":["xmpp","strophe","strophe.js","disco"],"author":{"name":"The strophe plugin developers"},"license":"MIT","bugs":{"url":"https://github.com/strophe/strophejs-plugin-disco/issues"},"homepage":"https://github.com/strophe/strophejs-plugin-disco#readme","devDependencies":{"rollup":"^0.45.2"},"peerDependencies":{"strophe.js":"^1.2.12"},"gitHead":"9574cc61f5edc383ca274aed28f1e652fab8f9b1","_id":"strophejs-plugin-disco@0.0.2","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"omichelsen","email":"ole@michelsen.dk"},"dist":{"integrity":"sha512-T9pJFzn1ZUqZ/we9+OvI5pFdrjeb4IBMbEjK+ZWEZV036wEl8l8GOtF8AJ3sIqOMtdIiFLdFu99JiGWd7yapAQ==","shasum":"a16312a34bf58518e13d23222948dcc9be3047f5","tarball":"https://registry.npmjs.org/strophejs-plugin-disco/-/strophejs-plugin-disco-0.0.2.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIGM7Vaw9vRbMLlNWdbkKIcoFnZY6/eNLhYgd3sLTVtuDAiEAsxEpSX31iUb5+es32J/lmM87Ytcl+UIhXeLWBuJ6/ts="}]},"maintainers":[{"email":"ole@michelsen.dk","name":"omichelsen"},{"email":"klaus@jsxc.org","name":"sualko"},{"email":"jc@opkode.com","name":"jcbrand"},{"email":"jc@opkode.com","name":"strophe-admin"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/strophejs-plugin-disco-0.0.2.tgz_1500069280372_0.04816031455993652"}}},"readme":"# strophe.disco.js\n\nPlugin for [strophe.js](https://www.npmjs.com/package/strophe.js) to provide Service Discovery\n([XEP-0030](http://xmpp.org/extensions/xep-0030.html)).\n\n## Install\n\n    npm install strophejs-plugin-disco\n\nThere are two plugins available.\n\n## Plugin A (default)\n\nThis [plugin](https://github.com/strophe/strophejs-plugin-disco/blob/master/src/strophe.disco.js) allows to\nsend disco queries and registers handlers that respond to incoming queries.\n\n### Usage\n\n    var c = new Strophe.Connection('bosh-service');\n    c.connect(jid,pw);\n    c.disco.info(jid,callback);\n\n#### Run Specs\n\nuse node with jasmine-node plugin to run the specs\n\n### ToDo\n\n- cleanup stanza specs using Strophe.Builder instead of strings\n\n## Plugin B\n\nThe [plugin](https://github.com/strophe/strophejs-plugin-disco/blob/master/public/javascript/strophe.disco.js)\nfacilitates client and server side handling of discovery messages.\n\n### Client Side\n\nThe plugin provides to methods (info and items) on top of the disco object that\nis added to the connection. You use them as follows\n\n    var c = new Strophe.Connection('http://localhost/xmpp-httpbind');\n    c.connect('andi@psi/strophe','andi');\n    c.disco.info('andi@psi/psi');\n\nYou can also pass a node, success and error handlers to the method.\nThe items method behaves in the same way. Just make sure that your success and\nerror handlers are passed after the node (if any).\n\n### Server Side\n\nThe module adds response handlers to info and item queries.\nThe disco object added to the connection has members for features and identity\nthat will be used to populate the disco#info response.\n\n     <iq xmlns='jabber:client' from='andi@psi/strophe' to='andi@psi/strophe2' type='result' id='4774:sendIQ'><query xmlns='http://jabber.org/protocol/disco#info'><identity name='strophe'/><feature var='http://jabber.org/protocol/disco#info'/><feature var='http://jabber.org/protocol/disco#items'/></query></iq>\n\nYou can additional nodes using addNode, e.g.\n    c.disco.addNode('aNode', { items: [{node: 'aNode', name: 'aName'}]  });\n\nand then query for them using the items method\n\n    c1.disco.items('andi@psi/strophe', 'aNode', function(s) { console.log(Strophe.serialize(s)) ; } )\n\nSee the specs for details.\n\n## Tests\n\nTo run the specs you should install jasmine-tool for nodejs via npm and update\nthe references to the external libraries (Strophe, jQuery) in jasmine.json.\nAfter that you run\n\n    $> jasmine mon\n\nand navigate your browser to http://localhost:8124 to view the specs executing.\n","maintainers":[{"email":"ole@michelsen.dk","name":"omichelsen"},{"email":"klaus@jsxc.org","name":"sualko"},{"email":"jc@opkode.com","name":"jcbrand"},{"email":"jc@opkode.com","name":"strophe-admin"}],"time":{"modified":"2022-06-27T01:19:44.011Z","created":"2017-02-16T11:48:56.163Z","0.0.1":"2017-02-16T11:48:56.163Z","0.0.2":"2017-07-14T21:54:40.529Z"},"homepage":"https://github.com/strophe/strophejs-plugin-disco#readme","keywords":["xmpp","strophe","strophe.js","disco"],"repository":{"type":"git","url":"git+https://github.com/strophe/strophejs-plugin-disco.git"},"author":{"name":"The strophe plugin developers"},"bugs":{"url":"https://github.com/strophe/strophejs-plugin-disco/issues"},"license":"MIT","readmeFilename":"README.md"}