@salesforce/core 6.2.2-qa.0 → 6.2.3-qa.0
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/lib/org/org.d.ts +8 -1
- package/lib/org/org.js +17 -17
- package/package.json +2 -2
package/lib/org/org.d.ts
CHANGED
|
@@ -284,7 +284,14 @@ export declare class Org extends AsyncOptionalCreatable<Org.Options> {
|
|
|
284
284
|
* Some organization information is locally cached, such as if the org name or if it is a scratch org.
|
|
285
285
|
* This method populates/updates the filesystem from information retrieved from the org.
|
|
286
286
|
*/
|
|
287
|
-
updateLocalInformation(): Promise<
|
|
287
|
+
updateLocalInformation(): Promise<{
|
|
288
|
+
name: string;
|
|
289
|
+
instanceName: string;
|
|
290
|
+
namespacePrefix: string | null;
|
|
291
|
+
isSandbox: boolean;
|
|
292
|
+
isScratch: boolean;
|
|
293
|
+
trailExpirationDate: string | null;
|
|
294
|
+
} | undefined>;
|
|
288
295
|
/**
|
|
289
296
|
* Refreshes the auth for this org's instance by calling HTTP GET on the baseUrl of the connection object.
|
|
290
297
|
*/
|
package/lib/org/org.js
CHANGED
|
@@ -484,12 +484,12 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
484
484
|
* using {@link Org.retrieveOrganizationInformation}.
|
|
485
485
|
*/
|
|
486
486
|
async determineIfScratch() {
|
|
487
|
-
|
|
488
|
-
if (cache
|
|
489
|
-
|
|
490
|
-
cache = this.getField(Org.Fields.IS_SCRATCH);
|
|
487
|
+
const cache = this.getField(Org.Fields.IS_SCRATCH);
|
|
488
|
+
if (cache !== undefined) {
|
|
489
|
+
return cache;
|
|
491
490
|
}
|
|
492
|
-
|
|
491
|
+
const updated = await this.updateLocalInformation();
|
|
492
|
+
return updated?.isScratch === true;
|
|
493
493
|
}
|
|
494
494
|
/**
|
|
495
495
|
* Returns `true` if the org is a sandbox.
|
|
@@ -499,12 +499,12 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
499
499
|
* using {@link Org.retrieveOrganizationInformation}.
|
|
500
500
|
*/
|
|
501
501
|
async determineIfSandbox() {
|
|
502
|
-
|
|
503
|
-
if (cache
|
|
504
|
-
|
|
505
|
-
cache = this.getField(Org.Fields.IS_SANDBOX);
|
|
502
|
+
const cache = this.getField(Org.Fields.IS_SANDBOX);
|
|
503
|
+
if (cache !== undefined) {
|
|
504
|
+
return cache;
|
|
506
505
|
}
|
|
507
|
-
|
|
506
|
+
const updated = await this.updateLocalInformation();
|
|
507
|
+
return updated?.isSandbox === true;
|
|
508
508
|
}
|
|
509
509
|
/**
|
|
510
510
|
* Retrieve a handful of fields from the Organization table in Salesforce. If this does not have the
|
|
@@ -523,18 +523,18 @@ class Org extends kit_1.AsyncOptionalCreatable {
|
|
|
523
523
|
const username = this.getUsername();
|
|
524
524
|
if (username) {
|
|
525
525
|
const organization = await this.retrieveOrganizationInformation();
|
|
526
|
-
const
|
|
527
|
-
const isSandbox = organization.IsSandbox && !organization.TrialExpirationDate;
|
|
528
|
-
const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
|
529
|
-
stateAggregator.orgs.update(username, {
|
|
526
|
+
const updateFields = {
|
|
530
527
|
[Org.Fields.NAME]: organization.Name,
|
|
531
528
|
[Org.Fields.INSTANCE_NAME]: organization.InstanceName,
|
|
532
529
|
[Org.Fields.NAMESPACE_PREFIX]: organization.NamespacePrefix,
|
|
533
|
-
[Org.Fields.IS_SANDBOX]:
|
|
534
|
-
[Org.Fields.IS_SCRATCH]:
|
|
530
|
+
[Org.Fields.IS_SANDBOX]: organization.IsSandbox && Boolean(organization.TrialExpirationDate),
|
|
531
|
+
[Org.Fields.IS_SCRATCH]: organization.IsSandbox && !organization.TrialExpirationDate,
|
|
535
532
|
[Org.Fields.TRIAL_EXPIRATION_DATE]: organization.TrialExpirationDate,
|
|
536
|
-
}
|
|
533
|
+
};
|
|
534
|
+
const stateAggregator = await stateAggregator_1.StateAggregator.getInstance();
|
|
535
|
+
stateAggregator.orgs.update(username, updateFields);
|
|
537
536
|
await stateAggregator.orgs.write(username);
|
|
537
|
+
return updateFields;
|
|
538
538
|
}
|
|
539
539
|
}
|
|
540
540
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@salesforce/core",
|
|
3
|
-
"version": "6.2.
|
|
3
|
+
"version": "6.2.3-qa.0",
|
|
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",
|
|
@@ -47,7 +47,7 @@
|
|
|
47
47
|
"faye": "^1.4.0",
|
|
48
48
|
"form-data": "^4.0.0",
|
|
49
49
|
"js2xmlparser": "^4.0.1",
|
|
50
|
-
"jsforce": "^2.0.0-beta.
|
|
50
|
+
"jsforce": "^2.0.0-beta.29",
|
|
51
51
|
"jsonwebtoken": "9.0.2",
|
|
52
52
|
"jszip": "3.10.1",
|
|
53
53
|
"pino": "^8.16.2",
|