@salesforce/core 5.4.0-crdt.1 → 6.1.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/README.md +3 -3
- package/lib/config/authInfoConfig.d.ts +1 -1
- package/lib/config/config.d.ts +6 -29
- package/lib/config/config.js +91 -113
- package/lib/config/configAggregator.js +1 -0
- package/lib/config/configFile.d.ts +3 -1
- package/lib/config/configFile.js +44 -67
- package/lib/config/configStore.d.ts +20 -29
- package/lib/config/configStore.js +50 -53
- package/lib/config/envVars.js +3 -2
- package/lib/config/lwwMap.d.ts +4 -5
- package/lib/config/lwwMap.js +19 -16
- package/lib/config/lwwRegister.d.ts +2 -3
- package/lib/config/lwwRegister.js +6 -7
- package/lib/config/sandboxOrgConfig.js +1 -1
- package/lib/config/sandboxProcessCache.d.ts +1 -1
- package/lib/crypto/crypto.js +4 -3
- package/lib/crypto/keyChain.js +1 -0
- package/lib/crypto/keyChainImpl.d.ts +2 -2
- package/lib/crypto/keyChainImpl.js +9 -8
- package/lib/crypto/secureBuffer.js +1 -1
- package/lib/deviceOauthService.d.ts +1 -1
- package/lib/deviceOauthService.js +8 -6
- package/lib/exported.d.ts +3 -4
- package/lib/exported.js +6 -6
- package/lib/global.js +4 -4
- package/lib/logger/logger.js +6 -5
- package/lib/logger/memoryLogger.d.ts +1 -1
- package/lib/logger/memoryLogger.js +2 -2
- package/lib/logger/transformStream.d.ts +1 -1
- package/lib/logger/transformStream.js +3 -3
- package/lib/messageTransformer.js +2 -2
- package/lib/messages.js +5 -5
- package/lib/org/authInfo.js +11 -10
- package/lib/org/authRemover.d.ts +1 -2
- package/lib/org/authRemover.js +2 -12
- package/lib/org/connection.js +3 -2
- package/lib/org/org.js +9 -8
- package/lib/org/orgConfigProperties.js +3 -2
- package/lib/org/permissionSetAssignment.js +15 -13
- package/lib/org/scratchOrgCreate.js +2 -1
- package/lib/org/scratchOrgErrorCodes.js +1 -0
- package/lib/org/scratchOrgFeatureDeprecation.js +1 -0
- package/lib/org/scratchOrgInfoApi.js +1 -0
- package/lib/org/scratchOrgInfoGenerator.js +3 -2
- package/lib/org/scratchOrgSettingsGenerator.js +3 -3
- package/lib/org/user.js +4 -3
- package/lib/schema/validator.js +2 -2
- package/lib/sfError.d.ts +1 -1
- package/lib/sfProject.d.ts +1 -0
- package/lib/sfProject.js +12 -11
- package/lib/stateAggregator/accessors/aliasAccessor.d.ts +1 -2
- package/lib/stateAggregator/accessors/aliasAccessor.js +3 -2
- package/lib/stateAggregator/accessors/orgAccessor.d.ts +2 -2
- package/lib/stateAggregator/accessors/orgAccessor.js +8 -6
- package/lib/stateAggregator/accessors/sandboxAccessor.d.ts +1 -1
- package/lib/stateAggregator/stateAggregator.d.ts +0 -2
- package/lib/stateAggregator/stateAggregator.js +0 -2
- package/lib/status/myDomainResolver.d.ts +1 -1
- package/lib/status/myDomainResolver.js +6 -6
- package/lib/status/pollingClient.js +1 -1
- package/lib/status/streamingClient.js +4 -3
- package/lib/status/types.d.ts +1 -1
- package/lib/status/types.js +2 -2
- package/lib/testSetup.d.ts +3 -7
- package/lib/testSetup.js +47 -39
- package/lib/util/cache.js +14 -14
- package/lib/util/checkLightningDomain.js +2 -2
- package/lib/util/directoryWriter.d.ts +1 -1
- package/lib/util/directoryWriter.js +7 -7
- package/lib/util/fileLocking.d.ts +24 -0
- package/lib/util/fileLocking.js +91 -0
- package/lib/util/findUppercaseKeys.d.ts +2 -0
- package/lib/util/findUppercaseKeys.js +29 -0
- package/lib/util/internal.js +7 -6
- package/lib/util/sfdc.d.ts +0 -18
- package/lib/util/sfdc.js +1 -42
- package/lib/util/sfdcUrl.d.ts +2 -2
- package/lib/util/sfdcUrl.js +9 -8
- package/lib/util/structuredWriter.d.ts +1 -1
- package/lib/util/time.d.ts +1 -0
- package/lib/util/time.js +13 -0
- package/lib/util/uniqid.js +3 -3
- package/lib/util/zipWriter.d.ts +1 -1
- package/lib/util/zipWriter.js +2 -2
- package/lib/webOAuthServer.d.ts +2 -2
- package/lib/webOAuthServer.js +16 -15
- package/package.json +14 -38
- package/lib/config/tokensConfig.d.ts +0 -10
- package/lib/config/tokensConfig.js +0 -29
- package/lib/org/index.d.ts +0 -6
- package/lib/org/index.js +0 -29
- package/lib/schema/printer.d.ts +0 -81
- package/lib/schema/printer.js +0 -263
- package/lib/stateAggregator/accessors/tokenAccessor.d.ts +0 -63
- package/lib/stateAggregator/accessors/tokenAccessor.js +0 -80
- package/lib/stateAggregator/index.d.ts +0 -4
- package/lib/stateAggregator/index.js +0 -27
- package/lib/util/jsonXmlTools.d.ts +0 -14
- package/lib/util/jsonXmlTools.js +0 -39
package/lib/config/lwwMap.js
CHANGED
|
@@ -14,28 +14,29 @@ var _LWWMap_data;
|
|
|
14
14
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
15
|
exports.LWWMap = exports.stateFromContents = exports.SYMBOL_FOR_DELETED = void 0;
|
|
16
16
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
17
|
-
const
|
|
17
|
+
const time_1 = require("../util/time");
|
|
18
18
|
const lwwRegister_1 = require("./lwwRegister");
|
|
19
19
|
exports.SYMBOL_FOR_DELETED = 'UNIQUE_IDENTIFIER_FOR_DELETED';
|
|
20
20
|
/**
|
|
21
21
|
* @param contents object aligning with ConfigContents
|
|
22
22
|
* @param timestamp a bigInt that sets the timestamp. Defaults to the current time
|
|
23
23
|
* construct a LWWState from an object
|
|
24
|
-
*
|
|
24
|
+
* @param keysToCheckForDeletion if a key is in this array, AND not in the contents, it will be marked as deleted
|
|
25
25
|
* */
|
|
26
|
-
const stateFromContents = (contents, timestamp
|
|
26
|
+
const stateFromContents = (contents, timestamp) => Object.fromEntries((0, ts_types_1.entriesOf)(contents).map(([key, value]) => [
|
|
27
27
|
key,
|
|
28
|
-
new lwwRegister_1.LWWRegister(
|
|
29
|
-
])
|
|
28
|
+
new lwwRegister_1.LWWRegister({ timestamp: timestamp ?? (0, time_1.nowBigInt)(), value }),
|
|
29
|
+
])
|
|
30
|
+
// I'd love to get rid of this ASsertion but don't know how.
|
|
31
|
+
);
|
|
30
32
|
exports.stateFromContents = stateFromContents;
|
|
31
33
|
class LWWMap {
|
|
32
|
-
constructor(
|
|
34
|
+
constructor(state) {
|
|
33
35
|
/** map of key to LWWRegister. Used for managing conflicts */
|
|
34
36
|
_LWWMap_data.set(this, new Map());
|
|
35
|
-
this.id = id ?? (0, uniqid_1.uniqid)();
|
|
36
37
|
// create a new register for each key in the initial state
|
|
37
38
|
for (const [key, register] of (0, ts_types_1.entriesOf)(state ?? {})) {
|
|
38
|
-
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister(
|
|
39
|
+
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister(register));
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
42
|
get value() {
|
|
@@ -44,11 +45,12 @@ class LWWMap {
|
|
|
44
45
|
.map(([key, register]) => [key, register.value]));
|
|
45
46
|
}
|
|
46
47
|
get state() {
|
|
47
|
-
return Object.fromEntries(Array.from(__classPrivateFieldGet(this, _LWWMap_data, "f").entries())
|
|
48
|
-
// .filter(([, register]) => Boolean(register))
|
|
49
|
-
.map(([key, register]) => [key, register.state]));
|
|
48
|
+
return Object.fromEntries(Array.from(__classPrivateFieldGet(this, _LWWMap_data, "f").entries()).map(([key, register]) => [key, register.state]));
|
|
50
49
|
}
|
|
50
|
+
// Merge top-level properties of the incoming state with the current state.
|
|
51
|
+
// The value with the latest timestamp wins.
|
|
51
52
|
merge(state) {
|
|
53
|
+
// properties that are in the incoming state but not the current state might have been deleted.
|
|
52
54
|
// recursively merge each key's register with the incoming state for that key
|
|
53
55
|
for (const [key, remote] of (0, ts_types_1.entriesOf)(state)) {
|
|
54
56
|
const local = __classPrivateFieldGet(this, _LWWMap_data, "f").get(key);
|
|
@@ -57,7 +59,7 @@ class LWWMap {
|
|
|
57
59
|
local.merge(remote);
|
|
58
60
|
// otherwise, instantiate a new `LWWRegister` with the incoming state
|
|
59
61
|
else
|
|
60
|
-
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister(
|
|
62
|
+
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister(remote));
|
|
61
63
|
}
|
|
62
64
|
return this.state;
|
|
63
65
|
}
|
|
@@ -69,9 +71,8 @@ class LWWMap {
|
|
|
69
71
|
register.set(value);
|
|
70
72
|
// otherwise, instantiate a new `LWWRegister` with the value
|
|
71
73
|
else
|
|
72
|
-
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister(
|
|
74
|
+
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister({ timestamp: (0, time_1.nowBigInt)(), value }));
|
|
73
75
|
}
|
|
74
|
-
// TODO: how to handle the deep `get` that is currently allowed ex: get('foo.bar.baz')
|
|
75
76
|
get(key) {
|
|
76
77
|
// map loses the typing
|
|
77
78
|
const value = __classPrivateFieldGet(this, _LWWMap_data, "f").get(key)?.value;
|
|
@@ -80,8 +81,10 @@ class LWWMap {
|
|
|
80
81
|
return value;
|
|
81
82
|
}
|
|
82
83
|
delete(key) {
|
|
83
|
-
|
|
84
|
-
|
|
84
|
+
__classPrivateFieldGet(this, _LWWMap_data, "f").set(key, new lwwRegister_1.LWWRegister({
|
|
85
|
+
timestamp: (0, time_1.nowBigInt)(),
|
|
86
|
+
value: exports.SYMBOL_FOR_DELETED,
|
|
87
|
+
}));
|
|
85
88
|
}
|
|
86
89
|
has(key) {
|
|
87
90
|
// if a register doesn't exist or its value is null, the map doesn't contain the key
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
type LWWRegisterState<T> = {
|
|
2
|
-
peer: string;
|
|
3
2
|
timestamp: bigint;
|
|
4
3
|
value: T;
|
|
5
4
|
};
|
|
@@ -9,10 +8,10 @@ type LWWRegisterState<T> = {
|
|
|
9
8
|
* @param T the type of the value stored in the register
|
|
10
9
|
*/
|
|
11
10
|
export declare class LWWRegister<T> {
|
|
12
|
-
readonly id: string;
|
|
13
11
|
state: LWWRegisterState<T>;
|
|
14
|
-
constructor(
|
|
12
|
+
constructor(state: LWWRegisterState<T>);
|
|
15
13
|
get value(): T;
|
|
14
|
+
get timestamp(): bigint;
|
|
16
15
|
set(value: T): void;
|
|
17
16
|
merge(incoming: LWWRegisterState<T>): LWWRegisterState<T>;
|
|
18
17
|
}
|
|
@@ -7,31 +7,30 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.LWWRegister = void 0;
|
|
10
|
+
const time_1 = require("../util/time");
|
|
10
11
|
/** a CRDT implementation. Uses timestamps to resolve conflicts when updating the value (last write wins)
|
|
11
12
|
* mostly based on https://jakelazaroff.com/words/an-interactive-intro-to-crdts/
|
|
12
13
|
*
|
|
13
14
|
* @param T the type of the value stored in the register
|
|
14
15
|
*/
|
|
15
16
|
class LWWRegister {
|
|
16
|
-
constructor(
|
|
17
|
-
this.id = id;
|
|
17
|
+
constructor(state) {
|
|
18
18
|
this.state = state;
|
|
19
19
|
}
|
|
20
20
|
get value() {
|
|
21
21
|
return this.state.value;
|
|
22
22
|
}
|
|
23
|
+
get timestamp() {
|
|
24
|
+
return this.state.timestamp;
|
|
25
|
+
}
|
|
23
26
|
set(value) {
|
|
24
|
-
|
|
25
|
-
this.state = { peer: this.id, timestamp: process.hrtime.bigint(), value };
|
|
27
|
+
this.state = { timestamp: (0, time_1.nowBigInt)(), value };
|
|
26
28
|
}
|
|
27
29
|
merge(incoming) {
|
|
28
30
|
// only update if the incoming timestamp is greater than the local timestamp
|
|
29
|
-
// console.log(`incoming: ${}`);
|
|
30
|
-
// console.log(`local: ${JSON.stringify(this.state)}`);
|
|
31
31
|
if (incoming.timestamp > this.state.timestamp) {
|
|
32
32
|
this.state = incoming;
|
|
33
33
|
}
|
|
34
|
-
// TODO: if the timestamps match, use the peer ID to break the tie (prefer self?)
|
|
35
34
|
return this.state;
|
|
36
35
|
}
|
|
37
36
|
}
|
|
@@ -47,5 +47,5 @@ exports.SandboxOrgConfig = SandboxOrgConfig;
|
|
|
47
47
|
*/
|
|
48
48
|
Fields["PROD_ORG_USERNAME"] = "prodOrgUsername";
|
|
49
49
|
})(Fields = SandboxOrgConfig.Fields || (SandboxOrgConfig.Fields = {}));
|
|
50
|
-
})(SandboxOrgConfig
|
|
50
|
+
})(SandboxOrgConfig || (exports.SandboxOrgConfig = SandboxOrgConfig = {}));
|
|
51
51
|
//# sourceMappingURL=sandboxOrgConfig.js.map
|
package/lib/crypto/crypto.js
CHANGED
|
@@ -8,9 +8,9 @@
|
|
|
8
8
|
/* eslint-disable @typescript-eslint/ban-types */
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.Crypto = void 0;
|
|
11
|
-
const crypto = require("crypto");
|
|
12
|
-
const os = require("os");
|
|
13
|
-
const
|
|
11
|
+
const crypto = require("node:crypto");
|
|
12
|
+
const os = require("node:os");
|
|
13
|
+
const node_path_1 = require("node:path");
|
|
14
14
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
15
|
const kit_1 = require("@salesforce/kit");
|
|
16
16
|
const logger_1 = require("../logger/logger");
|
|
@@ -26,6 +26,7 @@ const AUTH_TAG_LENGTH = 32;
|
|
|
26
26
|
const ENCRYPTED_CHARS = /[a-f0-9]/;
|
|
27
27
|
const KEY_NAME = 'sfdx';
|
|
28
28
|
const ACCOUNT = 'local';
|
|
29
|
+
;
|
|
29
30
|
const messages = new messages_1.Messages('@salesforce/core', 'encryption', new Map([["invalidEncryptedFormatError", "The encrypted data is not properly formatted."], ["invalidEncryptedFormatError.actions", ["If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org."]], ["authDecryptError", "Failed to decipher auth data. reason: %s."], ["unsupportedOperatingSystemError", "Unsupported Operating System: %s"], ["missingCredentialProgramError", "Unable to find required security software: %s"], ["credentialProgramAccessError", "Unable to execute security software: %s"], ["passwordRetryError", "Failed to get the password after %i retries."], ["passwordRequiredError", "A password is required."], ["keyChainServiceRequiredError", "Unable to get or set a keychain value without a service name."], ["keyChainAccountRequiredError", "Unable to get or set a keychain value without an account name."], ["keyChainUserCanceledError", "User canceled authentication."], ["keychainPasswordCreationError", "Failed to create a password in the keychain."], ["genericKeychainServiceError", "The service and account specified in %s do not match the version of the toolbelt."], ["genericKeychainServiceError.actions", ["Check your toolbelt version and re-auth."]], ["genericKeychainInvalidPermsError", "Invalid file permissions for secret file"], ["genericKeychainInvalidPermsError.actions", ["Ensure the file %s has the file permission octal value of %s."]], ["passwordNotFoundError", "Could not find password.\n%s"], ["passwordNotFoundError.actions", ["Ensure a valid password is returned with the following command: [%s]"]], ["setCredentialError", "Command failed with response:\n%s"], ["setCredentialError.actions", ["Determine why this command failed to set an encryption key for user %s: [%s]."]], ["macKeychainOutOfSync", "We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."]]));
|
|
30
31
|
const makeSecureBuffer = (password) => {
|
|
31
32
|
const newSb = new secureBuffer_1.SecureBuffer();
|
package/lib/crypto/keyChain.js
CHANGED
|
@@ -11,6 +11,7 @@ const kit_1 = require("@salesforce/kit");
|
|
|
11
11
|
const logger_1 = require("../logger/logger");
|
|
12
12
|
const messages_1 = require("../messages");
|
|
13
13
|
const keyChainImpl_1 = require("./keyChainImpl");
|
|
14
|
+
;
|
|
14
15
|
const messages = new messages_1.Messages('@salesforce/core', 'encryption', new Map([["invalidEncryptedFormatError", "The encrypted data is not properly formatted."], ["invalidEncryptedFormatError.actions", ["If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org."]], ["authDecryptError", "Failed to decipher auth data. reason: %s."], ["unsupportedOperatingSystemError", "Unsupported Operating System: %s"], ["missingCredentialProgramError", "Unable to find required security software: %s"], ["credentialProgramAccessError", "Unable to execute security software: %s"], ["passwordRetryError", "Failed to get the password after %i retries."], ["passwordRequiredError", "A password is required."], ["keyChainServiceRequiredError", "Unable to get or set a keychain value without a service name."], ["keyChainAccountRequiredError", "Unable to get or set a keychain value without an account name."], ["keyChainUserCanceledError", "User canceled authentication."], ["keychainPasswordCreationError", "Failed to create a password in the keychain."], ["genericKeychainServiceError", "The service and account specified in %s do not match the version of the toolbelt."], ["genericKeychainServiceError.actions", ["Check your toolbelt version and re-auth."]], ["genericKeychainInvalidPermsError", "Invalid file permissions for secret file"], ["genericKeychainInvalidPermsError.actions", ["Ensure the file %s has the file permission octal value of %s."]], ["passwordNotFoundError", "Could not find password.\n%s"], ["passwordNotFoundError.actions", ["Ensure a valid password is returned with the following command: [%s]"]], ["setCredentialError", "Command failed with response:\n%s"], ["setCredentialError.actions", ["Determine why this command failed to set an encryption key for user %s: [%s]."]], ["macKeychainOutOfSync", "We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."]]));
|
|
15
16
|
/**
|
|
16
17
|
* Gets the os level keychain impl.
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
/// <reference types="node" />
|
|
2
2
|
/// <reference types="node" />
|
|
3
3
|
/// <reference types="node" />
|
|
4
|
-
import * as childProcess from 'child_process';
|
|
5
|
-
import * as nodeFs from 'fs';
|
|
4
|
+
import * as childProcess from 'node:child_process';
|
|
5
|
+
import * as nodeFs from 'node:fs';
|
|
6
6
|
import { Nullable } from '@salesforce/ts-types';
|
|
7
7
|
export type FsIfc = Pick<typeof nodeFs, 'statSync'>;
|
|
8
8
|
/**
|
|
@@ -7,16 +7,17 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.keyChainImpl = exports.GenericWindowsKeychainAccess = exports.GenericUnixKeychainAccess = exports.GenericKeychainAccess = exports.KeychainAccess = void 0;
|
|
10
|
-
const childProcess = require("child_process");
|
|
11
|
-
const nodeFs = require("fs");
|
|
12
|
-
const fs = require("fs");
|
|
13
|
-
const os = require("os");
|
|
14
|
-
const
|
|
15
|
-
const path = require("path");
|
|
10
|
+
const childProcess = require("node:child_process");
|
|
11
|
+
const nodeFs = require("node:fs");
|
|
12
|
+
const fs = require("node:fs");
|
|
13
|
+
const os = require("node:os");
|
|
14
|
+
const node_os_1 = require("node:os");
|
|
15
|
+
const path = require("node:path");
|
|
16
16
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
17
17
|
const kit_1 = require("@salesforce/kit");
|
|
18
18
|
const global_1 = require("../global");
|
|
19
19
|
const messages_1 = require("../messages");
|
|
20
|
+
;
|
|
20
21
|
const messages = new messages_1.Messages('@salesforce/core', 'encryption', new Map([["invalidEncryptedFormatError", "The encrypted data is not properly formatted."], ["invalidEncryptedFormatError.actions", ["If attempting to create a scratch org then re-authorize. Otherwise create a new scratch org."]], ["authDecryptError", "Failed to decipher auth data. reason: %s."], ["unsupportedOperatingSystemError", "Unsupported Operating System: %s"], ["missingCredentialProgramError", "Unable to find required security software: %s"], ["credentialProgramAccessError", "Unable to execute security software: %s"], ["passwordRetryError", "Failed to get the password after %i retries."], ["passwordRequiredError", "A password is required."], ["keyChainServiceRequiredError", "Unable to get or set a keychain value without a service name."], ["keyChainAccountRequiredError", "Unable to get or set a keychain value without an account name."], ["keyChainUserCanceledError", "User canceled authentication."], ["keychainPasswordCreationError", "Failed to create a password in the keychain."], ["genericKeychainServiceError", "The service and account specified in %s do not match the version of the toolbelt."], ["genericKeychainServiceError.actions", ["Check your toolbelt version and re-auth."]], ["genericKeychainInvalidPermsError", "Invalid file permissions for secret file"], ["genericKeychainInvalidPermsError.actions", ["Ensure the file %s has the file permission octal value of %s."]], ["passwordNotFoundError", "Could not find password.\n%s"], ["passwordNotFoundError.actions", ["Ensure a valid password is returned with the following command: [%s]"]], ["setCredentialError", "Command failed with response:\n%s"], ["setCredentialError.actions", ["Determine why this command failed to set an encryption key for user %s: [%s]."]], ["macKeychainOutOfSync", "We\u2019ve encountered an error with the Mac keychain being out of sync with your `sfdx` credentials. To fix the problem, sync your credentials by authenticating into your org again using the auth commands."]]));
|
|
21
22
|
const GET_PASSWORD_RETRY_COUNT = 3;
|
|
22
23
|
/**
|
|
@@ -38,7 +39,7 @@ const isExe = (mode, gid, uid) => {
|
|
|
38
39
|
return true;
|
|
39
40
|
}
|
|
40
41
|
return Boolean(mode & parseInt('0001', 8) ||
|
|
41
|
-
(mode & parseInt('0010', 8) && process.getgid && gid === process.getgid()) ||
|
|
42
|
+
Boolean(mode & parseInt('0010', 8) && process.getgid && gid === process.getgid()) ||
|
|
42
43
|
(mode & parseInt('0100', 8) && process.getuid && uid === process.getuid()));
|
|
43
44
|
};
|
|
44
45
|
/**
|
|
@@ -400,7 +401,7 @@ class GenericKeychainAccess {
|
|
|
400
401
|
// eslint-disable-next-line class-methods-use-this
|
|
401
402
|
async isValidFileAccess(cb) {
|
|
402
403
|
try {
|
|
403
|
-
const root = (0,
|
|
404
|
+
const root = (0, node_os_1.homedir)();
|
|
404
405
|
await fs.promises.access(path.join(root, global_1.Global.SFDX_STATE_FOLDER), fs.constants.R_OK | fs.constants.X_OK | fs.constants.W_OK);
|
|
405
406
|
await cb(null);
|
|
406
407
|
}
|
|
@@ -7,7 +7,7 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.SecureBuffer = void 0;
|
|
10
|
-
const crypto = require("crypto");
|
|
10
|
+
const crypto = require("node:crypto");
|
|
11
11
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
12
12
|
const cipherName = 'aes-256-cbc';
|
|
13
13
|
const cipherSize = 32;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AsyncCreatable } from '@salesforce/kit';
|
|
2
2
|
import { OAuth2Config } from 'jsforce';
|
|
3
3
|
import { JsonMap, Nullable } from '@salesforce/ts-types';
|
|
4
|
-
import { AuthInfo } from './org';
|
|
4
|
+
import { AuthInfo } from './org/authInfo';
|
|
5
5
|
export interface DeviceCodeResponse extends JsonMap {
|
|
6
6
|
device_code: string;
|
|
7
7
|
interval: number;
|
|
@@ -14,9 +14,11 @@ const kit_1 = require("@salesforce/kit");
|
|
|
14
14
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
15
|
const FormData = require("form-data");
|
|
16
16
|
const logger_1 = require("./logger/logger");
|
|
17
|
-
const
|
|
17
|
+
const authInfo_1 = require("./org/authInfo");
|
|
18
|
+
const connection_1 = require("./org/connection");
|
|
18
19
|
const sfError_1 = require("./sfError");
|
|
19
20
|
const messages_1 = require("./messages");
|
|
21
|
+
;
|
|
20
22
|
const messages = new messages_1.Messages('@salesforce/core', 'auth', new Map([["targetOrgNotSet", "A default user is not set."], ["targetOrgNotSet.actions", ["Run the \"sfdx auth\" commands with --setdefaultusername to connect to an org and set it as your default org.", "Run \"force:org:create\" with --setdefaultusername to create a scratch org and set it as your default org.", "Run \"sfdx config:set defaultusername=<username>\" to set your default username."]], ["portInUse", "Cannot start the OAuth redirect server on port %s."], ["portInUse.actions", ["Kill the process running on port %s or use a custom connected app and update OauthLocalPort in the sfdx-project.json file."]], ["invalidRequestMethod", "Invalid request method: %s"], ["invalidRequestUri", "Invalid request uri: %s"], ["pollingTimeout", "The device authorization request timed out. After executing force:auth:device:login, you must approve access to the device within 10 minutes. This can happen if the URL wasn\u2019t copied into the browser, login was not attempted, or the 2FA process was not completed within 10 minutes. Request authorization again."], ["serverErrorHTMLResponse", "<html><head><style>body {background-color:#F4F6F9; font-family: Arial, sans-serif; font-size: 0.8125rem; line-height: 1.5rem; color: #16325c;} #center {margin: auto; width: 370px; padding: 100px 0px 20px;} #logo-container {margin-left: auto; margin-right: auto; text-align: center;} #logo {max-width: 180px; max-height: 113px; margin-bottom: 2rem; border: 0;} #header {font-size: 1.5rem; text-align: center; margin-bottom: 1rem;} #message {background-color: #FFFFFF; margin: 0px auto; padding: 1.25rem; border-radius: 0.25rem; border: 1px solid #D8DDE6;} #footer {height: 24px; width: 370px; text-align: center; font-size: .75rem; position: absolute; bottom: 10;}</style></head><body><div id=\"center\"><div id=\"logo-container\"><img id=\"logo\" aria-hidden=\"true\" name=\"logo\" alt=\"Salesforce\" src=\"data:image/svg+xml;base64,%s\"></div><div id=\"header\">%s</div><div id=\"message\">%s<br/><br/>This is most likely <b>not</b> an error with the Salesforce CLI. Please ensure all information is accurate and try again.</div><div id=\"footer\">© %s Salesforce, Inc. All rights reserved.</div></div></body></html>"], ["missingAuthCode", "No authentication code found on login response."], ["serverSuccessHTMLResponse", "<html><head><style>body {background-color:#F4F6F9; font-family: Arial, sans-serif; font-size: 0.8125rem; line-height: 1.5rem; color: #16325c;} #center {margin: auto; width: 300px; padding: 100px 0px 20px;} #logo-container {margin-left: auto; margin-right: auto; text-align: center;} #logo {max-width: 180px; max-height: 113px; margin-bottom: 2rem; border: 0;} #header {font-size: 1.5rem; text-align: center; margin-bottom: 1rem;} #message {background-color: #FFFFFF; margin: 0px auto; padding: 1.25rem; border-radius: 0.25rem; border: 1px solid #D8DDE6;} #footer {height: 24px; width: 300px; text-align: center; font-size: .75rem; position: absolute; bottom: 10;}</style></head><body><div id=\"center\"><div id=\"logo-container\"><img id=\"logo\" aria-hidden=\"true\" name=\"logo\" alt=\"Salesforce\" src=\"data:image/svg+xml;base64,%s\"></div><div id=\"header\">Authentication Successful</div><div id=\"message\">You've successfully logged in. You can now close this browser tab or window.</div><div id=\"footer\">© %s Salesforce, Inc. All rights reserved.</div></div></body></html>"], ["serverSfdcImage", "PD94bWwgdmVyc2lvbj0iMS4wIiBlbmNvZGluZz0idXRmLTgiPz4KPCEtLSBHZW5lcmF0b3I6IEFkb2JlIElsbHVzdHJhdG9yIDIxLjEuMCwgU1ZHIEV4cG9ydCBQbHVnLUluIC4gU1ZHIFZlcnNpb246IDYuMDAgQnVpbGQgMCkgIC0tPgo8c3ZnIHZlcnNpb249IjEuMSIgaWQ9IkxheWVyXzEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2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JCWMwLjMsMCwwLjQsMC4yLDAuNCwwLjVWOTcuNnoiLz4KCQkJPC9nPgoJCTwvZz4KCTwvZz4KPC9nPgo8L3N2Zz4K"]]));
|
|
21
23
|
async function wait(ms = 1000) {
|
|
22
24
|
return new Promise((resolve) => {
|
|
@@ -59,9 +61,9 @@ class DeviceOauthService extends kit_1.AsyncCreatable {
|
|
|
59
61
|
this.pollingCount = 0;
|
|
60
62
|
this.options = options;
|
|
61
63
|
if (!this.options.clientId)
|
|
62
|
-
this.options.clientId =
|
|
64
|
+
this.options.clientId = authInfo_1.DEFAULT_CONNECTED_APP_INFO.clientId;
|
|
63
65
|
if (!this.options.loginUrl)
|
|
64
|
-
this.options.loginUrl =
|
|
66
|
+
this.options.loginUrl = authInfo_1.AuthInfo.getDefaultInstanceUrl();
|
|
65
67
|
}
|
|
66
68
|
/**
|
|
67
69
|
* Begin the authorization flow by requesting the login
|
|
@@ -90,7 +92,7 @@ class DeviceOauthService extends kit_1.AsyncCreatable {
|
|
|
90
92
|
* @returns {Promise<AuthInfo>}
|
|
91
93
|
*/
|
|
92
94
|
async authorizeAndSave(approval) {
|
|
93
|
-
const authInfo = await
|
|
95
|
+
const authInfo = await authInfo_1.AuthInfo.create({
|
|
94
96
|
oauth2Options: {
|
|
95
97
|
loginUrl: approval.instance_url,
|
|
96
98
|
refreshToken: approval.refresh_token,
|
|
@@ -113,7 +115,7 @@ class DeviceOauthService extends kit_1.AsyncCreatable {
|
|
|
113
115
|
form.append('scope', DeviceOauthService.SCOPE);
|
|
114
116
|
return {
|
|
115
117
|
url,
|
|
116
|
-
headers: { ...
|
|
118
|
+
headers: { ...connection_1.SFDX_HTTP_HEADERS, ...form.getHeaders() },
|
|
117
119
|
method: 'POST',
|
|
118
120
|
body: form.getBuffer(),
|
|
119
121
|
};
|
|
@@ -125,7 +127,7 @@ class DeviceOauthService extends kit_1.AsyncCreatable {
|
|
|
125
127
|
form.append('code', code);
|
|
126
128
|
return {
|
|
127
129
|
url,
|
|
128
|
-
headers: { ...
|
|
130
|
+
headers: { ...connection_1.SFDX_HTTP_HEADERS, ...form.getHeaders() },
|
|
129
131
|
method: 'POST',
|
|
130
132
|
body: form.getBuffer(),
|
|
131
133
|
};
|
package/lib/exported.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ export { TTLConfig } from './config/ttlConfig';
|
|
|
4
4
|
export { envVars, EnvironmentVariable, SUPPORTED_ENV_VARS, EnvVars } from './config/envVars';
|
|
5
5
|
export { ConfigStore } from './config/configStore';
|
|
6
6
|
export { ConfigEntry, ConfigContents, ConfigValue } from './config/configStackTypes';
|
|
7
|
-
export {
|
|
7
|
+
export { StateAggregator } from './stateAggregator/stateAggregator';
|
|
8
8
|
export { DeviceOauthService, DeviceCodeResponse, DeviceCodePollingResponse } from './deviceOauthService';
|
|
9
9
|
export { OrgUsersConfig } from './config/orgUsersConfig';
|
|
10
10
|
export { ConfigPropertyMeta, ConfigPropertyMetaInput, Config, SfdxPropertyKeys, SfConfigProperties, SFDX_ALLOWED_PROPERTIES, SF_ALLOWED_PROPERTIES, } from './config/config';
|
|
@@ -20,20 +20,19 @@ export { SfdcUrl } from './util/sfdcUrl';
|
|
|
20
20
|
export { getJwtAudienceUrl } from './util/getJwtAudienceUrl';
|
|
21
21
|
export { Fields, FieldValue, LoggerLevel, LoggerLevelValue, LogLine, LoggerOptions, Logger } from './logger/logger';
|
|
22
22
|
export { Messages, StructuredMessage } from './messages';
|
|
23
|
-
export { Org, SandboxProcessObject, StatusEvent, SandboxEvents, SandboxUserAuthResponse, SandboxUserAuthRequest, SandboxRequest, ResumeSandboxRequest, OrgTypes, ResultEvent, ScratchOrgRequest, } from './org';
|
|
23
|
+
export { Org, SandboxProcessObject, StatusEvent, SandboxEvents, SandboxUserAuthResponse, SandboxUserAuthRequest, SandboxRequest, ResumeSandboxRequest, OrgTypes, ResultEvent, ScratchOrgRequest, } from './org/org';
|
|
24
24
|
export { OrgConfigProperties, ORG_CONFIG_ALLOWED_PROPERTIES } from './org/orgConfigProperties';
|
|
25
25
|
export { PackageDir, NamedPackageDir, PackageDirDependency, SfProject, SfProjectJson } from './sfProject';
|
|
26
26
|
export { SchemaValidator } from './schema/validator';
|
|
27
|
-
export { SchemaPrinter } from './schema/printer';
|
|
28
27
|
export { SfError } from './sfError';
|
|
29
28
|
export { PollingClient } from './status/pollingClient';
|
|
30
29
|
export { CometClient, CometSubscription, StreamingClient, StatusResult } from './status/streamingClient';
|
|
31
30
|
export { MyDomainResolver } from './status/myDomainResolver';
|
|
32
31
|
export { DefaultUserFields, REQUIRED_FIELDS, User, UserFields } from './org/user';
|
|
33
32
|
export { PermissionSetAssignment, PermissionSetAssignmentFields } from './org/permissionSetAssignment';
|
|
33
|
+
export { lockInit } from './util/fileLocking';
|
|
34
34
|
export { ScratchOrgCreateOptions, ScratchOrgCreateResult, scratchOrgCreate, scratchOrgResume, } from './org/scratchOrgCreate';
|
|
35
35
|
export { ScratchOrgInfo } from './org/scratchOrgTypes';
|
|
36
36
|
export { ScratchOrgLifecycleEvent, scratchOrgLifecycleEventName, scratchOrgLifecycleStages, } from './org/scratchOrgLifecycleEvents';
|
|
37
37
|
export { ScratchOrgCache } from './org/scratchOrgCache';
|
|
38
38
|
export * from './util/sfdc';
|
|
39
|
-
export * from './util/sfdcUrl';
|
package/lib/exported.js
CHANGED
|
@@ -20,9 +20,10 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
20
20
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
|
-
exports.scratchOrgLifecycleEventName = exports.scratchOrgResume = exports.scratchOrgCreate = exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfError = exports.
|
|
23
|
+
exports.scratchOrgLifecycleEventName = exports.scratchOrgResume = exports.scratchOrgCreate = exports.lockInit = exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfError = exports.SchemaValidator = exports.SfProjectJson = exports.SfProject = exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = exports.OrgTypes = exports.SandboxEvents = exports.Org = exports.Messages = exports.Logger = exports.LoggerLevel = exports.getJwtAudienceUrl = exports.SfdcUrl = exports.WebOAuthServer = exports.Lifecycle = exports.Global = exports.Mode = exports.SFDX_HTTP_HEADERS = exports.Connection = exports.AuthRemover = exports.AuthInfo = exports.ConfigAggregator = exports.SandboxRequestCache = exports.SF_ALLOWED_PROPERTIES = exports.SFDX_ALLOWED_PROPERTIES = exports.SfConfigProperties = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.StateAggregator = exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = exports.envVars = exports.TTLConfig = exports.ConfigFile = void 0;
|
|
24
24
|
exports.ScratchOrgCache = exports.scratchOrgLifecycleStages = void 0;
|
|
25
25
|
const messages_1 = require("./messages");
|
|
26
|
+
;
|
|
26
27
|
var configFile_1 = require("./config/configFile");
|
|
27
28
|
Object.defineProperty(exports, "ConfigFile", { enumerable: true, get: function () { return configFile_1.ConfigFile; } });
|
|
28
29
|
var ttlConfig_1 = require("./config/ttlConfig");
|
|
@@ -32,7 +33,7 @@ Object.defineProperty(exports, "envVars", { enumerable: true, get: function () {
|
|
|
32
33
|
Object.defineProperty(exports, "EnvironmentVariable", { enumerable: true, get: function () { return envVars_1.EnvironmentVariable; } });
|
|
33
34
|
Object.defineProperty(exports, "SUPPORTED_ENV_VARS", { enumerable: true, get: function () { return envVars_1.SUPPORTED_ENV_VARS; } });
|
|
34
35
|
Object.defineProperty(exports, "EnvVars", { enumerable: true, get: function () { return envVars_1.EnvVars; } });
|
|
35
|
-
var stateAggregator_1 = require("./stateAggregator");
|
|
36
|
+
var stateAggregator_1 = require("./stateAggregator/stateAggregator");
|
|
36
37
|
Object.defineProperty(exports, "StateAggregator", { enumerable: true, get: function () { return stateAggregator_1.StateAggregator; } });
|
|
37
38
|
var deviceOauthService_1 = require("./deviceOauthService");
|
|
38
39
|
Object.defineProperty(exports, "DeviceOauthService", { enumerable: true, get: function () { return deviceOauthService_1.DeviceOauthService; } });
|
|
@@ -71,7 +72,7 @@ Object.defineProperty(exports, "LoggerLevel", { enumerable: true, get: function
|
|
|
71
72
|
Object.defineProperty(exports, "Logger", { enumerable: true, get: function () { return logger_1.Logger; } });
|
|
72
73
|
var messages_2 = require("./messages");
|
|
73
74
|
Object.defineProperty(exports, "Messages", { enumerable: true, get: function () { return messages_2.Messages; } });
|
|
74
|
-
var org_1 = require("./org");
|
|
75
|
+
var org_1 = require("./org/org");
|
|
75
76
|
Object.defineProperty(exports, "Org", { enumerable: true, get: function () { return org_1.Org; } });
|
|
76
77
|
Object.defineProperty(exports, "SandboxEvents", { enumerable: true, get: function () { return org_1.SandboxEvents; } });
|
|
77
78
|
Object.defineProperty(exports, "OrgTypes", { enumerable: true, get: function () { return org_1.OrgTypes; } });
|
|
@@ -83,8 +84,6 @@ Object.defineProperty(exports, "SfProject", { enumerable: true, get: function ()
|
|
|
83
84
|
Object.defineProperty(exports, "SfProjectJson", { enumerable: true, get: function () { return sfProject_1.SfProjectJson; } });
|
|
84
85
|
var validator_1 = require("./schema/validator");
|
|
85
86
|
Object.defineProperty(exports, "SchemaValidator", { enumerable: true, get: function () { return validator_1.SchemaValidator; } });
|
|
86
|
-
var printer_1 = require("./schema/printer");
|
|
87
|
-
Object.defineProperty(exports, "SchemaPrinter", { enumerable: true, get: function () { return printer_1.SchemaPrinter; } });
|
|
88
87
|
var sfError_1 = require("./sfError");
|
|
89
88
|
Object.defineProperty(exports, "SfError", { enumerable: true, get: function () { return sfError_1.SfError; } });
|
|
90
89
|
var pollingClient_1 = require("./status/pollingClient");
|
|
@@ -100,6 +99,8 @@ Object.defineProperty(exports, "REQUIRED_FIELDS", { enumerable: true, get: funct
|
|
|
100
99
|
Object.defineProperty(exports, "User", { enumerable: true, get: function () { return user_1.User; } });
|
|
101
100
|
var permissionSetAssignment_1 = require("./org/permissionSetAssignment");
|
|
102
101
|
Object.defineProperty(exports, "PermissionSetAssignment", { enumerable: true, get: function () { return permissionSetAssignment_1.PermissionSetAssignment; } });
|
|
102
|
+
var fileLocking_1 = require("./util/fileLocking");
|
|
103
|
+
Object.defineProperty(exports, "lockInit", { enumerable: true, get: function () { return fileLocking_1.lockInit; } });
|
|
103
104
|
var scratchOrgCreate_1 = require("./org/scratchOrgCreate");
|
|
104
105
|
Object.defineProperty(exports, "scratchOrgCreate", { enumerable: true, get: function () { return scratchOrgCreate_1.scratchOrgCreate; } });
|
|
105
106
|
Object.defineProperty(exports, "scratchOrgResume", { enumerable: true, get: function () { return scratchOrgCreate_1.scratchOrgResume; } });
|
|
@@ -110,5 +111,4 @@ var scratchOrgCache_1 = require("./org/scratchOrgCache");
|
|
|
110
111
|
Object.defineProperty(exports, "ScratchOrgCache", { enumerable: true, get: function () { return scratchOrgCache_1.ScratchOrgCache; } });
|
|
111
112
|
// Utility sub-modules
|
|
112
113
|
__exportStar(require("./util/sfdc"), exports);
|
|
113
|
-
__exportStar(require("./util/sfdcUrl"), exports);
|
|
114
114
|
//# sourceMappingURL=exported.js.map
|
package/lib/global.js
CHANGED
|
@@ -7,9 +7,9 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.Global = exports.Mode = void 0;
|
|
10
|
-
const fs = require("fs");
|
|
11
|
-
const os = require("os");
|
|
12
|
-
const path = require("path");
|
|
10
|
+
const fs = require("node:fs");
|
|
11
|
+
const os = require("node:os");
|
|
12
|
+
const path = require("node:path");
|
|
13
13
|
const kit_1 = require("@salesforce/kit");
|
|
14
14
|
const sfError_1 = require("./sfError");
|
|
15
15
|
/**
|
|
@@ -24,7 +24,7 @@ var Mode;
|
|
|
24
24
|
Mode["DEVELOPMENT"] = "development";
|
|
25
25
|
Mode["DEMO"] = "demo";
|
|
26
26
|
Mode["TEST"] = "test";
|
|
27
|
-
})(Mode
|
|
27
|
+
})(Mode || (exports.Mode = Mode = {}));
|
|
28
28
|
/**
|
|
29
29
|
* Global constants, methods, and configuration.
|
|
30
30
|
*/
|
package/lib/logger/logger.js
CHANGED
|
@@ -7,8 +7,8 @@ exports.computeLevel = exports.Logger = exports.LoggerLevel = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const os = require("os");
|
|
11
|
-
const path = require("path");
|
|
10
|
+
const os = require("node:os");
|
|
11
|
+
const path = require("node:path");
|
|
12
12
|
const pino_1 = require("pino");
|
|
13
13
|
const kit_1 = require("@salesforce/kit");
|
|
14
14
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
@@ -30,7 +30,7 @@ var LoggerLevel;
|
|
|
30
30
|
LoggerLevel[LoggerLevel["WARN"] = 40] = "WARN";
|
|
31
31
|
LoggerLevel[LoggerLevel["ERROR"] = 50] = "ERROR";
|
|
32
32
|
LoggerLevel[LoggerLevel["FATAL"] = 60] = "FATAL";
|
|
33
|
-
})(LoggerLevel
|
|
33
|
+
})(LoggerLevel || (exports.LoggerLevel = LoggerLevel = {}));
|
|
34
34
|
/**
|
|
35
35
|
* A logging abstraction powered by {@link https://github.com/pinojs/pino | Pino} that provides both a default
|
|
36
36
|
* logger configuration that will log to the default path, and a way to create custom loggers based on the same foundation.
|
|
@@ -71,6 +71,7 @@ class Logger {
|
|
|
71
71
|
* `Logger`.
|
|
72
72
|
*/
|
|
73
73
|
constructor(optionsOrName) {
|
|
74
|
+
const enabled = process.env.SFDX_DISABLE_LOG_FILE !== 'true' && process.env.SF_DISABLE_LOG_FILE !== 'true';
|
|
74
75
|
const options = typeof optionsOrName === 'string'
|
|
75
76
|
? { name: optionsOrName, level: Logger.DEFAULT_LEVEL, fields: {} }
|
|
76
77
|
: optionsOrName;
|
|
@@ -89,9 +90,9 @@ class Logger {
|
|
|
89
90
|
name: options.name ?? Logger.ROOT_NAME,
|
|
90
91
|
base: options.fields ?? {},
|
|
91
92
|
level,
|
|
92
|
-
enabled
|
|
93
|
+
enabled,
|
|
93
94
|
};
|
|
94
|
-
if (options.useMemoryLogger || global_1.Global.getEnvironmentMode() === global_1.Mode.TEST) {
|
|
95
|
+
if (Boolean(options.useMemoryLogger) || global_1.Global.getEnvironmentMode() === global_1.Mode.TEST || !enabled) {
|
|
95
96
|
this.memoryLogger = new memoryLogger_1.MemoryLogger();
|
|
96
97
|
this.pinoLogger = (0, pino_1.pino)({
|
|
97
98
|
...commonOptions,
|
|
@@ -7,13 +7,13 @@ exports.MemoryLogger = void 0;
|
|
|
7
7
|
* Licensed under the BSD 3-Clause license.
|
|
8
8
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
9
9
|
*/
|
|
10
|
-
const
|
|
10
|
+
const node_stream_1 = require("node:stream");
|
|
11
11
|
const unwrapArray_1 = require("../util/unwrapArray");
|
|
12
12
|
const filters_1 = require("./filters");
|
|
13
13
|
/**
|
|
14
14
|
* Used by test setup to keep UT from writing to disk.
|
|
15
15
|
*/
|
|
16
|
-
class MemoryLogger extends
|
|
16
|
+
class MemoryLogger extends node_stream_1.Writable {
|
|
17
17
|
constructor() {
|
|
18
18
|
super({ objectMode: true });
|
|
19
19
|
this.loggedData = [];
|
|
@@ -6,7 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
* Licensed under the BSD 3-Clause license.
|
|
7
7
|
* For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
|
|
8
8
|
*/
|
|
9
|
-
const
|
|
9
|
+
const node_stream_1 = require("node:stream");
|
|
10
10
|
const unwrapArray_1 = require("../util/unwrapArray");
|
|
11
11
|
const filters_1 = require("./filters");
|
|
12
12
|
// eslint-disable-next-line @typescript-eslint/no-var-requires, @typescript-eslint/no-unsafe-assignment
|
|
@@ -16,7 +16,7 @@ function default_1() {
|
|
|
16
16
|
return build(
|
|
17
17
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
18
18
|
(source) => {
|
|
19
|
-
const myTransportStream = new
|
|
19
|
+
const myTransportStream = new node_stream_1.Transform({
|
|
20
20
|
objectMode: true,
|
|
21
21
|
transform(chunk, enc, cb) {
|
|
22
22
|
if (debugAllows(chunk)) {
|
|
@@ -29,7 +29,7 @@ function default_1() {
|
|
|
29
29
|
},
|
|
30
30
|
});
|
|
31
31
|
// eslint-disable-next-line @typescript-eslint/no-empty-function
|
|
32
|
-
(0,
|
|
32
|
+
(0, node_stream_1.pipeline)(source, myTransportStream, () => { });
|
|
33
33
|
return myTransportStream;
|
|
34
34
|
}, {
|
|
35
35
|
// This is needed to be able to pipeline transports.
|
|
@@ -28,7 +28,7 @@ const messageTransformer = () => {
|
|
|
28
28
|
if (ts.isExpressionStatement(node) && node.getText().includes('importMessagesDirectory')) {
|
|
29
29
|
// importMessagesDirectory now happens at compile, not in runtime
|
|
30
30
|
// returning undefined removes the node
|
|
31
|
-
return
|
|
31
|
+
return ts.factory.createEmptyStatement();
|
|
32
32
|
}
|
|
33
33
|
if (
|
|
34
34
|
// transform a runtime load call into hardcoded messages values
|
|
@@ -54,7 +54,7 @@ const messageTransformer = () => {
|
|
|
54
54
|
// it might be a node that contains one of the things we're interested in, so keep digging
|
|
55
55
|
return ts.visitEachChild(node, visitor, context);
|
|
56
56
|
};
|
|
57
|
-
return ts.visitNode(sourceFile, visitor);
|
|
57
|
+
return ts.visitNode(sourceFile, visitor, ts.isSourceFile);
|
|
58
58
|
};
|
|
59
59
|
return transformerFactory;
|
|
60
60
|
};
|
package/lib/messages.js
CHANGED
|
@@ -7,10 +7,10 @@
|
|
|
7
7
|
*/
|
|
8
8
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
9
9
|
exports.Messages = void 0;
|
|
10
|
-
const fs = require("fs");
|
|
11
|
-
const os = require("os");
|
|
12
|
-
const path = require("path");
|
|
13
|
-
const util = require("util");
|
|
10
|
+
const fs = require("node:fs");
|
|
11
|
+
const os = require("node:os");
|
|
12
|
+
const path = require("node:path");
|
|
13
|
+
const util = require("node:util");
|
|
14
14
|
const ts_types_1 = require("@salesforce/ts-types");
|
|
15
15
|
const kit_1 = require("@salesforce/kit");
|
|
16
16
|
const sfError_1 = require("./sfError");
|
|
@@ -438,7 +438,7 @@ class Messages {
|
|
|
438
438
|
// 'myMessage' -> `MyMessageWarning`
|
|
439
439
|
// 'myMessageError' -> `MyMessageError`
|
|
440
440
|
// 'warning.myMessage' -> `MyMessageWarning`
|
|
441
|
-
const name = `${(0, kit_1.upperFirst)(key.replace(searchValue, ''))}${labelRegExp.exec(key)
|
|
441
|
+
const name = `${(0, kit_1.upperFirst)(key.replace(searchValue, ''))}${labelRegExp.exec(key) ?? preserveName ? '' : label}`;
|
|
442
442
|
const message = this.getMessage(key, tokens);
|
|
443
443
|
let actions;
|
|
444
444
|
try {
|