jsforce2
Version:
Salesforce API Library for JavaScript
3 lines (2 loc) • 3.21 kB
JavaScript
!function(e){var t;"object"==typeof exports&&"undefined"!=typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):(t=(t=(t=(t="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:this).jsforce||(t.jsforce={})).modules||(t.modules={})).api||(t.api={})).Tooling=e()}(function(){return function n(r,s,i){function c(t,e){if(!s[t]){if(!r[t]){var o="function"==typeof require&&require;if(!e&&o)return o(t,!0);if(u)return u(t,!0);throw(o=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",o}o=s[t]={exports:{}},r[t][0].call(o.exports,function(e){return c(r[t][1][e]||e)},o,o.exports,n,r,s,i)}return s[t].exports}for(var u="function"==typeof require&&require,e=0;e<i.length;e++)c(i[e]);return c}({1:[function(e,t,o){"use strict";function n(t){this._conn=t,this._logger=t._logger,["query","queryMore","_toRecordResult","create","_createSingle","_createParallel","_createMany","insert","retrieve","_retrieveSingle","_retrieveParallel","_retrieveMany","update","_updateSingle","_updateParallel","_updateMany","upsert","del","delete","destroy","_destroySingle","_destroyParallel","_destroyMany","describe","describeGlobal","sobject"].forEach(function(e){this[e]=t.constructor.prototype[e]},this),this.cache=new i;var e={key:function(e){return e?"describe."+e:"describe"}};this.describe$=this.cache.makeCacheable(this.describe,this,e),this.describe=this.cache.makeResponseCacheable(this.describe,this,e),this.describeSObject$=this.describe$,this.describeSObject=this.describe,e={key:"describeGlobal"},this.describeGlobal$=this.cache.makeCacheable(this.describeGlobal,this,e),this.describeGlobal=this.cache.makeResponseCacheable(this.describeGlobal,this,e),this.initialize()}var r=window.jsforce.require("./core"),s=window.jsforce.require("lodash/core"),i=window.jsforce.require("./cache");n.prototype.initialize=function(){this.sobjects={},this.cache.clear(),this.cache.get("describeGlobal").removeAllListeners("value"),this.cache.get("describeGlobal").on("value",s.bind(function(e){e.result&&s.map(e.result.sobjects,function(e){return e.name}).forEach(this.sobject,this)},this))},n.prototype._baseUrl=function(){return this._conn._baseUrl()+"/tooling"},n.prototype._supports=function(e){return"sobject-collection"!==e&&this._conn._supports.apply(this._conn,arguments)},n.prototype.request=function(){return this._conn.request.apply(this._conn,arguments)},n.prototype.executeAnonymous=function(e,t){e=this._baseUrl()+"/executeAnonymous?anonymousBody="+encodeURIComponent(e);return this.request(e).thenCall(t)},n.prototype.runTestsAsynchronous=function(e,t){var o=this._baseUrl()+"/runTestsAsynchronous/";return this._conn.requestPost(o,{classids:e.join(",")},void 0,t)},n.prototype.runTestsSynchronous=function(e,t){var o=this._baseUrl()+"/runTestsSynchronous/";return this._conn.requestPost(o,{classnames:e.join(",")},void 0,t)},n.prototype.completions=function(e,t){s.isString(e)||(t=e,e="apex");e=this._baseUrl()+"/completions?type="+encodeURIComponent(e);return this.request(e).thenCall(t)},r.on("connection:new",function(e){e.tooling=new n(e)}),t.exports=n},{}]},{},[1])(1)});
//# sourceMappingURL=jsforce-api-tooling.min.js.map