@salesforce/core
Advanced tools
Comparing version 1.2.1 to 1.2.2
@@ -0,1 +1,8 @@ | ||
## [1.2.2](https://github.com/forcedotcom/sfdx-core/compare/v1.2.1...v1.2.2) (2019-02-11) | ||
### Bug Fixes | ||
* use default options off the constructor ([368a5f1](https://github.com/forcedotcom/sfdx-core/commit/368a5f1)) | ||
## [1.2.1](https://github.com/forcedotcom/sfdx-core/compare/v1.2.0...v1.2.1) (2019-01-31) | ||
@@ -2,0 +9,0 @@ |
@@ -75,15 +75,22 @@ import { AsyncCreatable } from '@salesforce/kit'; | ||
* // Creating a new authentication file. | ||
* const authInfo = await AuthInfo.create(myAdminUsername, { | ||
* const authInfo = await AuthInfo.create({ | ||
* username: myAdminUsername, | ||
* oauth2Options: { | ||
* loginUrl, authCode, clientId, clientSecret | ||
* }); | ||
* } | ||
* ); | ||
* authInfo.save(); | ||
* | ||
* // Creating an authorization info with an access token. | ||
* const authInfo = await AuthInfo.create(accessToken); | ||
* const authInfo = await AuthInfo.create({ | ||
* username: accessToken | ||
* }); | ||
* | ||
* // Using an existing authentication file. | ||
* const authInfo = await AuthInfo.create(myAdminUsername); | ||
* const authInfo = await AuthInfo.create({ | ||
* username: myAdminUsername | ||
* }); | ||
* | ||
* // Using the AuthInfo | ||
* const connection = await Connection.create(authInfo); | ||
* const connection = await Connection.create({ authInfo }); | ||
* ``` | ||
@@ -90,0 +97,0 @@ */ |
@@ -193,15 +193,22 @@ "use strict"; | ||
* // Creating a new authentication file. | ||
* const authInfo = await AuthInfo.create(myAdminUsername, { | ||
* const authInfo = await AuthInfo.create({ | ||
* username: myAdminUsername, | ||
* oauth2Options: { | ||
* loginUrl, authCode, clientId, clientSecret | ||
* }); | ||
* } | ||
* ); | ||
* authInfo.save(); | ||
* | ||
* // Creating an authorization info with an access token. | ||
* const authInfo = await AuthInfo.create(accessToken); | ||
* const authInfo = await AuthInfo.create({ | ||
* username: accessToken | ||
* }); | ||
* | ||
* // Using an existing authentication file. | ||
* const authInfo = await AuthInfo.create(myAdminUsername); | ||
* const authInfo = await AuthInfo.create({ | ||
* username: myAdminUsername | ||
* }); | ||
* | ||
* // Using the AuthInfo | ||
* const connection = await Connection.create(authInfo); | ||
* const connection = await Connection.create({ authInfo }); | ||
* ``` | ||
@@ -208,0 +215,0 @@ */ |
@@ -17,3 +17,3 @@ import { JsonMap, Optional } from '@salesforce/ts-types'; | ||
* ``` | ||
* const aliases = await Aliases.create(); | ||
* const aliases = await Aliases.create({}); | ||
* aliases.set('myAlias', 'username@company.org'); | ||
@@ -47,3 +47,3 @@ * await aliases.write(); | ||
/** | ||
* Get an alias from a key and group. Shorthand for `Alias.create().get(key)`. Returns the promise resolved when the | ||
* Get an alias from a key and group. Shorthand for `Alias.create({}).get(key)`. Returns the promise resolved when the | ||
* alias is created. | ||
@@ -50,0 +50,0 @@ * @param key The value of the alias to match. |
@@ -28,3 +28,3 @@ "use strict"; | ||
* ``` | ||
* const aliases = await Aliases.create(); | ||
* const aliases = await Aliases.create({}); | ||
* aliases.set('myAlias', 'username@company.org'); | ||
@@ -77,3 +77,3 @@ * await aliases.write(); | ||
/** | ||
* Get an alias from a key and group. Shorthand for `Alias.create().get(key)`. Returns the promise resolved when the | ||
* Get an alias from a key and group. Shorthand for `Alias.create({}).get(key)`. Returns the promise resolved when the | ||
* alias is created. | ||
@@ -80,0 +80,0 @@ * @param key The value of the alias to match. |
@@ -45,3 +45,3 @@ import { ConfigFile } from './configFile'; | ||
* ``` | ||
* const localConfig = await Config.create(); | ||
* const localConfig = await Config.create({}); | ||
* localConfig.set('defaultusername', 'username@company.org'); | ||
@@ -48,0 +48,0 @@ * await localConfig.write(); |
@@ -24,3 +24,3 @@ "use strict"; | ||
* ``` | ||
* const localConfig = await Config.create(); | ||
* const localConfig = await Config.create({}); | ||
* localConfig.set('defaultusername', 'username@company.org'); | ||
@@ -61,3 +61,3 @@ * await localConfig.write(); | ||
isState: true, | ||
filename: filename || Config.getFileName() | ||
filename: filename || this.getFileName() | ||
}; | ||
@@ -64,0 +64,0 @@ } |
@@ -96,3 +96,3 @@ /// <reference types="node" /> | ||
* | ||
* **Throws** *`Error`{ code: 'ENOENT' }* If the username.json file is not found when | ||
* **Throws** *`Error`{ code: 'ENOENT' }* If the {@link ConfigFile.getFilename} file is not found when | ||
* options.throwOnNotFound is true. | ||
@@ -99,0 +99,0 @@ */ |
@@ -63,3 +63,3 @@ "use strict"; | ||
isState: true, | ||
filename: filename || ConfigFile.getFileName() | ||
filename: filename || this.getFileName() | ||
}; | ||
@@ -170,9 +170,10 @@ } | ||
* | ||
* **Throws** *`Error`{ code: 'ENOENT' }* If the username.json file is not found when | ||
* **Throws** *`Error`{ code: 'ENOENT' }* If the {@link ConfigFile.getFilename} file is not found when | ||
* options.throwOnNotFound is true. | ||
*/ | ||
async init() { | ||
const statics = this.constructor; | ||
let defaultOptions = {}; | ||
try { | ||
defaultOptions = ConfigFile.getDefaultOptions(); | ||
defaultOptions = statics.getDefaultOptions(); | ||
} | ||
@@ -179,0 +180,0 @@ catch (e) { |
@@ -30,4 +30,4 @@ import { JsonCollection, JsonMap, Optional } from '@salesforce/ts-types'; | ||
* const connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'myAdminUsername' }) | ||
* }); | ||
* authInfo: await AuthInfo.create({ username: 'myAdminUsername' }) | ||
* }); | ||
* connection.query('SELECT Name from Account'); | ||
@@ -34,0 +34,0 @@ * |
@@ -34,4 +34,4 @@ "use strict"; | ||
* const connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'myAdminUsername' }) | ||
* }); | ||
* authInfo: await AuthInfo.create({ username: 'myAdminUsername' }) | ||
* }); | ||
* connection.query('SELECT Name from Account'); | ||
@@ -38,0 +38,0 @@ * |
@@ -20,3 +20,3 @@ import { AsyncCreatable } from '@salesforce/kit'; | ||
* // Email username | ||
* const org1: Org = await Org.create({ aliasOrUsername: 'foo@example.com' });//tslint:disable-line:no-unused-variable | ||
* const org1: Org = await Org.create({ aliasOrUsername: 'foo@example.com' }); | ||
* // The defaultusername config property | ||
@@ -26,3 +26,5 @@ * const org2: Org = await Org.create({}); | ||
* const org3: Org = await Org.create({ | ||
* connection: await Connection.create(await AuthInfo.create({ username: 'username' })) | ||
* connection: await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'username' }) | ||
* }) | ||
* }); | ||
@@ -105,4 +107,10 @@ * ``` | ||
* ``` | ||
* const org: Org = await Org.create(await Connection.create(await AuthInfo.create('foo@example.com'))); | ||
* const userAuth: AuthInfo = await AuthInfo.create('bar@example.com'); | ||
* const org: Org = await Org.create({ | ||
* connection: await Connection.create({ | ||
* authInfo: await AuthInfo.create('foo@example.com') | ||
* }) | ||
* }); | ||
* const userAuth: AuthInfo = await AuthInfo.create({ | ||
* username: 'bar@example.com' | ||
* }); | ||
* await org.addUsername(userAuth); | ||
@@ -109,0 +117,0 @@ * ``` |
@@ -36,3 +36,3 @@ "use strict"; | ||
* // Email username | ||
* const org1: Org = await Org.create({ aliasOrUsername: 'foo@example.com' });//tslint:disable-line:no-unused-variable | ||
* const org1: Org = await Org.create({ aliasOrUsername: 'foo@example.com' }); | ||
* // The defaultusername config property | ||
@@ -42,3 +42,5 @@ * const org2: Org = await Org.create({}); | ||
* const org3: Org = await Org.create({ | ||
* connection: await Connection.create(await AuthInfo.create({ username: 'username' })) | ||
* connection: await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'username' }) | ||
* }) | ||
* }); | ||
@@ -267,4 +269,10 @@ * ``` | ||
* ``` | ||
* const org: Org = await Org.create(await Connection.create(await AuthInfo.create('foo@example.com'))); | ||
* const userAuth: AuthInfo = await AuthInfo.create('bar@example.com'); | ||
* const org: Org = await Org.create({ | ||
* connection: await Connection.create({ | ||
* authInfo: await AuthInfo.create('foo@example.com') | ||
* }) | ||
* }); | ||
* const userAuth: AuthInfo = await AuthInfo.create({ | ||
* username: 'bar@example.com' | ||
* }); | ||
* await org.addUsername(userAuth); | ||
@@ -271,0 +279,0 @@ * ``` |
@@ -128,3 +128,3 @@ /// <reference types="node" /> | ||
* | ||
* const org = await Org.create(); | ||
* const org = await Org.create({}); | ||
* const options = new StreamingClient.DefaultOptions(org, 'MyPushTopics', streamProcessor); | ||
@@ -131,0 +131,0 @@ * |
@@ -74,3 +74,3 @@ "use strict"; | ||
* | ||
* const org = await Org.create(); | ||
* const org = await Org.create({}); | ||
* const options = new StreamingClient.DefaultOptions(org, 'MyPushTopics', streamProcessor); | ||
@@ -77,0 +77,0 @@ * |
@@ -33,3 +33,5 @@ import { AsyncCreatable } from '@salesforce/kit'; | ||
* ``` | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({username: 'user@example.com'})}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'user@example.com' }) | ||
* }); | ||
* const org: Org = await Org.create({ connection }); | ||
@@ -102,3 +104,5 @@ * const options: DefaultUserFields.Options = { | ||
* const username = 'user@example.com'; | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({ username })}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -124,3 +128,5 @@ * const user: User = await User.create({ org }); | ||
* ``` | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({username: 'user@example.com'})}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'user@example.com' }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -140,3 +146,5 @@ * | ||
* const username = 'boris@thecat.com'; | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({ username })}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -143,0 +151,0 @@ * const user: User = await User.create({ org }); |
@@ -96,3 +96,5 @@ "use strict"; | ||
* ``` | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({username: 'user@example.com'})}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'user@example.com' }) | ||
* }); | ||
* const org: Org = await Org.create({ connection }); | ||
@@ -204,3 +206,5 @@ * const options: DefaultUserFields.Options = { | ||
* const username = 'user@example.com'; | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({ username })}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -237,3 +241,5 @@ * const user: User = await User.create({ org }); | ||
* ``` | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({username: 'user@example.com'})}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username: 'user@example.com' }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -279,3 +285,5 @@ * | ||
* const username = 'boris@thecat.com'; | ||
* const connection: Connection = await Connection.create({authInfo: await AuthInfo.create({ username })}); | ||
* const connection: Connection = await Connection.create({ | ||
* authInfo: await AuthInfo.create({ username }) | ||
* }); | ||
* const org = await Org.create({ connection }); | ||
@@ -282,0 +290,0 @@ * const user: User = await User.create({ org }); |
{ | ||
"name": "@salesforce/core", | ||
"version": "1.2.1", | ||
"version": "1.2.2", | ||
"description": "Core libraries to interact with SFDX projects, orgs, and APIs.", | ||
@@ -5,0 +5,0 @@ "main": "lib/exported", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
423091
10747