namirasoft-alarm 1.3.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/dist/NamirasoftAlarmServer.d.ts +17 -0
- package/dist/NamirasoftAlarmServer.js +23 -0
- package/dist/NamirasoftAlarmServer.js.map +1 -0
- package/dist/NamirasoftAlarmServerAlarm.d.ts +17 -0
- package/dist/NamirasoftAlarmServerAlarm.js +70 -0
- package/dist/NamirasoftAlarmServerAlarm.js.map +1 -0
- package/dist/NamirasoftAlarmServerAlarmCategory.d.ts +16 -0
- package/dist/NamirasoftAlarmServerAlarmCategory.js +62 -0
- package/dist/NamirasoftAlarmServerAlarmCategory.js.map +1 -0
- package/dist/NamirasoftAlarmServerAlarmField.d.ts +16 -0
- package/dist/NamirasoftAlarmServerAlarmField.js +62 -0
- package/dist/NamirasoftAlarmServerAlarmField.js.map +1 -0
- package/dist/NamirasoftAlarmServerAlarmTag.d.ts +16 -0
- package/dist/NamirasoftAlarmServerAlarmTag.js +62 -0
- package/dist/NamirasoftAlarmServerAlarmTag.js.map +1 -0
- package/dist/NamirasoftAlarmServerBase.d.ts +5 -0
- package/dist/NamirasoftAlarmServerBase.js +12 -0
- package/dist/NamirasoftAlarmServerBase.js.map +1 -0
- package/dist/NamirasoftAlarmServerHealthz.d.ts +6 -0
- package/dist/NamirasoftAlarmServerHealthz.js +28 -0
- package/dist/NamirasoftAlarmServerHealthz.js.map +1 -0
- package/dist/NamirasoftAlarmServerValue.d.ts +6 -0
- package/dist/NamirasoftAlarmServerValue.js +29 -0
- package/dist/NamirasoftAlarmServerValue.js.map +1 -0
- package/dist/command/AlarmCategoryCommand.d.ts +4 -0
- package/dist/command/AlarmCategoryCommand.js +23 -0
- package/dist/command/AlarmCategoryCommand.js.map +1 -0
- package/dist/command/AlarmCategoryCreateCommand.d.ts +5 -0
- package/dist/command/AlarmCategoryCreateCommand.js +48 -0
- package/dist/command/AlarmCategoryCreateCommand.js.map +1 -0
- package/dist/command/AlarmCategoryDeleteCommand.d.ts +5 -0
- package/dist/command/AlarmCategoryDeleteCommand.js +37 -0
- package/dist/command/AlarmCategoryDeleteCommand.js.map +1 -0
- package/dist/command/AlarmCategoryGetCommand.d.ts +5 -0
- package/dist/command/AlarmCategoryGetCommand.js +37 -0
- package/dist/command/AlarmCategoryGetCommand.js.map +1 -0
- package/dist/command/AlarmCategoryListCommand.d.ts +5 -0
- package/dist/command/AlarmCategoryListCommand.js +37 -0
- package/dist/command/AlarmCategoryListCommand.js.map +1 -0
- package/dist/command/AlarmCategoryUpdateCommand.d.ts +5 -0
- package/dist/command/AlarmCategoryUpdateCommand.js +48 -0
- package/dist/command/AlarmCategoryUpdateCommand.js.map +1 -0
- package/dist/command/AlarmCommand.d.ts +4 -0
- package/dist/command/AlarmCommand.js +25 -0
- package/dist/command/AlarmCommand.js.map +1 -0
- package/dist/command/AlarmCreateCommand.d.ts +5 -0
- package/dist/command/AlarmCreateCommand.js +102 -0
- package/dist/command/AlarmCreateCommand.js.map +1 -0
- package/dist/command/AlarmDeleteCommand.d.ts +5 -0
- package/dist/command/AlarmDeleteCommand.js +37 -0
- package/dist/command/AlarmDeleteCommand.js.map +1 -0
- package/dist/command/AlarmFieldCommand.d.ts +4 -0
- package/dist/command/AlarmFieldCommand.js +23 -0
- package/dist/command/AlarmFieldCommand.js.map +1 -0
- package/dist/command/AlarmFieldCreateCommand.d.ts +5 -0
- package/dist/command/AlarmFieldCreateCommand.js +66 -0
- package/dist/command/AlarmFieldCreateCommand.js.map +1 -0
- package/dist/command/AlarmFieldDeleteCommand.d.ts +5 -0
- package/dist/command/AlarmFieldDeleteCommand.js +37 -0
- package/dist/command/AlarmFieldDeleteCommand.js.map +1 -0
- package/dist/command/AlarmFieldGetCommand.d.ts +5 -0
- package/dist/command/AlarmFieldGetCommand.js +37 -0
- package/dist/command/AlarmFieldGetCommand.js.map +1 -0
- package/dist/command/AlarmFieldListCommand.d.ts +5 -0
- package/dist/command/AlarmFieldListCommand.js +37 -0
- package/dist/command/AlarmFieldListCommand.js.map +1 -0
- package/dist/command/AlarmFieldUpdateCommand.d.ts +5 -0
- package/dist/command/AlarmFieldUpdateCommand.js +66 -0
- package/dist/command/AlarmFieldUpdateCommand.js.map +1 -0
- package/dist/command/AlarmGetCommand.d.ts +5 -0
- package/dist/command/AlarmGetCommand.js +37 -0
- package/dist/command/AlarmGetCommand.js.map +1 -0
- package/dist/command/AlarmListCommand.d.ts +5 -0
- package/dist/command/AlarmListCommand.js +37 -0
- package/dist/command/AlarmListCommand.js.map +1 -0
- package/dist/command/AlarmTagCommand.d.ts +4 -0
- package/dist/command/AlarmTagCommand.js +23 -0
- package/dist/command/AlarmTagCommand.js.map +1 -0
- package/dist/command/AlarmTagCreateCommand.d.ts +5 -0
- package/dist/command/AlarmTagCreateCommand.js +66 -0
- package/dist/command/AlarmTagCreateCommand.js.map +1 -0
- package/dist/command/AlarmTagDeleteCommand.d.ts +5 -0
- package/dist/command/AlarmTagDeleteCommand.js +37 -0
- package/dist/command/AlarmTagDeleteCommand.js.map +1 -0
- package/dist/command/AlarmTagGetCommand.d.ts +5 -0
- package/dist/command/AlarmTagGetCommand.js +37 -0
- package/dist/command/AlarmTagGetCommand.js.map +1 -0
- package/dist/command/AlarmTagListCommand.d.ts +5 -0
- package/dist/command/AlarmTagListCommand.js +37 -0
- package/dist/command/AlarmTagListCommand.js.map +1 -0
- package/dist/command/AlarmTagUpdateCommand.d.ts +5 -0
- package/dist/command/AlarmTagUpdateCommand.js +66 -0
- package/dist/command/AlarmTagUpdateCommand.js.map +1 -0
- package/dist/command/AlarmTriggerCommand.d.ts +5 -0
- package/dist/command/AlarmTriggerCommand.js +48 -0
- package/dist/command/AlarmTriggerCommand.js.map +1 -0
- package/dist/command/AlarmUpdateCommand.d.ts +5 -0
- package/dist/command/AlarmUpdateCommand.js +102 -0
- package/dist/command/AlarmUpdateCommand.js.map +1 -0
- package/dist/command/HealthzCommand.d.ts +4 -0
- package/dist/command/HealthzCommand.js +15 -0
- package/dist/command/HealthzCommand.js.map +1 -0
- package/dist/command/HealthzGetCommand.d.ts +5 -0
- package/dist/command/HealthzGetCommand.js +37 -0
- package/dist/command/HealthzGetCommand.js.map +1 -0
- package/dist/command/ValueCommand.d.ts +4 -0
- package/dist/command/ValueCommand.js +15 -0
- package/dist/command/ValueCommand.js.map +1 -0
- package/dist/command/ValueListCommand.d.ts +5 -0
- package/dist/command/ValueListCommand.js +37 -0
- package/dist/command/ValueListCommand.js.map +1 -0
- package/dist/command/cli.d.ts +2 -0
- package/dist/command/cli.js +22 -0
- package/dist/command/cli.js.map +1 -0
- package/dist/index.d.ts +50 -0
- package/dist/index.js +67 -0
- package/dist/index.js.map +1 -0
- package/dist/meta/AlarmCategoryMetaTable.d.ts +10 -0
- package/dist/meta/AlarmCategoryMetaTable.js +18 -0
- package/dist/meta/AlarmCategoryMetaTable.js.map +1 -0
- package/dist/meta/AlarmFieldMetaTable.d.ts +12 -0
- package/dist/meta/AlarmFieldMetaTable.js +20 -0
- package/dist/meta/AlarmFieldMetaTable.js.map +1 -0
- package/dist/meta/AlarmMetaTable.d.ts +15 -0
- package/dist/meta/AlarmMetaTable.js +23 -0
- package/dist/meta/AlarmMetaTable.js.map +1 -0
- package/dist/meta/AlarmTagMetaTable.d.ts +12 -0
- package/dist/meta/AlarmTagMetaTable.js +20 -0
- package/dist/meta/AlarmTagMetaTable.js.map +1 -0
- package/dist/meta/MetaDatabase.d.ts +12 -0
- package/dist/meta/MetaDatabase.js +19 -0
- package/dist/meta/MetaDatabase.js.map +1 -0
- package/dist/row/AlarmCategoryRow.d.ts +6 -0
- package/dist/row/AlarmCategoryRow.js +3 -0
- package/dist/row/AlarmCategoryRow.js.map +1 -0
- package/dist/row/AlarmFieldRow.d.ts +8 -0
- package/dist/row/AlarmFieldRow.js +3 -0
- package/dist/row/AlarmFieldRow.js.map +1 -0
- package/dist/row/AlarmInputRow.d.ts +9 -0
- package/dist/row/AlarmInputRow.js +3 -0
- package/dist/row/AlarmInputRow.js.map +1 -0
- package/dist/row/AlarmRow.d.ts +11 -0
- package/dist/row/AlarmRow.js +3 -0
- package/dist/row/AlarmRow.js.map +1 -0
- package/dist/row/AlarmTagRow.d.ts +8 -0
- package/dist/row/AlarmTagRow.js +3 -0
- package/dist/row/AlarmTagRow.js.map +1 -0
- package/dist/row/EntityCategoryInputRow.d.ts +3 -0
- package/dist/row/EntityCategoryInputRow.js +3 -0
- package/dist/row/EntityCategoryInputRow.js.map +1 -0
- package/dist/row/EntityFieldInputRow.d.ts +5 -0
- package/dist/row/EntityFieldInputRow.js +3 -0
- package/dist/row/EntityFieldInputRow.js.map +1 -0
- package/dist/row/EntityTagInputRow.d.ts +5 -0
- package/dist/row/EntityTagInputRow.js +3 -0
- package/dist/row/EntityTagInputRow.js.map +1 -0
- package/logo.png +0 -0
- package/package.json +28 -0
- package/src/NamirasoftAlarmServer.ts +48 -0
- package/src/NamirasoftAlarmServerAlarm.ts +75 -0
- package/src/NamirasoftAlarmServerAlarmCategory.ts +68 -0
- package/src/NamirasoftAlarmServerAlarmField.ts +68 -0
- package/src/NamirasoftAlarmServerAlarmTag.ts +68 -0
- package/src/NamirasoftAlarmServerBase.ts +30 -0
- package/src/NamirasoftAlarmServerHealthz.ts +36 -0
- package/src/NamirasoftAlarmServerValue.ts +37 -0
- package/src/command/AlarmCategoryCommand.ts +40 -0
- package/src/command/AlarmCategoryCreateCommand.ts +55 -0
- package/src/command/AlarmCategoryDeleteCommand.ts +44 -0
- package/src/command/AlarmCategoryGetCommand.ts +44 -0
- package/src/command/AlarmCategoryListCommand.ts +44 -0
- package/src/command/AlarmCategoryUpdateCommand.ts +55 -0
- package/src/command/AlarmCommand.ts +42 -0
- package/src/command/AlarmCreateCommand.ts +109 -0
- package/src/command/AlarmDeleteCommand.ts +44 -0
- package/src/command/AlarmFieldCommand.ts +40 -0
- package/src/command/AlarmFieldCreateCommand.ts +73 -0
- package/src/command/AlarmFieldDeleteCommand.ts +44 -0
- package/src/command/AlarmFieldGetCommand.ts +44 -0
- package/src/command/AlarmFieldListCommand.ts +44 -0
- package/src/command/AlarmFieldUpdateCommand.ts +73 -0
- package/src/command/AlarmGetCommand.ts +44 -0
- package/src/command/AlarmListCommand.ts +44 -0
- package/src/command/AlarmTagCommand.ts +40 -0
- package/src/command/AlarmTagCreateCommand.ts +73 -0
- package/src/command/AlarmTagDeleteCommand.ts +44 -0
- package/src/command/AlarmTagGetCommand.ts +44 -0
- package/src/command/AlarmTagListCommand.ts +44 -0
- package/src/command/AlarmTagUpdateCommand.ts +73 -0
- package/src/command/AlarmTriggerCommand.ts +55 -0
- package/src/command/AlarmUpdateCommand.ts +109 -0
- package/src/command/HealthzCommand.ts +32 -0
- package/src/command/HealthzGetCommand.ts +44 -0
- package/src/command/ValueCommand.ts +32 -0
- package/src/command/ValueListCommand.ts +44 -0
- package/src/command/cli.ts +41 -0
- package/src/index.ts +70 -0
- package/src/meta/AlarmCategoryMetaTable.ts +41 -0
- package/src/meta/AlarmFieldMetaTable.ts +45 -0
- package/src/meta/AlarmMetaTable.ts +51 -0
- package/src/meta/AlarmTagMetaTable.ts +45 -0
- package/src/meta/MetaDatabase.ts +40 -0
- package/src/row/AlarmCategoryRow.ts +27 -0
- package/src/row/AlarmFieldRow.ts +29 -0
- package/src/row/AlarmInputRow.ts +30 -0
- package/src/row/AlarmRow.ts +32 -0
- package/src/row/AlarmTagRow.ts +29 -0
- package/src/row/EntityCategoryInputRow.ts +24 -0
- package/src/row/EntityFieldInputRow.ts +26 -0
- package/src/row/EntityTagInputRow.ts +26 -0
- package/tsconfig.json +42 -0
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAlarmServer } from "../NamirasoftAlarmServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class AlarmUpdateCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["id"], [
|
|
31
|
+
{
|
|
32
|
+
name: "product_id",
|
|
33
|
+
short: "",
|
|
34
|
+
description: "Provides the value of 'product_id' in body",
|
|
35
|
+
optional: false,
|
|
36
|
+
args: ["product_id"],
|
|
37
|
+
defaults: [""]
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
name: "notification_sender_topic_id",
|
|
41
|
+
short: "",
|
|
42
|
+
description: "Provides the value of 'notification_sender_topic_id' in body",
|
|
43
|
+
optional: false,
|
|
44
|
+
args: ["notification_sender_topic_id"],
|
|
45
|
+
defaults: [""]
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: "name",
|
|
49
|
+
short: "",
|
|
50
|
+
description: "Provides the value of 'name' in body",
|
|
51
|
+
optional: true,
|
|
52
|
+
args: ["name"],
|
|
53
|
+
defaults: [""]
|
|
54
|
+
},
|
|
55
|
+
{
|
|
56
|
+
name: "entity",
|
|
57
|
+
short: "",
|
|
58
|
+
description: "Provides the value of 'entity' in body",
|
|
59
|
+
optional: true,
|
|
60
|
+
args: ["entity"],
|
|
61
|
+
defaults: [""]
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
name: "action",
|
|
65
|
+
short: "",
|
|
66
|
+
description: "Provides the value of 'action' in body",
|
|
67
|
+
optional: true,
|
|
68
|
+
args: ["action"],
|
|
69
|
+
defaults: [""]
|
|
70
|
+
},
|
|
71
|
+
{
|
|
72
|
+
name: "filters",
|
|
73
|
+
short: "",
|
|
74
|
+
description: "Provides the value of 'filters' in body",
|
|
75
|
+
optional: true,
|
|
76
|
+
args: ["filters"],
|
|
77
|
+
defaults: [""]
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
name: "description",
|
|
81
|
+
short: "",
|
|
82
|
+
description: "Provides the value of 'description' in body",
|
|
83
|
+
optional: true,
|
|
84
|
+
args: ["description"],
|
|
85
|
+
defaults: [""]
|
|
86
|
+
}
|
|
87
|
+
]);
|
|
88
|
+
}
|
|
89
|
+
override async exec()
|
|
90
|
+
{
|
|
91
|
+
let token = this.app.storage.getNSAToken();
|
|
92
|
+
if (token == null)
|
|
93
|
+
throw new Error("Token is not available. Please login first using:\nns-alarm account config \nor \n{this.command} account login.");
|
|
94
|
+
let storage = new IStorageMemory();
|
|
95
|
+
let manager = new TokenManager(storage, () => { });
|
|
96
|
+
manager.setValue(token, false);
|
|
97
|
+
let server = new NamirasoftAlarmServer(manager, e => this.app.logger.error(e.message));
|
|
98
|
+
let ans = await server.alarm.Update(this.arg_values[0], {
|
|
99
|
+
product_id: this.option_values.product_id,
|
|
100
|
+
notification_sender_topic_id: this.option_values.notification_sender_topic_id,
|
|
101
|
+
name: this.option_values.name,
|
|
102
|
+
entity: this.option_values.entity,
|
|
103
|
+
action: this.option_values.action,
|
|
104
|
+
filters: this.option_values.filters,
|
|
105
|
+
description: this.option_values.description
|
|
106
|
+
});
|
|
107
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
108
|
+
}
|
|
109
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { HealthzGetCommand } from "./HealthzGetCommand";
|
|
23
|
+
|
|
24
|
+
export class HealthzCommand extends BaseNavigatorCommand
|
|
25
|
+
{
|
|
26
|
+
constructor(argv: string[])
|
|
27
|
+
{
|
|
28
|
+
super(argv, {
|
|
29
|
+
"get": HealthzGetCommand,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAlarmServer } from "../NamirasoftAlarmServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class HealthzGetCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, [], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-alarm account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAlarmServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.healthz.Get();
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseNavigatorCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { ValueListCommand } from "./ValueListCommand";
|
|
23
|
+
|
|
24
|
+
export class ValueCommand extends BaseNavigatorCommand
|
|
25
|
+
{
|
|
26
|
+
constructor(argv: string[])
|
|
27
|
+
{
|
|
28
|
+
super(argv, {
|
|
29
|
+
"list": ValueListCommand,
|
|
30
|
+
});
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseFinalCommand } from "namirasoft-node-cli";
|
|
22
|
+
import { IStorageMemory } from "namirasoft-core";
|
|
23
|
+
import { NamirasoftAlarmServer } from "../NamirasoftAlarmServer";
|
|
24
|
+
import { TokenManager } from "namirasoft-account";
|
|
25
|
+
|
|
26
|
+
export class ValueListCommand extends BaseFinalCommand
|
|
27
|
+
{
|
|
28
|
+
constructor(argv: string[])
|
|
29
|
+
{
|
|
30
|
+
super(argv, ["table", "column"], []);
|
|
31
|
+
}
|
|
32
|
+
override async exec()
|
|
33
|
+
{
|
|
34
|
+
let token = this.app.storage.getNSAToken();
|
|
35
|
+
if (token == null)
|
|
36
|
+
throw new Error("Token is not available. Please login first using:\nns-alarm account config \nor \n{this.command} account login.");
|
|
37
|
+
let storage = new IStorageMemory();
|
|
38
|
+
let manager = new TokenManager(storage, () => { });
|
|
39
|
+
manager.setValue(token, false);
|
|
40
|
+
let server = new NamirasoftAlarmServer(manager, e => this.app.logger.error(e.message));
|
|
41
|
+
let ans = await server.value.List(this.arg_values[0], this.arg_values[1]);
|
|
42
|
+
this.app.logger.success(JSON.stringify(ans));
|
|
43
|
+
}
|
|
44
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/****************************************************************/
|
|
3
|
+
/* */
|
|
4
|
+
/* This is an Auto-Generated File */
|
|
5
|
+
/* Made By */
|
|
6
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
7
|
+
/* */
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/****************************************************************/
|
|
10
|
+
/* */
|
|
11
|
+
/* Please do not make any change to this file */
|
|
12
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
13
|
+
/* */
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/****************************************************************/
|
|
16
|
+
/* */
|
|
17
|
+
/* Namira Software Corporation */
|
|
18
|
+
/* https://namirasoft.com */
|
|
19
|
+
/* */
|
|
20
|
+
/****************************************************************/
|
|
21
|
+
|
|
22
|
+
import { AccountCommand } from "namirasoft-account";
|
|
23
|
+
import { AlarmCategoryCommand } from "./AlarmCategoryCommand";
|
|
24
|
+
import { AlarmCommand } from "./AlarmCommand";
|
|
25
|
+
import { AlarmFieldCommand } from "./AlarmFieldCommand";
|
|
26
|
+
import { AlarmTagCommand } from "./AlarmTagCommand";
|
|
27
|
+
import { Application, BaseStorage } from "namirasoft-node-cli";
|
|
28
|
+
import { HealthzCommand } from "./HealthzCommand";
|
|
29
|
+
import { ValueCommand } from "./ValueCommand";
|
|
30
|
+
|
|
31
|
+
let app = new Application("ns-alarm", new BaseStorage(),
|
|
32
|
+
{
|
|
33
|
+
"healthz": HealthzCommand,
|
|
34
|
+
"value": ValueCommand,
|
|
35
|
+
"alarmcategory": AlarmCategoryCommand,
|
|
36
|
+
"alarmfield": AlarmFieldCommand,
|
|
37
|
+
"alarmtag": AlarmTagCommand,
|
|
38
|
+
"alarm": AlarmCommand,
|
|
39
|
+
"account": AccountCommand
|
|
40
|
+
});
|
|
41
|
+
app.run();
|
package/src/index.ts
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
export * from "./NamirasoftAlarmServer";
|
|
22
|
+
export * from "./NamirasoftAlarmServerAlarm";
|
|
23
|
+
export * from "./NamirasoftAlarmServerAlarmCategory";
|
|
24
|
+
export * from "./NamirasoftAlarmServerAlarmField";
|
|
25
|
+
export * from "./NamirasoftAlarmServerAlarmTag";
|
|
26
|
+
export * from "./NamirasoftAlarmServerBase";
|
|
27
|
+
export * from "./NamirasoftAlarmServerHealthz";
|
|
28
|
+
export * from "./NamirasoftAlarmServerValue";
|
|
29
|
+
export * from "./command/AlarmCategoryCommand";
|
|
30
|
+
export * from "./command/AlarmCategoryCreateCommand";
|
|
31
|
+
export * from "./command/AlarmCategoryDeleteCommand";
|
|
32
|
+
export * from "./command/AlarmCategoryGetCommand";
|
|
33
|
+
export * from "./command/AlarmCategoryListCommand";
|
|
34
|
+
export * from "./command/AlarmCategoryUpdateCommand";
|
|
35
|
+
export * from "./command/AlarmCommand";
|
|
36
|
+
export * from "./command/AlarmCreateCommand";
|
|
37
|
+
export * from "./command/AlarmDeleteCommand";
|
|
38
|
+
export * from "./command/AlarmFieldCommand";
|
|
39
|
+
export * from "./command/AlarmFieldCreateCommand";
|
|
40
|
+
export * from "./command/AlarmFieldDeleteCommand";
|
|
41
|
+
export * from "./command/AlarmFieldGetCommand";
|
|
42
|
+
export * from "./command/AlarmFieldListCommand";
|
|
43
|
+
export * from "./command/AlarmFieldUpdateCommand";
|
|
44
|
+
export * from "./command/AlarmGetCommand";
|
|
45
|
+
export * from "./command/AlarmListCommand";
|
|
46
|
+
export * from "./command/AlarmTagCommand";
|
|
47
|
+
export * from "./command/AlarmTagCreateCommand";
|
|
48
|
+
export * from "./command/AlarmTagDeleteCommand";
|
|
49
|
+
export * from "./command/AlarmTagGetCommand";
|
|
50
|
+
export * from "./command/AlarmTagListCommand";
|
|
51
|
+
export * from "./command/AlarmTagUpdateCommand";
|
|
52
|
+
export * from "./command/AlarmTriggerCommand";
|
|
53
|
+
export * from "./command/AlarmUpdateCommand";
|
|
54
|
+
export * from "./command/HealthzCommand";
|
|
55
|
+
export * from "./command/HealthzGetCommand";
|
|
56
|
+
export * from "./command/ValueCommand";
|
|
57
|
+
export * from "./command/ValueListCommand";
|
|
58
|
+
export * from "./meta/AlarmCategoryMetaTable";
|
|
59
|
+
export * from "./meta/AlarmFieldMetaTable";
|
|
60
|
+
export * from "./meta/AlarmMetaTable";
|
|
61
|
+
export * from "./meta/AlarmTagMetaTable";
|
|
62
|
+
export * from "./meta/MetaDatabase";
|
|
63
|
+
export * from "./row/AlarmCategoryRow";
|
|
64
|
+
export * from "./row/AlarmFieldRow";
|
|
65
|
+
export * from "./row/AlarmInputRow";
|
|
66
|
+
export * from "./row/AlarmRow";
|
|
67
|
+
export * from "./row/AlarmTagRow";
|
|
68
|
+
export * from "./row/EntityCategoryInputRow";
|
|
69
|
+
export * from "./row/EntityFieldInputRow";
|
|
70
|
+
export * from "./row/EntityTagInputRow";
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseMetaColumn, BaseMetaTable } from "namirasoft-core";
|
|
22
|
+
|
|
23
|
+
export class AlarmCategoryMetaTable extends BaseMetaTable
|
|
24
|
+
{
|
|
25
|
+
public columns!: {
|
|
26
|
+
id: BaseMetaColumn;
|
|
27
|
+
user_id: BaseMetaColumn;
|
|
28
|
+
entity_id: BaseMetaColumn;
|
|
29
|
+
category_id: BaseMetaColumn;
|
|
30
|
+
}
|
|
31
|
+
constructor()
|
|
32
|
+
{
|
|
33
|
+
super("alarm_category", "Alarm Category");
|
|
34
|
+
this.columns = {
|
|
35
|
+
id: new BaseMetaColumn("id", "Id", "Integer", true),
|
|
36
|
+
user_id: new BaseMetaColumn("user_id", "User Id", "String", true),
|
|
37
|
+
entity_id: new BaseMetaColumn("entity_id", "Entity Id", "String", true),
|
|
38
|
+
category_id: new BaseMetaColumn("category_id", "Category Id", "String", true),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseMetaColumn, BaseMetaTable } from "namirasoft-core";
|
|
22
|
+
|
|
23
|
+
export class AlarmFieldMetaTable extends BaseMetaTable
|
|
24
|
+
{
|
|
25
|
+
public columns!: {
|
|
26
|
+
id: BaseMetaColumn;
|
|
27
|
+
user_id: BaseMetaColumn;
|
|
28
|
+
entity_id: BaseMetaColumn;
|
|
29
|
+
field_id: BaseMetaColumn;
|
|
30
|
+
value: BaseMetaColumn;
|
|
31
|
+
description: BaseMetaColumn;
|
|
32
|
+
}
|
|
33
|
+
constructor()
|
|
34
|
+
{
|
|
35
|
+
super("alarm_field", "Alarm Field");
|
|
36
|
+
this.columns = {
|
|
37
|
+
id: new BaseMetaColumn("id", "Id", "Integer", true),
|
|
38
|
+
user_id: new BaseMetaColumn("user_id", "User Id", "String", true),
|
|
39
|
+
entity_id: new BaseMetaColumn("entity_id", "Entity Id", "String", true),
|
|
40
|
+
field_id: new BaseMetaColumn("field_id", "Field Id", "String", true),
|
|
41
|
+
value: new BaseMetaColumn("value", "Value", "String", true),
|
|
42
|
+
description: new BaseMetaColumn("description", "Description", "String", false),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseMetaColumn, BaseMetaTable } from "namirasoft-core";
|
|
22
|
+
|
|
23
|
+
export class AlarmMetaTable extends BaseMetaTable
|
|
24
|
+
{
|
|
25
|
+
public columns!: {
|
|
26
|
+
id: BaseMetaColumn;
|
|
27
|
+
user_id: BaseMetaColumn;
|
|
28
|
+
product_id: BaseMetaColumn;
|
|
29
|
+
notification_sender_topic_id: BaseMetaColumn;
|
|
30
|
+
name: BaseMetaColumn;
|
|
31
|
+
entity: BaseMetaColumn;
|
|
32
|
+
action: BaseMetaColumn;
|
|
33
|
+
filters: BaseMetaColumn;
|
|
34
|
+
description: BaseMetaColumn;
|
|
35
|
+
}
|
|
36
|
+
constructor()
|
|
37
|
+
{
|
|
38
|
+
super("alarm", "Alarm");
|
|
39
|
+
this.columns = {
|
|
40
|
+
id: new BaseMetaColumn("id", "Id", "String", true),
|
|
41
|
+
user_id: new BaseMetaColumn("user_id", "User Id", "String", true),
|
|
42
|
+
product_id: new BaseMetaColumn("product_id", "Product Id", "String", true),
|
|
43
|
+
notification_sender_topic_id: new BaseMetaColumn("notification_sender_topic_id", "Notification Sender Topic Id", "String", true),
|
|
44
|
+
name: new BaseMetaColumn("name", "Name", "String", false),
|
|
45
|
+
entity: new BaseMetaColumn("entity", "Entity", "String", false),
|
|
46
|
+
action: new BaseMetaColumn("action", "Action", "String", false),
|
|
47
|
+
filters: new BaseMetaColumn("filters", "Filters", "String", false),
|
|
48
|
+
description: new BaseMetaColumn("description", "Description", "String", false),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { BaseMetaColumn, BaseMetaTable } from "namirasoft-core";
|
|
22
|
+
|
|
23
|
+
export class AlarmTagMetaTable extends BaseMetaTable
|
|
24
|
+
{
|
|
25
|
+
public columns!: {
|
|
26
|
+
id: BaseMetaColumn;
|
|
27
|
+
user_id: BaseMetaColumn;
|
|
28
|
+
entity_id: BaseMetaColumn;
|
|
29
|
+
name: BaseMetaColumn;
|
|
30
|
+
value: BaseMetaColumn;
|
|
31
|
+
description: BaseMetaColumn;
|
|
32
|
+
}
|
|
33
|
+
constructor()
|
|
34
|
+
{
|
|
35
|
+
super("alarm_tag", "Alarm Tag");
|
|
36
|
+
this.columns = {
|
|
37
|
+
id: new BaseMetaColumn("id", "Id", "Integer", true),
|
|
38
|
+
user_id: new BaseMetaColumn("user_id", "User Id", "String", true),
|
|
39
|
+
entity_id: new BaseMetaColumn("entity_id", "Entity Id", "String", true),
|
|
40
|
+
name: new BaseMetaColumn("name", "Name", "String", true),
|
|
41
|
+
value: new BaseMetaColumn("value", "Value", "String", true),
|
|
42
|
+
description: new BaseMetaColumn("description", "Description", "String", false),
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { AlarmCategoryMetaTable } from "./AlarmCategoryMetaTable";
|
|
22
|
+
import { AlarmFieldMetaTable } from "./AlarmFieldMetaTable";
|
|
23
|
+
import { AlarmMetaTable } from "./AlarmMetaTable";
|
|
24
|
+
import { AlarmTagMetaTable } from "./AlarmTagMetaTable";
|
|
25
|
+
|
|
26
|
+
export class MetaDatabase
|
|
27
|
+
{
|
|
28
|
+
public static main: MetaDatabase = new MetaDatabase();
|
|
29
|
+
public alarm: AlarmMetaTable;
|
|
30
|
+
public alarm_category: AlarmCategoryMetaTable;
|
|
31
|
+
public alarm_field: AlarmFieldMetaTable;
|
|
32
|
+
public alarm_tag: AlarmTagMetaTable;
|
|
33
|
+
constructor()
|
|
34
|
+
{
|
|
35
|
+
this.alarm = new AlarmMetaTable();
|
|
36
|
+
this.alarm_category = new AlarmCategoryMetaTable();
|
|
37
|
+
this.alarm_field = new AlarmFieldMetaTable();
|
|
38
|
+
this.alarm_tag = new AlarmTagMetaTable();
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
export type AlarmCategoryRow =
|
|
22
|
+
{
|
|
23
|
+
id: number;
|
|
24
|
+
user_id: string;
|
|
25
|
+
entity_id: string;
|
|
26
|
+
category_id: string;
|
|
27
|
+
}
|