occam-open-cli 6.0.173 → 6.0.175
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/bin/action/createAccount.js +3 -3
- package/bin/action/setOptions.js +3 -3
- package/bin/action/setShellCommands.js +5 -7
- package/bin/action/signIn.js +2 -2
- package/bin/configuration/version_5_1.js +5 -2
- package/bin/defaults.js +2 -0
- package/bin/operation/{setIdentityToken.js → updateIdentityToken.js} +2 -2
- package/bin/operation/{setOptions.js → updateOptions.js} +2 -2
- package/bin/operation/updateShellCommands.js +13 -0
- package/bin/prepare.js +12 -3
- package/package.json +1 -1
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
const createAccountOperation = require("../operation/createAccount"),
|
|
4
4
|
passwordPromptOperation = require("../operation/prompt/password"),
|
|
5
5
|
usernamePromptOperation = require("../operation/prompt/username"),
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
emailAddressPromptOperation = require("../operation/prompt/emailAddress"),
|
|
7
|
+
updateIdentityTokenOperation = require("../operation/updateIdentityToken");
|
|
8
8
|
|
|
9
9
|
const { executeOperations } = require("../utilities/operation");
|
|
10
10
|
|
|
@@ -16,7 +16,7 @@ function createAccountAction(emailAddress) {
|
|
|
16
16
|
usernamePromptOperation,
|
|
17
17
|
passwordPromptOperation,
|
|
18
18
|
createAccountOperation,
|
|
19
|
-
|
|
19
|
+
updateIdentityTokenOperation
|
|
20
20
|
],
|
|
21
21
|
context = {
|
|
22
22
|
emailAddress,
|
package/bin/action/setOptions.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
4
|
-
|
|
3
|
+
const useSSHPromptOperation = require("../operation/prompt/useSSH"),
|
|
4
|
+
updateOptionsOperation = require("../operation/updateOptions"),
|
|
5
5
|
gitHubHostNamePromptOperation = require("../operation/prompt/gitHubHostName");
|
|
6
6
|
|
|
7
7
|
const { executeOperations } = require("../utilities/operation"),
|
|
@@ -11,7 +11,7 @@ function setOptionsAction() {
|
|
|
11
11
|
const operations = [
|
|
12
12
|
useSSHPromptOperation,
|
|
13
13
|
gitHubHostNamePromptOperation,
|
|
14
|
-
|
|
14
|
+
updateOptionsOperation
|
|
15
15
|
],
|
|
16
16
|
context = {};
|
|
17
17
|
|
|
@@ -1,14 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const updateShellCommandsOperation = require("../operation/updateShellCommands"),
|
|
4
|
+
setShellCommandsPromptOperation = require("../operation/prompt/setShellCommands");
|
|
4
5
|
|
|
5
6
|
const { executeOperations } = require("../utilities/operation"),
|
|
6
|
-
{ retrieveShellCommands
|
|
7
|
+
{ retrieveShellCommands } = require("../configuration"),
|
|
7
8
|
{ FAILED_SET_SHELL_COMMANDS_MESSAGE, SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE } = require("../messages");
|
|
8
9
|
|
|
9
10
|
function setShellCommandsAction() {
|
|
10
11
|
const operations = [
|
|
11
|
-
setShellCommandsPromptOperation
|
|
12
|
+
setShellCommandsPromptOperation,
|
|
13
|
+
updateShellCommandsOperation
|
|
12
14
|
],
|
|
13
15
|
shellCommands = retrieveShellCommands(),
|
|
14
16
|
context = {
|
|
@@ -22,10 +24,6 @@ function setShellCommandsAction() {
|
|
|
22
24
|
return;
|
|
23
25
|
}
|
|
24
26
|
|
|
25
|
-
const { shellCommands } = context;
|
|
26
|
-
|
|
27
|
-
updateShellCommands(shellCommands);
|
|
28
|
-
|
|
29
27
|
console.log(SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE);
|
|
30
28
|
}, context);
|
|
31
29
|
}
|
package/bin/action/signIn.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const signInOperation = require("../operation/signIn"),
|
|
4
4
|
passwordPromptOperation = require("../operation/prompt/password"),
|
|
5
|
-
|
|
5
|
+
updateIdentityTokenOperation = require("../operation/updateIdentityToken"),
|
|
6
6
|
emailAddressOrUsernamePromptOperation = require("../operation/prompt/emailAddressOrUsername");
|
|
7
7
|
|
|
8
8
|
const { executeOperations } = require("../utilities/operation");
|
|
@@ -13,7 +13,7 @@ function signInAction(emailAddressOrUsername) {
|
|
|
13
13
|
emailAddressOrUsernamePromptOperation,
|
|
14
14
|
passwordPromptOperation,
|
|
15
15
|
signInOperation,
|
|
16
|
-
|
|
16
|
+
updateIdentityTokenOperation
|
|
17
17
|
],
|
|
18
18
|
context = {
|
|
19
19
|
emailAddressOrUsername,
|
|
@@ -1,12 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
3
|
const { VERSION_5_1 } = require("../versions"),
|
|
4
|
-
{ DEFAULT_HOST, DEFAULT_SHELL_COMMANDS } = require("../defaults");
|
|
4
|
+
{ DEFAULT_HOST, DEFAULT_USE_SSH, DEFAULT_SHELL_COMMANDS } = require("../defaults");
|
|
5
5
|
|
|
6
6
|
function createConfiguration() {
|
|
7
7
|
const version = VERSION_5_1,
|
|
8
8
|
host = DEFAULT_HOST,
|
|
9
|
-
|
|
9
|
+
useSSH = DEFAULT_USE_SSH,
|
|
10
|
+
options = {
|
|
11
|
+
useSSH,
|
|
12
|
+
},
|
|
10
13
|
shellCommands = DEFAULT_SHELL_COMMANDS,
|
|
11
14
|
identityToken = null,
|
|
12
15
|
configuration = {
|
package/bin/defaults.js
CHANGED
|
@@ -15,6 +15,7 @@ const DEFAULT_NO = false,
|
|
|
15
15
|
DEFAULT_DRY_RUN = false,
|
|
16
16
|
DEFAULT_VERSION = false,
|
|
17
17
|
DEFAULT_QUIETLY = false,
|
|
18
|
+
DEFAULT_USE_SSH = false,
|
|
18
19
|
DEFAULT_LOG_LEVEL = INFO_LEVEL,
|
|
19
20
|
DEFAULT_SHELL_COMMANDS = EMPTY_STRING,
|
|
20
21
|
DEFAULT_GITHUB_HOST_NAME = "github.com";
|
|
@@ -29,6 +30,7 @@ module.exports = {
|
|
|
29
30
|
DEFAULT_DRY_RUN,
|
|
30
31
|
DEFAULT_VERSION,
|
|
31
32
|
DEFAULT_QUIETLY,
|
|
33
|
+
DEFAULT_USE_SSH,
|
|
32
34
|
DEFAULT_LOG_LEVEL,
|
|
33
35
|
DEFAULT_SHELL_COMMANDS,
|
|
34
36
|
DEFAULT_GITHUB_HOST_NAME
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { updateIdentityToken } = require("../configuration");
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function updateIdentityTokenOperation(proceed, abort, context) {
|
|
6
6
|
const { identityToken } = context;
|
|
7
7
|
|
|
8
8
|
if (identityToken !== null) {
|
|
@@ -12,4 +12,4 @@ function setIdentityTokenOperation(proceed, abort, context) {
|
|
|
12
12
|
proceed();
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
module.exports =
|
|
15
|
+
module.exports = updateIdentityTokenOperation;
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
const { updateOptions } = require("../configuration");
|
|
4
4
|
|
|
5
|
-
function
|
|
5
|
+
function updateOptionsOperation(proceed, abort, context) {
|
|
6
6
|
const { useSSH } = context,
|
|
7
7
|
options = {};
|
|
8
8
|
|
|
@@ -22,4 +22,4 @@ function setOptionsOperation(proceed, abort, context) {
|
|
|
22
22
|
proceed();
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
module.exports =
|
|
25
|
+
module.exports = updateOptionsOperation;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
const { updateShellCommands } = require("../configuration");
|
|
4
|
+
|
|
5
|
+
function updateShellCommandsOperation(proceed, abort, context) {
|
|
6
|
+
const { shellCommands } = context;
|
|
7
|
+
|
|
8
|
+
updateShellCommands(shellCommands);
|
|
9
|
+
|
|
10
|
+
proceed();
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
module.exports = updateShellCommandsOperation;
|
package/bin/prepare.js
CHANGED
|
@@ -3,7 +3,14 @@
|
|
|
3
3
|
const changeDirectory = require("./changeDirectory");
|
|
4
4
|
|
|
5
5
|
const { DEFAULT_HELP, DEFAULT_VERSION } = require("./defaults"),
|
|
6
|
-
{ HELP_COMMAND,
|
|
6
|
+
{ HELP_COMMAND,
|
|
7
|
+
OPEN_COMMAND,
|
|
8
|
+
VERSION_COMMAND,
|
|
9
|
+
SIGN_IN_COMMAND,
|
|
10
|
+
SIGN_OUT_COMMAND,
|
|
11
|
+
INITIALISE_COMMAND,
|
|
12
|
+
SET_OPTIONS_COMMAND,
|
|
13
|
+
SET_SHELL_COMMANDS_COMMAND } = require("./commands");
|
|
7
14
|
|
|
8
15
|
function prepare(command, argument, options, main) {
|
|
9
16
|
const { help = DEFAULT_HELP, version = DEFAULT_VERSION } = options;
|
|
@@ -29,9 +36,11 @@ function prepare(command, argument, options, main) {
|
|
|
29
36
|
}
|
|
30
37
|
|
|
31
38
|
if (argument === null) {
|
|
32
|
-
|
|
39
|
+
if ((command !== SIGN_IN_COMMAND) && (command !== SIGN_OUT_COMMAND) && (command !== SET_OPTIONS_COMMAND) && (command !== SET_SHELL_COMMANDS_COMMAND)) {
|
|
40
|
+
argument = command; ///
|
|
33
41
|
|
|
34
|
-
|
|
42
|
+
command = OPEN_COMMAND;
|
|
43
|
+
}
|
|
35
44
|
}
|
|
36
45
|
|
|
37
46
|
if (command === null) {
|
package/package.json
CHANGED