From 5b370e455c7652a8487ef80a70bfb3516623db41 Mon Sep 17 00:00:00 2001 From: Nick Jennings Date: Tue, 5 Jan 2016 12:35:03 -0500 Subject: [PATCH] update build --- src/webfinger.min.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/webfinger.min.js b/src/webfinger.min.js index 9004457..e54b96b 100644 --- a/src/webfinger.min.js +++ b/src/webfinger.min.js @@ -1,2 +1,2 @@ /* webfinger.js v2.3.0 | (c) 2012-2014 Nick Jennings | License: AGPL | https://github.com/silverbucket/webfinger.js */ -"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=require("xmlhttprequest").XMLHttpRequest),function(e){function t(e){return e.toString=function(){return this.message},e}function r(e){"object"!=typeof e&&(e={}),this.config={tls_only:"undefined"!=typeof e.tls_only?e.tls_only:!0,webfist_fallback:"undefined"!=typeof e.webfist_fallback?e.webfist_fallback:!1,uri_fallback:"undefined"!=typeof e.uri_fallback?e.uri_fallback:!1,request_timeout:"undefined"!=typeof e.request_timeout?e.request_timeout:1e4}}var o={"http://webfist.org/spec/rel":"webfist","http://webfinger.net/rel/avatar":"avatar",remotestorage:"remotestorage","http://tools.ietf.org/id/draft-dejong-remotestorage":"remotestorage",remoteStorage:"remotestorage","http://www.packetizer.com/rel/share":"share","http://webfinger.net/rel/profile-page":"profile",me:"profile",vcard:"vcard",blog:"blog","http://packetizer.com/rel/blog":"blog","http://schemas.google.com/g/2010#updates-from":"updates","https://camlistore.org/rel/server":"camilstore"},s={avatar:[],remotestorage:[],blog:[],vcard:[],updates:[],share:[],profile:[],webfist:[],camlistore:[]},n=["webfinger","host-meta","host-meta.json"];if(r.prototype._fetchJRD=function(e,r,o){function s(e){var i=new XMLHttpRequest;i.onreadystatechange=function(){if(4===i.readyState){if(200===i.status)return n._isValidJSON(i.responseText)?o(i.responseText):r(t({message:"invalid json",url:e,status:i.status}));if(404===i.status)return r(t({message:"endpoint unreachable",url:e,status:i.status}));if(i.status>=301&&i.status<=302){var a=i.getResponseHeader("Location");return a?s(a):r(t({message:"no redirect URL found",url:e,status:i.status}))}return r(t({message:"error during request",url:e,status:i.status}))}},i.open("GET",e,!0),i.setRequestHeader("Accept","application/jrd+json, application/json"),i.send()}var n=this;return s(e)},r.prototype._isValidJSON=function(e){try{JSON.parse(e)}catch(t){return!1}return!0},r.prototype._isLocalhost=function(e){var t=/^localhost(\.localdomain)?(\:[0-9]+)?$/;return t.test(e)},r.prototype._processJRD=function(r,n,i){var a=JSON.parse(r);if("object"!=typeof a||"object"!=typeof a.links)return n("undefined"!=typeof a.error?t({message:a.error}):t({message:"unknown response from server"}));var u=a.links,f={object:a,json:r,idx:{}};f.idx.properties={name:e},f.idx.links=JSON.parse(JSON.stringify(s)),u.map(function(e,t){if(o.hasOwnProperty(e.rel)&&f.idx.links[o[e.rel]]){var r={};Object.keys(e).map(function(t,o){r[t]=e[t]}),f.idx.links[o[e.rel]].push(r)}});var p=JSON.parse(r).properties;for(var l in p)p.hasOwnProperty(l)&&"http://packetizer.com/ns/name"===l&&(f.idx.properties.name=p[l]);return i(f)},r.prototype.lookup=function(e,r){function o(){return l+"://"+f+"/.well-known/"+n[p]+"?resource=acct:"+e}function s(e){return a.config.uri_fallback&&"webfist.org"!==f&&p!==n.length-1?(p+=1,i()):a.config.tls_only||"https"!==l?a.config.webfist_fallback&&"webfist.org"!==f?(p=0,l="http",f="webfist.org",a._fetchJRD(o(),r,function(e){a._processJRD(e,r,function(e){"object"==typeof e.idx.links.webfist&&"string"==typeof e.idx.links.webfist[0].href&&a._fetchJRD(e.idx.links.webfist[0].href,r,function(e){a._processJRD(e,r,function(e){return r(null,r)})})})}),void 0):r(e):(p=0,l="http",i())}function i(){a._fetchJRD(o(),s,function(e){a._processJRD(e,r,function(e){r(null,e)})})}if("string"!=typeof e)throw new Error("first parameter must be a user address");if("function"!=typeof r)throw new Error("second parameter must be a callback");var a=this,u=e.replace(/ /g,"").split("@"),f=u[1],p=0,l="https";return 2!==u.length?r(t({message:"invalid user address "+e+" ( expected format: user@host.com )"})):(a._isLocalhost(f)&&(l="http"),setTimeout(i,0))},r.prototype.lookupLink=function(e,t,r){return s.hasOwnProperty(t)?void this.lookup(e,function(e,o){var s=o.idx.links[t];return e?r(e):0===s.length?r('no links found with rel="'+t+'"'):r(null,s[0])}):r("unsupported rel "+t)},"object"==typeof window)window.WebFinger=r;else if("function"==typeof define&&define.amd)define([],function(){return r});else try{module.exports=r}catch(i){}}(); \ No newline at end of file +"undefined"==typeof XMLHttpRequest&&(XMLHttpRequest=require("xmlhttprequest").XMLHttpRequest),function(e){function t(e){return e.toString=function(){return this.message},e}function r(e){if("string"!=typeof e)return!1;var t=e.split("://");return"https"===t[0]?!0:!1}function o(e){"object"!=typeof e&&(e={}),this.config={tls_only:"undefined"!=typeof e.tls_only?e.tls_only:!0,webfist_fallback:"undefined"!=typeof e.webfist_fallback?e.webfist_fallback:!1,uri_fallback:"undefined"!=typeof e.uri_fallback?e.uri_fallback:!1,request_timeout:"undefined"!=typeof e.request_timeout?e.request_timeout:1e4}}var s={"http://webfist.org/spec/rel":"webfist","http://webfinger.net/rel/avatar":"avatar",remotestorage:"remotestorage","http://tools.ietf.org/id/draft-dejong-remotestorage":"remotestorage",remoteStorage:"remotestorage","http://www.packetizer.com/rel/share":"share","http://webfinger.net/rel/profile-page":"profile",me:"profile",vcard:"vcard",blog:"blog","http://packetizer.com/rel/blog":"blog","http://schemas.google.com/g/2010#updates-from":"updates","https://camlistore.org/rel/server":"camilstore"},n={avatar:[],remotestorage:[],blog:[],vcard:[],updates:[],share:[],profile:[],webfist:[],camlistore:[]},i=["webfinger","host-meta","host-meta.json"];if(o.prototype.__fetchJRD=function(e,o,s){function n(e){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(4===a.readyState){if(200===a.status)return i.__isValidJSON(a.responseText)?s(a.responseText):o(t({message:"invalid json",url:e,status:a.status}));if(404===a.status)return o(t({message:"endpoint unreachable",url:e,status:a.status}));if(a.status>=301&&a.status<=302){var u=a.getResponseHeader("Location");return r(u)?n(u):o(t({message:"no redirect URL found",url:e,status:a.status}))}return o(t({message:"error during request",url:e,status:a.status}))}},a.open("GET",e,!0),a.setRequestHeader("Accept","application/jrd+json, application/json"),a.send()}var i=this;return n(e)},o.prototype.__isValidJSON=function(e){try{JSON.parse(e)}catch(t){return!1}return!0},o.prototype.__isLocalhost=function(e){var t=/^localhost(\.localdomain)?(\:[0-9]+)?$/;return t.test(e)},o.prototype.__processJRD=function(r,o,i){var a=JSON.parse(r);if("object"!=typeof a||"object"!=typeof a.links)return o("undefined"!=typeof a.error?t({message:a.error}):t({message:"unknown response from server"}));var u=a.links,f={object:a,json:r,idx:{}};f.idx.properties={name:e},f.idx.links=JSON.parse(JSON.stringify(n)),u.map(function(e){if(s.hasOwnProperty(e.rel)&&f.idx.links[s[e.rel]]){var t={};Object.keys(e).map(function(r){t[r]=e[r]}),f.idx.links[s[e.rel]].push(t)}});var p=JSON.parse(r).properties;for(var l in p)p.hasOwnProperty(l)&&"http://packetizer.com/ns/name"===l&&(f.idx.properties.name=p[l]);return i(f)},o.prototype.lookup=function(e,r){function o(){return l+"://"+f+"/.well-known/"+i[p]+"?resource=acct:"+e}function s(e){return a.config.uri_fallback&&"webfist.org"!==f&&p!==i.length-1?(p+=1,n()):a.config.tls_only||"https"!==l?a.config.webfist_fallback&&"webfist.org"!==f?(p=0,l="http",f="webfist.org",a.__fetchJRD(o(),r,function(e){a.__processJRD(e,r,function(e){"object"==typeof e.idx.links.webfist&&"string"==typeof e.idx.links.webfist[0].href&&a.__fetchJRD(e.idx.links.webfist[0].href,r,function(e){a.__processJRD(e,r,function(){return r(null,r)})})})}),void 0):r(e):(p=0,l="http",n())}function n(){a.__fetchJRD(o(),s,function(e){a.__processJRD(e,r,function(e){r(null,e)})})}if("string"!=typeof e)throw new Error("first parameter must be a user address");if("function"!=typeof r)throw new Error("second parameter must be a callback");var a=this,u=e.replace(/ /g,"").split("@"),f=u[1],p=0,l="https";return 2!==u.length?r(t({message:"invalid user address "+e+" ( expected format: user@host.com )"})):(a.__isLocalhost(f)&&(l="http"),setTimeout(n,0))},o.prototype.lookupLink=function(e,t,r){return n.hasOwnProperty(t)?void this.lookup(e,function(e,o){var s=o.idx.links[t];return e?r(e):0===s.length?r('no links found with rel="'+t+'"'):r(null,s[0])}):r("unsupported rel "+t)},"object"==typeof window)window.WebFinger=o;else if("function"==typeof define&&define.amd)define([],function(){return o});else try{module.exports=o}catch(a){}}(); \ No newline at end of file