@platformatic/basic 2.19.0-alpha.7 → 2.19.0-alpha.9

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/base.js CHANGED
@@ -13,6 +13,8 @@ import { NonZeroExitCode } from './errors.js'
13
13
  import { cleanBasePath } from './utils.js'
14
14
  import { ChildManager } from './worker/child-manager.js'
15
15
 
16
+ const kITC = Symbol.for('plt.runtime.itc')
17
+
16
18
  export class BaseStackable {
17
19
  childManager
18
20
  #subprocess
@@ -68,7 +70,8 @@ export class BaseStackable {
68
70
  setGraphqlSchema: this.setGraphqlSchema.bind(this),
69
71
  setConnectionString: this.setConnectionString.bind(this),
70
72
  setBasePath: this.setBasePath.bind(this),
71
- runtimeBasePath: this.runtimeConfig?.basePath ?? null
73
+ runtimeBasePath: this.runtimeConfig?.basePath ?? null,
74
+ invalidateHttpCache: this.#invalidateHttpCache.bind(this)
72
75
  })
73
76
  }
74
77
 
@@ -360,6 +363,10 @@ export class BaseStackable {
360
363
  return format === 'json' ? await this.metricsRegistry.getMetricsAsJSON() : await this.metricsRegistry.metrics()
361
364
  }
362
365
 
366
+ async #invalidateHttpCache (opts = {}) {
367
+ await globalThis[kITC].send('invalidateHttpCache', opts)
368
+ }
369
+
363
370
  getMeta () {
364
371
  return {
365
372
  composer: {
@@ -11,7 +11,7 @@ import { basename, resolve } from 'node:path'
11
11
  import { fileURLToPath } from 'node:url'
12
12
  import { isMainThread } from 'node:worker_threads'
13
13
  import pino from 'pino'
14
- import { getGlobalDispatcher, setGlobalDispatcher } from 'undici'
14
+ import { Agent, setGlobalDispatcher } from 'undici'
15
15
  import { WebSocket } from 'ws'
16
16
  import { exitCodes } from '../errors.js'
17
17
  import { importFile } from '../utils.js'
@@ -269,7 +269,8 @@ export class ChildProcess extends ITC {
269
269
  }
270
270
 
271
271
  #setupInterceptors () {
272
- setGlobalDispatcher(getGlobalDispatcher().compose(createInterceptor(this)))
272
+ const globalDispatcher = new Agent().compose(createInterceptor(this))
273
+ setGlobalDispatcher(globalDispatcher)
273
274
  }
274
275
 
275
276
  #setupHandlers () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/basic",
3
- "version": "2.19.0-alpha.7",
3
+ "version": "2.19.0-alpha.9",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "type": "module",
@@ -21,13 +21,13 @@
21
21
  "pino-abstract-transport": "^2.0.0",
22
22
  "semver": "^7.6.3",
23
23
  "split2": "^4.2.0",
24
- "undici": "^6.19.5",
24
+ "undici": "^7.0.0",
25
25
  "ws": "^8.18.0",
26
- "@platformatic/itc": "2.19.0-alpha.7",
27
- "@platformatic/config": "2.19.0-alpha.7",
28
- "@platformatic/utils": "2.19.0-alpha.7",
29
- "@platformatic/metrics": "2.19.0-alpha.7",
30
- "@platformatic/telemetry": "2.19.0-alpha.7"
26
+ "@platformatic/config": "2.19.0-alpha.9",
27
+ "@platformatic/itc": "2.19.0-alpha.9",
28
+ "@platformatic/metrics": "2.19.0-alpha.9",
29
+ "@platformatic/utils": "2.19.0-alpha.9",
30
+ "@platformatic/telemetry": "2.19.0-alpha.9"
31
31
  },
32
32
  "devDependencies": {
33
33
  "borp": "^0.19.0",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.19.0-alpha.7.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/basic/2.19.0-alpha.9.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "title": "Platformatic Stackable",
5
5
  "type": "object",