@salesforce/core 3.15.5 → 3.16.2

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.
@@ -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
  */
@@ -20,15 +20,6 @@ export declare type DeployOptionsWithRest = Partial<DeployOptions> & {
20
20
  };
21
21
  export interface Tooling<S extends Schema = Schema> extends JSForceTooling<S> {
22
22
  _logger: any;
23
- /**
24
- * Executes a query and auto-fetches (i.e., "queryMore") all results. This is especially
25
- * useful with large query result sizes, such as over 2000 records. The default maximum
26
- * fetch size is 10,000 records. Modify this via the options argument.
27
- *
28
- * @param soql The SOQL string.
29
- * @param options The query options. NOTE: the autoFetch option will always be true.
30
- */
31
- autoFetchQuery<T extends Schema = S>(soql: string, options?: QueryOptions): Promise<QueryResult<T>>;
32
23
  }
33
24
  /**
34
25
  * Handles connections and requests to Salesforce Orgs.
@@ -58,8 +58,6 @@ class Connection extends jsforce_1.Connection {
58
58
  */
59
59
  constructor(options) {
60
60
  super(options.connectionOptions || {});
61
- // eslint-disable-next-line @typescript-eslint/unbound-method
62
- this.tooling.autoFetchQuery = Connection.prototype.autoFetchQuery;
63
61
  this.options = options;
64
62
  this.username = options.authInfo.getUsername();
65
63
  }
@@ -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.5",
3
+ "version": "3.16.2",
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",