@platformatic/runtime 1.35.1 → 1.35.3
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/api-client.js +14 -1
- package/lib/management-api.js +8 -13
- package/package.json +10 -10
- package/fixtures/dbApp/db.sqlite +0 -0
- package/fixtures/dbAppWithMigrationError/db.sqlite +0 -0
- package/fixtures/monorepo/dbApp/db.sqlite +0 -0
- package/fixtures/typescript/services/composer/.env +0 -4
- package/fixtures/typescript/services/movies/dist/plugin.js +0 -6
- package/fixtures/typescript/services/movies/dist/plugin.js.map +0 -1
- package/fixtures/typescript/services/titles/.env +0 -3
- package/fixtures/typescript/services/titles/dist/plugins/example.js +0 -7
- package/fixtures/typescript/services/titles/dist/plugins/example.js.map +0 -1
- package/fixtures/typescript/services/titles/dist/routes/root.js +0 -14
- package/fixtures/typescript/services/titles/dist/routes/root.js.map +0 -1
- package/fixtures/typescript-custom-flags/services/composer/.env +0 -4
- package/fixtures/typescript-custom-flags/services/movies/.env +0 -4
- package/fixtures/typescript-custom-flags/services/titles/.env +0 -3
package/lib/api-client.js
CHANGED
|
@@ -346,7 +346,20 @@ class RuntimeApiClient extends EventEmitter {
|
|
|
346
346
|
})
|
|
347
347
|
}
|
|
348
348
|
|
|
349
|
-
async getLogIds () {
|
|
349
|
+
async getLogIds (runtimePID) {
|
|
350
|
+
runtimePID = runtimePID ?? process.pid
|
|
351
|
+
|
|
352
|
+
const runtimeLogFiles = await this.#getRuntimeLogFiles(runtimePID)
|
|
353
|
+
const runtimeLogIds = []
|
|
354
|
+
|
|
355
|
+
for (const logFile of runtimeLogFiles) {
|
|
356
|
+
const logId = parseInt(logFile.slice('logs.'.length))
|
|
357
|
+
runtimeLogIds.push(logId)
|
|
358
|
+
}
|
|
359
|
+
return runtimeLogIds
|
|
360
|
+
}
|
|
361
|
+
|
|
362
|
+
async getAllLogIds () {
|
|
350
363
|
const runtimesLogFiles = await this.#getAllLogsFiles()
|
|
351
364
|
const runtimesLogsIds = []
|
|
352
365
|
|
package/lib/management-api.js
CHANGED
|
@@ -140,25 +140,21 @@ async function createManagementApi (runtimeApiClient) {
|
|
|
140
140
|
app.get('/logs/indexes', async (req) => {
|
|
141
141
|
const returnAllIds = req.query.all === 'true'
|
|
142
142
|
|
|
143
|
-
const runtimesLogsIds = await runtimeApiClient.getLogIds()
|
|
144
143
|
if (returnAllIds) {
|
|
144
|
+
const runtimesLogsIds = await runtimeApiClient.getAllLogIds()
|
|
145
145
|
return runtimesLogsIds
|
|
146
146
|
}
|
|
147
147
|
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
return { indexes: runtimesLogsIds.at(-1).indexes }
|
|
148
|
+
const runtimeLogsIds = await runtimeApiClient.getLogIds()
|
|
149
|
+
return { indexes: runtimeLogsIds }
|
|
153
150
|
})
|
|
154
151
|
|
|
155
152
|
app.get('/logs/all', async (req, reply) => {
|
|
156
153
|
const runtimePID = parseInt(req.query.pid) || process.pid
|
|
157
154
|
|
|
158
|
-
const
|
|
159
|
-
const
|
|
160
|
-
const
|
|
161
|
-
const endLogId = logsIds.indexes.at(-1)
|
|
155
|
+
const logsIds = await runtimeApiClient.getLogIds(runtimePID)
|
|
156
|
+
const startLogId = logsIds.at(0)
|
|
157
|
+
const endLogId = logsIds.at(-1)
|
|
162
158
|
|
|
163
159
|
reply.hijack()
|
|
164
160
|
|
|
@@ -175,9 +171,8 @@ async function createManagementApi (runtimeApiClient) {
|
|
|
175
171
|
const logId = parseInt(req.params.id)
|
|
176
172
|
const runtimePID = parseInt(req.query.pid) || process.pid
|
|
177
173
|
|
|
178
|
-
const
|
|
179
|
-
|
|
180
|
-
if (!runtimeLogsIds || !runtimeLogsIds.indexes.includes(logId)) {
|
|
174
|
+
const logIds = await runtimeApiClient.getLogIds(runtimePID)
|
|
175
|
+
if (!logIds || !logIds.includes(logId)) {
|
|
181
176
|
throw new errors.LogFileNotFound(logId)
|
|
182
177
|
}
|
|
183
178
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/runtime",
|
|
3
|
-
"version": "1.35.
|
|
3
|
+
"version": "1.35.3",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -33,8 +33,8 @@
|
|
|
33
33
|
"typescript": "^5.4.2",
|
|
34
34
|
"undici-oidc-interceptor": "^0.5.0",
|
|
35
35
|
"why-is-node-running": "^2.2.2",
|
|
36
|
-
"@platformatic/sql-
|
|
37
|
-
"@platformatic/sql-
|
|
36
|
+
"@platformatic/sql-graphql": "1.35.3",
|
|
37
|
+
"@platformatic/sql-mapper": "1.35.3"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
40
|
"ws": "^8.16.0",
|
|
@@ -62,13 +62,13 @@
|
|
|
62
62
|
"tail-file-stream": "^0.1.0",
|
|
63
63
|
"undici": "^6.9.0",
|
|
64
64
|
"why-is-node-running": "^2.2.2",
|
|
65
|
-
"@platformatic/composer": "1.35.
|
|
66
|
-
"@platformatic/
|
|
67
|
-
"@platformatic/
|
|
68
|
-
"@platformatic/
|
|
69
|
-
"@platformatic/telemetry": "1.35.
|
|
70
|
-
"@platformatic/service": "1.35.
|
|
71
|
-
"@platformatic/utils": "1.35.
|
|
65
|
+
"@platformatic/composer": "1.35.3",
|
|
66
|
+
"@platformatic/db": "1.35.3",
|
|
67
|
+
"@platformatic/config": "1.35.3",
|
|
68
|
+
"@platformatic/generators": "1.35.3",
|
|
69
|
+
"@platformatic/telemetry": "1.35.3",
|
|
70
|
+
"@platformatic/service": "1.35.3",
|
|
71
|
+
"@platformatic/utils": "1.35.3"
|
|
72
72
|
},
|
|
73
73
|
"standard": {
|
|
74
74
|
"ignore": [
|
package/fixtures/dbApp/db.sqlite
DELETED
|
File without changes
|
|
Binary file
|
|
File without changes
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../plugin.ts"],"names":[],"mappings":";;AAGe,KAAK,oBAAW,GAAoB;AACnD,CAAC;AADD,4BACC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"example.js","sourceRoot":"","sources":["../../plugins/example.ts"],"names":[],"mappings":";;AAGe,KAAK,oBAAW,OAAwB,EAAE,IAA0B;IACjF,OAAO,CAAC,QAAQ,CAAC,SAAS,EAAE,QAAQ,CAAC,CAAA;AACvC,CAAC;AAFD,4BAEC"}
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
async function default_1(fastify, opts) {
|
|
4
|
-
fastify.get('/', async (request, reply) => {
|
|
5
|
-
return { hello: fastify.example };
|
|
6
|
-
});
|
|
7
|
-
fastify.get('/titles', async (request, reply) => {
|
|
8
|
-
const movies = await fastify.client.getMovies({});
|
|
9
|
-
const titles = movies.map((movie) => movie.title);
|
|
10
|
-
return { titles };
|
|
11
|
-
});
|
|
12
|
-
}
|
|
13
|
-
exports.default = default_1;
|
|
14
|
-
//# sourceMappingURL=root.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"root.js","sourceRoot":"","sources":["../../routes/root.ts"],"names":[],"mappings":";;AAUe,KAAK,oBAAW,OAAwB,EAAE,IAA0B;IACjF,OAAO,CAAC,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QACxC,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,OAAO,EAAE,CAAA;IACnC,CAAC,CAAC,CAAA;IAEF,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,EAAE;QAC9C,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,SAAS,CAAC,EAAE,CAAC,CAAA;QACjD,MAAM,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,KAAK,CAAC,CAAA;QACjD,OAAO,EAAE,MAAM,EAAE,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC;AAVD,4BAUC"}
|