namirasoft-log 1.4.8 → 1.4.10
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-file-keep +11 -11
- package/dist/NamirasoftLogServerBase.js +1 -1
- package/dist/NamirasoftLogServerBase.js.map +1 -1
- package/dist/StreamFile.js +7 -17
- package/dist/StreamFile.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +1 -1
- package/dist/index.js.map +1 -1
- package/dist/meta/LogGroupMetaTable.js +1 -1
- package/dist/meta/LogGroupMetaTable.js.map +1 -1
- package/dist/meta/LogMetaTable.js +1 -1
- package/dist/meta/LogMetaTable.js.map +1 -1
- package/dist/meta/{MetaDatabase.d.ts → NamirasoftLogMetaDatabase.d.ts} +10 -8
- package/dist/meta/NamirasoftLogMetaDatabase.js +26 -0
- package/dist/meta/NamirasoftLogMetaDatabase.js.map +1 -0
- package/package.json +27 -27
- package/src/BaseFormatter.ts +36 -36
- package/src/FormatterFull.ts +19 -19
- package/src/FormatterShort.ts +12 -12
- package/src/IFormatter.ts +5 -5
- package/src/ILogger.ts +17 -17
- package/src/IStream.ts +4 -4
- package/src/Log.ts +13 -13
- package/src/LogLevel.ts +11 -11
- package/src/Logger.ts +126 -126
- package/src/NamirasoftLogServer.ts +50 -50
- package/src/NamirasoftLogServerBase.ts +29 -29
- package/src/NamirasoftLogServerLog.ts +56 -56
- package/src/NamirasoftLogServerLogGroup.ts +69 -69
- package/src/NamirasoftLogServerLogGroupCategory.ts +62 -62
- package/src/NamirasoftLogServerLogGroupField.ts +69 -69
- package/src/NamirasoftLogServerLogGroupTag.ts +69 -69
- package/src/StreamConsole.ts +37 -37
- package/src/StreamFile.ts +47 -47
- package/src/StreamNamirasoftLog.ts +30 -30
- package/src/command/LogCommand.ts +35 -35
- package/src/command/LogGroupCategoryListCommand.ts +44 -44
- package/src/command/LogGroupFieldListCommand.ts +44 -44
- package/src/command/LogGroupListCommand.ts +44 -44
- package/src/command/LogGroupTagListCommand.ts +44 -44
- package/src/command/LogListCommand.ts +44 -44
- package/src/command/cli.ts +44 -44
- package/src/index.ts +1 -1
- package/src/meta/LogGroupCategoryMetaTable.ts +45 -45
- package/src/meta/LogGroupFieldMetaTable.ts +49 -49
- package/src/meta/LogGroupMetaTable.ts +49 -49
- package/src/meta/LogGroupTagMetaTable.ts +49 -49
- package/src/meta/LogMetaTable.ts +2 -2
- package/src/meta/{MetaDatabase.ts → NamirasoftLogMetaDatabase.ts} +19 -15
- package/src/row/LogGroupCategoryRow.ts +28 -28
- package/src/row/LogGroupFieldRow.ts +30 -30
- package/src/row/LogGroupRow.ts +32 -32
- package/src/row/LogGroupTagRow.ts +30 -30
- package/dist/meta/MetaDatabase.js +0 -23
- package/dist/meta/MetaDatabase.js.map +0 -1
package/src/Logger.ts
CHANGED
|
@@ -1,127 +1,127 @@
|
|
|
1
|
-
import { FormatterFull } from "./FormatterFull";
|
|
2
|
-
import { IFormatter } from "./IFormatter";
|
|
3
|
-
import { ILogger } from "./ILogger";
|
|
4
|
-
import { IStream } from "./IStream";
|
|
5
|
-
import { Log } from "./Log";
|
|
6
|
-
import { LogLevel } from "./LogLevel";
|
|
7
|
-
import { StreamConsole } from "./StreamConsole";
|
|
8
|
-
|
|
9
|
-
export class Logger implements ILogger
|
|
10
|
-
{
|
|
11
|
-
static main: Logger | null = null;
|
|
12
|
-
private defaultStream: IStream = new StreamConsole();
|
|
13
|
-
private formatter?: IFormatter = new FormatterFull();
|
|
14
|
-
private customFormatter: { [level: string]: IFormatter } = {};
|
|
15
|
-
private streams: IStream[] = [];
|
|
16
|
-
constructor()
|
|
17
|
-
{
|
|
18
|
-
if (Logger.main == null)
|
|
19
|
-
Logger.main = this;
|
|
20
|
-
this.setFromatter = this.setFromatter.bind(this);
|
|
21
|
-
this.setCustomFormatter = this.setCustomFormatter.bind(this);
|
|
22
|
-
this.addStream = this.addStream.bind(this);
|
|
23
|
-
this.log = this.log.bind(this);
|
|
24
|
-
this.trace = this.trace.bind(this);
|
|
25
|
-
this.verbose = this.verbose.bind(this);
|
|
26
|
-
this.debug = this.debug.bind(this);
|
|
27
|
-
this.info = this.info.bind(this);
|
|
28
|
-
this.success = this.success.bind(this);
|
|
29
|
-
this.warning = this.warning.bind(this);
|
|
30
|
-
this.error = this.error.bind(this);
|
|
31
|
-
this.critical = this.critical.bind(this);
|
|
32
|
-
this.fatal = this.fatal.bind(this);
|
|
33
|
-
this.onCatchError = this.onCatchError.bind(this);
|
|
34
|
-
this.onCatchCritical = this.onCatchCritical.bind(this);
|
|
35
|
-
this.onCatchFatal = this.onCatchFatal.bind(this);
|
|
36
|
-
this.getErrorMessage = this.getErrorMessage.bind(this);
|
|
37
|
-
this.getErrorStack = this.getErrorStack.bind(this);
|
|
38
|
-
this.initUncought = this.initUncought.bind(this);
|
|
39
|
-
}
|
|
40
|
-
setFromatter(formatter: IFormatter): void
|
|
41
|
-
{
|
|
42
|
-
this.formatter = formatter;
|
|
43
|
-
}
|
|
44
|
-
setCustomFormatter(level: LogLevel, formatter: IFormatter): void
|
|
45
|
-
{
|
|
46
|
-
this.customFormatter[level] = formatter;
|
|
47
|
-
}
|
|
48
|
-
addStream(stream: IStream)
|
|
49
|
-
{
|
|
50
|
-
this.streams.push(stream);
|
|
51
|
-
}
|
|
52
|
-
log(level: LogLevel, ...messages: any[])
|
|
53
|
-
{
|
|
54
|
-
let log = new Log(level, ...messages);
|
|
55
|
-
let formatted: { pre: string[], messages: string[], post: string[] } = { pre: [], messages: [], post: [] };
|
|
56
|
-
let formatter = this.customFormatter[level.toString()] ?? this.formatter;
|
|
57
|
-
if (formatter)
|
|
58
|
-
formatted = formatter.format(log);
|
|
59
|
-
if (this.streams.length == 0)
|
|
60
|
-
this.defaultStream.write(log, formatted);
|
|
61
|
-
else
|
|
62
|
-
this.streams.map(s => s.write(log, formatted));
|
|
63
|
-
}
|
|
64
|
-
trace(...messages: any[])
|
|
65
|
-
{
|
|
66
|
-
this.log(LogLevel.Trace, ...messages);
|
|
67
|
-
}
|
|
68
|
-
verbose(...messages: any[])
|
|
69
|
-
{
|
|
70
|
-
this.log(LogLevel.Verbose, ...messages);
|
|
71
|
-
}
|
|
72
|
-
debug(...messages: any[])
|
|
73
|
-
{
|
|
74
|
-
this.log(LogLevel.Debug, ...messages);
|
|
75
|
-
}
|
|
76
|
-
info(...messages: any[])
|
|
77
|
-
{
|
|
78
|
-
this.log(LogLevel.Info, ...messages);
|
|
79
|
-
}
|
|
80
|
-
success(...messages: any[])
|
|
81
|
-
{
|
|
82
|
-
this.log(LogLevel.Success, ...messages);
|
|
83
|
-
}
|
|
84
|
-
warning(...messages: any[])
|
|
85
|
-
{
|
|
86
|
-
this.log(LogLevel.Warning, ...messages);
|
|
87
|
-
}
|
|
88
|
-
error(...messages: any[])
|
|
89
|
-
{
|
|
90
|
-
this.log(LogLevel.Error, ...messages);
|
|
91
|
-
}
|
|
92
|
-
critical(...messages: any[])
|
|
93
|
-
{
|
|
94
|
-
this.log(LogLevel.Critical, ...messages);
|
|
95
|
-
}
|
|
96
|
-
fatal(...messages: any[])
|
|
97
|
-
{
|
|
98
|
-
this.log(LogLevel.Fatal, ...messages);
|
|
99
|
-
}
|
|
100
|
-
onCatchError(error: Error | unknown)
|
|
101
|
-
{
|
|
102
|
-
this.error(this.getErrorMessage(error), this.getErrorStack(error));
|
|
103
|
-
}
|
|
104
|
-
onCatchCritical(error: Error | unknown)
|
|
105
|
-
{
|
|
106
|
-
this.critical(this.getErrorMessage(error), this.getErrorStack(error));
|
|
107
|
-
}
|
|
108
|
-
onCatchFatal(error: Error | unknown)
|
|
109
|
-
{
|
|
110
|
-
this.fatal(this.getErrorMessage(error), this.getErrorStack(error));
|
|
111
|
-
}
|
|
112
|
-
protected getErrorMessage(error: Error | unknown): string
|
|
113
|
-
{
|
|
114
|
-
if (error instanceof Error)
|
|
115
|
-
return error.message;
|
|
116
|
-
return error + "";
|
|
117
|
-
}
|
|
118
|
-
protected getErrorStack(error: Error | unknown): string
|
|
119
|
-
{
|
|
120
|
-
if (error instanceof Error)
|
|
121
|
-
return error.stack ?? "";
|
|
122
|
-
return error + "";
|
|
123
|
-
}
|
|
124
|
-
initUncought()
|
|
125
|
-
{
|
|
126
|
-
}
|
|
1
|
+
import { FormatterFull } from "./FormatterFull";
|
|
2
|
+
import { IFormatter } from "./IFormatter";
|
|
3
|
+
import { ILogger } from "./ILogger";
|
|
4
|
+
import { IStream } from "./IStream";
|
|
5
|
+
import { Log } from "./Log";
|
|
6
|
+
import { LogLevel } from "./LogLevel";
|
|
7
|
+
import { StreamConsole } from "./StreamConsole";
|
|
8
|
+
|
|
9
|
+
export class Logger implements ILogger
|
|
10
|
+
{
|
|
11
|
+
static main: Logger | null = null;
|
|
12
|
+
private defaultStream: IStream = new StreamConsole();
|
|
13
|
+
private formatter?: IFormatter = new FormatterFull();
|
|
14
|
+
private customFormatter: { [level: string]: IFormatter } = {};
|
|
15
|
+
private streams: IStream[] = [];
|
|
16
|
+
constructor()
|
|
17
|
+
{
|
|
18
|
+
if (Logger.main == null)
|
|
19
|
+
Logger.main = this;
|
|
20
|
+
this.setFromatter = this.setFromatter.bind(this);
|
|
21
|
+
this.setCustomFormatter = this.setCustomFormatter.bind(this);
|
|
22
|
+
this.addStream = this.addStream.bind(this);
|
|
23
|
+
this.log = this.log.bind(this);
|
|
24
|
+
this.trace = this.trace.bind(this);
|
|
25
|
+
this.verbose = this.verbose.bind(this);
|
|
26
|
+
this.debug = this.debug.bind(this);
|
|
27
|
+
this.info = this.info.bind(this);
|
|
28
|
+
this.success = this.success.bind(this);
|
|
29
|
+
this.warning = this.warning.bind(this);
|
|
30
|
+
this.error = this.error.bind(this);
|
|
31
|
+
this.critical = this.critical.bind(this);
|
|
32
|
+
this.fatal = this.fatal.bind(this);
|
|
33
|
+
this.onCatchError = this.onCatchError.bind(this);
|
|
34
|
+
this.onCatchCritical = this.onCatchCritical.bind(this);
|
|
35
|
+
this.onCatchFatal = this.onCatchFatal.bind(this);
|
|
36
|
+
this.getErrorMessage = this.getErrorMessage.bind(this);
|
|
37
|
+
this.getErrorStack = this.getErrorStack.bind(this);
|
|
38
|
+
this.initUncought = this.initUncought.bind(this);
|
|
39
|
+
}
|
|
40
|
+
setFromatter(formatter: IFormatter): void
|
|
41
|
+
{
|
|
42
|
+
this.formatter = formatter;
|
|
43
|
+
}
|
|
44
|
+
setCustomFormatter(level: LogLevel, formatter: IFormatter): void
|
|
45
|
+
{
|
|
46
|
+
this.customFormatter[level] = formatter;
|
|
47
|
+
}
|
|
48
|
+
addStream(stream: IStream)
|
|
49
|
+
{
|
|
50
|
+
this.streams.push(stream);
|
|
51
|
+
}
|
|
52
|
+
log(level: LogLevel, ...messages: any[])
|
|
53
|
+
{
|
|
54
|
+
let log = new Log(level, ...messages);
|
|
55
|
+
let formatted: { pre: string[], messages: string[], post: string[] } = { pre: [], messages: [], post: [] };
|
|
56
|
+
let formatter = this.customFormatter[level.toString()] ?? this.formatter;
|
|
57
|
+
if (formatter)
|
|
58
|
+
formatted = formatter.format(log);
|
|
59
|
+
if (this.streams.length == 0)
|
|
60
|
+
this.defaultStream.write(log, formatted);
|
|
61
|
+
else
|
|
62
|
+
this.streams.map(s => s.write(log, formatted));
|
|
63
|
+
}
|
|
64
|
+
trace(...messages: any[])
|
|
65
|
+
{
|
|
66
|
+
this.log(LogLevel.Trace, ...messages);
|
|
67
|
+
}
|
|
68
|
+
verbose(...messages: any[])
|
|
69
|
+
{
|
|
70
|
+
this.log(LogLevel.Verbose, ...messages);
|
|
71
|
+
}
|
|
72
|
+
debug(...messages: any[])
|
|
73
|
+
{
|
|
74
|
+
this.log(LogLevel.Debug, ...messages);
|
|
75
|
+
}
|
|
76
|
+
info(...messages: any[])
|
|
77
|
+
{
|
|
78
|
+
this.log(LogLevel.Info, ...messages);
|
|
79
|
+
}
|
|
80
|
+
success(...messages: any[])
|
|
81
|
+
{
|
|
82
|
+
this.log(LogLevel.Success, ...messages);
|
|
83
|
+
}
|
|
84
|
+
warning(...messages: any[])
|
|
85
|
+
{
|
|
86
|
+
this.log(LogLevel.Warning, ...messages);
|
|
87
|
+
}
|
|
88
|
+
error(...messages: any[])
|
|
89
|
+
{
|
|
90
|
+
this.log(LogLevel.Error, ...messages);
|
|
91
|
+
}
|
|
92
|
+
critical(...messages: any[])
|
|
93
|
+
{
|
|
94
|
+
this.log(LogLevel.Critical, ...messages);
|
|
95
|
+
}
|
|
96
|
+
fatal(...messages: any[])
|
|
97
|
+
{
|
|
98
|
+
this.log(LogLevel.Fatal, ...messages);
|
|
99
|
+
}
|
|
100
|
+
onCatchError(error: Error | unknown)
|
|
101
|
+
{
|
|
102
|
+
this.error(this.getErrorMessage(error), this.getErrorStack(error));
|
|
103
|
+
}
|
|
104
|
+
onCatchCritical(error: Error | unknown)
|
|
105
|
+
{
|
|
106
|
+
this.critical(this.getErrorMessage(error), this.getErrorStack(error));
|
|
107
|
+
}
|
|
108
|
+
onCatchFatal(error: Error | unknown)
|
|
109
|
+
{
|
|
110
|
+
this.fatal(this.getErrorMessage(error), this.getErrorStack(error));
|
|
111
|
+
}
|
|
112
|
+
protected getErrorMessage(error: Error | unknown): string
|
|
113
|
+
{
|
|
114
|
+
if (error instanceof Error)
|
|
115
|
+
return error.message;
|
|
116
|
+
return error + "";
|
|
117
|
+
}
|
|
118
|
+
protected getErrorStack(error: Error | unknown): string
|
|
119
|
+
{
|
|
120
|
+
if (error instanceof Error)
|
|
121
|
+
return error.stack ?? "";
|
|
122
|
+
return error + "";
|
|
123
|
+
}
|
|
124
|
+
initUncought()
|
|
125
|
+
{
|
|
126
|
+
}
|
|
127
127
|
}
|
|
@@ -1,51 +1,51 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { NamirasoftLogServerHealthz } from "./NamirasoftLogServerHealthz";
|
|
22
|
-
import { NamirasoftLogServerLog } from "./NamirasoftLogServerLog";
|
|
23
|
-
import { NamirasoftLogServerLogGroup } from "./NamirasoftLogServerLogGroup";
|
|
24
|
-
import { NamirasoftLogServerLogGroupCategory } from "./NamirasoftLogServerLogGroupCategory";
|
|
25
|
-
import { NamirasoftLogServerLogGroupField } from "./NamirasoftLogServerLogGroupField";
|
|
26
|
-
import { NamirasoftLogServerLogGroupTag } from "./NamirasoftLogServerLogGroupTag";
|
|
27
|
-
import { NamirasoftLogServerValue } from "./NamirasoftLogServerValue";
|
|
28
|
-
import { TokenManager } from "namirasoft-account";
|
|
29
|
-
|
|
30
|
-
export class NamirasoftLogServer
|
|
31
|
-
{
|
|
32
|
-
manager: TokenManager;
|
|
33
|
-
healthz: NamirasoftLogServerHealthz;
|
|
34
|
-
value: NamirasoftLogServerValue;
|
|
35
|
-
loggroupcategory: NamirasoftLogServerLogGroupCategory;
|
|
36
|
-
loggroupfield: NamirasoftLogServerLogGroupField;
|
|
37
|
-
loggrouptag: NamirasoftLogServerLogGroupTag;
|
|
38
|
-
loggroup: NamirasoftLogServerLogGroup;
|
|
39
|
-
log: NamirasoftLogServerLog;
|
|
40
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
41
|
-
{
|
|
42
|
-
this.manager = manager;
|
|
43
|
-
this.healthz = new NamirasoftLogServerHealthz(base_url, manager, onError);
|
|
44
|
-
this.value = new NamirasoftLogServerValue(base_url, manager, onError);
|
|
45
|
-
this.loggroupcategory = new NamirasoftLogServerLogGroupCategory(base_url, manager, onError);
|
|
46
|
-
this.loggroupfield = new NamirasoftLogServerLogGroupField(base_url, manager, onError);
|
|
47
|
-
this.loggrouptag = new NamirasoftLogServerLogGroupTag(base_url, manager, onError);
|
|
48
|
-
this.loggroup = new NamirasoftLogServerLogGroup(base_url, manager, onError);
|
|
49
|
-
this.log = new NamirasoftLogServerLog(base_url, manager, onError);
|
|
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 changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { NamirasoftLogServerHealthz } from "./NamirasoftLogServerHealthz";
|
|
22
|
+
import { NamirasoftLogServerLog } from "./NamirasoftLogServerLog";
|
|
23
|
+
import { NamirasoftLogServerLogGroup } from "./NamirasoftLogServerLogGroup";
|
|
24
|
+
import { NamirasoftLogServerLogGroupCategory } from "./NamirasoftLogServerLogGroupCategory";
|
|
25
|
+
import { NamirasoftLogServerLogGroupField } from "./NamirasoftLogServerLogGroupField";
|
|
26
|
+
import { NamirasoftLogServerLogGroupTag } from "./NamirasoftLogServerLogGroupTag";
|
|
27
|
+
import { NamirasoftLogServerValue } from "./NamirasoftLogServerValue";
|
|
28
|
+
import { TokenManager } from "namirasoft-account";
|
|
29
|
+
|
|
30
|
+
export class NamirasoftLogServer
|
|
31
|
+
{
|
|
32
|
+
manager: TokenManager;
|
|
33
|
+
healthz: NamirasoftLogServerHealthz;
|
|
34
|
+
value: NamirasoftLogServerValue;
|
|
35
|
+
loggroupcategory: NamirasoftLogServerLogGroupCategory;
|
|
36
|
+
loggroupfield: NamirasoftLogServerLogGroupField;
|
|
37
|
+
loggrouptag: NamirasoftLogServerLogGroupTag;
|
|
38
|
+
loggroup: NamirasoftLogServerLogGroup;
|
|
39
|
+
log: NamirasoftLogServerLog;
|
|
40
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
41
|
+
{
|
|
42
|
+
this.manager = manager;
|
|
43
|
+
this.healthz = new NamirasoftLogServerHealthz(base_url, manager, onError);
|
|
44
|
+
this.value = new NamirasoftLogServerValue(base_url, manager, onError);
|
|
45
|
+
this.loggroupcategory = new NamirasoftLogServerLogGroupCategory(base_url, manager, onError);
|
|
46
|
+
this.loggroupfield = new NamirasoftLogServerLogGroupField(base_url, manager, onError);
|
|
47
|
+
this.loggrouptag = new NamirasoftLogServerLogGroupTag(base_url, manager, onError);
|
|
48
|
+
this.loggroup = new NamirasoftLogServerLogGroup(base_url, manager, onError);
|
|
49
|
+
this.log = new NamirasoftLogServerLog(base_url, manager, onError);
|
|
50
|
+
}
|
|
51
51
|
};
|
|
@@ -1,30 +1,30 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { NSABaseServer } from "namirasoft-account";
|
|
22
|
-
import { TokenManager } from "namirasoft-account";
|
|
23
|
-
|
|
24
|
-
export class NamirasoftLogServerBase extends NSABaseServer
|
|
25
|
-
{
|
|
26
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
-
{
|
|
28
|
-
super(base_url, `1.4.
|
|
29
|
-
}
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { NSABaseServer } from "namirasoft-account";
|
|
22
|
+
import { TokenManager } from "namirasoft-account";
|
|
23
|
+
|
|
24
|
+
export class NamirasoftLogServerBase extends NSABaseServer
|
|
25
|
+
{
|
|
26
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
27
|
+
{
|
|
28
|
+
super(base_url, `1.4.10`, manager, onError);
|
|
29
|
+
}
|
|
30
30
|
};
|
|
@@ -1,57 +1,57 @@
|
|
|
1
|
-
/****************************************************************/
|
|
2
|
-
/* */
|
|
3
|
-
/* This is an Auto-Generated File */
|
|
4
|
-
/* Made By */
|
|
5
|
-
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
-
/* */
|
|
7
|
-
/****************************************************************/
|
|
8
|
-
/****************************************************************/
|
|
9
|
-
/* */
|
|
10
|
-
/* Please do not make any change to this file */
|
|
11
|
-
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
-
/* */
|
|
13
|
-
/****************************************************************/
|
|
14
|
-
/****************************************************************/
|
|
15
|
-
/* */
|
|
16
|
-
/* Namira Software Corporation */
|
|
17
|
-
/* https://namirasoft.com */
|
|
18
|
-
/* */
|
|
19
|
-
/****************************************************************/
|
|
20
|
-
|
|
21
|
-
import { FilterItem } from "namirasoft-core";
|
|
22
|
-
import { LogCreateRow } from "./row/LogCreateRow";
|
|
23
|
-
import { LogRow } from "./row/LogRow";
|
|
24
|
-
import { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
|
|
25
|
-
import { SortItem } from "namirasoft-core";
|
|
26
|
-
import { TokenManager } from "namirasoft-account";
|
|
27
|
-
|
|
28
|
-
export class NamirasoftLogServerLog extends NamirasoftLogServerBase
|
|
29
|
-
{
|
|
30
|
-
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
31
|
-
{
|
|
32
|
-
super(base_url, manager, onError);
|
|
33
|
-
this.List = this.List.bind(this);
|
|
34
|
-
this.Get = this.Get.bind(this);
|
|
35
|
-
this.Create = this.Create.bind(this);
|
|
36
|
-
}
|
|
37
|
-
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[], user_id: (string | null)): Promise<{ rows: LogRow[], count: number }>
|
|
38
|
-
{
|
|
39
|
-
let filters_string_value: string = FilterItem.stringify(filters);
|
|
40
|
-
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
41
|
-
let path = `/log/list`;
|
|
42
|
-
let { data } = await this._get<{ rows: LogRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value, user_id });
|
|
43
|
-
return data;
|
|
44
|
-
}
|
|
45
|
-
async Get(id: string): Promise<LogRow>
|
|
46
|
-
{
|
|
47
|
-
let path = `/log/${id}`;
|
|
48
|
-
let { data } = await this._get<LogRow>(path, {});
|
|
49
|
-
return data;
|
|
50
|
-
}
|
|
51
|
-
async Create(body: LogCreateRow): Promise<LogRow>
|
|
52
|
-
{
|
|
53
|
-
let path = `/log`;
|
|
54
|
-
let { data } = await this._post<LogRow>(path, {}, body);
|
|
55
|
-
return data;
|
|
56
|
-
}
|
|
1
|
+
/****************************************************************/
|
|
2
|
+
/* */
|
|
3
|
+
/* This is an Auto-Generated File */
|
|
4
|
+
/* Made By */
|
|
5
|
+
/* Namirasoft SDK Generator NPM Package */
|
|
6
|
+
/* */
|
|
7
|
+
/****************************************************************/
|
|
8
|
+
/****************************************************************/
|
|
9
|
+
/* */
|
|
10
|
+
/* Please do not make any change to this file */
|
|
11
|
+
/* If any changed is reqired, ns-sdkg command must be used */
|
|
12
|
+
/* */
|
|
13
|
+
/****************************************************************/
|
|
14
|
+
/****************************************************************/
|
|
15
|
+
/* */
|
|
16
|
+
/* Namira Software Corporation */
|
|
17
|
+
/* https://namirasoft.com */
|
|
18
|
+
/* */
|
|
19
|
+
/****************************************************************/
|
|
20
|
+
|
|
21
|
+
import { FilterItem } from "namirasoft-core";
|
|
22
|
+
import { LogCreateRow } from "./row/LogCreateRow";
|
|
23
|
+
import { LogRow } from "./row/LogRow";
|
|
24
|
+
import { NamirasoftLogServerBase } from "./NamirasoftLogServerBase";
|
|
25
|
+
import { SortItem } from "namirasoft-core";
|
|
26
|
+
import { TokenManager } from "namirasoft-account";
|
|
27
|
+
|
|
28
|
+
export class NamirasoftLogServerLog extends NamirasoftLogServerBase
|
|
29
|
+
{
|
|
30
|
+
constructor(base_url: string, manager: TokenManager, onError: (error: Error) => void)
|
|
31
|
+
{
|
|
32
|
+
super(base_url, manager, onError);
|
|
33
|
+
this.List = this.List.bind(this);
|
|
34
|
+
this.Get = this.Get.bind(this);
|
|
35
|
+
this.Create = this.Create.bind(this);
|
|
36
|
+
}
|
|
37
|
+
async List(filters: FilterItem[] | null, page: (number | null), size: (number | null), sorts: SortItem[], user_id: (string | null)): Promise<{ rows: LogRow[], count: number }>
|
|
38
|
+
{
|
|
39
|
+
let filters_string_value: string = FilterItem.stringify(filters);
|
|
40
|
+
let sorts_string_value: string = SortItem.stringify(sorts);
|
|
41
|
+
let path = `/log/list`;
|
|
42
|
+
let { data } = await this._get<{ rows: LogRow[], count: number }>(path, { filters: filters_string_value, page, size, sorts: sorts_string_value, user_id });
|
|
43
|
+
return data;
|
|
44
|
+
}
|
|
45
|
+
async Get(id: string): Promise<LogRow>
|
|
46
|
+
{
|
|
47
|
+
let path = `/log/${id}`;
|
|
48
|
+
let { data } = await this._get<LogRow>(path, {});
|
|
49
|
+
return data;
|
|
50
|
+
}
|
|
51
|
+
async Create(body: LogCreateRow): Promise<LogRow>
|
|
52
|
+
{
|
|
53
|
+
let path = `/log`;
|
|
54
|
+
let { data } = await this._post<LogRow>(path, {}, body);
|
|
55
|
+
return data;
|
|
56
|
+
}
|
|
57
57
|
};
|