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