@salesforce/packaging 0.0.20 → 0.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/lib/interfaces/packagingInterfacesAndType.d.ts +30 -5
- package/lib/package/index.d.ts +1 -0
- package/lib/package/index.js +1 -0
- package/lib/package/packageProfileApi.d.ts +12 -5
- package/lib/package/packageProfileApi.js +3 -3
- package/lib/package/packageVersion.d.ts +12 -15
- package/lib/package/packageVersion.js +28 -46
- package/lib/package/packageVersionCreate.d.ts +12 -32
- package/lib/package/packageVersionCreate.js +105 -305
- package/lib/package/packageVersionCreateRequest.d.ts +1 -1
- package/lib/package1/package1VersionList.d.ts +1 -1
- package/lib/package1/package1VersionList.js +1 -1
- package/lib/utils/packageUtils.d.ts +5 -19
- package/lib/utils/packageUtils.js +7 -148
- package/messages/messages.md +6 -30
- package/messages/packageVersionCreate.md +71 -0
- package/package.json +2 -2
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { Connection } from '@salesforce/core';
|
|
2
2
|
import { PackageVersionCreateRequestResult, PackageVersionCreateRequestQueryOptions } from '../interfaces';
|
|
3
3
|
export declare function list(options?: PackageVersionCreateRequestQueryOptions): Promise<PackageVersionCreateRequestResult[]>;
|
|
4
|
-
export declare function byId(packageVersionCreateRequestId:
|
|
4
|
+
export declare function byId(packageVersionCreateRequestId: string, connection: Connection): Promise<PackageVersionCreateRequestResult[]>;
|
|
@@ -2,7 +2,7 @@ import { Connection } from '@salesforce/core';
|
|
|
2
2
|
import { Package1Display } from '../interfaces';
|
|
3
3
|
/**
|
|
4
4
|
* Lists package versions available in dev org. If package ID is supplied, only list versions of that package,
|
|
5
|
-
*
|
|
5
|
+
* otherwise, list all package versions
|
|
6
6
|
*
|
|
7
7
|
* @param connection: sfdx-core Connection to the org
|
|
8
8
|
* @param metadataPackageId: optional, if present ID of package to list versions for (starts with 033)
|
|
@@ -9,7 +9,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
9
9
|
exports.package1VersionList = void 0;
|
|
10
10
|
/**
|
|
11
11
|
* Lists package versions available in dev org. If package ID is supplied, only list versions of that package,
|
|
12
|
-
*
|
|
12
|
+
* otherwise, list all package versions
|
|
13
13
|
*
|
|
14
14
|
* @param connection: sfdx-core Connection to the org
|
|
15
15
|
* @param metadataPackageId: optional, if present ID of package to list versions for (starts with 033)
|
|
@@ -2,7 +2,7 @@ import { Connection, NamedPackageDir, PackageDir, SfdcUrl, SfError, SfProject }
|
|
|
2
2
|
import { Duration } from '@salesforce/kit';
|
|
3
3
|
import { Many, Nullable } from '@salesforce/ts-types';
|
|
4
4
|
import { SaveError } from 'jsforce';
|
|
5
|
-
import {
|
|
5
|
+
import { PackageType, PackageVersionCreateRequestResult, PackagingSObjects } from '../interfaces';
|
|
6
6
|
export declare const VERSION_NUMBER_SEP = ".";
|
|
7
7
|
export declare type IdRegistryValue = {
|
|
8
8
|
prefix: string;
|
|
@@ -24,10 +24,9 @@ export declare const DEFAULT_PACKAGE_DIR: {
|
|
|
24
24
|
export declare const BY_PREFIX: IdRegistry;
|
|
25
25
|
export declare const BY_LABEL: IdRegistry;
|
|
26
26
|
export declare function validateId(idObj: Many<IdRegistryValue>, value: string): void;
|
|
27
|
-
export declare function validateIdNoThrow(idObj: Many<IdRegistryValue>, value: any):
|
|
28
|
-
export declare function validateVersionNumber(versionNumberString: string, supportedBuildNumberToken: string, supportedBuildNumberToken2
|
|
27
|
+
export declare function validateIdNoThrow(idObj: Many<IdRegistryValue>, value: any): IdRegistryValue | false;
|
|
28
|
+
export declare function validateVersionNumber(versionNumberString: string, supportedBuildNumberToken: string, supportedBuildNumberToken2?: string): string;
|
|
29
29
|
export declare function validatePatchVersion(connection: Connection, versionNumberString: string, packageId: string): Promise<void>;
|
|
30
|
-
export declare function validUrl(url: string): boolean;
|
|
31
30
|
export declare function isErrorFromSPVQueryRestriction(err: Error): boolean;
|
|
32
31
|
export declare function isErrorPackageNotAvailable(err: Error): boolean;
|
|
33
32
|
export declare function massageErrorMessage(err: Error): Error;
|
|
@@ -47,7 +46,7 @@ export declare function escapeInstallationKey(key?: string): Nullable<string>;
|
|
|
47
46
|
* @param connection For tooling query
|
|
48
47
|
* @throws Error with message when package2 cannot be found
|
|
49
48
|
*/
|
|
50
|
-
export declare function getPackageType(packageId: string, connection: Connection): Promise<
|
|
49
|
+
export declare function getPackageType(packageId: string, connection: Connection): Promise<PackageType>;
|
|
51
50
|
/**
|
|
52
51
|
* Given 04t the package type type (Managed, Unlocked, Locked(deprecated?))
|
|
53
52
|
*
|
|
@@ -99,20 +98,9 @@ export declare function getPackageVersionStrings(subscriberPackageVersionIds: st
|
|
|
99
98
|
*/
|
|
100
99
|
export declare function queryWithInConditionChunking<T = Record<string, unknown>>(query: string, items: string[], replaceToken: string, connection: Connection): Promise<T[]>;
|
|
101
100
|
/**
|
|
102
|
-
*
|
|
101
|
+
* Returns the number of items that can be included in a quoted comma-separated string (e.g., "'item1','item2'") not exceeding maxLength
|
|
103
102
|
*/
|
|
104
103
|
export declare function getInClauseItemsCount(items: string[], startIndex: number, maxLength: number): number;
|
|
105
|
-
/**
|
|
106
|
-
* Given a package descriptor, return the ancestor ID. This code was duplicated to scratchOrgInfoGenerator.getAncestorIds,
|
|
107
|
-
* changes here may need to be duplicated there until that code, and/or this code is moved to a separate plugin.
|
|
108
|
-
*
|
|
109
|
-
* @param packageDescriptorJson JSON for packageDirectories element in sfdx-project.json
|
|
110
|
-
* @param connection For tooling query
|
|
111
|
-
* @param project The project to use for looking up the ancestor ID
|
|
112
|
-
* @param versionNumberString The version number string to use for looking up the ancestor ID
|
|
113
|
-
* @param skipAncestorCheck If true, skip the check for the ancestor ID
|
|
114
|
-
*/
|
|
115
|
-
export declare function getAncestorId(packageDescriptorJson: PackageDir, connection: Connection, project: SfProject, versionNumberString: string, skipAncestorCheck: boolean): Promise<string>;
|
|
116
104
|
export declare function validateAncestorId(ancestorId: string, highestReleasedVersion: PackagingSObjects.Package2Version, explicitUseNoAncestor: boolean, isPatch: boolean, skipAncestorCheck: boolean, origSpecifiedAncestor: string): string;
|
|
117
105
|
export declare function getAncestorIdHighestRelease(connection: Connection, packageId: string, versionNumberString: string, explicitUseHighestRelease: boolean, skipAncestorCheck: boolean): Promise<{
|
|
118
106
|
finalAncestorId: string;
|
|
@@ -164,7 +152,5 @@ export declare function generatePackageAliasEntry(connection: Connection, projec
|
|
|
164
152
|
[p: string]: string;
|
|
165
153
|
};
|
|
166
154
|
}>;
|
|
167
|
-
export declare function getSoqlWhereClauseMaxLength(): number;
|
|
168
155
|
export declare function formatDate(date: Date): string;
|
|
169
156
|
export declare function combineSaveErrors(sObject: string, crudOperation: string, errors: SaveError[]): SfError;
|
|
170
|
-
export declare function resolveCanonicalPackageProperty(options: PackageVersionCreateOptions): "id" | "package";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.combineSaveErrors = exports.formatDate = exports.generatePackageAliasEntry = exports.pollForStatusWithInterval = exports.findOrCreatePackage = exports.getPackageAliasesFromId = exports.convertCamelCaseStringToSentence = exports.getPackageIdFromAlias = exports.getConfigPackageDirectory = exports.getConfigPackageDirectories = exports.getPackageVersionNumber = exports.concatVersion = exports.getAncestorIdHighestRelease = exports.validateAncestorId = exports.getInClauseItemsCount = exports.queryWithInConditionChunking = exports.getPackageVersionStrings = exports.getHasMetadataRemoved = exports.getContainerOptions = exports.getSubscriberPackageVersionId = exports.getPackageTypeBy04t = exports.getPackageType = exports.escapeInstallationKey = exports.getPackageVersionId = exports.applyErrorAction = exports.massageErrorMessage = exports.isErrorPackageNotAvailable = exports.isErrorFromSPVQueryRestriction = exports.validatePatchVersion = exports.validateVersionNumber = exports.validateIdNoThrow = exports.validateId = exports.BY_LABEL = exports.BY_PREFIX = exports.DEFAULT_PACKAGE_DIR = exports.POLL_INTERVAL_SECONDS = exports.SOQL_WHERE_CLAUSE_MAX_LENGTH = exports.INSTALL_URL_BASE = exports.VERSION_NUMBER_SEP = void 0;
|
|
4
4
|
/*
|
|
5
5
|
* Copyright (c) 2022, salesforce.com, inc.
|
|
6
6
|
* All rights reserved.
|
|
@@ -107,11 +107,6 @@ async function validatePatchVersion(connection, versionNumberString, packageId)
|
|
|
107
107
|
}
|
|
108
108
|
exports.validatePatchVersion = validatePatchVersion;
|
|
109
109
|
// TODO: let's get rid of this in favor of SfdcUrl.isValidUrl()
|
|
110
|
-
// check that the provided url has a valid format
|
|
111
|
-
function validUrl(url) {
|
|
112
|
-
return core_1.SfdcUrl.isValidUrl(url);
|
|
113
|
-
}
|
|
114
|
-
exports.validUrl = validUrl;
|
|
115
110
|
// determines if error is from malformed SubscriberPackageVersion query
|
|
116
111
|
// this is in place to allow cli to run against app version 214, where SPV queries
|
|
117
112
|
// do not require installation key
|
|
@@ -225,7 +220,7 @@ exports.escapeInstallationKey = escapeInstallationKey;
|
|
|
225
220
|
async function getPackageType(packageId, connection) {
|
|
226
221
|
const query = `SELECT ContainerOptions FROM Package2 WHERE id ='${packageId}'`;
|
|
227
222
|
const queryResult = await connection.tooling.query(query);
|
|
228
|
-
if (
|
|
223
|
+
if (queryResult.records.length === 0) {
|
|
229
224
|
throw messages.createError('errorInvalidPackageId', [packageId]);
|
|
230
225
|
}
|
|
231
226
|
return queryResult.records[0].ContainerOptions;
|
|
@@ -380,7 +375,7 @@ async function queryWithInConditionChunking(query, items, replaceToken, connecti
|
|
|
380
375
|
}
|
|
381
376
|
exports.queryWithInConditionChunking = queryWithInConditionChunking;
|
|
382
377
|
/**
|
|
383
|
-
*
|
|
378
|
+
* Returns the number of items that can be included in a quoted comma-separated string (e.g., "'item1','item2'") not exceeding maxLength
|
|
384
379
|
*/
|
|
385
380
|
// TODO: this function cannot handle a single item that is longer than maxLength - what to do, since this could be the root cause of an infinite loop?
|
|
386
381
|
function getInClauseItemsCount(items, startIndex, maxLength) {
|
|
@@ -401,106 +396,6 @@ function getInClauseItemsCount(items, startIndex, maxLength) {
|
|
|
401
396
|
return includedCount;
|
|
402
397
|
}
|
|
403
398
|
exports.getInClauseItemsCount = getInClauseItemsCount;
|
|
404
|
-
/**
|
|
405
|
-
* Given a package descriptor, return the ancestor ID. This code was duplicated to scratchOrgInfoGenerator.getAncestorIds,
|
|
406
|
-
* changes here may need to be duplicated there until that code, and/or this code is moved to a separate plugin.
|
|
407
|
-
*
|
|
408
|
-
* @param packageDescriptorJson JSON for packageDirectories element in sfdx-project.json
|
|
409
|
-
* @param connection For tooling query
|
|
410
|
-
* @param project The project to use for looking up the ancestor ID
|
|
411
|
-
* @param versionNumberString The version number string to use for looking up the ancestor ID
|
|
412
|
-
* @param skipAncestorCheck If true, skip the check for the ancestor ID
|
|
413
|
-
*/
|
|
414
|
-
async function getAncestorId(packageDescriptorJson, connection, project, versionNumberString, skipAncestorCheck) {
|
|
415
|
-
// eslint-disable-next-line complexity
|
|
416
|
-
return Promise.resolve().then(async () => {
|
|
417
|
-
// If an id property is present, use it. Otherwise, look up the package id from the package property.
|
|
418
|
-
const packageId = packageDescriptorJson['id'] ?? getPackageIdFromAlias(packageDescriptorJson.package, project);
|
|
419
|
-
// No need to proceed if Unlocked
|
|
420
|
-
const packageType = await getPackageType(packageId, connection);
|
|
421
|
-
if (packageType === 'Unlocked') {
|
|
422
|
-
return '';
|
|
423
|
-
}
|
|
424
|
-
let ancestorId = '';
|
|
425
|
-
// ancestorID can be alias, 05i, or 04t;
|
|
426
|
-
// validate and convert to 05i, as needed
|
|
427
|
-
const versionNumber = versionNumberString.split(exports.VERSION_NUMBER_SEP);
|
|
428
|
-
const isPatch = versionNumber[2] !== '0';
|
|
429
|
-
let origSpecifiedAncestor = packageDescriptorJson.ancestorId;
|
|
430
|
-
let highestReleasedVersion = null;
|
|
431
|
-
const explicitUseHighestRelease = packageDescriptorJson.ancestorId === versionNumber_1.BuildNumberToken.HIGHEST_VERSION_NUMBER_TOKEN ||
|
|
432
|
-
packageDescriptorJson.ancestorVersion === versionNumber_1.BuildNumberToken.HIGHEST_VERSION_NUMBER_TOKEN;
|
|
433
|
-
const explicitUseNoAncestor = packageDescriptorJson.ancestorId === versionNumber_1.BuildNumberToken.NONE_VERSION_NUMBER_TOKEN ||
|
|
434
|
-
packageDescriptorJson.ancestorVersion === versionNumber_1.BuildNumberToken.NONE_VERSION_NUMBER_TOKEN;
|
|
435
|
-
if ((explicitUseHighestRelease || explicitUseNoAncestor) &&
|
|
436
|
-
packageDescriptorJson.ancestorId &&
|
|
437
|
-
packageDescriptorJson.ancestorVersion) {
|
|
438
|
-
if (packageDescriptorJson.ancestorId !== packageDescriptorJson.ancestorVersion) {
|
|
439
|
-
// both ancestorId and ancestorVersion specified, HIGHEST and/or NONE are used, the values disagree
|
|
440
|
-
throw messages.createError('errorAncestorIdVersionHighestOrNoneMismatch', [
|
|
441
|
-
packageDescriptorJson.ancestorId,
|
|
442
|
-
packageDescriptorJson.ancestorVersion,
|
|
443
|
-
]);
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
if (explicitUseNoAncestor && skipAncestorCheck) {
|
|
447
|
-
return '';
|
|
448
|
-
}
|
|
449
|
-
else {
|
|
450
|
-
const result = await getAncestorIdHighestRelease(connection, packageId, versionNumberString, explicitUseHighestRelease, skipAncestorCheck);
|
|
451
|
-
if (result.finalAncestorId) {
|
|
452
|
-
return result.finalAncestorId;
|
|
453
|
-
}
|
|
454
|
-
highestReleasedVersion = result.highestReleasedVersion;
|
|
455
|
-
}
|
|
456
|
-
// at this point if explicitUseHighestRelease=true, we have returned the ancestorId or thrown an error
|
|
457
|
-
// highestReleasedVersion should be null only if skipAncestorCheck or if there is no existing released package version
|
|
458
|
-
if (!explicitUseNoAncestor && packageDescriptorJson.ancestorId) {
|
|
459
|
-
ancestorId = getPackageIdFromAlias(packageDescriptorJson.ancestorId, project);
|
|
460
|
-
validateId([exports.BY_LABEL.SUBSCRIBER_PACKAGE_VERSION_ID, exports.BY_LABEL.PACKAGE_VERSION_ID], ancestorId);
|
|
461
|
-
ancestorId = await getPackageVersionId(ancestorId, connection);
|
|
462
|
-
}
|
|
463
|
-
if (!explicitUseNoAncestor && packageDescriptorJson.ancestorVersion) {
|
|
464
|
-
const regNumbers = new RegExp('^[0-9]+$');
|
|
465
|
-
const versionNumber = packageDescriptorJson.ancestorVersion.split(exports.VERSION_NUMBER_SEP);
|
|
466
|
-
if (versionNumber.length < 3 ||
|
|
467
|
-
versionNumber.length > 4 ||
|
|
468
|
-
!versionNumber[0].match(regNumbers) ||
|
|
469
|
-
!versionNumber[1].match(regNumbers) ||
|
|
470
|
-
!versionNumber[2].match(regNumbers)) {
|
|
471
|
-
throw messages.createError('errorInvalidAncestorVersionFormat', [packageDescriptorJson.ancestorVersion]);
|
|
472
|
-
}
|
|
473
|
-
const query = 'SELECT Id, IsReleased FROM Package2Version ' +
|
|
474
|
-
`WHERE Package2Id = '${packageId}' AND MajorVersion = ${versionNumber[0]} AND MinorVersion = ${versionNumber[1]} AND PatchVersion = ${versionNumber[2]}`;
|
|
475
|
-
let queriedAncestorId;
|
|
476
|
-
const ancestorVersionResult = await connection.tooling.query(query);
|
|
477
|
-
if (!ancestorVersionResult || !ancestorVersionResult.totalSize) {
|
|
478
|
-
throw messages.createError('errorNoMatchingAncestor', [packageDescriptorJson.ancestorVersion, packageId]);
|
|
479
|
-
}
|
|
480
|
-
else {
|
|
481
|
-
const releasedAncestor = ancestorVersionResult.records.find((rec) => rec.IsReleased === true);
|
|
482
|
-
if (!releasedAncestor) {
|
|
483
|
-
throw messages.createError('errorAncestorNotReleased', [packageDescriptorJson.ancestorVersion]);
|
|
484
|
-
}
|
|
485
|
-
else {
|
|
486
|
-
queriedAncestorId = releasedAncestor.Id;
|
|
487
|
-
}
|
|
488
|
-
}
|
|
489
|
-
// check for discrepancy between queried ancestorId and descriptor's ancestorId
|
|
490
|
-
if (Object.prototype.hasOwnProperty.call(packageDescriptorJson, 'ancestorId') &&
|
|
491
|
-
ancestorId !== queriedAncestorId) {
|
|
492
|
-
throw messages.createError('errorAncestorIdVersionMismatch', [
|
|
493
|
-
packageDescriptorJson.ancestorVersion,
|
|
494
|
-
packageDescriptorJson.ancestorId,
|
|
495
|
-
]);
|
|
496
|
-
}
|
|
497
|
-
ancestorId = queriedAncestorId;
|
|
498
|
-
origSpecifiedAncestor = packageDescriptorJson.ancestorVersion;
|
|
499
|
-
}
|
|
500
|
-
return validateAncestorId(ancestorId, highestReleasedVersion, explicitUseNoAncestor, isPatch, skipAncestorCheck, origSpecifiedAncestor);
|
|
501
|
-
});
|
|
502
|
-
}
|
|
503
|
-
exports.getAncestorId = getAncestorId;
|
|
504
399
|
function validateAncestorId(ancestorId, highestReleasedVersion, explicitUseNoAncestor, isPatch, skipAncestorCheck, origSpecifiedAncestor) {
|
|
505
400
|
if (explicitUseNoAncestor) {
|
|
506
401
|
if (!highestReleasedVersion) {
|
|
@@ -700,6 +595,7 @@ async function pollForStatusWithInterval(id, retries, packageId, branch, withPro
|
|
|
700
595
|
// for multiple errors, display one per line prefixed with (x)
|
|
701
596
|
if (results[0].Error.length > 1) {
|
|
702
597
|
results[0].Error.forEach((error) => {
|
|
598
|
+
// eslint-disable-next-line @typescript-eslint/restrict-template-expressions
|
|
703
599
|
errors.push(`(${errors.length + 1}) ${error}`);
|
|
704
600
|
});
|
|
705
601
|
errors.unshift(messages.getMessage('versionCreateFailedWithMultipleErrors'));
|
|
@@ -718,7 +614,7 @@ async function pollForStatusWithInterval(id, retries, packageId, branch, withPro
|
|
|
718
614
|
message: '',
|
|
719
615
|
remainingTime,
|
|
720
616
|
});
|
|
721
|
-
logger.info(`Request in progress. Sleeping ${interval} seconds. Will wait a total of ${remainingTime.seconds} more seconds before timing out. Current Status='${convertCamelCaseStringToSentence(results[0]?.Status)}'`);
|
|
617
|
+
logger.info(`Request in progress. Sleeping ${interval.seconds} seconds. Will wait a total of ${remainingTime.seconds} more seconds before timing out. Current Status='${convertCamelCaseStringToSentence(results[0]?.Status)}'`);
|
|
722
618
|
remainingRetries--;
|
|
723
619
|
return { completed: false, payload: results[0] };
|
|
724
620
|
}
|
|
@@ -770,14 +666,9 @@ exports.generatePackageAliasEntry = generatePackageAliasEntry;
|
|
|
770
666
|
function _isStatusEqualTo(results, statuses) {
|
|
771
667
|
return results?.length <= 0 ? false : statuses?.some((status) => results[0].Status === status);
|
|
772
668
|
}
|
|
773
|
-
// added for unit testing
|
|
774
|
-
function getSoqlWhereClauseMaxLength() {
|
|
775
|
-
return exports.SOQL_WHERE_CLAUSE_MAX_LENGTH;
|
|
776
|
-
}
|
|
777
|
-
exports.getSoqlWhereClauseMaxLength = getSoqlWhereClauseMaxLength;
|
|
778
669
|
function formatDate(date) {
|
|
779
670
|
const pad = (num) => {
|
|
780
|
-
return num < 10 ? `0${num}` : num
|
|
671
|
+
return num < 10 ? `0${num}` : `${num}`;
|
|
781
672
|
};
|
|
782
673
|
return `${date.getFullYear()}-${pad(date.getMonth() + 1)}-${pad(date.getDate())} ${pad(date.getHours())}:${pad(date.getMinutes())}`;
|
|
783
674
|
}
|
|
@@ -787,39 +678,7 @@ function combineSaveErrors(sObject, crudOperation, errors) {
|
|
|
787
678
|
const fieldsString = error.fields?.length > 0 ? `Fields: [${error.fields.join(', ')}]` : '';
|
|
788
679
|
return `Error: ${error.errorCode} Message: ${error.message} ${fieldsString}`;
|
|
789
680
|
});
|
|
790
|
-
|
|
791
|
-
crudOperation,
|
|
792
|
-
sObject,
|
|
793
|
-
errorMessages.join(os.EOL),
|
|
794
|
-
]);
|
|
795
|
-
return sfError;
|
|
681
|
+
return messages.createError('errorDuringSObjectCRUDOperation', [crudOperation, sObject, errorMessages.join(os.EOL)]);
|
|
796
682
|
}
|
|
797
683
|
exports.combineSaveErrors = combineSaveErrors;
|
|
798
|
-
function resolveCanonicalPackageProperty(options) {
|
|
799
|
-
let canonicalPackageProperty;
|
|
800
|
-
if (!options.package) {
|
|
801
|
-
const packageValProp = this.getPackageValuePropertyFromDirectory(options.path, options);
|
|
802
|
-
options.package = packageValProp.packageValue;
|
|
803
|
-
canonicalPackageProperty = packageValProp.packageProperty;
|
|
804
|
-
}
|
|
805
|
-
else if (!options.path) {
|
|
806
|
-
canonicalPackageProperty = this.getPackagePropertyFromPackage(this.project.getPackageDirectories(), options);
|
|
807
|
-
options.path = this.getConfigPackageDirectoriesValue(this.project.getPackageDirectories(), 'path', canonicalPackageProperty, options.package, 'package', options);
|
|
808
|
-
}
|
|
809
|
-
else {
|
|
810
|
-
canonicalPackageProperty = this.getPackagePropertyFromPackage(this.project.getPackageDirectories(), options);
|
|
811
|
-
this.getConfigPackageDirectoriesValue(this.project.getPackageDirectories(), canonicalPackageProperty, 'path', options.path, 'path', options);
|
|
812
|
-
const expectedPackageId = this.getConfigPackageDirectoriesValue(this.packageDirs, canonicalPackageProperty, 'path', options.path, 'path', options);
|
|
813
|
-
// This will throw an error if the package id flag value doesn't match
|
|
814
|
-
// any of the :id values in the package dirs.
|
|
815
|
-
this.getConfigPackageDirectoriesValue(this.project.getPackageDirectories(), 'path', canonicalPackageProperty, options.package, 'package', options);
|
|
816
|
-
// This will throw an error if the package id flag value doesn't match
|
|
817
|
-
// the correct corresponding directory with that packageId.
|
|
818
|
-
if (options.package !== expectedPackageId) {
|
|
819
|
-
throw messages.createError('errorDirectoryIdMismatch', ['--path', options.path, '--package', options.package]);
|
|
820
|
-
}
|
|
821
|
-
}
|
|
822
|
-
return canonicalPackageProperty;
|
|
823
|
-
}
|
|
824
|
-
exports.resolveCanonicalPackageProperty = resolveCanonicalPackageProperty;
|
|
825
684
|
//# sourceMappingURL=packageUtils.js.map
|
package/messages/messages.md
CHANGED
|
@@ -177,14 +177,6 @@ Only one package in a Dev Hub is allowed per converted from first-generation pac
|
|
|
177
177
|
|
|
178
178
|
Multiple errors occurred:
|
|
179
179
|
|
|
180
|
-
# errorScriptsNotApplicableToUnlockedPackage
|
|
181
|
-
|
|
182
|
-
We can’t create the package version. This parameter is available only for second-generation managed packages. Create the package version without the postinstallscript or uninstallscript parameters.,
|
|
183
|
-
|
|
184
|
-
# errorAncestorNotApplicableToUnlockedPackage
|
|
185
|
-
|
|
186
|
-
Can’t create package version. Specifying an ancestor is available only for second-generation managed packages. Remove the ancestorId or ancestorVersion from your sfdx-project.json file, and then create the package version again.,
|
|
187
|
-
|
|
188
180
|
# itemDoesNotFitWithinMaxLength
|
|
189
181
|
|
|
190
182
|
When calculating the number of items to be included in query "%s", when formatted, was too long.
|
|
@@ -207,34 +199,14 @@ The %s value [%s], doesn’t match the %s value in any packageDirectories specif
|
|
|
207
199
|
|
|
208
200
|
The %s value, [%s], and %s value, [%s], were both found in sfdx-project.json but don’t match. If you supply both values, they must match the path and package values in one of the packageDirectories.,
|
|
209
201
|
|
|
210
|
-
#
|
|
211
|
-
|
|
212
|
-
The temp files are located at: %s.
|
|
213
|
-
|
|
214
|
-
# failedToCreatePVCRequest
|
|
215
|
-
|
|
216
|
-
Failed to create request %s: %s
|
|
217
|
-
|
|
218
|
-
# versionNumberNotFoundInDevHub
|
|
202
|
+
# errorInvalidPackageId
|
|
219
203
|
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
# noReleaseVersionFound
|
|
223
|
-
|
|
224
|
-
No released version was found in Dev Hub for package id %s and version number %s.
|
|
225
|
-
|
|
226
|
-
# noReleaseVersionFoundForBranch
|
|
227
|
-
|
|
228
|
-
No version number was found in Dev Hub for package id $s and branch %s and version number %s.
|
|
204
|
+
The provided package ID '%s' is invalid.
|
|
229
205
|
|
|
230
206
|
# packagingDirNotFoundInConfigFile
|
|
231
207
|
|
|
232
208
|
Config file %s does not contain a packaging directory for %s.
|
|
233
209
|
|
|
234
|
-
# unpackagedMDDirectoryDoesNotExist
|
|
235
|
-
|
|
236
|
-
Un-packaged metadata directory %s was specified but does not exist.
|
|
237
|
-
|
|
238
210
|
# directoryDoesNotExist
|
|
239
211
|
|
|
240
212
|
Directory %s does not exist.
|
|
@@ -255,3 +227,7 @@ Can't uninstall the package %s during uninstall request %s.
|
|
|
255
227
|
# uninstallErrorAction
|
|
256
228
|
|
|
257
229
|
Verify installed package ID and resolve errors, then try again.
|
|
230
|
+
|
|
231
|
+
# errorNoSubscriberPackageRecord
|
|
232
|
+
|
|
233
|
+
No subscriber package was found for seed id: %s'
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# errorPackageAndPackageIdCollision
|
|
2
|
+
|
|
3
|
+
You can’t have both "package" and "packageId" (deprecated) defined as dependencies in sfdx-project.json.
|
|
4
|
+
|
|
5
|
+
# errorDependencyPair
|
|
6
|
+
|
|
7
|
+
Dependency must specify either a subscriberPackageVersionId or both packageId and versionNumber: %s
|
|
8
|
+
|
|
9
|
+
# errorNoIdInHub
|
|
10
|
+
|
|
11
|
+
No package ID was found in Dev Hub for package ID: %s.
|
|
12
|
+
|
|
13
|
+
# versionNumberNotFoundInDevHub
|
|
14
|
+
|
|
15
|
+
No version number was found in Dev Hub for package id %s and branch %s and version number %s that resolved to build number %s.
|
|
16
|
+
|
|
17
|
+
# buildNumberResolvedForLatest
|
|
18
|
+
|
|
19
|
+
Dependency on package %s was resolved to version number %s, branch %s, %s.
|
|
20
|
+
|
|
21
|
+
# buildNumberResolvedForReleased
|
|
22
|
+
|
|
23
|
+
Dependency on package %s was resolved to the released version number %s, %s.
|
|
24
|
+
|
|
25
|
+
# noReleaseVersionFound
|
|
26
|
+
|
|
27
|
+
No released version was found in Dev Hub for package id %s and version number %s.
|
|
28
|
+
|
|
29
|
+
# noReleaseVersionFoundForBranch
|
|
30
|
+
|
|
31
|
+
No version number was found in Dev Hub for package id $s and branch %s and version number %s.
|
|
32
|
+
|
|
33
|
+
# tempFileLocation
|
|
34
|
+
|
|
35
|
+
The temp files are located at: %s.
|
|
36
|
+
|
|
37
|
+
# signupDuplicateSettingsSpecified
|
|
38
|
+
|
|
39
|
+
You cannot use 'settings' and 'orgPreferences' in your scratch definition file, please specify one or the other.
|
|
40
|
+
|
|
41
|
+
# unpackagedMDDirectoryDoesNotExist
|
|
42
|
+
|
|
43
|
+
Un-packaged metadata directory %s was specified but does not exist.
|
|
44
|
+
|
|
45
|
+
# errorEmptyPackageDirs
|
|
46
|
+
|
|
47
|
+
sfdx-project.json must contain a packageDirectories entry for a package. You can run the force:package:create command to auto-populate such an entry.
|
|
48
|
+
|
|
49
|
+
# failedToCreatePVCRequest
|
|
50
|
+
|
|
51
|
+
Failed to create request %s: %s
|
|
52
|
+
|
|
53
|
+
# errorScriptsNotApplicableToUnlockedPackage
|
|
54
|
+
|
|
55
|
+
We can’t create the package version. This parameter is available only for second-generation managed packages. Create the package version without the postinstallscript or uninstallscript parameters.
|
|
56
|
+
|
|
57
|
+
# errorAncestorNotApplicableToUnlockedPackage
|
|
58
|
+
|
|
59
|
+
Can’t create package version. Specifying an ancestor is available only for second-generation managed packages. Remove the ancestorId or ancestorVersion from your sfdx-project.json file, and then create the package version again.
|
|
60
|
+
|
|
61
|
+
# defaultVersionName
|
|
62
|
+
|
|
63
|
+
versionName is blank in sfdx-project.json, so it will be set to this default value based on the versionNumber: %s
|
|
64
|
+
|
|
65
|
+
# releaseNotesUrl
|
|
66
|
+
|
|
67
|
+
release notes URL
|
|
68
|
+
|
|
69
|
+
# postInstallUrl
|
|
70
|
+
|
|
71
|
+
post-install URL
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/packaging",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.21",
|
|
4
4
|
"description": "packing libraries to Salesforce packaging platform",
|
|
5
5
|
"main": "lib/exported",
|
|
6
6
|
"types": "lib/exported.d.ts",
|
|
@@ -35,7 +35,7 @@
|
|
|
35
35
|
"!lib/**/*.map"
|
|
36
36
|
],
|
|
37
37
|
"dependencies": {
|
|
38
|
-
"@salesforce/core": "^3.
|
|
38
|
+
"@salesforce/core": "^3.26.1",
|
|
39
39
|
"@salesforce/kit": "^1.5.44",
|
|
40
40
|
"@salesforce/schemas": "^1.2.0",
|
|
41
41
|
"@salesforce/source-deploy-retrieve": "^6.2.0",
|