namirasoft-log 1.3.6 → 1.3.7

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 (104) hide show
  1. package/.ns-sdkg-dir-deep +1 -0
  2. package/.ns-sdkg-dir-keep +0 -0
  3. package/.ns-sdkg-file-keep +12 -0
  4. package/dist/NamirasoftLogServer.d.ts +9 -0
  5. package/dist/NamirasoftLogServer.js +10 -0
  6. package/dist/NamirasoftLogServer.js.map +1 -1
  7. package/dist/NamirasoftLogServerBase.d.ts +5 -0
  8. package/dist/NamirasoftLogServerBase.js +12 -0
  9. package/dist/NamirasoftLogServerBase.js.map +1 -0
  10. package/dist/NamirasoftLogServerHealthz.d.ts +4 -0
  11. package/dist/NamirasoftLogServerHealthz.js +25 -0
  12. package/dist/NamirasoftLogServerHealthz.js.map +1 -0
  13. package/dist/NamirasoftLogServerLog.d.ts +8 -0
  14. package/dist/NamirasoftLogServerLog.js +39 -0
  15. package/dist/NamirasoftLogServerLog.js.map +1 -0
  16. package/dist/NamirasoftLogServerLogGroup.d.ts +10 -0
  17. package/dist/NamirasoftLogServerLogGroup.js +53 -0
  18. package/dist/NamirasoftLogServerLogGroup.js.map +1 -0
  19. package/dist/command/HealthzCommand.d.ts +4 -0
  20. package/dist/command/HealthzCommand.js +15 -0
  21. package/dist/command/HealthzCommand.js.map +1 -0
  22. package/dist/command/HealthzGetCommand.d.ts +5 -0
  23. package/dist/command/HealthzGetCommand.js +37 -0
  24. package/dist/command/HealthzGetCommand.js.map +1 -0
  25. package/dist/command/LogCommand.d.ts +4 -0
  26. package/dist/command/LogCommand.js +19 -0
  27. package/dist/command/LogCommand.js.map +1 -0
  28. package/dist/command/LogCreateCommand.d.ts +5 -0
  29. package/dist/command/LogCreateCommand.js +129 -0
  30. package/dist/command/LogCreateCommand.js.map +1 -0
  31. package/dist/command/LogGetAllCommand.d.ts +5 -0
  32. package/dist/command/LogGetAllCommand.js +37 -0
  33. package/dist/command/LogGetAllCommand.js.map +1 -0
  34. package/dist/command/LogGetCommand.d.ts +5 -0
  35. package/dist/command/LogGetCommand.js +37 -0
  36. package/dist/command/LogGetCommand.js.map +1 -0
  37. package/dist/command/LogGroupCommand.d.ts +4 -0
  38. package/dist/command/LogGroupCommand.js +23 -0
  39. package/dist/command/LogGroupCommand.js.map +1 -0
  40. package/dist/command/LogGroupCreateCommand.d.ts +5 -0
  41. package/dist/command/LogGroupCreateCommand.js +57 -0
  42. package/dist/command/LogGroupCreateCommand.js.map +1 -0
  43. package/dist/command/LogGroupDeleteCommand.d.ts +5 -0
  44. package/dist/command/LogGroupDeleteCommand.js +37 -0
  45. package/dist/command/LogGroupDeleteCommand.js.map +1 -0
  46. package/dist/command/LogGroupGetAllCommand.d.ts +5 -0
  47. package/dist/command/LogGroupGetAllCommand.js +37 -0
  48. package/dist/command/LogGroupGetAllCommand.js.map +1 -0
  49. package/dist/command/LogGroupGetCommand.d.ts +5 -0
  50. package/dist/command/LogGroupGetCommand.js +37 -0
  51. package/dist/command/LogGroupGetCommand.js.map +1 -0
  52. package/dist/command/LogGroupUpdateCommand.d.ts +5 -0
  53. package/dist/command/LogGroupUpdateCommand.js +57 -0
  54. package/dist/command/LogGroupUpdateCommand.js.map +1 -0
  55. package/dist/command/cli.d.ts +2 -0
  56. package/dist/command/cli.js +16 -0
  57. package/dist/command/cli.js.map +1 -0
  58. package/dist/index.d.ts +23 -1
  59. package/dist/index.js +23 -1
  60. package/dist/index.js.map +1 -1
  61. package/dist/row/LogRow.d.ts +3 -0
  62. package/dist/row/LogRow.js +3 -0
  63. package/dist/row/LogRow.js.map +1 -0
  64. package/dist/row/LogRowInput.d.ts +12 -0
  65. package/dist/row/LogRowInput.js +3 -0
  66. package/dist/row/LogRowInput.js.map +1 -0
  67. package/dist/row/LogRowOutput.d.ts +1 -0
  68. package/dist/row/LogRowOutput.js +3 -0
  69. package/dist/row/LogRowOutput.js.map +1 -0
  70. package/dist/row/LoggroupRow.d.ts +3 -0
  71. package/dist/row/LoggroupRow.js +3 -0
  72. package/dist/row/LoggroupRow.js.map +1 -0
  73. package/dist/row/LoggroupRowInput.d.ts +4 -0
  74. package/dist/row/LoggroupRowInput.js +3 -0
  75. package/dist/row/LoggroupRowInput.js.map +1 -0
  76. package/dist/row/LoggroupRowOutput.d.ts +4 -0
  77. package/dist/row/LoggroupRowOutput.js +3 -0
  78. package/dist/row/LoggroupRowOutput.js.map +1 -0
  79. package/package.json +10 -6
  80. package/src/NamirasoftLogServer.ts +39 -2
  81. package/src/NamirasoftLogServerBase.ts +31 -0
  82. package/src/NamirasoftLogServerHealthz.ts +32 -0
  83. package/src/NamirasoftLogServerLog.ts +46 -0
  84. package/src/NamirasoftLogServerLogGroup.ts +58 -0
  85. package/src/command/HealthzCommand.ts +33 -0
  86. package/src/command/HealthzGetCommand.ts +45 -0
  87. package/src/command/LogCommand.ts +37 -0
  88. package/src/command/LogCreateCommand.ts +137 -0
  89. package/src/command/LogGetAllCommand.ts +45 -0
  90. package/src/command/LogGetCommand.ts +45 -0
  91. package/src/command/LogGroupCommand.ts +41 -0
  92. package/src/command/LogGroupCreateCommand.ts +65 -0
  93. package/src/command/LogGroupDeleteCommand.ts +45 -0
  94. package/src/command/LogGroupGetAllCommand.ts +45 -0
  95. package/src/command/LogGroupGetCommand.ts +45 -0
  96. package/src/command/LogGroupUpdateCommand.ts +65 -0
  97. package/src/command/cli.ts +35 -0
  98. package/src/index.ts +45 -2
  99. package/src/row/LogRow.ts +25 -0
  100. package/src/row/LogRowInput.ts +34 -0
  101. package/src/row/LogRowOutput.ts +24 -0
  102. package/src/row/LoggroupRow.ts +25 -0
  103. package/src/row/LoggroupRowInput.ts +26 -0
  104. package/src/row/LoggroupRowOutput.ts +26 -0
@@ -0,0 +1,46 @@
1
+
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 { LogRow } from "./row/LogRow";
23
+ import { LogRowInput } from "./row/LogRowInput";
24
+ import { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
25
+
26
+ export class NamirasoftLogServerLog extends NamirasoftLogServerBase
27
+ {
28
+ async GetAll(product_id: (number | null), project_id: (number | null), search: (number | null)): Promise<LogRow[]>
29
+ {
30
+ let path = `/log/all`;
31
+ let { data } = await this._get<LogRow[]>(path, { product_id, project_id, search });
32
+ return data;
33
+ }
34
+ async Get(id: number): Promise<LogRow>
35
+ {
36
+ let path = `/log/${id}`;
37
+ let { data } = await this._get<LogRow>(path, {});
38
+ return data;
39
+ }
40
+ async Create(body: LogRowInput): Promise<LogRow>
41
+ {
42
+ let path = `/log`;
43
+ let { data } = await this._post<LogRow>(path, {}, body);
44
+ return data;
45
+ }
46
+ };
@@ -0,0 +1,58 @@
1
+
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 { LoggroupRow } from "./row/LoggroupRow";
23
+ import { LoggroupRowInput } from "./row/LoggroupRowInput";
24
+ import { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
25
+
26
+ export class NamirasoftLogServerLogGroup extends NamirasoftLogServerBase
27
+ {
28
+ async GetAll(project_id: (number | null), search: (number | null)): Promise<LoggroupRow>
29
+ {
30
+ let path = `/log_group/all`;
31
+ let { data } = await this._get<LoggroupRow>(path, { project_id, search });
32
+ return data;
33
+ }
34
+ async Get(id: number): Promise<LoggroupRow>
35
+ {
36
+ let path = `/log_group/${id}`;
37
+ let { data } = await this._get<LoggroupRow>(path, {});
38
+ return data;
39
+ }
40
+ async Create(body: LoggroupRowInput): Promise<LoggroupRow>
41
+ {
42
+ let path = `/log_group`;
43
+ let { data } = await this._post<LoggroupRow>(path, {}, body);
44
+ return data;
45
+ }
46
+ async Update(id: number, body: LoggroupRowInput): Promise<LoggroupRow>
47
+ {
48
+ let path = `/log_group/${id}`;
49
+ let { data } = await this._put<LoggroupRow>(path, {}, body);
50
+ return data;
51
+ }
52
+ async Delete(id: number): Promise<void>
53
+ {
54
+ let path = `/log_group/${id}`;
55
+ let { data } = await this._delete<void>(path, {});
56
+ return data;
57
+ }
58
+ };
@@ -0,0 +1,33 @@
1
+
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 { BaseNavigatorCommand } from "namirasoft-node-cli";
23
+ import { HealthzGetCommand } from "./HealthzGetCommand";
24
+
25
+ export class HealthzCommand extends BaseNavigatorCommand
26
+ {
27
+ constructor(argv: string[])
28
+ {
29
+ super(argv, {
30
+ "get": HealthzGetCommand,
31
+ });
32
+ }
33
+ };
@@ -0,0 +1,45 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class HealthzGetCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, [], []);
32
+ }
33
+ override async exec()
34
+ {
35
+ let token = this.app.storage.getNSAToken();
36
+ if (token == null)
37
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
38
+ let storage = new IStorageMemory();
39
+ let manager = new TokenManager(storage, () => { });
40
+ manager.setValue(token, false);
41
+ let server = new NamirasoftLogServer(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,37 @@
1
+
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 { BaseNavigatorCommand } from "namirasoft-node-cli";
23
+ import { LogCreateCommand } from "./LogCreateCommand";
24
+ import { LogGetAllCommand } from "./LogGetAllCommand";
25
+ import { LogGetCommand } from "./LogGetCommand";
26
+
27
+ export class LogCommand extends BaseNavigatorCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, {
32
+ "getall": LogGetAllCommand,
33
+ "get": LogGetCommand,
34
+ "create": LogCreateCommand,
35
+ });
36
+ }
37
+ };
@@ -0,0 +1,137 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogCreateCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, [], [
32
+ {
33
+ name: "id",
34
+ short: "",
35
+ description: "Provides the value of 'id' in body",
36
+ optional: true,
37
+ args: ["id"],
38
+ defaults: [""]
39
+ },
40
+ {
41
+ name: "user_id",
42
+ short: "",
43
+ description: "Provides the value of 'user_id' in body",
44
+ optional: true,
45
+ args: ["user_id"],
46
+ defaults: [""]
47
+ },
48
+ {
49
+ name: "product_id",
50
+ short: "",
51
+ description: "Provides the value of 'product_id' in body",
52
+ optional: true,
53
+ args: ["product_id"],
54
+ defaults: [""]
55
+ },
56
+ {
57
+ name: "project_id",
58
+ short: "",
59
+ description: "Provides the value of 'project_id' in body",
60
+ optional: true,
61
+ args: ["project_id"],
62
+ defaults: [""]
63
+ },
64
+ {
65
+ name: "log_group_id",
66
+ short: "",
67
+ description: "Provides the value of 'log_group_id' in body",
68
+ optional: true,
69
+ args: ["log_group_id"],
70
+ defaults: [""]
71
+ },
72
+ {
73
+ name: "level",
74
+ short: "",
75
+ description: "Provides the value of 'level' in body",
76
+ optional: true,
77
+ args: ["level"],
78
+ defaults: [""]
79
+ },
80
+ {
81
+ name: "message",
82
+ short: "",
83
+ description: "Provides the value of 'message' in body",
84
+ optional: true,
85
+ args: ["message"],
86
+ defaults: [""]
87
+ },
88
+ {
89
+ name: "stack",
90
+ short: "",
91
+ description: "Provides the value of 'stack' in body",
92
+ optional: true,
93
+ args: ["stack"],
94
+ defaults: [""]
95
+ },
96
+ {
97
+ name: "sent",
98
+ short: "",
99
+ description: "Provides the value of 'sent' in body",
100
+ optional: true,
101
+ args: ["sent"],
102
+ defaults: [""]
103
+ },
104
+ {
105
+ name: "result",
106
+ short: "",
107
+ description: "Provides the value of 'result' in body",
108
+ optional: true,
109
+ args: ["result"],
110
+ defaults: [""]
111
+ }
112
+ ]);
113
+ }
114
+ override async exec()
115
+ {
116
+ let token = this.app.storage.getNSAToken();
117
+ if (token == null)
118
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
119
+ let storage = new IStorageMemory();
120
+ let manager = new TokenManager(storage, () => { });
121
+ manager.setValue(token, false);
122
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
123
+ let ans = await server.log.Create({
124
+ id: this.option_values.id,
125
+ user_id: this.option_values.user_id,
126
+ product_id: this.option_values.product_id,
127
+ project_id: this.option_values.project_id,
128
+ log_group_id: this.option_values.log_group_id,
129
+ level: this.option_values.level,
130
+ message: this.option_values.message,
131
+ stack: this.option_values.stack,
132
+ sent: this.option_values.sent,
133
+ result: this.option_values.result
134
+ });
135
+ this.app.logger.success(JSON.stringify(ans));
136
+ }
137
+ };
@@ -0,0 +1,45 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogGetAllCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, ["product_id", "project_id", "search"], []);
32
+ }
33
+ override async exec()
34
+ {
35
+ let token = this.app.storage.getNSAToken();
36
+ if (token == null)
37
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
38
+ let storage = new IStorageMemory();
39
+ let manager = new TokenManager(storage, () => { });
40
+ manager.setValue(token, false);
41
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.log.GetAll(this.arg_values[0], this.arg_values[1], this.arg_values[2]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -0,0 +1,45 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogGetCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, ["id"], []);
32
+ }
33
+ override async exec()
34
+ {
35
+ let token = this.app.storage.getNSAToken();
36
+ if (token == null)
37
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
38
+ let storage = new IStorageMemory();
39
+ let manager = new TokenManager(storage, () => { });
40
+ manager.setValue(token, false);
41
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.log.Get(this.arg_values[0]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -0,0 +1,41 @@
1
+
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 { BaseNavigatorCommand } from "namirasoft-node-cli";
23
+ import { LogGroupCreateCommand } from "./LogGroupCreateCommand";
24
+ import { LogGroupDeleteCommand } from "./LogGroupDeleteCommand";
25
+ import { LogGroupGetAllCommand } from "./LogGroupGetAllCommand";
26
+ import { LogGroupGetCommand } from "./LogGroupGetCommand";
27
+ import { LogGroupUpdateCommand } from "./LogGroupUpdateCommand";
28
+
29
+ export class LogGroupCommand extends BaseNavigatorCommand
30
+ {
31
+ constructor(argv: string[])
32
+ {
33
+ super(argv, {
34
+ "getall": LogGroupGetAllCommand,
35
+ "get": LogGroupGetCommand,
36
+ "create": LogGroupCreateCommand,
37
+ "update": LogGroupUpdateCommand,
38
+ "delete": LogGroupDeleteCommand,
39
+ });
40
+ }
41
+ };
@@ -0,0 +1,65 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogGroupCreateCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, [], [
32
+ {
33
+ name: "project_id",
34
+ short: "",
35
+ description: "Provides the value of 'project_id' in body",
36
+ optional: false,
37
+ args: ["project_id"],
38
+ defaults: [""]
39
+ },
40
+ {
41
+ name: "name",
42
+ short: "",
43
+ description: "Provides the value of 'name' in body",
44
+ optional: false,
45
+ args: ["name"],
46
+ defaults: [""]
47
+ }
48
+ ]);
49
+ }
50
+ override async exec()
51
+ {
52
+ let token = this.app.storage.getNSAToken();
53
+ if (token == null)
54
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
55
+ let storage = new IStorageMemory();
56
+ let manager = new TokenManager(storage, () => { });
57
+ manager.setValue(token, false);
58
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
59
+ let ans = await server.loggroup.Create({
60
+ project_id: this.option_values.project_id,
61
+ name: this.option_values.name
62
+ });
63
+ this.app.logger.success(JSON.stringify(ans));
64
+ }
65
+ };
@@ -0,0 +1,45 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogGroupDeleteCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, ["id"], []);
32
+ }
33
+ override async exec()
34
+ {
35
+ let token = this.app.storage.getNSAToken();
36
+ if (token == null)
37
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
38
+ let storage = new IStorageMemory();
39
+ let manager = new TokenManager(storage, () => { });
40
+ manager.setValue(token, false);
41
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.loggroup.Delete(this.arg_values[0]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };
@@ -0,0 +1,45 @@
1
+
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 { BaseFinalCommand } from "namirasoft-node-cli";
23
+ import { IStorageMemory } from "namirasoft-core";
24
+ import { NamirasoftLogServer } from "../NamirasoftLogServer";
25
+ import { TokenManager } from "namirasoft-account";
26
+
27
+ export class LogGroupGetAllCommand extends BaseFinalCommand
28
+ {
29
+ constructor(argv: string[])
30
+ {
31
+ super(argv, ["project_id", "search"], []);
32
+ }
33
+ override async exec()
34
+ {
35
+ let token = this.app.storage.getNSAToken();
36
+ if (token == null)
37
+ throw new Error("Token is not available. Please login first using:\nns-log account config \nor \n{this.command} account login.");
38
+ let storage = new IStorageMemory();
39
+ let manager = new TokenManager(storage, () => { });
40
+ manager.setValue(token, false);
41
+ let server = new NamirasoftLogServer(manager, e => this.app.logger.error(e.message));
42
+ let ans = await server.loggroup.GetAll(this.arg_values[0], this.arg_values[1]);
43
+ this.app.logger.success(JSON.stringify(ans));
44
+ }
45
+ };