occam-open-cli 6.1.72 → 6.1.73

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.
Files changed (154) hide show
  1. package/lib/abbreviations.js +27 -0
  2. package/lib/action/clone.js +38 -0
  3. package/lib/action/createAccount.js +40 -0
  4. package/lib/action/help.js +15 -0
  5. package/lib/action/initialise.js +26 -0
  6. package/lib/action/open.js +39 -0
  7. package/lib/action/publish.js +68 -0
  8. package/lib/action/resetPassword.js +32 -0
  9. package/lib/action/setOptions.js +33 -0
  10. package/lib/action/setShellCommands.js +37 -0
  11. package/lib/action/signIn.js +37 -0
  12. package/lib/action/signOut.js +19 -0
  13. package/lib/action/version.js +19 -0
  14. package/lib/action/withdraw.js +38 -0
  15. package/lib/changeDirectory.js +33 -0
  16. package/lib/commands.js +66 -0
  17. package/lib/configuration/version_2_0.js +20 -0
  18. package/lib/configuration/version_5_0.js +17 -0
  19. package/lib/configuration/version_5_1.js +40 -0
  20. package/lib/configuration.js +175 -0
  21. package/lib/constants.js +46 -0
  22. package/lib/defaults.js +69 -0
  23. package/lib/descriptions.js +58 -0
  24. package/lib/main.js +132 -0
  25. package/lib/messages.js +134 -0
  26. package/lib/operation/clone.js +34 -0
  27. package/lib/operation/cloneRepositories.js +92 -0
  28. package/lib/operation/createAccount.js +34 -0
  29. package/lib/operation/executeShallCommands.js +47 -0
  30. package/lib/operation/getIdentityToken.js +24 -0
  31. package/lib/operation/loadProject.js +28 -0
  32. package/lib/operation/open.js +34 -0
  33. package/lib/operation/openReleasees.js +120 -0
  34. package/lib/operation/prompt/areYouSure.js +36 -0
  35. package/lib/operation/prompt/confirmPassword.js +36 -0
  36. package/lib/operation/prompt/emailAddress.js +45 -0
  37. package/lib/operation/prompt/emailAddressOrUsername.js +45 -0
  38. package/lib/operation/prompt/gitHubHostName.js +46 -0
  39. package/lib/operation/prompt/password.js +36 -0
  40. package/lib/operation/prompt/releaseName.js +44 -0
  41. package/lib/operation/prompt/repositoryName.js +44 -0
  42. package/lib/operation/prompt/setShellCommands.js +40 -0
  43. package/lib/operation/prompt/useSSH.js +37 -0
  44. package/lib/operation/prompt/username.js +45 -0
  45. package/lib/operation/publish.js +46 -0
  46. package/lib/operation/releaseToJSON.js +28 -0
  47. package/lib/operation/resetPassword.js +31 -0
  48. package/lib/operation/signIn.js +33 -0
  49. package/lib/operation/updateIdentityToken.js +20 -0
  50. package/lib/operation/updateMetaJSONFileVersion.js +24 -0
  51. package/lib/operation/updateOptions.js +26 -0
  52. package/lib/operation/updateShellCommands.js +18 -0
  53. package/lib/operation/withdraw.js +27 -0
  54. package/lib/options.js +54 -0
  55. package/lib/post.js +68 -0
  56. package/lib/prepare.js +48 -0
  57. package/lib/uris.js +42 -0
  58. package/lib/utilities/operation.js +46 -0
  59. package/lib/utilities/prompt.js +15 -0
  60. package/lib/utilities/release.js +18 -0
  61. package/lib/utilities/response.js +22 -0
  62. package/lib/utilities/shell.js +35 -0
  63. package/lib/utilities/status.js +30 -0
  64. package/lib/utilities/string.js +17 -0
  65. package/lib/utilities/validate.js +83 -0
  66. package/lib/versions.js +30 -0
  67. package/open.js +3 -3
  68. package/package.json +18 -3
  69. package/{bin → src}/abbreviations.js +4 -2
  70. package/{bin → src}/action/clone.js +6 -8
  71. package/src/action/createAccount.js +32 -0
  72. package/{bin → src}/action/help.js +1 -3
  73. package/{bin → src}/action/initialise.js +3 -5
  74. package/{bin → src}/action/open.js +6 -8
  75. package/{bin → src}/action/publish.js +11 -13
  76. package/{bin → src}/action/resetPassword.js +4 -6
  77. package/src/action/setOptions.js +26 -0
  78. package/src/action/setShellCommands.js +29 -0
  79. package/src/action/signIn.js +28 -0
  80. package/src/action/signOut.js +12 -0
  81. package/src/action/version.js +13 -0
  82. package/{bin → src}/action/withdraw.js +7 -9
  83. package/{bin → src}/changeDirectory.js +4 -6
  84. package/src/commands.js +15 -0
  85. package/src/configuration/version_2_0.js +13 -0
  86. package/{bin → src}/configuration/version_5_1.js +4 -9
  87. package/{bin → src}/configuration.js +20 -35
  88. package/src/constants.js +10 -0
  89. package/src/defaults.js +21 -0
  90. package/src/descriptions.js +13 -0
  91. package/{bin → src}/main.js +32 -34
  92. package/src/messages.js +32 -0
  93. package/{bin → src}/operation/clone.js +3 -5
  94. package/{bin → src}/operation/cloneRepositories.js +6 -8
  95. package/{bin → src}/operation/createAccount.js +3 -5
  96. package/{bin → src}/operation/executeShallCommands.js +5 -7
  97. package/{bin → src}/operation/getIdentityToken.js +2 -4
  98. package/{bin → src}/operation/loadProject.js +3 -5
  99. package/{bin → src}/operation/open.js +3 -5
  100. package/{bin → src}/operation/openReleasees.js +6 -8
  101. package/{bin → src}/operation/prompt/areYouSure.js +6 -8
  102. package/{bin → src}/operation/prompt/confirmPassword.js +4 -6
  103. package/{bin → src}/operation/prompt/emailAddress.js +5 -7
  104. package/{bin → src}/operation/prompt/emailAddressOrUsername.js +5 -7
  105. package/{bin → src}/operation/prompt/gitHubHostName.js +7 -9
  106. package/{bin → src}/operation/prompt/password.js +5 -7
  107. package/{bin → src}/operation/prompt/releaseName.js +5 -7
  108. package/{bin → src}/operation/prompt/repositoryName.js +5 -7
  109. package/{bin → src}/operation/prompt/setShellCommands.js +6 -8
  110. package/{bin → src}/operation/prompt/useSSH.js +6 -8
  111. package/{bin → src}/operation/prompt/username.js +5 -7
  112. package/{bin → src}/operation/publish.js +4 -6
  113. package/{bin → src}/operation/releaseToJSON.js +2 -4
  114. package/{bin → src}/operation/resetPassword.js +3 -5
  115. package/{bin → src}/operation/signIn.js +3 -5
  116. package/src/operation/updateIdentityToken.js +13 -0
  117. package/{bin → src}/operation/updateMetaJSONFileVersion.js +3 -5
  118. package/{bin → src}/operation/updateOptions.js +2 -4
  119. package/src/operation/updateShellCommands.js +11 -0
  120. package/{bin → src}/operation/withdraw.js +3 -5
  121. package/src/options.js +12 -0
  122. package/{bin → src}/post.js +7 -9
  123. package/{bin → src}/prepare.js +13 -15
  124. package/src/uris.js +9 -0
  125. package/{bin → src}/utilities/operation.js +2 -6
  126. package/src/utilities/prompt.js +3 -0
  127. package/{bin → src}/utilities/release.js +2 -6
  128. package/{bin → src}/utilities/response.js +2 -6
  129. package/{bin → src}/utilities/shell.js +4 -8
  130. package/{bin → src}/utilities/status.js +1 -1
  131. package/src/utilities/string.js +9 -0
  132. package/src/utilities/validate.js +37 -0
  133. package/src/versions.js +6 -0
  134. package/bin/action/createAccount.js +0 -34
  135. package/bin/action/setOptions.js +0 -28
  136. package/bin/action/setShellCommands.js +0 -31
  137. package/bin/action/signIn.js +0 -30
  138. package/bin/action/signOut.js +0 -14
  139. package/bin/action/version.js +0 -15
  140. package/bin/commands.js +0 -31
  141. package/bin/configuration/version_2_0.js +0 -17
  142. package/bin/constants.js +0 -27
  143. package/bin/defaults.js +0 -37
  144. package/bin/descriptions.js +0 -27
  145. package/bin/messages.js +0 -65
  146. package/bin/operation/updateIdentityToken.js +0 -15
  147. package/bin/operation/updateShellCommands.js +0 -13
  148. package/bin/options.js +0 -25
  149. package/bin/uris.js +0 -19
  150. package/bin/utilities/prompt.js +0 -7
  151. package/bin/utilities/string.js +0 -13
  152. package/bin/utilities/validate.js +0 -50
  153. package/bin/versions.js +0 -13
  154. /package/{bin → src}/configuration/version_5_0.js +0 -0
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { versionUtilities, configurationUtilities } = require("necessary");
3
+ import { versionUtilities, configurationUtilities } from "necessary";
4
4
 
5
- const { OPEN } = require("./constants"),
6
- { createConfiguration } = require("./configuration/version_5_1"),
7
- { migrateConfigurationToVersion_2_0 } = require("./configuration/version_2_0"),
8
- { migrateConfigurationToVersion_5_0 } = require("./configuration/version_5_0"),
9
- { migrateConfigurationToVersion_5_1 } = require("./configuration/version_5_1"),
10
- { CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } = require("./messages"),
11
- { VERSION_1_5, VERSION_2_0, VERSION_5_0, VERSION_5_1 } = require("./versions");
5
+ import { OPEN } from "./constants";
6
+ import { createConfiguration } from "./configuration/version_5_1";
7
+ import { migrateConfigurationToVersion_2_0 } from "./configuration/version_2_0";
8
+ import { migrateConfigurationToVersion_5_0 } from "./configuration/version_5_0";
9
+ import { migrateConfigurationToVersion_5_1 } from "./configuration/version_5_1";
10
+ import { CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE } from "./messages";
11
+ import { VERSION_1_5, VERSION_2_0, VERSION_5_0, VERSION_5_1 } from "./versions";
12
12
 
13
13
  const { rc } = configurationUtilities,
14
14
  { migrate } = versionUtilities,
@@ -18,64 +18,64 @@ const rcBaseExtension = OPEN; ///
18
18
 
19
19
  setRCBaseExtension(rcBaseExtension);
20
20
 
21
- function retrieveHost() {
21
+ export function retrieveHost() {
22
22
  const configuration = readConfigurationFile(),
23
23
  { host } = configuration;
24
24
 
25
25
  return host;
26
26
  }
27
27
 
28
- function retrieveOptions() {
28
+ export function retrieveOptions() {
29
29
  const configuration = readConfigurationFile(),
30
30
  { options } = configuration;
31
31
 
32
32
  return options;
33
33
  }
34
34
 
35
- function retrieveShellCommands() {
35
+ export function retrieveShellCommands() {
36
36
  const configuration = readConfigurationFile(),
37
37
  { shellCommands } = configuration;
38
38
 
39
39
  return shellCommands;
40
40
  }
41
41
 
42
- function retrieveIdentityToken() {
42
+ export function retrieveIdentityToken() {
43
43
  const configuration = readConfigurationFile(),
44
44
  { identityToken } = configuration;
45
45
 
46
46
  return identityToken;
47
47
  }
48
48
 
49
- function updateOptions(options) {
49
+ export function updateOptions(options) {
50
50
  updateConfigurationFile({
51
51
  options
52
52
  });
53
53
  }
54
54
 
55
- function updateShellCommands(shellCommands) {
55
+ export function updateShellCommands(shellCommands) {
56
56
  updateConfigurationFile({
57
57
  shellCommands
58
58
  });
59
59
  }
60
60
 
61
- function updateIdentityToken(identityToken) {
61
+ export function updateIdentityToken(identityToken) {
62
62
  updateConfigurationFile({
63
63
  identityToken
64
64
  });
65
65
  }
66
66
 
67
- function removeIdentityToken() {
67
+ export function removeIdentityToken() {
68
68
  updateConfigurationFile(null, "identityToken");
69
69
  }
70
70
 
71
- function createConfigurationFile() {
71
+ export function createConfigurationFile() {
72
72
  const configuration = createConfiguration(),
73
73
  json = configuration; ///
74
74
 
75
75
  writeRCFile(json);
76
76
  }
77
77
 
78
- function migrateConfigurationFile() {
78
+ export function migrateConfigurationFile() {
79
79
  assertConfigurationFileExists();
80
80
 
81
81
  let json = readRCFile();
@@ -92,14 +92,14 @@ function migrateConfigurationFile() {
92
92
  writeRCFile(json);
93
93
  }
94
94
 
95
- function checkConfigurationFileExists() {
95
+ export function checkConfigurationFileExists() {
96
96
  const rcFileExists = checkRCFileExists(),
97
97
  configurationFileExists = rcFileExists; ///
98
98
 
99
99
  return configurationFileExists;
100
100
  }
101
101
 
102
- function assertConfigurationFileExists() {
102
+ export function assertConfigurationFileExists() {
103
103
  const configurationFileExists = checkConfigurationFileExists();
104
104
 
105
105
  if (!configurationFileExists) {
@@ -109,21 +109,6 @@ function assertConfigurationFileExists() {
109
109
  }
110
110
  }
111
111
 
112
- module.exports = {
113
- retrieveHost,
114
- retrieveOptions,
115
- retrieveShellCommands,
116
- retrieveIdentityToken,
117
- updateOptions,
118
- updateShellCommands,
119
- updateIdentityToken,
120
- removeIdentityToken,
121
- createConfigurationFile,
122
- migrateConfigurationFile,
123
- checkConfigurationFileExists,
124
- assertConfigurationFileExists
125
- };
126
-
127
112
  function readConfigurationFile() {
128
113
  assertConfigurationFileExists();
129
114
 
@@ -0,0 +1,10 @@
1
+ "use strict";
2
+
3
+ export const END = "end";
4
+ export const DATA = "data";
5
+ export const OPEN = "open";
6
+ export const HOST_URL = "hostURL";
7
+ export const DOUBLE_DOTS = "..";
8
+ export const DOUBLE_DASH = "--";
9
+ export const EMPTY_STRING = "";
10
+ export const OCCAM_OPEN_CLI = "Occam Open-CLI";
@@ -0,0 +1,21 @@
1
+ "use strict";
2
+
3
+ import { levels } from "necessary";
4
+
5
+ import { EMPTY_STRING } from "./constants";
6
+
7
+ const { INFO_LEVEL } = levels;
8
+
9
+ export const DEFAULT_YES = false;
10
+ export const DEFAULT_HELP = false;
11
+ export const DEFAULT_HOST = "https://openmathematics.org";
12
+ export const DEFAULT_TAIL = 10;
13
+ export const DEFAULT_FOLLOW = false;
14
+ export const DEFAULT_DRY_RUN = false;
15
+ export const DEFAULT_VERSION = false;
16
+ export const DEFAULT_QUIETLY = false;
17
+ export const DEFAULT_HEADLESS = false;
18
+ export const DEFAULT_LOG_LEVEL = INFO_LEVEL;
19
+ export const DEFAULT_DEPENDENCIES = false;
20
+ export const DEFAULT_SHELL_COMMANDS = EMPTY_STRING;
21
+ export const DEFAULT_GITHUB_HOST_NAME = "github.com";
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ export const USE_SSH_DESCRIPTION = "Use SSH when cloning: ";
4
+ export const PASSWORD_DESCRIPTION = "Password: ";
5
+ export const USERNAME_DESCRIPTION = "Username: ";
6
+ export const RELEASE_NAME_DESCRIPTION = "Package name: "; //
7
+ export const ARE_YOU_SURE_DESCRIPTION = "Are you sure? (y)es (n)o: ";
8
+ export const EMAIL_ADDRESS_DESCRIPTION = "Email address: ";
9
+ export const SHELL_COMMANDS_DESCRIPTION = "Shell command(s) to run after successful publishing: ";
10
+ export const REPOSITORY_NAME_DESCRIPTION = "Repository name: ";
11
+ export const CONFIRM_PASSWORD_DESCRIPTION = "Confirm password: ";
12
+ export const GITHUB_HOST_NAME_DESCRIPTION = "GitHub host name (leave blank for default): ";
13
+ export const EMAIL_ADDRESS_OR_USERNAME_DESCRIPTION = "Email address or username: ";
@@ -1,37 +1,37 @@
1
1
  "use strict";
2
2
 
3
- const helpAction = require("./action/help"),
4
- openAction = require("./action/open"),
5
- cloneAction = require("./action/clone"),
6
- signInAction = require("./action/signIn"),
7
- signOutAction = require("./action/signOut"),
8
- versionAction = require("./action/version"),
9
- publishAction = require("./action/publish"),
10
- withdrawAction = require("./action/withdraw"),
11
- initialiseAction = require("./action/initialise"),
12
- setOptionsAction = require("./action/setOptions"),
13
- createAccountAction = require("./action/createAccount"),
14
- resetPasswordAction = require("./action/resetPassword"),
15
- setShellCommandsAction = require("./action/setShellCommands");
16
-
17
- const { EMPTY_STRING } = require("./constants"),
18
- { NO_ARGUMENT_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } = require("./messages"),
19
- { DEFAULT_YES, DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_DRY_RUN, DEFAULT_QUIETLY, DEFAULT_HEADLESS, DEFAULT_LOG_LEVEL, DEFAULT_DEPENDENCIES } = require("./defaults"),
20
- { HELP_COMMAND,
21
- OPEN_COMMAND,
22
- CLONE_COMMAND,
23
- VERSION_COMMAND,
24
- PUBLISH_COMMAND,
25
- SIGN_IN_COMMAND,
26
- SIGN_OUT_COMMAND,
27
- WITHDRAW_COMMAND,
28
- INITIALISE_COMMAND,
29
- SET_OPTIONS_COMMAND,
30
- CREATE_ACCOUNT_COMMAND,
31
- RESET_PASSWORD_COMMAND,
32
- SET_SHELL_COMMANDS_COMMAND } = require("./commands");
33
-
34
- function main(command, argument, options) {
3
+ import helpAction from "./action/help";
4
+ import openAction from "./action/open";
5
+ import cloneAction from "./action/clone";
6
+ import signInAction from "./action/signIn";
7
+ import signOutAction from "./action/signOut";
8
+ import versionAction from "./action/version";
9
+ import publishAction from "./action/publish";
10
+ import withdrawAction from "./action/withdraw";
11
+ import initialiseAction from "./action/initialise";
12
+ import setOptionsAction from "./action/setOptions";
13
+ import createAccountAction from "./action/createAccount";
14
+ import resetPasswordAction from "./action/resetPassword";
15
+ import setShellCommandsAction from "./action/setShellCommands";
16
+
17
+ import { EMPTY_STRING } from "./constants";
18
+ import { NO_ARGUMENT_GIVEN_MESSAGE, COMMAND_NOT_RECOGNISED_MESSAGE } from "./messages";
19
+ import { DEFAULT_YES, DEFAULT_TAIL, DEFAULT_FOLLOW, DEFAULT_DRY_RUN, DEFAULT_QUIETLY, DEFAULT_HEADLESS, DEFAULT_LOG_LEVEL, DEFAULT_DEPENDENCIES } from "./defaults";
20
+ import { HELP_COMMAND,
21
+ OPEN_COMMAND,
22
+ CLONE_COMMAND,
23
+ VERSION_COMMAND,
24
+ PUBLISH_COMMAND,
25
+ SIGN_IN_COMMAND,
26
+ SIGN_OUT_COMMAND,
27
+ WITHDRAW_COMMAND,
28
+ INITIALISE_COMMAND,
29
+ SET_OPTIONS_COMMAND,
30
+ CREATE_ACCOUNT_COMMAND,
31
+ RESET_PASSWORD_COMMAND,
32
+ SET_SHELL_COMMANDS_COMMAND } from "./commands";
33
+
34
+ export default function main(command, argument, options) {
35
35
  const { yes = DEFAULT_YES,
36
36
  tail = DEFAULT_TAIL,
37
37
  follow = DEFAULT_FOLLOW,
@@ -154,8 +154,6 @@ function main(command, argument, options) {
154
154
  }
155
155
  }
156
156
 
157
- module.exports = main;
158
-
159
157
  function stripTrailingSlash(string) {
160
158
  string = string.replace(/\/$/, EMPTY_STRING);
161
159
 
@@ -0,0 +1,32 @@
1
+ "use strict";
2
+
3
+ export const NO_ARGUMENT_GIVEN_MESSAGE = "No argument has been given.";
4
+ export const COMMAND_NOT_RECOGNISED_MESSAGE = "The command is not recognised.";
5
+ export const PASSWORDS_DO_NOT_MATCH_MESSAGE = "The passwords do not match.";
6
+ export const SERVER_FAILED_TO_RESPOND_ERROR_MESSAGE = "The server did not respond in a timely or intelligible fashion. If this problem persists then please be kind enough to report it.";
7
+ export const CONFIGURATION_FILE_DOES_NOT_EXIST_MESSAGE = "The action cannot be performed because the configuration file is missing. Run 'open initialise' to create one.";
8
+ export const SIGN_OUT_MESSAGE = "You have been signed out.";
9
+ export const INVALID_ANSWER_MESSAGE = "You must answer (y)es or (n)o.";
10
+ export const INVALID_USERNAME_MESSAGE = "Usernames must consist of groups of at least two and no more than sixteen numbers or lowercase letters, separated by dashes.";
11
+ export const INVALID_PASSWORD_MESSAGE = "Passwords must consist of at least eight letters, numbers or common punctuation symbols.";
12
+ export const INVALID_AFFIRMATION_MESSAGE = "You must answer (y)es or (n)o.";
13
+ export const INVALID_RELEASE_NAME_MESSAGE = "Package names must consist of groups of at least two and no more than sixteen numbers or lowercase letters, separated by dashes.";
14
+ export const INVALID_EMAIL_ADDRESS_MESSAGE = "The email address does not appear to be a valid one.";
15
+ export const INVALID_REPOSITORY_NAME_MESSAGE = "Repository names must consist of groups of at least two and no more than sixteen numbers or lowercase letters, separated by dashes.";
16
+ export const INVALID_GITHUB_HOST_NAME_MESSAGE = "The GitHub host name can be any number of alphabetical, numeric, dash or period characters, or can be left blank.";
17
+ export const INVALID_EMAIL_ADDRESS_OR_USERNAME_MESSAGE = "The email address or username does not appear to be a valid one.";
18
+ export const FAILED_OPEN_MESSAGE = "Failed to open the package.";
19
+ export const FAILED_CLONE_MESSAGE = "Failed to clone the repository.";
20
+ export const FAILED_PUBLISH_MESSAGE = "Failed to publish the package.";
21
+ export const FAILED_WITHDRAW_MESSAGE = "Failed to withdraw the package.";
22
+ export const FAILED_INITIALISE_MESSAGE = "Failed to create a configuration file because one is already present.";
23
+ export const FAILED_SET_OPTIONS_MESSAGE = "Failed to set the options.";
24
+ export const FAILED_PROJECT_LOAD_MESSAGE = "Failed to load the project. Likely it is missing or perhaps it is already a package.";
25
+ export const FAILED_SET_SHELL_COMMANDS_MESSAGE = "Failed to set the shell commands.";
26
+ export const SUCCESSFUL_OPEN_MESSAGE = "The package has been opened successfully.";
27
+ export const SUCCESSFUL_CLONE_MESSAGE = "The repository has been cloned successfully.";
28
+ export const SUCCESSFUL_PUBLISH_MESSAGE = "The package has been published successfully.";
29
+ export const SUCCESSFUL_WITHDRAW_MESSAGE = "The package has been withdrawn successfully.";
30
+ export const SUCCESSFUL_INITIALISE_MESSAGE = "The configuration file has been created successfully.";
31
+ export const SUCCESSFUL_SET_OPTIONS_MESSAGE = "The options have been set successfully.";
32
+ export const SUCCESSFUL_SET_SHELL_COMMANDS_MESSAGE = "The shell commands have been set successfully.";
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- const post = require("../post");
3
+ import post from "../post";
4
4
 
5
- const { CLONE_API_URI } = require("../uris");
5
+ import { CLONE_API_URI } from "../uris";
6
6
 
7
- function cloneOperation(proceed, abort, context) {
7
+ export default function cloneOperation(proceed, abort, context) {
8
8
  const { repositoryName } = context,
9
9
  releaseName = repositoryName, ///
10
10
  uri = `${CLONE_API_URI}/${releaseName}`,
@@ -27,5 +27,3 @@ function cloneOperation(proceed, abort, context) {
27
27
  proceed();
28
28
  });
29
29
  }
30
-
31
- module.exports = cloneOperation;
@@ -1,17 +1,17 @@
1
1
  "use strict";
2
2
 
3
- const { exec } = require("child_process"),
4
- { Entries } = require("occam-entities"),
5
- { arrayUtilities, fileSystemUtilities, asynchronousUtilities } = require("necessary");
3
+ import { exec } from "child_process";
4
+ import { Entries } from "occam-entities";
5
+ import { arrayUtilities, fileSystemUtilities, asynchronousUtilities } from "necessary";
6
6
 
7
- const { retrieveOptions } = require("../configuration"),
8
- { DEFAULT_GITHUB_HOST_NAME } = require("../defaults");
7
+ import { retrieveOptions } from "../configuration";
8
+ import { DEFAULT_GITHUB_HOST_NAME } from "../defaults";
9
9
 
10
10
  const { first } = arrayUtilities,
11
11
  { forEach } = asynchronousUtilities,
12
12
  { checkEntryExists } = fileSystemUtilities;
13
13
 
14
- function cloneRepositoriesOperation(proceed, abort, context) {
14
+ export default function cloneRepositoriesOperation(proceed, abort, context) {
15
15
  const { releases, dependencies } = context
16
16
 
17
17
  if (dependencies) {
@@ -56,8 +56,6 @@ function cloneRepositoriesOperation(proceed, abort, context) {
56
56
  }, done, context, index);
57
57
  }
58
58
 
59
- module.exports = cloneRepositoriesOperation;
60
-
61
59
  function cloneRepositoryOperation(release, next, done, context, index) {
62
60
  if (index === 0) {
63
61
  const { headless } = context;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- const post = require("../post");
3
+ import post from "../post";
4
4
 
5
- const { CREATE_ACCOUNT_API_URI } = require("../uris");
5
+ import { CREATE_ACCOUNT_API_URI } from "../uris";
6
6
 
7
- function createAccountOperation(proceed, abort, context) {
7
+ export default function createAccountOperation(proceed, abort, context) {
8
8
  const { username, password, emailAddress } = context,
9
9
  uri = CREATE_ACCOUNT_API_URI,
10
10
  json = {
@@ -24,5 +24,3 @@ function createAccountOperation(proceed, abort, context) {
24
24
  proceed();
25
25
  });
26
26
  }
27
-
28
- module.exports = createAccountOperation;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { characters } = require("necessary");
3
+ import { characters } from "necessary";
4
4
 
5
- const { execute } = require("../utilities/shell");
6
- const { EMPTY_STRING } = require("../constants");
7
- const { retrieveShellCommands } = require("../configuration");
5
+ import { execute } from "../utilities/shell";
6
+ import { EMPTY_STRING } from "../constants";
7
+ import { retrieveShellCommands } from "../configuration";
8
8
 
9
9
  const { DASH_CHARACTER } = characters;
10
10
 
11
- function executeShellCommandsOperation(proceed, abort, context) {
11
+ export default function executeShellCommandsOperation(proceed, abort, context) {
12
12
  const { success, releaseName } = context;
13
13
 
14
14
  if (success) {
@@ -56,5 +56,3 @@ function executeShellCommandsOperation(proceed, abort, context) {
56
56
 
57
57
  proceed();
58
58
  }
59
-
60
- module.exports = executeShellCommandsOperation;
@@ -1,8 +1,8 @@
1
1
  "use strict";
2
2
 
3
- const { retrieveIdentityToken } = require("../configuration");
3
+ import { retrieveIdentityToken } from "../configuration";
4
4
 
5
- function getIdentityTokenOperation(proceed, abort, context) {
5
+ export default function getIdentityTokenOperation(proceed, abort, context) {
6
6
  const identityToken = retrieveIdentityToken();
7
7
 
8
8
  if (!identityToken) {
@@ -17,5 +17,3 @@ function getIdentityTokenOperation(proceed, abort, context) {
17
17
 
18
18
  proceed();
19
19
  }
20
-
21
- module.exports = getIdentityTokenOperation;
@@ -1,12 +1,12 @@
1
1
  "use strict";
2
2
 
3
- const { fileSystemUtilities } = require("occam-file-system");
3
+ import { fileSystemUtilities } from "occam-file-system";
4
4
 
5
- const { FAILED_PROJECT_LOAD_MESSAGE } = require("../messages");
5
+ import { FAILED_PROJECT_LOAD_MESSAGE } from "../messages";
6
6
 
7
7
  const { loadProject } = fileSystemUtilities;
8
8
 
9
- function loadProjectOperation(proceed, abort, context) {
9
+ export default function loadProjectOperation(proceed, abort, context) {
10
10
  const { releaseName } = context,
11
11
  projectsDirectoryPath = process.cwd(), ///
12
12
  project = loadProject(releaseName ,projectsDirectoryPath);
@@ -27,5 +27,3 @@ function loadProjectOperation(proceed, abort, context) {
27
27
 
28
28
  proceed();
29
29
  }
30
-
31
- module.exports = loadProjectOperation;
@@ -1,10 +1,10 @@
1
1
  "use strict";
2
2
 
3
- const post = require("../post");
3
+ import post from "../post";
4
4
 
5
- const { OPEN_API_URI } = require("../uris");
5
+ import { OPEN_API_URI } from "../uris";
6
6
 
7
- function openOperation(proceed, abort, context) {
7
+ export default function openOperation(proceed, abort, context) {
8
8
  const { releaseName } = context,
9
9
  uri = `${OPEN_API_URI}/${releaseName}`,
10
10
  json = {};
@@ -26,5 +26,3 @@ function openOperation(proceed, abort, context) {
26
26
  proceed();
27
27
  });
28
28
  }
29
-
30
- module.exports = openOperation;
@@ -1,18 +1,18 @@
1
1
  "use strict";
2
2
 
3
- const { arrayUtilities, shellUtilities, fileSystemUtilities, asynchronousUtilities } = require("necessary");
3
+ import { arrayUtilities, shellUtilities, fileSystemUtilities, asynchronousUtilities } from "necessary";
4
4
 
5
- const { isFileRelease } = require("../utilities/release"),
6
- { validateAnswer } = require("../utilities/validate"),
7
- { isAnswerAffirmative } = require("../utilities/prompt"),
8
- { INVALID_ANSWER_MESSAGE } = require("../messages");
5
+ import { isFileRelease } from "../utilities/release";
6
+ import { validateAnswer } from "../utilities/validate";
7
+ import { isAnswerAffirmative } from "../utilities/prompt";
8
+ import { INVALID_ANSWER_MESSAGE } from "../messages";
9
9
 
10
10
  const { first } = arrayUtilities,
11
11
  { prompt } = shellUtilities,
12
12
  { forEach } = asynchronousUtilities,
13
13
  { writeFile, removeEntry, checkEntryExists, isEntryDirectory } = fileSystemUtilities;
14
14
 
15
- function openReleasesOperation(proceed, abort, context) {
15
+ export default function openReleasesOperation(proceed, abort, context) {
16
16
  const { releases, dependencies } = context;
17
17
 
18
18
  if (dependencies) {
@@ -57,8 +57,6 @@ function openReleasesOperation(proceed, abort, context) {
57
57
  }, done, context, index);
58
58
  }
59
59
 
60
- module.exports = openReleasesOperation;
61
-
62
60
  function openReleasePromptOperation(release, next, done, context, index) {
63
61
  if (index === 0) {
64
62
  const { headless } = context;
@@ -1,15 +1,15 @@
1
1
  "use strict";
2
2
 
3
- const { shellUtilities } = require("necessary");
3
+ import { shellUtilities } from "necessary";
4
4
 
5
- const { isAnswerAffirmative } = require("../../utilities/prompt"),
6
- { validateAffirmation } = require("../../utilities/validate"),
7
- { ARE_YOU_SURE_DESCRIPTION } = require("../../descriptions"),
8
- { INVALID_AFFIRMATION_MESSAGE } = require("../../messages");
5
+ import { isAnswerAffirmative } from "../../utilities/prompt";
6
+ import { validateAffirmation } from "../../utilities/validate";
7
+ import { ARE_YOU_SURE_DESCRIPTION } from "../../descriptions";
8
+ import { INVALID_AFFIRMATION_MESSAGE } from "../../messages";
9
9
 
10
10
  const { prompt } = shellUtilities;
11
11
 
12
- function areYouSurePromptOperation(proceed, abort, context) {
12
+ export default function areYouSurePromptOperation(proceed, abort, context) {
13
13
  const description = ARE_YOU_SURE_DESCRIPTION,
14
14
  errorMessage = INVALID_AFFIRMATION_MESSAGE,
15
15
  validationFunction = validateAffirmation, ///
@@ -35,5 +35,3 @@ function areYouSurePromptOperation(proceed, abort, context) {
35
35
  abort();
36
36
  });
37
37
  }
38
-
39
- module.exports = areYouSurePromptOperation;
@@ -1,13 +1,13 @@
1
1
  "use strict";
2
2
 
3
- const { shellUtilities } = require("necessary");
3
+ import { shellUtilities } from "necessary";
4
4
 
5
- const { CONFIRM_PASSWORD_DESCRIPTION } = require("../../descriptions"),
6
- { PASSWORDS_DO_NOT_MATCH_MESSAGE } = require("../../messages");
5
+ import { CONFIRM_PASSWORD_DESCRIPTION } from "../../descriptions";
6
+ import { PASSWORDS_DO_NOT_MATCH_MESSAGE } from "../../messages";
7
7
 
8
8
  const { prompt } = shellUtilities;
9
9
 
10
- function confirmPasswordPromptOperation(proceed, abort, context) {
10
+ export default function confirmPasswordPromptOperation(proceed, abort, context) {
11
11
  const { password } = context,
12
12
  hidden = true,
13
13
  description = CONFIRM_PASSWORD_DESCRIPTION,
@@ -38,5 +38,3 @@ function confirmPasswordPromptOperation(proceed, abort, context) {
38
38
  return valid;
39
39
  }
40
40
  }
41
-
42
- module.exports = confirmPasswordPromptOperation;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { shellUtilities } = require("necessary");
3
+ import { shellUtilities } from "necessary";
4
4
 
5
- const { validateEmailAddress } = require("../../utilities/validate"),
6
- { EMAIL_ADDRESS_DESCRIPTION } = require("../../descriptions"),
7
- { INVALID_EMAIL_ADDRESS_MESSAGE } = require("../../messages");
5
+ import { validateEmailAddress } from "../../utilities/validate";
6
+ import { EMAIL_ADDRESS_DESCRIPTION } from "../../descriptions";
7
+ import { INVALID_EMAIL_ADDRESS_MESSAGE } from "../../messages";
8
8
 
9
9
  const { prompt } = shellUtilities;
10
10
 
11
- function emailAddressPromptOperation(proceed, abort, context) {
11
+ export default function emailAddressPromptOperation(proceed, abort, context) {
12
12
  const { emailAddress } = context,
13
13
  errorMessage = INVALID_EMAIL_ADDRESS_MESSAGE;
14
14
 
@@ -49,5 +49,3 @@ function emailAddressPromptOperation(proceed, abort, context) {
49
49
  abort();
50
50
  });
51
51
  }
52
-
53
- module.exports = emailAddressPromptOperation;
@@ -1,14 +1,14 @@
1
1
  "use strict";
2
2
 
3
- const { shellUtilities } = require("necessary");
3
+ import { shellUtilities } from "necessary";
4
4
 
5
- const { validateEmailAddressOrUsername } = require("../../utilities/validate"),
6
- { EMAIL_ADDRESS_OR_USERNAME_DESCRIPTION } = require("../../descriptions"),
7
- { INVALID_EMAIL_ADDRESS_OR_USERNAME_MESSAGE } = require("../../messages");
5
+ import { validateEmailAddressOrUsername } from "../../utilities/validate";
6
+ import { EMAIL_ADDRESS_OR_USERNAME_DESCRIPTION } from "../../descriptions";
7
+ import { INVALID_EMAIL_ADDRESS_OR_USERNAME_MESSAGE } from "../../messages";
8
8
 
9
9
  const { prompt } = shellUtilities;
10
10
 
11
- function emailAddressOrUsernamePromptOperation(proceed, abort, context) {
11
+ export default function emailAddressOrUsernamePromptOperation(proceed, abort, context) {
12
12
  const { emailAddressOrUsername } = context,
13
13
  errorMessage = INVALID_EMAIL_ADDRESS_OR_USERNAME_MESSAGE;
14
14
 
@@ -49,5 +49,3 @@ function emailAddressOrUsernamePromptOperation(proceed, abort, context) {
49
49
  abort();
50
50
  });
51
51
  }
52
-
53
- module.exports = emailAddressOrUsernamePromptOperation;
@@ -1,16 +1,16 @@
1
1
  "use strict";
2
2
 
3
- const { shellUtilities } = require("necessary");
3
+ import { shellUtilities } from "necessary";
4
4
 
5
- const { EMPTY_STRING } = require("../../constants"),
6
- { validateGitHubHostName } = require("../../utilities/validate"),
7
- { DEFAULT_GITHUB_HOST_NAME } = require("../../defaults"),
8
- { GITHUB_HOST_NAME_DESCRIPTION } = require("../../descriptions"),
9
- { INVALID_GITHUB_HOST_NAME_MESSAGE } = require("../../messages");
5
+ import { EMPTY_STRING } from "../../constants";
6
+ import { validateGitHubHostName } from "../../utilities/validate";
7
+ import { DEFAULT_GITHUB_HOST_NAME } from "../../defaults";
8
+ import { GITHUB_HOST_NAME_DESCRIPTION } from "../../descriptions";
9
+ import { INVALID_GITHUB_HOST_NAME_MESSAGE } from "../../messages";
10
10
 
11
11
  const { prompt } = shellUtilities;
12
12
 
13
- function gitHubHostNamePromptOperation(proceed, abort, context) {
13
+ export default function gitHubHostNamePromptOperation(proceed, abort, context) {
14
14
  const { useSSH } = context;
15
15
 
16
16
  if (!useSSH) {
@@ -50,5 +50,3 @@ function gitHubHostNamePromptOperation(proceed, abort, context) {
50
50
  abort();
51
51
  });
52
52
  }
53
-
54
- module.exports = gitHubHostNamePromptOperation;