@salesforce/packaging 0.0.2 → 0.0.3
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 +12 -0
- package/lib/exported.d.ts +1 -0
- package/lib/exported.js +1 -0
- package/lib/interfaces/index.d.ts +1 -0
- package/lib/interfaces/index.js +1 -0
- package/lib/interfaces/packagingInterfacesAndType.d.ts +29 -3
- package/lib/interfaces/packagingInterfacesAndType.js +6 -0
- package/lib/interfaces/packagingSObjects.d.ts +225 -0
- package/lib/interfaces/packagingSObjects.js +20 -0
- package/lib/package/index.d.ts +2 -1
- package/lib/package/index.js +2 -1
- package/lib/package/packageList.d.ts +4 -0
- package/lib/package/packageList.js +19 -0
- package/lib/package/{package2Version.d.ts → packageVersion2GP.d.ts} +2 -2
- package/lib/package/{package2Version.js → packageVersion2GP.js} +4 -4
- package/lib/package/packageVersionCreateRequestApi.d.ts +17 -0
- package/lib/package/packageVersionCreateRequestApi.js +92 -0
- package/lib/package1/index.d.ts +1 -1
- package/lib/package1/index.js +1 -1
- package/lib/package1/{package1Version.d.ts → packageVersion1GP.d.ts} +3 -3
- package/lib/package1/{package1Version.js → packageVersion1GP.js} +4 -4
- package/lib/utils/index.d.ts +1 -0
- package/lib/utils/index.js +24 -0
- package/lib/utils/packageUtils.d.ts +152 -0
- package/lib/utils/packageUtils.js +786 -0
- package/lib/utils/versionNumber.d.ts +16 -0
- package/lib/utils/versionNumber.js +56 -0
- package/messages/messages.md +191 -0
- package/package.json +2 -2
|
@@ -0,0 +1,152 @@
|
|
|
1
|
+
import { Connection, NamedPackageDir, PackageDir, SfProject } from '@salesforce/core';
|
|
2
|
+
import { Duration } from '@salesforce/kit';
|
|
3
|
+
import { Many } from '@salesforce/ts-types';
|
|
4
|
+
import { PackagingSObjects, Package2VersionCreateRequestResult } from '../interfaces';
|
|
5
|
+
import { PackageVersionCreateRequestApi } from '../package/packageVersionCreateRequestApi';
|
|
6
|
+
export declare const VERSION_NUMBER_SEP = ".";
|
|
7
|
+
export declare type IdRegistryValue = {
|
|
8
|
+
prefix: string;
|
|
9
|
+
label: string;
|
|
10
|
+
};
|
|
11
|
+
export declare type IdRegistry = {
|
|
12
|
+
[key: string]: IdRegistryValue;
|
|
13
|
+
};
|
|
14
|
+
export declare const INSTALL_URL_BASE = "https://login.salesforce.com/packaging/installPackage.apexp?p0=";
|
|
15
|
+
export declare const SOQL_WHERE_CLAUSE_MAX_LENGTH = 4000;
|
|
16
|
+
export declare const POLL_INTERVAL_SECONDS = 30;
|
|
17
|
+
export declare const DEFAULT_PACKAGE_DIR: {
|
|
18
|
+
path: string;
|
|
19
|
+
package: string;
|
|
20
|
+
versionName: string;
|
|
21
|
+
versionNumber: string;
|
|
22
|
+
default: boolean;
|
|
23
|
+
};
|
|
24
|
+
export declare const BY_PREFIX: IdRegistry;
|
|
25
|
+
export declare const BY_LABEL: IdRegistry;
|
|
26
|
+
export declare function validateId(idObj: Many<IdRegistryValue>, value: string): void;
|
|
27
|
+
export declare function validateIdNoThrow(idObj: Many<IdRegistryValue>, value: any): any;
|
|
28
|
+
export declare function validateVersionNumber(versionNumberString: string, supportedBuildNumberToken: string, supportedBuildNumberToken2: string): string;
|
|
29
|
+
export declare function validatePatchVersion(connection: Connection, versionNumberString: string, packageId: string): Promise<void>;
|
|
30
|
+
export declare function validUrl(url: string): boolean;
|
|
31
|
+
export declare function isErrorFromSPVQueryRestriction(err: Error): boolean;
|
|
32
|
+
export declare function isErrorPackageNotAvailable(err: Error): boolean;
|
|
33
|
+
export declare function massageErrorMessage(err: Error): Error;
|
|
34
|
+
export declare function applyErrorAction(err: Error): Error;
|
|
35
|
+
/**
|
|
36
|
+
* Given a subscriber package version ID (04t) or package version ID (05i), return the package version ID (05i)
|
|
37
|
+
*
|
|
38
|
+
* @param versionId The subscriber package version ID
|
|
39
|
+
* @param connection For tooling query
|
|
40
|
+
*/
|
|
41
|
+
export declare function getPackageVersionId(versionId: string, connection: Connection): Promise<string>;
|
|
42
|
+
/**
|
|
43
|
+
* Given 0Ho the package type type (Managed, Unlocked, Locked(deprecated?))
|
|
44
|
+
*
|
|
45
|
+
* @param package2Id the 0Ho
|
|
46
|
+
* @param connection For tooling query
|
|
47
|
+
* @throws Error with message when package2 cannot be found
|
|
48
|
+
*/
|
|
49
|
+
export declare function getPackage2Type(package2Id: string, connection: Connection): Promise<string>;
|
|
50
|
+
/**
|
|
51
|
+
* Given 04t the package type type (Managed, Unlocked, Locked(deprecated?))
|
|
52
|
+
*
|
|
53
|
+
* @param package2VersionId the 04t
|
|
54
|
+
* @param connection For tooling query
|
|
55
|
+
* @param installKey For tooling query, if an installation key is applicable to the package version it must be passed in the queries
|
|
56
|
+
* @throws Error with message when package2 cannot be found
|
|
57
|
+
*/
|
|
58
|
+
export declare function getPackage2TypeBy04t(package2VersionId: string, connection: Connection, installKey: string): Promise<string>;
|
|
59
|
+
/**
|
|
60
|
+
* Given a package version ID (05i) or subscriber package version ID (04t), return the subscriber package version ID (04t)
|
|
61
|
+
*
|
|
62
|
+
* @param versionId The suscriber package version ID
|
|
63
|
+
* @param connection For tooling query
|
|
64
|
+
*/
|
|
65
|
+
export declare function getSubscriberPackageVersionId(versionId: string, connection: Connection): Promise<string>;
|
|
66
|
+
/**
|
|
67
|
+
* Get the ContainerOptions for the specified Package2 (0Ho) IDs.
|
|
68
|
+
*
|
|
69
|
+
* @return Map of 0Ho id to container option api value
|
|
70
|
+
* @param package2Ids The list of package IDs
|
|
71
|
+
* @param connection For tooling query
|
|
72
|
+
*/
|
|
73
|
+
export declare function getContainerOptions(package2Ids: string[], connection: Connection): Promise<Map<string, string>>;
|
|
74
|
+
/**
|
|
75
|
+
* Return the Package2Version.HasMetadataRemoved field value for the given Id (05i)
|
|
76
|
+
*
|
|
77
|
+
* @param packageVersionId package version ID (05i)
|
|
78
|
+
* @param connection For tooling query
|
|
79
|
+
*/
|
|
80
|
+
export declare function getHasMetadataRemoved(packageVersionId: string, connection: Connection): Promise<boolean>;
|
|
81
|
+
/**
|
|
82
|
+
* Given a list of subscriber package version IDs (04t), return the associated version strings (e.g., Major.Minor.Patch.Build)
|
|
83
|
+
*
|
|
84
|
+
* @return Map of subscriberPackageVersionId to versionString
|
|
85
|
+
* @param subscriberPackageVersionIds
|
|
86
|
+
* @param connection For tooling query
|
|
87
|
+
*/
|
|
88
|
+
export declare function getPackageVersionStrings(subscriberPackageVersionIds: string[], connection: Connection): Promise<Map<string, string>>;
|
|
89
|
+
/**
|
|
90
|
+
* For queries with an IN condition, determine if the WHERE clause will exceed
|
|
91
|
+
* SOQL's 4000 character limit. Perform multiple queries as needed to stay below the limit.
|
|
92
|
+
*
|
|
93
|
+
* @return concatenated array of records returned from the resulting query(ies)
|
|
94
|
+
* @param query The full query to execute containing the replaceToken param in its IN clause
|
|
95
|
+
* @param items The IN clause items. A length-appropriate single-quoted comma-separated string chunk will be made from the items.
|
|
96
|
+
* @param replaceToken A placeholder in the query's IN condition that will be replaced with the chunked items
|
|
97
|
+
* @param connection For tooling query
|
|
98
|
+
*/
|
|
99
|
+
export declare function queryWithInConditionChunking<T = Record<string, unknown>>(query: string, items: string[], replaceToken: string, connection: Connection): Promise<T[]>;
|
|
100
|
+
/**
|
|
101
|
+
* Returns the number of items that can be included in a quoted comma-separated string (e.g., "'item1','item2'") not exceeding maxLength
|
|
102
|
+
*/
|
|
103
|
+
export declare function getInClauseItemsCount(items: string[], startIndex: number, maxLength: number): number;
|
|
104
|
+
/**
|
|
105
|
+
* Given a package descriptor, return the ancestor ID. This code was duplicated to scratchOrgInfoGenerator.getAncestorIds,
|
|
106
|
+
* changes here may need to be duplicated there until that code, and/or this code is moved to a separate plugin.
|
|
107
|
+
*
|
|
108
|
+
* @param packageDescriptorJson JSON for packageDirectories element in sfdx-project.json
|
|
109
|
+
* @param connection For tooling query
|
|
110
|
+
* @param project The project to use for looking up the ancestor ID
|
|
111
|
+
* @param versionNumberString The version number string to use for looking up the ancestor ID
|
|
112
|
+
* @param skipAncestorCheck If true, skip the check for the ancestor ID
|
|
113
|
+
*/
|
|
114
|
+
export declare function getAncestorId(packageDescriptorJson: PackageDir, connection: Connection, project: SfProject, versionNumberString: string, skipAncestorCheck: boolean): Promise<string>;
|
|
115
|
+
export declare function validateAncestorId(ancestorId: string, highestReleasedVersion: PackagingSObjects.Package2Version, explicitUseNoAncestor: boolean, isPatch: boolean, skipAncestorCheck: boolean, origSpecifiedAncestor: string): string;
|
|
116
|
+
export declare function getAncestorIdHighestRelease(connection: Connection, packageId: string, versionNumberString: string, explicitUseHighestRelease: boolean, skipAncestorCheck: boolean): Promise<{
|
|
117
|
+
finalAncestorId: string;
|
|
118
|
+
highestReleasedVersion: PackagingSObjects.Package2Version;
|
|
119
|
+
}>;
|
|
120
|
+
/**
|
|
121
|
+
* Return a version string in Major.Minor.Patch.Build format, using 0 for any empty part
|
|
122
|
+
*/
|
|
123
|
+
export declare function concatVersion(major: string | number, minor: string | number, patch: string | number, build: string | number): string;
|
|
124
|
+
export declare function getPackage2VersionNumber(package2VersionObj: PackagingSObjects.Package2Version): string;
|
|
125
|
+
export declare function getConfigPackageDirectories(project: SfProject): PackageDir[];
|
|
126
|
+
export declare function getConfigPackageDirectory(packageDirs: NamedPackageDir[], lookupProperty: string, lookupValue: unknown): NamedPackageDir | undefined;
|
|
127
|
+
/**
|
|
128
|
+
* Given a packageAlias, attempt to return the associated id from the config
|
|
129
|
+
*
|
|
130
|
+
* @param packageAlias string representing a package alias
|
|
131
|
+
* @param project for obtaining the project config
|
|
132
|
+
* @returns the associated id or the arg given.
|
|
133
|
+
*/
|
|
134
|
+
export declare function getPackageIdFromAlias(packageAlias: string, project: SfProject): string;
|
|
135
|
+
/**
|
|
136
|
+
* @param stringIn pascal or camel case string
|
|
137
|
+
* @returns space delimited and lower-cased (except for 1st char) string (e.g. in "AbcdEfghIj" => "Abcd efgh ij")
|
|
138
|
+
*/
|
|
139
|
+
export declare function convertCamelCaseStringToSentence(stringIn: string): string;
|
|
140
|
+
/**
|
|
141
|
+
* Given a package id, attempt to return the associated aliases from the config
|
|
142
|
+
*
|
|
143
|
+
* @param packageId string representing a package id
|
|
144
|
+
* @param project for obtaining the project config
|
|
145
|
+
* @returns an array of alias for the given id.
|
|
146
|
+
*/
|
|
147
|
+
export declare function getPackageAliasesFromId(packageId: string, project: SfProject): string[];
|
|
148
|
+
export declare function findOrCreatePackage2(seedPackage: string, connection: Connection): Promise<string>;
|
|
149
|
+
export declare function _getPackageVersionCreateRequestApi(connection: Connection): PackageVersionCreateRequestApi;
|
|
150
|
+
export declare function pollForStatusWithInterval(context: any, id: string, retries: number, packageId: string, branch: string, withProject: SfProject, connection: Connection, interval: Duration): Promise<Package2VersionCreateRequestResult>;
|
|
151
|
+
export declare function getSoqlWhereClauseMaxLength(): number;
|
|
152
|
+
export declare function formatDate(date: Date): string;
|