@platformatic/service 2.6.1 → 2.7.1-alpha.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/lib/stackable.js CHANGED
@@ -9,6 +9,8 @@ const { extractTypeScriptCompileOptionsFromConfig } = require('./compile')
9
9
  const { compile } = require('@platformatic/ts-compiler')
10
10
  const { deepmerge } = require('@platformatic/utils')
11
11
 
12
+ const kITC = Symbol.for('plt.runtime.itc')
13
+
12
14
  class ServiceStackable {
13
15
  constructor (options) {
14
16
  this.app = null
@@ -34,7 +36,8 @@ class ServiceStackable {
34
36
  this.registerGlobals({
35
37
  setOpenapiSchema: this.setOpenapiSchema.bind(this),
36
38
  setGraphqlSchema: this.setGraphqlSchema.bind(this),
37
- setBasePath: this.setBasePath.bind(this)
39
+ setBasePath: this.setBasePath.bind(this),
40
+ invalidateHttpCache: this.#invalidateHttpCache.bind(this)
38
41
  })
39
42
  }
40
43
 
@@ -117,8 +120,8 @@ class ServiceStackable {
117
120
  prefix: config.basePath ?? this.basePath ?? this.context?.serviceId,
118
121
  wantsAbsoluteUrls: false,
119
122
  needsRootRedirect: false,
120
- tcp: !!this.app.url,
121
- url: this.app.url
123
+ tcp: !!this.app?.url,
124
+ url: this.app?.url
122
125
  }
123
126
  }
124
127
  }
@@ -218,6 +221,10 @@ class ServiceStackable {
218
221
  globalThis.platformatic = Object.assign(globalThis.platformatic ?? {}, globals)
219
222
  }
220
223
 
224
+ async #invalidateHttpCache (opts = {}) {
225
+ await globalThis[kITC].send('invalidateHttpCache', opts)
226
+ }
227
+
221
228
  #setHttpMetrics () {
222
229
  this.app.register(httpMetrics, {
223
230
  registry: this.metricsRegistry,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/service",
3
- "version": "2.6.1",
3
+ "version": "2.7.1-alpha.1",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -76,14 +76,14 @@
76
76
  "rfdc": "^1.3.1",
77
77
  "semgrator": "^0.3.0",
78
78
  "undici": "^6.9.0",
79
- "@platformatic/client": "2.6.1",
80
- "@platformatic/config": "2.6.1",
81
- "@platformatic/metrics": "2.6.1",
82
- "@platformatic/generators": "2.6.1",
83
- "@platformatic/scalar-theme": "2.6.1",
84
- "@platformatic/telemetry": "2.6.1",
85
- "@platformatic/ts-compiler": "2.6.1",
86
- "@platformatic/utils": "2.6.1"
79
+ "@platformatic/client": "2.7.1-alpha.1",
80
+ "@platformatic/metrics": "2.7.1-alpha.1",
81
+ "@platformatic/scalar-theme": "2.7.1-alpha.1",
82
+ "@platformatic/generators": "2.7.1-alpha.1",
83
+ "@platformatic/telemetry": "2.7.1-alpha.1",
84
+ "@platformatic/ts-compiler": "2.7.1-alpha.1",
85
+ "@platformatic/utils": "2.7.1-alpha.1",
86
+ "@platformatic/config": "2.7.1-alpha.1"
87
87
  },
88
88
  "scripts": {
89
89
  "test": "pnpm run lint && borp -T --concurrency=1 --timeout=180000 && tsd",
package/schema.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/service/2.6.1.json",
3
- "version": "2.6.1",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/service/2.7.1-alpha.1.json",
3
+ "version": "2.7.1-alpha.1",
4
4
  "title": "Platformatic Service",
5
5
  "type": "object",
6
6
  "properties": {