@salesforce/core 3.33.7 → 3.33.9

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.
@@ -38,13 +38,8 @@ class TTLConfig extends configFile_1.ConfigFile {
38
38
  }
39
39
  async init() {
40
40
  const contents = await this.read(this.options.throwOnNotFound);
41
- const purged = {};
42
41
  const date = new Date().getTime();
43
- for (const [key, opts] of Object.entries(contents)) {
44
- if (!this.isExpired(date, opts))
45
- purged[key] = opts;
46
- }
47
- this.setContents(purged);
42
+ this.setContents(Object.fromEntries(Object.entries(contents).filter(([, value]) => !this.isExpired(date, value))));
48
43
  }
49
44
  // eslint-disable-next-line class-methods-use-this
50
45
  timestamp(value) {
@@ -243,17 +243,20 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
243
243
  // ask all those orgs if they know this orgId
244
244
  await Promise.all(hubAuthInfos.map(async (hubAuthInfo) => {
245
245
  try {
246
- const data = await AuthInfo.queryScratchOrg(hubAuthInfo.username, fields.orgId);
247
- if (data.totalSize > 0) {
248
- // if any return a result
249
- logger.debug(`found orgId ${fields.orgId} in devhub ${hubAuthInfo.username}`);
250
- try {
251
- await orgAuthInfo.save({ ...fields, devHubUsername: hubAuthInfo.username });
252
- logger.debug(`set ${hubAuthInfo.username} as devhub for scratch org ${orgAuthInfo.getUsername()}`);
253
- }
254
- catch (error) {
255
- logger.debug(`error updating auth file for ${orgAuthInfo.getUsername()}`, error);
256
- }
246
+ const soi = await AuthInfo.queryScratchOrg(hubAuthInfo.username, fields.orgId);
247
+ // if any return a result
248
+ logger.debug(`found orgId ${fields.orgId} in devhub ${hubAuthInfo.username}`);
249
+ try {
250
+ await orgAuthInfo.save({
251
+ ...fields,
252
+ devHubUsername: hubAuthInfo.username,
253
+ expirationDate: soi.ExpirationDate,
254
+ isScratch: true,
255
+ });
256
+ logger.debug(`set ${hubAuthInfo.username} as devhub and expirationDate ${soi.ExpirationDate} for scratch org ${orgAuthInfo.getUsername()}`);
257
+ }
258
+ catch (error) {
259
+ logger.debug(`error updating auth file for ${orgAuthInfo.getUsername()}`, error);
257
260
  }
258
261
  }
259
262
  catch (error) {
@@ -270,7 +273,7 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
270
273
  static async queryScratchOrg(devHubUsername, scratchOrgId) {
271
274
  const devHubOrg = await org_1.Org.create({ aliasOrUsername: devHubUsername });
272
275
  const conn = devHubOrg.getConnection();
273
- const data = await conn.query(`select Id from ScratchOrgInfo where ScratchOrg = '${(0, sfdc_1.trimTo15)(scratchOrgId)}'`);
276
+ const data = await conn.singleRecordQuery(`select Id, ExpirationDate from ScratchOrgInfo where ScratchOrg = '${(0, sfdc_1.trimTo15)(scratchOrgId)}'`);
274
277
  return data;
275
278
  }
276
279
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "3.33.7",
3
+ "version": "3.33.9",
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",
@@ -37,12 +37,12 @@
37
37
  ],
38
38
  "dependencies": {
39
39
  "@salesforce/bunyan": "^2.0.0",
40
- "@salesforce/kit": "^1.9.0",
40
+ "@salesforce/kit": "^1.9.2",
41
41
  "@salesforce/schemas": "^1.5.0",
42
42
  "@salesforce/ts-types": "^1.7.2",
43
43
  "@types/graceful-fs": "^4.1.6",
44
44
  "@types/semver": "^7.3.13",
45
- "ajv": "^8.11.2",
45
+ "ajv": "^8.12.0",
46
46
  "archiver": "^5.3.0",
47
47
  "change-case": "^4.1.2",
48
48
  "debug": "^3.2.7",
@@ -58,7 +58,7 @@
58
58
  "@salesforce/dev-config": "^3.0.1",
59
59
  "@salesforce/dev-scripts": "^4.0.0-beta.7",
60
60
  "@salesforce/prettier-config": "^0.0.2",
61
- "@salesforce/ts-sinon": "^1.4.4",
61
+ "@salesforce/ts-sinon": "^1.4.6",
62
62
  "@types/archiver": "^5.3.1",
63
63
  "@types/chai-string": "^1.4.2",
64
64
  "@types/debug": "0.0.31",
@@ -66,30 +66,30 @@
66
66
  "@types/jsonwebtoken": "9.0.1",
67
67
  "@types/lodash": "^4.14.191",
68
68
  "@types/shelljs": "0.8.11",
69
- "@typescript-eslint/eslint-plugin": "^5.53.0",
69
+ "@typescript-eslint/eslint-plugin": "^5.54.1",
70
70
  "@typescript-eslint/parser": "^5.54.1",
71
71
  "chai": "^4.3.7",
72
72
  "chai-string": "^1.5.0",
73
73
  "commitizen": "^3.1.2",
74
- "eslint": "^8.32.0",
75
- "eslint-config-prettier": "^8.6.0",
76
- "eslint-config-salesforce": "^1.1.0",
74
+ "eslint": "^8.35.0",
75
+ "eslint-config-prettier": "^8.7.0",
76
+ "eslint-config-salesforce": "^1.1.1",
77
77
  "eslint-config-salesforce-license": "^0.2.0",
78
78
  "eslint-config-salesforce-typescript": "^1.1.1",
79
79
  "eslint-plugin-header": "^3.1.1",
80
- "eslint-plugin-import": "^2.26.0",
80
+ "eslint-plugin-import": "^2.27.5",
81
81
  "eslint-plugin-jsdoc": "^39.6.4",
82
82
  "husky": "^7.0.4",
83
83
  "lodash": "^4.17.21",
84
84
  "mocha": "^9.1.3",
85
85
  "nyc": "^15.1.0",
86
- "prettier": "^2.8.1",
86
+ "prettier": "^2.8.4",
87
87
  "pretty-quick": "^3.1.3",
88
88
  "shelljs": "0.8.5",
89
89
  "sinon": "^14.0.2",
90
90
  "ts-node": "^10.4.0",
91
91
  "ttypescript": "^1.5.15",
92
- "typescript": "^4.9.4",
92
+ "typescript": "^4.9.5",
93
93
  "wireit": "^0.9.3"
94
94
  },
95
95
  "repository": {