@platformatic/service 1.14.4 → 1.15.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/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?: 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
- prefix?: string;
186
+ path?: string;
154
187
  }
155
188
  | boolean;
156
189
  graphql?:
157
- | boolean
158
190
  | {
159
191
  graphiql?: boolean;
160
- [k: string]: unknown;
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
- export interface Plugins {
173
- paths: (
174
- | string
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
- encapsulate?: boolean;
178
- maxDepth?: number;
179
- autoHooks?: boolean;
180
- autoHooksPattern?: string;
181
- cascadeHooks?: boolean;
182
- overwriteHooks?: boolean;
183
- routeParams?: boolean;
184
- forceESM?: boolean;
185
- ignoreFilter?: string;
186
- matchFilter?: string;
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, addPrefixToEnv } = require('@platformatic/generators')
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
  }
@@ -59,7 +59,7 @@ async function setupOpenAPI (app, opts) {
59
59
  ...theme,
60
60
  ...openapi,
61
61
  logLevel: 'warn',
62
- prefix: openapi.prefix || '/documentation'
62
+ prefix: openapi.swaggerPrefix || '/documentation'
63
63
  })
64
64
  }
65
65
 
package/lib/schema.js CHANGED
@@ -619,9 +619,9 @@ const openApiBase = {
619
619
  externalDocs: {
620
620
  $ref: '#/$defs/external-documentation'
621
621
  },
622
- prefix: {
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.14.4",
3
+ "version": "1.15.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -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.14.4",
80
- "@platformatic/client": "1.14.4",
81
- "@platformatic/config": "1.14.4",
82
- "@platformatic/swagger-ui-theme": "1.14.4",
83
- "@platformatic/generators": "1.14.4",
84
- "@platformatic/metaconfig": "1.14.4",
85
- "@platformatic/telemetry": "1.14.4",
86
- "@platformatic/utils": "1.14.4"
79
+ "@platformatic/client": "1.15.0",
80
+ "@platformatic/config": "1.15.0",
81
+ "@platformatic/authenticate": "1.15.0",
82
+ "@platformatic/generators": "1.15.0",
83
+ "@platformatic/swagger-ui-theme": "1.15.0",
84
+ "@platformatic/telemetry": "1.15.0",
85
+ "@platformatic/metaconfig": "1.15.0",
86
+ "@platformatic/utils": "1.15.0"
87
87
  },
88
88
  "standard": {
89
89
  "ignore": [