From 04100cd5cebf0cef7d481fcd88da2a6078d74662 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 16 May 2017 23:46:36 +0100 Subject: [PATCH] Added more methods --- types/jsforce/index.d.ts | 18 +++++++++++++++++- types/jsforce/jsforce-tests.ts | 8 ++++++++ 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 67d0fcdda2..36858776d0 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -20,7 +20,8 @@ declare namespace jsforce { class SObject { record(options: any, callback?: (err: Error, ret: any) => void): void; update(options: SObjectCreateOptions, callback?: (err: Error, ret: any) => void): void; - retrieve(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; + retrieve(ids: string | string[], callback?: (err: Error, ret: any) => void): void; + retrieve(ids: string | string[], options?: Object, callback?: (err: Error, ret: any) => void): void; // upsert(options: SObjectOptions): void; describeGlobal(callback: (err: Error, res: any) => void): void; describe$(callback: (err: Error, ret: DescribeSObjectResult) => void): void; @@ -44,9 +45,20 @@ declare namespace jsforce { destroy(ids: string | string[], callback?: (err: Error, ret: any) => void): void; delete(ids: string | string[], callback?: (err: Error, ret: any) => void): void; deleteBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; + destroyBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; + destroyHardBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; deleted(start: Date | string, end: Date | string, callback?: (info: DeletedRecordsInfo) => void): Promise; deleteHardBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; describe(callback?: (err: Error, ret: DescribeSObjectResult) => void): Promise; + insert(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; + insertBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; + layouts(layoutName?: string, callback?: (err: Error, info: LayoutInfo) => void): Promise; + listview(id: string): ListView; + listviews(callback?: (err: Error, info: ListViewsInfo) => void): Promise; + quickAction(actionName: string): QuickAction; + quickActions(callback?: (err: Error, info: any) => void): Promise; + recent(callback?: (err: Error, ret: RecordResult) => void): Promise; + select(field?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; } interface ConnectionOptions { @@ -159,6 +171,10 @@ declare namespace jsforce { interface Batch { } interface CompactLayoutInfo { } interface DeletedRecordsInfo { } + interface LayoutInfo { } + interface ListView { } + interface ListViewsInfo { } + interface QuickAction { } } export = jsforce; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index cf25cd4a6b..bd9738bee9 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -30,6 +30,14 @@ salesforceConnection.sobject("ContentVersion").create({ } }); +salesforceConnection.sobject("ContentVersion").retrieve("world", { + test: "test" +}, (err, ret: sf.RecordResult) => { + if (err || !ret.success) { + return; + } +}); + salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { });