@salesforce/source-deploy-retrieve 9.8.3 → 9.8.5

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.
@@ -16,7 +16,9 @@
16
16
  */
17
17
  export declare class DecodeableMap<K extends string, V> extends Map<string, V> {
18
18
  private internalkeysMap;
19
+ private internalLogger;
19
20
  private get keysMap();
21
+ private get logger();
20
22
  /**
21
23
  * boolean indicating whether an element with the specified key (matching decoded) exists or not.
22
24
  */
@@ -1,12 +1,14 @@
1
1
  "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.DecodeableMap = void 0;
2
4
  /*
3
5
  * Copyright (c) 2023, salesforce.com, inc.
4
6
  * All rights reserved.
5
7
  * Licensed under the BSD 3-Clause license.
6
8
  * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
7
9
  */
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- exports.DecodeableMap = void 0;
10
+ const core_1 = require("@salesforce/core");
11
+ const ts_types_1 = require("@salesforce/ts-types");
10
12
  /**
11
13
  * This is an extension of the Map class that can match keys whether they are encoded or decoded.
12
14
  * Decoding the key can solve some edge cases in component fullNames such as Layouts and Profiles.
@@ -30,6 +32,12 @@ class DecodeableMap extends Map {
30
32
  }
31
33
  return this.internalkeysMap;
32
34
  }
35
+ get logger() {
36
+ if (!this.internalLogger) {
37
+ this.internalLogger = core_1.Logger.childFromRoot(this.constructor.name);
38
+ }
39
+ return this.internalLogger;
40
+ }
33
41
  /**
34
42
  * boolean indicating whether an element with the specified key (matching decoded) exists or not.
35
43
  */
@@ -68,22 +76,29 @@ class DecodeableMap extends Map {
68
76
  return key;
69
77
  }
70
78
  else {
71
- const decodedKey = decodeURIComponent(key);
72
- if (key !== decodedKey) {
73
- // The key is encoded; If this is part of a set operation,
74
- // set the { decodedKey : encodedKey } in the internal map.
75
- if (setInKeysMap) {
76
- this.keysMap.set(decodedKey, key);
79
+ try {
80
+ const decodedKey = decodeURIComponent(key);
81
+ if (key !== decodedKey) {
82
+ // The key is encoded; If this is part of a set operation,
83
+ // set the { decodedKey : encodedKey } in the internal map.
84
+ if (setInKeysMap) {
85
+ this.keysMap.set(decodedKey, key);
86
+ }
87
+ if (super.has(decodedKey)) {
88
+ return decodedKey;
89
+ }
77
90
  }
78
- if (super.has(decodedKey)) {
79
- return decodedKey;
91
+ else {
92
+ const encodedKey = this.keysMap.get(decodedKey);
93
+ if (encodedKey && super.has(encodedKey)) {
94
+ return encodedKey;
95
+ }
80
96
  }
81
97
  }
82
- else {
83
- const encodedKey = this.keysMap.get(decodedKey);
84
- if (encodedKey && super.has(encodedKey)) {
85
- return encodedKey;
86
- }
98
+ catch (e) {
99
+ // Log the error and the key
100
+ const errMsg = e instanceof Error ? e.message : (0, ts_types_1.isString)(e) ? e : 'unknown';
101
+ this.logger.debug(`Could not decode metadata key: ${key} due to: ${errMsg}`);
87
102
  }
88
103
  }
89
104
  }
@@ -1 +1 @@
1
- {"version":3,"file":"decodeableMap.js","sourceRoot":"","sources":["../../../src/collections/decodeableMap.ts"],"names":[],"mappings":";AAAA;;;;;GAKG;;;AAEH;;;;;;;;;;;;;;;GAeG;AACH,MAAa,aAAmC,SAAQ,GAAc;IAQpE,IAAY,OAAO;QACjB,IAAI,CAAC,IAAI,CAAC,eAAe,EAAE;YACzB,IAAI,CAAC,eAAe,GAAG,IAAI,GAAG,EAAE,CAAC;SAClC;QACD,OAAO,IAAI,CAAC,eAAe,CAAC;IAC9B,CAAC;IAED;;OAEG;IACI,GAAG,CAAC,GAAM;QACf,OAAO,CAAC,CAAC,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;IACpC,CAAC;IAED;;;;OAIG;IACI,GAAG,CAAC,GAAM;QACf,MAAM,WAAW,GAAG,IAAI,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC;QAC7C,OAAO,WAAW,CAAC,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC,C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D,CAAC;IAED,mFAAmF;IACnF,iFAAiF;IACjF,2DAA2D;IACnD,cAAc,CAAC,GAAM,EAAE,YAAY,GAAG,KAAK;QACjD,IAAI,KAAK,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE;YAClB,OAAO,GAAG,CAAC;SACZ;aAAM;YACL,IAAI;gBACF,MAAM,UAAU,GAAG,kBAAkB,CAAC,GAAG,CAAC,CAAC;gBAC3C,IAAI,GAAG,KAAK,UAAU,EAAE;oBACtB,0DAA0D;oBAC1D,2DAA2D;oBAC3D,IAAI,YAAY,EAAE;wBAChB,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,GAAG,CAAC,CAAC;qBACnC;oBACD,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;wBACzB,OAAO,UAAU,CAAC;qBACnB;iBACF;qBAAM;oBACL,MAAM,UAAU,GAAG,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;oBAChD,IAAI,UAAU,IAAI,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,EAAE;wBACvC,OAAO,UAAU,CAAC;qBACnB;iBACF;aACF;YAAC,OAAO,CAAU,EAAE;gBACnB,4BAA4B;gBAC5B,MAAM,MAAM,GAAG,CAAC,YAAY,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,IAAA,mBAAQ,EAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;gBAC5E,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,kCAAkC,GAAG,YAAY,MAAM,EAAE,CAAC,CAAC;aAC9E;SACF;IACH,CAAC;CACF;AAzFD,sCAyFC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/source-deploy-retrieve",
3
- "version": "9.8.3",
3
+ "version": "9.8.5",
4
4
  "description": "JavaScript library to run Salesforce metadata deploys and retrieves",
5
5
  "main": "lib/src/index.js",
6
6
  "author": "Salesforce",
@@ -25,7 +25,7 @@
25
25
  "node": ">=16.0.0"
26
26
  },
27
27
  "dependencies": {
28
- "@salesforce/core": "^5.3.16",
28
+ "@salesforce/core": "^5.3.17",
29
29
  "@salesforce/kit": "^3.0.15",
30
30
  "@salesforce/ts-types": "^2.0.9",
31
31
  "fast-levenshtein": "^3.0.0",
@@ -39,12 +39,12 @@
39
39
  "proxy-agent": "^6.3.1"
40
40
  },
41
41
  "devDependencies": {
42
- "@salesforce/cli-plugins-testkit": "^4.4.10",
42
+ "@salesforce/cli-plugins-testkit": "^4.4.12",
43
43
  "@salesforce/dev-scripts": "^6.0.3",
44
- "@salesforce/ts-sinon": "^1.4.18",
44
+ "@salesforce/ts-sinon": "^1.4.19",
45
45
  "@types/deep-equal-in-any-order": "^1.0.1",
46
46
  "@types/fast-levenshtein": "^0.0.3",
47
- "@types/graceful-fs": "^4.1.7",
47
+ "@types/graceful-fs": "^4.1.8",
48
48
  "@types/mime": "2.0.3",
49
49
  "@types/minimatch": "^5.1.2",
50
50
  "@types/proxy-from-env": "^1.0.3",