@salesforce/core 3.15.4 → 3.16.1

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 CHANGED
@@ -2,6 +2,28 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ ### [3.16.1](https://github.com/forcedotcom/sfdx-core/compare/v3.16.0...v3.16.1) (2022-05-11)
6
+
7
+ ### Bug Fixes
8
+
9
+ - homedir can change after Core loads ([bb1e4f5](https://github.com/forcedotcom/sfdx-core/commit/bb1e4f5b1f59269f6d48a5389b1d76eeee252db0))
10
+
11
+ ## [3.16.0](https://github.com/forcedotcom/sfdx-core/compare/v3.15.5...v3.16.0) (2022-05-04)
12
+
13
+ ### Features
14
+
15
+ - force v3 release ([05620c8](https://github.com/forcedotcom/sfdx-core/commit/05620c80256052a1b814b631e9afd951d63bea9e))
16
+
17
+ ### Bug Fixes
18
+
19
+ - disable schemaValidation ([#578](https://github.com/forcedotcom/sfdx-core/issues/578)) ([9b60cb4](https://github.com/forcedotcom/sfdx-core/commit/9b60cb4dd3181f0bfbafadb72bcd0904e851084f))
20
+
21
+ ### [3.15.5](https://github.com/forcedotcom/sfdx-core/compare/v3.15.4...v3.15.5) (2022-05-03)
22
+
23
+ ### Bug Fixes
24
+
25
+ - SfdxConfigAggregator ([238ad07](https://github.com/forcedotcom/sfdx-core/commit/238ad0757cc332ecc1897bd7230140a31a559332))
26
+
5
27
  ### [3.15.4](https://github.com/forcedotcom/sfdx-core/compare/v3.15.3...v3.15.4) (2022-05-03)
6
28
 
7
29
  ### Bug Fixes
@@ -219,7 +219,7 @@ export declare namespace ConfigAggregator {
219
219
  * @deprecated
220
220
  */
221
221
  export declare class SfdxConfigAggregator extends ConfigAggregator {
222
- constructor(options?: ConfigAggregator.Options);
222
+ static create<P, T extends AsyncOptionalCreatable<P>>(this: new (options?: ConfigAggregator.Options) => T, options?: ConfigAggregator.Options): Promise<T>;
223
223
  getPropertyMeta(key: string): ConfigPropertyMeta;
224
224
  getPropertyValue<T extends AnyJson>(key: string): Optional<T>;
225
225
  getInfo(key: string): ConfigInfo;
@@ -313,14 +313,14 @@ ConfigAggregator.encrypted = true;
313
313
  * @deprecated
314
314
  */
315
315
  class SfdxConfigAggregator extends ConfigAggregator {
316
- constructor(options = {}) {
316
+ static async create(options = {}) {
317
317
  const customConfigMeta = options.customConfigMeta || [];
318
318
  // org-metadata-rest-deploy has been moved to plugin-deploy-retrieve but we need to have a placeholder
319
319
  // for it here since sfdx needs to know how to set the deprecated restDeploy config var.
320
320
  const restDeploy = config_1.SFDX_ALLOWED_PROPERTIES.find((p) => p.key === config_1.SfdxPropertyKeys.REST_DEPLOY);
321
321
  const orgRestDeploy = Object.assign({}, restDeploy, { key: 'org-metadata-rest-deploy', deprecated: false });
322
322
  options.customConfigMeta = [...customConfigMeta, orgRestDeploy];
323
- super(options);
323
+ return super.create(options);
324
324
  }
325
325
  getPropertyMeta(key) {
326
326
  const match = this.getAllowedProperties().find((element) => key === element.key);
@@ -317,7 +317,7 @@ const _darwinImpl = {
317
317
  }
318
318
  },
319
319
  };
320
- const secretFile = path.join((0, os_1.homedir)(), global_1.Global.SFDX_STATE_FOLDER, 'key.json');
320
+ const getSecretFile = () => path.join(global_1.Global.SFDX_DIR, 'key.json');
321
321
  var SecretField;
322
322
  (function (SecretField) {
323
323
  SecretField["SERVICE"] = "service";
@@ -331,6 +331,7 @@ async function _writeFile(opts, fn) {
331
331
  [SecretField.KEY]: opts.password,
332
332
  [SecretField.SERVICE]: opts.service,
333
333
  };
334
+ const secretFile = getSecretFile();
334
335
  await mkdirp(path.dirname(secretFile));
335
336
  await fs.promises.writeFile(secretFile, JSON.stringify(contents, null, 4), { mode: '600' });
336
337
  fn(null, contents);
@@ -341,7 +342,7 @@ async function _writeFile(opts, fn) {
341
342
  }
342
343
  async function _readFile() {
343
344
  // The file and access is validated before this method is called
344
- const fileContents = (0, kit_1.parseJsonMap)(await fs.promises.readFile(secretFile, 'utf8'));
345
+ const fileContents = (0, kit_1.parseJsonMap)(await fs.promises.readFile(getSecretFile(), 'utf8'));
345
346
  return {
346
347
  account: (0, ts_types_1.ensureString)(fileContents[SecretField.ACCOUNT]),
347
348
  password: (0, ts_types_1.asString)(fileContents[SecretField.KEY]),
@@ -368,7 +369,7 @@ class GenericKeychainAccess {
368
369
  else {
369
370
  // if the service and account names don't match then maybe someone or something is editing
370
371
  // that file. #donotallow
371
- fn(messages.createError('genericKeychainServiceError', [secretFile]));
372
+ fn(messages.createError('genericKeychainServiceError', [getSecretFile()]));
372
373
  }
373
374
  }
374
375
  catch (readJsonErr) {
@@ -428,6 +429,7 @@ class GenericUnixKeychainAccess extends GenericKeychainAccess {
428
429
  await cb(err);
429
430
  }
430
431
  else {
432
+ const secretFile = getSecretFile();
431
433
  const stats = await fs.promises.stat(secretFile);
432
434
  const octalModeStr = (stats.mode & 0o777).toString(8);
433
435
  const EXPECTED_OCTAL_PERM_VALUE = '600';
@@ -453,7 +455,7 @@ class GenericWindowsKeychainAccess extends GenericKeychainAccess {
453
455
  }
454
456
  else {
455
457
  try {
456
- await fs.promises.access(secretFile, fs.constants.R_OK | fs.constants.W_OK);
458
+ await fs.promises.access(getSecretFile(), fs.constants.R_OK | fs.constants.W_OK);
457
459
  await cb(null);
458
460
  }
459
461
  catch (e) {
package/lib/global.d.ts CHANGED
@@ -33,13 +33,13 @@ export declare class Global {
33
33
  *
34
34
  * **See** {@link Global.SFDX_STATE_FOLDER}
35
35
  */
36
- static readonly SFDX_DIR: string;
36
+ static get SFDX_DIR(): string;
37
37
  /**
38
38
  * The full system path to the global sf state folder.
39
39
  *
40
40
  * **See** {@link Global.SF_STATE_FOLDER}
41
41
  */
42
- static readonly SF_DIR: string;
42
+ static get SF_DIR(): string;
43
43
  /**
44
44
  * The full system path to the global log file.
45
45
  */
package/lib/global.js CHANGED
@@ -28,6 +28,22 @@ var Mode;
28
28
  * Global constants, methods, and configuration.
29
29
  */
30
30
  class Global {
31
+ /**
32
+ * The full system path to the global sfdx state folder.
33
+ *
34
+ * **See** {@link Global.SFDX_STATE_FOLDER}
35
+ */
36
+ static get SFDX_DIR() {
37
+ return path.join(os.homedir(), Global.SFDX_STATE_FOLDER);
38
+ }
39
+ /**
40
+ * The full system path to the global sf state folder.
41
+ *
42
+ * **See** {@link Global.SF_STATE_FOLDER}
43
+ */
44
+ static get SF_DIR() {
45
+ return path.join(os.homedir(), Global.SF_STATE_FOLDER);
46
+ }
31
47
  /**
32
48
  * Gets the current mode environment variable as a {@link Mode} instance.
33
49
  *
@@ -64,18 +80,6 @@ Global.SFDX_STATE_FOLDER = '.sfdx';
64
80
  * The global folder in which sf state is stored.
65
81
  */
66
82
  Global.SF_STATE_FOLDER = '.sf';
67
- /**
68
- * The full system path to the global sfdx state folder.
69
- *
70
- * **See** {@link Global.SFDX_STATE_FOLDER}
71
- */
72
- Global.SFDX_DIR = path.join(os.homedir(), Global.SFDX_STATE_FOLDER);
73
- /**
74
- * The full system path to the global sf state folder.
75
- *
76
- * **See** {@link Global.SF_STATE_FOLDER}
77
- */
78
- Global.SF_DIR = path.join(os.homedir(), Global.SF_STATE_FOLDER);
79
83
  /**
80
84
  * The full system path to the global log file.
81
85
  */
@@ -82,6 +82,9 @@ class SchemaValidator {
82
82
  // because the CLI team does not "own" the @salesforce/schemas repository.
83
83
  // Invalid schema would cause errors wherever SchemaValidator is used.
84
84
  strictSchema: false,
85
+ // If we end up getting an npm-shrinkwrap working in the future we could turn this back off.
86
+ // https://github.com/forcedotcom/cli/issues/1493
87
+ validateSchema: false,
85
88
  });
86
89
  // JSEN to AJV migration note - regarding the following "TODO":
87
90
  // I don't think that AJV has a way to throw an error if an additional property exists in the data
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.15.4",
3
+ "version": "3.16.1",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/exported",
6
6
  "types": "lib/exported.d.ts",