mstate-cli 0.2.3 → 0.2.4

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mstate-cli",
3
- "version": "0.2.3",
3
+ "version": "0.2.4",
4
4
  "main": "index.js",
5
5
  "bin": {
6
6
  "mstate": "./dist/index.js"
@@ -14,3 +14,6 @@ export const MSTATE_DOMAIN: string = `https://dev.mstate.ai/`;
14
14
  export const MSTATE_URL: string = 'https://dev.mstate.mobioffice.io/api';
15
15
  // export const MSTATE_URL = 'http://localhost:3000/api';
16
16
  // export const MSTATE_URL = 'https://api.mstate.mobioffice.io/api';
17
+
18
+ // export const MOBIOFFICE_URL: string = 'https://server.mobioffice.io/api';
19
+ export const MOBIOFFICE_URL: string = 'https://dev-server.mobioffice.io/api';
@@ -1,7 +1,7 @@
1
1
  export enum CmdAction {
2
2
  LOGIN = 'login',
3
3
  LINK = 'link',
4
- UPDATE = 'update',
4
+ SET = 'set',
5
5
  DEV = 'dev',
6
6
  UNLINK = 'unlink',
7
7
  PERMISSION = 'permission',
@@ -1,3 +1,4 @@
1
+ import { MOBIOFFICE_URL } from '../common/constant';
1
2
  import { CmdAction } from '../common/enum';
2
3
  import { getValueFromArgs } from '../common/helpers';
3
4
  import { customLog, getSecretKey } from '../common/utils';
@@ -6,12 +7,12 @@ enum Key {
6
7
  WORKFLOW = 'workflow=',
7
8
  PERMISSIONS = 'permissions=',
8
9
  SECRET_KEY = 'secret=',
9
- COMPANY_ID = 'company=',
10
+ COMPANY_NAME = 'company=',
10
11
  USER_ID = 'user=',
11
12
  }
12
13
 
13
14
  class MobiofficeHandler {
14
- private MOBIOFFICE_URL: string = 'https://server.mobioffice.io/api';
15
+ private MOBIOFFICE_URL: string = MOBIOFFICE_URL;
15
16
 
16
17
  constructor() {}
17
18
 
@@ -20,7 +21,7 @@ class MobiofficeHandler {
20
21
 
21
22
  const workflowName = getValueFromArgs(args, Key.WORKFLOW);
22
23
  const secretKey = getSecretKey();
23
- const companyID = getValueFromArgs(args, Key.COMPANY_ID);
24
+ const companyName = getValueFromArgs(args, Key.COMPANY_NAME);
24
25
  const user = getValueFromArgs(args, Key.USER_ID);
25
26
 
26
27
  if (!workflowName) {
@@ -33,7 +34,7 @@ class MobiofficeHandler {
33
34
  return;
34
35
  }
35
36
 
36
- if (!companyID) {
37
+ if (!companyName) {
37
38
  customLog.changeAndThrow(`Parameter company is required`);
38
39
  return;
39
40
  }
@@ -54,7 +55,7 @@ class MobiofficeHandler {
54
55
  action: action.toUpperCase(),
55
56
  workflow: workflowName,
56
57
  secret: secretKey,
57
- companyID,
58
+ nickname: companyName,
58
59
  user,
59
60
  }),
60
61
  });
package/src/index.ts CHANGED
@@ -33,7 +33,7 @@ const [action] = argv.slice(2);
33
33
  else await companyHandler.addToken();
34
34
  break;
35
35
 
36
- case CmdAction.UPDATE:
36
+ case CmdAction.SET:
37
37
  companyHandler.handleUpdateSavedSecretKey();
38
38
  break;
39
39