jsforce2
Version:
Salesforce API Library for JavaScript
3 lines (2 loc) • 31.4 kB
JavaScript
!function(t){var e;"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):(e=(e=(e=(e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsforce||(e.jsforce={})).modules||(e.modules={})).api||(e.api={})).Metadata=t()}(function(){return function n(o,i,u){function s(e,t){if(!i[e]){if(!o[e]){var r="function"==typeof require&&require;if(!t&&r)return r(e,!0);if(a)return a(e,!0);throw(r=new Error("Cannot find module '"+e+"'")).code="MODULE_NOT_FOUND",r}r=i[e]={exports:{}},o[e][0].call(r.exports,function(t){return s(o[e][1][t]||t)},r,r.exports,n,o,i,u)}return i[e].exports}for(var a="function"==typeof require&&require,t=0;t<u.length;t++)s(u[t]);return s}({1:[function(t,g,e){(function(r,u){"use strict";var t=window.jsforce.require("inherits"),e=window.jsforce.require("events"),n=window.jsforce.require("readable-stream"),f=window.jsforce.require("lodash/core"),o=window.jsforce.require("./core"),s=window.jsforce.require("./promise"),i=window.jsforce.require("./soap"),a=g.exports=function(t){this._conn=t};function h(t){t=f.clone(t);return t.success="true"===t.success,t}function c(t){t=h(t);return t.created="true"===t.created,t}function l(t){t=f.clone(t);return delete t.$,t}a.prototype.pollInterval=1e3,a.prototype.pollTimeout=1e4,a.prototype._invoke=function(t,e,r){return new i(this._conn,{xmlns:"http://soap.sforce.com/2006/04/metadata",endpointUrl:this._conn.instanceUrl+"/services/Soap/m/"+this._conn.version}).invoke(t,e).then(function(t){return t.result}).thenCall(r)},a.prototype.createAsync=function(e,t,r){if(30<Number(this._conn.version))throw new Error("Async metadata CRUD calls are not supported on ver 31.0 or later.");function n(t){return t["@xsi:type"]=e,t}var o=f.isArray(t);t=o?f.map(t,n):n(t);t=this._invoke("create",{metadata:t});return new p(this,t,o).thenCall(r)},a.prototype.createSync=a.prototype.create=function(e,t,r){function n(t){return t["@xsi:type"]=e,t}return t=f.isArray(t)?f.map(t,n):n(t),this._invoke("createMetadata",{metadata:t}).then(function(t){return f.isArray(t)?f.map(t,h):h(t)}).thenCall(r)},a.prototype.readSync=a.prototype.read=function(t,e,r){return this._invoke("readMetadata",{type:t,fullNames:e}).then(function(t){return f.isArray(t.records)?f.map(t.records,l):l(t.records)}).thenCall(r)},a.prototype.updateAsync=function(e,t,r){if(30<Number(this._conn.version))throw new Error("Async metadata CRUD calls are not supported on ver 31.0 or later.");function n(t){return t.metadata["@xsi:type"]=e,t}var o=f.isArray(t);t=o?f.map(t,n):n(t);t=this._invoke("update",{updateMetadata:t});return new p(this,t,o).thenCall(r)},a.prototype.updateSync=a.prototype.update=function(e,t,r){function n(t){return t["@xsi:type"]=e,t}return t=f.isArray(t)?f.map(t,n):n(t),this._invoke("updateMetadata",{metadata:t}).then(function(t){return f.isArray(t)?f.map(t,h):h(t)}).thenCall(r)},a.prototype.upsertSync=a.prototype.upsert=function(e,t,r){function n(t){return t["@xsi:type"]=e,t}return t=f.isArray(t)?f.map(t,n):n(t),this._invoke("upsertMetadata",{metadata:t}).then(function(t){return f.isArray(t)?f.map(t,c):c(t)}).thenCall(r)},a.prototype.deleteAsync=function(e,t,r){if(30<Number(this._conn.version))throw new Error("Async metadata CRUD calls are not supported on ver 31.0 or later.");function n(t){return f.isString(t)&&(t={fullName:t}),t["@xsi:type"]=e,t}var o=f.isArray(t);t=o?f.map(t,n):n(t);t=this._invoke("delete",{metadata:t});return new p(this,t,o).thenCall(r)},a.prototype.del=a.prototype.deleteSync=a.prototype.delete=function(t,e,r){return this._invoke("deleteMetadata",{type:t,fullNames:e}).then(function(t){return f.isArray(t)?f.map(t,h):h(t)}).thenCall(r)},a.prototype.rename=function(t,e,r,n){return this._invoke("renameMetadata",{type:t,oldFullName:e,newFullName:r}).then(h).thenCall(n)},a.prototype.checkStatus=function(t,e){var r=f.isArray(t),t=this._invoke("checkStatus",{asyncProcessId:t});return new p(this,t,r).thenCall(e)},a.prototype.describe=function(t,e){return f.isString(t)||(e=t,t=this._conn.version),this._invoke("describeMetadata",{asOfVersion:t}).then(function(t){return t.metadataObjects=f.isArray(t.metadataObjects)?t.metadataObjects:[t.metadataObjects],t.metadataObjects=f.map(t.metadataObjects,function(t){return t.childXmlNames&&(t.childXmlNames=f.isArray(t.childXmlNames)?t.childXmlNames:[t.childXmlNames]),t.inFolder="true"===t.inFolder,t.metaFile="true"===t.metaFile,t}),t.partialSaveAllowed="true"===t.partialSaveAllowed,t.testRequired="true"===t.testRequired,t}).thenCall(e)},a.prototype.list=function(t,e,r){return f.isString(e)||(r=e,e=this._conn.version),f.isArray(t)||(t=[t]),this._invoke("listMetadata",{queries:t,asOfVersion:e},r)},a.prototype.retrieve=function(t,e){t=this._invoke("retrieve",{request:t});return new y(this,t).thenCall(e)},a.prototype.checkRetrieveStatus=function(t,e){return this._invoke("checkRetrieveStatus",{asyncProcessId:t},e)},a.prototype.deploy=function(t,e,r){e&&!f.isFunction(e)||(r=e,e={});var n=s.defer();if(f.isObject(t)&&f.isFunction(t.pipe)){var o=[];t.on("data",function(t){o.push(t)}),t.on("end",function(){n.resolve(u.concat(o).toString("base64"))})}else if(t instanceof u)n.resolve(t.toString("base64"));else{if(!(t instanceof String||"string"==typeof t))throw"Unexpected zipInput type";n.resolve(t)}var i=this,t=n.promise.then(function(t){return i._invoke("deploy",{ZipFile:t,DeployOptions:e},r)});return new d(this,t).thenCall(r)},a.prototype.checkDeployStatus=function(t,e,r){return e=f.isObject(e)||f.isBoolean(e)?!!e:(r=e,!1),this._invoke("checkDeployStatus",{asyncProcessId:t,includeDetails:e}).then(function(t){return t.done="true"===t.done,t.success="true"===t.success,t.checkOnly="true"===t.checkOnly,t.runTestsEnabled="true"===t.runTestsEnabled,t.ignoreWarnings&&(t.ignoreWarnings="true"===t.ignoreWarnings),t.rollbackOnError&&(t.rollbackOnError="true"===t.rollbackOnError),t.numberComponentErrors=Number(t.numberComponentErrors),t.numberComponentsDeployed=Number(t.numberComponentsDeployed),t.numberComponentsTotal=Number(t.numberComponentsTotal),t.numberTestErrors=Number(t.numberTestErrors),t.numberTestsCompleted=Number(t.numberTestsCompleted),t.numberTestsTotal=Number(t.numberTestsTotal),t}).thenCall(r)};var p=function(t,e,r){this._meta=t,this._results=e,this._isArray=r};t(p,e.EventEmitter),p.prototype.then=function(r,t){var n=this;return this._results.then(function(t){function e(t){return t.$&&"true"===t.$["xsi:nil"]?null:(t.done="true"===t.done,t)}return t=f.isArray(t)?f.map(t,e):e(t),n._isArray&&!f.isArray(t)&&(t=[t]),r(t)},t)},p.prototype.thenCall=function(e){return f.isFunction(e)?this.then(function(t){r.nextTick(function(){e(null,t)})},function(t){r.nextTick(function(){e(t)})}):this},p.prototype.check=function(t){var e=this,r=this._meta;return this.then(function(t){t=f.isArray(t)?f.map(t,function(t){return t.id}):t.id;return e._ids=t,r.checkStatus(t)}).thenCall(t)},p.prototype.poll=function(u,e){var s=this,r=(new Date).getTime(),a=function(){var t=(new Date).getTime();if(r+e<t){t="Polling time out.";return s._ids&&(t+=" Process Id = "+s._ids),void s.emit("error",new Error(t))}s.check().then(function(t){for(var e=!0,r=f.isArray(t)?t:[t],n=0,o=r.length;n<o;n++){var i=r[n];i&&!i.done&&(s.emit("progress",i),e=!1)}e?s.emit("complete",t):setTimeout(a,u)},function(t){s.emit("error",t)})};setTimeout(a,u)},p.prototype.complete=function(t){var e=s.defer();this.on("complete",function(t){e.resolve(t)}),this.on("error",function(t){e.reject(t)});var r=this._meta;return this.poll(r.pollInterval,r.pollTimeout),e.promise.thenCall(t)};var y=function(t,e){y.super_.call(this,t,e)};t(y,p),y.prototype.complete=function(t){var e=this._meta;return y.super_.prototype.complete.call(this).then(function(t){return e.checkRetrieveStatus(t.id)}).thenCall(t)},y.prototype.stream=function(){var t=this,r=new n.Readable,e=!1;return r._read=function(){e||(e=!0,t.complete(function(t,e){t?r.emit("error",t):(r.push(u.from(e.zipFile,"base64")),r.push(null))}))},r};var d=function(t,e){d.super_.call(this,t,e)};t(d,p),d.prototype.complete=function(e,t){f.isFunction(e)&&(t=e,e=!1);var r=this._meta;return d.super_.prototype.complete.call(this).then(function(t){return r.checkDeployStatus(t.id,e)}).thenCall(t)},o.on("connection:new",function(t){t.metadata=new a(t)})}).call(this,t("_process"),t("buffer").Buffer)},{_process:5,buffer:3}],2:[function(t,e,r){"use strict";r.byteLength=function(t){var e=h(t),t=e[0],e=e[1];return 3*(t+e)/4-e},r.toByteArray=function(t){for(var e,r=h(t),n=r[0],r=r[1],o=new f(function(t,e){return 3*(t+e)/4-e}(n,r)),i=0,u=0<r?n-4:n,s=0;s<u;s+=4)e=a[t.charCodeAt(s)]<<18|a[t.charCodeAt(s+1)]<<12|a[t.charCodeAt(s+2)]<<6|a[t.charCodeAt(s+3)],o[i++]=e>>16&255,o[i++]=e>>8&255,o[i++]=255&e;2===r&&(e=a[t.charCodeAt(s)]<<2|a[t.charCodeAt(s+1)]>>4,o[i++]=255&e);1===r&&(e=a[t.charCodeAt(s)]<<10|a[t.charCodeAt(s+1)]<<4|a[t.charCodeAt(s+2)]>>2,o[i++]=e>>8&255,o[i++]=255&e);return o},r.fromByteArray=function(t){for(var e,r=t.length,n=r%3,o=[],i=0,u=r-n;i<u;i+=16383)o.push(function(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(function(t){return s[t>>18&63]+s[t>>12&63]+s[t>>6&63]+s[63&t]}(n));return o.join("")}(t,i,u<i+16383?u:i+16383));1==n?(e=t[r-1],o.push(s[e>>2]+s[e<<4&63]+"==")):2==n&&(e=(t[r-2]<<8)+t[r-1],o.push(s[e>>10]+s[e>>4&63]+s[e<<2&63]+"="));return o.join("")};for(var s=[],a=[],f="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0,i=n.length;o<i;++o)s[o]=n[o],a[n.charCodeAt(o)]=o;function h(t){var e=t.length;if(0<e%4)throw new Error("Invalid string. Length must be a multiple of 4");t=t.indexOf("=");return-1===t&&(t=e),[t,t===e?0:4-t%4]}a["-".charCodeAt(0)]=62,a["_".charCodeAt(0)]=63},{}],3:[function(t,e,r){"use strict";var s=t("base64-js"),i=t("ieee754");r.Buffer=c,r.SlowBuffer=function(t){+t!=t&&(t=0);return c.alloc(+t)},r.INSPECT_MAX_BYTES=50;var n=2147483647;function o(t){if(n<t)throw new RangeError("Invalid typed array length");t=new Uint8Array(t);return t.__proto__=c.prototype,t}function c(t,e,r){if("number"!=typeof t)return u(t,e,r);if("string"==typeof e)throw new Error("If encoding is specified then the first argument must be a string");return f(t)}function u(t,e,r){if("number"==typeof t)throw new TypeError('"value" argument must not be a number');return x(t)||t&&x(t.buffer)?function(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');r=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r);return r.__proto__=c.prototype,r}(t,e,r):"string"==typeof t?function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!c.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|p(t,e),n=o(r),e=n.write(t,e);e!==r&&(n=n.slice(0,e));return n}(t,e):function(t){if(c.isBuffer(t)){var e=0|l(t.length),r=o(e);return 0===r.length?r:(t.copy(r,0,0,e),r)}if(t){if(ArrayBuffer.isView(t)||"length"in t)return"number"!=typeof t.length||M(t.length)?o(0):h(t);if("Buffer"===t.type&&Array.isArray(t.data))return h(t.data)}throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object.")}(t)}function a(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('"size" argument must not be negative')}function f(t){return a(t),o(t<0?0:0|l(t))}function h(t){for(var e=t.length<0?0:0|l(t.length),r=o(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t){if(n<=t)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+n.toString(16)+" bytes");return 0|t}function p(t,e){if(c.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||x(t))return t.byteLength;"string"!=typeof t&&(t=""+t);var r=t.length;if(0===r)return 0;for(var n=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":case void 0:return S(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return I(t).length;default:if(n)return S(t).length;e=(""+e).toLowerCase(),n=!0}}function y(t,e,r){var n,o,i,u=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t=t||"utf8";;)switch(t){case"hex":return function(t,e,r){var n=t.length;(!e||e<0)&&(e=0);(!r||r<0||n<r)&&(r=n);for(var o="",i=e;i<r;++i)o+=function(t){return t<16?"0"+t.toString(16):t.toString(16)}(t[i]);return o}(this,e,r);case"utf8":case"utf-8":return b(this,e,r);case"ascii":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}(this,e,r);case"latin1":case"binary":return function(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}(this,e,r);case"base64":return n=this,i=r,0===(o=e)&&i===n.length?s.fromByteArray(n):s.fromByteArray(n.slice(o,i));case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return function(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}(this,e,r);default:if(u)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),u=!0}}function d(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function g(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):2147483647<r?r=2147483647:r<-2147483648&&(r=-2147483648),M(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=c.from(e,n)),c.isBuffer(e))return 0===e.length?-1:m(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?(o?Uint8Array.prototype.indexOf:Uint8Array.prototype.lastIndexOf).call(t,e,r):m(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function m(t,e,r,n,o){var i=1,u=t.length,s=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;u/=i=2,s/=2,r/=2}function a(t,e){return 1===i?t[e]:t.readUInt16BE(e*i)}if(o)for(var f=-1,h=r;h<u;h++)if(a(t,h)===a(e,-1===f?0:h-f)){if(-1===f&&(f=h),h-f+1===s)return f*i}else-1!==f&&(h-=h-f),f=-1;else for(u<r+s&&(r=u-s),h=r;0<=h;h--){for(var c=!0,l=0;l<s;l++)if(a(t,h+l)!==a(e,l)){c=!1;break}if(c)return h}return-1}function w(t,e,r,n){return U(function(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function v(t,e,r,n){return U(function(t,e){for(var r,n,o=[],i=0;i<t.length&&!((e-=2)<0);++i)n=t.charCodeAt(i),r=n>>8,n=n%256,o.push(n),o.push(r);return o}(e,t.length-r),t,r,n)}function b(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,u,s,a,f=t[o],h=null,c=239<f?4:223<f?3:191<f?2:1;if(o+c<=r)switch(c){case 1:f<128&&(h=f);break;case 2:128==(192&(i=t[o+1]))&&127<(a=(31&f)<<6|63&i)&&(h=a);break;case 3:i=t[o+1],u=t[o+2],128==(192&i)&&128==(192&u)&&2047<(a=(15&f)<<12|(63&i)<<6|63&u)&&(a<55296||57343<a)&&(h=a);break;case 4:i=t[o+1],u=t[o+2],s=t[o+3],128==(192&i)&&128==(192&u)&&128==(192&s)&&65535<(a=(15&f)<<18|(63&i)<<12|(63&u)<<6|63&s)&&a<1114112&&(h=a)}null===h?(h=65533,c=1):65535<h&&(h-=65536,n.push(h>>>10&1023|55296),h=56320|1023&h),n.push(h),o+=c}return function(t){var e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);var r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=E));return r}(n)}r.kMaxLength=n,(c.TYPED_ARRAY_SUPPORT=function(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(t){return!1}}())||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(c.prototype,"parent",{get:function(){if(this instanceof c)return this.buffer}}),Object.defineProperty(c.prototype,"offset",{get:function(){if(this instanceof c)return this.byteOffset}}),"undefined"!=typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),c.poolSize=8192,c.from=u,c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,c.alloc=function(t,e,r){return e=e,r=r,a(t=t),!(t<=0)&&void 0!==e?"string"==typeof r?o(t).fill(e,r):o(t).fill(e):o(t)},c.allocUnsafe=f,c.allocUnsafeSlow=f,c.isBuffer=function(t){return null!=t&&!0===t._isBuffer},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},c.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},c.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return c.alloc(0);if(void 0===e)for(o=e=0;o<t.length;++o)e+=t[o].length;for(var r=c.allocUnsafe(e),n=0,o=0;o<t.length;++o){var i=t[o];if(ArrayBuffer.isView(i)&&(i=c.from(i)),!c.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(r,n),n+=i.length}return r},c.byteLength=p,c.prototype._isBuffer=!0,c.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)d(this,e,e+1);return this},c.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)d(this,e,e+3),d(this,e+1,e+2);return this},c.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)d(this,e,e+7),d(this,e+1,e+6),d(this,e+2,e+5),d(this,e+3,e+4);return this},c.prototype.toLocaleString=c.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?b(this,0,t):y.apply(this,arguments)},c.prototype.equals=function(t){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===c.compare(this,t)},c.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return 0<this.length&&(t=this.toString("hex",0,e).match(/.{2}/g).join(" "),this.length>e&&(t+=" ... ")),"<Buffer "+t+">"},c.prototype.compare=function(t,e,r,n,o){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(o<=n&&r<=e)return 0;if(o<=n)return-1;if(r<=e)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),u=(r>>>=0)-(e>>>=0),s=Math.min(i,u),a=this.slice(n,o),f=t.slice(e,r),h=0;h<s;++h)if(a[h]!==f[h]){i=a[h],u=f[h];break}return i<u?-1:u<i?1:0},c.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},c.prototype.indexOf=function(t,e,r){return g(this,t,e,r,!0)},c.prototype.lastIndexOf=function(t,e,r){return g(this,t,e,r,!1)},c.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||o<r)&&(r=o),0<t.length&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n=n||"utf8";for(var i,u,s,a=!1;;)switch(n){case"hex":return function(t,e,r,n){r=Number(r)||0;var o=t.length-r;(!n||o<(n=Number(n)))&&(n=o),(o=e.length)/2<n&&(n=o/2);for(var i=0;i<n;++i){var u=parseInt(e.substr(2*i,2),16);if(M(u))return i;t[r+i]=u}return i}(this,t,e,r);case"utf8":case"utf-8":return u=e,s=r,U(S(t,(i=this).length-u),i,u,s);case"ascii":return w(this,t,e,r);case"latin1":case"binary":return w(this,t,e,r);case"base64":return i=this,u=e,s=r,U(I(t),i,u,s);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return v(this,t,e,r);default:if(a)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),a=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var E=4096;function A(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(r<t+e)throw new RangeError("Trying to access beyond buffer length")}function _(t,e,r,n,o,i){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(o<e||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function B(t,e,r,n){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function C(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,4),i.write(t,e,r,n,23,4),r+4}function T(t,e,r,n,o){return e=+e,r>>>=0,o||B(t,0,r,8),i.write(t,e,r,n,52,8),r+8}c.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):r<t&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):r<e&&(e=r),e<t&&(e=t);e=this.subarray(t,e);return e.__proto__=c.prototype,e},c.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},c.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t+--e],o=1;0<e&&(o*=256);)n+=this[t+--e]*o;return n},c.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return(o*=128)<=n&&(n-=Math.pow(2,8*e)),n},c.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);for(var n=e,o=1,i=this[t+--n];0<n&&(o*=256);)i+=this[t+--n]*o;return(o*=128)<=i&&(i-=Math.pow(2,8*e)),i},c.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);t=this[t]|this[t+1]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);t=this[t+1]|this[t]<<8;return 32768&t?4294901760|t:t},c.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),i.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),i.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||_(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},c.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||_(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;0<=--o&&(i*=256);)this[e+o]=t/i&255;return e+r},c.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,255,0),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},c.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeIntLE=function(t,e,r,n){t=+t,e>>>=0,n||_(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=0,i=1,u=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===u&&0!==this[e+o-1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},c.prototype.writeIntBE=function(t,e,r,n){t=+t,e>>>=0,n||_(this,t,e,r,(n=Math.pow(2,8*r-1))-1,-n);var o=r-1,i=1,u=0;for(this[e+o]=255&t;0<=--o&&(i*=256);)t<0&&0===u&&0!==this[e+o+1]&&(u=1),this[e+o]=(t/i>>0)-u&255;return e+r},c.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},c.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},c.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},c.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||_(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},c.prototype.writeFloatLE=function(t,e,r){return C(this,t,e,!0,r)},c.prototype.writeFloatBE=function(t,e,r){return C(this,t,e,!1,r)},c.prototype.writeDoubleLE=function(t,e,r){return T(this,t,e,!0,r)},c.prototype.writeDoubleBE=function(t,e,r){return T(this,t,e,!1,r)},c.prototype.copy=function(t,e,r,n){if(!c.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r=r||0,n||0===n||(n=this.length),e>=t.length&&(e=t.length),e=e||0,0<n&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;0<=i;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},c.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!c.isEncoding(n))throw new TypeError("Unknown encoding: "+n);var o;1===t.length&&(o=t.charCodeAt(0),("utf8"===n&&o<128||"latin1"===n)&&(t=o))}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,"number"==typeof(t=t||0))for(i=e;i<r;++i)this[i]=t;else{var u=c.isBuffer(t)?t:new c(t,n),s=u.length;if(0===s)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=u[i%s]}return this};var k=/[^+/0-9A-Za-z-_]/g;function S(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],u=0;u<n;++u){if(55295<(r=t.charCodeAt(u))&&r<57344){if(!o){if(56319<r){-1<(e-=3)&&i.push(239,191,189);continue}if(u+1===n){-1<(e-=3)&&i.push(239,191,189);continue}o=r;continue}if(r<56320){-1<(e-=3)&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&-1<(e-=3)&&i.push(239,191,189);if(o=null,r<128){if(--e<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function I(t){return s.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(k,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function U(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function x(t){return t instanceof ArrayBuffer||null!=t&&null!=t.constructor&&"ArrayBuffer"===t.constructor.name&&"number"==typeof t.byteLength}function M(t){return t!=t}},{"base64-js":2,ieee754:4}],4:[function(t,e,r){r.read=function(t,e,r,n,o){var i,u,s=8*o-n-1,a=(1<<s)-1,f=a>>1,h=-7,c=r?o-1:0,l=r?-1:1,r=t[e+c];for(c+=l,i=r&(1<<-h)-1,r>>=-h,h+=s;0<h;i=256*i+t[e+c],c+=l,h-=8);for(u=i&(1<<-h)-1,i>>=-h,h+=n;0<h;u=256*u+t[e+c],c+=l,h-=8);if(0===i)i=1-f;else{if(i===a)return u?NaN:1/0*(r?-1:1);u+=Math.pow(2,n),i-=f}return(r?-1:1)*u*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var u,s,a=8*i-o-1,f=(1<<a)-1,h=f>>1,c=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,l=n?0:i-1,p=n?1:-1,i=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,u=f):(u=Math.floor(Math.log(e)/Math.LN2),e*(n=Math.pow(2,-u))<1&&(u--,n*=2),2<=(e+=1<=u+h?c/n:c*Math.pow(2,1-h))*n&&(u++,n/=2),f<=u+h?(s=0,u=f):1<=u+h?(s=(e*n-1)*Math.pow(2,o),u+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,o),u=0));8<=o;t[r+l]=255&s,l+=p,s/=256,o-=8);for(u=u<<o|s,a+=o;0<a;t[r+l]=255&u,l+=p,u/=256,a-=8);t[r+l-p]|=128*i}},{}],5:[function(t,e,r){var n,o,e=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(t){n=i}try{o="function"==typeof clearTimeout?clearTimeout:u}catch(t){o=u}}();var a,f=[],h=!1,c=-1;function l(){h&&a&&(h=!1,a.length?f=a.concat(f):c=-1,f.length&&p())}function p(){if(!h){var t=s(l);h=!0;for(var e=f.length;e;){for(a=f,f=[];++c<e;)a&&a[c].run();c=-1,e=f.length}a=null,h=!1,function(e){if(o===clearTimeout)return clearTimeout(e);if((o===u||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(e);try{o(e)}catch(t){try{return o.call(null,e)}catch(t){return o.call(this,e)}}}(t)}}function y(t,e){this.fun=t,this.array=e}function d(){}e.nextTick=function(t){var e=new Array(arguments.length-1);if(1<arguments.length)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];f.push(new y(t,e)),1!==f.length||h||s(p)},y.prototype.run=function(){this.fun.apply(null,this.array)},e.title="browser",e.browser=!0,e.env={},e.argv=[],e.version="",e.versions={},e.on=d,e.addListener=d,e.once=d,e.off=d,e.removeListener=d,e.removeAllListeners=d,e.emit=d,e.prependListener=d,e.prependOnceListener=d,e.listeners=function(t){return[]},e.binding=function(t){throw new Error("process.binding is not supported")},e.cwd=function(){return"/"},e.chdir=function(t){throw new Error("process.chdir is not supported")},e.umask=function(){return 0}},{}]},{},[1])(1)});
//# sourceMappingURL=jsforce-api-metadata.min.js.map