occam-open-cli 5.2.77 → 6.0.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/bin/action/help.js
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
|
|
3
|
-
const
|
|
3
|
+
const withdrawOperation = require("../operation/withdraw"),
|
|
4
4
|
areYouSurePromptOperation = require("../operation/prompt/areYouSure"),
|
|
5
5
|
getIdentityTokenOperation = require("../operation/getIdentityToken"),
|
|
6
6
|
releaseNamePromptOperation = require("../operation/prompt/releaseName");
|
|
7
7
|
|
|
8
8
|
const { executeOperations } = require("../utilities/operation"),
|
|
9
|
-
{
|
|
9
|
+
{ FAILED_WITHDRAW_MESSAGE, SUCCESSFUL_WITHDRAW_MESSAGE } = require("../messages");
|
|
10
10
|
|
|
11
|
-
function
|
|
11
|
+
function withdrawAction(argument) {
|
|
12
12
|
const releaseName = argument, ///
|
|
13
13
|
password = null,
|
|
14
14
|
operations = [
|
|
15
15
|
getIdentityTokenOperation,
|
|
16
16
|
releaseNamePromptOperation,
|
|
17
17
|
areYouSurePromptOperation,
|
|
18
|
-
|
|
18
|
+
withdrawOperation
|
|
19
19
|
],
|
|
20
20
|
context = {
|
|
21
21
|
password,
|
|
@@ -25,8 +25,8 @@ function deprecateAction(argument) {
|
|
|
25
25
|
executeOperations(operations, (completed) => {
|
|
26
26
|
const success = completed, ///
|
|
27
27
|
message = success ?
|
|
28
|
-
|
|
29
|
-
|
|
28
|
+
SUCCESSFUL_WITHDRAW_MESSAGE :
|
|
29
|
+
FAILED_WITHDRAW_MESSAGE;
|
|
30
30
|
|
|
31
31
|
console.log(message);
|
|
32
32
|
|
|
@@ -34,4 +34,4 @@ function deprecateAction(argument) {
|
|
|
34
34
|
}, context);
|
|
35
35
|
}
|
|
36
36
|
|
|
37
|
-
module.exports =
|
|
37
|
+
module.exports = withdrawAction;
|
package/bin/actions.js
CHANGED
|
@@ -7,7 +7,7 @@ const helpAction = require("./action/help"),
|
|
|
7
7
|
signOutAction = require("./action/signOut"),
|
|
8
8
|
versionAction = require("./action/version"),
|
|
9
9
|
publishAction = require("./action/publish"),
|
|
10
|
-
|
|
10
|
+
withdrawAction = require("./action/withdraw"),
|
|
11
11
|
initialiseAction = require("./action/initialise"),
|
|
12
12
|
setOptionsAction = require("./action/setOptions"),
|
|
13
13
|
createAccountAction = require("./action/createAccount"),
|
|
@@ -22,7 +22,7 @@ const { DEFAULT_NO, DEFAULT_YES, DEFAULT_HELP, DEFAULT_TAIL, DEFAULT_FOLLOW, DEF
|
|
|
22
22
|
PUBLISH_COMMAND,
|
|
23
23
|
SIGN_IN_COMMAND,
|
|
24
24
|
SIGN_OUT_COMMAND,
|
|
25
|
-
|
|
25
|
+
WITHDRAW_COMMAND,
|
|
26
26
|
INITIALISE_COMMAND,
|
|
27
27
|
SET_OPTIONS_COMMAND,
|
|
28
28
|
CREATE_ACCOUNT_COMMAND,
|
|
@@ -59,7 +59,7 @@ function actions(command, argument, options) {
|
|
|
59
59
|
case PUBLISH_COMMAND: publishAction(argument, tail, follow, dryRun, logLevel); break;
|
|
60
60
|
case SIGN_IN_COMMAND: signInAction(argument); break;
|
|
61
61
|
case SIGN_OUT_COMMAND: signOutAction(); break;
|
|
62
|
-
case
|
|
62
|
+
case WITHDRAW_COMMAND: withdrawAction(argument); break;
|
|
63
63
|
case INITIALISE_COMMAND: initialiseAction(); break;
|
|
64
64
|
case SET_OPTIONS_COMMAND: setOptionsAction(); break;
|
|
65
65
|
case CREATE_ACCOUNT_COMMAND: createAccountAction(argument); break;
|
package/bin/commands.js
CHANGED
|
@@ -7,7 +7,7 @@ const HELP_COMMAND = "help",
|
|
|
7
7
|
PUBLISH_COMMAND = "publish",
|
|
8
8
|
SIGN_IN_COMMAND = "sign-in",
|
|
9
9
|
SIGN_OUT_COMMAND = "sign-out",
|
|
10
|
-
|
|
10
|
+
WITHDRAW_COMMAND = "withdraw",
|
|
11
11
|
INITIALISE_COMMAND = "initialise",
|
|
12
12
|
SET_OPTIONS_COMMAND = "set-options",
|
|
13
13
|
CREATE_ACCOUNT_COMMAND = "create-account",
|
|
@@ -22,7 +22,7 @@ module.exports = {
|
|
|
22
22
|
PUBLISH_COMMAND,
|
|
23
23
|
SIGN_IN_COMMAND,
|
|
24
24
|
SIGN_OUT_COMMAND,
|
|
25
|
-
|
|
25
|
+
WITHDRAW_COMMAND,
|
|
26
26
|
INITIALISE_COMMAND,
|
|
27
27
|
SET_OPTIONS_COMMAND,
|
|
28
28
|
CREATE_ACCOUNT_COMMAND,
|
package/bin/messages.js
CHANGED
|
@@ -15,14 +15,14 @@ const PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.",
|
|
|
15
15
|
FAILED_OPEN_MESSAGE = "Failed to open the package.",
|
|
16
16
|
FAILED_CLONE_MESSAGE = "Failed to clone the package.",
|
|
17
17
|
FAILED_PUBLISH_MESSAGE = "Failed to publish the package.",
|
|
18
|
-
|
|
18
|
+
FAILED_WITHDRAW_MESSAGE = "Failed to withdraw the package.",
|
|
19
19
|
FAILED_INITIALISE_MESSAGE = "Failed to create a configuration file because one is already present.",
|
|
20
20
|
FAILED_SET_OPTIONS_MESSAGE = "Failed to set the options.",
|
|
21
21
|
FAILED_SET_SHELL_COMMANDS_MESSAGE = "Failed to set the shell commands.",
|
|
22
22
|
SUCCESSFUL_OPEN_MESSAGE = "The package has been opened successfully.",
|
|
23
23
|
SUCCESSFUL_CLONE_MESSAGE = "The package has been cloned successfully.",
|
|
24
24
|
SUCCESSFUL_PUBLISH_MESSAGE = "The package has been published successfully.",
|
|
25
|
-
|
|
25
|
+
SUCCESSFUL_WITHDRAW_MESSAGE = "The package has been withdrawd successfully.",
|
|
26
26
|
SUCCESSFUL_INITIALISE_MESSAGE = "The configuration file has been created successfully.",
|
|
27
27
|
SUCCESSFUL_SET_OPTIONS_MESSAGE = "The options have been set successfully.",
|
|
28
28
|
SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE = "The shell commands have been set successfully.";
|
|
@@ -43,14 +43,14 @@ module.exports = {
|
|
|
43
43
|
FAILED_OPEN_MESSAGE,
|
|
44
44
|
FAILED_CLONE_MESSAGE,
|
|
45
45
|
FAILED_PUBLISH_MESSAGE,
|
|
46
|
-
|
|
46
|
+
FAILED_WITHDRAW_MESSAGE,
|
|
47
47
|
FAILED_INITIALISE_MESSAGE,
|
|
48
48
|
FAILED_SET_OPTIONS_MESSAGE,
|
|
49
49
|
FAILED_SET_SHELL_COMMANDS_MESSAGE,
|
|
50
50
|
SUCCESSFUL_OPEN_MESSAGE,
|
|
51
51
|
SUCCESSFUL_CLONE_MESSAGE,
|
|
52
52
|
SUCCESSFUL_PUBLISH_MESSAGE,
|
|
53
|
-
|
|
53
|
+
SUCCESSFUL_WITHDRAW_MESSAGE,
|
|
54
54
|
SUCCESSFUL_INITIALISE_MESSAGE,
|
|
55
55
|
SUCCESSFUL_SET_OPTIONS_MESSAGE,
|
|
56
56
|
SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
const post = require("../post");
|
|
4
4
|
|
|
5
|
-
const {
|
|
5
|
+
const { WITHDRAW_API_URI } = require("../uris");
|
|
6
6
|
|
|
7
|
-
function
|
|
7
|
+
function withdrawOperation(proceed, abort, context) {
|
|
8
8
|
const { releaseName, identityToken } = context,
|
|
9
|
-
uri = `${
|
|
9
|
+
uri = `${WITHDRAW_API_URI}/${releaseName}`,
|
|
10
10
|
json = {
|
|
11
11
|
identityToken
|
|
12
12
|
};
|
|
@@ -16,4 +16,4 @@ function deprecateOperation(proceed, abort, context) {
|
|
|
16
16
|
});
|
|
17
17
|
}
|
|
18
18
|
|
|
19
|
-
module.exports =
|
|
19
|
+
module.exports = withdrawOperation;
|
package/bin/uris.js
CHANGED
|
@@ -4,7 +4,7 @@ const OPEN_API_URI = "/api/open",
|
|
|
4
4
|
CLONE_API_URI = "/api/clone",
|
|
5
5
|
PUBLISH_API_URI = "/api/publish",
|
|
6
6
|
SIGN_IN_API_URI = "/api/sign-in",
|
|
7
|
-
|
|
7
|
+
WITHDRAW_API_URI = "/api/withdraw",
|
|
8
8
|
RESET_PASSWORD_API_URI = "/api/reset-password",
|
|
9
9
|
CREATE_ACCOUNT_API_URI = "/api/create-account";
|
|
10
10
|
|
|
@@ -13,7 +13,7 @@ module.exports = {
|
|
|
13
13
|
CLONE_API_URI,
|
|
14
14
|
PUBLISH_API_URI,
|
|
15
15
|
SIGN_IN_API_URI,
|
|
16
|
-
|
|
16
|
+
WITHDRAW_API_URI,
|
|
17
17
|
RESET_PASSWORD_API_URI,
|
|
18
18
|
CREATE_ACCOUNT_API_URI
|
|
19
19
|
};
|
package/package.json
CHANGED