@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
|
@@ -1,16 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
module.exports = async function (app) {
|
|
4
|
-
app.graphql.extendSchema(`
|
|
5
|
-
extend type Query {
|
|
6
|
-
hello: String
|
|
7
|
-
}
|
|
8
|
-
`)
|
|
9
|
-
app.graphql.defineResolvers({
|
|
10
|
-
Query: {
|
|
11
|
-
hello: async function (root, args, context) {
|
|
12
|
-
throw new Error('Kaboooooom!!!')
|
|
13
|
-
}
|
|
14
|
-
}
|
|
15
|
-
})
|
|
16
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"pretty": false,
|
|
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,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"logger": {
|
|
4
|
-
"level": "info"
|
|
5
|
-
},
|
|
6
|
-
"hostname": "127.0.0.1",
|
|
7
|
-
"port": "0",
|
|
8
|
-
"pluginTimeout": 60000,
|
|
9
|
-
"keepAliveTimeout": 1
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["plugin.ts"],
|
|
13
|
-
"typescript": {
|
|
14
|
-
"outDir": "compiled"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
|
@@ -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,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"logger": {
|
|
4
|
-
"level": "info"
|
|
5
|
-
},
|
|
6
|
-
"hostname": "127.0.0.1",
|
|
7
|
-
"port": "0",
|
|
8
|
-
"pluginTimeout": 60000,
|
|
9
|
-
"keepAliveTimeout": 1
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["plugin.ts"],
|
|
13
|
-
"typescript": {
|
|
14
|
-
"flags": ["-b"]
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"pretty": false,
|
|
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,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,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"logger": {
|
|
4
|
-
"level": "info"
|
|
5
|
-
},
|
|
6
|
-
"hostname": "127.0.0.1",
|
|
7
|
-
"port": "0",
|
|
8
|
-
"pluginTimeout": 60000,
|
|
9
|
-
"keepAliveTimeout": 1
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["plugin.ts"],
|
|
13
|
-
"typescript": {
|
|
14
|
-
"tsConfig": "./a-config-for-ts.json"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"pretty": false,
|
|
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,18 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"server": {
|
|
3
|
-
"logger": {
|
|
4
|
-
"level": "info"
|
|
5
|
-
},
|
|
6
|
-
"hostname": "127.0.0.1",
|
|
7
|
-
"port": "0",
|
|
8
|
-
"pluginTimeout": 60000,
|
|
9
|
-
"keepAliveTimeout": 1
|
|
10
|
-
},
|
|
11
|
-
"plugins": {
|
|
12
|
-
"paths": ["plugin.ts"],
|
|
13
|
-
"typescript": {
|
|
14
|
-
"enabled": "false"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"watch": false
|
|
18
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"pretty": false,
|
|
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,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,22 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"compilerOptions": {
|
|
3
|
-
"module": "commonjs",
|
|
4
|
-
"esModuleInterop": true,
|
|
5
|
-
"target": "es2020",
|
|
6
|
-
"moduleResolution": "node",
|
|
7
|
-
"sourceMap": false,
|
|
8
|
-
"pretty": false,
|
|
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,15 +0,0 @@
|
|
|
1
|
-
'use strict'
|
|
2
|
-
|
|
3
|
-
const undici = require('undici')
|
|
4
|
-
|
|
5
|
-
module.exports = async function (app) {
|
|
6
|
-
app.get('/request', async function () {
|
|
7
|
-
try {
|
|
8
|
-
const res = await undici.request('http://localhost:42')
|
|
9
|
-
return await res.body.json()
|
|
10
|
-
} catch (err) {
|
|
11
|
-
console.log(err)
|
|
12
|
-
throw err
|
|
13
|
-
}
|
|
14
|
-
})
|
|
15
|
-
}
|