@@ -96,7 +96,7 @@ if (forcetk.Client === undefined) {
96
96
forcetk . Client . prototype . refreshAccessToken = function ( callback , error ) {
97
97
var that = this ;
98
98
var url = this . loginUrl + '/services/oauth2/token' ;
99
- $j . ajax ( {
99
+ return $j . ajax ( {
100
100
type : 'POST' ,
101
101
url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
102
102
cache : false ,
@@ -158,7 +158,7 @@ if (forcetk.Client === undefined) {
158
158
var that = this ;
159
159
var url = this . instanceUrl + '/services/data' + path ;
160
160
161
- $j . ajax ( {
161
+ return $j . ajax ( {
162
162
type : method || "GET" ,
163
163
async : this . asyncAjax ,
164
164
url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
@@ -265,7 +265,7 @@ if (forcetk.Client === undefined) {
265
265
var that = this ;
266
266
var url = this . instanceUrl + '/services/apexrest' + path ;
267
267
268
- $j . ajax ( {
268
+ return $j . ajax ( {
269
269
type : method || "GET" ,
270
270
async : this . asyncAjax ,
271
271
url : ( this . proxyUrl !== null ) ? this . proxyUrl : url ,
@@ -312,7 +312,7 @@ if (forcetk.Client === undefined) {
312
312
* @param [error=null] function to which jqXHR will be passed in case of error
313
313
*/
314
314
forcetk . Client . prototype . versions = function ( callback , error ) {
315
- this . ajax ( '/' , callback , error ) ;
315
+ return this . ajax ( '/' , callback , error ) ;
316
316
}
317
317
318
318
/*
@@ -322,7 +322,7 @@ if (forcetk.Client === undefined) {
322
322
* @param [error=null] function to which jqXHR will be passed in case of error
323
323
*/
324
324
forcetk . Client . prototype . resources = function ( callback , error ) {
325
- this . ajax ( '/' + this . apiVersion + '/' , callback , error ) ;
325
+ return this . ajax ( '/' + this . apiVersion + '/' , callback , error ) ;
326
326
}
327
327
328
328
/*
@@ -332,7 +332,7 @@ if (forcetk.Client === undefined) {
332
332
* @param [error=null] function to which jqXHR will be passed in case of error
333
333
*/
334
334
forcetk . Client . prototype . describeGlobal = function ( callback , error ) {
335
- this . ajax ( '/' + this . apiVersion + '/sobjects/' , callback , error ) ;
335
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' , callback , error ) ;
336
336
}
337
337
338
338
/*
@@ -342,7 +342,7 @@ if (forcetk.Client === undefined) {
342
342
* @param [error=null] function to which jqXHR will be passed in case of error
343
343
*/
344
344
forcetk . Client . prototype . metadata = function ( objtype , callback , error ) {
345
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
345
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
346
346
, callback , error ) ;
347
347
}
348
348
@@ -354,7 +354,7 @@ if (forcetk.Client === undefined) {
354
354
* @param [error=null] function to which jqXHR will be passed in case of error
355
355
*/
356
356
forcetk . Client . prototype . describe = function ( objtype , callback , error ) {
357
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype
357
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype
358
358
+ '/describe/' , callback , error ) ;
359
359
}
360
360
@@ -368,7 +368,7 @@ if (forcetk.Client === undefined) {
368
368
* @param [error=null] function to which jqXHR will be passed in case of error
369
369
*/
370
370
forcetk . Client . prototype . create = function ( objtype , fields , callback , error ) {
371
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
371
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/'
372
372
, callback , error , "POST" , JSON . stringify ( fields ) ) ;
373
373
}
374
374
@@ -405,7 +405,7 @@ if (forcetk.Client === undefined) {
405
405
* @param [error=null] function to which jqXHR will be passed in case of error
406
406
*/
407
407
forcetk . Client . prototype . upsert = function ( objtype , externalIdField , externalId , fields , callback , error ) {
408
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + externalIdField + '/' + externalId
408
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + externalIdField + '/' + externalId
409
409
+ '?_HttpMethod=PATCH' , callback , error , "POST" , JSON . stringify ( fields ) ) ;
410
410
}
411
411
@@ -420,7 +420,7 @@ if (forcetk.Client === undefined) {
420
420
* @param [error=null] function to which jqXHR will be passed in case of error
421
421
*/
422
422
forcetk . Client . prototype . update = function ( objtype , id , fields , callback , error ) {
423
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
423
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
424
424
+ '?_HttpMethod=PATCH' , callback , error , "POST" , JSON . stringify ( fields ) ) ;
425
425
}
426
426
@@ -433,7 +433,7 @@ if (forcetk.Client === undefined) {
433
433
* @param [error=null] function to which jqXHR will be passed in case of error
434
434
*/
435
435
forcetk . Client . prototype . del = function ( objtype , id , callback , error ) {
436
- this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
436
+ return this . ajax ( '/' + this . apiVersion + '/sobjects/' + objtype + '/' + id
437
437
, callback , error , "DELETE" ) ;
438
438
}
439
439
@@ -445,7 +445,7 @@ if (forcetk.Client === undefined) {
445
445
* @param [error=null] function to which jqXHR will be passed in case of error
446
446
*/
447
447
forcetk . Client . prototype . query = function ( soql , callback , error ) {
448
- this . ajax ( '/' + this . apiVersion + '/query?q=' + escape ( soql )
448
+ return this . ajax ( '/' + this . apiVersion + '/query?q=' + escape ( soql )
449
449
, callback , error ) ;
450
450
}
451
451
@@ -470,7 +470,7 @@ if (forcetk.Client === undefined) {
470
470
//-- leave alone
471
471
}
472
472
473
- this . ajax ( url , callback , error ) ;
473
+ return this . ajax ( url , callback , error ) ;
474
474
}
475
475
476
476
/*
@@ -481,7 +481,7 @@ if (forcetk.Client === undefined) {
481
481
* @param [error=null] function to which jqXHR will be passed in case of error
482
482
*/
483
483
forcetk . Client . prototype . search = function ( sosl , callback , error ) {
484
- this . ajax ( '/' + this . apiVersion + '/search?q=' + escape ( sosl )
484
+ return this . ajax ( '/' + this . apiVersion + '/search?q=' + escape ( sosl )
485
485
, callback , error ) ;
486
486
}
487
487
}
0 commit comments