jsforce2 1.11.1 → 5.2.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of jsforce2 might be problematic. Click here for more details.

Files changed (80) hide show
  1. package/index.js +46 -1
  2. package/package.json +7 -105
  3. package/LICENSE +0 -22
  4. package/README.md +0 -74
  5. package/bin/jsforce +0 -3
  6. package/bower.json +0 -30
  7. package/build/jsforce-api-analytics.js +0 -393
  8. package/build/jsforce-api-analytics.min.js +0 -2
  9. package/build/jsforce-api-analytics.min.js.map +0 -1
  10. package/build/jsforce-api-apex.js +0 -183
  11. package/build/jsforce-api-apex.min.js +0 -2
  12. package/build/jsforce-api-apex.min.js.map +0 -1
  13. package/build/jsforce-api-bulk.js +0 -1054
  14. package/build/jsforce-api-bulk.min.js +0 -2
  15. package/build/jsforce-api-bulk.min.js.map +0 -1
  16. package/build/jsforce-api-chatter.js +0 -320
  17. package/build/jsforce-api-chatter.min.js +0 -2
  18. package/build/jsforce-api-chatter.min.js.map +0 -1
  19. package/build/jsforce-api-metadata.js +0 -3020
  20. package/build/jsforce-api-metadata.min.js +0 -2
  21. package/build/jsforce-api-metadata.min.js.map +0 -1
  22. package/build/jsforce-api-soap.js +0 -403
  23. package/build/jsforce-api-soap.min.js +0 -2
  24. package/build/jsforce-api-soap.min.js.map +0 -1
  25. package/build/jsforce-api-streaming.js +0 -3479
  26. package/build/jsforce-api-streaming.min.js +0 -2
  27. package/build/jsforce-api-streaming.min.js.map +0 -1
  28. package/build/jsforce-api-tooling.js +0 -319
  29. package/build/jsforce-api-tooling.min.js +0 -2
  30. package/build/jsforce-api-tooling.min.js.map +0 -1
  31. package/build/jsforce-core.js +0 -25250
  32. package/build/jsforce-core.min.js +0 -2
  33. package/build/jsforce-core.min.js.map +0 -1
  34. package/build/jsforce.js +0 -31637
  35. package/build/jsforce.min.js +0 -2
  36. package/build/jsforce.min.js.map +0 -1
  37. package/core.js +0 -1
  38. package/lib/VERSION.js +0 -2
  39. package/lib/_required.js +0 -29
  40. package/lib/api/analytics.js +0 -387
  41. package/lib/api/apex.js +0 -177
  42. package/lib/api/bulk.js +0 -862
  43. package/lib/api/chatter.js +0 -314
  44. package/lib/api/index.js +0 -8
  45. package/lib/api/metadata.js +0 -848
  46. package/lib/api/soap.js +0 -397
  47. package/lib/api/streaming-extension.js +0 -136
  48. package/lib/api/streaming.js +0 -270
  49. package/lib/api/tooling.js +0 -313
  50. package/lib/browser/canvas.js +0 -90
  51. package/lib/browser/client.js +0 -241
  52. package/lib/browser/core.js +0 -5
  53. package/lib/browser/jsforce.js +0 -6
  54. package/lib/browser/jsonp.js +0 -52
  55. package/lib/browser/request.js +0 -70
  56. package/lib/cache.js +0 -252
  57. package/lib/cli/cli.js +0 -431
  58. package/lib/cli/repl.js +0 -337
  59. package/lib/connection.js +0 -1881
  60. package/lib/core.js +0 -16
  61. package/lib/csv.js +0 -50
  62. package/lib/date.js +0 -163
  63. package/lib/http-api.js +0 -300
  64. package/lib/jsforce.js +0 -10
  65. package/lib/logger.js +0 -52
  66. package/lib/oauth2.js +0 -206
  67. package/lib/process.js +0 -275
  68. package/lib/promise.js +0 -164
  69. package/lib/query.js +0 -881
  70. package/lib/quick-action.js +0 -90
  71. package/lib/record-stream.js +0 -305
  72. package/lib/record.js +0 -107
  73. package/lib/registry/file-registry.js +0 -48
  74. package/lib/registry/index.js +0 -3
  75. package/lib/registry/registry.js +0 -111
  76. package/lib/require.js +0 -14
  77. package/lib/soap.js +0 -207
  78. package/lib/sobject.js +0 -558
  79. package/lib/soql-builder.js +0 -236
  80. package/lib/transport.js +0 -233
package/lib/sobject.js DELETED
@@ -1,558 +0,0 @@
1
- /**
2
- * @file Represents Salesforce SObject
3
- * @author Shinichi Tomita <shinichi.tomita@gmail.com>
4
- */
5
-
6
- 'use strict';
7
-
8
- var _ = require('lodash/core'),
9
- Record = require('./record'),
10
- Query = require('./query'),
11
- Cache = require('./cache'),
12
- QuickAction = require('./quick-action');
13
-
14
- /**
15
- * A class for organizing all SObject access
16
- *
17
- * @constructor
18
- */
19
- var SObject = module.exports = function(conn, type) {
20
- this._conn = conn;
21
- this.type = type;
22
- var cacheOptions = { key: "describe." + this.type };
23
- this.describe$ = conn.cache.makeCacheable(this.describe, this, cacheOptions);
24
- this.describe = conn.cache.makeResponseCacheable(this.describe, this, cacheOptions);
25
-
26
- cacheOptions = { key: "layouts." + this.type };
27
- this.layouts$ = conn.cache.makeCacheable(this.layouts, this, cacheOptions);
28
- this.layouts = conn.cache.makeResponseCacheable(this.layouts, this, cacheOptions);
29
-
30
- cacheOptions = { key: "compactLayouts." + this.type };
31
- this.compactLayouts$ = conn.cache.makeCacheable(this.compactLayouts, this, cacheOptions);
32
- this.compactLayouts = conn.cache.makeResponseCacheable(this.compactLayouts, this, cacheOptions);
33
-
34
- cacheOptions = { key: "approvalLayouts." + this.type };
35
- this.approvalLayouts$ = conn.cache.makeCacheable(this.approvalLayouts, this, cacheOptions);
36
- this.approvalLayouts = conn.cache.makeResponseCacheable(this.approvalLayouts, this, cacheOptions);
37
- };
38
-
39
- /**
40
- * Synonym of SObject#create()
41
- *
42
- * @method SObject#insert
43
- * @param {Record|Array.<Record>} records - A record or array of records to create
44
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
45
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
46
- */
47
- /**
48
- * Create records
49
- *
50
- * @method SObject#create
51
- * @param {Record|Array.<Record>} records - A record or array of records to create
52
- * @param {Object} [options] - Options for rest api.
53
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
54
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
55
- */
56
- SObject.prototype.insert =
57
- SObject.prototype.create = function(records, options, callback) {
58
- if (typeof options === 'function') {
59
- callback = options;
60
- options = {};
61
- }
62
- return this._conn.create(this.type, records, options, callback);
63
- };
64
-
65
- /**
66
- * Retrieve specified records
67
- *
68
- * @param {String|Array.<String>} ids - A record ID or array of record IDs
69
- * @param {Object} [options] - Options for rest api.
70
- * @param {Callback.<Record|Array.<Record>>} [callback] - Callback function
71
- * @returns {Promise.<Record|Array.<Record>>}
72
- */
73
- SObject.prototype.retrieve = function(ids, options, callback) {
74
- if (typeof options === 'function') {
75
- callback = options;
76
- options = {};
77
- }
78
- return this._conn.retrieve(this.type, ids, options, callback);
79
- };
80
-
81
- /**
82
- * Update records
83
- *
84
- * @param {Record|Array.<Record>} records - A record or array of records to update
85
- * @param {Object} [options] - Options for rest api.
86
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
87
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
88
- */
89
- SObject.prototype.update = function(records, options, callback) {
90
- if (typeof options === 'function') {
91
- callback = options;
92
- options = {};
93
- }
94
- return this._conn.update(this.type, records, options, callback);
95
- };
96
-
97
- /**
98
- * Upsert records
99
- *
100
- * @param {Record|Array.<Record>} records - Record or array of records to upsert
101
- * @param {String} extIdField - External ID field name
102
- * @param {Object} [options] - Options for rest api.
103
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback
104
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
105
- */
106
- SObject.prototype.upsert = function(records, extIdField, options, callback) {
107
- if (typeof options === 'function') {
108
- callback = options;
109
- options = {};
110
- }
111
- return this._conn.upsert(this.type, records, extIdField, options, callback);
112
- };
113
-
114
- /**
115
- * Synonym of SObject#destroy()
116
- *
117
- * @method SObject#delete
118
- * @param {String|Array.<String>} ids - A ID or array of IDs to delete
119
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
120
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
121
- */
122
- /**
123
- * Synonym of SObject#destroy()
124
- *
125
- * @method SObject#del
126
- * @param {String|Array.<String>} ids - A ID or array of IDs to delete
127
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
128
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
129
- */
130
- /**
131
- * Delete records
132
- *
133
- * @method SObject#destroy
134
- * @param {String|Array.<String>} ids - A ID or array of IDs to delete
135
- * @param {Object} [options] - Options for rest api.
136
- * @param {Callback.<RecordResult|Array.<RecordResult>>} [callback] - Callback function
137
- * @returns {Promise.<RecordResult|Array.<RecordResult>>}
138
- */
139
- SObject.prototype["delete"] =
140
- SObject.prototype.del =
141
- SObject.prototype.destroy = function(ids, options, callback) {
142
- if (typeof options === 'function') {
143
- callback = options;
144
- options = {};
145
- }
146
- return this._conn.destroy(this.type, ids, options, callback);
147
- };
148
-
149
- /**
150
- * Describe SObject metadata
151
- *
152
- * @param {Callback.<DescribeSObjectResult>} [callback] - Callback function
153
- * @returns {Promise.<DescribeSObjectResult>}
154
- */
155
- SObject.prototype.describe = function(callback) {
156
- return this._conn.describe(this.type, callback);
157
- };
158
-
159
- /**
160
- * Get record representation instance by given id
161
- *
162
- * @param {String} id - A record ID
163
- * @returns {RecordReference}
164
- */
165
- SObject.prototype.record = function(id) {
166
- return new Record(this._conn, this.type, id);
167
- };
168
-
169
- /**
170
- * Find and fetch records which matches given conditions
171
- *
172
- * @param {Object|String} [conditions] - Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
173
- * @param {Object|Array.<String>|String} [fields] - Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
174
- * @param {Object} [options] - Query options.
175
- * @param {Number} [options.limit] - Maximum number of records the query will return.
176
- * @param {Number} [options.offset] - Offset number where begins returning results.
177
- * @param {Number} [options.skip] - Synonym of options.offset.
178
- * @param {Callback.<Array.<Record>>} [callback] - Callback function
179
- * @returns {Query.<Array.<Record>>}
180
- */
181
- SObject.prototype.find = function(conditions, fields, options, callback) {
182
- if (typeof conditions === 'function') {
183
- callback = conditions;
184
- conditions = {};
185
- fields = null;
186
- options = null;
187
- } else if (typeof fields === 'function') {
188
- callback = fields;
189
- fields = null;
190
- options = null;
191
- } else if (typeof options === 'function') {
192
- callback = options;
193
- options = null;
194
- }
195
- options = options || {};
196
- var config = {
197
- fields: fields,
198
- includes: options.includes,
199
- table: this.type,
200
- conditions: conditions,
201
- limit: options.limit,
202
- sort: options.sort,
203
- offset: options.offset || options.skip
204
- };
205
- var query = new Query(this._conn, config, options);
206
- query.setResponseTarget(Query.ResponseTargets.Records);
207
- if (callback) { query.run(callback); }
208
- return query;
209
- };
210
-
211
- /**
212
- * Fetch one record which matches given conditions
213
- *
214
- * @param {Object|String} [conditions] - Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
215
- * @param {Object|Array.<String>|String} [fields] - Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
216
- * @param {Object} [options] - Query options.
217
- * @param {Number} [options.limit] - Maximum number of records the query will return.
218
- * @param {Number} [options.offset] - Offset number where begins returning results.
219
- * @param {Number} [options.skip] - Synonym of options.offset.
220
- * @param {Callback.<Record>} [callback] - Callback function
221
- * @returns {Query.<Record>}
222
- */
223
- SObject.prototype.findOne = function(conditions, fields, options, callback) {
224
- if (typeof conditions === 'function') {
225
- callback = conditions;
226
- conditions = {};
227
- fields = null;
228
- options = null;
229
- } else if (typeof fields === 'function') {
230
- callback = fields;
231
- fields = null;
232
- options = null;
233
- } else if (typeof options === 'function') {
234
- callback = options;
235
- options = null;
236
- }
237
- options = _.extend(options || {}, { limit: 1 });
238
- var query = this.find(conditions, fields, options);
239
- query.setResponseTarget(Query.ResponseTargets.SingleRecord);
240
- if (callback) { query.run(callback); }
241
- return query;
242
- };
243
-
244
- /**
245
- * Find and fetch records only by specifying fields to fetch.
246
- *
247
- * @param {Object|Array.<String>|String} [fields] - Fields to fetch. Format can be in JSON object (MongoDB-like), array of field names, or comma-separated field names.
248
- * @param {Callback.<Array.<Record>>} [callback] - Callback function
249
- * @returns {Query.<Array.<Record>>}
250
- */
251
- SObject.prototype.select = function(fields, callback) {
252
- return this.find(null, fields, null, callback);
253
- };
254
-
255
- /**
256
- * Count num of records which matches given conditions
257
- *
258
- * @param {Object|String} [conditions] - Conditions in JSON object (MongoDB-like), or raw SOQL WHERE clause string.
259
- * @param {Callback.<Number>} [callback] - Callback function
260
- * @returns {Query.<Number>}
261
- */
262
- SObject.prototype.count = function(conditions, callback) {
263
- if (typeof conditions === 'function') {
264
- callback = conditions;
265
- conditions = {};
266
- }
267
- var query = this.find(conditions, { "count()" : true });
268
- query.setResponseTarget("Count");
269
- if (callback) { query.run(callback); }
270
- return query;
271
- };
272
-
273
-
274
- /**
275
- * Call Bulk#load() to execute bulkload, returning batch object
276
- *
277
- * @param {String} operation - Bulk load operation ('insert', 'update', 'upsert', 'delete', or 'hardDelete')
278
- * @param {Object} [options] - Options for bulk loading operation
279
- * @param {String} [options.extIdField] - External ID field name (used when upsert operation).
280
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulkload. Accepts array of records, CSv string, and CSV data input stream.
281
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
282
- * @returns {Bulk~Batch}
283
- */
284
- SObject.prototype.bulkload = function(operation, options, input, callback) {
285
- return this._conn.bulk.load(this.type, operation, options, input, callback);
286
- };
287
-
288
- /**
289
- * Synonym of SObject#createBulk()
290
- *
291
- * @method SObject#insertBulk
292
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream.
293
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
294
- * @returns {Bulk~Batch}
295
- */
296
- /**
297
- * Bulkly insert input data using bulk API
298
- *
299
- * @method SObject#createBulk
300
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk insert. Accepts array of records, CSv string, and CSV data input stream.
301
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
302
- * @returns {Bulk~Batch}
303
- */
304
- SObject.prototype.insertBulk =
305
- SObject.prototype.createBulk = function(input, callback) {
306
- return this.bulkload("insert", input, callback);
307
- };
308
-
309
- /**
310
- * Bulkly update records by input data using bulk API
311
- *
312
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk update Accepts array of records, CSv string, and CSV data input stream.
313
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
314
- * @returns {Bulk~Batch}
315
- */
316
- SObject.prototype.updateBulk = function(input, callback) {
317
- return this.bulkload("update", input, callback);
318
- };
319
-
320
- /**
321
- * Bulkly upsert records by input data using bulk API
322
- *
323
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk upsert. Accepts array of records, CSv string, and CSV data input stream.
324
- * @param {String} [options.extIdField] - External ID field name
325
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
326
- * @returns {Bulk~Batch}
327
- */
328
- SObject.prototype.upsertBulk = function(input, extIdField, callback) {
329
- return this.bulkload("upsert", { extIdField: extIdField }, input, callback);
330
- };
331
-
332
- /**
333
- * Synonym of SObject#destroyBulk()
334
- *
335
- * @method SObject#deleteBulk
336
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
337
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
338
- * @returns {Bulk~Batch}
339
- */
340
- /**
341
- * Bulkly delete records specified by input data using bulk API
342
- *
343
- * @method SObject#destroyBulk
344
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
345
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
346
- * @returns {Bulk~Batch}
347
- */
348
- SObject.prototype.deleteBulk =
349
- SObject.prototype.destroyBulk = function(input, callback) {
350
- return this.bulkload("delete", input, callback);
351
- };
352
-
353
- /**
354
- * Synonym of SObject#destroyHardBulk()
355
- *
356
- * @method SObject#deleteHardBulk
357
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
358
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
359
- * @returns {Bulk~Batch}
360
- */
361
- /**
362
- * Bulkly hard delete records specified in input data using bulk API
363
- *
364
- * @method SObject#destroyHardBulk
365
- * @param {Array.<Record>|stream.Stream|String} [input] - Input source for bulk delete. Accepts array of records, CSv string, and CSV data input stream.
366
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
367
- * @returns {Bulk~Batch}
368
- */
369
- SObject.prototype.deleteHardBulk =
370
- SObject.prototype.destroyHardBulk = function(input, callback) {
371
- return this.bulkload("hardDelete", input, callback);
372
- };
373
-
374
- /**
375
- * Retrieve recently accessed records
376
- *
377
- * @param {Callback.<Array.<RecordResult>>} [callback] - Callback function
378
- * @returns {Promise.<Array.<RecordResult>>}
379
- */
380
- SObject.prototype.recent = function (callback) {
381
- return this._conn.recent(this.type, callback);
382
- };
383
-
384
- /**
385
- * Retrieve the updated records
386
- *
387
- * @param {String|Date} start - start date or string representing the start of the interval
388
- * @param {String|Date} end - start date or string representing the end of the interval, must be > start
389
- * @param {Callback.<UpdatedRecordsInfo>} [callback] - Callback function
390
- * @returns {Promise.<UpdatedRecordsInfo>}
391
- */
392
- SObject.prototype.updated = function (start, end, callback) {
393
- return this._conn.updated(this.type, start, end, callback);
394
- };
395
-
396
- /**
397
- * Retrieve the deleted records
398
- *
399
- * @param {String|Date} start - start date or string representing the start of the interval
400
- * @param {String|Date} end - start date or string representing the end of the interval, must be > start
401
- * @param {Callback.<DeletedRecordsInfo>} [callback] - Callback function
402
- * @returns {Promise.<DeletedRecordsInfo>}
403
- */
404
- SObject.prototype.deleted = function (start, end, callback) {
405
- return this._conn.deleted(this.type, start, end, callback);
406
- };
407
-
408
- /**
409
- * @typedef {Object} LayoutInfo
410
- * @prop {Array.<Object>} layouts - Array of layouts
411
- * @prop {Array.<Object>} recordTypeMappings - Array of record type mappings
412
- */
413
- /**
414
- * Describe layout information for SObject
415
- *
416
- * @param {String} [layoutName] - Name of named layout. (e.g. UserAlt in User SObject)
417
- * @param {Callback.<LayoutInfo>} [callback] - Callback function
418
- * @returns {Promise.<LayoutInfo>}
419
- */
420
- SObject.prototype.layouts = function(layoutName, callback) {
421
- if (typeof layoutName === 'function') {
422
- callback = layoutName;
423
- layoutName = null;
424
- }
425
- var url = "/sobjects/" + this.type + "/describe/" + (layoutName ? "namedLayouts/"+layoutName : "layouts");
426
- return this._conn.request(url, callback);
427
- };
428
-
429
- /**
430
- * @typedef {Object} CompactLayoutInfo
431
- * @prop {Array.<Object>} compactLayouts - Array of compact layouts
432
- * @prop {String} defaultCompactLayoutId - ID of default compact layout
433
- * @prop {Array.<Object>} recordTypeCompactLayoutMappings - Array of record type mappings
434
- */
435
- /**
436
- * Describe compact layout information defined for SObject
437
- *
438
- * @param {Callback.<CompactLayoutInfo>} [callback] - Callback function
439
- * @returns {Promise.<CompactLayoutInfo>}
440
- */
441
- SObject.prototype.compactLayouts = function(callback) {
442
- var url = "/sobjects/" + this.type + "/describe/compactLayouts";
443
- return this._conn.request(url, callback);
444
- };
445
-
446
-
447
- /**
448
- * @typedef {Object} ApprovalLayoutInfo
449
- * @prop {Array.<Object>} approvalLayouts - Array of approval layouts
450
- */
451
- /**
452
- * Describe compact layout information defined for SObject
453
- *
454
- * @param {Callback.<ApprovalLayoutInfo>} [callback] - Callback function
455
- * @returns {Promise.<ApprovalLayoutInfo>}
456
- */
457
- SObject.prototype.approvalLayouts = function(callback) {
458
- var url = "/sobjects/" + this.type + "/describe/approvalLayouts";
459
- return this._conn.request(url, callback);
460
- };
461
-
462
- /**
463
- * Returns the list of list views for the SObject
464
- *
465
- * @param {Callback.<ListViewsInfo>} [callback] - Callback function
466
- * @returns {Promise.<ListViewsInfo>}
467
- */
468
- SObject.prototype.listviews = function(callback) {
469
- var url = this._conn._baseUrl() + '/sobjects/' + this.type + '/listviews';
470
- return this._conn.request(url, callback);
471
- };
472
-
473
- /**
474
- * Returns the list view info in specifed view id
475
- *
476
- * @param {String} id - List view ID
477
- * @returns {ListView}
478
- */
479
- SObject.prototype.listview = function(id) {
480
- return new ListView(this._conn, this.type, id);
481
- };
482
-
483
- /**
484
- * Returns all registered quick actions for the SObject
485
- *
486
- * @param {Callback.<Array.<QuickAction~QuickActionInfo>>} [callback] - Callback function
487
- * @returns {Promise.<Array.<QuickAction~QuickActionInfo>>}
488
- */
489
- SObject.prototype.quickActions = function(callback) {
490
- return this._conn.request("/sobjects/" + this.type + "/quickActions").thenCall(callback);
491
- };
492
-
493
- /**
494
- * Get reference for specified quick aciton in the SObject
495
- *
496
- * @param {String} actionName - Name of the quick action
497
- * @returns {QuickAction}
498
- */
499
- SObject.prototype.quickAction = function(actionName) {
500
- return new QuickAction(this._conn, "/sobjects/" + this.type + "/quickActions/" + actionName);
501
- };
502
-
503
-
504
- /**
505
- * A class for organizing list view information
506
- *
507
- * @protected
508
- * @class ListView
509
- * @param {Connection} conn - Connection instance
510
- * @param {SObject} type - SObject type
511
- * @param {String} id - List view ID
512
- */
513
- var ListView = function(conn, type, id) {
514
- this._conn = conn;
515
- this.type = type;
516
- this.id = id;
517
- };
518
-
519
- /**
520
- * Executes query for the list view and returns the resulting data and presentation information.
521
- *
522
- * @param {Callback.<ListViewResultInfo>} [callback] - Callback function
523
- * @returns {Promise.<ListViewResultInfo>}
524
- */
525
- ListView.prototype.results = function(callback) {
526
- var url = this._conn._baseUrl() + '/sobjects/' + this.type + '/listviews/' + this.id + '/results';
527
- return this._conn.request(url, callback);
528
- };
529
-
530
-
531
- /**
532
- * Returns detailed information about a list view
533
- *
534
- * @param {Object} [options] - Identity call options
535
- * @param {Object} [options.headers] - Additional HTTP request headers sent in identity request
536
- * @param {Callback.<ListViewDescribeInfo>} [callback] - Callback function
537
- * @returns {Promise.<ListViewDescribeInfo>}
538
- */
539
- ListView.prototype.describe = function(options, callback) {
540
- if (typeof options === 'function') {
541
- callback = options;
542
- options = {};
543
- }
544
- options = options || {};
545
- var url = this._conn._baseUrl() + '/sobjects/' + this.type + '/listviews/' + this.id + '/describe';
546
- return this._conn.request({ method: 'GET', url: url, headers: options.headers }, callback);
547
- };
548
-
549
- /**
550
- * Explain plan for executing list view
551
- *
552
- * @param {Callback.<ExplainInfo>} [callback] - Callback function
553
- * @returns {Promise.<ExplainInfo>}
554
- */
555
- ListView.prototype.explain = function(callback) {
556
- var url = "/query/?explain=" + this.id;
557
- return this._conn.request(url, callback);
558
- };