diff --git a/src/browserforce.ts b/src/browserforce.ts index 1e5418bd..5bba2d64 100644 --- a/src/browserforce.ts +++ b/src/browserforce.ts @@ -48,7 +48,7 @@ export class Browserforce { // path instead of url public async openPage(urlPath: string, options?: WaitForOptions): Promise { - let page; + let page: Page; const result = await pRetry( async () => { page = await this.browser.newPage(); diff --git a/src/plugins/activity-settings/index.e2e-spec.ts b/src/plugins/activity-settings/index.e2e-spec.ts index 6e703191..cc313246 100644 --- a/src/plugins/activity-settings/index.e2e-spec.ts +++ b/src/plugins/activity-settings/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { ActivitySettings } from '.'; describe(ActivitySettings.name, function () { - let plugin; + let plugin: ActivitySettings; before(() => { plugin = new ActivitySettings(global.bf); }); diff --git a/src/plugins/communities/index.e2e-spec.ts b/src/plugins/communities/index.e2e-spec.ts index 1aa3ea9c..53d1988e 100644 --- a/src/plugins/communities/index.e2e-spec.ts +++ b/src/plugins/communities/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { Communities } from '.'; describe.skip(Communities.name, function () { - let plugin; + let plugin: Communities; before(() => { plugin = new Communities(global.bf); }); diff --git a/src/plugins/customer-portal/index.e2e-spec.ts b/src/plugins/customer-portal/index.e2e-spec.ts index 37d79e56..770d6e54 100644 --- a/src/plugins/customer-portal/index.e2e-spec.ts +++ b/src/plugins/customer-portal/index.e2e-spec.ts @@ -7,7 +7,7 @@ import { CustomerPortalSetup } from './portals'; describe('CustomerPortal', () => { describe(CustomerPortalEnable.name, function () { - let plugin; + let plugin: CustomerPortalEnable; before(() => { plugin = new CustomerPortalEnable(global.bf); }); @@ -33,7 +33,7 @@ describe('CustomerPortal', () => { }); describe(CustomerPortalSetup.name, function () { - let plugin; + let plugin: CustomerPortalSetup; before(() => { plugin = new CustomerPortalSetup(global.bf); }); @@ -132,7 +132,7 @@ describe('CustomerPortal', () => { }); describe(CustomerPortalAvailableCustomObjects.name, function () { - let plugin; + let plugin: CustomerPortalAvailableCustomObjects; before(() => { plugin = new CustomerPortalAvailableCustomObjects(global.bf); }); diff --git a/src/plugins/defer-sharing-calculation/index.e2e-spec.ts b/src/plugins/defer-sharing-calculation/index.e2e-spec.ts index b4be13fa..2f6e69a5 100644 --- a/src/plugins/defer-sharing-calculation/index.e2e-spec.ts +++ b/src/plugins/defer-sharing-calculation/index.e2e-spec.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import { DeferSharingCalculation } from '.'; describe(DeferSharingCalculation.name, function () { - let plugin; + let plugin: DeferSharingCalculation; before(() => { plugin = new DeferSharingCalculation(global.bf); }); diff --git a/src/plugins/density-settings/index.e2e-spec.ts b/src/plugins/density-settings/index.e2e-spec.ts index bf36cf2e..7869ce51 100644 --- a/src/plugins/density-settings/index.e2e-spec.ts +++ b/src/plugins/density-settings/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { DensitySettings } from '.'; describe(DensitySettings.name, function () { - let plugin; + let plugin: DensitySettings; before(() => { plugin = new DensitySettings(global.bf); }); diff --git a/src/plugins/email-deliverability/index.e2e-spec.ts b/src/plugins/email-deliverability/index.e2e-spec.ts index 0e28f32c..5e48f013 100644 --- a/src/plugins/email-deliverability/index.e2e-spec.ts +++ b/src/plugins/email-deliverability/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { EmailDeliverability } from '.'; describe(EmailDeliverability.name, function () { - let plugin; + let plugin: EmailDeliverability; before(() => { plugin = new EmailDeliverability(global.bf); }); diff --git a/src/plugins/home-page-layouts/index.e2e-spec.ts b/src/plugins/home-page-layouts/index.e2e-spec.ts index 49c93af1..9442c37d 100644 --- a/src/plugins/home-page-layouts/index.e2e-spec.ts +++ b/src/plugins/home-page-layouts/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { HomePageLayouts } from '.'; describe(HomePageLayouts.name, function () { - let plugin; + let plugin: HomePageLayouts; before(() => { plugin = new HomePageLayouts(global.bf); }); diff --git a/src/plugins/lightning-experience-settings/index.e2e-spec.ts b/src/plugins/lightning-experience-settings/index.e2e-spec.ts index 027c04cb..de0b1b01 100644 --- a/src/plugins/lightning-experience-settings/index.e2e-spec.ts +++ b/src/plugins/lightning-experience-settings/index.e2e-spec.ts @@ -3,7 +3,7 @@ import { LightningExperienceSettings } from '.'; describe(LightningExperienceSettings.name, function () { describe('activeThemeName', () => { - let plugin; + let plugin: LightningExperienceSettings; before(() => { plugin = new LightningExperienceSettings(global.bf); }); diff --git a/src/plugins/opportunity-splits/index.e2e-spec.ts b/src/plugins/opportunity-splits/index.e2e-spec.ts index 72902f6b..7ee5e836 100644 --- a/src/plugins/opportunity-splits/index.e2e-spec.ts +++ b/src/plugins/opportunity-splits/index.e2e-spec.ts @@ -4,7 +4,7 @@ import * as path from 'path'; import { OpportunitySplits } from '.'; describe(OpportunitySplits.name, function () { - let plugin; + let plugin: OpportunitySplits; before(() => { plugin = new OpportunitySplits(global.bf); }); diff --git a/src/plugins/picklists/index.e2e-spec.ts b/src/plugins/picklists/index.e2e-spec.ts index 7d4b4d22..269a5a26 100644 --- a/src/plugins/picklists/index.e2e-spec.ts +++ b/src/plugins/picklists/index.e2e-spec.ts @@ -6,7 +6,7 @@ import { FieldDependencies } from './field-dependencies'; describe(Picklists.name, function () { this.timeout('10m'); - let plugin; + let plugin: Picklists; before(() => { plugin = new Picklists(global.bf); }); @@ -63,7 +63,7 @@ describe(Picklists.name, function () { describe(FieldDependencies.name, function () { this.timeout('10m'); - let plugin; + let plugin: FieldDependencies; before(() => { plugin = new FieldDependencies(global.bf); }); diff --git a/src/plugins/record-types/index.e2e-spec.ts b/src/plugins/record-types/index.e2e-spec.ts index 77579e97..ca0386cc 100644 --- a/src/plugins/record-types/index.e2e-spec.ts +++ b/src/plugins/record-types/index.e2e-spec.ts @@ -5,7 +5,7 @@ import { RecordTypes } from '.'; describe(RecordTypes.name, function () { this.timeout('10m'); - let plugin; + let plugin: RecordTypes; before(() => { plugin = new RecordTypes(global.bf); }); diff --git a/src/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.ts b/src/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.ts index f812b84b..7fb63efc 100644 --- a/src/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.ts +++ b/src/plugins/relate-contact-to-multiple-accounts/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { RelateContactToMultipleAccounts } from '.'; describe(RelateContactToMultipleAccounts.name, function () { - let plugin; + let plugin: RelateContactToMultipleAccounts; before(() => { plugin = new RelateContactToMultipleAccounts(global.bf); }); diff --git a/src/plugins/salesforce-to-salesforce/index.e2e-spec.ts b/src/plugins/salesforce-to-salesforce/index.e2e-spec.ts index befd4953..2ab522ac 100644 --- a/src/plugins/salesforce-to-salesforce/index.e2e-spec.ts +++ b/src/plugins/salesforce-to-salesforce/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { SalesforceToSalesforce } from '.'; describe(SalesforceToSalesforce.name, function () { - let plugin; + let plugin: SalesforceToSalesforce; before(() => { plugin = new SalesforceToSalesforce(global.bf); }); diff --git a/src/plugins/security/certificate-and-key-management/index.ts b/src/plugins/security/certificate-and-key-management/index.ts index cef099f4..a9fedebb 100644 --- a/src/plugins/security/certificate-and-key-management/index.ts +++ b/src/plugins/security/certificate-and-key-management/index.ts @@ -47,18 +47,20 @@ export class CertificateAndKeyManagement extends BrowserforcePlugin { certificates: [], importFromKeystore: [] }; - let existingCertificates; + let existingCertificates: CertificateRecord[] = []; if (definition?.certificates?.length || definition?.importFromKeystore?.length) { - existingCertificates = await this.org.getConnection().tooling.query( - `SELECT Id, DeveloperName, MasterLabel, OptionsIsPrivateKeyExportable, KeySize FROM Certificate`, - { scanAll: false } - // BUG in jsforce: query acts with scanAll:true and returns deleted CustomObjects. - // It cannot be disabled. - ); + existingCertificates = ( + await this.org.getConnection().tooling.query( + `SELECT Id, DeveloperName, MasterLabel, OptionsIsPrivateKeyExportable, KeySize FROM Certificate`, + { scanAll: false } + // BUG in jsforce: query acts with scanAll:true and returns deleted CustomObjects. + // It cannot be disabled. + ) + )?.records; } if (definition?.certificates?.length) { for (const cert of definition.certificates) { - const existingCert = existingCertificates.records.find((co) => co.DeveloperName === cert.name); + const existingCert = existingCertificates.find((co) => co.DeveloperName === cert.name); if (existingCert) { response.certificates!.push({ _id: existingCert.Id, @@ -72,7 +74,7 @@ export class CertificateAndKeyManagement extends BrowserforcePlugin { } if (definition?.importFromKeystore?.length) { for (const cert of definition.importFromKeystore) { - const existingCert = existingCertificates.records.find((co) => co.DeveloperName === cert.name); + const existingCert = existingCertificates.find((co) => co.DeveloperName === cert.name); if (existingCert) { response.importFromKeystore!.push({ name: existingCert.DeveloperName diff --git a/src/plugins/security/index.e2e-spec.ts b/src/plugins/security/index.e2e-spec.ts index 15755e46..3acea4f9 100644 --- a/src/plugins/security/index.e2e-spec.ts +++ b/src/plugins/security/index.e2e-spec.ts @@ -4,7 +4,8 @@ import { CertificateAndKeyManagement } from './certificate-and-key-management'; import { IdentityProvider } from './identity-provider'; describe(`${CertificateAndKeyManagement.name} and ${IdentityProvider.name}`, function () { - let pluginIdentityProvider, pluginCertificateManagement; + let pluginIdentityProvider: IdentityProvider; + let pluginCertificateManagement: CertificateAndKeyManagement; before(() => { pluginIdentityProvider = new IdentityProvider(global.bf); pluginCertificateManagement = new CertificateAndKeyManagement(global.bf); diff --git a/src/plugins/security/login-access-policies/index.e2e-spec.ts b/src/plugins/security/login-access-policies/index.e2e-spec.ts index 457cee10..d369d770 100644 --- a/src/plugins/security/login-access-policies/index.e2e-spec.ts +++ b/src/plugins/security/login-access-policies/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { type Config, LoginAccessPolicies } from '.'; describe(LoginAccessPolicies.name, function () { - let plugin; + let plugin: LoginAccessPolicies; before(() => { plugin = new LoginAccessPolicies(global.bf); }); diff --git a/src/plugins/security/sharing/index.e2e-spec.ts b/src/plugins/security/sharing/index.e2e-spec.ts index 3e8ce45c..e1dc1039 100644 --- a/src/plugins/security/sharing/index.e2e-spec.ts +++ b/src/plugins/security/sharing/index.e2e-spec.ts @@ -2,7 +2,7 @@ import assert from 'assert'; import { Sharing } from '.'; describe.skip(Sharing.name, function () { - let plugin; + let plugin: Sharing; before(() => { plugin = new Sharing(global.bf); });