@jsforce/jsforce-node 0.0.1 → 3.0.0-next.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.
Files changed (127) hide show
  1. package/LICENSE +22 -0
  2. package/README.md +54 -0
  3. package/index.d.ts +4 -0
  4. package/index.js +1 -0
  5. package/lib/VERSION.d.ts +2 -0
  6. package/lib/VERSION.js +3 -0
  7. package/lib/api/analytics/types.d.ts +509 -0
  8. package/lib/api/analytics/types.js +2 -0
  9. package/lib/api/analytics.d.ts +163 -0
  10. package/lib/api/analytics.js +342 -0
  11. package/lib/api/apex.d.ts +44 -0
  12. package/lib/api/apex.js +86 -0
  13. package/lib/api/bulk.d.ts +444 -0
  14. package/lib/api/bulk.js +1372 -0
  15. package/lib/api/chatter.d.ts +133 -0
  16. package/lib/api/chatter.js +248 -0
  17. package/lib/api/metadata/schema.d.ts +16117 -0
  18. package/lib/api/metadata/schema.js +9094 -0
  19. package/lib/api/metadata.d.ts +189 -0
  20. package/lib/api/metadata.js +406 -0
  21. package/lib/api/soap/schema.d.ts +3167 -0
  22. package/lib/api/soap/schema.js +1787 -0
  23. package/lib/api/soap.d.ts +76 -0
  24. package/lib/api/soap.js +155 -0
  25. package/lib/api/streaming/extension.d.ts +94 -0
  26. package/lib/api/streaming/extension.js +151 -0
  27. package/lib/api/streaming.d.ts +160 -0
  28. package/lib/api/streaming.js +252 -0
  29. package/lib/api/tooling.d.ts +284 -0
  30. package/lib/api/tooling.js +202 -0
  31. package/lib/api/wsdl/wsdl2schema.d.ts +1 -0
  32. package/lib/api/wsdl/wsdl2schema.js +354 -0
  33. package/lib/browser/canvas.d.ts +12 -0
  34. package/lib/browser/canvas.js +77 -0
  35. package/lib/browser/client.d.ts +82 -0
  36. package/lib/browser/client.js +244 -0
  37. package/lib/browser/jsonp.d.ts +12 -0
  38. package/lib/browser/jsonp.js +69 -0
  39. package/lib/browser/registry.d.ts +3 -0
  40. package/lib/browser/registry.js +5 -0
  41. package/lib/browser/request.d.ts +10 -0
  42. package/lib/browser/request.js +202 -0
  43. package/lib/cache.d.ts +74 -0
  44. package/lib/cache.js +159 -0
  45. package/lib/connection.d.ts +355 -0
  46. package/lib/connection.js +1153 -0
  47. package/lib/core.d.ts +17 -0
  48. package/lib/core.js +55 -0
  49. package/lib/csv.d.ts +23 -0
  50. package/lib/csv.js +35 -0
  51. package/lib/date.d.ts +82 -0
  52. package/lib/date.js +201 -0
  53. package/lib/http-api.d.ts +75 -0
  54. package/lib/http-api.js +257 -0
  55. package/lib/index.d.ts +12 -0
  56. package/lib/index.js +31 -0
  57. package/lib/jsforce.d.ts +26 -0
  58. package/lib/jsforce.js +67 -0
  59. package/lib/jwtOAuth2.d.ts +8 -0
  60. package/lib/jwtOAuth2.js +23 -0
  61. package/lib/oauth2.d.ts +92 -0
  62. package/lib/oauth2.js +245 -0
  63. package/lib/process.d.ts +157 -0
  64. package/lib/process.js +143 -0
  65. package/lib/query.d.ts +341 -0
  66. package/lib/query.js +817 -0
  67. package/lib/quick-action.d.ts +44 -0
  68. package/lib/quick-action.js +46 -0
  69. package/lib/record-reference.d.ts +46 -0
  70. package/lib/record-reference.js +65 -0
  71. package/lib/record-stream.d.ts +83 -0
  72. package/lib/record-stream.js +233 -0
  73. package/lib/registry/base.d.ts +43 -0
  74. package/lib/registry/base.js +96 -0
  75. package/lib/registry/empty.d.ts +7 -0
  76. package/lib/registry/empty.js +13 -0
  77. package/lib/registry/file.d.ts +11 -0
  78. package/lib/registry/file.js +51 -0
  79. package/lib/registry/index.d.ts +8 -0
  80. package/lib/registry/index.js +21 -0
  81. package/lib/registry/sfdx.d.ts +56 -0
  82. package/lib/registry/sfdx.js +133 -0
  83. package/lib/registry/types.d.ts +47 -0
  84. package/lib/registry/types.js +2 -0
  85. package/lib/request-helper.d.ts +23 -0
  86. package/lib/request-helper.js +102 -0
  87. package/lib/request.d.ts +11 -0
  88. package/lib/request.js +75 -0
  89. package/lib/session-refresh-delegate.d.ts +31 -0
  90. package/lib/session-refresh-delegate.js +69 -0
  91. package/lib/soap.d.ts +60 -0
  92. package/lib/soap.js +246 -0
  93. package/lib/sobject.d.ts +258 -0
  94. package/lib/sobject.js +376 -0
  95. package/lib/soql-builder.d.ts +25 -0
  96. package/lib/soql-builder.js +226 -0
  97. package/lib/transport.d.ts +63 -0
  98. package/lib/transport.js +175 -0
  99. package/lib/types/common.d.ts +560 -0
  100. package/lib/types/common.js +2 -0
  101. package/lib/types/index.d.ts +7 -0
  102. package/lib/types/index.js +23 -0
  103. package/lib/types/projection.d.ts +26 -0
  104. package/lib/types/projection.js +2 -0
  105. package/lib/types/record.d.ts +44 -0
  106. package/lib/types/record.js +2 -0
  107. package/lib/types/schema.d.ts +50 -0
  108. package/lib/types/schema.js +2 -0
  109. package/lib/types/soap.d.ts +43 -0
  110. package/lib/types/soap.js +2 -0
  111. package/lib/types/standard-schema.d.ts +16199 -0
  112. package/lib/types/standard-schema.js +2 -0
  113. package/lib/types/util.d.ts +7 -0
  114. package/lib/types/util.js +2 -0
  115. package/lib/util/formatter.d.ts +8 -0
  116. package/lib/util/formatter.js +24 -0
  117. package/lib/util/function.d.ts +32 -0
  118. package/lib/util/function.js +52 -0
  119. package/lib/util/logger.d.ts +29 -0
  120. package/lib/util/logger.js +102 -0
  121. package/lib/util/promise.d.ts +19 -0
  122. package/lib/util/promise.js +25 -0
  123. package/lib/util/stream.d.ts +12 -0
  124. package/lib/util/stream.js +88 -0
  125. package/package.json +260 -6
  126. package/typings/faye/index.d.ts +16 -0
  127. package/typings/index.d.ts +1 -0
@@ -0,0 +1,560 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
3
+ /// <reference types="node" />
4
+ import { Optional } from './util';
5
+ import { URLSearchParams } from 'url';
6
+ import * as FormData from 'form-data';
7
+ /**
8
+ * type defs
9
+ */
10
+ export type Callback<T, T2 = undefined> = (err: Error | null | undefined, ret?: T, ret2?: T2) => any;
11
+ export type HttpBody = Buffer | URLSearchParams | NodeJS.ReadableStream | string | FormData | null;
12
+ export type HttpMethods = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS';
13
+ export type HttpRequest = {
14
+ url: string;
15
+ method: HttpMethods;
16
+ headers?: {
17
+ [name: string]: string;
18
+ };
19
+ body?: HttpBody;
20
+ };
21
+ export type HttpRequestOptions = {
22
+ httpProxy?: string;
23
+ timeout?: number;
24
+ followRedirect?: boolean | ((redirectUrl: string) => HttpRequest | null);
25
+ encoding?: BufferEncoding;
26
+ };
27
+ export type HttpResponse = {
28
+ statusCode: number;
29
+ headers: {
30
+ [name: string]: string;
31
+ };
32
+ body: string;
33
+ };
34
+ export type Record = {
35
+ [field: string]: any;
36
+ Id?: string;
37
+ attributes?: {
38
+ type: string;
39
+ url: string;
40
+ [prop: string]: any;
41
+ };
42
+ };
43
+ export type SavedRecord = Record & {
44
+ Id: string;
45
+ };
46
+ export type SaveError = {
47
+ errorCode: string;
48
+ message: string;
49
+ fields?: string[];
50
+ };
51
+ export type SaveResult = {
52
+ success: true;
53
+ id: string;
54
+ errors: never[];
55
+ } | {
56
+ success: false;
57
+ id?: undefined;
58
+ errors: SaveError[];
59
+ };
60
+ export type UpsertResult = {
61
+ success: true;
62
+ id: string;
63
+ created: boolean;
64
+ errors: never[];
65
+ } | {
66
+ success: false;
67
+ id?: undefined;
68
+ created?: undefined;
69
+ errors: SaveError[];
70
+ };
71
+ export type SearchResult = {
72
+ searchRecords: Record[];
73
+ };
74
+ export type RetrieveOptions = {
75
+ allOrNone?: boolean;
76
+ fields?: string[];
77
+ headers?: {
78
+ [name: string]: string;
79
+ };
80
+ };
81
+ export type DmlOptions = {
82
+ allOrNone?: boolean;
83
+ allowRecursive?: boolean;
84
+ headers?: {
85
+ [name: string]: string;
86
+ };
87
+ multipartFileFields?: {
88
+ [fieldName: string]: MultipartFileFieldOptions;
89
+ };
90
+ };
91
+ export type MultipartFileFieldOptions = {
92
+ filename?: string;
93
+ contentType: string;
94
+ };
95
+ export type SignedRequestObject = {
96
+ client: {
97
+ oauthToken: string;
98
+ };
99
+ };
100
+ export type Field = {
101
+ aggregatable: boolean;
102
+ autoNumber: boolean;
103
+ byteLength: number;
104
+ calculated: boolean;
105
+ calculatedFormula: Optional<string>;
106
+ cascadeDelete: boolean;
107
+ caseSensitive: boolean;
108
+ compoundFieldName: Optional<string>;
109
+ controllerName: Optional<string>;
110
+ createable: boolean;
111
+ custom: boolean;
112
+ defaultValue: Optional<string>;
113
+ defaultValueFormula: Optional<string>;
114
+ defaultedOnCreate: boolean;
115
+ dependentPicklist: boolean;
116
+ deprecatedAndHidden: boolean;
117
+ digits: number;
118
+ displayLocationInDecimal: boolean;
119
+ encrypted: boolean;
120
+ externalId: boolean;
121
+ extraTypeInfo: Optional<string>;
122
+ filterable: boolean;
123
+ filteredLookupInfo: object;
124
+ groupable: boolean;
125
+ highScaleNumber: boolean;
126
+ htmlFormatted: boolean;
127
+ idLookup: boolean;
128
+ inlineHelpText: Optional<string>;
129
+ label: string;
130
+ length: number;
131
+ mask: Optional<string>;
132
+ maskType: Optional<string>;
133
+ name: string;
134
+ nameField: boolean;
135
+ namePointing: boolean;
136
+ nillable: boolean;
137
+ permissionable: boolean;
138
+ picklistValues: Optional<any[]>;
139
+ precision: number;
140
+ queryByDistance: boolean;
141
+ referenceTargetField: object;
142
+ referenceTo: Optional<string[]>;
143
+ relationshipName: Optional<string>;
144
+ relationshipOrder: Optional<number>;
145
+ restrictedDelete: boolean;
146
+ restrictedPicklist: boolean;
147
+ scale: number;
148
+ soapType: string;
149
+ sortable: boolean;
150
+ type: string;
151
+ unique: boolean;
152
+ updateable: boolean;
153
+ writeRequiresMasterRead: boolean;
154
+ };
155
+ type ActionOverride = {
156
+ formFactor: string;
157
+ isAvailableInTouch: boolean;
158
+ name: string;
159
+ pageId: string;
160
+ url: Optional<string>;
161
+ };
162
+ type ChildRelationship = {
163
+ cascadeDelete: boolean;
164
+ childSObject: string;
165
+ deprecatedAndHidden: boolean;
166
+ field: string;
167
+ junctionIdListNames: string[];
168
+ junctionReferenceTo: string[];
169
+ relationshipName: Optional<string>;
170
+ restrictedDelete: boolean;
171
+ };
172
+ type NamedLayoutInfo = {
173
+ name: string;
174
+ urls: {
175
+ [key: string]: string;
176
+ };
177
+ };
178
+ type RecordTypeInfo = {
179
+ available: boolean;
180
+ defaultRecordTypeMapping: boolean;
181
+ master: boolean;
182
+ name: string;
183
+ recordTypeId: string;
184
+ urls: {
185
+ [key: string]: string;
186
+ };
187
+ };
188
+ type ScopeInfo = {
189
+ label: string;
190
+ name: string;
191
+ };
192
+ type DescribeGlobalSObjectResult = {
193
+ activateable: boolean;
194
+ createable: boolean;
195
+ custom: boolean;
196
+ customSetting: boolean;
197
+ deepCloneable: boolean;
198
+ deletable: boolean;
199
+ deprecatedAndHidden: boolean;
200
+ feedEnabled: boolean;
201
+ hasSubtypes: boolean;
202
+ idEnabled: boolean;
203
+ isInterface: boolean;
204
+ isSubtype: boolean;
205
+ keyPrefix: Optional<string>;
206
+ label: string;
207
+ labelPlural: string;
208
+ layoutable: boolean;
209
+ mergeable: boolean;
210
+ mruEnabled: boolean;
211
+ name: string;
212
+ queryable: boolean;
213
+ replicateable: boolean;
214
+ retrieveable: boolean;
215
+ searchable: boolean;
216
+ triggerable: boolean;
217
+ undeletable: boolean;
218
+ updateable: boolean;
219
+ urls: {
220
+ [key: string]: string;
221
+ };
222
+ };
223
+ export type DescribeSObjectResult = DescribeGlobalSObjectResult & {
224
+ actionOverrides: ActionOverride[];
225
+ childRelationships: ChildRelationship[];
226
+ compactLayoutable: boolean;
227
+ fields: Field[];
228
+ listviewable: boolean;
229
+ lookupLayoutable: boolean;
230
+ namedLayoutInfos: NamedLayoutInfo[];
231
+ networkScopeFieldName: Optional<string>;
232
+ recordTypeInfos: RecordTypeInfo[];
233
+ searchLayoutable: boolean;
234
+ supportedScopes: Optional<ScopeInfo[]>;
235
+ };
236
+ export type DescribeGlobalResult = {
237
+ encoding: string;
238
+ maxBatchSize: number;
239
+ sobjects: DescribeGlobalSObjectResult[];
240
+ };
241
+ type DescribeColor = {
242
+ color: string;
243
+ context: string;
244
+ theme: string;
245
+ };
246
+ type DescribeIcon = {
247
+ contentType: string;
248
+ height: Optional<number>;
249
+ theme: string;
250
+ url: string;
251
+ width: Optional<number>;
252
+ };
253
+ type WebLinkPosition = 'fullScreen' | 'none' | 'topLeft';
254
+ type WebLinkType = 'javascript' | 'page' | 'sControl' | 'url';
255
+ type WebLinkWindowType = 'newWindow' | 'noSidebar' | 'onClickJavaScript' | 'replace' | 'sidebar';
256
+ type DescribeLayoutButton = {
257
+ behavior: Optional<WebLinkWindowType>;
258
+ colors: Optional<DescribeColor[]>;
259
+ content: Optional<string>;
260
+ contentSource: Optional<WebLinkType>;
261
+ custom: boolean;
262
+ encoding: Optional<string>;
263
+ height: Optional<number>;
264
+ icons: Optional<DescribeIcon[]>;
265
+ label: string;
266
+ menubar: boolean;
267
+ name: string;
268
+ overridden: boolean;
269
+ resizeable: boolean;
270
+ scrollbars: boolean;
271
+ showsLocation: boolean;
272
+ showsStatus: boolean;
273
+ toolbar: boolean;
274
+ url: Optional<string>;
275
+ width: Optional<number>;
276
+ windowPosition: Optional<WebLinkPosition>;
277
+ };
278
+ type DescribeLayoutButtonSection = {
279
+ detailButtons: DescribeLayoutButton[];
280
+ };
281
+ type LayoutComponentType = 'AnalyticsCloud' | 'Canvas' | 'CustomLink' | 'EmptySpace' | 'ExpandedLookup' | 'Field' | 'ReportChart' | 'SControl' | 'Separator' | 'VisualforcePage';
282
+ type DescribeLayoutComponent = {
283
+ details?: any;
284
+ displayLines: number;
285
+ tabOrder: number;
286
+ type: LayoutComponentType;
287
+ value: Optional<string>;
288
+ };
289
+ type DescribeLayoutItem = {
290
+ editableForNew: boolean;
291
+ editableForUpdate: boolean;
292
+ label: string;
293
+ layoutComponents: DescribeLayoutComponent[];
294
+ placeholder: boolean;
295
+ required: boolean;
296
+ };
297
+ type DescribeLayoutRow = {
298
+ layoutItems: DescribeLayoutItem[];
299
+ numItems: number;
300
+ };
301
+ type DescribeLayoutSection = {
302
+ columns: number;
303
+ heading: string;
304
+ layoutRows: DescribeLayoutRow[];
305
+ parentLayoutId: string;
306
+ rows: number;
307
+ tabOrder: 'LeftToRight' | 'TopToBottom';
308
+ useCollapsibleSection: boolean;
309
+ useHeading: boolean;
310
+ };
311
+ type DescribeQuickActionListItemResult = {
312
+ colors: Optional<DescribeColor[]>;
313
+ iconUrl: Optional<string>;
314
+ icons: Optional<DescribeIcon[]>;
315
+ label: string;
316
+ miniIconUrl: Optional<string>;
317
+ quickActionName: string;
318
+ targetSobjectType: Optional<string>;
319
+ type: 'Create' | 'VisualforcePage';
320
+ };
321
+ type DescribeQuickActionListResult = {
322
+ quickActionListItems: DescribeQuickActionListItemResult[];
323
+ };
324
+ type DescribeRelatedContentItem = {
325
+ describeLayoutItem: DescribeLayoutItem;
326
+ };
327
+ type RelatedContent = {
328
+ relatedContentItems: DescribeRelatedContentItem[];
329
+ };
330
+ type RelatedListColumn = {
331
+ field: Optional<string>;
332
+ fieldApiName: string;
333
+ format: Optional<string>;
334
+ label: string;
335
+ lookupId: Optional<string>;
336
+ name: string;
337
+ sortable: boolean;
338
+ };
339
+ type RelatedListSort = {
340
+ column: string;
341
+ ascending: boolean;
342
+ };
343
+ type RelatedList = {
344
+ accessLevelRequiredForCreate: Optional<string>;
345
+ buttons: DescribeLayoutButton[];
346
+ columns: RelatedListColumn[];
347
+ custom: boolean;
348
+ field: Optional<string>;
349
+ label: string;
350
+ limitRows: number;
351
+ name: string;
352
+ sobject: Optional<string>;
353
+ sort: RelatedListSort[];
354
+ };
355
+ type DescribeLayoutSaveOption = {
356
+ defaultValue: boolean;
357
+ isDisplayed: boolean;
358
+ label: string;
359
+ name: string;
360
+ restHeaderName: string;
361
+ soapHeaderName: string;
362
+ };
363
+ type DescribeLayout = {
364
+ buttonLayoutSection: Optional<DescribeLayoutButtonSection>;
365
+ detailLayoutSections: DescribeLayoutSection[];
366
+ editLayoutSections: DescribeLayoutSection[];
367
+ feedView: Optional<DescribeLayoutFeedView>;
368
+ highlightsPanelLayoutSection: Optional<DescribeLayoutSection>;
369
+ multirowEditLayoutSections: DescribeLayoutSection[];
370
+ id: string;
371
+ quickActionList: DescribeQuickActionListResult;
372
+ relatedContent: RelatedContent;
373
+ relatedLists: RelatedList[];
374
+ saveOptions: DescribeLayoutSaveOption[];
375
+ };
376
+ type DescribeLayoutFeedFilter = {
377
+ label: string;
378
+ name: string;
379
+ type: 'AllUpdates' | 'FeedItemType';
380
+ };
381
+ type DescribeLayoutFeedView = {
382
+ feedFilters: DescribeLayoutFeedFilter[];
383
+ };
384
+ type RecordTypeMapping = any;
385
+ export type DescribeLayoutResult = {
386
+ layouts: DescribeLayout[];
387
+ recordTypeMappings: RecordTypeMapping[];
388
+ recordTypeSelectorRequired: boolean[];
389
+ };
390
+ export type DescribeCompactLayout = {
391
+ actions: DescribeLayoutButton[];
392
+ fieldItems: DescribeLayoutItem[];
393
+ id: Optional<string>;
394
+ imageItems: DescribeLayoutItem[];
395
+ label: string;
396
+ name: string;
397
+ objectType: string;
398
+ };
399
+ type RecordTypeCompactLayoutMapping = {
400
+ available: boolean;
401
+ compactLayoutId: Optional<string>;
402
+ compactLayoutName: string;
403
+ recordTypeId: string;
404
+ recordTypeName: string;
405
+ };
406
+ export type DescribeCompactLayoutsResult = {
407
+ compactLayouts: DescribeCompactLayout[];
408
+ defaultCompactLayoutId: Optional<string>;
409
+ recordTypeCompactLayoutMappings: RecordTypeCompactLayoutMapping[];
410
+ };
411
+ type DescribeApprovalLayout = {
412
+ id: string;
413
+ label: string;
414
+ layoutItems: DescribeLayoutItem[];
415
+ name: string;
416
+ };
417
+ export type DescribeApprovalLayoutsResult = {
418
+ approvalLayouts: DescribeApprovalLayout[];
419
+ };
420
+ export type DescribeTab = {
421
+ colors: DescribeColor[];
422
+ custom: boolean;
423
+ iconUrl: string;
424
+ icons: DescribeIcon[];
425
+ label: string;
426
+ miniIconUrl: string;
427
+ name: string;
428
+ sobjectName: Optional<string>;
429
+ url: string;
430
+ };
431
+ export type DescribeTheme = {
432
+ themeItems: Array<{
433
+ colors: Optional<DescribeColor[]>;
434
+ icons: Optional<DescribeIcon[]>;
435
+ name: string;
436
+ }>;
437
+ };
438
+ export type DescribeQuickActionResult = {
439
+ actionEnumOrId: string;
440
+ label: string;
441
+ name: string;
442
+ type: string;
443
+ urls: {
444
+ [key: string]: string;
445
+ };
446
+ };
447
+ type DescribeQuickActionDefaultValue = any;
448
+ type QuickActionLayout = {
449
+ collapsed: boolean;
450
+ columns: number;
451
+ heading: string | null;
452
+ layoutRows: any[];
453
+ layoutSectionId: string | null;
454
+ parentLayoutId: string | null;
455
+ rows: number;
456
+ tabOrder: string;
457
+ useCollapsibleSection: boolean;
458
+ useHeading: boolean;
459
+ };
460
+ export type DescribeQuickActionDetailResult = DescribeQuickActionResult & {
461
+ canvasApplicationId: string | null;
462
+ canvasApplicationName: string | null;
463
+ colors: DescribeColor[];
464
+ contextSobjectType: string | null;
465
+ defaultValues: DescribeQuickActionDefaultValue[];
466
+ flowDevName: string | null;
467
+ flowRecordIdVar: string | null;
468
+ height: number;
469
+ iconName: string | null;
470
+ iconUrl: string | null;
471
+ icons: DescribeIcon[];
472
+ layout: QuickActionLayout;
473
+ lightningComponentBundleId: string | null;
474
+ lightningComponentBundleName: string | null;
475
+ lightningComponentQualifiedName: string | null;
476
+ lightningWebComponentBundleId: string | null;
477
+ lightningWebComponentBundleName: string | null;
478
+ lightningWebComponentQualifiedName: string | null;
479
+ miniIconUrl: string;
480
+ mobileExtensionId: string | null;
481
+ showQuickActionLcHeader: boolean;
482
+ showQuickActionVfHeader: boolean;
483
+ targetParentField: string | null;
484
+ targetRecordTypeId: string | null;
485
+ targetSobjectType: string;
486
+ type: string;
487
+ visualforcePageName: string | null;
488
+ visualforcePageUrl: string | null;
489
+ width: number | null;
490
+ };
491
+ export type DeletedResult = {
492
+ deletedRecords: Array<{
493
+ id: string;
494
+ deletedDate: string;
495
+ }>;
496
+ earliestDateAvailable: string;
497
+ latestDateCovered: string;
498
+ };
499
+ export type UpdatedResult = {
500
+ ids: string[];
501
+ latestDateCovered: string;
502
+ };
503
+ export type OrganizationLimitsInfo = {
504
+ [key: string]: {
505
+ Max: number;
506
+ Remaining: number;
507
+ };
508
+ };
509
+ export type IdentityInfo = {
510
+ user_id: string;
511
+ organization_id: string;
512
+ id: string;
513
+ username: string;
514
+ display_name: string;
515
+ nick_name: string;
516
+ email: string;
517
+ photos: {
518
+ picture: string;
519
+ thumbnail: string;
520
+ };
521
+ urls: {
522
+ enterprise: string;
523
+ metadata: string;
524
+ partner: string;
525
+ rest: string;
526
+ sobjects: string;
527
+ search: string;
528
+ query: string;
529
+ profile: string;
530
+ };
531
+ user_type: string;
532
+ language: string;
533
+ };
534
+ export type UserInfo = {
535
+ id: string;
536
+ organizationId: string;
537
+ url: string;
538
+ };
539
+ export type LimitInfo = {
540
+ apiUsage?: {
541
+ used: number;
542
+ limit: number;
543
+ };
544
+ };
545
+ export type ProcessRule = {
546
+ actions: {
547
+ id: string;
548
+ name: string;
549
+ type: string;
550
+ };
551
+ description: string | null;
552
+ id: string;
553
+ name: string;
554
+ namespacePrefix: string | null;
555
+ object: string;
556
+ };
557
+ export type ProcessRules = {
558
+ [index: string]: ProcessRule;
559
+ };
560
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,7 @@
1
+ export * from './common';
2
+ export * from './schema';
3
+ export * from './projection';
4
+ export * from './record';
5
+ export * from './util';
6
+ export * from './soap';
7
+ export * from './standard-schema';
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./common"), exports);
18
+ __exportStar(require("./schema"), exports);
19
+ __exportStar(require("./projection"), exports);
20
+ __exportStar(require("./record"), exports);
21
+ __exportStar(require("./util"), exports);
22
+ __exportStar(require("./soap"), exports);
23
+ __exportStar(require("./standard-schema"), exports);
@@ -0,0 +1,26 @@
1
+ import { SObjectDefinition, Schema } from './schema';
2
+ import { StringKeys } from './util';
3
+ /**
4
+ *
5
+ */
6
+ type FieldPath_3<SO extends SObjectDefinition> = '*' | StringKeys<SO['Fields']>[];
7
+ type FieldPath_2<SO extends SObjectDefinition, PSOR extends SO['ParentReferences'] = SO['ParentReferences']> = '*' | StringKeys<SO['Fields']> | {
8
+ [K in StringKeys<PSOR>]?: '*' | FieldPath_3<Extract<PSOR[K], SObjectDefinition>>[];
9
+ };
10
+ type FieldPath_1<SO extends SObjectDefinition, PSOR extends SO['ParentReferences'] = SO['ParentReferences']> = '*' | StringKeys<SO['Fields']> | {
11
+ [K in StringKeys<PSOR>]?: '*' | FieldPath_2<Extract<PSOR[K], SObjectDefinition>>[];
12
+ };
13
+ type FieldPathSpecifier_<S extends Schema, N extends string, SO extends SObjectDefinition = S['SObjects'][N], PSOR extends SO['ParentReferences'] = SO['ParentReferences']> = '*' | StringKeys<SO['Fields']> | {
14
+ [K in StringKeys<PSOR>]?: '*' | FieldPath_1<Extract<PSOR[K], SObjectDefinition>>[];
15
+ };
16
+ export type FieldPathSpecifier<S extends Schema, N extends string> = FieldPathSpecifier_<S, N>;
17
+ export type FieldProjectionConfigObject = {
18
+ [name: string]: 1 | true | FieldProjectionConfig | undefined;
19
+ };
20
+ export type FieldProjectionConfig = string | null | FieldProjectionConfigObject;
21
+ export type FieldPathScopedProjection<S extends Schema, N extends string, FPS extends FieldPathSpecifier<S, N>> = FPS extends {
22
+ [name: string]: any;
23
+ } ? {
24
+ [K in StringKeys<FPS>]: FPS[K] extends '*' ? '*' : FPS[K] extends Array<infer U> ? U extends FieldProjectionConfig ? U : never : never;
25
+ } : FPS extends string ? FPS : never;
26
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,44 @@
1
+ import { Record } from './common';
2
+ import { Schema, SObjectDefinition, ParentReferenceNames, ParentReferenceSObjectName, SObjectNames } from './schema';
3
+ import { FieldProjectionConfig, FieldPathScopedProjection, FieldPathSpecifier, FieldProjectionConfigObject } from './projection';
4
+ import { StringKeys, PickIfMatch, ConditionalPartial, IsEqualType } from './util';
5
+ /**
6
+ *
7
+ */
8
+ type RecordWithFields<SO extends SObjectDefinition, IsPartial extends boolean = false> = Record & IsPartial extends true ? Partial<SO['Fields']> : SO['Fields'];
9
+ type RecordWithParentRefs<SO extends SObjectDefinition, IsPartial extends boolean = false, PSOR extends SObjectDefinition['ParentReferences'] = SO['ParentReferences']> = RecordWithFields<SO, IsPartial> & ConditionalPartial<{
10
+ [K in StringKeys<PSOR>]: RecordWithParentRefs<NonNullable<PSOR[K]>, IsPartial> | Extract<PSOR[K], null>;
11
+ }, IsPartial>;
12
+ type RecordWithChildRelations<SO extends SObjectDefinition, IsPartial extends boolean = false, CSOR extends SObjectDefinition['ChildRelationships'] = SO['ChildRelationships']> = RecordWithParentRefs<SO, IsPartial> & ConditionalPartial<{
13
+ [K in StringKeys<CSOR>]: ChildRelationObject<CSOR[K], IsPartial> | null;
14
+ }, IsPartial>;
15
+ type ChildRelationRecordSet<R extends Record> = {
16
+ totalSize: number;
17
+ done: boolean;
18
+ records: R[];
19
+ };
20
+ type ChildRelationObject<CO extends SObjectDefinition, IsPartial extends boolean = false> = ChildRelationRecordSet<RecordWithParentRefs<CO, IsPartial>>;
21
+ /**
22
+ *
23
+ */
24
+ type RecordFieldProjectionForAsterOrNull<S extends Schema, SO extends SObjectDefinition, FPCAN extends '*' | null> = FPCAN[] extends never[] ? {} : FPCAN extends '*' ? RecordWithFields<SO> : RecordWithChildRelations<SO, true>;
25
+ type RecordFieldProjectionForString<S extends Schema, SO extends SObjectDefinition, FPCS extends string> = FPCS[] extends never[] ? {} : PickIfMatch<RecordWithFields<SO>, FPCS>;
26
+ type RecordReferenceProjection<S extends Schema, SO extends SObjectDefinition, FPCO extends FieldProjectionConfigObject, FK extends StringKeys<FPCO>, PRN extends ParentReferenceNames<S, N>, N extends SObjectNames<S> = Extract<SObjectNames<S>, SO['Name']>, PN extends SObjectNames<S> = ParentReferenceSObjectName<S, N, PRN>, PSO extends SObjectDefinition | null = SO['ParentReferences'][PRN], FPCOFK extends FieldProjectionConfig = Extract<FPCO[FK], FieldProjectionConfig>> = RecordFieldProjection<S, PN, FPCOFK> | (null extends PSO ? null : never);
27
+ type RecordFieldProjectionForObjectConfig<S extends Schema, SO extends SObjectDefinition, FPCO extends FieldProjectionConfigObject> = FPCO[] extends never[] ? {} : {
28
+ [FK in StringKeys<FPCO>]: FK extends StringKeys<RecordWithFields<SO>> ? RecordWithFields<SO>[FK] : FK extends StringKeys<SO['ParentReferences']> ? RecordReferenceProjection<S, SO, FPCO, FK, FK> : never;
29
+ };
30
+ type RecordFieldProjection<S extends Schema, N extends string, FPC extends FieldProjectionConfig, SO extends SObjectDefinition = S['SObjects'][N], FPCALL extends FieldProjectionConfig = FieldPathScopedProjection<S, N, FieldPathSpecifier<S, N>>, FPCAN extends '*' | null = Extract<FPC, '*' | null>, FPCS extends string = Exclude<Extract<FPC, string>, '*'>, FPCO extends Exclude<FPC, string | null> = Exclude<FPC, string | null>> = FPCALL[] extends FPC[] ? RecordFieldProjectionForAsterOrNull<S, SO, null> : RecordFieldProjectionForAsterOrNull<S, SO, FPCAN> & RecordFieldProjectionForString<S, SO, FPCS> & RecordFieldProjectionForObjectConfig<S, SO, FPCO>;
31
+ type SObjectChildRelationshipRecord_<CRN extends string, CR extends Record> = {
32
+ [K in CRN]: ChildRelationRecordSet<CR> | null;
33
+ };
34
+ type IsUnionString_<T extends string, TOrig extends string> = T extends string ? IsEqualType<T, TOrig> extends true ? false : true : never;
35
+ type IsUnionString<T extends string> = IsUnionString_<T, T>;
36
+ export type SObjectChildRelationshipProp<CRN extends string, CR extends Record> = IsUnionString<CRN> extends true ? {} : SObjectChildRelationshipRecord_<CRN, CR>;
37
+ export type SObjectRecord<S extends Schema, N extends string, FPC extends FieldProjectionConfig = '*', R extends Record = Record, Option extends Partial<{
38
+ Extend: boolean;
39
+ }> = {}> = IsUnionString<N> extends true ? R : IsEqualType<R, Record> extends true ? RecordFieldProjection<S, N, FPC> & Record : Option['Extend'] extends true ? RecordFieldProjection<S, N, FPC> & Record & R : R;
40
+ export type SObjectInputRecord<S extends Schema, N extends string> = Partial<SObjectRecord<S, N>>;
41
+ export type SObjectUpdateRecord<S extends Schema, N extends string> = SObjectInputRecord<S, N> & {
42
+ Id: string;
43
+ };
44
+ export {};
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });