@salesforce/packaging 5.0.4 → 5.0.6

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.
@@ -30,9 +30,7 @@ export declare function uniqid(options?: {
30
30
  }): string;
31
31
  export declare function validateId(idObj: Many<IdRegistryValue>, value: string | undefined): void;
32
32
  export declare function validateIdNoThrow(idObj: Many<IdRegistryValue>, value: string): IdRegistryValue | boolean;
33
- export declare function applyErrorAction(err: Error & {
34
- action?: string;
35
- }): Error;
33
+ export declare function applyErrorAction(err: Error | SfError): Error;
36
34
  export declare function massageErrorMessage(err: Error): Error;
37
35
  /**
38
36
  * Given a subscriber package version ID (04t) or package version ID (05i), return the package version ID (05i)
@@ -150,11 +150,10 @@ function validateIdNoThrow(idObj, value) {
150
150
  // applies actions to common package errors
151
151
  // eslint-disable-next-line complexity
152
152
  function applyErrorAction(err) {
153
- // append when actions already exist
154
153
  const actions = [];
155
154
  // include existing actions
156
- if (err.action) {
157
- actions.push(err.action);
155
+ if (err instanceof core_1.SfError && err.actions?.length) {
156
+ actions.push(...err.actions);
158
157
  }
159
158
  // TODO: (need to get with packaging team on this)
160
159
  // until next generation packaging is GA, wrap perm-based errors w/
@@ -186,7 +185,12 @@ function applyErrorAction(err) {
186
185
  actions.push(messages.getMessage('idNotFoundAction'));
187
186
  }
188
187
  if (actions.length > 0) {
189
- err['action'] = actions.join('\n');
188
+ if (err instanceof core_1.SfError) {
189
+ err.actions = actions;
190
+ }
191
+ else {
192
+ err.actions = actions;
193
+ }
190
194
  }
191
195
  return err;
192
196
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/packaging",
3
- "version": "5.0.4",
3
+ "version": "5.0.6",
4
4
  "description": "Packaging library for the Salesforce packaging platform",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",
@@ -46,7 +46,7 @@
46
46
  "@salesforce/core": "^9.0.0",
47
47
  "@salesforce/kit": "^4.0.0",
48
48
  "@salesforce/schemas": "^1.10.3",
49
- "@salesforce/source-deploy-retrieve": "^13.0.0",
49
+ "@salesforce/source-deploy-retrieve": "^13.0.1",
50
50
  "@salesforce/ts-types": "^3.0.0",
51
51
  "@salesforce/types": "^1.8.0",
52
52
  "fast-xml-parser": "^5.10.1",