@platformatic/control 1.28.1 → 1.30.0
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/lib/errors.js +1 -0
- package/lib/ps.js +1 -1
- package/lib/runtime-api-client.js +16 -0
- package/lib/services.js +2 -2
- package/package.json +2 -2
package/lib/errors.js
CHANGED
|
@@ -19,5 +19,6 @@ module.exports = {
|
|
|
19
19
|
FailedToGetRuntimeConfig: createError(`${ERROR_PREFIX}_FAILED_TO_GET_RUNTIME_CONFIG`, 'Failed to get runtime config %s.'),
|
|
20
20
|
FailedToGetRuntimeServiceConfig: createError(`${ERROR_PREFIX}_FAILED_TO_GET_RUNTIME_SERVICE_CONFIG`, 'Failed to get runtime service config %s.'),
|
|
21
21
|
FailedToGetRuntimeHistoryLogs: createError(`${ERROR_PREFIX}_FAILED_TO_GET_HISTORY_LOGS`, 'Failed to get history logs %s.'),
|
|
22
|
+
FailedToGetRuntimeAllLogs: createError(`${ERROR_PREFIX}_FAILED_TO_GET_RUNTIME_ALL_LOGS`, 'Failed to get runtime all logs %s.'),
|
|
22
23
|
FailedToGetRuntimeLogIndexes: createError(`${ERROR_PREFIX}_FAILED_TO_GET_HISTORY_LOGS_COUNT`, 'Failed to get history logs count %s.')
|
|
23
24
|
}
|
package/lib/ps.js
CHANGED
|
@@ -220,6 +220,22 @@ class RuntimeApiClient {
|
|
|
220
220
|
return body
|
|
221
221
|
}
|
|
222
222
|
|
|
223
|
+
async getRuntimeAllLogsStream (pid) {
|
|
224
|
+
const client = this.#getUndiciClient(pid)
|
|
225
|
+
|
|
226
|
+
const { statusCode, body } = await client.request({
|
|
227
|
+
path: '/api/v1/logs/all',
|
|
228
|
+
method: 'GET'
|
|
229
|
+
})
|
|
230
|
+
|
|
231
|
+
if (statusCode !== 200) {
|
|
232
|
+
const error = await body.text()
|
|
233
|
+
throw new errors.FailedToGetRuntimeAllLogs(error)
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
return body
|
|
237
|
+
}
|
|
238
|
+
|
|
223
239
|
async getRuntimeLogIndexes (pid) {
|
|
224
240
|
const client = this.#getUndiciClient(pid)
|
|
225
241
|
|
package/lib/services.js
CHANGED
|
@@ -25,7 +25,7 @@ const tableColumns = [
|
|
|
25
25
|
const tableConfig = {
|
|
26
26
|
border: getBorderCharacters('void'),
|
|
27
27
|
columnDefault: {
|
|
28
|
-
paddingLeft:
|
|
28
|
+
paddingLeft: 0,
|
|
29
29
|
paddingRight: 1
|
|
30
30
|
},
|
|
31
31
|
drawHorizontalLine: () => false
|
|
@@ -48,7 +48,7 @@ async function printRuntimeServices (services) {
|
|
|
48
48
|
}
|
|
49
49
|
|
|
50
50
|
const servicesTable = table(raws, tableConfig)
|
|
51
|
-
|
|
51
|
+
process.stdout.write(servicesTable)
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
async function getRuntimeServicesCommand (argv) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/control",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"description": "Platformatic Control",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"split2": "^4.2.0",
|
|
25
25
|
"standard": "^17.1.0",
|
|
26
26
|
"tsd": "^0.30.7",
|
|
27
|
-
"@platformatic/runtime": "1.
|
|
27
|
+
"@platformatic/runtime": "1.30.0"
|
|
28
28
|
},
|
|
29
29
|
"dependencies": {
|
|
30
30
|
"@fastify/error": "^3.4.1",
|