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