Socket
Socket
Sign inDemoInstall

@salesforce/core

Package Overview
Dependencies
Maintainers
29
Versions
499
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@salesforce/core - npm Package Compare versions

Comparing version 1.0.3 to 1.1.0

4

lib/authInfo.js

@@ -318,3 +318,3 @@ "use strict";

this.logger.debug(dataToSave);
const config = await authInfoConfig_1.AuthInfoConfig.create(authInfoConfig_1.AuthInfoConfig.getOptions(username));
const config = await authInfoConfig_1.AuthInfoConfig.create(Object.assign({}, authInfoConfig_1.AuthInfoConfig.getOptions(username), { throwOnNotFound: false }));
config.setContentsFromObject(dataToSave);

@@ -488,3 +488,3 @@ await config.write();

try {
const config = await authInfoConfig_1.AuthInfoConfig.create(authInfoConfig_1.AuthInfoConfig.getOptions(username));
const config = await authInfoConfig_1.AuthInfoConfig.create(Object.assign({}, authInfoConfig_1.AuthInfoConfig.getOptions(username), { throwOnNotFound: true }));
authConfig = config.toObject();

@@ -491,0 +491,0 @@ }

@@ -95,2 +95,5 @@ /// <reference types="node" />

* Used to initialize asynchronous components.
*
* **Throws** *`Error`{ code: 'ENOENT' }* If the username.json file is not found when
* options.throwOnNotFound is true.
*/

@@ -124,3 +127,7 @@ protected init(): Promise<void>;

filePath?: string;
/**
* Indicates if init should throw if the corresponding config file is not found.
*/
throwOnNotFound?: boolean;
}
}

@@ -168,2 +168,5 @@ "use strict";

* Used to initialize asynchronous components.
*
* **Throws** *`Error`{ code: 'ENOENT' }* If the username.json file is not found when
* options.throwOnNotFound is true.
*/

@@ -194,3 +197,3 @@ async init() {

this.path = path_1.join(configRootFolder, this.options.filePath ? this.options.filePath : '', this.options.filename);
await this.read();
await this.read(this.options.throwOnNotFound);
}

@@ -197,0 +200,0 @@ }

@@ -353,3 +353,3 @@ "use strict";

// create the file
_writeFile.call(this, opts, fn);
await _writeFile.call(this, opts, fn);
}

@@ -362,3 +362,3 @@ else {

// the existing file validated. we can write the updated key
_writeFile.call(this, opts, fn);
await _writeFile.call(this, opts, fn);
}

@@ -365,0 +365,0 @@ });

@@ -69,25 +69,20 @@ "use strict";

.create(kit_1.mapKeys(assignment, (value, key) => kit_1.upperFirst(key)));
if (createResponse.length) {
throw sfdxError_1.SfdxError.create('@salesforce/core', 'permissionSetAssignment', 'unexpectedType');
}
else {
if (createResponse.success) {
return assignment;
if (ts_types_1.hasArray(createResponse, 'errors')) {
const messages = messages_1.Messages.loadMessages('@salesforce/core', 'permissionSetAssignment');
let message = messages.getMessage('errorsEncounteredCreatingAssignment');
const errors = createResponse.errors;
if (errors && errors.length > 0) {
message = `${message}:${os_1.EOL}`;
errors.forEach(_message => {
message = `${message}${_message}${os_1.EOL}`;
});
throw new sfdxError_1.SfdxError(message, 'errorsEncounteredCreatingAssignment');
}
else {
const messages = messages_1.Messages.loadMessages('@salesforce/core', 'permissionSetAssignment');
let message = messages.getMessage('errorsEncounteredCreatingAssignment');
const errors = createResponse.errors;
if (errors && errors.length > 0) {
message = `${message}:${os_1.EOL}`;
errors.forEach(_message => {
message = `${message}${_message}${os_1.EOL}`;
});
throw new sfdxError_1.SfdxError(message, 'errorsEncounteredCreatingAssignment');
}
else {
throw sfdxError_1.SfdxError.create('@salesforce/core', 'permissionSetAssignment', 'notSuccessfulButNoErrorsReported');
}
throw sfdxError_1.SfdxError.create('@salesforce/core', 'permissionSetAssignment', 'notSuccessfulButNoErrorsReported');
}
}
else {
return assignment;
}
}

@@ -94,0 +89,0 @@ /**

@@ -173,3 +173,3 @@ "use strict";

*/
exports.unexpectedResult = new sfdxError_1.SfdxError('This code was expected to failed', 'UnexpectedResult');
exports.unexpectedResult = new sfdxError_1.SfdxError('This code was expected to fail', 'UnexpectedResult');
/**

@@ -176,0 +176,0 @@ * Use for this testing pattern:

{
"name": "@salesforce/core",
"version": "1.0.3",
"version": "1.1.0",
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.",

@@ -15,2 +15,3 @@ "main": "lib/exported",

"lint": "yarn sfdx-lint",
"lint-fix": "yarn sfdx-lint --fix",
"postcompile": "tsc -p test; tsc -p typedocExamples",

@@ -43,7 +44,7 @@ "prepack": "yarn sfdx-build",

"@salesforce/ts-types": "0.19.3",
"@types/jsforce": "1.8.12",
"@types/jsforce": "1.9.2",
"bunyan-sfdx-no-dtrace": "1.8.2",
"debug": "^3.1.0",
"jsen": "0.6.6",
"jsforce": "1.8.4",
"jsforce": "1.9.1",
"jsonwebtoken": "7.0.0",

@@ -54,3 +55,3 @@ "mkdirp": "0.5.1",

"devDependencies": {
"@salesforce/dev-scripts": "0.3.7",
"@salesforce/dev-scripts": "0.3.9",
"@types/debug": "0.0.30",

@@ -57,0 +58,0 @@ "@types/jsen": "0.0.19",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc