namirasoft-cost 1.4.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.
Files changed (99) hide show
  1. package/dist/NamirasoftCostServer.d.ts +13 -0
  2. package/dist/NamirasoftCostServer.js +20 -0
  3. package/dist/NamirasoftCostServer.js.map +1 -0
  4. package/dist/NamirasoftCostServerBase.d.ts +5 -0
  5. package/dist/NamirasoftCostServerBase.js +11 -0
  6. package/dist/NamirasoftCostServerBase.js.map +1 -0
  7. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +12 -0
  8. package/dist/NamirasoftCostServerBillWatchAWS.js +29 -0
  9. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -0
  10. package/dist/NamirasoftCostServerCost.d.ts +14 -0
  11. package/dist/NamirasoftCostServerCost.js +41 -0
  12. package/dist/NamirasoftCostServerCost.js.map +1 -0
  13. package/dist/NamirasoftCostServerHealthz.d.ts +6 -0
  14. package/dist/NamirasoftCostServerHealthz.js +28 -0
  15. package/dist/NamirasoftCostServerHealthz.js.map +1 -0
  16. package/dist/NamirasoftCostServerValue.d.ts +6 -0
  17. package/dist/NamirasoftCostServerValue.js +29 -0
  18. package/dist/NamirasoftCostServerValue.js.map +1 -0
  19. package/dist/command/BillWatchAWSCommand.d.ts +4 -0
  20. package/dist/command/BillWatchAWSCommand.js +15 -0
  21. package/dist/command/BillWatchAWSCommand.js.map +1 -0
  22. package/dist/command/BillWatchAWSEstimationCommand.d.ts +5 -0
  23. package/dist/command/BillWatchAWSEstimationCommand.js +67 -0
  24. package/dist/command/BillWatchAWSEstimationCommand.js.map +1 -0
  25. package/dist/command/CostCommand.d.ts +4 -0
  26. package/dist/command/CostCommand.js +17 -0
  27. package/dist/command/CostCommand.js.map +1 -0
  28. package/dist/command/CostListCommand.d.ts +5 -0
  29. package/dist/command/CostListCommand.js +38 -0
  30. package/dist/command/CostListCommand.js.map +1 -0
  31. package/dist/command/Cost_CreateCommand.d.ts +5 -0
  32. package/dist/command/Cost_CreateCommand.js +148 -0
  33. package/dist/command/Cost_CreateCommand.js.map +1 -0
  34. package/dist/command/HealthzCommand.d.ts +4 -0
  35. package/dist/command/HealthzCommand.js +15 -0
  36. package/dist/command/HealthzCommand.js.map +1 -0
  37. package/dist/command/HealthzGetCommand.d.ts +5 -0
  38. package/dist/command/HealthzGetCommand.js +38 -0
  39. package/dist/command/HealthzGetCommand.js.map +1 -0
  40. package/dist/command/ValueCommand.d.ts +4 -0
  41. package/dist/command/ValueCommand.js +15 -0
  42. package/dist/command/ValueCommand.js.map +1 -0
  43. package/dist/command/ValueListCommand.d.ts +5 -0
  44. package/dist/command/ValueListCommand.js +38 -0
  45. package/dist/command/ValueListCommand.js.map +1 -0
  46. package/dist/command/cli.d.ts +2 -0
  47. package/dist/command/cli.js +20 -0
  48. package/dist/command/cli.js.map +1 -0
  49. package/dist/index.d.ts +22 -0
  50. package/dist/index.js +39 -0
  51. package/dist/index.js.map +1 -0
  52. package/dist/meta/CostMetaTable.d.ts +23 -0
  53. package/dist/meta/CostMetaTable.js +46 -0
  54. package/dist/meta/CostMetaTable.js.map +1 -0
  55. package/dist/meta/NamirasoftCostMetaDatabase.d.ts +13 -0
  56. package/dist/meta/NamirasoftCostMetaDatabase.js +27 -0
  57. package/dist/meta/NamirasoftCostMetaDatabase.js.map +1 -0
  58. package/dist/row/CostCreateRow.d.ts +14 -0
  59. package/dist/row/CostCreateRow.js +3 -0
  60. package/dist/row/CostCreateRow.js.map +1 -0
  61. package/dist/row/CostRow.d.ts +16 -0
  62. package/dist/row/CostRow.js +3 -0
  63. package/dist/row/CostRow.js.map +1 -0
  64. package/dist/row/EstimationRow.d.ts +5 -0
  65. package/dist/row/EstimationRow.js +3 -0
  66. package/dist/row/EstimationRow.js.map +1 -0
  67. package/dist/row/EstimationRowRow.d.ts +5 -0
  68. package/dist/row/EstimationRowRow.js +3 -0
  69. package/dist/row/EstimationRowRow.js.map +1 -0
  70. package/dist/row/PeriodRow.d.ts +4 -0
  71. package/dist/row/PeriodRow.js +3 -0
  72. package/dist/row/PeriodRow.js.map +1 -0
  73. package/logo.png +0 -0
  74. package/package.json +28 -0
  75. package/src/NamirasoftCostServer.ts +42 -0
  76. package/src/NamirasoftCostServerBase.ts +30 -0
  77. package/src/NamirasoftCostServerBillWatchAWS.ts +39 -0
  78. package/src/NamirasoftCostServerCost.ts +50 -0
  79. package/src/NamirasoftCostServerHealthz.ts +36 -0
  80. package/src/NamirasoftCostServerValue.ts +37 -0
  81. package/src/command/BillWatchAWSCommand.ts +32 -0
  82. package/src/command/BillWatchAWSEstimationCommand.ts +74 -0
  83. package/src/command/CostCommand.ts +34 -0
  84. package/src/command/CostListCommand.ts +45 -0
  85. package/src/command/Cost_CreateCommand.ts +155 -0
  86. package/src/command/HealthzCommand.ts +32 -0
  87. package/src/command/HealthzGetCommand.ts +45 -0
  88. package/src/command/ValueCommand.ts +32 -0
  89. package/src/command/ValueListCommand.ts +45 -0
  90. package/src/command/cli.ts +39 -0
  91. package/src/index.ts +42 -0
  92. package/src/meta/CostMetaTable.ts +74 -0
  93. package/src/meta/NamirasoftCostMetaDatabase.ts +51 -0
  94. package/src/row/CostCreateRow.ts +35 -0
  95. package/src/row/CostRow.ts +37 -0
  96. package/src/row/EstimationRow.ts +27 -0
  97. package/src/row/EstimationRowRow.ts +27 -0
  98. package/src/row/PeriodRow.ts +25 -0
  99. package/tsconfig.json +42 -0
@@ -0,0 +1,50 @@
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 change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { CostCreateRow } from "./row/CostCreateRow";
22
+ import { CostRow } from "./row/CostRow";
23
+ import { FilterItem } from "namirasoft-core";
24
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
25
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
26
+ import { SortItem } from "namirasoft-core";
27
+
28
+ export class NamirasoftCostServerCost extends NamirasoftCostServerBase
29
+ {
30
+ constructor(server: NamirasoftCostServer)
31
+ {
32
+ super(server);
33
+ this.List = this.List.bind(this);
34
+ this._Create = this._Create.bind(this);
35
+ }
36
+ async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[]): Promise<{ rows: CostRow[], count: number }>
37
+ {
38
+ let filters_string_value: string = FilterItem.stringify(filters);
39
+ let sorts_string_value: string = SortItem.stringify(sorts);
40
+ let path = `/cost/list`;
41
+ let { data } = await this.server._get<{ rows: CostRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value });
42
+ return data;
43
+ }
44
+ async _Create(body: CostCreateRow): Promise<CostRow>
45
+ {
46
+ let path = `/application/cost`;
47
+ let { data } = await this.server._post<CostRow>(path, {}, body);
48
+ return data;
49
+ }
50
+ };
@@ -0,0 +1,36 @@
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 change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
22
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
23
+
24
+ export class NamirasoftCostServerHealthz extends NamirasoftCostServerBase
25
+ {
26
+ constructor(server: NamirasoftCostServer)
27
+ {
28
+ super(server);
29
+ this.Get = this.Get.bind(this);
30
+ }
31
+ async Get(): Promise<void>
32
+ {
33
+ let path = `/healthz`;
34
+ await this.server._get<void>(path, {});
35
+ }
36
+ };
@@ -0,0 +1,37 @@
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 change is required, ns-sdkg command must be used */
12
+ /* */
13
+ /****************************************************************/
14
+ /****************************************************************/
15
+ /* */
16
+ /* Namira Software Corporation */
17
+ /* https://namirasoft.com */
18
+ /* */
19
+ /****************************************************************/
20
+
21
+ import { NamirasoftCostServer } from "./NamirasoftCostServer";
22
+ import { NamirasoftCostServerBase } from "./NamirasoftCostServerBase";
23
+
24
+ export class NamirasoftCostServerValue extends NamirasoftCostServerBase
25
+ {
26
+ constructor(server: NamirasoftCostServer)
27
+ {
28
+ super(server);
29
+ this.List = this.List.bind(this);
30
+ }
31
+ async List(table: string, column: string, search: (string | null), field_id: (string | null), limit: (number | null)): Promise<string[]>
32
+ {
33
+ let path = `/value/list/${table}/${column}`;
34
+ let { data } = await this.server._get<string[]>(path, { search, field_id, limit });
35
+ return data;
36
+ }
37
+ };
@@ -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 change is required, 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 { BillWatchAWSEstimationCommand } from "./BillWatchAWSEstimationCommand";
23
+
24
+ export class BillWatchAWSCommand extends BaseNavigatorCommand
25
+ {
26
+ constructor(argv: string[])
27
+ {
28
+ super(argv, {
29
+ "estimation": BillWatchAWSEstimationCommand,
30
+ });
31
+ }
32
+ };
@@ -0,0 +1,74 @@
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 change is required, 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 { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class BillWatchAWSEstimationCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "first_watch_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_watch_created_at' in body",
35
+ optional: false,
36
+ args: ["first_watch_created_at"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "period",
41
+ short: "",
42
+ description: "Provides the value of 'period' in body",
43
+ optional: false,
44
+ args: ["period"],
45
+ defaults: [""]
46
+ },
47
+ {
48
+ name: "regions",
49
+ short: "",
50
+ description: "Provides the value of 'regions' in body",
51
+ optional: false,
52
+ args: ["regions"],
53
+ defaults: [""]
54
+ }
55
+ ]);
56
+ }
57
+ override async exec()
58
+ {
59
+ let token = this.app.storage.getNSAToken();
60
+ if (token == null)
61
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
62
+ let storage = new IStorageMemoryDedicated();
63
+ let manager = new TokenManager(storage, () => { });
64
+ manager.setValue(token, false);
65
+ let url = this.app.storage.getItem("ns-cost-server-url");
66
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
67
+ let ans = await server.bill_watch_a_w_s.Estimation({
68
+ first_watch_created_at: this.option_values.first_watch_created_at,
69
+ period: this.option_values.period,
70
+ regions: this.option_values.regions
71
+ });
72
+ this.app.logger.success(JSON.stringify(ans));
73
+ }
74
+ };
@@ -0,0 +1,34 @@
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 change is required, 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 { CostListCommand } from "./CostListCommand";
23
+ import { Cost_CreateCommand } from "./Cost_CreateCommand";
24
+
25
+ export class CostCommand extends BaseNavigatorCommand
26
+ {
27
+ constructor(argv: string[])
28
+ {
29
+ super(argv, {
30
+ "list": CostListCommand,
31
+ "_create": Cost_CreateCommand,
32
+ });
33
+ }
34
+ };
@@ -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 change is required, 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 { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class CostListCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, ["filters", "page", "size", "sorts"], []);
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-cost account config \nor \nns-cost account login.");
37
+ let storage = new IStorageMemoryDedicated();
38
+ let manager = new TokenManager(storage, () => { });
39
+ manager.setValue(token, false);
40
+ let url = this.app.storage.getItem("ns-cost-server-url");
41
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.cost.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -0,0 +1,155 @@
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 change is required, 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 { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class Cost_CreateCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "user_id",
33
+ short: "",
34
+ description: "Provides the value of 'user_id' in body",
35
+ optional: false,
36
+ args: ["user_id"],
37
+ defaults: [""]
38
+ },
39
+ {
40
+ name: "workspace_id",
41
+ short: "",
42
+ description: "Provides the value of 'workspace_id' in body",
43
+ optional: false,
44
+ args: ["workspace_id"],
45
+ defaults: [""]
46
+ },
47
+ {
48
+ name: "product_id",
49
+ short: "",
50
+ description: "Provides the value of 'product_id' in body",
51
+ optional: false,
52
+ args: ["product_id"],
53
+ defaults: [""]
54
+ },
55
+ {
56
+ name: "resource_entity",
57
+ short: "",
58
+ description: "Provides the value of 'resource_entity' in body",
59
+ optional: false,
60
+ args: ["resource_entity"],
61
+ defaults: [""]
62
+ },
63
+ {
64
+ name: "resource_id",
65
+ short: "",
66
+ description: "Provides the value of 'resource_id' in body",
67
+ optional: false,
68
+ args: ["resource_id"],
69
+ defaults: [""]
70
+ },
71
+ {
72
+ name: "usage_name",
73
+ short: "",
74
+ description: "Provides the value of 'usage_name' in body",
75
+ optional: false,
76
+ args: ["usage_name"],
77
+ defaults: [""]
78
+ },
79
+ {
80
+ name: "usage_value",
81
+ short: "",
82
+ description: "Provides the value of 'usage_value' in body",
83
+ optional: false,
84
+ args: ["usage_value"],
85
+ defaults: [""]
86
+ },
87
+ {
88
+ name: "usage_unit",
89
+ short: "",
90
+ description: "Provides the value of 'usage_unit' in body",
91
+ optional: false,
92
+ args: ["usage_unit"],
93
+ defaults: [""]
94
+ },
95
+ {
96
+ name: "period_start",
97
+ short: "",
98
+ description: "Provides the value of 'period_start' in body",
99
+ optional: false,
100
+ args: ["period_start"],
101
+ defaults: [""]
102
+ },
103
+ {
104
+ name: "period_end",
105
+ short: "",
106
+ description: "Provides the value of 'period_end' in body",
107
+ optional: false,
108
+ args: ["period_end"],
109
+ defaults: [""]
110
+ },
111
+ {
112
+ name: "amount",
113
+ short: "",
114
+ description: "Provides the value of 'amount' in body",
115
+ optional: false,
116
+ args: ["amount"],
117
+ defaults: [""]
118
+ },
119
+ {
120
+ name: "currency",
121
+ short: "",
122
+ description: "Provides the value of 'currency' in body",
123
+ optional: false,
124
+ args: ["currency"],
125
+ defaults: [""]
126
+ }
127
+ ]);
128
+ }
129
+ override async exec()
130
+ {
131
+ let token = this.app.storage.getNSAToken();
132
+ if (token == null)
133
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
134
+ let storage = new IStorageMemoryDedicated();
135
+ let manager = new TokenManager(storage, () => { });
136
+ manager.setValue(token, false);
137
+ let url = this.app.storage.getItem("ns-cost-server-url");
138
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
139
+ let ans = await server.cost._Create({
140
+ user_id: this.option_values.user_id,
141
+ workspace_id: this.option_values.workspace_id,
142
+ product_id: this.option_values.product_id,
143
+ resource_entity: this.option_values.resource_entity,
144
+ resource_id: this.option_values.resource_id,
145
+ usage_name: this.option_values.usage_name,
146
+ usage_value: this.option_values.usage_value,
147
+ usage_unit: this.option_values.usage_unit,
148
+ period_start: this.option_values.period_start,
149
+ period_end: this.option_values.period_end,
150
+ amount: this.option_values.amount,
151
+ currency: this.option_values.currency
152
+ });
153
+ this.app.logger.success(JSON.stringify(ans));
154
+ }
155
+ };
@@ -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 change is required, 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,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 change is required, 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 { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
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-cost account config \nor \nns-cost account login.");
37
+ let storage = new IStorageMemoryDedicated();
38
+ let manager = new TokenManager(storage, () => { });
39
+ manager.setValue(token, false);
40
+ let url = this.app.storage.getItem("ns-cost-server-url");
41
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.healthz.Get();
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -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 change is required, 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,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 change is required, 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 { IStorageMemoryDedicated } from "namirasoft-core";
23
+ import { NamirasoftCostServer } from "../NamirasoftCostServer";
24
+ import { TokenManager } from "namirasoft-account";
25
+
26
+ export class ValueListCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, ["table", "column", "search", "field_id", "limit"], []);
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-cost account config \nor \nns-cost account login.");
37
+ let storage = new IStorageMemoryDedicated();
38
+ let manager = new TokenManager(storage, () => { });
39
+ manager.setValue(token, false);
40
+ let url = this.app.storage.getItem("ns-cost-server-url");
41
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.value.List(this.arg_values[0], this.arg_values[1], this.arg_values[2], this.arg_values[3], this.arg_values[4]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };