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/demo/maintenance_request/actions/add_photo.json +23 -0
- package/demo/maintenance_request/actions/change_assignee.json +57 -0
- package/demo/maintenance_request/actions/change_status.json +57 -0
- package/demo/maintenance_request/actions/create_ticket.json +28 -0
- package/demo/maintenance_request/actions/edit_collaborator.json +57 -0
- package/demo/maintenance_request/actions/handle_update_ticket.json +21 -0
- package/demo/maintenance_request/actions/submit_form.json +140 -0
- package/demo/maintenance_request/environment.json +8 -0
- package/demo/maintenance_request/workflow.json +84 -0
- package/dist/index.js +12 -12
- package/package.json +1 -1
- package/src/common/constant.ts +3 -0
- package/src/common/enum.ts +1 -1
- package/src/handlers/mobioffice.handler.ts +6 -5
- package/src/index.ts +1 -1
package/package.json
CHANGED
package/src/common/constant.ts
CHANGED
@@ -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';
|
package/src/common/enum.ts
CHANGED
@@ -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
|
-
|
10
|
+
COMPANY_NAME = 'company=',
|
10
11
|
USER_ID = 'user=',
|
11
12
|
}
|
12
13
|
|
13
14
|
class MobiofficeHandler {
|
14
|
-
private MOBIOFFICE_URL: string =
|
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
|
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 (!
|
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
|
-
|
58
|
+
nickname: companyName,
|
58
59
|
user,
|
59
60
|
}),
|
60
61
|
});
|