@platformatic/service 0.46.1 → 0.47.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/.c8rc +6 -0
- package/config.d.ts +0 -1
- package/index.d.ts +25 -0
- package/index.js +1 -0
- package/index.test-d.ts +24 -1
- package/lib/schema.js +0 -3
- package/package.json +9 -7
- package/fixtures/hello/no-server-logger.json +0 -13
- package/fixtures/hello/platformatic.service.json +0 -18
- package/fixtures/hello/plugin.js +0 -7
- package/fixtures/hello/warn-log.service.json +0 -18
- package/fixtures/hello-client/hello/hello.cjs +0 -21
- package/fixtures/hello-client/hello/hello.d.ts +0 -34
- package/fixtures/hello-client/hello/hello.openapi.json +0 -22
- package/fixtures/hello-client/hello/package.json +0 -5
- package/fixtures/hello-client/platformatic.service.json +0 -19
- package/fixtures/hello-client/plugin.js +0 -8
- package/fixtures/hello-client-ts/hello/hello.cjs +0 -21
- package/fixtures/hello-client-ts/hello/hello.d.ts +0 -34
- package/fixtures/hello-client-ts/hello/hello.openapi.json +0 -22
- package/fixtures/hello-client-ts/hello/package.json +0 -5
- package/fixtures/hello-client-ts/platformatic.service.json +0 -21
- package/fixtures/hello-client-ts/plugin.ts +0 -8
- package/fixtures/hello-client-ts/tsconfig.json +0 -23
- package/fixtures/hello-client-ts-without-deps/hello.d.ts +0 -34
- package/fixtures/hello-client-ts-without-deps/hello.openapi.json +0 -22
- package/fixtures/hello-client-ts-without-deps/platformatic.service.json +0 -23
- package/fixtures/hello-client-ts-without-deps/plugin.ts +0 -8
- package/fixtures/hello-client-ts-without-deps/tsconfig.json +0 -22
- package/fixtures/hello-client-without-deps/hello.d.ts +0 -34
- package/fixtures/hello-client-without-deps/hello.openapi.json +0 -22
- package/fixtures/hello-client-without-deps/platformatic.service.json +0 -21
- package/fixtures/hello-client-without-deps/plugin.js +0 -8
- package/fixtures/https/embedded-pem.json +0 -20
- package/fixtures/https/https.crt +0 -25
- package/fixtures/https/https.key +0 -27
- package/fixtures/https/pem-path.json +0 -20
- package/fixtures/https/plugin.js +0 -7
- package/fixtures/options/platformatic.service.yml +0 -9
- package/fixtures/options/plugin.js +0 -7
- package/test/autoload.test.js +0 -486
- package/test/cli/compile-1.test.mjs +0 -352
- package/test/cli/compile-2.test.mjs +0 -310
- package/test/cli/gen-schema.test.mjs +0 -44
- package/test/cli/gen-types.test.mjs +0 -30
- package/test/cli/helper.mjs +0 -67
- package/test/cli/start.test.mjs +0 -126
- package/test/cli/tap-parallel-not-ok +0 -0
- package/test/cli/validations.test.mjs +0 -33
- package/test/clients.test.js +0 -87
- package/test/config.test.js +0 -316
- package/test/cors.test.js +0 -291
- package/test/fixtures/bad-typescript-plugin/platformatic.service.json +0 -16
- package/test/fixtures/bad-typescript-plugin/plugin.ts +0 -5
- package/test/fixtures/bad-typescript-plugin/tsconfig.json +0 -22
- package/test/fixtures/custom-port-placeholder.json +0 -10
- package/test/fixtures/default-env-var-names.json +0 -7
- package/test/fixtures/directories/platformatic.service.json +0 -13
- package/test/fixtures/directories/plugins/decorator.js +0 -7
- package/test/fixtures/directories/routes/foo/bar.js +0 -11
- package/test/fixtures/directories/routes/foo/baz/index.js +0 -7
- package/test/fixtures/directories/routes/foo/baz/index2.js +0 -11
- package/test/fixtures/directories/routes/oof/auto.hooks.js +0 -5
- package/test/fixtures/directories/routes/oof/index.js +0 -7
- package/test/fixtures/directories/routes/root.js +0 -7
- package/test/fixtures/hello-ts-with-config/global.d.ts +0 -8
- package/test/fixtures/hello-ts-with-config/platformatic.service.json +0 -16
- package/test/fixtures/hello-ts-with-config/plugin.ts +0 -8
- package/test/fixtures/hello-ts-with-config/tsconfig.json +0 -23
- package/test/fixtures/hello-world-resolver.js +0 -16
- package/test/fixtures/missing-property.config.json +0 -1
- package/test/fixtures/nested-directories/modules/catalogue/index.js +0 -11
- package/test/fixtures/nested-directories/modules/catalogue/routes/products.js +0 -14
- package/test/fixtures/nested-directories/modules/inventory/index.js +0 -33
- package/test/fixtures/nested-directories/modules/inventory/routes/product.js +0 -15
- package/test/fixtures/nested-directories/package.json +0 -3
- package/test/fixtures/nested-directories/platformatic.service.json +0 -23
- package/test/fixtures/nested-directories/plugins/decorator.js +0 -3
- package/test/fixtures/nested-directories/plugins/handlers.js +0 -17
- package/test/fixtures/not-load.js +0 -8
- package/test/fixtures/not-load.service.json +0 -13
- package/test/fixtures/other-side.js +0 -9
- package/test/fixtures/request-id.js +0 -9
- package/test/fixtures/root-endpoint-plugin.js +0 -8
- package/test/fixtures/throw-resolver.js +0 -16
- package/test/fixtures/typescript-autoload/platformatic.service.json +0 -16
- package/test/fixtures/typescript-autoload/routes/plugin.ts +0 -5
- package/test/fixtures/typescript-autoload/tsconfig.json +0 -22
- package/test/fixtures/typescript-compiled/compiled/plugin.js +0 -6
- package/test/fixtures/typescript-compiled/platformatic.service.json +0 -18
- package/test/fixtures/typescript-plugin/platformatic.service.json +0 -16
- package/test/fixtures/typescript-plugin/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin/tsconfig.json +0 -22
- package/test/fixtures/typescript-plugin-custom-flags/platformatic.service.json +0 -18
- package/test/fixtures/typescript-plugin-custom-flags/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-custom-flags/tsconfig.json +0 -22
- package/test/fixtures/typescript-plugin-custom-tsconfig/a-config-for-ts.json +0 -22
- package/test/fixtures/typescript-plugin-custom-tsconfig/platformatic.service.json +0 -18
- package/test/fixtures/typescript-plugin-custom-tsconfig/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-nocompile/platformatic.service.json +0 -16
- package/test/fixtures/typescript-plugin-nocompile/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-nocompile/tsconfig.json +0 -22
- package/test/fixtures/typescript-plugin-nocompile-enabled/platformatic.service.json +0 -18
- package/test/fixtures/typescript-plugin-nocompile-enabled/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-nocompile-enabled/tsconfig.json +0 -22
- package/test/fixtures/typescript-plugin-nocompile-string/platformatic.service.json +0 -16
- package/test/fixtures/typescript-plugin-nocompile-string/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-nocompile-string/tsconfig.json +0 -22
- package/test/fixtures/typescript-plugin-string/platformatic.service.json +0 -16
- package/test/fixtures/typescript-plugin-string/plugin.ts +0 -5
- package/test/fixtures/typescript-plugin-string/tsconfig.json +0 -22
- package/test/fixtures/undici-plugin.js +0 -15
- package/test/graphql.test.js +0 -219
- package/test/healthcheck.test.js +0 -92
- package/test/helper.js +0 -30
- package/test/https.test.js +0 -64
- package/test/lambda.test.js +0 -103
- package/test/load-and-reload-files.test.js +0 -180
- package/test/load-plugin.test.js +0 -67
- package/test/metrics.test.js +0 -220
- package/test/routes.test.js +0 -230
- package/test/schema.test.js +0 -12
- package/test/tap-parallel-ok +0 -0
- package/test/telemetry.test.js +0 -87
- package/test/utils.test.js +0 -37
package/.c8rc
ADDED
package/config.d.ts
CHANGED
package/index.d.ts
CHANGED
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
/// <reference types="@fastify/swagger" />
|
|
4
4
|
import { FastifyInstance } from 'fastify'
|
|
5
5
|
import ConfigManager from '@platformatic/config'
|
|
6
|
+
import type { IConfigManagerOptions } from '@platformatic/config'
|
|
6
7
|
import { PlatformaticService } from './config'
|
|
8
|
+
import type { JSONSchemaType } from 'ajv'
|
|
7
9
|
|
|
8
10
|
export interface PlatformaticApp<T> {
|
|
9
11
|
configManager: ConfigManager<T>
|
|
@@ -19,3 +21,26 @@ declare module 'fastify' {
|
|
|
19
21
|
restart: () => Promise<void>
|
|
20
22
|
}
|
|
21
23
|
}
|
|
24
|
+
|
|
25
|
+
export interface ConfigManagerConfig<T> extends Omit<IConfigManagerOptions, 'source' | 'watch' | 'schema'> {
|
|
26
|
+
transformConfig: (this: ConfigManager<T>) => Promise<void>
|
|
27
|
+
schema: object
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
export interface Stackable<ConfigType> {
|
|
31
|
+
(app: FastifyInstance, opts: object): Promise<void>
|
|
32
|
+
|
|
33
|
+
configType: string
|
|
34
|
+
configManagerConfig: ConfigManagerConfig<ConfigType>
|
|
35
|
+
schema: object
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
interface SchemaExport {
|
|
39
|
+
schema: JSONSchemaType<PlatformaticServiceConfig>
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
export const schema: SchemaExport
|
|
43
|
+
|
|
44
|
+
export declare const platformaticService: Stackable<PlatformaticServiceConfig>
|
|
45
|
+
|
|
46
|
+
export default platformaticService
|
package/index.js
CHANGED
|
@@ -54,6 +54,7 @@ async function platformaticService (app, opts, toLoad = []) {
|
|
|
54
54
|
if (config.plugins) {
|
|
55
55
|
let registerTsCompiler = false
|
|
56
56
|
const typescript = config.plugins.typescript
|
|
57
|
+
/* c8 ignore next 6 */
|
|
57
58
|
if (typescript === true) {
|
|
58
59
|
registerTsCompiler = true
|
|
59
60
|
} else if (typeof typescript === 'object') {
|
package/index.test-d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { expectType } from 'tsd'
|
|
2
2
|
import { FastifyInstance } from 'fastify'
|
|
3
|
-
import { buildServer, PlatformaticApp } from '.'
|
|
3
|
+
import { buildServer, PlatformaticApp, platformaticService, Stackable, PlatformaticServiceConfig } from '.'
|
|
4
4
|
import ConfigManager from '@platformatic/config'
|
|
5
5
|
import { OpenAPI } from 'openapi-types'
|
|
6
6
|
import type { MercuriusPlugin } from 'mercurius'
|
|
@@ -22,3 +22,26 @@ expectType<PlatformaticService>(server.platformatic.config)
|
|
|
22
22
|
expectType<OpenAPI.Document>(server.swagger())
|
|
23
23
|
expectType<MercuriusPlugin>(server.graphql)
|
|
24
24
|
expectType<Promise<void>>(server.restart())
|
|
25
|
+
|
|
26
|
+
function buildStackable (): Stackable<PlatformaticServiceConfig> {
|
|
27
|
+
async function myApp (app: FastifyInstance, opts: object): Promise<void> {
|
|
28
|
+
await platformaticService(app, opts)
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
myApp.schema = platformaticService.configManagerConfig.schema
|
|
32
|
+
myApp.configType = 'myApp'
|
|
33
|
+
myApp.configManagerConfig = {
|
|
34
|
+
...platformaticService.configManagerConfig,
|
|
35
|
+
async transformConfig (this: ConfigManager<PlatformaticServiceConfig>) {
|
|
36
|
+
this.current.plugins = {
|
|
37
|
+
paths: [{
|
|
38
|
+
path: 'my-plugin'
|
|
39
|
+
}]
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
return myApp
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
expectType<Stackable<PlatformaticServiceConfig>>(buildStackable())
|
package/lib/schema.js
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.47.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"@fastify/swagger-ui": "^1.9.0",
|
|
49
49
|
"@fastify/under-pressure": "^8.2.0",
|
|
50
50
|
"@mercuriusjs/federation": "^2.0.0",
|
|
51
|
+
"@types/ws": "^8.5.5",
|
|
52
|
+
"ajv": "^8.12.0",
|
|
51
53
|
"close-with-grace": "^1.2.0",
|
|
52
54
|
"commist": "^3.2.0",
|
|
53
55
|
"desm": "^1.3.0",
|
|
@@ -56,7 +58,7 @@
|
|
|
56
58
|
"execa": "^8.0.0",
|
|
57
59
|
"fastify": "^4.18.0",
|
|
58
60
|
"fastify-metrics": "^10.3.0",
|
|
59
|
-
"fastify-plugin": "^4.5.
|
|
61
|
+
"fastify-plugin": "^4.5.1",
|
|
60
62
|
"graphql": "^16.6.0",
|
|
61
63
|
"help-me": "^4.2.0",
|
|
62
64
|
"mercurius": "^13.0.0",
|
|
@@ -65,11 +67,11 @@
|
|
|
65
67
|
"pino-pretty": "^10.0.0",
|
|
66
68
|
"rfdc": "^1.3.0",
|
|
67
69
|
"ua-parser-js": "^1.0.35",
|
|
68
|
-
"@platformatic/client": "0.
|
|
69
|
-
"@platformatic/config": "0.
|
|
70
|
-
"@platformatic/swagger-ui-theme": "0.
|
|
71
|
-
"@platformatic/
|
|
72
|
-
"@platformatic/
|
|
70
|
+
"@platformatic/client": "0.47.0",
|
|
71
|
+
"@platformatic/config": "0.47.0",
|
|
72
|
+
"@platformatic/swagger-ui-theme": "0.47.0",
|
|
73
|
+
"@platformatic/telemetry": "0.47.0",
|
|
74
|
+
"@platformatic/utils": "0.47.0"
|
|
73
75
|
},
|
|
74
76
|
"standard": {
|
|
75
77
|
"ignore": [
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "info",
|
|
7
|
-
"name": "hello server"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"plugins": {
|
|
11
|
-
"paths": ["./plugin.js"]
|
|
12
|
-
},
|
|
13
|
-
"service": {
|
|
14
|
-
"openapi": true
|
|
15
|
-
},
|
|
16
|
-
"metrics": false,
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
package/fixtures/hello/plugin.js
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"name": "hello server"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"plugins": {
|
|
11
|
-
"paths": ["./plugin.js"]
|
|
12
|
-
},
|
|
13
|
-
"service": {
|
|
14
|
-
"openapi": true
|
|
15
|
-
},
|
|
16
|
-
"metrics": false,
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const pltClient = require('@platformatic/client')
|
|
4
|
-
const { join } = require('path')
|
|
5
|
-
|
|
6
|
-
async function generateHelloClientPlugin (app, opts) {
|
|
7
|
-
app.register(pltClient, {
|
|
8
|
-
type: 'openapi',
|
|
9
|
-
name: 'hello',
|
|
10
|
-
path: join(__dirname, 'hello.openapi.json'),
|
|
11
|
-
url: opts.url
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
generateHelloClientPlugin[Symbol.for('plugin-meta')] = {
|
|
16
|
-
name: 'hello OpenAPI Client'
|
|
17
|
-
}
|
|
18
|
-
generateHelloClientPlugin[Symbol.for('skip-override')] = true
|
|
19
|
-
|
|
20
|
-
module.exports = generateHelloClientPlugin
|
|
21
|
-
module.exports.default = generateHelloClientPlugin
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify'
|
|
2
|
-
|
|
3
|
-
interface GetRequest {
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface GetResponse {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface Hello {
|
|
10
|
-
get(req: GetRequest): Promise<GetResponse>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type HelloPlugin = FastifyPluginAsync<NonNullable<hello.HelloOptions>>
|
|
14
|
-
|
|
15
|
-
declare module 'fastify' {
|
|
16
|
-
interface FastifyInstance {
|
|
17
|
-
'hello': Hello;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface FastifyRequest {
|
|
21
|
-
'hello': Hello;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare namespace hello {
|
|
26
|
-
export interface HelloOptions {
|
|
27
|
-
url: string
|
|
28
|
-
}
|
|
29
|
-
export const hello: HelloPlugin;
|
|
30
|
-
export { hello as default };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare function hello(...params: Parameters<HelloPlugin>): ReturnType<HelloPlugin>;
|
|
34
|
-
export = hello;
|
|
@@ -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,19 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"name": "hello client"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"plugins": {
|
|
11
|
-
"paths": ["./plugin.js"]
|
|
12
|
-
},
|
|
13
|
-
"clients": [{
|
|
14
|
-
"path": "hello",
|
|
15
|
-
"url": "{PLT_CLIENT_URL}"
|
|
16
|
-
}],
|
|
17
|
-
"metrics": false,
|
|
18
|
-
"watch": false
|
|
19
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const pltClient = require('@platformatic/client')
|
|
4
|
-
const { join } = require('path')
|
|
5
|
-
|
|
6
|
-
async function generateHelloClientPlugin (app, opts) {
|
|
7
|
-
app.register(pltClient, {
|
|
8
|
-
type: 'openapi',
|
|
9
|
-
name: 'hello',
|
|
10
|
-
path: join(__dirname, 'hello.openapi.json'),
|
|
11
|
-
url: opts.url
|
|
12
|
-
})
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
generateHelloClientPlugin[Symbol.for('plugin-meta')] = {
|
|
16
|
-
name: 'hello OpenAPI Client'
|
|
17
|
-
}
|
|
18
|
-
generateHelloClientPlugin[Symbol.for('skip-override')] = true
|
|
19
|
-
|
|
20
|
-
module.exports = generateHelloClientPlugin
|
|
21
|
-
module.exports.default = generateHelloClientPlugin
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify'
|
|
2
|
-
|
|
3
|
-
interface GetRequest {
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface GetResponse {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface Hello {
|
|
10
|
-
get(req: GetRequest): Promise<GetResponse>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type HelloPlugin = FastifyPluginAsync<NonNullable<hello.HelloOptions>>
|
|
14
|
-
|
|
15
|
-
declare module 'fastify' {
|
|
16
|
-
interface FastifyInstance {
|
|
17
|
-
'hello': Hello;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface FastifyRequest {
|
|
21
|
-
'hello': Hello;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare namespace hello {
|
|
26
|
-
export interface HelloOptions {
|
|
27
|
-
url: string
|
|
28
|
-
}
|
|
29
|
-
export const hello: HelloPlugin;
|
|
30
|
-
export { hello as default };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare function hello(...params: Parameters<HelloPlugin>): ReturnType<HelloPlugin>;
|
|
34
|
-
export = hello;
|
|
@@ -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,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"name": "hello client ts"
|
|
8
|
-
},
|
|
9
|
-
"pluginTimeout": 30000
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["./plugin.ts"],
|
|
13
|
-
"typescript": true
|
|
14
|
-
},
|
|
15
|
-
"clients": [{
|
|
16
|
-
"path": "hello",
|
|
17
|
-
"url": "{PLT_CLIENT_URL}"
|
|
18
|
-
}],
|
|
19
|
-
"metrics": false,
|
|
20
|
-
"watch": false
|
|
21
|
-
}
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"incremental": true,
|
|
9
|
-
"pretty": true,
|
|
10
|
-
"noEmitOnError": true,
|
|
11
|
-
"outDir": "dist"
|
|
12
|
-
},
|
|
13
|
-
"watchOptions": {
|
|
14
|
-
"watchFile": "fixedPollingInterval",
|
|
15
|
-
"watchDirectory": "fixedPollingInterval",
|
|
16
|
-
"fallbackPolling": "dynamicPriority",
|
|
17
|
-
"synchronousWatchDirectory": true,
|
|
18
|
-
"excludeDirectories": [
|
|
19
|
-
"**/node_modules",
|
|
20
|
-
"dist"
|
|
21
|
-
]
|
|
22
|
-
}
|
|
23
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify'
|
|
2
|
-
|
|
3
|
-
interface GetRequest {
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface GetResponse {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface Hello {
|
|
10
|
-
get(req: GetRequest): Promise<GetResponse>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type HelloPlugin = FastifyPluginAsync<NonNullable<hello.HelloOptions>>
|
|
14
|
-
|
|
15
|
-
declare module 'fastify' {
|
|
16
|
-
interface FastifyInstance {
|
|
17
|
-
'hello': Hello;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface FastifyRequest {
|
|
21
|
-
'hello': Hello;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare namespace hello {
|
|
26
|
-
export interface HelloOptions {
|
|
27
|
-
url: string
|
|
28
|
-
}
|
|
29
|
-
export const hello: HelloPlugin;
|
|
30
|
-
export { hello as default };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare function hello(...params: Parameters<HelloPlugin>): ReturnType<HelloPlugin>;
|
|
34
|
-
export = hello;
|
|
@@ -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,23 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"name": "hello client ts"
|
|
8
|
-
},
|
|
9
|
-
"pluginTimeout": 30000
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["./plugin.ts"],
|
|
13
|
-
"typescript": true
|
|
14
|
-
},
|
|
15
|
-
"clients": [{
|
|
16
|
-
"schema": "./hello.openapi.json",
|
|
17
|
-
"name": "hello",
|
|
18
|
-
"type": "openapi",
|
|
19
|
-
"url": "{PLT_CLIENT_URL}"
|
|
20
|
-
}],
|
|
21
|
-
"metrics": false,
|
|
22
|
-
"watch": false
|
|
23
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es6",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": true,
|
|
8
|
-
"pretty": true,
|
|
9
|
-
"noEmitOnError": true,
|
|
10
|
-
"outDir": "dist"
|
|
11
|
-
},
|
|
12
|
-
"watchOptions": {
|
|
13
|
-
"watchFile": "fixedPollingInterval",
|
|
14
|
-
"watchDirectory": "fixedPollingInterval",
|
|
15
|
-
"fallbackPolling": "dynamicPriority",
|
|
16
|
-
"synchronousWatchDirectory": true,
|
|
17
|
-
"excludeDirectories": [
|
|
18
|
-
"**/node_modules",
|
|
19
|
-
"dist"
|
|
20
|
-
]
|
|
21
|
-
}
|
|
22
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
import { FastifyPluginAsync } from 'fastify'
|
|
2
|
-
|
|
3
|
-
interface GetRequest {
|
|
4
|
-
}
|
|
5
|
-
|
|
6
|
-
interface GetResponse {
|
|
7
|
-
}
|
|
8
|
-
|
|
9
|
-
interface Hello {
|
|
10
|
-
get(req: GetRequest): Promise<GetResponse>;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
type HelloPlugin = FastifyPluginAsync<NonNullable<hello.HelloOptions>>
|
|
14
|
-
|
|
15
|
-
declare module 'fastify' {
|
|
16
|
-
interface FastifyInstance {
|
|
17
|
-
'hello': Hello;
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
interface FastifyRequest {
|
|
21
|
-
'hello': Hello;
|
|
22
|
-
}
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
declare namespace hello {
|
|
26
|
-
export interface HelloOptions {
|
|
27
|
-
url: string
|
|
28
|
-
}
|
|
29
|
-
export const hello: HelloPlugin;
|
|
30
|
-
export { hello as default };
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
declare function hello(...params: Parameters<HelloPlugin>): ReturnType<HelloPlugin>;
|
|
34
|
-
export = hello;
|
|
@@ -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,21 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"hostname": "127.0.0.1",
|
|
4
|
-
"port": 0,
|
|
5
|
-
"logger": {
|
|
6
|
-
"level": "warn",
|
|
7
|
-
"name": "hello client"
|
|
8
|
-
}
|
|
9
|
-
},
|
|
10
|
-
"plugins": {
|
|
11
|
-
"paths": ["./plugin.js"]
|
|
12
|
-
},
|
|
13
|
-
"clients": [{
|
|
14
|
-
"schema": "./hello.openapi.json",
|
|
15
|
-
"name": "hello",
|
|
16
|
-
"type": "openapi",
|
|
17
|
-
"url": "{PLT_CLIENT_URL}"
|
|
18
|
-
}],
|
|
19
|
-
"metrics": false,
|
|
20
|
-
"watch": false
|
|
21
|
-
}
|