thinkncollab-shell 0.0.8 → 0.0.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/bin/thinknsh.js +9 -7
- package/package.json +1 -1
- package/src/commands/auth/login.js +76 -76
- package/src/commands/auth/logout.js +31 -31
- package/src/commands/auth/register.js +51 -51
- package/src/commands/auth/whoami.js +51 -51
- package/src/commands/index.js +129 -129
- package/src/commands/message/say.js +48 -42
- package/src/commands/room/join.js +141 -141
- package/src/commands/room/leave.js +32 -32
- package/src/commands/room/rooms.js +65 -65
- package/src/commands/shell/notify.js +87 -87
- package/src/commands/shell/status.js +72 -72
- package/src/commands/tasks/complete.js +46 -46
- package/src/commands/tasks/create-task.js +100 -100
- package/src/commands/tasks/task-status.js +60 -60
- package/src/commands/tasks/task.js +74 -74
- package/src/commands/tasks/tasks.js +182 -182
- package/src/commands/team/invite.js +45 -45
- package/src/commands/team/myteam.js +77 -77
- package/src/commands/team/teammates.js +51 -51
- package/src/commands/terminal/share.js +251 -251
- package/src/core/api-client.js +245 -245
- package/src/core/project-config.js +99 -99
- package/src/core/shell.js +165 -36
- package/src/core/websocket.js +16 -15
- package/src/events/notifications.js +15 -28
- package/src/utils/logger.js +10 -20
package/src/utils/logger.js
CHANGED
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Logger for ThinkNCollab Shell
|
|
1
|
+
/* Logger for ThinkNCollab Shell
|
|
3
2
|
*/
|
|
4
3
|
|
|
5
4
|
const fs = require('fs-extra');
|
|
@@ -29,16 +28,14 @@ class Logger {
|
|
|
29
28
|
this.currentLogFile = this.getLogFileName();
|
|
30
29
|
}
|
|
31
30
|
|
|
32
|
-
|
|
33
|
-
* Get log file name
|
|
31
|
+
/* Get log file name
|
|
34
32
|
*/
|
|
35
33
|
getLogFileName() {
|
|
36
34
|
const date = new Date().toISOString().split('T')[0];
|
|
37
35
|
return path.join(this.options.logDir, `thinknsh-${date}.log`);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
|
-
|
|
41
|
-
* Write to log file
|
|
38
|
+
/* Write to log file
|
|
42
39
|
*/
|
|
43
40
|
async write(level, message, data = null) {
|
|
44
41
|
if (this.levels[level] < this.levels[this.options.level]) {
|
|
@@ -63,8 +60,7 @@ class Logger {
|
|
|
63
60
|
}
|
|
64
61
|
}
|
|
65
62
|
|
|
66
|
-
|
|
67
|
-
* Rotate log files if needed
|
|
63
|
+
/* Rotate log files if needed
|
|
68
64
|
*/
|
|
69
65
|
async rotateIfNeeded() {
|
|
70
66
|
try {
|
|
@@ -87,8 +83,7 @@ class Logger {
|
|
|
87
83
|
}
|
|
88
84
|
}
|
|
89
85
|
|
|
90
|
-
|
|
91
|
-
* Clean old log files
|
|
86
|
+
/* Clean old log files
|
|
92
87
|
*/
|
|
93
88
|
async cleanOldLogs() {
|
|
94
89
|
try {
|
|
@@ -114,36 +109,31 @@ class Logger {
|
|
|
114
109
|
}
|
|
115
110
|
}
|
|
116
111
|
|
|
117
|
-
|
|
118
|
-
* Debug log
|
|
112
|
+
/* Debug log
|
|
119
113
|
*/
|
|
120
114
|
debug(message, data = null) {
|
|
121
115
|
return this.write('debug', message, data);
|
|
122
116
|
}
|
|
123
117
|
|
|
124
|
-
|
|
125
|
-
* Info log
|
|
118
|
+
/* Info log
|
|
126
119
|
*/
|
|
127
120
|
info(message, data = null) {
|
|
128
121
|
return this.write('info', message, data);
|
|
129
122
|
}
|
|
130
123
|
|
|
131
|
-
|
|
132
|
-
* Warn log
|
|
124
|
+
/* Warn log
|
|
133
125
|
*/
|
|
134
126
|
warn(message, data = null) {
|
|
135
127
|
return this.write('warn', message, data);
|
|
136
128
|
}
|
|
137
129
|
|
|
138
|
-
|
|
139
|
-
* Error log
|
|
130
|
+
/* Error log
|
|
140
131
|
*/
|
|
141
132
|
error(message, data = null) {
|
|
142
133
|
return this.write('error', message, data);
|
|
143
134
|
}
|
|
144
135
|
|
|
145
|
-
|
|
146
|
-
* Get recent logs
|
|
136
|
+
/* Get recent logs
|
|
147
137
|
*/
|
|
148
138
|
async getRecentLogs(lines = 100) {
|
|
149
139
|
try {
|