namirasoft-cost 1.4.9 → 1.4.11

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 (87) hide show
  1. package/dist/NamirasoftCostServer.d.ts +8 -2
  2. package/dist/NamirasoftCostServer.js +9 -3
  3. package/dist/NamirasoftCostServer.js.map +1 -1
  4. package/dist/NamirasoftCostServerBillWatchAWS.d.ts +2 -2
  5. package/dist/NamirasoftCostServerBillWatchAWS.js.map +1 -1
  6. package/dist/NamirasoftCostServerBillWatchAzure.d.ts +2 -2
  7. package/dist/NamirasoftCostServerBillWatchAzure.js.map +1 -1
  8. package/dist/NamirasoftCostServerBillWatchGCP.d.ts +2 -2
  9. package/dist/NamirasoftCostServerBillWatchGCP.js.map +1 -1
  10. package/dist/NamirasoftCostServerFieldCategory.d.ts +20 -0
  11. package/dist/NamirasoftCostServerFieldCategory.js +37 -0
  12. package/dist/NamirasoftCostServerFieldCategory.js.map +1 -0
  13. package/dist/NamirasoftCostServerFieldField.d.ts +20 -0
  14. package/dist/NamirasoftCostServerFieldField.js +37 -0
  15. package/dist/NamirasoftCostServerFieldField.js.map +1 -0
  16. package/dist/NamirasoftCostServerMetrics.d.ts +6 -0
  17. package/dist/NamirasoftCostServerMetrics.js +28 -0
  18. package/dist/NamirasoftCostServerMetrics.js.map +1 -0
  19. package/dist/command/BillWatchAWSEstimationCommand.js +5 -5
  20. package/dist/command/BillWatchAWSEstimationCommand.js.map +1 -1
  21. package/dist/command/BillWatchAWS_CreateForCommand.js +5 -5
  22. package/dist/command/BillWatchAWS_CreateForCommand.js.map +1 -1
  23. package/dist/command/BillWatchAzureEstimationCommand.js +4 -4
  24. package/dist/command/BillWatchAzureEstimationCommand.js.map +1 -1
  25. package/dist/command/BillWatchAzure_CreateForCommand.js +4 -4
  26. package/dist/command/BillWatchAzure_CreateForCommand.js.map +1 -1
  27. package/dist/command/BillWatchGCPEstimationCommand.js +5 -5
  28. package/dist/command/BillWatchGCPEstimationCommand.js.map +1 -1
  29. package/dist/command/BillWatchGCP_CreateForCommand.js +5 -5
  30. package/dist/command/BillWatchGCP_CreateForCommand.js.map +1 -1
  31. package/dist/command/FieldCategoryCommand.d.ts +4 -0
  32. package/dist/command/FieldCategoryCommand.js +17 -0
  33. package/dist/command/FieldCategoryCommand.js.map +1 -0
  34. package/dist/command/FieldCategoryEstimationCommand.d.ts +5 -0
  35. package/dist/command/FieldCategoryEstimationCommand.js +67 -0
  36. package/dist/command/FieldCategoryEstimationCommand.js.map +1 -0
  37. package/dist/command/FieldCategory_CreateForCommand.d.ts +5 -0
  38. package/dist/command/FieldCategory_CreateForCommand.js +85 -0
  39. package/dist/command/FieldCategory_CreateForCommand.js.map +1 -0
  40. package/dist/command/FieldFieldCommand.d.ts +4 -0
  41. package/dist/command/FieldFieldCommand.js +17 -0
  42. package/dist/command/FieldFieldCommand.js.map +1 -0
  43. package/dist/command/FieldFieldEstimationCommand.d.ts +5 -0
  44. package/dist/command/FieldFieldEstimationCommand.js +67 -0
  45. package/dist/command/FieldFieldEstimationCommand.js.map +1 -0
  46. package/dist/command/FieldField_CreateForCommand.d.ts +5 -0
  47. package/dist/command/FieldField_CreateForCommand.js +85 -0
  48. package/dist/command/FieldField_CreateForCommand.js.map +1 -0
  49. package/dist/command/MetricsCommand.d.ts +4 -0
  50. package/dist/command/MetricsCommand.js +15 -0
  51. package/dist/command/MetricsCommand.js.map +1 -0
  52. package/dist/command/MetricsGetCommand.d.ts +5 -0
  53. package/dist/command/MetricsGetCommand.js +38 -0
  54. package/dist/command/MetricsGetCommand.js.map +1 -0
  55. package/dist/command/cli.js +6 -0
  56. package/dist/command/cli.js.map +1 -1
  57. package/dist/index.d.ts +11 -0
  58. package/dist/index.js +11 -0
  59. package/dist/index.js.map +1 -1
  60. package/dist/meta/NamirasoftCostMetaDatabase.js +1 -1
  61. package/dist/meta/NamirasoftCostMetaDatabase.js.map +1 -1
  62. package/logo.png +0 -0
  63. package/package.json +4 -4
  64. package/src/NamirasoftCostServer.ts +14 -5
  65. package/src/NamirasoftCostServerBillWatchAWS.ts +2 -2
  66. package/src/NamirasoftCostServerBillWatchAzure.ts +2 -2
  67. package/src/NamirasoftCostServerBillWatchGCP.ts +2 -2
  68. package/src/NamirasoftCostServerFieldCategory.ts +47 -0
  69. package/src/NamirasoftCostServerFieldField.ts +47 -0
  70. package/src/NamirasoftCostServerMetrics.ts +36 -0
  71. package/src/command/BillWatchAWSEstimationCommand.ts +5 -5
  72. package/src/command/BillWatchAWS_CreateForCommand.ts +5 -5
  73. package/src/command/BillWatchAzureEstimationCommand.ts +4 -4
  74. package/src/command/BillWatchAzure_CreateForCommand.ts +4 -4
  75. package/src/command/BillWatchGCPEstimationCommand.ts +5 -5
  76. package/src/command/BillWatchGCP_CreateForCommand.ts +5 -5
  77. package/src/command/FieldCategoryCommand.ts +34 -0
  78. package/src/command/FieldCategoryEstimationCommand.ts +74 -0
  79. package/src/command/FieldCategory_CreateForCommand.ts +92 -0
  80. package/src/command/FieldFieldCommand.ts +34 -0
  81. package/src/command/FieldFieldEstimationCommand.ts +74 -0
  82. package/src/command/FieldField_CreateForCommand.ts +92 -0
  83. package/src/command/MetricsCommand.ts +32 -0
  84. package/src/command/MetricsGetCommand.ts +45 -0
  85. package/src/command/cli.ts +6 -0
  86. package/src/index.ts +11 -0
  87. package/src/meta/NamirasoftCostMetaDatabase.ts +1 -1
@@ -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 FieldFieldEstimationCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, [], [
31
+ {
32
+ name: "first_entity_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_entity_created_at' in body",
35
+ optional: true,
36
+ args: ["first_entity_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: "active",
49
+ short: "",
50
+ description: "Provides the value of 'active' in body",
51
+ optional: false,
52
+ args: ["active"],
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.field_field.Estimation({
68
+ first_entity_created_at: this.option_values.first_entity_created_at,
69
+ period: this.option_values.period,
70
+ active: this.option_values.active
71
+ });
72
+ this.app.logger.success(JSON.stringify(ans));
73
+ }
74
+ };
@@ -0,0 +1,92 @@
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 FieldField_CreateForCommand extends BaseFinalCommand
27
+ {
28
+ constructor(argv: string[])
29
+ {
30
+ super(argv, ["user_id"], [
31
+ {
32
+ name: "first_entity_created_at",
33
+ short: "",
34
+ description: "Provides the value of 'first_entity_created_at' in body",
35
+ optional: true,
36
+ args: ["first_entity_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: "active",
49
+ short: "",
50
+ description: "Provides the value of 'active' in body",
51
+ optional: false,
52
+ args: ["active"],
53
+ defaults: [""]
54
+ },
55
+ {
56
+ name: "workspace_id",
57
+ short: "",
58
+ description: "Provides the value of 'workspace_id' in body",
59
+ optional: false,
60
+ args: ["workspace_id"],
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
+ }
73
+ override async exec()
74
+ {
75
+ let token = this.app.storage.getNSAToken();
76
+ if (token == null)
77
+ throw new Error("Token is not available. Please login first using:\nns-cost account config \nor \nns-cost account login.");
78
+ let storage = new IStorageMemoryDedicated();
79
+ let manager = new TokenManager(storage, () => { });
80
+ manager.setValue(token, false);
81
+ let url = this.app.storage.getItem("ns-cost-server-url");
82
+ let server = new NamirasoftCostServer(url, manager, e => this.app.logger.error(e.message));
83
+ let ans = await server.field_field._CreateFor(this.arg_values[0], {
84
+ first_entity_created_at: this.option_values.first_entity_created_at,
85
+ period: this.option_values.period,
86
+ active: this.option_values.active,
87
+ workspace_id: this.option_values.workspace_id,
88
+ resource_id: this.option_values.resource_id
89
+ });
90
+ this.app.logger.success(JSON.stringify(ans));
91
+ }
92
+ };
@@ -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 { MetricsGetCommand } from "./MetricsGetCommand";
23
+
24
+ export class MetricsCommand extends BaseNavigatorCommand
25
+ {
26
+ constructor(argv: string[])
27
+ {
28
+ super(argv, {
29
+ "get": MetricsGetCommand,
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 MetricsGetCommand 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.metrics.Get();
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -26,16 +26,22 @@ import { BillWatchAzureCommand } from "./BillWatchAzureCommand";
26
26
  import { BillWatchGCPCommand } from "./BillWatchGCPCommand";
27
27
  import { ConfigCommand } from "namirasoft-node-cli";
28
28
  import { CostCommand } from "./CostCommand";
29
+ import { FieldCategoryCommand } from "./FieldCategoryCommand";
30
+ import { FieldFieldCommand } from "./FieldFieldCommand";
29
31
  import { HealthzCommand } from "./HealthzCommand";
32
+ import { MetricsCommand } from "./MetricsCommand";
30
33
  import { ValueCommand } from "./ValueCommand";
31
34
 
32
35
  let app = new Application("ns-cost", new BaseStorage(),
33
36
  {
34
37
  "healthz": HealthzCommand,
38
+ "metrics": MetricsCommand,
35
39
  "value": ValueCommand,
36
40
  "billwatchaws": BillWatchAWSCommand,
37
41
  "billwatchazure": BillWatchAzureCommand,
38
42
  "billwatchgcp": BillWatchGCPCommand,
43
+ "fieldcategory": FieldCategoryCommand,
44
+ "fieldfield": FieldFieldCommand,
39
45
  "cost": CostCommand,
40
46
  "account": AccountCommand,
41
47
  "config": (argv: string[]) => new ConfigCommand(argv, ["ns-cost-server-url"])
package/src/index.ts CHANGED
@@ -24,7 +24,10 @@ export * from "./NamirasoftCostServerBillWatchAWS";
24
24
  export * from "./NamirasoftCostServerBillWatchAzure";
25
25
  export * from "./NamirasoftCostServerBillWatchGCP";
26
26
  export * from "./NamirasoftCostServerCost";
27
+ export * from "./NamirasoftCostServerFieldCategory";
28
+ export * from "./NamirasoftCostServerFieldField";
27
29
  export * from "./NamirasoftCostServerHealthz";
30
+ export * from "./NamirasoftCostServerMetrics";
28
31
  export * from "./NamirasoftCostServerValue";
29
32
  export * from "./TimeUtil";
30
33
  export * from "./command/BillWatchAWSCommand";
@@ -39,8 +42,16 @@ export * from "./command/BillWatchGCP_CreateForCommand";
39
42
  export * from "./command/CostCommand";
40
43
  export * from "./command/CostListCommand";
41
44
  export * from "./command/Cost_CreateForCommand";
45
+ export * from "./command/FieldCategoryCommand";
46
+ export * from "./command/FieldCategoryEstimationCommand";
47
+ export * from "./command/FieldCategory_CreateForCommand";
48
+ export * from "./command/FieldFieldCommand";
49
+ export * from "./command/FieldFieldEstimationCommand";
50
+ export * from "./command/FieldField_CreateForCommand";
42
51
  export * from "./command/HealthzCommand";
43
52
  export * from "./command/HealthzGetCommand";
53
+ export * from "./command/MetricsCommand";
54
+ export * from "./command/MetricsGetCommand";
44
55
  export * from "./command/ValueCommand";
45
56
  export * from "./command/ValueListCommand";
46
57
  export * from "./enum/TrialUnit";
@@ -33,7 +33,7 @@ export class NamirasoftCostMetaDatabase extends NSBaseMetaDatabase<NamirasoftCos
33
33
  };
34
34
  constructor(manager?: TokenManager, onError?: (error: Error) => void)
35
35
  {
36
- super({ id: "prd-bd9199b941c445bf", name: "Namirasoft Cost", headline: "", description: "", logo: "https://static.namirasoft.com/image/namirasoft/cost/logo/base.png", link: "https://cost.namirasoft.com" });
36
+ super({ id: "prd-bd9199b941c445bf", name: "Namirasoft Cost", headline: "", description: "Namirasoft Cost displays detailed records of charges from all Namirasoft Pay-as-You-Go services. Users can view the date, amount, and reason for each charge.", logo: "https://static.namirasoft.com/image/namirasoft/cost/logo/base.png", link: "https://cost.namirasoft.com" });
37
37
  this.manager = manager;
38
38
  this.onError = onError;
39
39
  this.tables = {