diff --git a/messages/diagnostics.md b/messages/diagnostics.md new file mode 100644 index 00000000..1d50452d --- /dev/null +++ b/messages/diagnostics.md @@ -0,0 +1,19 @@ +# apiVersionMismatch + +The sourceApiVersion in sfdx-project.json doesn't match the apiVersion. The commands that deploy and retrieve source use the sourceApiVersion in this case. The version mismatch isn't a problem, as long as it's the behavior you actually want. + +# apiVersionUnset + +Neither sourceApiVersion nor apiVersion are defined. The commands that deploy and retrieve source use the max apiVersion of the target org in this case. The issue isn't a problem, as long as it's the behavior you actually want. + +# maxApiVersionMismatch + +The max apiVersion of the default DevHub org doesn't match the max apiVersion of the default target org. This mismatch means that the default target orgs are running different API versions. Be sure you explicitly set the apiVersion when you deploy or retrieve source, or you will likely run into problems. + +# sourceApiVersionMaxMismatch + +The sourceApiVersion in sfdx-project.json doesn't match the max apiVersion of the default target org. As a result, you're not using the latest features available in API version %s. The version mismatch isn't a problem, as long as it's the behavior you actually want. + +# apiVersionMaxMismatch + +The apiVersion doesn't match the max apiVersion of the default target org. As a result, you're not using the latest features available in API version %s. The version mismatch isn't a problem, as long as it's the behavior you actually want. diff --git a/package.json b/package.json index 59dbe265..fd186ad7 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "@salesforce/apex-node": "^3.0.2", "@salesforce/core": "^6.4.4", "@salesforce/kit": "^3.0.15", + "@salesforce/plugin-info": "^3.0.21", "@salesforce/sf-plugins-core": "^7.1.9", "@salesforce/source-deploy-retrieve": "^10.2.13", "@salesforce/source-tracking": "^5.1.11", @@ -91,6 +92,9 @@ } } }, + "hooks": { + "sf-doctor-@salesforce/plugin-deploy-retrieve": "./lib/hooks/diagnostics" + }, "flexibleTaxonomy": true }, "repository": "salesforcecli/plugin-deploy-retrieve", diff --git a/src/hooks/diagnostics.ts b/src/hooks/diagnostics.ts new file mode 100644 index 00000000..d835d68a --- /dev/null +++ b/src/hooks/diagnostics.ts @@ -0,0 +1,143 @@ +/* + * Copyright (c) 2022, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ +import { ConfigAggregator, Lifecycle, Logger, Messages, SfProject, OrgConfigProperties, Org } from '@salesforce/core'; +import { SfDoctor } from '@salesforce/plugin-info'; + +type HookFunction = (options: { doctor: SfDoctor }) => Promise<[void]>; + +let logger: Logger; +const getLogger = (): Logger => { + if (!logger) { + logger = Logger.childFromRoot('plugin-deploy-retrieve-diagnostics'); + } + return logger; +}; + +const pluginName = '@salesforce/plugin-deploy-retrieve'; +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); +const messages = Messages.loadMessages(pluginName, 'diagnostics'); + +export const hook: HookFunction = async (options) => { + getLogger().debug(`Running SfDoctor diagnostics for ${pluginName}`); + return Promise.all([apiVersionTest(options.doctor)]); +}; + +// ============================ +// *** DIAGNOSTIC TESTS *** +// ============================ + +// Gathers and compares the following API versions: +// 1. apiVersion (if set) from the sfdx config, including environment variable +// 2. sourceApiVersion (if set) from sfdx-project.json +// 3. max apiVersion of the default target dev hub org (if set) +// 4. max apiVersion of the default target org (if set) +// +// Warns if: +// 1. apiVersion and sourceApiVersion are set but not equal +// 2. apiVersion and sourceApiVersion are both not set +// 3. default devhub target org and default target org have different max apiVersions +// 4. sourceApiVersion is set and does not match max apiVersion of default target org +// 5. apiVersion is set and does not match max apiVersion of default target org +const apiVersionTest = async (doctor: SfDoctor): Promise => { + getLogger().debug('Running API Version tests'); + + // check org-api-version from ConfigAggregator + const aggregator = await ConfigAggregator.create(); + const apiVersion = aggregator.getPropertyValue(OrgConfigProperties.ORG_API_VERSION); + + const sourceApiVersion = await getSourceApiVersion(); + + const targetDevHub = aggregator.getPropertyValue(OrgConfigProperties.TARGET_DEV_HUB); + const targetOrg = aggregator.getPropertyValue(OrgConfigProperties.TARGET_ORG); + const targetDevHubApiVersion = targetDevHub && (await getMaxApiVersion(aggregator, targetDevHub)); + const targetOrgApiVersion = targetOrg && (await getMaxApiVersion(aggregator, targetOrg)); + + doctor.addPluginData(pluginName, { + apiVersion, + sourceApiVersion, + targetDevHubApiVersion, + targetOrgApiVersion, + }); + + const testName1 = `[${pluginName}] sourceApiVersion matches apiVersion`; + let status1 = 'pass'; + if (diff(sourceApiVersion, apiVersion)) { + status1 = 'warn'; + doctor.addSuggestion(messages.getMessage('apiVersionMismatch')); + } + if (sourceApiVersion === undefined && apiVersion === undefined) { + status1 = 'warn'; + doctor.addSuggestion(messages.getMessage('apiVersionUnset')); + } + void Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: testName1, status: status1 }); + + if (targetDevHubApiVersion && targetOrgApiVersion) { + const testName2 = `[${pluginName}] default target DevHub max apiVersion matches default target org max apiVersion`; + let status2 = 'pass'; + if (diff(targetDevHubApiVersion, targetOrgApiVersion)) { + status2 = 'warn'; + doctor.addSuggestion(messages.getMessage('maxApiVersionMismatch')); + } + void Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: testName2, status: status2 }); + } + + // Only run this test if both sourceApiVersion and the default target org max version are set. + if (sourceApiVersion?.length && targetOrgApiVersion?.length) { + const testName3 = `[${pluginName}] sourceApiVersion matches default target org max apiVersion`; + let status3 = 'pass'; + if (diff(sourceApiVersion, targetOrgApiVersion)) { + status3 = 'warn'; + doctor.addSuggestion(messages.getMessage('sourceApiVersionMaxMismatch', [targetOrgApiVersion])); + } + void Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: testName3, status: status3 }); + } + + // Only run this test if both apiVersion and the default target org max version are set. + if (apiVersion?.length && targetOrgApiVersion?.length) { + const testName4 = `[${pluginName}] apiVersion matches default target org max apiVersion`; + let status4 = 'pass'; + if (diff(apiVersion, targetOrgApiVersion)) { + status4 = 'warn'; + doctor.addSuggestion(messages.getMessage('apiVersionMaxMismatch', [targetOrgApiVersion])); + } + void Lifecycle.getInstance().emit('Doctor:diagnostic', { testName: testName4, status: status4 }); + } +}; + +// check sfdx-project.json for sourceApiVersion +const getSourceApiVersion = async (): Promise => { + try { + const project = SfProject.getInstance(); + const projectJson = await project.resolveProjectConfig(); + return projectJson.sourceApiVersion as string | undefined; + } catch (error) { + const errMsg = (error as Error).message; + getLogger().debug(`Cannot determine sourceApiVersion due to: ${errMsg}`); + } +}; + +// check max API version for default orgs +const getMaxApiVersion = async (aggregator: ConfigAggregator, aliasOrUsername: string): Promise => { + try { + const org = await Org.create({ aliasOrUsername, aggregator }); + return await org.retrieveMaxApiVersion(); + } catch (error) { + const errMsg = (error as Error).message; + getLogger().debug(`Cannot determine the max ApiVersion for org: [${aliasOrUsername}] due to: ${errMsg}`); + } +}; + +// Compare 2 API versions that have values and return if they are different. +// E.g., +// Comparing undefined with 56.0 would return false. +// Comparing undefined with undefined would return false. +// Comparing 55.0 with 55.0 would return false. +// Comparing 55.0 with 56.0 would return true. +const diff = (version1: string | undefined, version2: string | undefined): boolean => { + getLogger().debug(`Comparing API versions: [${version1},${version2}]`); + return !!version1?.length && !!version2?.length && version1 !== version2; +}; diff --git a/test/hooks/diagnostics.test.ts b/test/hooks/diagnostics.test.ts new file mode 100644 index 00000000..3d6321d5 --- /dev/null +++ b/test/hooks/diagnostics.test.ts @@ -0,0 +1,214 @@ +/* + * Copyright (c) 2020, salesforce.com, inc. + * All rights reserved. + * Licensed under the BSD 3-Clause license. + * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause + */ + +import sinon from 'sinon'; +import { expect } from 'chai'; +import { fromStub, StubbedType, stubInterface, stubMethod } from '@salesforce/ts-sinon'; +import { SfDoctor } from '@salesforce/plugin-info'; +import { ConfigAggregator, Lifecycle, Messages, Org, SfProject } from '@salesforce/core'; +import { TestContext } from '@salesforce/core/lib/testSetup.js'; +import { hook } from '../../src/hooks/diagnostics.js'; +const pluginName = '@salesforce/plugin-deploy-retrieve'; + +Messages.importMessagesDirectoryFromMetaUrl(import.meta.url); +const messages = Messages.loadMessages(pluginName, 'diagnostics'); + +describe('Doctor diagnostics', () => { + const sandbox = new TestContext().SANDBOX; + + // Stubs for: + // 1. the Doctor class needed by the hook + // 2. ConfigAggregator for apiVersion in the config + // 3. SfProject for sourceApiVersion in sfdx-project.json + // 4. Org for maxApiVersion of default devhub and target orgs + let doctorMock: SfDoctor; + let doctorStubbedType: StubbedType; + let configAggregatorMock: ConfigAggregator; + let configAggregatorStubbedType: StubbedType; + let sfProjectMock: SfProject; + let sfProjectStubbedType: StubbedType; + let orgMock: Org; + let orgStubbedType: StubbedType; + let addPluginDataStub: sinon.SinonStub; + let getPropertyValueStub: sinon.SinonStub; + let resolveProjectConfigStub: sinon.SinonStub; + let addSuggestionStub: sinon.SinonStub; + let lifecycleEmitStub: sinon.SinonStub; + let maxApiVersionStub: sinon.SinonStub; + + beforeEach(() => { + doctorStubbedType = stubInterface(sandbox); + doctorMock = fromStub(doctorStubbedType); + configAggregatorStubbedType = stubInterface(sandbox); + configAggregatorMock = fromStub(configAggregatorStubbedType); + stubMethod(sandbox, ConfigAggregator, 'create').resolves(configAggregatorMock); + sfProjectStubbedType = stubInterface(sandbox); + sfProjectMock = fromStub(sfProjectStubbedType); + stubMethod(sandbox, SfProject, 'getInstance').returns(sfProjectMock); + orgStubbedType = stubInterface(sandbox); + orgMock = fromStub(orgStubbedType); + stubMethod(sandbox, Org, 'create').resolves(orgMock); + lifecycleEmitStub = stubMethod(sandbox, Lifecycle.prototype, 'emit'); + + // Shortening these for brevity in tests. + addPluginDataStub = doctorStubbedType.addPluginData; + addSuggestionStub = doctorStubbedType.addSuggestion; + getPropertyValueStub = configAggregatorStubbedType.getPropertyValue; + resolveProjectConfigStub = sfProjectStubbedType.resolveProjectConfig; + maxApiVersionStub = orgStubbedType.retrieveMaxApiVersion; + }); + + afterEach(() => { + sandbox.restore(); + }); + + it('should warn when apiVersion does not match sourceApiVersion', async () => { + getPropertyValueStub.onFirstCall().returns('55.0'); + resolveProjectConfigStub.onFirstCall().resolves({ sourceApiVersion: '52.0' }); + + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: '55.0', + sourceApiVersion: '52.0', + targetDevHubApiVersion: undefined, + targetOrgApiVersion: undefined, + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() to be called once').to.equal(1); + expect(addSuggestionStub.args[0][0]).to.equal(messages.getMessage('apiVersionMismatch')); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[0][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[0][1]).to.deep.equal({ + testName: `[${pluginName}] sourceApiVersion matches apiVersion`, + status: 'warn', + }); + }); + + it('should pass when apiVersion matches sourceApiVersion', async () => { + getPropertyValueStub.onFirstCall().returns('55.0'); + resolveProjectConfigStub.onFirstCall().resolves({ sourceApiVersion: '55.0' }); + + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: '55.0', + sourceApiVersion: '55.0', + targetDevHubApiVersion: undefined, + targetOrgApiVersion: undefined, + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() NOT to be called').to.equal(0); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[0][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[0][1]).to.deep.equal({ + testName: `[${pluginName}] sourceApiVersion matches apiVersion`, + status: 'pass', + }); + }); + + it('should warn when both apiVersion and sourceApiVersion are not set', async () => { + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: undefined, + sourceApiVersion: undefined, + targetDevHubApiVersion: undefined, + targetOrgApiVersion: undefined, + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() to be called once').to.equal(1); + expect(addSuggestionStub.args[0][0]).to.equal(messages.getMessage('apiVersionUnset')); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[0][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[0][1]).to.deep.equal({ + testName: `[${pluginName}] sourceApiVersion matches apiVersion`, + status: 'warn', + }); + }); + + it('should warn when default devhub target org and default target org have different max apiVersions', async () => { + getPropertyValueStub.onSecondCall().returns('devhubOrg').onThirdCall().returns('scratchOrg'); + maxApiVersionStub.onFirstCall().resolves('55.0').onSecondCall().resolves('56.0'); + + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: undefined, + sourceApiVersion: undefined, + targetDevHubApiVersion: '55.0', + targetOrgApiVersion: '56.0', + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() to be called twice').to.equal(2); + expect(addSuggestionStub.args[1][0]).to.equal(messages.getMessage('maxApiVersionMismatch')); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[1][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[1][1]).to.deep.equal({ + testName: `[${pluginName}] default target DevHub max apiVersion matches default target org max apiVersion`, + status: 'warn', + }); + }); + + it('should warn when sourceApiVersion and default target org max apiVersion does not match', async () => { + const targetOrgApiVersion = '56.0'; + resolveProjectConfigStub.resolves({ sourceApiVersion: '55.0' }); + getPropertyValueStub.onThirdCall().returns('scratchOrg'); + maxApiVersionStub.onFirstCall().resolves(targetOrgApiVersion); + + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: undefined, + sourceApiVersion: '55.0', + targetDevHubApiVersion: undefined, + targetOrgApiVersion, + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() to be called once').to.equal(1); + expect(addSuggestionStub.args[0][0]).to.equal( + messages.getMessage('sourceApiVersionMaxMismatch', [targetOrgApiVersion]) + ); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[1][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[1][1]).to.deep.equal({ + testName: `[${pluginName}] sourceApiVersion matches default target org max apiVersion`, + status: 'warn', + }); + }); + + it('should warn when apiVersion and default target org max apiVersion does not match', async () => { + const targetOrgApiVersion = '56.0'; + getPropertyValueStub.onFirstCall().returns('55.0'); + getPropertyValueStub.onThirdCall().returns('scratchOrg'); + maxApiVersionStub.onFirstCall().resolves(targetOrgApiVersion); + + await hook({ doctor: doctorMock }); + + expect(addPluginDataStub.callCount, 'Expected doctor.addPluginData() to be called once').to.equal(1); + expect(addPluginDataStub.args[0][0]).to.equal(pluginName); + expect(addPluginDataStub.args[0][1]).to.deep.equal({ + apiVersion: '55.0', + sourceApiVersion: undefined, + targetDevHubApiVersion: undefined, + targetOrgApiVersion, + }); + expect(addSuggestionStub.callCount, 'Expected doctor.addSuggestion() to be called once').to.equal(1); + expect(addSuggestionStub.args[0][0]).to.equal(messages.getMessage('apiVersionMaxMismatch', [targetOrgApiVersion])); + expect(lifecycleEmitStub.called).to.be.true; + expect(lifecycleEmitStub.args[1][0]).to.equal('Doctor:diagnostic'); + expect(lifecycleEmitStub.args[1][1]).to.deep.equal({ + testName: `[${pluginName}] apiVersion matches default target org max apiVersion`, + status: 'warn', + }); + }); +}); diff --git a/yarn.lock b/yarn.lock index 5afec4eb..f53dedc8 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1180,6 +1180,11 @@ "@babel/helper-validator-identifier" "^7.22.5" to-fast-properties "^2.0.0" +"@colors/colors@1.5.0": + version "1.5.0" + resolved "https://registry.yarnpkg.com/@colors/colors/-/colors-1.5.0.tgz#bb504579c1cae923e6576a4f5da43d25f97bdbd9" + integrity sha512-ooWCrlZP11i8GImSjTHYHLkvFDP48nS4+204nGb1RiX/WXYHmJA2III9/e2DWVabCESdW7hBAEzHRqUn9OUVvQ== + "@commitlint/cli@^17.1.2": version "17.6.5" resolved "https://registry.yarnpkg.com/@commitlint/cli/-/cli-17.6.5.tgz#3a8abd6499f9d4aeafe3bf9201338ccb868a14b9" @@ -1442,6 +1447,15 @@ strip-ansi "^6.0.1" wrap-ansi "^6.2.0" +"@inquirer/input@^1.2.16": + version "1.2.16" + resolved "https://registry.yarnpkg.com/@inquirer/input/-/input-1.2.16.tgz#94d8765a47689e799fd55ed0361dedc8f554341b" + integrity sha512-Ou0LaSWvj1ni+egnyQ+NBtfM1885UwhRCMtsRt2bBO47DoC1dwtCa+ZUNgrxlnCHHF0IXsbQHYtIIjFGAavI4g== + dependencies: + "@inquirer/core" "^6.0.0" + "@inquirer/type" "^1.1.6" + chalk "^4.1.2" + "@inquirer/password@^1.1.16": version "1.1.16" resolved "https://registry.yarnpkg.com/@inquirer/password/-/password-1.1.16.tgz#37ddebbe37c6e76f8ad27d1f726aacdd7c423558" @@ -1985,7 +1999,7 @@ strip-ansi "6.0.1" ts-retry-promise "^0.8.0" -"@salesforce/core@^6.1.0", "@salesforce/core@^6.1.3", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.4", "@salesforce/core@^6.4.7", "@salesforce/core@^6.5.1", "@salesforce/core@^6.5.2": +"@salesforce/core@^6.1.0", "@salesforce/core@^6.1.3", "@salesforce/core@^6.4.1", "@salesforce/core@^6.4.2", "@salesforce/core@^6.4.4", "@salesforce/core@^6.4.7", "@salesforce/core@^6.5.1", "@salesforce/core@^6.5.2": version "6.5.3" resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-6.5.3.tgz#b1ceef7947b9046ab23e78e73851115fec86f4f9" integrity sha512-L4I2LrGyuXbNDCkoQdrMQ2sR/nhNIgRMLgpYNpOARZFIWKUsnjgBLVpUui+knCzjrQsOMoSwev+W0vp17iT76w== @@ -2068,6 +2082,23 @@ handlebars "^4.7.8" tslib "^2" +"@salesforce/plugin-info@^3.0.21": + version "3.0.21" + resolved "https://registry.yarnpkg.com/@salesforce/plugin-info/-/plugin-info-3.0.21.tgz#f5b4f5af315dce829c0d0abe49a8f51321b17fcb" + integrity sha512-j060NJicZLWlci35v50PP5XhKRwQ9yITycdUc8M3dBoELoJcK8EBT0pwuN1u7ypi49K2Lma1z+69nT9vSuh0Cw== + dependencies: + "@inquirer/input" "^1.2.16" + "@oclif/core" "^3.18.2" + "@salesforce/core" "^6.4.2" + "@salesforce/kit" "^3.0.15" + "@salesforce/sf-plugins-core" "^7.1.4" + got "^13.0.0" + marked "^4.3.0" + marked-terminal "^4.2.0" + open "^8.4.2" + proxy-agent "^6.3.1" + semver "^7.5.4" + "@salesforce/plugin-source@^2.11.4": version "2.11.4" resolved "https://registry.yarnpkg.com/@salesforce/plugin-source/-/plugin-source-2.11.4.tgz#03d8b7fd9787f09ae210d657d2b91fc433be3f90" @@ -2108,7 +2139,7 @@ chalk "^4" inquirer "^8.2.5" -"@salesforce/sf-plugins-core@^7.1.9": +"@salesforce/sf-plugins-core@^7.1.4", "@salesforce/sf-plugins-core@^7.1.9": version "7.1.9" resolved "https://registry.yarnpkg.com/@salesforce/sf-plugins-core/-/sf-plugins-core-7.1.9.tgz#b4ea2005096f2289160cfd4452afb51d53bdefb3" integrity sha512-nyl6Kh1IHbGxcbQSUoJcte3t4fvozaXuHQWkHExIMGKjvSp8fCnx4pra8NZRdg/HnbWWu6eIHV4b/cHdzKWjnQ== @@ -2206,6 +2237,11 @@ resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-4.6.0.tgz#3c7c9c46e678feefe7a2e5bb609d3dbd665ffb3f" integrity sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw== +"@sindresorhus/is@^5.2.0": + version "5.6.0" + resolved "https://registry.yarnpkg.com/@sindresorhus/is/-/is-5.6.0.tgz#41dd6093d34652cddb5d5bdeee04eafc33826668" + integrity sha512-TV7t8GKYaJWsn00tFDqBw8+Uqmr8A0fRU1tvTQhyZzGv0sJCGRQL3JGMI3ucuKo3XIZdUP+Lx7/gh2t3lewy7g== + "@sinonjs/commons@^1", "@sinonjs/commons@^1.3.0", "@sinonjs/commons@^1.6.0", "@sinonjs/commons@^1.7.0", "@sinonjs/commons@^1.8.1": version "1.8.6" resolved "https://registry.yarnpkg.com/@sinonjs/commons/-/commons-1.8.6.tgz#80c516a4dc264c2a69115e7578d62581ff455ed9" @@ -2766,6 +2802,13 @@ dependencies: defer-to-connect "^2.0.0" +"@szmarczak/http-timer@^5.0.1": + version "5.0.1" + resolved "https://registry.yarnpkg.com/@szmarczak/http-timer/-/http-timer-5.0.1.tgz#c7c1bf1141cdd4751b0399c8fc7b8b664cd5be3a" + integrity sha512-+PmQX0PiAYPMeVYe237LJAYvOMYW1j2rH5YROyS3b4CTVJum34HfRvKvAzozHAQG0TnHNdUfY9nCeUyRAs//cw== + dependencies: + defer-to-connect "^2.0.1" + "@tootallnate/once@1": version "1.1.2" resolved "https://registry.yarnpkg.com/@tootallnate/once/-/once-1.1.2.tgz#ccb91445360179a04e7fe6aff78c00ffc1eeaf82" @@ -2854,6 +2897,11 @@ resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.1.tgz#0ea7b61496902b95890dc4c3a116b60cb8dae812" integrity sha512-SZs7ekbP8CN0txVG2xVRH6EgKmEm31BOxA07vkFaETzZz1xh+cbt8BcI0slpymvwhx5dlFnQG2rTlPVQn+iRPQ== +"@types/http-cache-semantics@^4.0.2": + version "4.0.4" + resolved "https://registry.yarnpkg.com/@types/http-cache-semantics/-/http-cache-semantics-4.0.4.tgz#b979ebad3919799c979b17c72621c0bc0a31c6c4" + integrity sha512-1m0bIFVc7eJWyve9S0RnuRgcQqF/Xd5QsUZAZeQFr1Q3/p9JWoQQEqmVy+DPTNpGXwhgIetAoYF8JSc33q29QA== + "@types/inquirer@^8.2.3": version "8.2.10" resolved "https://registry.yarnpkg.com/@types/inquirer/-/inquirer-8.2.10.tgz#9444dce2d764c35bc5bb4d742598aaa4acb6561b" @@ -3259,7 +3307,7 @@ ansi-colors@4.1.1: resolved "https://registry.yarnpkg.com/ansi-colors/-/ansi-colors-4.1.1.tgz#cbb9ae256bf750af1eab344f229aa27fe94ba348" integrity sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA== -ansi-escapes@^4.2.1, ansi-escapes@^4.3.2: +ansi-escapes@^4.2.1, ansi-escapes@^4.3.1, ansi-escapes@^4.3.2: version "4.3.2" resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-4.3.2.tgz#6b2291d1db7d98b6521d5f1efa42d0f3a9feb65e" integrity sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ== @@ -3761,6 +3809,24 @@ cacheable-lookup@^5.0.3: resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-5.0.4.tgz#5a6b865b2c44357be3d5ebc2a467b032719a7005" integrity sha512-2/kNscPhpcxrOigMZzbiWF7dz8ilhb/nIHU3EyZiXWXpeq/au8qJ8VhdftMkty3n7Gj6HIGalQG8oiBNB3AJgA== +cacheable-lookup@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/cacheable-lookup/-/cacheable-lookup-7.0.0.tgz#3476a8215d046e5a3202a9209dd13fec1f933a27" + integrity sha512-+qJyx4xiKra8mZrcwhjMRMUhD5NR1R8esPkzIYxX96JiecFoxAXFuz/GpR3+ev4PE1WamHip78wV0vcmPQtp8w== + +cacheable-request@^10.2.8: + version "10.2.14" + resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-10.2.14.tgz#eb915b665fda41b79652782df3f553449c406b9d" + integrity sha512-zkDT5WAF4hSSoUgyfg5tFIxz8XQK+25W/TLVojJTMKBaxevLBBtLxgqguAuVQB8PVW79FVjHcU+GJ9tVbDZ9mQ== + dependencies: + "@types/http-cache-semantics" "^4.0.2" + get-stream "^6.0.1" + http-cache-semantics "^4.1.1" + keyv "^4.5.3" + mimic-response "^4.0.0" + normalize-url "^8.0.0" + responselike "^3.0.0" + cacheable-request@^7.0.2: version "7.0.4" resolved "https://registry.yarnpkg.com/cacheable-request/-/cacheable-request-7.0.4.tgz#7a33ebf08613178b403635be7b899d3e69bbe817" @@ -3993,6 +4059,15 @@ cli-spinners@^2.5.0, cli-spinners@^2.9.2: resolved "https://registry.yarnpkg.com/cli-spinners/-/cli-spinners-2.9.2.tgz#1773a8f4b9c4d6ac31563df53b3fc1d79462fe41" integrity sha512-ywqV+5MmyL4E7ybXgKys4DugZbX0FC6LnwrhjuykIjnK9k8OQacQ7axGKnjDXWNhns0xot3bZI5h55H8yo9cJg== +cli-table3@^0.6.0: + version "0.6.3" + resolved "https://registry.yarnpkg.com/cli-table3/-/cli-table3-0.6.3.tgz#61ab765aac156b52f222954ffc607a6f01dbeeb2" + integrity sha512-w5Jac5SykAeZJKntOxJCrm63Eg5/4dhMWIcuTbo9rpE+brgaSZo0RuNJZeOyMgsUdhDeojvgyQLmjI+K50ZGyg== + dependencies: + string-width "^4.2.0" + optionalDependencies: + "@colors/colors" "1.5.0" + cli-table@^0.3.1: version "0.3.11" resolved "https://registry.yarnpkg.com/cli-table/-/cli-table-0.3.11.tgz#ac69cdecbe81dccdba4889b9a18b7da312a9d3ee" @@ -4428,7 +4503,7 @@ defaults@^1.0.3: dependencies: clone "^1.0.2" -defer-to-connect@^2.0.0: +defer-to-connect@^2.0.0, defer-to-connect@^2.0.1: version "2.0.1" resolved "https://registry.yarnpkg.com/defer-to-connect/-/defer-to-connect-2.0.1.tgz#8016bdb4143e4632b77a3449c6236277de520587" integrity sha512-4tvttepXG1VaYGrRibk5EwJd1t4udunSOVMdLSAL6mId1ix438oPwPZMALY41FCijukO1L0twNcGsdzS7dHgDg== @@ -4442,6 +4517,11 @@ define-data-property@^1.0.1, define-data-property@^1.1.1: gopd "^1.0.1" has-property-descriptors "^1.0.0" +define-lazy-prop@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/define-lazy-prop/-/define-lazy-prop-2.0.0.tgz#3f7ae421129bcaaac9bc74905c98a0009ec9ee7f" + integrity sha512-Ds09qNh8yw3khSjiJjiUInaGX9xlqZDY7JVryGxdxV7NPeuqQfplOpQ66yJFZut3jLa5zOwkXw1g9EI2uKh4Og== + define-properties@^1.1.3, define-properties@^1.1.4, define-properties@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" @@ -5254,6 +5334,11 @@ foreground-child@^3.1.0: cross-spawn "^7.0.0" signal-exit "^4.0.1" +form-data-encoder@^2.1.2: + version "2.1.4" + resolved "https://registry.yarnpkg.com/form-data-encoder/-/form-data-encoder-2.1.4.tgz#261ea35d2a70d48d30ec7a9603130fa5515e9cd5" + integrity sha512-yDYSgNMraqvnxiEXO4hi88+YZxaHC6QKzb5N84iRCTDeRO7ZALpir/lVmf/uXUhnwUr2O4HU8s/n6x+yNjQkHw== + form-data@^4.0.0: version "4.0.0" resolved "https://registry.yarnpkg.com/form-data/-/form-data-4.0.0.tgz#93919daeaf361ee529584b9b31664dc12c9fa452" @@ -5411,7 +5496,7 @@ get-stream@^5.0.0, get-stream@^5.1.0: dependencies: pump "^3.0.0" -get-stream@^6.0.0: +get-stream@^6.0.0, get-stream@^6.0.1: version "6.0.1" resolved "https://registry.yarnpkg.com/get-stream/-/get-stream-6.0.1.tgz#a262d8eef67aced57c2852ad6167526a43cbf7b7" integrity sha512-ts6Wi+2j3jQjqi70w5AlN8DFnkSwC+MqmxEzdEALB2qXZYV3X/b1CTfgPLGJNMeAWxdPfU8FO1ms3NUfaHCPYg== @@ -5579,6 +5664,23 @@ got@^11, got@^11.8.6: p-cancelable "^2.0.0" responselike "^2.0.0" +got@^13.0.0: + version "13.0.0" + resolved "https://registry.yarnpkg.com/got/-/got-13.0.0.tgz#a2402862cef27a5d0d1b07c0fb25d12b58175422" + integrity sha512-XfBk1CxOOScDcMr9O1yKkNaQyy865NbYs+F7dr4H0LZMVgCj2Le59k6PqbNHoL5ToeaEQUYh6c6yMfVcc6SJxA== + dependencies: + "@sindresorhus/is" "^5.2.0" + "@szmarczak/http-timer" "^5.0.1" + cacheable-lookup "^7.0.0" + cacheable-request "^10.2.8" + decompress-response "^6.0.0" + form-data-encoder "^2.1.2" + get-stream "^6.0.1" + http2-wrapper "^2.1.10" + lowercase-keys "^3.0.0" + p-cancelable "^3.0.0" + responselike "^3.0.0" + graceful-fs@^4.1.15, graceful-fs@^4.1.2, graceful-fs@^4.1.5, graceful-fs@^4.1.6, graceful-fs@^4.2.0, graceful-fs@^4.2.11, graceful-fs@^4.2.4, graceful-fs@^4.2.6: version "4.2.11" resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" @@ -5785,6 +5887,14 @@ http2-wrapper@^1.0.0-beta.5.2: quick-lru "^5.1.1" resolve-alpn "^1.0.0" +http2-wrapper@^2.1.10: + version "2.2.1" + resolved "https://registry.yarnpkg.com/http2-wrapper/-/http2-wrapper-2.2.1.tgz#310968153dcdedb160d8b72114363ef5fce1f64a" + integrity sha512-V5nVw1PAOgfI3Lmeaj2Exmeg7fenjhRUgz1lPSezy1CuhPYbgQtbQj4jZfEAEMlaL+vupsvhjqCyjzob0yxsmQ== + dependencies: + quick-lru "^5.1.1" + resolve-alpn "^1.2.0" + https-proxy-agent@^5.0.0: version "5.0.1" resolved "https://registry.yarnpkg.com/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz#c59ef224a04fe8b754f3db0063a25ea30d0005d6" @@ -6048,7 +6158,7 @@ is-date-object@^1.0.1: dependencies: has-tostringtag "^1.0.0" -is-docker@^2.0.0: +is-docker@^2.0.0, is-docker@^2.1.1: version "2.2.1" resolved "https://registry.yarnpkg.com/is-docker/-/is-docker-2.2.1.tgz#33eeabe23cfe86f14bde4408a02c0cfb853acdaa" integrity sha512-F+i2BKsFrH66iaUFc0woD8sLy8getkwTwtOBjvs56Cx4CgJDeKQeqfz8wAYiSb8JOprWhHH5p77PbmYCvvUuXQ== @@ -6563,6 +6673,13 @@ keyv@^4.0.0: dependencies: json-buffer "3.0.1" +keyv@^4.5.3: + version "4.5.4" + resolved "https://registry.yarnpkg.com/keyv/-/keyv-4.5.4.tgz#a879a99e29452f942439f2a405e3af8b31d4de93" + integrity sha512-oxVHkHR/EJf2CNXnWxRLW6mg7JyCCUcG0DtEGmL2ctUo1PNTin1PUil+r/+4r5MpVgC/fn1kjsx7mjSujKqIpw== + dependencies: + json-buffer "3.0.1" + kind-of@^6.0.3: version "6.0.3" resolved "https://registry.yarnpkg.com/kind-of/-/kind-of-6.0.3.tgz#07c05034a6c349fa06e24fa35aa76db4580ce4dd" @@ -6814,6 +6931,11 @@ lowercase-keys@^2.0.0: resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-2.0.0.tgz#2603e78b7b4b0006cbca2fbcc8a3202558ac9479" integrity sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA== +lowercase-keys@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/lowercase-keys/-/lowercase-keys-3.0.0.tgz#c5e7d442e37ead247ae9db117a9d0a467c89d4f2" + integrity sha512-ozCC6gdQ+glXOQsveKD0YsDy8DSQFjDTz4zyzEHNV5+JP5D62LmfDZ6o1cycFx9ouG940M5dE8C8CTewdj2YWQ== + lru-cache@^5.1.1: version "5.1.1" resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" @@ -6937,6 +7059,18 @@ map-obj@^4.0.0: resolved "https://registry.yarnpkg.com/map-obj/-/map-obj-4.3.0.tgz#9304f906e93faae70880da102a9f1df0ea8bb05a" integrity sha512-hdN1wVrZbb29eBGiGjJbeP8JbKjq1urkHJ/LIP/NY48MZ1QVXUsQBV1G1zvYFHn1XE06cwjBsOI2K3Ulnj1YXQ== +marked-terminal@^4.2.0: + version "4.2.0" + resolved "https://registry.yarnpkg.com/marked-terminal/-/marked-terminal-4.2.0.tgz#593734a53cf9a4bb01ea961aa579bd21889ce502" + integrity sha512-DQfNRV9svZf0Dm9Cf5x5xaVJ1+XjxQW6XjFJ5HFkVyK52SDpj5PCBzS5X5r2w9nHr3mlB0T5201UMLue9fmhUw== + dependencies: + ansi-escapes "^4.3.1" + cardinal "^2.1.1" + chalk "^4.1.0" + cli-table3 "^0.6.0" + node-emoji "^1.10.0" + supports-hyperlinks "^2.1.0" + marked@^10.0.0: version "10.0.0" resolved "https://registry.yarnpkg.com/marked/-/marked-10.0.0.tgz#7fe1805bb908433d760e2de0fcc8841a2b2d745c" @@ -7050,6 +7184,11 @@ mimic-response@^3.1.0: resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-3.1.0.tgz#2d1d59af9c1b129815accc2c46a022a5ce1fa3c9" integrity sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ== +mimic-response@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/mimic-response/-/mimic-response-4.0.0.tgz#35468b19e7c75d10f5165ea25e75a5ceea7cf70f" + integrity sha512-e5ISH9xMYU0DzrT+jl8q2ze9D6eWBto+I8CNpe+VI+K2J/F/k3PdkdTdz4wvGVH4NTpo+NRYTVIuMQEMMcsLqg== + min-indent@^1.0.0: version "1.0.1" resolved "https://registry.yarnpkg.com/min-indent/-/min-indent-1.0.1.tgz#a63f681673b30571fbe8bc25686ae746eefa9869" @@ -7377,6 +7516,13 @@ no-case@^3.0.4: lower-case "^2.0.2" tslib "^2.0.3" +node-emoji@^1.10.0: + version "1.11.0" + resolved "https://registry.yarnpkg.com/node-emoji/-/node-emoji-1.11.0.tgz#69a0150e6946e2f115e9d7ea4df7971e2628301c" + integrity sha512-wo2DpQkQp7Sjm2A0cq+sN7EHKO6Sl0ctXeBdFZrL9T9+UywORbufTcTZxom8YqpLQt/FqNMUkOpkZrJVYSKD3A== + dependencies: + lodash "^4.17.21" + node-fetch@^2.6.1, node-fetch@^2.6.7, node-fetch@^2.6.9: version "2.7.0" resolved "https://registry.yarnpkg.com/node-fetch/-/node-fetch-2.7.0.tgz#d0f0fa6e3e2dc1d27efcd8ad99d550bda94d187d" @@ -7483,6 +7629,11 @@ normalize-url@^6.0.1: resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-6.1.0.tgz#40d0885b535deffe3f3147bec877d05fe4c5668a" integrity sha512-DlL+XwOy3NxAQ8xuC0okPgK46iuVNAK01YN7RueYBqqFeGsBjV9XmCAzAdgt+667bCl5kPh9EqKKDwnaPG1I7A== +normalize-url@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/normalize-url/-/normalize-url-8.0.0.tgz#593dbd284f743e8dcf6a5ddf8fadff149c82701a" + integrity sha512-uVFpKhj5MheNBJRTiMZ9pE/7hD1QTeEvugSJW/OmLzAp78PB5O6adfMNTvmfKhXBkvCzC+rqifWcVYpGFwTjnw== + npm-bundled@^1.1.1: version "1.1.2" resolved "https://registry.yarnpkg.com/npm-bundled/-/npm-bundled-1.1.2.tgz#944c78789bd739035b70baa2ca5cc32b8d860bc1" @@ -7777,6 +7928,15 @@ open@^7.0.0: is-docker "^2.0.0" is-wsl "^2.1.1" +open@^8.4.2: + version "8.4.2" + resolved "https://registry.yarnpkg.com/open/-/open-8.4.2.tgz#5b5ffe2a8f793dcd2aad73e550cb87b59cb084f9" + integrity sha512-7x81NCL719oNbsq/3mh+hVrAWmFuEYUqrq/Iw3kUzH8ReypT9QQ0BLoJS7/G9k6N81XjW4qHWtjWwe/9eLy1EQ== + dependencies: + define-lazy-prop "^2.0.0" + is-docker "^2.1.1" + is-wsl "^2.2.0" + optionator@^0.9.3: version "0.9.3" resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.3.tgz#007397d44ed1872fdc6ed31360190f81814e2c64" @@ -7814,6 +7974,11 @@ p-cancelable@^2.0.0: resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-2.1.1.tgz#aab7fbd416582fa32a3db49859c122487c5ed2cf" integrity sha512-BZOr3nRQHOntUjTrH8+Lh54smKHoHyur8We1V8DSMVrl5A2malOOwuJRnKRDjSnkoeBh4at6BwEnb5I7Jl31wg== +p-cancelable@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/p-cancelable/-/p-cancelable-3.0.0.tgz#63826694b54d61ca1c20ebcb6d3ecf5e14cd8050" + integrity sha512-mlVgR3PGuzlo0MmTdk4cXqXWlwQDLnONTAg6sm62XkMJEiRxN3GL3SffkYvqwonbkJBcrI7Uvv5Zh9yjvn2iUw== + p-finally@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/p-finally/-/p-finally-1.0.0.tgz#3fbcfb15b899a44123b34b6dcc18b724336a2cae" @@ -8541,7 +8706,7 @@ requires-port@^1.0.0: resolved "https://registry.yarnpkg.com/requires-port/-/requires-port-1.0.0.tgz#925d2601d39ac485e091cf0da5c6e694dc3dcaff" integrity sha512-KigOCHcocU3XODJxsu8i/j8T9tzT4adHiecwORRQ0ZZFcp7ahwXuRU1m+yuO90C5ZUyGeGfocHDI14M3L3yDAQ== -resolve-alpn@^1.0.0: +resolve-alpn@^1.0.0, resolve-alpn@^1.2.0: version "1.2.1" resolved "https://registry.yarnpkg.com/resolve-alpn/-/resolve-alpn-1.2.1.tgz#b7adbdac3546aaaec20b45e7d8265927072726f9" integrity sha512-0a1F4l73/ZFZOakJnQ3FvkJ2+gSTQWz/r2KE5OdDY0TxPm5h4GkqkWWfM47T7HsbnOtcJVEF4epCVy6u7Q3K+g== @@ -8579,6 +8744,13 @@ responselike@^2.0.0: dependencies: lowercase-keys "^2.0.0" +responselike@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/responselike/-/responselike-3.0.0.tgz#20decb6c298aff0dbee1c355ca95461d42823626" + integrity sha512-40yHxbNcl2+rzXvZuVkrYohathsSJlMTXKryG5y8uciHv1+xDLHQpgjG64JUO9nrEq2jGLH6IZ8BcZyw3wrweg== + dependencies: + lowercase-keys "^3.0.0" + restore-cursor@^3.1.0: version "3.1.0" resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-3.1.0.tgz#39f67c54b3a7a58cea5236d95cf0034239631f7e" @@ -9230,7 +9402,7 @@ supports-color@^7.0.0, supports-color@^7.1.0: dependencies: has-flag "^4.0.0" -supports-hyperlinks@^2.2.0: +supports-hyperlinks@^2.1.0, supports-hyperlinks@^2.2.0: version "2.3.0" resolved "https://registry.yarnpkg.com/supports-hyperlinks/-/supports-hyperlinks-2.3.0.tgz#3943544347c1ff90b15effb03fc14ae45ec10624" integrity sha512-RpsAZlpWcDwOPQA22aCH4J0t7L8JmAvsCxfOSEwm7cQs3LshN36QaTkwd70DnBOXDWGssw2eUoc8CaRWT0XunA==