From de601567dcf0bfaa6deb623cff99a974eb9f5af3 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 9 May 2017 18:09:04 +0100 Subject: [PATCH 1/6] initial commit --- types/jsforce/index.d.ts | 198 +++++++++++++++++++++++++++++++++ types/jsforce/jsforce-tests.ts | 1 + types/jsforce/tsconfig.json | 22 ++++ types/jsforce/tslint.json | 6 + 4 files changed, 227 insertions(+) create mode 100644 types/jsforce/index.d.ts create mode 100644 types/jsforce/jsforce-tests.ts create mode 100644 types/jsforce/tsconfig.json create mode 100644 types/jsforce/tslint.json diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts new file mode 100644 index 0000000000..4b7dedc2e4 --- /dev/null +++ b/types/jsforce/index.d.ts @@ -0,0 +1,198 @@ +// Type definitions for archiver 1.8 +// Project: https://github.com/jsforce/jsforce +// Definitions by: Dolan Miu +// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped + +import * as fs from 'fs'; +import * as stream from 'stream'; +import * as express from 'express'; +import * as glob from 'glob'; + +declare namespace jsforce { + type ConnectionEvent = "refresh"; + class Connection { + constructor(params: ConnectionOptions) + + sobject(resource: string): SObject; + on(eventName: ConnectionEvent, callback: Function): void; + } + + class SObject { + create(options: any, callback?: (err: Error, ret: RecordResult) => void): void; + 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; + del(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; + destroy(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; + delete(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; + // upsert(options: SObjectOptions): void; + describe(callback: (err: Error, ret: Meta) => void): void; + describeGlobal(callback: (err: Error, res: any) => void): void; + describe$(callback: (err: Error, ret: Meta) => void): void; + describeGlobal$(callback: (err: Error, res: any) => void): void; + + find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; + + findOne(query?: any, callback?: (err: Error, ret: T) => void): void; + findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): void; + findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): void; + } + + interface ConnectionOptions { + instanceUrl?: string; + accessToken?: string; + refreshToken?: string; + oauth2?: { + clientId: string, + clientSecret: string, + redirectUri?: string, + }; + sessionId?: string; + serverUrl?: string; + redirectUri?: string; + } + + interface SObjectOptions { + Id?: SalesforceId; + Name?: string; + ExtId__c?: string; + } + + class SalesforceId extends String { + } + + interface SObjectCreateOptions extends SObjectOptions { + IsDeleted?: boolean, + MasterRecordId?: SalesforceId, + Name?: string, + Type?: string, + ParentId?: SalesforceId, + BillingStreet?: string, + BillingCity?: string, + BillingState?: string, + BillingPostalCode?: string, + BillingCountry?: string, + BillingLatitude?: number, + BillingLongitude?: number, + ShippingStreet?: string, + ShippingCity?: string, + ShippingState?: string, + ShippingPostalCode?: string, + ShippingCountry?: string, + ShippingLatitude?: number, + ShippingLongitude?: number, + Phone?: string, + Website?: string, + Industry?: string, + NumberOfEmployees?: number, + Description?: string, + OwnerId?: SalesforceId, + CreatedDate?: Date, + CreatedById?: SalesforceId, + LastModifiedDate?: Date, + LastModifiedById?: SalesforceId, + SystemModstamp?: Date, + LastActivityDate?: Date, + LastViewedDate?: Date, + LastReferencedDate?: Date, + Jigsaw?: string; + JigsawCompanyId?: string; + AccountSource?: string; + SicDesc?: string; + } + + interface Meta { + label: string; + fields: string[]; + } + + enum Date { + YESTERDAY + } + + class Query { + filter(filter: Object): Query; + hint(hint: Object): Query; + limit(value: number): Query; + maxFetch(value: number): Query; + offset(value: number): Query; + skip(value: number): Query; + sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query; + run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + del(callback?: (err: Error, ret: RecordResult) => void): any; + delete(callback?: (err: Error, ret: RecordResult) => void): any; + destroy(callback?: (err: Error, ret: RecordResult) => void): Promise; + explain(callback?: (err: Error, info: ExplainInfo) => void): Promise; + scanAll(value: boolean): Query; + select(fields: Object | string[] | string): Query; + then(onSuccess?: Function, onRejected?: Function): Promise; + thenCall(callback?: (err: Error, records: T) => void): Query; + toSOQL(callback: (err: Error, soql: string) => void): Promise; + update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise; + where(conditions: Object | string): Query; + } + + interface ExecuteOptions { + autoFetch?: boolean; + maxFetch?: number; + scanAll?: number; + } + + interface RecordResult { id: SalesforceId, success: boolean, anys: Object[] } + interface ExplainInfo { } + + interface SalesforceContentVersionDocument { + attributes: + { + type: string, + url: string, + }; + Id: SalesforceId, + ContentDocumentId: SalesforceId, + IsLatest: boolean, + ContentUrl: string, + VersionNumber: string, + Title: string, + Description: string, + ReasonForChange: string, + SharingOption: string, + PathOnClient: string, + RatingCount: number, + IsDeleted: boolean, + ContentModifiedDate: Date, + ContentModifiedById: SalesforceId, + PositiveRatingCount: number, + NegativeRatingCount: number, + FeaturedContentBoost: Date, + FeaturedContentDate: Date, + OwnerId: SalesforceId, + CreatedById: SalesforceId, + CreatedDate: Date, + LastModifiedById: SalesforceId, + LastModifiedDate: Date, + SystemModstamp: Date, + TagCsv: string, + FileType: string, + PublishStatus: string, + VersionData: string, + ContentSize: number, + FileExtension: string, + FirstPublishLocationId: SalesforceId, + Origin: string, + ContentLocation: string, + TextPreview: string, + ExternalDocumentInfo1: string, + ExternalDocumentInfo2: string, + ExternalDataSourceId: string, + Checksum: string, + IsMajorVersion: boolean, + IsAssetEnabled: boolean, + User__c: string + } +} + +export = jsforce; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts new file mode 100644 index 0000000000..334116ee23 --- /dev/null +++ b/types/jsforce/jsforce-tests.ts @@ -0,0 +1 @@ +import * as jsforce from 'jsforce'; diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json new file mode 100644 index 0000000000..a7acac4d84 --- /dev/null +++ b/types/jsforce/tsconfig.json @@ -0,0 +1,22 @@ +{ + "compilerOptions": { + "module": "commonjs", + "lib": [ + "es6" + ], + "noImplicitAny": true, + "noImplicitThis": true, + "strictNullChecks": false, + "baseUrl": "../", + "typeRoots": [ + "../" + ], + "types": [], + "noEmit": true, + "forceConsistentCasingInFileNames": true + }, + "files": [ + "index.d.ts", + "jsforce-tests.ts" + ] +} \ No newline at end of file diff --git a/types/jsforce/tslint.json b/types/jsforce/tslint.json new file mode 100644 index 0000000000..a62d0d4e68 --- /dev/null +++ b/types/jsforce/tslint.json @@ -0,0 +1,6 @@ +{ + "extends": "dtslint/dt.json", + "rules": { + "ban-types": false + } +} From e821bc121bef99ed3d7bd2ac80f4314d96bb2735 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 9 May 2017 18:35:42 +0100 Subject: [PATCH 2/6] added more typings --- types/jsforce/index.d.ts | 78 ++++++++++------------------------ types/jsforce/jsforce-tests.ts | 46 +++++++++++++++++++- 2 files changed, 67 insertions(+), 57 deletions(-) diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 4b7dedc2e4..67d0fcdda2 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -18,17 +18,12 @@ declare namespace jsforce { } class SObject { - create(options: any, callback?: (err: Error, ret: RecordResult) => void): void; 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; - del(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; - destroy(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; - delete(objectId: string | string[], callback?: (err: Error, ret: any) => void): void; // upsert(options: SObjectOptions): void; - describe(callback: (err: Error, ret: Meta) => void): void; describeGlobal(callback: (err: Error, res: any) => void): void; - describe$(callback: (err: Error, ret: Meta) => void): void; + describe$(callback: (err: Error, ret: DescribeSObjectResult) => void): void; describeGlobal$(callback: (err: Error, res: any) => void): void; find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; @@ -38,6 +33,20 @@ declare namespace jsforce { findOne(query?: any, callback?: (err: Error, ret: T) => void): void; findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): void; findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): void; + + approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; + bulkload(operation: string, options?: { extIdField?: string }, input?: Record[] | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; + compactLayouts(callback?: CompactLayoutInfo): Promise; + count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; + create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; + createBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; + del(ids: string | string[], callback?: (err: Error, ret: any) => void): void; + 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; + 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; } interface ConnectionOptions { @@ -103,7 +112,7 @@ declare namespace jsforce { SicDesc?: string; } - interface Meta { + interface DescribeSObjectResult { label: string; fields: string[]; } @@ -143,56 +152,13 @@ declare namespace jsforce { } interface RecordResult { id: SalesforceId, success: boolean, anys: Object[] } - interface ExplainInfo { } - interface SalesforceContentVersionDocument { - attributes: - { - type: string, - url: string, - }; - Id: SalesforceId, - ContentDocumentId: SalesforceId, - IsLatest: boolean, - ContentUrl: string, - VersionNumber: string, - Title: string, - Description: string, - ReasonForChange: string, - SharingOption: string, - PathOnClient: string, - RatingCount: number, - IsDeleted: boolean, - ContentModifiedDate: Date, - ContentModifiedById: SalesforceId, - PositiveRatingCount: number, - NegativeRatingCount: number, - FeaturedContentBoost: Date, - FeaturedContentDate: Date, - OwnerId: SalesforceId, - CreatedById: SalesforceId, - CreatedDate: Date, - LastModifiedById: SalesforceId, - LastModifiedDate: Date, - SystemModstamp: Date, - TagCsv: string, - FileType: string, - PublishStatus: string, - VersionData: string, - ContentSize: number, - FileExtension: string, - FirstPublishLocationId: SalesforceId, - Origin: string, - ContentLocation: string, - TextPreview: string, - ExternalDocumentInfo1: string, - ExternalDocumentInfo2: string, - ExternalDataSourceId: string, - Checksum: string, - IsMajorVersion: boolean, - IsAssetEnabled: boolean, - User__c: string - } + interface ExplainInfo { } + interface ApprovalLayoutInfo { } + interface Record { } + interface Batch { } + interface CompactLayoutInfo { } + interface DeletedRecordsInfo { } } export = jsforce; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index 334116ee23..cf25cd4a6b 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -1 +1,45 @@ -import * as jsforce from 'jsforce'; +import * as sf from 'jsforce'; + +const salesforceConnection: sf.Connection = new sf.Connection({ + instanceUrl: '', + refreshToken: '', + oauth2: { + clientId: '', + clientSecret: '', + }, +}); + +salesforceConnection.sobject("Account").create({ + Name: "Test Acc 2", + BillingStreet: "Maplestory street", + BillingPostalCode: "ME4 666" +}, (err, ret: sf.RecordResult) => { + if (err || !ret.success) { + return; + } +}); + +salesforceConnection.sobject("ContentVersion").create({ + OwnerId: '', + Title: 'hello', + PathOnClient: './hello-world.jpg', + VersionData: '{ Test: Data }' +}, (err, ret: sf.RecordResult) => { + if (err || !ret.success) { + return; + } +}); + +salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { + +}); + +salesforceConnection.sobject("ContentDocumentLink").create({ + ContentDocumentId: '', + LinkedEntityId: '', + ShareType: "I" +}, (err, ret: sf.RecordResult) => { + if (err || !ret.success) { + return; + } +}); \ No newline at end of file From 04100cd5cebf0cef7d481fcd88da2a6078d74662 Mon Sep 17 00:00:00 2001 From: Dolan Date: Tue, 16 May 2017 23:46:36 +0100 Subject: [PATCH 3/6] 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) => { }); From 305b1690610a07f25f79a74bb87c6e13adb7770d Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 17 May 2017 00:52:31 +0100 Subject: [PATCH 4/6] Split up the file into multiple, more manageable files --- types/jsforce/connection.ts | 28 ++++ types/jsforce/create-options.ts | 42 +++++ types/jsforce/date-enum.ts | 3 + types/jsforce/describe-result.ts | 4 + types/jsforce/index.d.ts | 174 +-------------------- types/jsforce/jsforce-tests.ts | 13 +- types/jsforce/query.ts | 34 ++++ types/jsforce/record-result.ts | 7 + types/jsforce/salesforce-id.ts | 2 + types/jsforce/salesforce-object-options.ts | 7 + types/jsforce/salesforce-object.ts | 60 +++++++ types/jsforce/tsconfig.json | 8 + 12 files changed, 206 insertions(+), 176 deletions(-) create mode 100644 types/jsforce/connection.ts create mode 100644 types/jsforce/create-options.ts create mode 100644 types/jsforce/date-enum.ts create mode 100644 types/jsforce/describe-result.ts create mode 100644 types/jsforce/query.ts create mode 100644 types/jsforce/record-result.ts create mode 100644 types/jsforce/salesforce-id.ts create mode 100644 types/jsforce/salesforce-object-options.ts create mode 100644 types/jsforce/salesforce-object.ts diff --git a/types/jsforce/connection.ts b/types/jsforce/connection.ts new file mode 100644 index 0000000000..a1f4f6f809 --- /dev/null +++ b/types/jsforce/connection.ts @@ -0,0 +1,28 @@ +import { SObjectCreateOptions } from './create-options'; +import { DescribeSObjectResult } from './describe-result'; +import { Query } from './query'; +import { RecordResult } from './record-result'; +import { SObject } from './salesforce-object'; + +export interface ConnectionOptions { + instanceUrl?: string; + accessToken?: string; + refreshToken?: string; + oauth2?: { + clientId: string, + clientSecret: string, + redirectUri?: string, + }; + sessionId?: string; + serverUrl?: string; + redirectUri?: string; +} + +export type ConnectionEvent = "refresh"; + +export declare class Connection { + constructor(params: ConnectionOptions) + + sobject(resource: string): SObject; + on(eventName: ConnectionEvent, callback: Function): void; +} diff --git a/types/jsforce/create-options.ts b/types/jsforce/create-options.ts new file mode 100644 index 0000000000..e72de859c7 --- /dev/null +++ b/types/jsforce/create-options.ts @@ -0,0 +1,42 @@ +import { SalesforceId } from './salesforce-id'; +import { SObjectOptions } from './salesforce-object-options'; + +export interface SObjectCreateOptions extends SObjectOptions { + IsDeleted?: boolean; + MasterRecordId?: SalesforceId; + Name?: string; + Type?: string; + ParentId?: SalesforceId; + BillingStreet?: string; + BillingCity?: string; + BillingState?: string; + BillingPostalCode?: string; + BillingCountry?: string; + BillingLatitude?: number; + BillingLongitude?: number; + ShippingStreet?: string; + ShippingCity?: string; + ShippingState?: string; + ShippingPostalCode?: string; + ShippingCountry?: string; + ShippingLatitude?: number; + ShippingLongitude?: number; + Phone?: string; + Website?: string; + Industry?: string; + NumberOfEmployees?: number; + Description?: string; + OwnerId?: SalesforceId; + CreatedDate?: Date; + CreatedById?: SalesforceId; + LastModifiedDate?: Date; + LastModifiedById?: SalesforceId; + SystemModstamp?: Date; + LastActivityDate?: Date; + LastViewedDate?: Date; + LastReferencedDate?: Date; + Jigsaw?: string; + JigsawCompanyId?: string; + AccountSource?: string; + SicDesc?: string; +} diff --git a/types/jsforce/date-enum.ts b/types/jsforce/date-enum.ts new file mode 100644 index 0000000000..0f5d9b6408 --- /dev/null +++ b/types/jsforce/date-enum.ts @@ -0,0 +1,3 @@ +export enum Date { + YESTERDAY +} diff --git a/types/jsforce/describe-result.ts b/types/jsforce/describe-result.ts new file mode 100644 index 0000000000..584a62d3bf --- /dev/null +++ b/types/jsforce/describe-result.ts @@ -0,0 +1,4 @@ +export interface DescribeSObjectResult { + label: string; + fields: string[]; +} diff --git a/types/jsforce/index.d.ts b/types/jsforce/index.d.ts index 36858776d0..4c0f82b626 100644 --- a/types/jsforce/index.d.ts +++ b/types/jsforce/index.d.ts @@ -8,173 +8,7 @@ import * as stream from 'stream'; import * as express from 'express'; import * as glob from 'glob'; -declare namespace jsforce { - type ConnectionEvent = "refresh"; - class Connection { - constructor(params: ConnectionOptions) - - sobject(resource: string): SObject; - on(eventName: ConnectionEvent, callback: Function): void; - } - - class SObject { - record(options: any, callback?: (err: Error, ret: any) => void): void; - update(options: SObjectCreateOptions, 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; - describeGlobal$(callback: (err: Error, res: any) => void): void; - - find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; - find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; - - findOne(query?: any, callback?: (err: Error, ret: T) => void): void; - findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): void; - findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): void; - - approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; - bulkload(operation: string, options?: { extIdField?: string }, input?: Record[] | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; - compactLayouts(callback?: CompactLayoutInfo): Promise; - count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; - create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; - createBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; - del(ids: string | string[], callback?: (err: Error, ret: any) => void): void; - 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 { - instanceUrl?: string; - accessToken?: string; - refreshToken?: string; - oauth2?: { - clientId: string, - clientSecret: string, - redirectUri?: string, - }; - sessionId?: string; - serverUrl?: string; - redirectUri?: string; - } - - interface SObjectOptions { - Id?: SalesforceId; - Name?: string; - ExtId__c?: string; - } - - class SalesforceId extends String { - } - - interface SObjectCreateOptions extends SObjectOptions { - IsDeleted?: boolean, - MasterRecordId?: SalesforceId, - Name?: string, - Type?: string, - ParentId?: SalesforceId, - BillingStreet?: string, - BillingCity?: string, - BillingState?: string, - BillingPostalCode?: string, - BillingCountry?: string, - BillingLatitude?: number, - BillingLongitude?: number, - ShippingStreet?: string, - ShippingCity?: string, - ShippingState?: string, - ShippingPostalCode?: string, - ShippingCountry?: string, - ShippingLatitude?: number, - ShippingLongitude?: number, - Phone?: string, - Website?: string, - Industry?: string, - NumberOfEmployees?: number, - Description?: string, - OwnerId?: SalesforceId, - CreatedDate?: Date, - CreatedById?: SalesforceId, - LastModifiedDate?: Date, - LastModifiedById?: SalesforceId, - SystemModstamp?: Date, - LastActivityDate?: Date, - LastViewedDate?: Date, - LastReferencedDate?: Date, - Jigsaw?: string; - JigsawCompanyId?: string; - AccountSource?: string; - SicDesc?: string; - } - - interface DescribeSObjectResult { - label: string; - fields: string[]; - } - - enum Date { - YESTERDAY - } - - class Query { - filter(filter: Object): Query; - hint(hint: Object): Query; - limit(value: number): Query; - maxFetch(value: number): Query; - offset(value: number): Query; - skip(value: number): Query; - sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query; - run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; - execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; - exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; - del(callback?: (err: Error, ret: RecordResult) => void): any; - delete(callback?: (err: Error, ret: RecordResult) => void): any; - destroy(callback?: (err: Error, ret: RecordResult) => void): Promise; - explain(callback?: (err: Error, info: ExplainInfo) => void): Promise; - scanAll(value: boolean): Query; - select(fields: Object | string[] | string): Query; - then(onSuccess?: Function, onRejected?: Function): Promise; - thenCall(callback?: (err: Error, records: T) => void): Query; - toSOQL(callback: (err: Error, soql: string) => void): Promise; - update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise; - where(conditions: Object | string): Query; - } - - interface ExecuteOptions { - autoFetch?: boolean; - maxFetch?: number; - scanAll?: number; - } - - interface RecordResult { id: SalesforceId, success: boolean, anys: Object[] } - - interface ExplainInfo { } - interface ApprovalLayoutInfo { } - interface Record { } - interface Batch { } - interface CompactLayoutInfo { } - interface DeletedRecordsInfo { } - interface LayoutInfo { } - interface ListView { } - interface ListViewsInfo { } - interface QuickAction { } -} - -export = jsforce; +export { Date } from './date-enum'; +export { RecordResult } from './record-result'; +export { Connection } from './connection'; +export { SObject } from './salesforce-object'; diff --git a/types/jsforce/jsforce-tests.ts b/types/jsforce/jsforce-tests.ts index bd9738bee9..70a41ec934 100644 --- a/types/jsforce/jsforce-tests.ts +++ b/types/jsforce/jsforce-tests.ts @@ -13,7 +13,7 @@ salesforceConnection.sobject("Account").create({ Name: "Test Acc 2", BillingStreet: "Maplestory street", BillingPostalCode: "ME4 666" -}, (err, ret: sf.RecordResult) => { +}, (err: Error, ret: sf.RecordResult) => { if (err || !ret.success) { return; } @@ -24,7 +24,7 @@ salesforceConnection.sobject("ContentVersion").create({ Title: 'hello', PathOnClient: './hello-world.jpg', VersionData: '{ Test: Data }' -}, (err, ret: sf.RecordResult) => { +}, (err: Error, ret: sf.RecordResult) => { if (err || !ret.success) { return; } @@ -32,22 +32,23 @@ salesforceConnection.sobject("ContentVersion").create({ salesforceConnection.sobject("ContentVersion").retrieve("world", { test: "test" -}, (err, ret: sf.RecordResult) => { +}, (err: Error, ret: sf.RecordResult) => { if (err || !ret.success) { return; } }); salesforceConnection.sobject("ContentVersion").findOne({ Id: '' }, (err, contentVersion) => { - }); salesforceConnection.sobject("ContentDocumentLink").create({ ContentDocumentId: '', LinkedEntityId: '', ShareType: "I" -}, (err, ret: sf.RecordResult) => { +}, (err: Error, ret: sf.RecordResult) => { if (err || !ret.success) { return; } -}); \ No newline at end of file +}); + +sf.Date.YESTERDAY; diff --git a/types/jsforce/query.ts b/types/jsforce/query.ts new file mode 100644 index 0000000000..d5beec791f --- /dev/null +++ b/types/jsforce/query.ts @@ -0,0 +1,34 @@ +import { SalesforceId } from './salesforce-id'; +import { RecordResult } from './record-result'; + +export interface ExecuteOptions { + autoFetch?: boolean; + maxFetch?: number; + scanAll?: number; +} + +export declare class Query { + filter(filter: Object): Query; + hint(hint: Object): Query; + limit(value: number): Query; + maxFetch(value: number): Query; + offset(value: number): Query; + skip(value: number): Query; + sort(keyOrList: string | Object[] | Object, direction?: "ASC" | "DESC" | number): Query; + run(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + execute(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + exec(options?: ExecuteOptions, callback?: (err: Error, records: T[]) => void): Query; + del(callback?: (err: Error, ret: RecordResult) => void): any; + delete(callback?: (err: Error, ret: RecordResult) => void): any; + destroy(callback?: (err: Error, ret: RecordResult) => void): Promise; + explain(callback?: (err: Error, info: ExplainInfo) => void): Promise; + scanAll(value: boolean): Query; + select(fields: Object | string[] | string): Query; + then(onSuccess?: Function, onRejected?: Function): Promise; + thenCall(callback?: (err: Error, records: T) => void): Query; + toSOQL(callback: (err: Error, soql: string) => void): Promise; + update(mapping: any, type: string, callback: (err: Error, records: RecordResult[]) => void): Promise; + where(conditions: Object | string): Query; +} + +export interface ExplainInfo { } diff --git a/types/jsforce/record-result.ts b/types/jsforce/record-result.ts new file mode 100644 index 0000000000..bf53a5bf98 --- /dev/null +++ b/types/jsforce/record-result.ts @@ -0,0 +1,7 @@ +import { SalesforceId } from './salesforce-id'; + +export interface RecordResult { + id: SalesforceId; + success: boolean; + anys: Object[]; +} diff --git a/types/jsforce/salesforce-id.ts b/types/jsforce/salesforce-id.ts new file mode 100644 index 0000000000..87d086880f --- /dev/null +++ b/types/jsforce/salesforce-id.ts @@ -0,0 +1,2 @@ +export class SalesforceId extends String { +} diff --git a/types/jsforce/salesforce-object-options.ts b/types/jsforce/salesforce-object-options.ts new file mode 100644 index 0000000000..2cc6e46f39 --- /dev/null +++ b/types/jsforce/salesforce-object-options.ts @@ -0,0 +1,7 @@ +import { SalesforceId } from './salesforce-id'; + +export interface SObjectOptions { + Id?: SalesforceId; + Name?: string; + ExtId__c?: string; +} diff --git a/types/jsforce/salesforce-object.ts b/types/jsforce/salesforce-object.ts new file mode 100644 index 0000000000..2ec340d1c8 --- /dev/null +++ b/types/jsforce/salesforce-object.ts @@ -0,0 +1,60 @@ +import * as stream from 'stream'; + +import { SObjectCreateOptions } from './create-options'; +import { DescribeSObjectResult } from './describe-result'; +import { Query } from './query'; +import { RecordResult } from './record-result'; + +export declare class SObject { + record(options: any, callback?: (err: Error, ret: any) => void): void; + update(options: SObjectCreateOptions, 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; + describeGlobal$(callback: (err: Error, res: any) => void): void; + + find(query?: any, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; + find(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T[]) => void): Query; + + findOne(query?: any, callback?: (err: Error, ret: T) => void): void; + findOne(query?: any, fields?: Object | string[] | string, callback?: (err: Error, ret: T) => void): void; + findOne(query?: any, fields?: Object | string[] | string, options?: Object, callback?: (err: Error, ret: T) => void): void; + + approvalLayouts(callback?: (layoutInfo: ApprovalLayoutInfo) => void): Promise; + bulkload(operation: string, options?: { extIdField?: string }, input?: Record[] | stream.Stream[] | string[], callback?: (err: Error, ret: RecordResult) => void): Batch; + compactLayouts(callback?: CompactLayoutInfo): Promise; + count(conditions?: Object | string, callback?: (err: Error, num: number) => void): Promise; + create(options: any | any[], callback?: (err: Error, ret: RecordResult | RecordResult[]) => void): Promise; + createBulk(input?: Record[] | stream.Stream | String, callback?: (err: Error, ret: RecordResult) => void): Batch; + del(ids: string | string[], callback?: (err: Error, ret: any) => void): void; + 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; +} + +export interface ApprovalLayoutInfo { } +export interface Record { } +export interface Batch { } +export interface CompactLayoutInfo { } +export interface DeletedRecordsInfo { } +export interface LayoutInfo { } +export interface ListView { } +export interface ListViewsInfo { } +export interface QuickAction { } diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index a7acac4d84..c7987cf4b9 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -17,6 +17,14 @@ }, "files": [ "index.d.ts", + "connection.ts", + "create-options.ts", + "date-enum.ts", + "salesforce-object-options.ts", + "salesforce-object.ts", + "salesforce-id.ts", + "query.ts", + "describe-result.ts", "jsforce-tests.ts" ] } \ No newline at end of file From 0cf0d087859c5ae68a2cf574414c908883872784 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 17 May 2017 01:41:33 +0100 Subject: [PATCH 5/6] Added more methods and enum types --- types/jsforce/date-enum.ts | 38 ++++++++++++++++++++++- types/jsforce/query.ts | 2 +- types/jsforce/salesforce-object.ts | 48 ++++++++++++++++++++++++------ 3 files changed, 77 insertions(+), 11 deletions(-) diff --git a/types/jsforce/date-enum.ts b/types/jsforce/date-enum.ts index 0f5d9b6408..0833be0f98 100644 --- a/types/jsforce/date-enum.ts +++ b/types/jsforce/date-enum.ts @@ -1,3 +1,39 @@ export enum Date { - YESTERDAY + YESTERDAY, + TODAY, + TOMORROW, + LAST_WEEK, + THIS_WEEK, + NEXT_WEEK, + LAST_MONTH, + THIS_MONTH, + NEXT_MONTH, + LAST_90_DAYS, + NEXT_90_DAYS, + LAST_N_DAYS, + NEXT_N_DAYS, + NEXT_N_WEEKS, + LAST_N_WEEKS, + NEXT_N_MONTHS, + LAST_N_MONTHS, + THIS_QUARTER, + LAST_QUARTER, + NEXT_QUARTER, + NEXT_N_QUARTERS, + LAST_N_QUARTERS, + THIS_YEAR, + LAST_YEAR, + NEXT_YEAR, + NEXT_N_YEARS, + LAST_N_YEARS, + THIS_FISCAL_QUARTER, + LAST_FISCAL_QUARTER, + NEXT_FISCAL_QUARTER, + NEXT_N_FISCAL_QUARTERS, + LAST_N_FISCAL_QUARTERS, + THIS_FISCAL_YEAR, + LAST_FISCAL_YEAR, + NEXT_FISCAL_YEAR, + NEXT_N_FISCAL_YEARS, + LAST_N_FISCAL_YEARS } diff --git a/types/jsforce/query.ts b/types/jsforce/query.ts index d5beec791f..bd9f968798 100644 --- a/types/jsforce/query.ts +++ b/types/jsforce/query.ts @@ -31,4 +31,4 @@ export declare class Query { where(conditions: Object | string): Query; } -export interface ExplainInfo { } +export class ExplainInfo { } diff --git a/types/jsforce/salesforce-object.ts b/types/jsforce/salesforce-object.ts index 2ec340d1c8..3e0e1b38a5 100644 --- a/types/jsforce/salesforce-object.ts +++ b/types/jsforce/salesforce-object.ts @@ -4,6 +4,8 @@ import { SObjectCreateOptions } from './create-options'; import { DescribeSObjectResult } from './describe-result'; import { Query } from './query'; import { RecordResult } from './record-result'; +import { Connection } from './connection'; +import { SalesforceId } from './salesforce-id'; export declare class SObject { record(options: any, callback?: (err: Error, ret: any) => void): void; @@ -49,12 +51,40 @@ export declare class SObject { select(field?: Object | string[] | string, callback?: (err: Error, ret: T[]) => void): Query; } -export interface ApprovalLayoutInfo { } -export interface Record { } -export interface Batch { } -export interface CompactLayoutInfo { } -export interface DeletedRecordsInfo { } -export interface LayoutInfo { } -export interface ListView { } -export interface ListViewsInfo { } -export interface QuickAction { } +export interface ApprovalLayoutInfo { + approvalLayouts: Object[]; +} + +export declare class Record extends Object { + constructor(connection: Connection, type: SObject, id: SalesforceId) +} + +export class Batch extends stream.Writable { +} + +export interface CompactLayoutInfo { + compactLayouts: Object[]; + defaultCompactLayoutId: string; + recordTypeCompactLayoutMappings: Object[]; +} + +export interface DeletedRecordsInfo { + earliestDateAvailable: string; + latestDateCovered: string; + deletedRecords: { + id: string, + deletedDate: string, + }; +} + +export interface LayoutInfo { + layouts: Object[]; + recordTypeMappings: Object[]; +} + +export declare class ListView { + constructor(connection: Connection, type: SObject, id: SalesforceId) +} + +export class ListViewsInfo { } +export class QuickAction { } From f823abb6a49cc32904a2cb079d305781e3849346 Mon Sep 17 00:00:00 2001 From: Dolan Date: Wed, 17 May 2017 15:04:50 +0100 Subject: [PATCH 6/6] Made all of the files .d.ts --- types/jsforce/{connection.ts => connection.d.ts} | 2 +- .../{create-options.ts => create-options.d.ts} | 0 types/jsforce/{date-enum.ts => date-enum.d.ts} | 0 .../{describe-result.ts => describe-result.d.ts} | 0 types/jsforce/{query.ts => query.d.ts} | 2 +- .../{record-result.ts => record-result.d.ts} | 0 .../{salesforce-id.ts => salesforce-id.d.ts} | 0 ...options.ts => salesforce-object-options.d.ts} | 0 ...lesforce-object.ts => salesforce-object.d.ts} | 6 +++--- types/jsforce/tsconfig.json | 16 ++++++++-------- 10 files changed, 13 insertions(+), 13 deletions(-) rename types/jsforce/{connection.ts => connection.d.ts} (95%) rename types/jsforce/{create-options.ts => create-options.d.ts} (100%) rename types/jsforce/{date-enum.ts => date-enum.d.ts} (100%) rename types/jsforce/{describe-result.ts => describe-result.d.ts} (100%) rename types/jsforce/{query.ts => query.d.ts} (98%) rename types/jsforce/{record-result.ts => record-result.d.ts} (100%) rename types/jsforce/{salesforce-id.ts => salesforce-id.d.ts} (100%) rename types/jsforce/{salesforce-object-options.ts => salesforce-object-options.d.ts} (100%) rename types/jsforce/{salesforce-object.ts => salesforce-object.d.ts} (97%) diff --git a/types/jsforce/connection.ts b/types/jsforce/connection.d.ts similarity index 95% rename from types/jsforce/connection.ts rename to types/jsforce/connection.d.ts index a1f4f6f809..f3864eb5d8 100644 --- a/types/jsforce/connection.ts +++ b/types/jsforce/connection.d.ts @@ -20,7 +20,7 @@ export interface ConnectionOptions { export type ConnectionEvent = "refresh"; -export declare class Connection { +export class Connection { constructor(params: ConnectionOptions) sobject(resource: string): SObject; diff --git a/types/jsforce/create-options.ts b/types/jsforce/create-options.d.ts similarity index 100% rename from types/jsforce/create-options.ts rename to types/jsforce/create-options.d.ts diff --git a/types/jsforce/date-enum.ts b/types/jsforce/date-enum.d.ts similarity index 100% rename from types/jsforce/date-enum.ts rename to types/jsforce/date-enum.d.ts diff --git a/types/jsforce/describe-result.ts b/types/jsforce/describe-result.d.ts similarity index 100% rename from types/jsforce/describe-result.ts rename to types/jsforce/describe-result.d.ts diff --git a/types/jsforce/query.ts b/types/jsforce/query.d.ts similarity index 98% rename from types/jsforce/query.ts rename to types/jsforce/query.d.ts index bd9f968798..0d716c28da 100644 --- a/types/jsforce/query.ts +++ b/types/jsforce/query.d.ts @@ -7,7 +7,7 @@ export interface ExecuteOptions { scanAll?: number; } -export declare class Query { +export class Query { filter(filter: Object): Query; hint(hint: Object): Query; limit(value: number): Query; diff --git a/types/jsforce/record-result.ts b/types/jsforce/record-result.d.ts similarity index 100% rename from types/jsforce/record-result.ts rename to types/jsforce/record-result.d.ts diff --git a/types/jsforce/salesforce-id.ts b/types/jsforce/salesforce-id.d.ts similarity index 100% rename from types/jsforce/salesforce-id.ts rename to types/jsforce/salesforce-id.d.ts diff --git a/types/jsforce/salesforce-object-options.ts b/types/jsforce/salesforce-object-options.d.ts similarity index 100% rename from types/jsforce/salesforce-object-options.ts rename to types/jsforce/salesforce-object-options.d.ts diff --git a/types/jsforce/salesforce-object.ts b/types/jsforce/salesforce-object.d.ts similarity index 97% rename from types/jsforce/salesforce-object.ts rename to types/jsforce/salesforce-object.d.ts index 3e0e1b38a5..ac2288fe33 100644 --- a/types/jsforce/salesforce-object.ts +++ b/types/jsforce/salesforce-object.d.ts @@ -7,7 +7,7 @@ import { RecordResult } from './record-result'; import { Connection } from './connection'; import { SalesforceId } from './salesforce-id'; -export declare class SObject { +export class SObject { record(options: any, callback?: (err: Error, ret: any) => void): void; update(options: SObjectCreateOptions, callback?: (err: Error, ret: any) => void): void; retrieve(ids: string | string[], callback?: (err: Error, ret: any) => void): void; @@ -55,7 +55,7 @@ export interface ApprovalLayoutInfo { approvalLayouts: Object[]; } -export declare class Record extends Object { +export class Record extends Object { constructor(connection: Connection, type: SObject, id: SalesforceId) } @@ -82,7 +82,7 @@ export interface LayoutInfo { recordTypeMappings: Object[]; } -export declare class ListView { +export class ListView { constructor(connection: Connection, type: SObject, id: SalesforceId) } diff --git a/types/jsforce/tsconfig.json b/types/jsforce/tsconfig.json index c7987cf4b9..63812424be 100644 --- a/types/jsforce/tsconfig.json +++ b/types/jsforce/tsconfig.json @@ -17,14 +17,14 @@ }, "files": [ "index.d.ts", - "connection.ts", - "create-options.ts", - "date-enum.ts", - "salesforce-object-options.ts", - "salesforce-object.ts", - "salesforce-id.ts", - "query.ts", - "describe-result.ts", + "connection.d.ts", + "create-options.d.ts", + "date-enum.d.ts", + "salesforce-object-options.d.ts", + "salesforce-object.d.ts", + "salesforce-id.d.ts", + "query.d.ts", + "describe-result.d.ts", "jsforce-tests.ts" ] } \ No newline at end of file