@platformatic/runtime 2.0.0 → 2.0.2
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/config.d.ts +1 -1
- package/package.json +13 -13
- package/schema.json +1 -1
- package/fixtures/botched-start/platformatic.runtime.json +0 -14
- package/fixtures/botched-start/services/a/platformatic.service.json +0 -14
- package/fixtures/botched-start/services/a/plugin.js +0 -11
- package/fixtures/composerApp/api1.json +0 -65
- package/fixtures/composerApp/platformatic.composer.json +0 -23
- package/fixtures/configs/invalid-entrypoint.json +0 -14
- package/fixtures/configs/invalid-schema-type.config.json +0 -19
- package/fixtures/configs/invalid-web-with-services.json +0 -36
- package/fixtures/configs/missing-property.config.json +0 -13
- package/fixtures/configs/missing-service-config.json +0 -7
- package/fixtures/configs/monorepo-composer-no-autoload.json +0 -32
- package/fixtures/configs/monorepo-composer.json +0 -19
- package/fixtures/configs/monorepo-create-cycle.json +0 -20
- package/fixtures/configs/monorepo-missing-dependencies.json +0 -9
- package/fixtures/configs/monorepo-no-cycles.json +0 -19
- package/fixtures/configs/monorepo-openapi.json +0 -12
- package/fixtures/configs/monorepo-watch-env.json +0 -19
- package/fixtures/configs/monorepo-watch-single.json +0 -12
- package/fixtures/configs/monorepo-watch.json +0 -27
- package/fixtures/configs/monorepo-with-dependencies.json +0 -8
- package/fixtures/configs/monorepo-with-management-api-without-metrics.json +0 -21
- package/fixtures/configs/monorepo-with-management-api.json +0 -20
- package/fixtures/configs/monorepo-with-metrics.json +0 -32
- package/fixtures/configs/monorepo.json +0 -27
- package/fixtures/configs/no-schema.config.json +0 -18
- package/fixtures/configs/no-services.config.json +0 -5
- package/fixtures/configs/no-sources.config.json +0 -4
- package/fixtures/configs/service-throws-on-start.json +0 -11
- package/fixtures/configs/service-with-env-port.json +0 -32
- package/fixtures/configs/service-with-stdio.json +0 -12
- package/fixtures/configs/watch.json +0 -19
- package/fixtures/crash-on-bootstrap/platformatic.runtime.json +0 -15
- package/fixtures/crash-on-bootstrap/services/service-1/platformatic.service.json +0 -14
- package/fixtures/crash-on-bootstrap/services/service-1/plugin.js +0 -5
- package/fixtures/crash-on-bootstrap/services/service-2/platformatic.service.json +0 -14
- package/fixtures/crash-on-bootstrap/services/service-2/plugin.js +0 -5
- package/fixtures/dbApp/package.json +0 -5
- package/fixtures/dbApp/platformatic.db.json +0 -28
- package/fixtures/dbApp/plugin.js +0 -12
- package/fixtures/dbAppNoName/package.json +0 -4
- package/fixtures/dbAppNoName/platformatic.db.json +0 -27
- package/fixtures/dbAppNoName/plugin.js +0 -12
- package/fixtures/dbAppNoPackageJson/platformatic.db.json +0 -27
- package/fixtures/dbAppNoPackageJson/plugin.js +0 -12
- package/fixtures/dbAppWithMigrationError/migrations/001.do.sql +0 -4
- package/fixtures/dbAppWithMigrationError/migrations/001.undo.sql +0 -1
- package/fixtures/dbAppWithMigrationError/package.json +0 -5
- package/fixtures/dbAppWithMigrationError/platformatic.db.json +0 -28
- package/fixtures/dbAppWithMigrationError/plugin.js +0 -5
- package/fixtures/do-not-reload-dependencies/node_modules/foo/foo.js +0 -2
- package/fixtures/do-not-reload-dependencies/node_modules/foo/package.json +0 -3
- package/fixtures/do-not-reload-dependencies/node_modules/foom/foom.js +0 -1
- package/fixtures/do-not-reload-dependencies/node_modules/foom/package.json +0 -4
- package/fixtures/do-not-reload-dependencies/platformatic.service.json +0 -18
- package/fixtures/do-not-reload-dependencies/plugin.js +0 -14
- package/fixtures/do-not-restart-on-crash/platformatic.runtime.json +0 -15
- package/fixtures/do-not-restart-on-crash/services/a/platformatic.service.json +0 -16
- package/fixtures/do-not-restart-on-crash/services/a/plugin.js +0 -9
- package/fixtures/empty/hello.js +0 -7
- package/fixtures/express/platformatic.runtime.json +0 -21
- package/fixtures/express/services/a/platformatic.service.json +0 -14
- package/fixtures/express/services/a/plugin.js +0 -26
- package/fixtures/express/services/b/platformatic.service.json +0 -14
- package/fixtures/express/services/b/plugin.js +0 -19
- package/fixtures/external-client/openmeter.json +0 -420
- package/fixtures/external-client/platformatic.service.json +0 -13
- package/fixtures/interceptors/external.js +0 -27
- package/fixtures/interceptors/idp.js +0 -48
- package/fixtures/interceptors/platformatic.runtime.json +0 -27
- package/fixtures/interceptors/services/a/platformatic.service.json +0 -17
- package/fixtures/interceptors/services/a/plugin.js +0 -15
- package/fixtures/interceptors-2/platformatic.runtime.json +0 -25
- package/fixtures/interceptors-2/services/a/platformatic.service.json +0 -17
- package/fixtures/interceptors-2/services/a/plugin.js +0 -15
- package/fixtures/leven/.env.sample +0 -4
- package/fixtures/leven/platformatic.runtime.json +0 -11
- package/fixtures/leven/services/deeply-spittle/platformatic.service.json +0 -25
- package/fixtures/leven/services/deeply-spittle/plugins/example.js +0 -6
- package/fixtures/leven/services/deeply-spittle/routes/root.js +0 -8
- package/fixtures/leven/services/rainy-empire/platformatic.composer.json +0 -21
- package/fixtures/management-api/package.json +0 -4
- package/fixtures/management-api/platformatic.json +0 -22
- package/fixtures/management-api/services/service-1/platformatic.json +0 -15
- package/fixtures/management-api/services/service-1/plugin.js +0 -16
- package/fixtures/management-api/services/service-2/platformatic.json +0 -9
- package/fixtures/management-api/services/service-2/plugin.js +0 -8
- package/fixtures/management-api/services/service-db/migrations/001.do.sql +0 -4
- package/fixtures/management-api/services/service-db/migrations/001.undo.sql +0 -1
- package/fixtures/management-api/services/service-db/package.json +0 -5
- package/fixtures/management-api/services/service-db/platformatic.db.json +0 -29
- package/fixtures/management-api/services/service-db/plugin.js +0 -12
- package/fixtures/management-api-custom-labels/package.json +0 -4
- package/fixtures/management-api-custom-labels/platformatic.json +0 -22
- package/fixtures/management-api-custom-labels/services/service-1/platformatic.json +0 -12
- package/fixtures/management-api-custom-labels/services/service-1/plugin.js +0 -16
- package/fixtures/management-api-custom-labels/services/service-2/platformatic.json +0 -9
- package/fixtures/management-api-custom-labels/services/service-2/plugin.js +0 -8
- package/fixtures/management-api-custom-labels/services/service-db/migrations/001.do.sql +0 -4
- package/fixtures/management-api-custom-labels/services/service-db/migrations/001.undo.sql +0 -1
- package/fixtures/management-api-custom-labels/services/service-db/package.json +0 -5
- package/fixtures/management-api-custom-labels/services/service-db/platformatic.db.json +0 -29
- package/fixtures/management-api-custom-labels/services/service-db/plugin.js +0 -12
- package/fixtures/management-api-without-metrics/package.json +0 -4
- package/fixtures/management-api-without-metrics/platformatic.json +0 -14
- package/fixtures/management-api-without-metrics/services/service-1/platformatic.json +0 -8
- package/fixtures/monorepo/composerApp/external-service.json +0 -204
- package/fixtures/monorepo/composerApp/platformatic.composer.json +0 -46
- package/fixtures/monorepo/dbApp/platformatic.db.json +0 -16
- package/fixtures/monorepo/docs/README.md +0 -1
- package/fixtures/monorepo/serviceApp/deps/dep1.js +0 -7
- package/fixtures/monorepo/serviceApp/deps/dep2.mjs +0 -2
- package/fixtures/monorepo/serviceApp/deps/dep3.mjs +0 -2
- package/fixtures/monorepo/serviceApp/deps/dep4.js +0 -1
- package/fixtures/monorepo/serviceApp/platformatic.service.json +0 -23
- package/fixtures/monorepo/serviceApp/plugin.js +0 -29
- package/fixtures/monorepo/serviceApp/with-logger/package.json +0 -5
- package/fixtures/monorepo/serviceApp/with-logger/with-logger.cjs +0 -25
- package/fixtures/monorepo/serviceApp/with-logger/with-logger.d.ts +0 -38
- package/fixtures/monorepo/serviceApp/with-logger/with-logger.openapi.json +0 -22
- package/fixtures/monorepo/serviceAppWithLogger/platformatic.service.json +0 -20
- package/fixtures/monorepo/serviceAppWithLogger/plugin.js +0 -20
- package/fixtures/monorepo/serviceAppWithMultiplePlugins/platformatic.service.json +0 -28
- package/fixtures/monorepo/serviceAppWithMultiplePlugins/plugin.js +0 -8
- package/fixtures/monorepo/serviceAppWithMultiplePlugins/plugin2.mjs +0 -5
- package/fixtures/monorepo-missing-dependencies/composer/platformatic.json +0 -24
- package/fixtures/monorepo-openapi/serviceAppWithoutOpenapi/platformatic.service.json +0 -13
- package/fixtures/monorepo-openapi/serviceAppWithoutOpenapi/plugin.js +0 -8
- package/fixtures/monorepo-watch/service1/platformatic.service.json +0 -13
- package/fixtures/monorepo-watch/service1/plugin.js +0 -8
- package/fixtures/monorepo-with-dependencies/main/clients/service-1/package.json +0 -3
- package/fixtures/monorepo-with-dependencies/main/clients/service-1/schema.json +0 -204
- package/fixtures/monorepo-with-dependencies/main/clients/service-2/package.json +0 -3
- package/fixtures/monorepo-with-dependencies/main/clients/service-2/schema.json +0 -204
- package/fixtures/monorepo-with-dependencies/main/external-service.schema.json +0 -204
- package/fixtures/monorepo-with-dependencies/main/platformatic.json +0 -46
- package/fixtures/monorepo-with-dependencies/service-1/clients/service-2/package.json +0 -3
- package/fixtures/monorepo-with-dependencies/service-1/clients/service-2/schema.json +0 -204
- package/fixtures/monorepo-with-dependencies/service-1/external-service.schema.json +0 -204
- package/fixtures/monorepo-with-dependencies/service-1/platformatic.json +0 -29
- package/fixtures/monorepo-with-dependencies/service-2/platformatic.json +0 -15
- package/fixtures/no-env.service.json +0 -25
- package/fixtures/preload/platformatic.runtime.json +0 -15
- package/fixtures/preload/preload.js +0 -1
- package/fixtures/preload/services/a/platformatic.service.json +0 -14
- package/fixtures/preload/services/a/plugin.js +0 -7
- package/fixtures/prom-server/platformatic.json +0 -16
- package/fixtures/prom-server/services/service-1/platformatic.json +0 -13
- package/fixtures/prom-server/services/service-1/plugin.js +0 -8
- package/fixtures/prom-server/services/service-2/platformatic.json +0 -12
- package/fixtures/prom-server/services/service-2/plugin.js +0 -8
- package/fixtures/restart-on-crash/platformatic.runtime.json +0 -14
- package/fixtures/restart-on-crash/services/a/platformatic.service.json +0 -16
- package/fixtures/restart-on-crash/services/a/plugin.js +0 -9
- package/fixtures/sample-runtime/.env +0 -9
- package/fixtures/sample-runtime/package.json +0 -16
- package/fixtures/sample-runtime/platformatic.json +0 -18
- package/fixtures/sample-runtime/services/rival/package.json +0 -16
- package/fixtures/sample-runtime/services/rival/platformatic.json +0 -33
- package/fixtures/sample-runtime/services/rival/routes/root.js +0 -7
- package/fixtures/sample-runtime-with-2-services/.env +0 -10
- package/fixtures/sample-runtime-with-2-services/package.json +0 -16
- package/fixtures/sample-runtime-with-2-services/platformatic.json +0 -18
- package/fixtures/sample-runtime-with-2-services/services/foobar/package.json +0 -16
- package/fixtures/sample-runtime-with-2-services/services/foobar/platformatic.json +0 -18
- package/fixtures/sample-runtime-with-2-services/services/foobar/routes/root.js +0 -7
- package/fixtures/sample-runtime-with-2-services/services/rival/package.json +0 -16
- package/fixtures/sample-runtime-with-2-services/services/rival/platformatic.json +0 -33
- package/fixtures/sample-runtime-with-2-services/services/rival/routes/root.js +0 -7
- package/fixtures/server/logger-transport/custom-transport.js +0 -15
- package/fixtures/server/logger-transport/platformatic.runtime.json +0 -21
- package/fixtures/server/logger-transport/services/echo/platformatic.service.json +0 -12
- package/fixtures/server/logger-transport/services/echo/routes/hello.js +0 -6
- package/fixtures/server/overrides-service/platformatic.runtime.json +0 -18
- package/fixtures/server/overrides-service/services/echo/platformatic.service.json +0 -19
- package/fixtures/server/overrides-service/services/echo/routes/span.js +0 -8
- package/fixtures/server/runtime-server/platformatic.runtime.json +0 -18
- package/fixtures/server/runtime-server/services/echo/platformatic.service.json +0 -12
- package/fixtures/server/runtime-server/services/echo/routes/hello.js +0 -6
- package/fixtures/serviceAppThrowsOnStart/platformatic.service.json +0 -12
- package/fixtures/serviceAppThrowsOnStart/plugin.js +0 -6
- package/fixtures/stackables/node_modules/foo/foo.js +0 -62
- package/fixtures/stackables/node_modules/foo/package.json +0 -4
- package/fixtures/stackables/platformatic.json +0 -11
- package/fixtures/start-command-in-runtime.js +0 -24
- package/fixtures/start-command.js +0 -9
- package/fixtures/starter.js +0 -9
- package/fixtures/stdio/platformatic.service.json +0 -6
- package/fixtures/stdio/plugin.js +0 -24
- package/fixtures/telemetry/platformatic.runtime.json +0 -18
- package/fixtures/telemetry/services/echo/platformatic.service.json +0 -19
- package/fixtures/telemetry/services/echo/routes/span.js +0 -22
- package/fixtures/telemetry/services/service-1/platformatic.service.json +0 -19
- package/fixtures/telemetry/services/service-1/routes/echo.js +0 -7
- package/fixtures/typescript/.env +0 -4
- package/fixtures/typescript/platformatic.runtime.json +0 -11
- package/fixtures/typescript/services/composer/platformatic.composer.json +0 -28
- package/fixtures/typescript/services/movies/.env +0 -4
- package/fixtures/typescript/services/movies/global.d.ts +0 -23
- package/fixtures/typescript/services/movies/migrations/001.do.sql +0 -6
- package/fixtures/typescript/services/movies/migrations/001.undo.sql +0 -3
- package/fixtures/typescript/services/movies/platformatic.db.json +0 -33
- package/fixtures/typescript/services/movies/plugin.ts +0 -5
- package/fixtures/typescript/services/movies/tsconfig.json +0 -21
- package/fixtures/typescript/services/movies/types/Movie.d.ts +0 -9
- package/fixtures/typescript/services/movies/types/index.d.ts +0 -7
- package/fixtures/typescript/services/titles/client/client.d.ts +0 -141
- package/fixtures/typescript/services/titles/client/client.openapi.json +0 -630
- package/fixtures/typescript/services/titles/client/package.json +0 -4
- package/fixtures/typescript/services/titles/platformatic.service.json +0 -31
- package/fixtures/typescript/services/titles/plugins/example.ts +0 -6
- package/fixtures/typescript/services/titles/routes/root.ts +0 -21
- package/fixtures/typescript/services/titles/tsconfig.json +0 -21
- package/fixtures/typescript-custom-flags/.env +0 -4
- package/fixtures/typescript-custom-flags/platformatic.runtime.json +0 -11
- package/fixtures/typescript-custom-flags/services/composer/platformatic.composer.json +0 -28
- package/fixtures/typescript-custom-flags/services/movies/global.d.ts +0 -23
- package/fixtures/typescript-custom-flags/services/movies/migrations/001.do.sql +0 -6
- package/fixtures/typescript-custom-flags/services/movies/migrations/001.undo.sql +0 -3
- package/fixtures/typescript-custom-flags/services/movies/platformatic.db.json +0 -35
- package/fixtures/typescript-custom-flags/services/movies/plugin.ts +0 -5
- package/fixtures/typescript-custom-flags/services/movies/tsconfig.json +0 -20
- package/fixtures/typescript-custom-flags/services/movies/types/Movie.d.ts +0 -9
- package/fixtures/typescript-custom-flags/services/movies/types/index.d.ts +0 -7
- package/fixtures/typescript-custom-flags/services/titles/client/client.d.ts +0 -141
- package/fixtures/typescript-custom-flags/services/titles/client/client.openapi.json +0 -630
- package/fixtures/typescript-custom-flags/services/titles/client/package.json +0 -4
- package/fixtures/typescript-custom-flags/services/titles/platformatic.service.json +0 -33
- package/fixtures/typescript-custom-flags/services/titles/plugins/example.ts +0 -6
- package/fixtures/typescript-custom-flags/services/titles/routes/root.ts +0 -21
- package/fixtures/typescript-custom-flags/services/titles/tsconfig.json +0 -21
- package/fixtures/typescript-no-env/platformatic.runtime.json +0 -11
- package/fixtures/typescript-no-env/services/composer/platformatic.composer.json +0 -28
- package/fixtures/typescript-no-env/services/movies/global.d.ts +0 -23
- package/fixtures/typescript-no-env/services/movies/migrations/001.do.sql +0 -6
- package/fixtures/typescript-no-env/services/movies/migrations/001.undo.sql +0 -3
- package/fixtures/typescript-no-env/services/movies/platformatic.db.json +0 -33
- package/fixtures/typescript-no-env/services/movies/plugin.ts +0 -5
- package/fixtures/typescript-no-env/services/movies/tsconfig.json +0 -21
- package/fixtures/typescript-no-env/services/movies/types/Movie.d.ts +0 -9
- package/fixtures/typescript-no-env/services/movies/types/index.d.ts +0 -7
- package/fixtures/typescript-no-env/services/titles/client/client.d.ts +0 -141
- package/fixtures/typescript-no-env/services/titles/client/client.openapi.json +0 -630
- package/fixtures/typescript-no-env/services/titles/client/package.json +0 -4
- package/fixtures/typescript-no-env/services/titles/platformatic.service.json +0 -31
- package/fixtures/typescript-no-env/services/titles/plugins/example.ts +0 -6
- package/fixtures/typescript-no-env/services/titles/routes/root.ts +0 -21
- package/fixtures/typescript-no-env/services/titles/tsconfig.json +0 -21
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const { request } = require('undici')
|
|
4
|
-
const { getGreeting } = require('./deps/dep1')
|
|
5
|
-
|
|
6
|
-
/** @param {import('fastify').FastifyInstance} app */
|
|
7
|
-
module.exports = async function (app) {
|
|
8
|
-
app.get('/', async () => {
|
|
9
|
-
return { hello: await getGreeting() + '123' }
|
|
10
|
-
})
|
|
11
|
-
|
|
12
|
-
app.get('/upstream', async () => {
|
|
13
|
-
const res = await request('http://with-logger.plt.local')
|
|
14
|
-
const text = await res.body.text()
|
|
15
|
-
return text
|
|
16
|
-
})
|
|
17
|
-
|
|
18
|
-
app.get('/crash', () => {
|
|
19
|
-
setImmediate(() => {
|
|
20
|
-
throw new Error('boom')
|
|
21
|
-
})
|
|
22
|
-
|
|
23
|
-
return 'ok'
|
|
24
|
-
})
|
|
25
|
-
|
|
26
|
-
app.get('/env', () => {
|
|
27
|
-
return process.env
|
|
28
|
-
})
|
|
29
|
-
}
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
// const pltClient = require('@platformatic/client')
|
|
4
|
-
const { join } = require('path')
|
|
5
|
-
|
|
6
|
-
async function plugin () {
|
|
7
|
-
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
async function generateWithLoggerClientPlugin (app, opts) {
|
|
11
|
-
app.register(plugin, {
|
|
12
|
-
type: 'openapi',
|
|
13
|
-
name: 'withLogger',
|
|
14
|
-
path: join(__dirname, 'with-logger.openapi.json'),
|
|
15
|
-
url: opts.url,
|
|
16
|
-
})
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
generateWithLoggerClientPlugin[Symbol.for('plugin-meta')] = {
|
|
20
|
-
name: 'withLogger OpenAPI Client',
|
|
21
|
-
}
|
|
22
|
-
generateWithLoggerClientPlugin[Symbol.for('skip-override')] = true
|
|
23
|
-
|
|
24
|
-
module.exports = generateWithLoggerClientPlugin
|
|
25
|
-
module.exports.default = generateWithLoggerClientPlugin
|
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify'
|
|
2
|
-
|
|
3
|
-
interface GetRequest {
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface GetResponse {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface WithLogger {
|
|
10
|
-
get(req: GetRequest): Promise<GetResponse>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type WithLoggerPlugin = FastifyPluginAsync<NonNullable<withLogger.WithLoggerOptions>>
|
|
14
|
-
|
|
15
|
-
declare module 'fastify' {
|
|
16
|
-
interface ConfigureWithLogger {
|
|
17
|
-
getHeaders(req: FastifyRequest, reply: FastifyReply): Promise<Record<string, string>>;
|
|
18
|
-
}
|
|
19
|
-
interface FastifyInstance {
|
|
20
|
-
withLogger: WithLogger;
|
|
21
|
-
configureWithLogger(opts: ConfigureWithLogger): unknown
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
interface FastifyRequest {
|
|
25
|
-
withLogger: WithLogger;
|
|
26
|
-
}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
declare namespace withLogger {
|
|
30
|
-
export interface WithLoggerOptions {
|
|
31
|
-
url: string
|
|
32
|
-
}
|
|
33
|
-
export const withLogger: WithLoggerPlugin
|
|
34
|
-
export { withLogger as default }
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
declare function withLogger (...params: Parameters<WithLoggerPlugin>): ReturnType<WithLoggerPlugin>
|
|
38
|
-
export = withLogger
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.3",
|
|
3
|
-
"info": {
|
|
4
|
-
"title": "Platformatic",
|
|
5
|
-
"description": "This is a service built on top of Platformatic",
|
|
6
|
-
"version": "1.0.0"
|
|
7
|
-
},
|
|
8
|
-
"components": {
|
|
9
|
-
"schemas": {}
|
|
10
|
-
},
|
|
11
|
-
"paths": {
|
|
12
|
-
"/": {
|
|
13
|
-
"get": {
|
|
14
|
-
"responses": {
|
|
15
|
-
"200": {
|
|
16
|
-
"description": "Default Response"
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/service/1.52.0.json",
|
|
3
|
-
"server": {
|
|
4
|
-
"hostname": "127.0.0.1",
|
|
5
|
-
"port": 0,
|
|
6
|
-
"logger": {
|
|
7
|
-
"name": "service-with-logger",
|
|
8
|
-
"level": "trace"
|
|
9
|
-
}
|
|
10
|
-
},
|
|
11
|
-
"service": {
|
|
12
|
-
"openapi": true
|
|
13
|
-
},
|
|
14
|
-
"plugins": {
|
|
15
|
-
"paths": [
|
|
16
|
-
"plugin.js"
|
|
17
|
-
]
|
|
18
|
-
},
|
|
19
|
-
"watch": true
|
|
20
|
-
}
|
|
@@ -1,20 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
/** @param {import('fastify').FastifyInstance} app */
|
|
4
|
-
module.exports = async function (app) {
|
|
5
|
-
app.get('/', async () => {
|
|
6
|
-
return { hello: 'world' }
|
|
7
|
-
})
|
|
8
|
-
|
|
9
|
-
let crashOnClose = false
|
|
10
|
-
app.get('/crash-on-close', { schema: { hide: true } }, async () => {
|
|
11
|
-
crashOnClose = true
|
|
12
|
-
})
|
|
13
|
-
|
|
14
|
-
app.addHook('onClose', async () => {
|
|
15
|
-
if (crashOnClose) {
|
|
16
|
-
app.log.info('Crashing process on purpose')
|
|
17
|
-
throw new Error('Crashing process on purpose')
|
|
18
|
-
}
|
|
19
|
-
})
|
|
20
|
-
}
|
|
@@ -1,28 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/service/1.52.0.json",
|
|
3
|
-
"server": {
|
|
4
|
-
"hostname": "127.0.0.1",
|
|
5
|
-
"port": 0
|
|
6
|
-
},
|
|
7
|
-
"service": {
|
|
8
|
-
"openapi": true
|
|
9
|
-
},
|
|
10
|
-
"plugins": {
|
|
11
|
-
"paths": [
|
|
12
|
-
{
|
|
13
|
-
"path": "plugin.js",
|
|
14
|
-
"options": {
|
|
15
|
-
"name": "plugin1"
|
|
16
|
-
}
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"path": "plugin2.mjs",
|
|
20
|
-
"options": {
|
|
21
|
-
"name": "plugin2"
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
]
|
|
25
|
-
},
|
|
26
|
-
"metrics": false,
|
|
27
|
-
"watch": true
|
|
28
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "https://schemas.platformatic.dev/@platformatic/composer/1.52.0.json",
|
|
3
|
-
"server": {
|
|
4
|
-
"hostname": "127.0.0.1",
|
|
5
|
-
"port": 0,
|
|
6
|
-
"logger": {
|
|
7
|
-
"level": "info"
|
|
8
|
-
},
|
|
9
|
-
"pluginTimeout": 0
|
|
10
|
-
},
|
|
11
|
-
"composer": {
|
|
12
|
-
"services": [
|
|
13
|
-
{
|
|
14
|
-
"id": "missing",
|
|
15
|
-
"openapi": {
|
|
16
|
-
"url": "/documentation/json",
|
|
17
|
-
"prefix": "/missing"
|
|
18
|
-
}
|
|
19
|
-
}
|
|
20
|
-
],
|
|
21
|
-
"refreshTimeout": 5000
|
|
22
|
-
},
|
|
23
|
-
"watch": false
|
|
24
|
-
}
|
|
@@ -1,204 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"openapi": "3.0.3",
|
|
3
|
-
"info": {
|
|
4
|
-
"version": "8.3.1",
|
|
5
|
-
"title": "@fastify/swagger"
|
|
6
|
-
},
|
|
7
|
-
"components": {
|
|
8
|
-
"schemas": {}
|
|
9
|
-
},
|
|
10
|
-
"paths": {
|
|
11
|
-
"/posts": {
|
|
12
|
-
"get": {
|
|
13
|
-
"responses": {
|
|
14
|
-
"200": {
|
|
15
|
-
"description": "Default Response",
|
|
16
|
-
"content": {
|
|
17
|
-
"application/json": {
|
|
18
|
-
"schema": {
|
|
19
|
-
"type": "array",
|
|
20
|
-
"items": {
|
|
21
|
-
"type": "object",
|
|
22
|
-
"properties": {
|
|
23
|
-
"id": {
|
|
24
|
-
"type": "number"
|
|
25
|
-
},
|
|
26
|
-
"name": {
|
|
27
|
-
"type": "string"
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
},
|
|
37
|
-
"post": {
|
|
38
|
-
"requestBody": {
|
|
39
|
-
"content": {
|
|
40
|
-
"application/json": {
|
|
41
|
-
"schema": {
|
|
42
|
-
"type": "object",
|
|
43
|
-
"properties": {
|
|
44
|
-
"name": {
|
|
45
|
-
"type": "string"
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
},
|
|
52
|
-
"responses": {
|
|
53
|
-
"200": {
|
|
54
|
-
"description": "Default Response",
|
|
55
|
-
"content": {
|
|
56
|
-
"application/json": {
|
|
57
|
-
"schema": {
|
|
58
|
-
"type": "object",
|
|
59
|
-
"properties": {
|
|
60
|
-
"id": {
|
|
61
|
-
"type": "number"
|
|
62
|
-
},
|
|
63
|
-
"name": {
|
|
64
|
-
"type": "string"
|
|
65
|
-
}
|
|
66
|
-
}
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
}
|
|
71
|
-
}
|
|
72
|
-
},
|
|
73
|
-
"put": {
|
|
74
|
-
"requestBody": {
|
|
75
|
-
"content": {
|
|
76
|
-
"application/json": {
|
|
77
|
-
"schema": {
|
|
78
|
-
"type": "object",
|
|
79
|
-
"properties": {
|
|
80
|
-
"id": {
|
|
81
|
-
"type": "number"
|
|
82
|
-
},
|
|
83
|
-
"name": {
|
|
84
|
-
"type": "string"
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
},
|
|
91
|
-
"responses": {
|
|
92
|
-
"200": {
|
|
93
|
-
"description": "Default Response",
|
|
94
|
-
"content": {
|
|
95
|
-
"application/json": {
|
|
96
|
-
"schema": {
|
|
97
|
-
"type": "object",
|
|
98
|
-
"properties": {
|
|
99
|
-
"id": {
|
|
100
|
-
"type": "number"
|
|
101
|
-
},
|
|
102
|
-
"name": {
|
|
103
|
-
"type": "string"
|
|
104
|
-
}
|
|
105
|
-
}
|
|
106
|
-
}
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}
|
|
110
|
-
}
|
|
111
|
-
}
|
|
112
|
-
},
|
|
113
|
-
"/posts/{id}": {
|
|
114
|
-
"get": {
|
|
115
|
-
"responses": {
|
|
116
|
-
"200": {
|
|
117
|
-
"description": "Default Response",
|
|
118
|
-
"content": {
|
|
119
|
-
"application/json": {
|
|
120
|
-
"schema": {
|
|
121
|
-
"type": "object",
|
|
122
|
-
"properties": {
|
|
123
|
-
"id": {
|
|
124
|
-
"type": "number"
|
|
125
|
-
},
|
|
126
|
-
"name": {
|
|
127
|
-
"type": "string"
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
},
|
|
136
|
-
"post": {
|
|
137
|
-
"responses": {
|
|
138
|
-
"200": {
|
|
139
|
-
"description": "Default Response",
|
|
140
|
-
"content": {
|
|
141
|
-
"application/json": {
|
|
142
|
-
"schema": {
|
|
143
|
-
"type": "object",
|
|
144
|
-
"properties": {
|
|
145
|
-
"id": {
|
|
146
|
-
"type": "number"
|
|
147
|
-
},
|
|
148
|
-
"name": {
|
|
149
|
-
"type": "string"
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
}
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
},
|
|
158
|
-
"put": {
|
|
159
|
-
"responses": {
|
|
160
|
-
"200": {
|
|
161
|
-
"description": "Default Response",
|
|
162
|
-
"content": {
|
|
163
|
-
"application/json": {
|
|
164
|
-
"schema": {
|
|
165
|
-
"type": "object",
|
|
166
|
-
"properties": {
|
|
167
|
-
"id": {
|
|
168
|
-
"type": "number"
|
|
169
|
-
},
|
|
170
|
-
"name": {
|
|
171
|
-
"type": "string"
|
|
172
|
-
}
|
|
173
|
-
}
|
|
174
|
-
}
|
|
175
|
-
}
|
|
176
|
-
}
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
"delete": {
|
|
181
|
-
"responses": {
|
|
182
|
-
"200": {
|
|
183
|
-
"description": "Default Response",
|
|
184
|
-
"content": {
|
|
185
|
-
"application/json": {
|
|
186
|
-
"schema": {
|
|
187
|
-
"type": "object",
|
|
188
|
-
"properties": {
|
|
189
|
-
"id": {
|
|
190
|
-
"type": "number"
|
|
191
|
-
},
|
|
192
|
-
"name": {
|
|
193
|
-
"type": "string"
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
}
|