@platformatic/service 2.22.0 → 2.23.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/index.d.ts CHANGED
@@ -2,8 +2,7 @@
2
2
  /// <reference types="@fastify/swagger" />
3
3
  import { FastifyInstance, FastifyBaseLogger } from 'fastify'
4
4
  import ConfigManager from '@platformatic/config'
5
- import type { ConfigManagerConfig } from '@platformatic/config'
6
- import type { Stackable as _Stackable, StackableInterface } from '@platformatic/config'
5
+ import type { Stackable as _Stackable, StackableInterface, ConfigManagerConfig } from '@platformatic/config'
7
6
  import { BaseGenerator } from '@platformatic/generators'
8
7
  import { PlatformaticService } from './config'
9
8
  import type { JSONSchemaType } from 'ajv'
@@ -3,7 +3,7 @@
3
3
  const fp = require('fastify-plugin')
4
4
  const autoload = require('@fastify/autoload')
5
5
  const { stat } = require('node:fs').promises
6
- const { createRequire } = require('node:module')
6
+ const { createRequire } = require('@platformatic/utils')
7
7
  const { join } = require('node:path')
8
8
  const { pathToFileURL } = require('node:url')
9
9
 
@@ -36,7 +36,7 @@ module.exports = fp(async function (app, opts) {
36
36
  forceESM: plugin.forceESM,
37
37
  ignoreFilter: plugin.ignoreFilter,
38
38
  matchFilter: plugin.matchFilter,
39
- ...patternOptions,
39
+ ...patternOptions
40
40
  })
41
41
  } else {
42
42
  let loaded = await import(pathToFileURL(plugin.path))
@@ -68,11 +68,7 @@ function patternOptionsFromPlugin (plugin) {
68
68
  const config = {}
69
69
 
70
70
  // Expected keys for autoload plugin options that expect regexp patterns
71
- const patternOptionKeys = [
72
- 'ignorePattern',
73
- 'indexPattern',
74
- 'autoHooksPattern',
75
- ]
71
+ const patternOptionKeys = ['ignorePattern', 'indexPattern', 'autoHooksPattern']
76
72
 
77
73
  for (const key of patternOptionKeys) {
78
74
  const pattern = plugin[key]
package/lib/stackable.js CHANGED
@@ -49,6 +49,7 @@ class ServiceStackable {
49
49
  root: this.context.directory ? pathToFileURL(this.context.directory).toString() : undefined,
50
50
  setOpenapiSchema: this.setOpenapiSchema.bind(this),
51
51
  setGraphqlSchema: this.setGraphqlSchema.bind(this),
52
+ setConnectionString: this.setConnectionString.bind(this),
52
53
  setBasePath: this.setBasePath.bind(this),
53
54
  runtimeBasePath: this.runtimeConfig?.basePath ?? null,
54
55
  invalidateHttpCache: this.#invalidateHttpCache.bind(this)
@@ -136,7 +137,8 @@ class ServiceStackable {
136
137
  needsRootRedirect: false,
137
138
  tcp: !!this.app?.url,
138
139
  url: this.app?.url
139
- }
140
+ },
141
+ connectionStrings: [this.connectionString],
140
142
  }
141
143
  }
142
144
 
@@ -227,6 +229,10 @@ class ServiceStackable {
227
229
  this.graphqlSchema = schema
228
230
  }
229
231
 
232
+ setConnectionString (connectionString) {
233
+ this.connectionString = connectionString
234
+ }
235
+
230
236
  setBasePath (basePath) {
231
237
  this.basePath = basePath
232
238
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/service",
3
- "version": "2.22.0",
3
+ "version": "2.23.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -23,7 +23,7 @@
23
23
  "borp": "^0.19.0",
24
24
  "eslint": "9",
25
25
  "json-schema-to-typescript": "^15.0.0",
26
- "neostandard": "^0.11.1",
26
+ "neostandard": "^0.12.0",
27
27
  "openapi-types": "^12.1.3",
28
28
  "pino-abstract-transport": "^2.0.0",
29
29
  "self-cert": "^2.0.0",
@@ -76,14 +76,14 @@
76
76
  "rfdc": "^1.3.1",
77
77
  "semgrator": "^0.3.0",
78
78
  "undici": "^7.0.0",
79
- "@platformatic/client": "2.22.0",
80
- "@platformatic/config": "2.22.0",
81
- "@platformatic/metrics": "2.22.0",
82
- "@platformatic/generators": "2.22.0",
83
- "@platformatic/scalar-theme": "2.22.0",
84
- "@platformatic/telemetry": "2.22.0",
85
- "@platformatic/utils": "2.22.0",
86
- "@platformatic/ts-compiler": "2.22.0"
79
+ "@platformatic/config": "2.23.0",
80
+ "@platformatic/metrics": "2.23.0",
81
+ "@platformatic/client": "2.23.0",
82
+ "@platformatic/scalar-theme": "2.23.0",
83
+ "@platformatic/generators": "2.23.0",
84
+ "@platformatic/telemetry": "2.23.0",
85
+ "@platformatic/ts-compiler": "2.23.0",
86
+ "@platformatic/utils": "2.23.0"
87
87
  },
88
88
  "scripts": {
89
89
  "test": "pnpm run lint && borp -T --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/service/2.22.0.json",
3
- "version": "2.22.0",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/service/2.23.0.json",
3
+ "version": "2.23.0",
4
4
  "title": "Platformatic Service",
5
5
  "type": "object",
6
6
  "properties": {