@mimik/local 7.1.0 → 7.1.1

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/index.js CHANGED
@@ -1,13 +1,10 @@
1
1
  /* eslint-disable prefer-template, no-console */
2
2
  import {
3
- DEFAULT_DIRECTORY,
4
- DUMMY_CUSTOMER_CODE,
5
- IGNORE,
3
+ DEFAULT,
4
+ DUMMY,
6
5
  LITERAL,
7
6
  SYSTEM_NAME,
8
7
  TEST,
9
- shellFile,
10
- testJsonFile,
11
8
  } from './lib/common.js';
12
9
  import {
13
10
  baseUrl,
@@ -20,7 +17,7 @@ import {
20
17
  start2shell,
21
18
  write,
22
19
  } from './lib/helpers.js';
23
- import { dirname, join } from 'path';
20
+ import { dirname, join } from 'node:path';
24
21
  import {
25
22
  getAPI,
26
23
  getAdminToken,
@@ -34,9 +31,9 @@ import {
34
31
  startSetup,
35
32
  } from './lib/tasks.js';
36
33
  import { commitCheckMsg } from '@mimik/git-hooks';
37
- import { fileURLToPath } from 'url';
34
+ import { fileURLToPath } from 'node:url';
38
35
  import find from 'lodash.find';
39
- import fs from 'fs';
36
+ import { writeFileSync } from 'node:fs';
40
37
 
41
38
  colors.setTheme({
42
39
  success: 'green',
@@ -59,111 +56,122 @@ const getBasePath = apiDef => apiDef.basePath || apiDef.servers[FIRST].url;
59
56
  * or
60
57
  * import { mSTTestSetup, mSTSetup, mITTestSetup, mITSetup, testSetup, setup, dotFiles, scripts, unScripts, commitCheckMsg, start2process, testJsonFile} from '@mimik/local';
61
58
  *
62
- * @description Set of functions for local deployment.
59
+ * @description Utilities for local deployment.
63
60
  *
64
61
  * The following files are expected to exist:
65
- * In the directory above the server root directory: `mSTConfig.json`, `mIDConfig.json`, `mITConfig.json`,`sumoLog.json`, `kinesisLog.json`, `s3Log.json`, `customerConfig.json`, `key.json`, `locationConfig.json` are being set. If they don't exist at the launch of the script, default will be setup.
66
- * - for `mSTConfig.json`:
67
- * ``` javascript
62
+ *
63
+ * In the directory **above** the server’s root directory: `mSTConfig.json`, `mIDConfig.json`, `mITConfig.json`, `sumoLog.json`, `kinesisLog.json`, `s3Log.json`, `customerConfig.json`, `key.json`, and `locationConfig.json`. If they don’t exist when the script launches, defaults will be set up.
64
+ *
65
+ * - For `mSTConfig.json`:
66
+ * ```javascript
68
67
  * {
69
- * "basePath": "base path of the mST server, for example: `/mST/v1`",
70
- * "protocol": "protocol for the mST server, for example: `http:`, by default `http:`",
71
- * "domainName": "domain name of the mST server",
72
- * "port": "port for the mST server, for example: `8025`",
73
- * "passphrase": "passphrase to be used to generate public private key pair, if not present mST will user regular key",
74
- * "update": "switch to indicate if mST needs to be updated, default is `false`. If the address is localhost, mST will be updated"
68
+ * "basePath": "Base path of the mST server, e.g., `/mST/v1`",
69
+ * "protocol": "Protocol for the mST server, e.g., `http:` (default: `http:`)",
70
+ * "domainName": "Domain name of the mST server",
71
+ * "port": "Port for the mST server, e.g., `8025`",
72
+ * "passphrase": "Passphrase used to generate the public/private key pair; if not present, mST will use a regular key",
73
+ * "update": "Whether mST should be updated (default: `false`). If the address is localhost, mST will be updated.",
75
74
  * "admin": {
76
- * "clientId": "id or the client in order to get an admin token for mST, for example: `12345`",
77
- * "clientSecret": "secret of the client in order to get an admin token for mST, for example: `timeForSecret`"
75
+ * "clientId": "Client ID used to obtain an mST admin token, e.g., `12345`",
76
+ * "clientSecret": "Client secret used to obtain an mST admin token, e.g., `timeForSecret`"
78
77
  * }
79
78
  * }
80
79
  * ```
81
- * `domainName` must exit, and when `domainName` is equal to `localhost`, `port` must exist. When `domainName` is equal to `localhost` the `local ip` will replace `localhost`. When `domainName` is different of `localhost` the `port` will be ignored.
82
- * - for `mIDConfig.json`:
83
- * ``` javascript
80
+ * `domainName` must exist. When `domainName` is `localhost`, `port` must also exist. When `domainName` is `localhost`, the local IP will replace `localhost`. When `domainName` is different from `localhost`, `port` is ignored.
81
+ *
82
+ * - For `mIDConfig.json`:
83
+ * ```javascript
84
84
  * {
85
- * "basePath": "base path of the mID server, for example: `/mID/v1`",
86
- * "protocol": "protocol for the mID server, for example: `http:`, by default `http:`",
87
- * "domainName": "domain name of the mID server",
88
- * "port": "port for the mST server, for example: `8015`",
85
+ * "basePath": "Base path of the mID server, e.g., `/mID/v1`",
86
+ * "protocol": "Protocol for the mID server, e.g., `http:` (default: `http:`)",
87
+ * "domainName": "Domain name of the mID server",
88
+ * "port": "Port for the mID server, e.g., `8015`",
89
89
  * "implicit": {
90
- * "key": "a key to sign and verify the signature of a use token: `timeForSecret`",
91
- * "audience": "url defining the audinece used in user token: `https://mimik`"
90
+ * "key": "Key to sign and verify the signature of a user token, e.g., `timeForSecret`",
91
+ * "audience": "URL defining the audience used in the user token, e.g., `https://mimik`"
92
92
  * }
93
93
  * }
94
94
  * ```
95
- * Similar properties than for mSTConfig on `domainName` and `port` apply.
96
- * - for `mITConfig.json`:
97
- * ``` javascript
95
+ * The same `domainName`/`port` rules as in `mSTConfig.json` apply.
96
+ *
97
+ * - For `mITConfig.json`:
98
+ * ```javascript
98
99
  * {
99
- * "basePath": "base path of the mIT server, for example: `/mIT/v1`",
100
- * "protocol": "protocol for the mIT server, for example: `http:`, by default `http:`",
101
- * "domainName": "domain name of the mIT server",
102
- * "port": "port for the mIT server, for example: `8050`"
100
+ * "basePath": "Base path of the mIT server, e.g., `/mIT/v1`",
101
+ * "protocol": "Protocol for the mIT server, e.g., `http:` (default: `http:`)",
102
+ * "domainName": "Domain name of the mIT server",
103
+ * "port": "Port for the mIT server, e.g., `8050`"
103
104
  * }
104
105
  * ```
105
- * Similar properties than for mSTConfig on `domainName` and `port` apply.
106
- * - for `sumoLog.json`:
107
- * ``` javascript
106
+ * The same `domainName`/`port` rules as in `mSTConfig.json` apply.
107
+ *
108
+ * - For `sumoLog.json`:
109
+ * ```javascript
108
110
  * {
109
111
  * "<serverType>": {
110
- * "url": "base URL for sumologic, for example: `https://endpoint2.collection.us2.sumologic.com/receiver/v1/http/`",
111
- * "code": "code for sumologic, everything after the last / in the sumologic URL"
112
+ * "url": "Base URL for Sumo Logic, e.g., `https://endpoint2.collection.us2.sumologic.com/receiver/v1/http/`",
113
+ * "code": "The code for Sumo Logic (the part after the last `/` in the URL)"
112
114
  * },
113
115
  * "default": {
114
- * "url": "base URL for sumologic, for example: `https://endpoint2.collection.us2.sumologic.com/receiver/v1/http/`",
115
- * "code": "code for sumologic, everything after the last / in the sumologic URL"
116
+ * "url": "Base URL for Sumo Logic, e.g., `https://endpoint2.collection.us2.sumologic.com/receiver/v1/http/`",
117
+ * "code": "The code for Sumo Logic (the part after the last `/` in the URL)"
118
+ * }
116
119
  * }
117
120
  * ```
118
- * - for `kinesisLog.json`:
119
- * ``` javascript
121
+ *
122
+ * - For `kinesisLog.json`:
123
+ * ```javascript
120
124
  * {
121
- * "region": "region of the Kinesis implementation",
122
- * "accessKeyId": "access key id of Kinesis",
123
- * "secretAccessKey": "secret access key for Kinesis",
124
- * "streamNameInfo": "name of the Kinesis stream for info",
125
- * "streamNameError": "name of the Kinesis stream for error",
126
- * "streamNameOther": "name of the Kinesis stream for all the other levels"
125
+ * "region": "Region of the Kinesis implementation",
126
+ * "accessKeyId": "Access key ID for Kinesis",
127
+ * "secretAccessKey": "Secret access key for Kinesis",
128
+ * "streamNameInfo": "Name of the Kinesis stream for info",
129
+ * "streamNameError": "Name of the Kinesis stream for errors",
130
+ * "streamNameOther": "Name of the Kinesis stream for all other levels"
127
131
  * }
128
132
  * ```
129
- * - for `s3Log.json`:
130
- * ``` javascript
131
- * {
132
- * "region": "region of the S3 implementation",
133
- * "accessKeyId": "Access key id for S3",
134
- * "secretAccessKey": "secret access key for S3",
135
- * "bucketname": "name of the S3 bucket used to store the information",
136
- * "maxEvents": "number of events buffered before sending to S3 (integer)",
137
- * "timeout": "number of seconds before timeout to send to S3 (integer)",
138
- * "maxSize": "max size in Bytes before sending to S3 (integer)"
139
- * }
133
+ *
134
+ * - For `s3Log.json`:
135
+ * ```javascript
136
+ * {
137
+ * "region": "Region of the S3 implementation",
138
+ * "accessKeyId": "Access key ID for S3",
139
+ * "secretAccessKey": "Secret access key for S3",
140
+ * "bucketname": "Name of the S3 bucket used to store information",
141
+ * "maxEvents": "Number of events buffered before sending to S3 (integer)",
142
+ * "timeout": "Number of seconds before a timeout triggers sending to S3 (integer)",
143
+ * "maxSize": "Maximum size in bytes before sending to S3 (integer)"
144
+ * }
140
145
  * ```
146
+ *
141
147
  * - for `key.json`:
142
- * ``` javascript
143
- * {
144
- * "bitbucket": {
145
- * "username": "username to access the bitbucket account",
146
- * "password": "password to access the bitbucket account"
147
- * },
148
- * "swaggerhub": "key to access private API on swaggerhub"
149
- * }
148
+ * ```javascript
149
+ * {
150
+ * "bitbucket": {
151
+ * "username": "Username to access the Bitbucket account",
152
+ * "password": "Password to access the Bitbucket account"
153
+ * },
154
+ * "swaggerhub": "Key to access private APIs on SwaggerHub"
155
+ * }
150
156
  * ```
151
- * - for `locationConfig.json`:
152
- * ``` javascript
153
- * {
154
- * "url": "url of the location provider"
155
- * "key": "key to make request to the location provider"
156
- * }
157
+ *
158
+ * - For `locationConfig.json`:
159
+ * ```javascript
160
+ * {
161
+ * "url": "URL of the location provider",
162
+ * "key": "API key used to make requests to the location provider"
163
+ * }
157
164
  * ```
158
- * A property may be defined for each `serverType` involved. If the serverType does not exist the default will be picked.
159
- * - for `customerConfig.json`:
160
- * See `mST` `README.md` file for an example of a customer configuration. This may have to be updated to reflect the new servers.
161
- * - in the `local` directory of the server root directory: two files `start.json` and `testStart.json` may exit. `start.json` is used when `npm start` is executed, `testStart.json` is used when `npm test` is executed.
162
- * If the files don't exist `exampe-start.json` is used to create `start.json` and `testStart.json`.
163
- * Additionally `example-testStart.json` is used when to create `testStart.json`. The values in `example-testStart.json` take precedence over the values in `example-start.json`.
164
- * The configuration of these files depends on the configuration parameters of the server.
165
- * The following is an example of start.json file for `mIT`:
166
- * ``` javascript
165
+ *
166
+ * A property may be defined for each `serverType` involved. If the `serverType` does not exist, the `default` entry is used.
167
+ *
168
+ * - for `customerConfig.json`: see `mST` `README.md` file for an example of a customer configuration. This may have to be updated to reflect the new server.
169
+ * - In the `local` directory under the server’s root directory: two files, `start.json` and `testStart.json`, may exist. `start.json` is used when `npm start` is executed; `testStart.json` is used when `npm test` is executed.
170
+ * If these files don’t exist, `example-start.json` is used to create `start.json` and `testStart.json`. Additionally, `example-testStart.json` is used to create `testStart.json`; values in `example-testStart.json` take precedence over values in `example-start.json`.
171
+ * The configuration of these files depends on the server’s configuration parameters.
172
+ *
173
+ * Example `start.json` for `mIT`:
174
+ * ```javascript
167
175
  * {
168
176
  * "NODE_ENV": "local",
169
177
  * "LOG_LEVEL": "debug",
@@ -176,29 +184,32 @@ const getBasePath = apiDef => apiDef.basePath || apiDef.servers[FIRST].url;
176
184
  * "SERVER_SECURITY_SET": "off"
177
185
  * }
178
186
  * ```
179
- * While all the files use the `.json` extension it is still possible to add comments `//` in the file to make the file more explicit or to remove some parameters.
180
- * There are reserved environment variables used by the library for configuration:
181
- * - `oauthImplicitNeeded`: if the service handles user token the implicit configuration is needed
182
- * - `mIDNeeded`: if the service has mID as a target
187
+ *
188
+ * Although all files use the `.json` extension, you may still add `//` comments to make them more explicit or to remove parameters.
189
+ *
190
+ * Reserved environment variables used by the library for configuration:
191
+ * - `oauthImplicitNeeded`: if the service handles user tokens, the implicit configuration is required
192
+ * - `mIDNeeded`: if the service targets mID
183
193
  * - `locationNeeded`: if location translation is needed
184
- * - `standAlone`: if the service needs to be operated without other service. If the service has targets most likely 500 errors will be generated
194
+ * - `standAlone`: if the service must operate without other services (if the service has targets, 500 errors are likely)
185
195
  *
186
- * If SERVER_ID is not set in the start.json or testStart.json file, SERVER_ID will be assigned with a uuid.v4.
196
+ * If `SERVER_ID` is not set in `start.json` or `testStart.json`, it will be assigned using `uuidv4`.
187
197
  *
188
- * For test in json file (`server-test.json`) is created in `.`.
189
- * This file contains informations needed to start the test:
190
- * ``` javascript
198
+ * For tests, a JSON file (`server-test.json`) is created in the project root (`.`).
199
+ * This file contains information needed to start the tests:
200
+ * ```javascript
191
201
  * {
192
- * "start": "information needed to setup the environment variables for the test",
193
- * "CUSTOMER_NAME": "name of the customer to setup customer config",
194
- * "CUSTOMER_CODE": "code of the customer to setup coustomer config, `not available for MST`",
195
- * "BASE_PATH": "base path of the API",
196
- * "MST_TOKEN": "mST admin token for creating clients, `no available in standAlone`",
197
- * "ADMIN_TOKEN": "admin token of the service, `no available in standAlone`",
198
- * "MID_TOKEN": "mID admin token for creating users when `authImplicitNeeded is set, `not available in standAlone`")
202
+ * "start": "Information needed to set environment variables for the test",
203
+ * "CUSTOMER_NAME": "Customer name used to set up customer config",
204
+ * "CUSTOMER_CODE": "Customer code used to set up customer config (`not available for mST`)",
205
+ * "BASE_PATH": "Base path of the API",
206
+ * "MST_TOKEN": "mST admin token for creating clients (`not available in standAlone`)",
207
+ * "ADMIN_TOKEN": "Admin token of the service (`not available in standAlone`)",
208
+ * "MID_TOKEN": "mID admin token for creating users when `authImplicitNeeded` is set (`not available in standAlone`)"
199
209
  * }
200
- *```
201
- * In standAlone mode the test can easily get the token using `oauth-helper-temp`.
210
+ * ```
211
+ *
212
+ * In `standAlone` mode, the test can obtain tokens using `oauth-helper-temp`.
202
213
  *
203
214
  */
204
215
 
@@ -207,7 +218,7 @@ const mSTInit = (confType) => {
207
218
  const config = init(regType, false, true);
208
219
  const start = startSetup(config, startConfig);
209
220
 
210
- getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT_DIRECTORY, config.pack.swaggerFile, config.key)
221
+ getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT.API_DIRECTORY, config.pack.swaggerFile, config.key)
211
222
  .then((apiDefinition) => {
212
223
  console.log('- mST base url: ' + config.mSTBaseUrl.info);
213
224
  console.log('- mIT base url: ' + config.MITBaseUrl.info);
@@ -215,12 +226,12 @@ const mSTInit = (confType) => {
215
226
  if (confType === TEST) {
216
227
  start.CUSTOMER_NAME = SYSTEM_NAME;
217
228
  start.BASE_PATH = getBasePath(apiDefinition);
218
- return { file: testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
229
+ return { file: DEFAULT.FILE.testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
219
230
  }
220
- return { file: shellFile, content: start2shell(start), type: 'shell script' };
231
+ return { file: DEFAULT.FILE.shellFile, content: start2shell(start), type: 'shell script' };
221
232
  })
222
233
  .then((response) => {
223
- fs.writeFileSync(response.file, response.content);
234
+ writeFileSync(response.file, response.content);
224
235
  console.log(`${regType}status: ` + 'completed'.success + ', ' + response.type.info + ' created at (' + response.file.info + ')');
225
236
  })
226
237
  .catch(err => exitError(regType, err));
@@ -234,7 +245,7 @@ const mITInit = (confType) => {
234
245
  let start = startSetup(config, startConfig);
235
246
  let authorization;
236
247
 
237
- getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT_DIRECTORY, config.pack.swaggerFile, config.key)
248
+ getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT.API_DIRECTORY, config.pack.swaggerFile, config.key)
238
249
  .then((apiDefinition) => {
239
250
  console.log('- mST base url: ' + `${mSTBaseUrl}`.info);
240
251
  console.log('- mIT base url: ' + config.MITBaseUrl.info);
@@ -243,11 +254,11 @@ const mITInit = (confType) => {
243
254
  start = settingUpDummyServer(type, start.SERVER_ID, null, start);
244
255
  if (confType === TEST) {
245
256
  start.CUSTOMER_NAME = SYSTEM_NAME;
246
- start.CUSTOMER_CODE = DUMMY_CUSTOMER_CODE;
257
+ start.CUSTOMER_CODE = DUMMY.CUSTOMER_CODE;
247
258
  start.BASE_PATH = getBasePath(apiDefinition);
248
- return { file: testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
259
+ return { file: DEFAULT.FILE.testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
249
260
  }
250
- return { file: shellFile, content: start2shell(start), type: 'shell script' };
261
+ return { file: DEFAULT.FILE.shellFile, content: start2shell(start), type: 'shell script' };
251
262
  }
252
263
  return getAdminToken(
253
264
  { type: 'mST', audience: `${baseUrl('mST', regType, config.mST, LITERAL)}/clients/Generic-mST` },
@@ -274,16 +285,16 @@ const mITInit = (confType) => {
274
285
  start.BASE_PATH = getBasePath(apiDefinition);
275
286
  start.MST_TOKEN = authorization;
276
287
  start.ADMIN_TOKEN = adminToken;
277
- return { file: testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
288
+ return { file: DEFAULT.FILE.testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
278
289
  }
279
290
  if (adminToken) console.log('- admin token for the service: ' + adminToken.info);
280
291
  console.log('- mST token: ' + authorization.info);
281
- return { file: shellFile, content: start2shell(start), type: 'shell script' };
292
+ return { file: DEFAULT.FILE.shellFile, content: start2shell(start), type: 'shell script' };
282
293
  });
283
294
  }));
284
295
  })
285
296
  .then((response) => {
286
- fs.writeFileSync(response.file, response.content);
297
+ writeFileSync(response.file, response.content);
287
298
  console.log(`${regType}status: ` + 'completed'.success + ', ' + response.type.info + ' created at (' + response.file.info + ')');
288
299
  })
289
300
  .catch(err => exitError(regType, err));
@@ -301,7 +312,7 @@ const serverInit = (confType) => {
301
312
  let start = startSetup(config, startConfig);
302
313
  let authorization;
303
314
 
304
- getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT_DIRECTORY, config.pack.swaggerFile, config.key)
315
+ getAPI(start.SWAGGER_FILE_DIRECTORY || DEFAULT.API_DIRECTORY, config.pack.swaggerFile, config.key)
305
316
  .then((apiDefinition) => {
306
317
  console.log('- mST base url: ' + `${mSTBaseUrl}`.info);
307
318
  console.log('- mIT base url: ' + config.MITBaseUrl.info);
@@ -310,11 +321,11 @@ const serverInit = (confType) => {
310
321
  start = settingUpDummyServer(type, start.SERVER_ID, customer, start);
311
322
  if (confType === TEST) {
312
323
  start.CUSTOMER_NAME = customer.name;
313
- start.CUSTOMER_CODE = DUMMY_CUSTOMER_CODE;
324
+ start.CUSTOMER_CODE = DUMMY.CUSTOMER_CODE;
314
325
  start.BASE_PATH = getBasePath(apiDefinition);
315
- return { file: testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
326
+ return { file: DEFAULT.FILE.testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
316
327
  }
317
- return { file: shellFile, content: start2shell(start), type: 'shell script' };
328
+ return { file: DEFAULT.FILE.shellFile, content: start2shell(start), type: 'shell script' };
318
329
  }
319
330
  return getAdminToken(
320
331
  { type: 'mST', audience: `${baseUrl('mST', regType, config.mST, LITERAL)}/clients/Generic-mST` },
@@ -345,7 +356,7 @@ const serverInit = (confType) => {
345
356
  start.BASE_PATH = getBasePath(apiDefinition);
346
357
  start.MST_TOKEN = authorization;
347
358
  start.ADMIN_TOKEN = adminToken;
348
- const testResponse = { file: testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
359
+ const testResponse = { file: DEFAULT.FILE.testJsonFile, content: JSON.stringify(start2env(start), null, TAB), type: 'JSON file' };
349
360
 
350
361
  if (startConfig.oauthImplicitNeeded === 'yes') {
351
362
  return settingUpAdminClient('mID', `admin_${customer.name}_${start.NODE_ENV}_mID`, customer, start.MST_TOKEN, mSTBaseUrl)
@@ -360,12 +371,12 @@ const serverInit = (confType) => {
360
371
  }
361
372
  if (adminToken) console.log('- admin token for the service: ' + adminToken.info);
362
373
  console.log('- mST token: ' + authorization.info);
363
- return { file: shellFile, content: start2shell(start), type: 'shell script' };
374
+ return { file: DEFAULT.FILE.shellFile, content: start2shell(start), type: 'shell script' };
364
375
  });
365
376
  });
366
377
  })
367
378
  .then((response) => {
368
- fs.writeFileSync(response.file, response.content);
379
+ writeFileSync(response.file, response.content);
369
380
  console.log(`${regType}status: ` + 'completed'.success + ', ' + response.type.info + ' created at (' + response.file.info + ')');
370
381
  })
371
382
  .catch(err => exitError(regType, err));
@@ -373,292 +384,366 @@ const serverInit = (confType) => {
373
384
 
374
385
  /**
375
386
  *
376
- * Setup mST for test.
387
+ * Set up `mST` for tests.
377
388
  *
378
389
  * @function mSTTestSetup
379
390
  * @category sync
380
391
  *
381
392
  * @return `null`.
382
393
  *
383
- * Will exit 1 if there is an error.
394
+ * Exits with code `1` on error.
384
395
  *
385
- * The following actions are being performed:
396
+ * Actions performed:
386
397
  *
387
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
388
- * 2. generate a json object stored in a file in . to enable the test
398
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
399
+ * 2. Generate a JSON object and store it in a file in the project root (`.`) to enable tests.
389
400
  *
390
- * The following files are needed to perform these actions:
401
+ * Files required:
391
402
  *
392
403
  * | Filename | Description |
393
404
  * | -------- | ----------- |
394
- * | `../sumoLog.json` | The sumologic endpoints and code
395
- * | `../kinesisLog.json` | The Kinesis information
396
- * | `../s3Log.json` | The S3 information
397
- * | `../mSTConfig.json` | The config for mST
398
- * | `../mITConfig.json` | The config for mIT
399
- * | `./local/testStart.json` | The local configuration. If it does not exist start.json will be used and if start.json does not exist start-example.json will be used to create start.json
405
+ * | `../sumoLog.json` | Sumologic endpoints and code
406
+ * | `../kinesisLog.json` | AWS Kinesis configuration
407
+ * | `../s3Log.json` | AWS S3 configuration
408
+ * | `../mSTConfig.json` | mST configuration
409
+ * | `../mITConfig.json` | mIT configuration
410
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
411
+ * | `../key.json` | Github username and password or Swaggerhub key
412
+ * | `./local/testStart.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `testStart.json`)
400
413
  */
401
414
  export const mSTTestSetup = () => mSTInit(TEST);
402
415
 
403
416
  /**
404
417
  *
405
- * Setup mST.
418
+ * Set up `mST`.
406
419
  *
407
420
  * @function mSTSetup
408
421
  * @category sync
409
422
  *
410
423
  * @return `null`.
411
424
  *
412
- * Will exit 1 if there is an error.
425
+ * Exits with code `1` on error.
413
426
  *
414
- * The following actions are being performed:
427
+ * Actions performed:
415
428
  *
416
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
417
- * 2. generate a shell script in a file in . to start the server
429
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
430
+ * 2. Generate a shell script in the project root (`.`) to start the server.
418
431
  *
419
- * The following files are needed to perform these actions:
432
+ * Files required:
420
433
  *
421
434
  * | Filename | Description |
422
435
  * | -------- | ----------- |
423
- * | `../sumoLog.json` | The sumologic endpoints and code
424
- * | `../kinesisLog.json` | The Kinesis information
425
- * | `../s3Log.json` | The S3 information
426
- * | `../mSTConfig.json` | The config for mST
427
- * | `../mITConfig.json` | The config for mIT
428
- * | `./local/start.json` | The local configuration. If it does not exist start-example.json will be used to create start.json
436
+ * | `../sumoLog.json` | Sumologic endpoints and code
437
+ * | `../kinesisLog.json` | AWS Kinesis configuration
438
+ * | `../s3Log.json` | AWS S3 configuration
439
+ * | `../mSTConfig.json` | mST configuration
440
+ * | `../mITConfig.json` | mIT configuration
441
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
442
+ * | `../key.json` | Github username and password or Swaggerhub key
443
+ * | `./local/start.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `start.json`)
429
444
  */
430
445
  export const mSTSetup = () => mSTInit();
431
446
 
432
447
  /**
433
448
  *
434
- * Setup mIT for test.
449
+ * Set up `mIT` for tests.
435
450
  *
436
451
  * @function mITTestSetup
437
452
  * @category sync
438
453
  *
439
454
  * @return `null`.
440
455
  *
441
- * Will exit 1 if there is an error.
456
+ * Exits with code `1` on error.
442
457
  *
443
458
  * Two modes are available:
444
- * 1. stand alone
445
- * 2. with mST
446
459
  *
447
- * The environment variable STAND_ALONE will select the mode.
448
- * When in stand alone, the following actions are being performed:
460
+ * 1. Standalone
461
+ * 2. With mST
449
462
  *
450
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
451
- * 2. get an admin token for that service
452
- * 3. generate a JSON object store in a file under .
463
+ * The environment variable `STAND_ALONE` selects the mode.
453
464
  *
454
- * In standAlone the dependencies will not be reachable and the operation that implies reaching dependencies will most likely generate a 500 error.
465
+ * When **standalone**, the following actions are performed:
455
466
  *
456
- * When mST and other servers are present, the following actions are being performed:
467
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
468
+ * 2. Obtain an admin token for the service.
469
+ * 3. Generate a JSON object and store it in a file under the project root (`.`).
457
470
  *
458
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
459
- * 2. get an admin token for mST
460
- * 3. register the service in mST
461
- * 4. register an admin client for that service in mST
462
- * 5. get an admin token for that service
463
- * 6. get an admin token for mID if needed
464
- * 7. generate a JSON object store in a file under .
471
+ * In `standAlone` mode, dependencies are not reachable and operations that contact dependencies will most likely return a 500 error.
465
472
  *
466
- * The following files are needed to perform these actions:
473
+ * When **mST and other servers are present**, the following actions are performed:
474
+ *
475
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
476
+ * 2. Obtain an admin token for mST.
477
+ * 3. Register the service in mST.
478
+ * 4. Register an admin client for the service in mST.
479
+ * 5. Obtain an admin token for the service.
480
+ * 6. Obtain an admin token for mID if needed.
481
+ * 7. Generate a JSON object and store it in a file under the project root (`.`).
482
+ *
483
+ * Files required:
467
484
  *
468
485
  * | Filename | Description |
469
486
  * | -------- | ----------- |
470
- * | `../sumoLog.json` | The sumologic endpoints and code
471
- * | `../kinesisLog.json` | The Kinesis information
472
- * | `../s3Log.json` | The S3 information
473
- * | `../mSTConfig.json` | The config for mST
474
- * | `../mITConfig.json` | The config for mIT
475
- * | `./local/testStart.json` | The local configuration. If it does not exist start.json will be used and if start.json does not exist start-example.json will be used to create start.json
487
+ * | `../sumoLog.json` | Sumologic endpoints and code
488
+ * | `../kinesisLog.json` | AWS Kinesis configuration
489
+ * | `../s3Log.json` | AWS S3 configuration
490
+ * | `../mSTConfig.json` | mST configuration
491
+ * | `../mITConfig.json` | mIT configuration
492
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
493
+ * | `../key.json` | Github username and password or Swaggerhub key
494
+ * | `./local/testStart.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `testStart.json`)
476
495
  */
477
496
  export const mITTestSetup = () => mITInit(TEST);
478
497
 
479
498
  /**
480
499
  *
481
- * Setup mIT.
500
+ * Set up `mIT`.
482
501
  *
483
502
  * @function mITSetup
484
503
  * @category sync
485
504
  *
486
505
  * @return `null`.
487
506
  *
488
- * Will exit 1 if there is an error.
507
+ * Exits with code `1` on error.
489
508
  *
490
509
  * Two modes are available:
491
- * 1. stand alone
492
- * 2. with mST
493
510
  *
494
- * The environment variable STAND_ALONE will select the mode.
495
- * When in stand alone, the following actions are being performed:
511
+ * 1. Standalone
512
+ * 2. With mST
496
513
  *
497
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
498
- * 2. get an admin token for that service
499
- * 3. generate a shell script to start the server
514
+ * The environment variable `STAND_ALONE` selects the mode.
500
515
  *
501
- * In standAlone the dependencies will not be reachable and the operation that implies reaching dependencies will most likely generate a 500 error.
516
+ * When **standalone**, the following actions are performed:
502
517
  *
503
- * When mST is present, the following actions are being performed:
518
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
519
+ * 2. Obtain an admin token for the service.
520
+ * 3. Generate a shell script in the project root (`.`) to start the server.
504
521
  *
505
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
506
- * 2. get an admin token for mST
507
- * 3. register the service in mST
508
- * 4. generate a shell script to start the server
522
+ * In `standAlone` mode, dependencies are not reachable and operations that contact dependencies will most likely return a 500 error.
509
523
  *
510
- * The following files are needed to perform these actions:
524
+ * When **mST is present**, the following actions are performed:
525
+ *
526
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
527
+ * 2. Obtain an admin token for mST.
528
+ * 3. Register the service in mST.
529
+ * 4. Generate a shell script in the project root (`.`) to start the server.
530
+ *
531
+ * Files required:
511
532
  *
512
533
  * | Filename | Description |
513
534
  * | -------- | ----------- |
514
- * | `../sumoLog.json` | The sumologic endpoints and code
515
- * | `../kinesisLog.json` | The Kinesis information
516
- * | `../s3Log.json` | The S3 information
517
- * | `../mSTConfig.json` | The config for mST
518
- * | `../mITConfig.json` | The config for mIT
519
- * | `./local/start.json` | The local configuration. If it does not exist start-example.json will be used to create start.json
535
+ * | `../sumoLog.json` | Sumologic endpoints and code
536
+ * | `../kinesisLog.json` | AWS Kinesis configuration
537
+ * | `../s3Log.json` | AWS S3 configuration
538
+ * | `../mSTConfig.json` | mST configuration
539
+ * | `../mITConfig.json` | mIT configuration
540
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
541
+ * | `../key.json` | Github username and password or Swaggerhub key
542
+ * | `./local/start.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `start.json`)
520
543
  */
521
544
  export const mITSetup = () => mITInit();
522
545
 
523
546
  /**
524
547
  *
525
- * Setup a service (not mST, mIT) for test.
548
+ * Set up a service (not mST or mIT) for tests.
526
549
  *
527
550
  * @function testSetup
528
551
  * @category sync
529
552
  *
530
553
  * @return `null`.
531
554
  *
532
- * Will exit 1 if there is an error.
555
+ * Exits with code `1` on error.
533
556
  *
534
557
  * Two modes are available:
535
- * 1. stand alone
536
- * 2. with mST, mID are other dependent servers
537
558
  *
538
- * The environment variable STAND_ALONE will select the mode.
539
- * When in stand alone, the following actions are being performed:
559
+ * 1. Standalone
560
+ * 2. With mST/mID and other dependent servers
540
561
  *
541
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
542
- * 2. get an admin token for that service
543
- * 3. generate a JSON object store in a file under .
562
+ * The environment variable `STAND_ALONE` selects the mode.
544
563
  *
545
- * In standAlone the dependencies will not be reachable and the operation that implies reaching dependencies will most likely generate a 500 error.
564
+ * When **standalone**, the following actions are performed:
546
565
  *
547
- * When mST and other servers are present, the following actions are being performed:
566
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
567
+ * 2. Obtain an admin token for the service.
568
+ * 3. Generate a JSON object and store it in a file under the project root (`.`).
548
569
  *
549
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
550
- * 2. get an admin token for mST
551
- * 3. setup the customer in mST
552
- * 4. register the service in mST
553
- * 5. register an admin client for that service in mST
554
- * 6. get an admin token for that service
555
- * 7. get an admin token for mID if needed
556
- * 8. generate a json object store in a file under .
570
+ * In `standAlone` mode, dependencies are not reachable and operations that contact dependencies will most likely return a 500 error.
557
571
  *
558
- * The following files are needed to perform these actions:
572
+ * When **mST and other servers are present**, the following actions are performed:
573
+ *
574
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
575
+ * 2. Obtain an admin token for mST.
576
+ * 3. Set up the customer in mST.
577
+ * 4. Register the service in mST.
578
+ * 5. Register an admin client for the service in mST.
579
+ * 6. Obtain an admin token for the service.
580
+ * 7. Obtain an admin token for mID if needed.
581
+ * 8. Generate a JSON object and store it in a file under the project root (`.`).
582
+ *
583
+ * Files required:
559
584
  *
560
585
  * | Filename | Description |
561
586
  * | -------- | ----------- |
562
- * | `../sumoLog.json` | The sumologic endpoints and code
563
- * | `../kinesisLog.json` | The Kinesis information
564
- * | `../s3Log.json` | The S3 information
565
- * | `../mSTConfig.json` | The config for mST
566
- * | `../mITConfig.json` | The config for mIT
567
- * | `../mIDConfig.json` | The config for mID
568
- * | `../customerConfig.json` | The mST customer config
569
- * | `./local/testStart.json` | The local configuration. If it does not exist start.json will be used and if start.json does not exist start-example.json will be used to create start.json
587
+ * | `../sumoLog.json` | Sumologic endpoints and code
588
+ * | `../kinesisLog.json` | AWS Kinesis configuration
589
+ * | `../s3Log.json` | AWS S3 configuration
590
+ * | `../mSTConfig.json` | mST configuration
591
+ * | `../mITConfig.json` | mIT configuration
592
+ * | `../mIDConfig.json` | mID configuration (when needed)
593
+ * | `../customerConfig.json` | mST customer configuration
594
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
595
+ * | `../key.json` | Github username and password or Swaggerhub key
596
+ * | `./local/testStart.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `testStart.json`)
570
597
  */
571
598
  export const testSetup = () => serverInit(TEST);
572
599
 
573
600
  /**
574
601
  *
575
- * Setup a service (not mST, mIT).
602
+ * Set up a service (not mST or mIT).
576
603
  *
577
604
  * @function setup
578
605
  * @category sync
579
606
  *
580
607
  * @return `null`.
581
608
  *
582
- * Will exit 1 if there is an error.
609
+ * Exits with code `1` on error.
583
610
  *
584
611
  * Two modes are available:
585
- * 1. stand alone
586
- * 2. with mST, mID are other dependent servers
612
+ * 1. Standalone
613
+ * 2. With mST/mID and other dependent servers
587
614
  *
588
- * The environment variable STAND_ALONE will select the mode.
589
- * When in stand alone, the following actions are being performed:
615
+ * The environment variable `STAND_ALONE` selects the mode.
590
616
  *
591
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
592
- * 2. get an admin token for that service
593
- * 3. generate a shell script to start the server
617
+ * When **standalone**, the following actions are performed:
594
618
  *
595
- * In standAlone the dependencies will not be reachable and the operation that implies reaching dependencies will most likely generate a 500 error.
619
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
620
+ * 2. Obtain an admin token for the service.
621
+ * 3. Generate a shell script to start the server.
596
622
  *
597
- * When mST and other servers are present, the following actions are being performed:
623
+ * In `standAlone` mode, dependencies are not reachable and operations that contact dependencies will most likely return a 500 error.
598
624
  *
599
- * 1. retrieve the API from [swaggerhub](https://app.swaggerhub.com/search?type=API&owner=mimik)
600
- * 2. get an admin token for mST
601
- * 3. setup the customer in mST
602
- * 4. register the service in mST
603
- * 5. generate a shell script to start the server
625
+ * When **mST and other servers are present**, the following actions are performed:
626
+ *
627
+ * 1. Retrieve the API definition from [SwaggerHub](https://app.swaggerhub.com/search?type=API&owner=mimik).
628
+ * 2. Obtain an admin token for mST.
629
+ * 3. Set up the customer in mST.
630
+ * 4. Register the service in mST.
631
+ * 5. Generate a shell script in the project root (`.`) to start the server.
604
632
  *
605
633
  * The following files are needed to perform these actions:
606
634
  *
607
635
  * | Filename | Description |
608
636
  * | -------- | ----------- |
609
- * | `../sumo.json` | The sumologic endpoints and code
610
- * | `../kinesisLog.json` | The Kinesis information
611
- * | `../s3Log.json` | The S3 information
612
- * | `../mSTConfig.json` | The config for mST
613
- * | `../mITConfig.json` | The config for mIT
614
- * | `../mIDConfig.json` | The config for mID
615
- * | `../customerConfig.json` | The mST customer config
616
- * | `./local/start.json` | The local configuration. If it does not exist start-example.json will be used to create start.json
637
+ * | `../sumo.json` | Sumo Logic endpoints and code
638
+ * | `../kinesisLog.json` | Kinesis configuration
639
+ * | `../s3Log.json` | S3 configuration
640
+ * | `../mSTConfig.json` | mST configuration
641
+ * | `../mITConfig.json` | mIT configuration
642
+ * | `../mIDConfig.json` | mID configuration (when needed)
643
+ * | `../customerConfig.json` | mST customer configuration
644
+ * | `../locationConfig.json` | Location provider URL and key (when needed)
645
+ * | `../key.json` | Github username and password or Swaggerhub key
646
+ * | `./local/start.json` | Local configuration (if it does not exist, `example-start.json` will be used to create `start.json`)
617
647
  */
618
648
  export const setup = () => serverInit();
619
649
 
620
- const rootPath = (pathName, ignore) => {
621
- const rootDir = join(localDirname, '..', '..', '..');
622
-
623
- if (pathName) {
624
- if (ignore) return `${IGNORE}${join(rootDir, pathName)}`;
625
- return join(rootDir, pathName);
626
- }
627
- if (ignore) return `${IGNORE}${rootDir}`;
628
- return rootDir;
629
- };
630
-
650
+ /**
651
+ *
652
+ * Utility to create `rule files`.
653
+ *
654
+ * @function dotFiles
655
+ * @category sync
656
+ *
657
+ * @return `null`.
658
+ *
659
+ * Creates the `rule files` for:
660
+ *
661
+ * - `eslint` -> `eslint.config.js`.
662
+ * - `c8` -> `.nycrc`
663
+ * - `github` -> `.gitignore`
664
+ *
665
+ * If a file already exists, it will be overwritten.
666
+ */
631
667
  export const dotFiles = () => {
632
- write(rootPath('eslint.config.js'), read(join(localDirname, 'dotFiles', 'eslint.config.js'), INSTALL), INSTALL);
633
- write(rootPath('.nycrc'), parse(read(join(localDirname, 'dotFiles', 'nycrc.json'), 'nycrc.json', INSTALL)), INSTALL, true);
634
- write(rootPath('.gitignore'), read(join(localDirname, 'dotFiles', 'gitIgnore.txt'), INSTALL), INSTALL);
668
+ write('./eslint.config.js', read(join(localDirname, 'dotFiles', 'eslint.config.js'), INSTALL), INSTALL);
669
+ write('./.nycrc', parse(read(join(localDirname, 'dotFiles', 'nycrc.json'), 'nycrc.json', INSTALL)), INSTALL, true);
670
+ write('./.gitignore', read(join(localDirname, 'dotFiles', 'gitIgnore.txt'), INSTALL), INSTALL);
635
671
  };
636
672
 
673
+ /**
674
+ *
675
+ * Utility to add `scripts` and `husky`.
676
+ *
677
+ * @function scripts
678
+ * @category sync
679
+ *
680
+ * @return `null`.
681
+ *
682
+ * Adds `scripts` and `husky` to `package.json`. If a script already exists, it will be overwritten.
683
+ */
637
684
  export const scripts = () => {
638
- const packageFilename = rootPath('package.json');
639
- const scriptsFile = parse(read(join(localDirname, 'scripts.json'), INSTALL), 'scripts.json', INSTALL);
640
- const packageFile = parse(read(packageFilename, INSTALL), 'package.json', INSTALL);
685
+ const scriptsContent = parse(read(join(localDirname, 'scripts.json'), INSTALL), 'scripts.json', INSTALL);
686
+ const packageContent = parse(read(DEFAULT.FILE.packageFile, INSTALL), DEFAULT.FILE.packageFile, INSTALL);
641
687
 
642
- Object.keys(scriptsFile.scripts).forEach((script) => {
643
- packageFile.scripts[script] = scriptsFile.scripts[script];
688
+ Object.keys(scriptsContent.scripts).forEach((script) => {
689
+ packageContent.scripts[script] = scriptsContent.scripts[script];
644
690
  });
645
- packageFile.husky = scriptsFile.husky;
646
- write(packageFilename, packageFile, 'package.json', INSTALL, true);
691
+ packageContent.husky = scriptsContent.husky;
692
+ write(DEFAULT.FILE.packageFile, packageContent, DEFAULT.FILE.packageFile, INSTALL, true);
647
693
  };
648
694
 
695
+ /**
696
+ *
697
+ * Utility to remove `scripts` and `husky`.
698
+ *
699
+ * @function unscripts
700
+ * @category sync
701
+ *
702
+ * @return `null`.
703
+ *
704
+ * Removes `scripts` and `husky` from `package.json`. Only removes the scripts that are in the script file.
705
+ */
649
706
  export const unScripts = () => {
650
- const packageFilename = rootPath('package.json');
651
- const scriptsFile = parse(read(join(localDirname, 'scripts.json'), INSTALL), 'scripts.json', INSTALL);
652
- const packageFile = parse(read(packageFilename, INSTALL), 'package.json', INSTALL);
707
+ const scriptsContent = parse(read(join(localDirname, 'scripts.json'), INSTALL), 'scripts.json', INSTALL);
708
+ const packageContent = parse(read(DEFAULT.FILE.packageFile, INSTALL), DEFAULT.FILE.packageFile, INSTALL);
653
709
 
654
- Object.keys(scriptsFile.scripts).forEach((script) => {
655
- delete packageFile.scripts[script];
710
+ Object.keys(scriptsContent.scripts).forEach((script) => {
711
+ delete packageContent.scripts[script];
656
712
  });
657
- delete packageFile.husky;
658
- write(packageFilename, packageFile, 'package.json', INSTALL, true);
713
+ delete packageContent.husky;
714
+ write(DEFAULT.FILE.packageFile, packageContent, DEFAULT.FILE.packageFile, INSTALL, true);
659
715
  };
660
716
 
661
- export { commitCheckMsg, start2process, testJsonFile };
717
+ /**
718
+ * Path to the JSON test file.
719
+ *
720
+ * @type {string}
721
+ */
722
+ export const testJsonFile = DEFAULT.FILE.testJsonFile; // eslint-disable-line prefer-destructuring
723
+
724
+ /**
725
+ *
726
+ * Check the validity of the commit message.
727
+ *
728
+ * @function commitCheckMsg
729
+ * @category async
730
+ * @return {Promise}.
731
+ * @fulfil `null`.
732
+ *
733
+ * Exits with code `1` if the commit message is not correct or if the branch is not a Jira generated branch.
734
+ */
735
+ export { commitCheckMsg };
736
+
737
+ /**
738
+ *
739
+ * Set up the environment variables based on given JSON object.
740
+ *
741
+ * @function start2process
742
+ * @category sync
743
+ * @param {object} start - JSON object that is used to configure the environment variables. The comments (starting by //) are ignored.
744
+ * @return `null`.
745
+ */
746
+ export { start2process };
662
747
 
663
748
  export default {
664
749
  commitCheckMsg,