Skip to content

Commit

Permalink
fix: bump pkg lin to 0.0.42
Browse files Browse the repository at this point in the history
  • Loading branch information
peternhale committed Sep 27, 2022
1 parent 8694880 commit 7c98fdb
Show file tree
Hide file tree
Showing 11 changed files with 73 additions and 64 deletions.
4 changes: 4 additions & 0 deletions messages/package_install.md
Original file line number Diff line number Diff line change
Expand Up @@ -171,3 +171,7 @@ Waiting %s minutes for package install to complete.
# packageInstallWaitingStatus

%d minutes remaining until timeout. Install status: %s

# errorInvalidPackageId

The provided package ID '%s' is invalid.
10 changes: 5 additions & 5 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
"author": "Salesforce",
"bugs": "https://github.com/forcedotcom/cli/issues",
"dependencies": {
"@oclif/core": "^1.14.2",
"@salesforce/command": "^5.2.6",
"@salesforce/core": "^3.3.0",
"@salesforce/kit": "^1.6.0",
"@salesforce/packaging": "^0.0.36",
"@oclif/core": "^1.16.4",
"@salesforce/command": "^5.2.10",
"@salesforce/core": "^3.30.8",
"@salesforce/kit": "^1.6.1",
"@salesforce/packaging": "0.0.42",
"tslib": "^2",
"chalk": "^4.1.2"
},
Expand Down
6 changes: 3 additions & 3 deletions src/commands/force/package/beta/convert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,13 @@ import { flags, FlagsConfig, SfdxCommand } from '@salesforce/command';
import { Duration } from '@salesforce/kit';
import { Lifecycle, Messages, SfError, SfProject } from '@salesforce/core';
import {
convertCamelCaseStringToSentence,
INSTALL_URL_BASE,
Package,
PackageEvents,
PackageVersionCreateEventData,
PackageVersionCreateRequestResult,
} from '@salesforce/packaging';
import { camelCaseToTitleCase } from '@salesforce/kit';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_convert');
Expand Down Expand Up @@ -67,7 +67,7 @@ export class PackageConvert extends SfdxCommand {
this.ux.log(
`Request in progress. Sleeping 30 seconds. Will wait a total of ${
data.timeRemaining.seconds
} more seconds before timing out. Current Status='${convertCamelCaseStringToSentence(
} more seconds before timing out. Current Status='${camelCaseToTitleCase(
data.packageVersionCreateRequestResult.Status
)}'`
);
Expand Down Expand Up @@ -104,7 +104,7 @@ export class PackageConvert extends SfdxCommand {
);
break;
default:
this.ux.log(pvcMessages.getMessage('InProgress', [convertCamelCaseStringToSentence(result.Status), result.Id]));
this.ux.log(pvcMessages.getMessage('InProgress', [camelCaseToTitleCase(result.Status), result.Id]));
}

return result;
Expand Down
9 changes: 1 addition & 8 deletions src/commands/force/package/beta/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,7 @@
import * as os from 'os';
import { flags, FlagsConfig, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import {
applyErrorAction,
createPackage,
massageErrorMessage,
PackageCreateOptions,
PackageType,
} from '@salesforce/packaging';
import { applyErrorAction, createPackage, PackageCreateOptions, PackageType } from '@salesforce/packaging';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_create');
Expand Down Expand Up @@ -79,7 +73,6 @@ export class PackageCreateCommand extends SfdxCommand {
const result: { Id: string } = await createPackage(this.hubOrg.getConnection(), this.project, options).catch(
(err) => {
// TODO: until package2 is GA, wrap perm-based errors w/ 'contact sfdc' action (REMOVE once package2 is GA'd)
err = massageErrorMessage(err);
throw applyErrorAction(err);
}
);
Expand Down
3 changes: 1 addition & 2 deletions src/commands/force/package/beta/delete.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
import * as os from 'os';
import { flags, FlagsConfig, SfdxCommand } from '@salesforce/command';
import { Messages } from '@salesforce/core';
import { applyErrorAction, deletePackage, massageErrorMessage, PackageSaveResult } from '@salesforce/packaging';
import { applyErrorAction, deletePackage, PackageSaveResult } from '@salesforce/packaging';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_delete');
Expand Down Expand Up @@ -52,7 +52,6 @@ export class PackageDeleteCommand extends SfdxCommand {
!!this.flags.undelete
).catch((err) => {
// TODO: until package2 is GA, wrap perm-based errors w/ 'contact sfdc' action (REMOVE once package2 is GA'd)
err = massageErrorMessage(err);
throw applyErrorAction(err);
});
this.display(result);
Expand Down
22 changes: 21 additions & 1 deletion src/commands/force/package/beta/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ import { flags, FlagsConfig, SfdxCommand, UX } from '@salesforce/command';
import { Connection, Lifecycle, Messages, SfError, SfProject } from '@salesforce/core';
import { Duration } from '@salesforce/kit';
import {
getPackageTypeBy04t,
Package,
PackageEvents,
PackageInstallCreateRequest,
Expand All @@ -30,6 +29,27 @@ const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_
const securityType = { AllUsers: 'full', AdminsOnly: 'none' };
const upgradeType = { Delete: 'delete-only', DeprecateOnly: 'deprecate-only', Mixed: 'mixed-mode' };

async function getPackageTypeBy04t(
packageVersionId: string,
connection: Connection,
installKey?: string
): Promise<string> {
let query = `SELECT Package2ContainerOptions FROM SubscriberPackageVersion WHERE id ='${packageVersionId}'`;

if (installKey) {
const escapedInstallationKey = installKey.replace(/\\/g, '\\\\').replace(/'/g, "\\'");
query += ` AND InstallationKey ='${escapedInstallationKey}'`;
}

const queryResult = await connection.tooling.query<
Pick<PackagingSObjects.SubscriberPackageVersion, 'Package2ContainerOptions'>
>(query);
if (!queryResult || queryResult.records === null || queryResult.records.length === 0) {
throw messages.createError('errorInvalidPackageId', [packageVersionId]);
}
return queryResult.records[0].Package2ContainerOptions;
}

export class Install extends SfdxCommand {
public static readonly description = messages.getMessage('cliDescription');
public static readonly examples = messages.getMessage('examples').split(os.EOL);
Expand Down
5 changes: 2 additions & 3 deletions src/commands/force/package/beta/version/create.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@ import * as os from 'os';
import * as path from 'path';
import * as fs from 'fs';
import { flags, FlagsConfig, SfdxCommand } from '@salesforce/command';
import { Duration } from '@salesforce/kit';
import { Duration, camelCaseToTitleCase } from '@salesforce/kit';
import { Lifecycle, Messages } from '@salesforce/core';
import {
convertCamelCaseStringToSentence,
getPackageIdFromAlias,
INSTALL_URL_BASE,
PackageVersion,
Expand Down Expand Up @@ -214,7 +213,7 @@ export class PackageVersionCreateCommand extends SfdxCommand {
);
break;
default:
this.ux.log(messages.getMessage('InProgress', [convertCamelCaseStringToSentence(result.Status), result.Id]));
this.ux.log(messages.getMessage('InProgress', [camelCaseToTitleCase(result.Status), result.Id]));
}
return result;
}
Expand Down
3 changes: 2 additions & 1 deletion src/commands/force/package/beta/version/create/report.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import { Messages } from '@salesforce/core';
import * as pkgUtils from '@salesforce/packaging';
import { PackageVersion, PackageVersionCreateRequestResult } from '@salesforce/packaging';
import * as chalk from 'chalk';
import { camelCaseToTitleCase } from '@salesforce/kit';

Messages.importMessagesDirectory(__dirname);
const messages = Messages.loadMessages('@salesforce/plugin-packaging', 'package_version_create_report');
Expand Down Expand Up @@ -48,7 +49,7 @@ export class PackageVersionCreateReportCommand extends SfdxCommand {
},
{
key: pvclMessages.getMessage('status'),
value: pkgUtils.convertCamelCaseStringToSentence(record.Status),
value: camelCaseToTitleCase(record.Status),
},
{
key: pvclMessages.getMessage('packageId'),
Expand Down
6 changes: 0 additions & 6 deletions src/commands/force/package/beta/version/promote.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ import {
getHasMetadataRemoved,
getPackageIdFromAlias,
getPackageVersionId,
getSubscriberPackageVersionId,
PackageSaveResult,
PackageVersion,
validateId,
Expand Down Expand Up @@ -80,11 +79,6 @@ export class PackageVersionPromoteCommand extends SfdxCommand {
throw err;
}

if (packageId.startsWith('05i')) {
// we should print, and return the 04t id
result.id = await getSubscriberPackageVersionId(packageId, conn);
}

this.ux.log(messages.getMessage('humanSuccess', [result.id]));
return result;
}
Expand Down
1 change: 0 additions & 1 deletion test/commands/force/package/install.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,6 @@ describe('force:package:install', () => {
});

it('should confirm UpgradeType when NO --noprompt flag', async () => {
// stub the getPackageTypeBy04t() query to return an Unlocked package type
queryStub.resolves({
done: true,
totalSize: 1,
Expand Down
68 changes: 34 additions & 34 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -731,10 +731,10 @@
is-wsl "^2.1.1"
tslib "^2.3.1"

"@oclif/core@^1.0.8", "@oclif/core@^1.14.1", "@oclif/core@^1.14.2", "@oclif/core@^1.2.1", "@oclif/core@^1.3.4", "@oclif/core@^1.3.6", "@oclif/core@^1.6.4", "@oclif/core@^1.7.0", "@oclif/core@^1.9.0", "@oclif/core@^1.9.9":
version "1.16.0"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.16.0.tgz#4b53261eeb0c0244700bfc9eb41159d483436f21"
integrity sha512-xtqhAbjQHBcz+xQpEHJ3eJEVfRQ4zl41Yw5gw/N+D1jgaIUrHTxCY/sfTvhw93LAQo7B++ozHzSb7DISFXsQFQ==
"@oclif/core@^1.0.8", "@oclif/core@^1.14.1", "@oclif/core@^1.16.4", "@oclif/core@^1.2.1", "@oclif/core@^1.3.4", "@oclif/core@^1.3.6", "@oclif/core@^1.6.4", "@oclif/core@^1.7.0", "@oclif/core@^1.9.0", "@oclif/core@^1.9.9":
version "1.16.4"
resolved "https://registry.yarnpkg.com/@oclif/core/-/core-1.16.4.tgz#fafa338ada0624d7f1adac036302b05a37cd96d0"
integrity sha512-l+xHtVMteJWeTZZ+f2yLyNjf69X0mhAH8GILXnmoAGAemXbc1DVstvloxOouarvm9xyHHhquzO1Qg5l6xa1VIw==
dependencies:
"@oclif/linewrap" "^1.0.0"
"@oclif/screen" "^3.0.2"
Expand Down Expand Up @@ -1038,23 +1038,23 @@
strip-ansi "6.0.1"
ts-retry-promise "^0.7.0"

"@salesforce/command@^5.1.0", "@salesforce/command@^5.1.3", "@salesforce/command@^5.2.6":
version "5.2.6"
resolved "https://registry.yarnpkg.com/@salesforce/command/-/command-5.2.6.tgz#649e3c1ab2c4f5a71b1c908f95a644c1b398d7da"
integrity sha512-Rsvk8k4ZKwZiMD6STSTHMNPigqkr+hycuRwjm1pk57vDDSllVVa3R8yv0em1OoJsiyIH7l/zhRQ6IcZ7ObM7Jg==
"@salesforce/command@^5.1.0", "@salesforce/command@^5.1.3", "@salesforce/command@^5.2.10":
version "5.2.10"
resolved "https://registry.yarnpkg.com/@salesforce/command/-/command-5.2.10.tgz#e879444218fc2381cd386a6408019f1de990c6ae"
integrity sha512-Vtyih+a4vWPISJFQgXASqHSMFpYbeXSg1kA7VAq2FCgLnhepJVyA6Vx3leWq/h/fQDW4+QpfI4mg2siQO03ugw==
dependencies:
"@oclif/core" "^1.14.1"
"@oclif/plugin-help" "^5.1.11"
"@oclif/test" "^2.1.0"
"@salesforce/core" "^3.26.2"
"@salesforce/kit" "^1.6.0"
"@salesforce/ts-types" "^1.5.20"
"@salesforce/core" "^3.30.8"
"@salesforce/kit" "^1.6.1"
"@salesforce/ts-types" "^1.5.21"
chalk "^2.4.2"

"@salesforce/core@^3.15.5", "@salesforce/core@^3.19.5", "@salesforce/core@^3.20.1", "@salesforce/core@^3.24.1", "@salesforce/core@^3.26.1", "@salesforce/core@^3.26.2", "@salesforce/core@^3.3.0", "@salesforce/core@^3.30.0":
version "3.30.0"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-3.30.0.tgz#51c986aba5bb4b599fbff1d8c3f9e37508f9206f"
integrity sha512-qU48fYMBcqZOVAUXaRYUleuelqfR8CERc1LUTJwmufRocieCHSx9PVXVRDgWl9KW09xcDyv8hu8RL5IaAVfWKA==
"@salesforce/core@^3.15.5", "@salesforce/core@^3.19.5", "@salesforce/core@^3.20.1", "@salesforce/core@^3.24.1", "@salesforce/core@^3.26.1", "@salesforce/core@^3.30.0", "@salesforce/core@^3.30.8":
version "3.30.8"
resolved "https://registry.yarnpkg.com/@salesforce/core/-/core-3.30.8.tgz#e40ee555b4eae5c74ae337d74c5db5a8f0d5fc59"
integrity sha512-5ixL5R9F600RfHtskuFLossGWAa2BDzysQk6Ns5OsHLY87U/1bH8edf+fubamf3aDaZaMIrcBoucQ2OJVmPtYw==
dependencies:
"@salesforce/bunyan" "^2.0.0"
"@salesforce/kit" "^1.5.41"
Expand Down Expand Up @@ -1119,23 +1119,23 @@
typedoc-plugin-external-module-name "~4.0.0"
typescript "^4.1.3"

"@salesforce/kit@^1.5.17", "@salesforce/kit@^1.5.41", "@salesforce/kit@^1.5.42", "@salesforce/kit@^1.6.0":
version "1.6.0"
resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.6.0.tgz#0305dea2c9847d4b08068c4a9d436da5c9a5ce5e"
integrity sha512-8VZvWYl61jBaUIqo+pNoDvVqaZKPmqauvkhJHvcr/+D7+EXsjne9PDMggy5mNQJvonD6iegR/h3BqcWrppSaeQ==
"@salesforce/kit@^1.5.17", "@salesforce/kit@^1.5.41", "@salesforce/kit@^1.5.42", "@salesforce/kit@^1.6.0", "@salesforce/kit@^1.6.1":
version "1.6.1"
resolved "https://registry.yarnpkg.com/@salesforce/kit/-/kit-1.6.1.tgz#73a16205f957e527b2cc9bfcebc55b6880f3169b"
integrity sha512-ZuQrzUo1jili5xl9LbJOsIra07C4FIRy5f9PLGi8lXEKGIJ2qg21VCLlREGV5tz5Qm1aYsCYW9rjQQzME1ou8Q==
dependencies:
"@salesforce/ts-types" "^1.5.20"
"@salesforce/ts-types" "^1.5.21"
shx "^0.3.3"
tslib "^2.2.0"

"@salesforce/packaging@^0.0.36":
version "0.0.36"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-0.0.36.tgz#43145ad2ab61ae189babfdac9ae8ff449b0e94a0"
integrity sha512-P+/i954ZxeV8s56BIGYU/oczmkqVqYYfKR3vwXwvMcQLSqORcxfWy8o6Bfk/rxyVEKWQ41cCom31+lGwInCSlA==
"@salesforce/packaging@0.0.42":
version "0.0.42"
resolved "https://registry.yarnpkg.com/@salesforce/packaging/-/packaging-0.0.42.tgz#8c41f796867f36af119cfaa2f33647ad0b1ee95c"
integrity sha512-wQ9Ay+la5m403GUTmWbr4j6mq5wTsYVBo+qZgybvVusRNi1iuOt8dMIEiPFQvFxwlJFL3JPNNdx80Z2cDjkITQ==
dependencies:
"@oclif/core" "^1.14.2"
"@oclif/core" "^1.16.4"
"@salesforce/core" "^3.30.0"
"@salesforce/kit" "^1.6.0"
"@salesforce/kit" "^1.6.1"
"@salesforce/schemas" "^1.2.0"
"@salesforce/source-deploy-retrieve" "^6.2.0"
"@salesforce/ts-types" "^1.5.20"
Expand All @@ -1147,9 +1147,9 @@
graphology-types "^0.24.4"
js2xmlparser "^4.0.2"
jsforce beta
jszip "^3.10.0"
jszip "^3.10.1"
mkdirp "1.0.4"
ts-retry-promise "^0.6.1"
ts-retry-promise "^0.7.0"
xml2js "^0.4.23"

"@salesforce/plugin-auth@^2.2.3":
Expand Down Expand Up @@ -1227,10 +1227,10 @@
sinon "^5.1.1"
tslib "^2.2.0"

"@salesforce/ts-types@^1.5.17", "@salesforce/ts-types@^1.5.20":
version "1.5.20"
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-1.5.20.tgz#f6875a710ceca48223b240026a14af6d3b39882f"
integrity sha512-Ov6um4CWd63EvkRavkHG0J/P9XYL55sdkDWPMr7+AIgqh5flHxDRz09/C4e9M94aX30rzJxW4TVX6EBf4Cu2BQ==
"@salesforce/ts-types@^1.5.17", "@salesforce/ts-types@^1.5.20", "@salesforce/ts-types@^1.5.21":
version "1.5.21"
resolved "https://registry.yarnpkg.com/@salesforce/ts-types/-/ts-types-1.5.21.tgz#e62784872f0e74bf4ae13381dc58aa4644ee2df3"
integrity sha512-qG8r8WOzqpFOHaH3EGU3IwGrY/pSv9NQp4B0wGxOuPDBbraXVvd3KhWVStxaLGKBkJClJ7/+t+iCSP82sEiGcg==
dependencies:
tslib "^2.2.0"

Expand Down Expand Up @@ -5066,7 +5066,7 @@ jsonwebtoken@8.5.1:
ms "^2.1.1"
semver "^5.6.0"

jszip@^3.10.0:
jszip@^3.10.1:
version "3.10.1"
resolved "https://registry.yarnpkg.com/jszip/-/jszip-3.10.1.tgz#34aee70eb18ea1faec2f589208a157d1feb091c2"
integrity sha512-xXDvecyTpGLrqFrvkrUSoxxfJI5AH7U8zxxtVclpsUtMCq4JQ290LY8AW5c7Ggnr/Y/oK+bQMbqK2qmtk3pN4g==
Expand Down Expand Up @@ -7829,7 +7829,7 @@ ts-node@^10.0.0, ts-node@^10.8.1:
v8-compile-cache-lib "^3.0.1"
yn "3.1.1"

ts-retry-promise@^0.6.0, ts-retry-promise@^0.6.1:
ts-retry-promise@^0.6.0:
version "0.6.2"
resolved "https://registry.yarnpkg.com/ts-retry-promise/-/ts-retry-promise-0.6.2.tgz#6925149cd5da40c536f704269232ab3966271d06"
integrity sha512-QFnm3RuFivgkQGKm8XX7F7sAMQEI7pzVkfSlcWMYH+MoIRy7BI3sE8135YPapP8Fra5KgAuOq2QFT969N14cAw==
Expand Down

0 comments on commit 7c98fdb

Please sign in to comment.