@platformatic/service 2.74.3 → 3.0.0-alpha.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 +2 -30
- package/eslint.config.js +4 -6
- package/index.d.ts +55 -47
- package/index.js +44 -199
- package/lib/application.js +35 -0
- package/lib/compile.js +1 -52
- package/lib/generator.js +424 -0
- package/lib/plugins/cors.js +5 -8
- package/lib/plugins/graphql.js +16 -14
- package/lib/plugins/health-check.js +6 -8
- package/lib/plugins/openapi.js +40 -31
- package/lib/plugins/plugins.js +6 -53
- package/lib/{root-endpoint/index.js → plugins/root.js} +9 -8
- package/lib/plugins/sandbox-wrapper.js +62 -55
- package/lib/schema.js +1028 -203
- package/lib/stackable.js +171 -338
- package/lib/upgrade.js +6 -8
- package/lib/utils.js +30 -93
- package/lib/versions/0.16.0.js +14 -15
- package/lib/versions/{from-zero-twenty-eight-to-will-see.js → 0.28.0.js} +3 -6
- package/lib/versions/2.0.0.js +4 -7
- package/lib/versions/3.0.0.js +14 -0
- package/package.json +18 -25
- package/schema.json +10 -155
- package/tsconfig.json +16 -6
- package/.c8rc +0 -6
- package/help/compile.txt +0 -19
- package/help/create.txt +0 -11
- package/help/help.txt +0 -8
- package/help/schema.txt +0 -9
- package/help/start.txt +0 -23
- package/index.test-d.ts +0 -107
- package/lib/create.mjs +0 -85
- package/lib/gen-schema.js +0 -15
- package/lib/gen-types.mjs +0 -38
- package/lib/generator/README.md +0 -31
- package/lib/generator/service-generator.d.ts +0 -11
- package/lib/generator/service-generator.js +0 -126
- package/lib/openapi-schema-defs.js +0 -1108
- package/lib/plugins/clients.js +0 -16
- package/lib/plugins/metrics.js +0 -244
- package/lib/plugins/typescript.js +0 -20
- package/lib/start.js +0 -190
- package/service.mjs +0 -71
- /package/{lib/root-endpoint/public → public}/images/dark_mode.svg +0 -0
- /package/{lib/root-endpoint/public → public}/images/favicon.ico +0 -0
- /package/{lib/root-endpoint/public → public}/images/light_mode.svg +0 -0
- /package/{lib/root-endpoint/public → public}/images/platformatic-logo-dark.svg +0 -0
- /package/{lib/root-endpoint/public → public}/images/platformatic-logo-light.svg +0 -0
- /package/{lib/root-endpoint/public → public}/images/triangle_dark.svg +0 -0
- /package/{lib/root-endpoint/public → public}/images/triangle_light.svg +0 -0
- /package/{lib/root-endpoint/public → public}/index.html +0 -0
package/lib/utils.js
CHANGED
|
@@ -1,90 +1,9 @@
|
|
|
1
|
-
|
|
1
|
+
import { access, readFile, stat } from 'node:fs/promises'
|
|
2
|
+
import { resolve } from 'node:path'
|
|
2
3
|
|
|
3
|
-
|
|
4
|
-
const { resolve, join, relative, dirname, basename } = require('node:path')
|
|
5
|
-
const { isatty } = require('tty')
|
|
6
|
-
const { setPinoFormatters, setPinoTimestamp } = require('@platformatic/utils')
|
|
4
|
+
let _isDocker
|
|
7
5
|
|
|
8
|
-
async function
|
|
9
|
-
try {
|
|
10
|
-
const filePath = directory ? resolve(directory, filename) : filename
|
|
11
|
-
await access(filePath)
|
|
12
|
-
return true
|
|
13
|
-
} catch (err) {
|
|
14
|
-
return false
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
/* c8 ignore start */
|
|
19
|
-
function addLoggerToTheConfig (config) {
|
|
20
|
-
if (config.server?.loggerInstance) {
|
|
21
|
-
return
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
// We might have a config with no server
|
|
25
|
-
if (!config.server) {
|
|
26
|
-
config.server = {}
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
let logger = config.server.logger
|
|
30
|
-
if (!logger) {
|
|
31
|
-
config.server.logger = { level: 'info' }
|
|
32
|
-
logger = config.server.logger
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
// If TTY use pino-pretty
|
|
36
|
-
if (isatty(1)) {
|
|
37
|
-
if (!logger.transport) {
|
|
38
|
-
logger.transport = {
|
|
39
|
-
target: 'pino-pretty',
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
if (config.server.logger?.formatters) {
|
|
45
|
-
setPinoFormatters(config.server.logger)
|
|
46
|
-
}
|
|
47
|
-
if (config.server.logger?.timestamp) {
|
|
48
|
-
setPinoTimestamp(config.server.logger)
|
|
49
|
-
}
|
|
50
|
-
}
|
|
51
|
-
/* c8 ignore stop */
|
|
52
|
-
|
|
53
|
-
function getJSPluginPath (workingDir, tsPluginPath, compileDir) {
|
|
54
|
-
if (tsPluginPath.endsWith('js')) {
|
|
55
|
-
return tsPluginPath
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
if (tsPluginPath.indexOf(compileDir) === 0) {
|
|
59
|
-
// In this case, we passed through this function before and we have adjusted
|
|
60
|
-
// the path of the plugin to point to the dist/ folder. Then we restarted.
|
|
61
|
-
// Therefore, we can just return the path as is.
|
|
62
|
-
return tsPluginPath
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
const isTs = tsPluginPath.endsWith('ts')
|
|
66
|
-
let newBaseName
|
|
67
|
-
|
|
68
|
-
// TODO: investigate why c8 does not see those
|
|
69
|
-
/* c8 ignore next 5 */
|
|
70
|
-
if (isTs) {
|
|
71
|
-
newBaseName = basename(tsPluginPath, '.ts') + '.js'
|
|
72
|
-
} else {
|
|
73
|
-
newBaseName = basename(tsPluginPath)
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
const tsPluginRelativePath = relative(workingDir, tsPluginPath)
|
|
77
|
-
const jsPluginRelativePath = join(
|
|
78
|
-
dirname(tsPluginRelativePath),
|
|
79
|
-
newBaseName
|
|
80
|
-
)
|
|
81
|
-
|
|
82
|
-
return join(compileDir, jsPluginRelativePath)
|
|
83
|
-
}
|
|
84
|
-
|
|
85
|
-
let isDockerCached
|
|
86
|
-
|
|
87
|
-
async function isDocker () {
|
|
6
|
+
export async function isDocker () {
|
|
88
7
|
async function hasDockerEnv () {
|
|
89
8
|
try {
|
|
90
9
|
await stat('/.dockerenv')
|
|
@@ -102,16 +21,34 @@ async function isDocker () {
|
|
|
102
21
|
}
|
|
103
22
|
}
|
|
104
23
|
|
|
105
|
-
if (
|
|
106
|
-
|
|
24
|
+
if (_isDocker === undefined) {
|
|
25
|
+
_isDocker = (await hasDockerEnv()) || (await hasDockerCGroup())
|
|
107
26
|
}
|
|
108
27
|
|
|
109
|
-
return
|
|
28
|
+
return _isDocker
|
|
110
29
|
}
|
|
111
30
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
31
|
+
export async function isFileAccessible (filename, directory) {
|
|
32
|
+
try {
|
|
33
|
+
const filePath = directory ? resolve(directory, filename) : filename
|
|
34
|
+
await access(filePath)
|
|
35
|
+
return true
|
|
36
|
+
} catch (err) {
|
|
37
|
+
return false
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export async function sanitizeHTTPSArgument (arg) {
|
|
42
|
+
if (typeof arg === 'string') {
|
|
43
|
+
return arg
|
|
44
|
+
} else if (!Array.isArray(arg)) {
|
|
45
|
+
return readFile(arg.path)
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
const sanitized = []
|
|
49
|
+
for (const item of arg) {
|
|
50
|
+
sanitized.push(typeof item === 'string' ? item : await readFile(item.path))
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
return sanitized
|
|
117
54
|
}
|
package/lib/versions/0.16.0.js
CHANGED
|
@@ -1,9 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports = {
|
|
1
|
+
export default {
|
|
4
2
|
version: '0.16.0',
|
|
5
|
-
|
|
6
|
-
up: function (config) {
|
|
3
|
+
up (config) {
|
|
7
4
|
let kind = 'service'
|
|
8
5
|
// This file will be reused in platformatic/db
|
|
9
6
|
if (config.core) {
|
|
@@ -13,18 +10,18 @@ module.exports = {
|
|
|
13
10
|
if (config.plugin) {
|
|
14
11
|
if (Array.isArray(config.plugin)) {
|
|
15
12
|
config.plugins = {
|
|
16
|
-
paths: config.plugin.map(
|
|
13
|
+
paths: config.plugin.map(p => {
|
|
17
14
|
if (typeof p === 'string') {
|
|
18
15
|
return p
|
|
19
16
|
} else if (p.options) {
|
|
20
17
|
return {
|
|
21
18
|
path: p.path,
|
|
22
|
-
options: p.options
|
|
19
|
+
options: p.options
|
|
23
20
|
}
|
|
24
21
|
} else {
|
|
25
22
|
return p.path
|
|
26
23
|
}
|
|
27
|
-
})
|
|
24
|
+
})
|
|
28
25
|
}
|
|
29
26
|
|
|
30
27
|
if (typeof config.plugin[0] === 'object') {
|
|
@@ -41,14 +38,16 @@ module.exports = {
|
|
|
41
38
|
} else if (typeof config.plugin === 'object') {
|
|
42
39
|
if (config.plugin.options) {
|
|
43
40
|
config.plugins = {
|
|
44
|
-
paths: [
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
paths: [
|
|
42
|
+
{
|
|
43
|
+
path: config.plugin.path,
|
|
44
|
+
options: config.plugin.options
|
|
45
|
+
}
|
|
46
|
+
]
|
|
48
47
|
}
|
|
49
48
|
} else {
|
|
50
49
|
config.plugins = {
|
|
51
|
-
paths: [config.plugin.path]
|
|
50
|
+
paths: [config.plugin.path]
|
|
52
51
|
}
|
|
53
52
|
}
|
|
54
53
|
|
|
@@ -66,7 +65,7 @@ module.exports = {
|
|
|
66
65
|
}
|
|
67
66
|
} else {
|
|
68
67
|
config.plugins = {
|
|
69
|
-
paths: [config.plugin]
|
|
68
|
+
paths: [config.plugin]
|
|
70
69
|
}
|
|
71
70
|
}
|
|
72
71
|
|
|
@@ -78,5 +77,5 @@ module.exports = {
|
|
|
78
77
|
config.$schema = 'https://platformatic.dev/schemas/v0.17.0/' + kind
|
|
79
78
|
|
|
80
79
|
return config
|
|
81
|
-
}
|
|
80
|
+
}
|
|
82
81
|
}
|
|
@@ -1,14 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
module.exports.migration = {
|
|
1
|
+
export default {
|
|
4
2
|
version: '0.28.0',
|
|
5
|
-
|
|
6
|
-
up: function (config) {
|
|
3
|
+
up (config) {
|
|
7
4
|
if (config.watch !== false) {
|
|
8
5
|
config.watch = typeof config.watch === 'object' ? config.watch : true
|
|
9
6
|
}
|
|
10
7
|
delete config.plugins?.watch
|
|
11
8
|
|
|
12
9
|
return config
|
|
13
|
-
}
|
|
10
|
+
}
|
|
14
11
|
}
|
package/lib/versions/2.0.0.js
CHANGED
|
@@ -1,11 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import { version } from '../schema.js'
|
|
2
2
|
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
module.exports.migration = {
|
|
3
|
+
export default {
|
|
6
4
|
version: '2.0.0',
|
|
7
|
-
|
|
8
|
-
up: function (config) {
|
|
5
|
+
up (config) {
|
|
9
6
|
if (typeof config.allowCycles === 'boolean') {
|
|
10
7
|
delete config.allowCycles
|
|
11
8
|
}
|
|
@@ -13,5 +10,5 @@ module.exports.migration = {
|
|
|
13
10
|
config.$schema = `https://schemas.platformatic.dev/@platformatic/service/${version}.json`
|
|
14
11
|
|
|
15
12
|
return config
|
|
16
|
-
}
|
|
13
|
+
}
|
|
17
14
|
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
export default {
|
|
2
|
+
version: '2.99.0',
|
|
3
|
+
up (config) {
|
|
4
|
+
if (typeof config.plugins?.typescript !== 'undefined') {
|
|
5
|
+
delete config.plugins.typescript
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
if (typeof config.clients !== 'undefined') {
|
|
9
|
+
delete config.clients
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
return config
|
|
13
|
+
}
|
|
14
|
+
}
|
package/package.json
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
|
-
"
|
|
7
|
-
|
|
8
|
-
},
|
|
6
|
+
"types": "index.d.ts",
|
|
7
|
+
"type": "module",
|
|
9
8
|
"author": "Platformatic Inc. <oss@platformatic.dev> (https://platformatic.dev)",
|
|
10
9
|
"repository": {
|
|
11
10
|
"type": "git",
|
|
@@ -28,8 +27,6 @@
|
|
|
28
27
|
"pino-abstract-transport": "^2.0.0",
|
|
29
28
|
"self-cert": "^2.0.0",
|
|
30
29
|
"split2": "^4.2.0",
|
|
31
|
-
"strip-ansi": "^7.1.0",
|
|
32
|
-
"tsd": "^0.32.0",
|
|
33
30
|
"typescript": "^5.5.4",
|
|
34
31
|
"undici": "7.11.0",
|
|
35
32
|
"vscode-json-languageservice": "^5.3.9",
|
|
@@ -39,29 +36,25 @@
|
|
|
39
36
|
"dependencies": {
|
|
40
37
|
"@fastify/accepts": "^5.0.0",
|
|
41
38
|
"@fastify/autoload": "^6.0.0",
|
|
42
|
-
"@fastify/basic-auth": "^6.0.0",
|
|
43
39
|
"@fastify/cors": "^10.0.0",
|
|
44
40
|
"@fastify/deepmerge": "^2.0.0",
|
|
45
41
|
"@fastify/error": "^4.0.0",
|
|
46
42
|
"@fastify/static": "^8.0.0",
|
|
47
43
|
"@fastify/swagger": "^9.0.0",
|
|
48
44
|
"@fastify/under-pressure": "^9.0.0",
|
|
49
|
-
"@scalar/fastify-api-reference": "1.
|
|
45
|
+
"@scalar/fastify-api-reference": "1.33.0",
|
|
46
|
+
"@types/node": "^22.10.6",
|
|
50
47
|
"@types/ws": "^8.5.10",
|
|
51
48
|
"ajv": "^8.12.0",
|
|
52
49
|
"cli-progress": "^3.12.0",
|
|
53
50
|
"close-with-grace": "^2.0.0",
|
|
54
51
|
"code-block-writer": "^13.0.1",
|
|
55
52
|
"colorette": "^2.0.20",
|
|
56
|
-
"commist": "^3.2.0",
|
|
57
53
|
"console-table-printer": "^2.12.0",
|
|
58
|
-
"desm": "^1.3.1",
|
|
59
54
|
"env-schema": "^6.0.0",
|
|
60
|
-
"es-main": "^1.3.0",
|
|
61
55
|
"execa": "^9.0.0",
|
|
62
56
|
"fast-json-patch": "^3.1.1",
|
|
63
57
|
"fastify": "^5.0.0",
|
|
64
|
-
"fastify-metrics": "^12.0.0",
|
|
65
58
|
"fastify-plugin": "^5.0.0",
|
|
66
59
|
"graphql": "^16.9.0",
|
|
67
60
|
"help-me": "^5.0.0",
|
|
@@ -69,27 +62,27 @@
|
|
|
69
62
|
"minimist": "^1.2.8",
|
|
70
63
|
"my-ua-parser": "^2.0.2",
|
|
71
64
|
"ora": "^6.3.1",
|
|
72
|
-
"pino": "^9.
|
|
65
|
+
"pino": "^9.9.0",
|
|
73
66
|
"pino-pretty": "^13.0.0",
|
|
74
|
-
"prom-client": "^15.1.2",
|
|
75
67
|
"rfdc": "^1.3.1",
|
|
76
68
|
"semgrator": "^0.3.0",
|
|
77
69
|
"undici": "^7.0.0",
|
|
78
|
-
"@platformatic/
|
|
79
|
-
"@platformatic/
|
|
80
|
-
"@platformatic/
|
|
81
|
-
"@platformatic/scalar-theme": "
|
|
82
|
-
"@platformatic/
|
|
83
|
-
"@platformatic/
|
|
84
|
-
|
|
85
|
-
|
|
70
|
+
"@platformatic/basic": "3.0.0-alpha.2",
|
|
71
|
+
"@platformatic/generators": "3.0.0-alpha.2",
|
|
72
|
+
"@platformatic/metrics": "3.0.0-alpha.2",
|
|
73
|
+
"@platformatic/scalar-theme": "3.0.0-alpha.2",
|
|
74
|
+
"@platformatic/telemetry": "3.0.0-alpha.2",
|
|
75
|
+
"@platformatic/foundation": "3.0.0-alpha.2"
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=22.18.0"
|
|
86
79
|
},
|
|
87
80
|
"scripts": {
|
|
88
|
-
"test": "pnpm run lint && borp
|
|
89
|
-
"
|
|
81
|
+
"test": "pnpm run lint && borp --concurrency=1 --timeout 1200000 --no-typescript",
|
|
82
|
+
"coverage": "pnpm run lint && borp -C -X test -X test/fixtures --concurrency=1 --timeout 1200000 --no-typescript",
|
|
90
83
|
"gen-schema": "node lib/schema.js > schema.json",
|
|
91
84
|
"gen-types": "json2ts > config.d.ts < schema.json",
|
|
92
85
|
"build": "pnpm run gen-schema && pnpm run gen-types",
|
|
93
|
-
"lint": "eslint
|
|
86
|
+
"lint": "eslint"
|
|
94
87
|
}
|
|
95
88
|
}
|
package/schema.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
|
-
"$id": "https://schemas.platformatic.dev/@platformatic/service/
|
|
3
|
-
"version": "
|
|
4
|
-
"title": "Platformatic Service",
|
|
2
|
+
"$id": "https://schemas.platformatic.dev/@platformatic/service/3.0.0-alpha.2.json",
|
|
3
|
+
"version": "3.0.0-alpha.2",
|
|
4
|
+
"title": "Platformatic Service Config",
|
|
5
5
|
"type": "object",
|
|
6
6
|
"properties": {
|
|
7
7
|
"basePath": {
|
|
@@ -629,45 +629,6 @@
|
|
|
629
629
|
}
|
|
630
630
|
]
|
|
631
631
|
}
|
|
632
|
-
},
|
|
633
|
-
"typescript": {
|
|
634
|
-
"anyOf": [
|
|
635
|
-
{
|
|
636
|
-
"type": "object",
|
|
637
|
-
"properties": {
|
|
638
|
-
"enabled": {
|
|
639
|
-
"anyOf": [
|
|
640
|
-
{
|
|
641
|
-
"type": "boolean"
|
|
642
|
-
},
|
|
643
|
-
{
|
|
644
|
-
"type": "string"
|
|
645
|
-
}
|
|
646
|
-
]
|
|
647
|
-
},
|
|
648
|
-
"tsConfig": {
|
|
649
|
-
"type": "string",
|
|
650
|
-
"resolvePath": true
|
|
651
|
-
},
|
|
652
|
-
"outDir": {
|
|
653
|
-
"type": "string",
|
|
654
|
-
"resolvePath": true
|
|
655
|
-
},
|
|
656
|
-
"flags": {
|
|
657
|
-
"type": "array",
|
|
658
|
-
"items": {
|
|
659
|
-
"type": "string"
|
|
660
|
-
}
|
|
661
|
-
}
|
|
662
|
-
}
|
|
663
|
-
},
|
|
664
|
-
{
|
|
665
|
-
"type": "boolean"
|
|
666
|
-
},
|
|
667
|
-
{
|
|
668
|
-
"type": "string"
|
|
669
|
-
}
|
|
670
|
-
]
|
|
671
632
|
}
|
|
672
633
|
},
|
|
673
634
|
"additionalProperties": false,
|
|
@@ -684,77 +645,6 @@
|
|
|
684
645
|
}
|
|
685
646
|
]
|
|
686
647
|
},
|
|
687
|
-
"metrics": {
|
|
688
|
-
"anyOf": [
|
|
689
|
-
{
|
|
690
|
-
"type": "boolean"
|
|
691
|
-
},
|
|
692
|
-
{
|
|
693
|
-
"type": "object",
|
|
694
|
-
"properties": {
|
|
695
|
-
"port": {
|
|
696
|
-
"anyOf": [
|
|
697
|
-
{
|
|
698
|
-
"type": "integer"
|
|
699
|
-
},
|
|
700
|
-
{
|
|
701
|
-
"type": "string"
|
|
702
|
-
}
|
|
703
|
-
]
|
|
704
|
-
},
|
|
705
|
-
"hostname": {
|
|
706
|
-
"type": "string"
|
|
707
|
-
},
|
|
708
|
-
"endpoint": {
|
|
709
|
-
"type": "string"
|
|
710
|
-
},
|
|
711
|
-
"server": {
|
|
712
|
-
"type": "string",
|
|
713
|
-
"enum": [
|
|
714
|
-
"own",
|
|
715
|
-
"parent",
|
|
716
|
-
"hide"
|
|
717
|
-
]
|
|
718
|
-
},
|
|
719
|
-
"defaultMetrics": {
|
|
720
|
-
"type": "object",
|
|
721
|
-
"properties": {
|
|
722
|
-
"enabled": {
|
|
723
|
-
"type": "boolean"
|
|
724
|
-
}
|
|
725
|
-
},
|
|
726
|
-
"required": [
|
|
727
|
-
"enabled"
|
|
728
|
-
],
|
|
729
|
-
"additionalProperties": false
|
|
730
|
-
},
|
|
731
|
-
"auth": {
|
|
732
|
-
"type": "object",
|
|
733
|
-
"properties": {
|
|
734
|
-
"username": {
|
|
735
|
-
"type": "string"
|
|
736
|
-
},
|
|
737
|
-
"password": {
|
|
738
|
-
"type": "string"
|
|
739
|
-
}
|
|
740
|
-
},
|
|
741
|
-
"additionalProperties": false,
|
|
742
|
-
"required": [
|
|
743
|
-
"username",
|
|
744
|
-
"password"
|
|
745
|
-
]
|
|
746
|
-
},
|
|
747
|
-
"labels": {
|
|
748
|
-
"type": "object",
|
|
749
|
-
"additionalProperties": {
|
|
750
|
-
"type": "string"
|
|
751
|
-
}
|
|
752
|
-
}
|
|
753
|
-
},
|
|
754
|
-
"additionalProperties": false
|
|
755
|
-
}
|
|
756
|
-
]
|
|
757
|
-
},
|
|
758
648
|
"telemetry": {
|
|
759
649
|
"type": "object",
|
|
760
650
|
"properties": {
|
|
@@ -935,6 +825,13 @@
|
|
|
935
825
|
"module": {
|
|
936
826
|
"type": "string"
|
|
937
827
|
},
|
|
828
|
+
"application": {
|
|
829
|
+
"type": "object",
|
|
830
|
+
"properties": {},
|
|
831
|
+
"additionalProperties": false,
|
|
832
|
+
"required": [],
|
|
833
|
+
"default": {}
|
|
834
|
+
},
|
|
938
835
|
"service": {
|
|
939
836
|
"type": "object",
|
|
940
837
|
"properties": {
|
|
@@ -1096,48 +993,6 @@
|
|
|
1096
993
|
},
|
|
1097
994
|
"additionalProperties": false
|
|
1098
995
|
},
|
|
1099
|
-
"clients": {
|
|
1100
|
-
"type": "array",
|
|
1101
|
-
"items": {
|
|
1102
|
-
"type": "object",
|
|
1103
|
-
"properties": {
|
|
1104
|
-
"serviceId": {
|
|
1105
|
-
"type": "string"
|
|
1106
|
-
},
|
|
1107
|
-
"name": {
|
|
1108
|
-
"type": "string"
|
|
1109
|
-
},
|
|
1110
|
-
"type": {
|
|
1111
|
-
"type": "string",
|
|
1112
|
-
"enum": [
|
|
1113
|
-
"openapi",
|
|
1114
|
-
"graphql"
|
|
1115
|
-
]
|
|
1116
|
-
},
|
|
1117
|
-
"path": {
|
|
1118
|
-
"type": "string",
|
|
1119
|
-
"resolvePath": true
|
|
1120
|
-
},
|
|
1121
|
-
"schema": {
|
|
1122
|
-
"type": "string",
|
|
1123
|
-
"resolvePath": true
|
|
1124
|
-
},
|
|
1125
|
-
"url": {
|
|
1126
|
-
"type": "string"
|
|
1127
|
-
},
|
|
1128
|
-
"fullResponse": {
|
|
1129
|
-
"type": "boolean"
|
|
1130
|
-
},
|
|
1131
|
-
"fullRequest": {
|
|
1132
|
-
"type": "boolean"
|
|
1133
|
-
},
|
|
1134
|
-
"validateResponse": {
|
|
1135
|
-
"type": "boolean"
|
|
1136
|
-
}
|
|
1137
|
-
},
|
|
1138
|
-
"additionalProperties": false
|
|
1139
|
-
}
|
|
1140
|
-
},
|
|
1141
996
|
"runtime": {
|
|
1142
997
|
"type": "object",
|
|
1143
998
|
"properties": {
|
package/tsconfig.json
CHANGED
|
@@ -1,12 +1,22 @@
|
|
|
1
1
|
{
|
|
2
2
|
"compilerOptions": {
|
|
3
|
-
"module": "
|
|
4
|
-
"moduleResolution": "node",
|
|
3
|
+
"module": "esnext",
|
|
5
4
|
"esModuleInterop": true,
|
|
6
|
-
"
|
|
7
|
-
"target": "
|
|
8
|
-
"outDir": "build",
|
|
5
|
+
"lib": ["es2022"],
|
|
6
|
+
"target": "esnext",
|
|
9
7
|
"sourceMap": true,
|
|
10
|
-
"
|
|
8
|
+
"pretty": true,
|
|
9
|
+
"noEmitOnError": true,
|
|
10
|
+
"incremental": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"outDir": "dist",
|
|
13
|
+
"skipLibCheck": true
|
|
14
|
+
},
|
|
15
|
+
"watchOptions": {
|
|
16
|
+
"watchFile": "fixedPollingInterval",
|
|
17
|
+
"watchDirectory": "fixedPollingInterval",
|
|
18
|
+
"fallbackPolling": "dynamicPriority",
|
|
19
|
+
"synchronousWatchDirectory": true,
|
|
20
|
+
"excludeDirectories": ["**/node_modules", "dist"]
|
|
11
21
|
}
|
|
12
22
|
}
|
package/.c8rc
DELETED
package/help/compile.txt
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
Compile typescript plugins.
|
|
2
|
-
|
|
3
|
-
``` bash
|
|
4
|
-
$ platformatic service compile
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
As a result of executing this command, Platformatic Service will compile typescript
|
|
8
|
-
plugins in the `outDir` directory.
|
|
9
|
-
|
|
10
|
-
Using the `--clean` flag, the outDir directory will be removed before the new compilation process starts.
|
|
11
|
-
|
|
12
|
-
If not specified, the configuration will be loaded from any of the following, in the current directory.
|
|
13
|
-
|
|
14
|
-
* `platformatic.json`, or
|
|
15
|
-
* `platformatic.yml`, or
|
|
16
|
-
* `platformatic.tml`
|
|
17
|
-
|
|
18
|
-
You can find more details about the configuration format here:
|
|
19
|
-
* [Platformatic Service Configuration](https://docs.platformatic.dev/docs/service/configuration)
|
package/help/create.txt
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
Creates a new Platformatic Service application.
|
|
2
|
-
|
|
3
|
-
Options are
|
|
4
|
-
|
|
5
|
-
* `dir <string>` - the directory where to create the project (Default: `process.cwd() + 'platformatic-composer'`)
|
|
6
|
-
* `port <string>` - the port where the application will listen (Default: `3042`)
|
|
7
|
-
* `hostname <string>` - the hostname where the application will listen (Default: `0.0.0.0`)
|
|
8
|
-
* `git <boolean>` - Init the git repository (Default: `true`)
|
|
9
|
-
* `typescript <boolean>` - Use Typescript (Default: `false`)
|
|
10
|
-
* `install <boolean>` - Run or not `npm install` after creating the files (Default: `true`)
|
|
11
|
-
* `plugin <boolean>` - Creates a sample plugin and tests (Default: `true`)
|
package/help/help.txt
DELETED
|
@@ -1,8 +0,0 @@
|
|
|
1
|
-
Available commands:
|
|
2
|
-
|
|
3
|
-
* `create` - creates a new Platformatic Service application.
|
|
4
|
-
* `help` - show this help message.
|
|
5
|
-
* `help <command>` - show more information about a command.
|
|
6
|
-
* `start` - start the server.
|
|
7
|
-
* `schema config` - generate the schema configuration file.
|
|
8
|
-
* `compile` - compile the typescript files.
|
package/help/schema.txt
DELETED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
Update the config schema file:
|
|
2
|
-
|
|
3
|
-
* `schema config` - update the JSON schema config available on `platformatic.json`
|
|
4
|
-
|
|
5
|
-
Your configuration on `platformatic.json` has a schema defined to improve the developer experience and avoid mistakes when updating the configuration of Platformatic Service.
|
|
6
|
-
When you initialize a new Platformatic service (f.e. running `npm create platformatic@latest`), a new JSON `$schema` property is added in the `platformatic.json` config. This can allow your IDE to add suggestions (f.e. mandatory/missing fields, types, default values) by opening the config in `platformatic.service.json`.
|
|
7
|
-
Running `platformatic service schema config` you can update your schema so that it matches well the latest changes available on your config.
|
|
8
|
-
|
|
9
|
-
|
package/help/start.txt
DELETED
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
Start the Platformatic Service with the following command:
|
|
2
|
-
|
|
3
|
-
``` bash
|
|
4
|
-
$ platformatic service start
|
|
5
|
-
```
|
|
6
|
-
|
|
7
|
-
You will need a configuration file. Here is an example to get you started,
|
|
8
|
-
save the following as `platformatic.json`:
|
|
9
|
-
|
|
10
|
-
``` json
|
|
11
|
-
{
|
|
12
|
-
"server": {
|
|
13
|
-
"hostname": "127.0.0.1",
|
|
14
|
-
"port": 0,
|
|
15
|
-
"logger": {
|
|
16
|
-
"level": "info"
|
|
17
|
-
}
|
|
18
|
-
},
|
|
19
|
-
"plugin": {
|
|
20
|
-
"path": "./plugin.js"
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
```
|