UNPKG

jsforce

Version:

Salesforce API Library for JavaScript

3 lines 1.98 kB
/*! jsforce - v1.3.0 - 2014-09-15 */ !function(a){if("object"==typeof exports&&"undefined"!=typeof module)module.exports=a();else if("function"==typeof define&&define.amd)define([],a);else{var b;"undefined"!=typeof window?b=window:"undefined"!=typeof global?b=global:"undefined"!=typeof self&&(b=self);var c=b;c=c.jsforce||(c.jsforce={}),c=c.modules||(c.modules={}),c=c.api||(c.api={}),c.Apex=a()}}(function(){return function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);var j=new Error("Cannot find module '"+g+"'");throw j.code="MODULE_NOT_FOUND",j}var k=c[g]={exports:{}};b[g][0].call(k.exports,function(a){var c=b[g][1][a];return e(c?c:a)},k,k.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({1:[function(a,b){var c=function(a){this._conn=a};c.prototype._baseUrl=function(){return this._conn.instanceUrl+"/services/apexrest"},c.prototype._createRequestParams=function(a,b,c){var d={method:a,url:this._baseUrl()+b};return/^(GET|DELETE)$/i.test(a)||(d.headers={"Content-Type":"application/json"}),c&&(d.body=JSON.stringify(c)),d},c.prototype.get=function(a,b){return this._conn._request(this._createRequestParams("GET",a)).thenCall(b)},c.prototype.post=function(a,b,c){"function"==typeof b&&(c=b,b=void 0);var d=this._createRequestParams("POST",a,b);return this._conn._request(d).thenCall(c)},c.prototype.put=function(a,b,c){"function"==typeof b&&(c=b,b=void 0);var d=this._createRequestParams("PUT",a,b);return this._conn._request(d).thenCall(c)},c.prototype.patch=function(a,b,c){"function"==typeof b&&(c=b,b=void 0);var d=this._createRequestParams("PATCH",a,b);return this._conn._request(d).thenCall(c)},c.prototype.del=c.prototype["delete"]=function(a,b){return this._conn._request(this._createRequestParams("DELETE",a)).thenCall(b)},b.exports=c},{}]},{},[1])(1)}); //# sourceMappingURL=jsforce-api-apex.min.js.map