@platformatic/service 1.14.4 → 1.15.1
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 +57 -40
- package/lib/generator/service-generator.js +1 -26
- package/lib/plugins/openapi.js +1 -1
- package/lib/schema.js +2 -2
- package/package.json +10 -10
package/config.d.ts
CHANGED
|
@@ -32,6 +32,33 @@ export interface PlatformaticService {
|
|
|
32
32
|
| boolean
|
|
33
33
|
| {
|
|
34
34
|
level?: string;
|
|
35
|
+
transport?:
|
|
36
|
+
| {
|
|
37
|
+
target?: string;
|
|
38
|
+
options?: {
|
|
39
|
+
[k: string]: unknown;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
| {
|
|
43
|
+
targets?: {
|
|
44
|
+
target?: string;
|
|
45
|
+
options?: {
|
|
46
|
+
[k: string]: unknown;
|
|
47
|
+
};
|
|
48
|
+
level?: string;
|
|
49
|
+
additionalProperties?: never;
|
|
50
|
+
[k: string]: unknown;
|
|
51
|
+
}[];
|
|
52
|
+
options?: {
|
|
53
|
+
[k: string]: unknown;
|
|
54
|
+
};
|
|
55
|
+
};
|
|
56
|
+
pipeline?: {
|
|
57
|
+
target?: string;
|
|
58
|
+
options?: {
|
|
59
|
+
[k: string]: unknown;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
35
62
|
[k: string]: unknown;
|
|
36
63
|
};
|
|
37
64
|
serializerOpts?: {
|
|
@@ -109,7 +136,9 @@ export interface PlatformaticService {
|
|
|
109
136
|
hideOptionsRoute?: boolean;
|
|
110
137
|
};
|
|
111
138
|
};
|
|
112
|
-
plugins?:
|
|
139
|
+
plugins?: {
|
|
140
|
+
[k: string]: unknown;
|
|
141
|
+
};
|
|
113
142
|
metrics?:
|
|
114
143
|
| boolean
|
|
115
144
|
| {
|
|
@@ -148,17 +177,20 @@ export interface PlatformaticService {
|
|
|
148
177
|
tags?: Tag[];
|
|
149
178
|
externalDocs?: ExternalDocumentation;
|
|
150
179
|
/**
|
|
151
|
-
* Base URL for the OpenAPI
|
|
180
|
+
* Base URL for the OpenAPI Swagger Documentation
|
|
181
|
+
*/
|
|
182
|
+
swaggerPrefix?: string;
|
|
183
|
+
/**
|
|
184
|
+
* Path to an OpenAPI spec file
|
|
152
185
|
*/
|
|
153
|
-
|
|
186
|
+
path?: string;
|
|
154
187
|
}
|
|
155
188
|
| boolean;
|
|
156
189
|
graphql?:
|
|
157
|
-
| boolean
|
|
158
190
|
| {
|
|
159
191
|
graphiql?: boolean;
|
|
160
|
-
|
|
161
|
-
|
|
192
|
+
}
|
|
193
|
+
| boolean;
|
|
162
194
|
};
|
|
163
195
|
clients?: {
|
|
164
196
|
serviceId?: string;
|
|
@@ -168,41 +200,26 @@ export interface PlatformaticService {
|
|
|
168
200
|
schema?: string;
|
|
169
201
|
url?: string;
|
|
170
202
|
}[];
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
203
|
+
versions?: {
|
|
204
|
+
/**
|
|
205
|
+
* The path to the directory containing the versions mappers
|
|
206
|
+
*/
|
|
207
|
+
dir: string;
|
|
208
|
+
configs: {
|
|
209
|
+
version: string;
|
|
210
|
+
openapi?: {
|
|
211
|
+
prefix?: string;
|
|
176
212
|
path?: string;
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
ignorePattern?: string;
|
|
188
|
-
scriptPattern?: string;
|
|
189
|
-
indexPattern?: string;
|
|
190
|
-
options?: {
|
|
191
|
-
[k: string]: unknown;
|
|
192
|
-
};
|
|
193
|
-
[k: string]: unknown;
|
|
194
|
-
}
|
|
195
|
-
)[];
|
|
196
|
-
typescript?:
|
|
197
|
-
| {
|
|
198
|
-
enabled?: boolean | string;
|
|
199
|
-
tsConfig?: string;
|
|
200
|
-
outDir?: string;
|
|
201
|
-
flags?: string[];
|
|
202
|
-
[k: string]: unknown;
|
|
203
|
-
}
|
|
204
|
-
| boolean
|
|
205
|
-
| string;
|
|
213
|
+
};
|
|
214
|
+
plugins?:
|
|
215
|
+
| {
|
|
216
|
+
[k: string]: unknown;
|
|
217
|
+
}
|
|
218
|
+
| {
|
|
219
|
+
[k: string]: unknown;
|
|
220
|
+
};
|
|
221
|
+
}[];
|
|
222
|
+
};
|
|
206
223
|
}
|
|
207
224
|
export interface OpenTelemetry {
|
|
208
225
|
/**
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
'use strict'
|
|
2
2
|
|
|
3
|
-
const { BaseGenerator
|
|
4
|
-
const { getPackageConfigurationObject } = require('@platformatic/generators/lib/utils')
|
|
3
|
+
const { BaseGenerator } = require('@platformatic/generators')
|
|
5
4
|
const { readFile } = require('node:fs/promises')
|
|
6
5
|
const { join } = require('node:path')
|
|
7
6
|
|
|
@@ -110,30 +109,6 @@ declare module 'fastify' {
|
|
|
110
109
|
}
|
|
111
110
|
}
|
|
112
111
|
|
|
113
|
-
if (this.packages.length > 0) {
|
|
114
|
-
if (!config.plugins) {
|
|
115
|
-
config.plugins = {}
|
|
116
|
-
}
|
|
117
|
-
config.plugins.packages = this.packages.map((packageDefinition) => {
|
|
118
|
-
const packageConfigOutput = getPackageConfigurationObject(packageDefinition.options, this.config.serviceName)
|
|
119
|
-
if (Object.keys(packageConfigOutput.env).length > 0) {
|
|
120
|
-
const envForPackages = {}
|
|
121
|
-
Object.entries(packageConfigOutput.env).forEach((kv) => {
|
|
122
|
-
envForPackages[kv[0]] = kv[1]
|
|
123
|
-
})
|
|
124
|
-
if (this.config.isRuntimeContext) {
|
|
125
|
-
this.config.env = {
|
|
126
|
-
...this.config.env,
|
|
127
|
-
...addPrefixToEnv(envForPackages, this.config.envPrefix)
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
}
|
|
131
|
-
return {
|
|
132
|
-
name: packageDefinition.name,
|
|
133
|
-
options: packageConfigOutput.config
|
|
134
|
-
}
|
|
135
|
-
})
|
|
136
|
-
}
|
|
137
112
|
return config
|
|
138
113
|
}
|
|
139
114
|
}
|
package/lib/plugins/openapi.js
CHANGED
package/lib/schema.js
CHANGED
|
@@ -619,9 +619,9 @@ const openApiBase = {
|
|
|
619
619
|
externalDocs: {
|
|
620
620
|
$ref: '#/$defs/external-documentation'
|
|
621
621
|
},
|
|
622
|
-
|
|
622
|
+
swaggerPrefix: {
|
|
623
623
|
type: 'string',
|
|
624
|
-
description: 'Base URL for the OpenAPI'
|
|
624
|
+
description: 'Base URL for the OpenAPI Swagger Documentation'
|
|
625
625
|
},
|
|
626
626
|
path: {
|
|
627
627
|
type: 'string',
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@platformatic/service",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.15.1",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"bin": {
|
|
@@ -67,7 +67,7 @@
|
|
|
67
67
|
"fastify-metrics": "^10.3.2",
|
|
68
68
|
"fastify-plugin": "^4.5.1",
|
|
69
69
|
"graphql": "^16.8.1",
|
|
70
|
-
"help-me": "^
|
|
70
|
+
"help-me": "^5.0.0",
|
|
71
71
|
"mercurius": "^13.1.0",
|
|
72
72
|
"minimist": "^1.2.8",
|
|
73
73
|
"openapi-schema-diff": "^0.0.1",
|
|
@@ -76,14 +76,14 @@
|
|
|
76
76
|
"rfdc": "^1.3.0",
|
|
77
77
|
"undici": "^6.0.0",
|
|
78
78
|
"ua-parser-js": "^1.0.36",
|
|
79
|
-
"@platformatic/authenticate": "1.
|
|
80
|
-
"@platformatic/client": "1.
|
|
81
|
-
"@platformatic/config": "1.
|
|
82
|
-
"@platformatic/
|
|
83
|
-
"@platformatic/
|
|
84
|
-
"@platformatic/
|
|
85
|
-
"@platformatic/
|
|
86
|
-
"@platformatic/
|
|
79
|
+
"@platformatic/authenticate": "1.15.1",
|
|
80
|
+
"@platformatic/client": "1.15.1",
|
|
81
|
+
"@platformatic/config": "1.15.1",
|
|
82
|
+
"@platformatic/generators": "1.15.1",
|
|
83
|
+
"@platformatic/swagger-ui-theme": "1.15.1",
|
|
84
|
+
"@platformatic/telemetry": "1.15.1",
|
|
85
|
+
"@platformatic/utils": "1.15.1",
|
|
86
|
+
"@platformatic/metaconfig": "1.15.1"
|
|
87
87
|
},
|
|
88
88
|
"standard": {
|
|
89
89
|
"ignore": [
|