UNPKG

jsforce2

Version:

Salesforce API Library for JavaScript

3 lines (2 loc) 2.31 kB
!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={})).Apex=e()}(function(){return function o(r,i,u){function f(t,e){if(!i[t]){if(!r[t]){var n="function"==typeof require&&require;if(!e&&n)return n(t,!0);if(s)return s(t,!0);throw(n=new Error("Cannot find module '"+t+"'")).code="MODULE_NOT_FOUND",n}n=i[t]={exports:{}},r[t][0].call(n.exports,function(e){return f(r[t][1][e]||e)},n,n.exports,o,r,i,u)}return i[t].exports}for(var s="function"==typeof require&&require,e=0;e<u.length;e++)f(u[e]);return f}({1:[function(e,t,n){"use strict";function o(e){this._conn=e}var r=window.jsforce.require("./core");o.prototype._baseUrl=function(){return this._conn.instanceUrl+"/services/apexrest"},o.prototype._createRequestParams=function(e,t,n,o){var r={method:e,url:this._baseUrl()+t},t={};return o&&"object"==typeof o.headers&&(t=o.headers),/^(GET|DELETE)$/i.test(e)||(t["Content-Type"]="application/json"),r.headers=t,n&&(t=r.headers["Content-Type"],r.body=t&&"application/json"!==t?n:JSON.stringify(n)),r},o.prototype.get=function(e,t,n){return"function"==typeof t&&(n=t,t=void 0),this._conn.request(this._createRequestParams("GET",e,void 0,t)).thenCall(n)},o.prototype.post=function(e,t,n,o){"function"==typeof t&&(o=t,n=t=void 0),"function"==typeof n&&(o=n,n=void 0);n=this._createRequestParams("POST",e,t,n);return this._conn.request(n).thenCall(o)},o.prototype.put=function(e,t,n,o){"function"==typeof t&&(o=t,n=t=void 0),"function"==typeof n&&(o=n,n=void 0);n=this._createRequestParams("PUT",e,t,n);return this._conn.request(n).thenCall(o)},o.prototype.patch=function(e,t,n,o){"function"==typeof t&&(o=t,n=t=void 0),"function"==typeof n&&(o=n,n=void 0);n=this._createRequestParams("PATCH",e,t,n);return this._conn.request(n).thenCall(o)},o.prototype.del=o.prototype.delete=function(e,t,n){return"function"==typeof t&&(n=t,t=void 0),this._conn.request(this._createRequestParams("DELETE",e,void 0,t)).thenCall(n)},r.on("connection:new",function(e){e.apex=new o(e)}),t.exports=o},{}]},{},[1])(1)}); //# sourceMappingURL=jsforce-api-apex.min.js.map