namirasoft-log 1.3.5 → 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.
- package/.ns-sdkg-dir-deep +1 -0
- package/.ns-sdkg-dir-keep +0 -0
- package/.ns-sdkg-file-keep +12 -0
- package/dist/FormatterFull.d.ts +2 -2
- package/dist/FormatterFull.js +9 -20
- package/dist/FormatterFull.js.map +1 -1
- package/dist/FormatterShort.d.ts +2 -2
- package/dist/FormatterShort.js +3 -14
- package/dist/FormatterShort.js.map +1 -1
- package/dist/IFormatter.d.ts +2 -2
- package/dist/ILogger.d.ts +13 -13
- package/dist/IStream.d.ts +1 -1
- package/dist/Logger.d.ts +13 -13
- package/dist/Logger.js +21 -58
- package/dist/Logger.js.map +1 -1
- package/dist/NamirasoftLogServer.d.ts +9 -0
- package/dist/NamirasoftLogServer.js +10 -0
- package/dist/NamirasoftLogServer.js.map +1 -1
- package/dist/NamirasoftLogServerBase.d.ts +5 -0
- package/dist/NamirasoftLogServerBase.js +12 -0
- package/dist/NamirasoftLogServerBase.js.map +1 -0
- package/dist/NamirasoftLogServerHealthz.d.ts +4 -0
- package/dist/NamirasoftLogServerHealthz.js +25 -0
- package/dist/NamirasoftLogServerHealthz.js.map +1 -0
- package/dist/NamirasoftLogServerLog.d.ts +8 -0
- package/dist/NamirasoftLogServerLog.js +39 -0
- package/dist/NamirasoftLogServerLog.js.map +1 -0
- package/dist/NamirasoftLogServerLogGroup.d.ts +10 -0
- package/dist/NamirasoftLogServerLogGroup.js +53 -0
- package/dist/NamirasoftLogServerLogGroup.js.map +1 -0
- package/dist/StreamConsole.d.ts +1 -1
- package/dist/StreamConsole.js +25 -36
- package/dist/StreamConsole.js.map +1 -1
- package/dist/StreamFile.d.ts +1 -1
- package/dist/StreamFile.js +2 -13
- package/dist/StreamFile.js.map +1 -1
- package/dist/StreamNamirasoftLog.d.ts +1 -1
- package/dist/StreamNamirasoftLog.js +0 -11
- package/dist/StreamNamirasoftLog.js.map +1 -1
- 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/LogCommand.d.ts +4 -0
- package/dist/command/LogCommand.js +19 -0
- package/dist/command/LogCommand.js.map +1 -0
- package/dist/command/LogCreateCommand.d.ts +5 -0
- package/dist/command/LogCreateCommand.js +129 -0
- package/dist/command/LogCreateCommand.js.map +1 -0
- package/dist/command/LogGetAllCommand.d.ts +5 -0
- package/dist/command/LogGetAllCommand.js +37 -0
- package/dist/command/LogGetAllCommand.js.map +1 -0
- package/dist/command/LogGetCommand.d.ts +5 -0
- package/dist/command/LogGetCommand.js +37 -0
- package/dist/command/LogGetCommand.js.map +1 -0
- package/dist/command/LogGroupCommand.d.ts +4 -0
- package/dist/command/LogGroupCommand.js +23 -0
- package/dist/command/LogGroupCommand.js.map +1 -0
- package/dist/command/LogGroupCreateCommand.d.ts +5 -0
- package/dist/command/LogGroupCreateCommand.js +57 -0
- package/dist/command/LogGroupCreateCommand.js.map +1 -0
- package/dist/command/LogGroupDeleteCommand.d.ts +5 -0
- package/dist/command/LogGroupDeleteCommand.js +37 -0
- package/dist/command/LogGroupDeleteCommand.js.map +1 -0
- package/dist/command/LogGroupGetAllCommand.d.ts +5 -0
- package/dist/command/LogGroupGetAllCommand.js +37 -0
- package/dist/command/LogGroupGetAllCommand.js.map +1 -0
- package/dist/command/LogGroupGetCommand.d.ts +5 -0
- package/dist/command/LogGroupGetCommand.js +37 -0
- package/dist/command/LogGroupGetCommand.js.map +1 -0
- package/dist/command/LogGroupUpdateCommand.d.ts +5 -0
- package/dist/command/LogGroupUpdateCommand.js +57 -0
- package/dist/command/LogGroupUpdateCommand.js.map +1 -0
- package/dist/command/cli.d.ts +2 -0
- package/dist/command/cli.js +16 -0
- package/dist/command/cli.js.map +1 -0
- package/dist/index.d.ts +23 -1
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/dist/row/LogRow.d.ts +3 -0
- package/dist/row/LogRow.js +3 -0
- package/dist/row/LogRow.js.map +1 -0
- package/dist/row/LogRowInput.d.ts +12 -0
- package/dist/row/LogRowInput.js +3 -0
- package/dist/row/LogRowInput.js.map +1 -0
- package/dist/row/LogRowOutput.d.ts +1 -0
- package/dist/row/LogRowOutput.js +3 -0
- package/dist/row/LogRowOutput.js.map +1 -0
- package/dist/row/LoggroupRow.d.ts +3 -0
- package/dist/row/LoggroupRow.js +3 -0
- package/dist/row/LoggroupRow.js.map +1 -0
- package/dist/row/LoggroupRowInput.d.ts +4 -0
- package/dist/row/LoggroupRowInput.js +3 -0
- package/dist/row/LoggroupRowInput.js.map +1 -0
- package/dist/row/LoggroupRowOutput.d.ts +4 -0
- package/dist/row/LoggroupRowOutput.js +3 -0
- package/dist/row/LoggroupRowOutput.js.map +1 -0
- package/package.json +10 -6
- package/src/FormatterFull.ts +1 -1
- package/src/FormatterShort.ts +1 -1
- package/src/IFormatter.ts +1 -1
- package/src/ILogger.ts +13 -13
- package/src/IStream.ts +1 -1
- package/src/Logger.ts +27 -30
- package/src/NamirasoftLogServer.ts +39 -2
- package/src/NamirasoftLogServerBase.ts +31 -0
- package/src/NamirasoftLogServerHealthz.ts +32 -0
- package/src/NamirasoftLogServerLog.ts +46 -0
- package/src/NamirasoftLogServerLogGroup.ts +58 -0
- package/src/StreamConsole.ts +1 -1
- package/src/StreamFile.ts +1 -1
- package/src/StreamNamirasoftLog.ts +1 -1
- package/src/command/HealthzCommand.ts +33 -0
- package/src/command/HealthzGetCommand.ts +45 -0
- package/src/command/LogCommand.ts +37 -0
- package/src/command/LogCreateCommand.ts +137 -0
- package/src/command/LogGetAllCommand.ts +45 -0
- package/src/command/LogGetCommand.ts +45 -0
- package/src/command/LogGroupCommand.ts +41 -0
- package/src/command/LogGroupCreateCommand.ts +65 -0
- package/src/command/LogGroupDeleteCommand.ts +45 -0
- package/src/command/LogGroupGetAllCommand.ts +45 -0
- package/src/command/LogGroupGetCommand.ts +45 -0
- package/src/command/LogGroupUpdateCommand.ts +65 -0
- package/src/command/cli.ts +35 -0
- package/src/index.ts +45 -2
- package/src/row/LogRow.ts +25 -0
- package/src/row/LogRowInput.ts +34 -0
- package/src/row/LogRowOutput.ts +24 -0
- package/src/row/LoggroupRow.ts +25 -0
- package/src/row/LoggroupRowInput.ts +26 -0
- package/src/row/LoggroupRowOutput.ts +26 -0
|
@@ -1,3 +1,40 @@
|
|
|
1
|
-
|
|
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 { NamirasoftLogServerHealthz } from "./NamirasoftLogServerHealthz";
|
|
23
|
+
import { NamirasoftLogServerLog } from "./NamirasoftLogServerLog";
|
|
24
|
+
import { NamirasoftLogServerLogGroup } from "./NamirasoftLogServerLogGroup";
|
|
25
|
+
import { TokenManager } from "namirasoft-account";
|
|
26
|
+
|
|
27
|
+
export class NamirasoftLogServer
|
|
2
28
|
{
|
|
3
|
-
|
|
29
|
+
manager: TokenManager;
|
|
30
|
+
healthz: NamirasoftLogServerHealthz;
|
|
31
|
+
log: NamirasoftLogServerLog;
|
|
32
|
+
loggroup: NamirasoftLogServerLogGroup;
|
|
33
|
+
constructor(manager: TokenManager, onError: (error: Error) => void)
|
|
34
|
+
{
|
|
35
|
+
this.manager = manager;
|
|
36
|
+
this.healthz = new NamirasoftLogServerHealthz(manager, onError);
|
|
37
|
+
this.log = new NamirasoftLogServerLog(manager, onError);
|
|
38
|
+
this.loggroup = new NamirasoftLogServerLogGroup(manager, onError);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
@@ -0,0 +1,31 @@
|
|
|
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 { NamirasoftServerBase } from "namirasoft-account";
|
|
23
|
+
import { TokenManager } from "namirasoft-account";
|
|
24
|
+
|
|
25
|
+
export class NamirasoftLogServerBase extends NamirasoftServerBase
|
|
26
|
+
{
|
|
27
|
+
constructor(manager: TokenManager, onError: (error: Error) => void)
|
|
28
|
+
{
|
|
29
|
+
super(`https://log.namirasoft.com/api/v1`, manager, onError);
|
|
30
|
+
}
|
|
31
|
+
};
|
|
@@ -0,0 +1,32 @@
|
|
|
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 { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftLogServerHealthz extends NamirasoftLogServerBase
|
|
25
|
+
{
|
|
26
|
+
async Get(): Promise<void>
|
|
27
|
+
{
|
|
28
|
+
let path = `/healthz`;
|
|
29
|
+
let { data } = await this._get<void>(path, {});
|
|
30
|
+
return data;
|
|
31
|
+
}
|
|
32
|
+
};
|
|
@@ -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
|
+
};
|
package/src/StreamConsole.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { LogLevel } from './LogLevel';
|
|
|
5
5
|
|
|
6
6
|
export class StreamConsole implements IStream
|
|
7
7
|
{
|
|
8
|
-
|
|
8
|
+
write(log: Log, formated: { pre: string[], messages: string[], post: string[] }): void
|
|
9
9
|
{
|
|
10
10
|
let writter = (data: string) =>
|
|
11
11
|
{
|
package/src/StreamFile.ts
CHANGED
|
@@ -40,7 +40,7 @@ export class StreamFile implements IStream
|
|
|
40
40
|
let name = names.join("-");
|
|
41
41
|
return path.resolve(this.basePath, name);
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
write(log: Log, formated: { pre: string[], messages: string[], post: string[] }): void
|
|
44
44
|
{
|
|
45
45
|
let filePath = this.getFilePath(log);
|
|
46
46
|
fs.appendFile(filePath, [...formated.pre, ...formated.messages, ...formated.post].join("\n"), () => { });
|
|
@@ -8,7 +8,7 @@ export class StreamNamirasoftLog implements IStream
|
|
|
8
8
|
{
|
|
9
9
|
this.token = token;
|
|
10
10
|
}
|
|
11
|
-
|
|
11
|
+
write(_: Log, __: { pre: string[], messages: string[], post: string[] }): void
|
|
12
12
|
{
|
|
13
13
|
}
|
|
14
14
|
}
|
|
@@ -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
|
+
};
|