@platformatic/runtime 2.14.0 → 2.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
@@ -5,7 +5,7 @@
5
5
  * and run json-schema-to-typescript to regenerate this file.
6
6
  */
7
7
 
8
- export type HttpsSchemasPlatformaticDevPlatformaticRuntime2140Json = {
8
+ export type HttpsSchemasPlatformaticDevPlatformaticRuntime2150Json = {
9
9
  [k: string]: unknown;
10
10
  } & {
11
11
  $schema?: string;
package/lib/runtime.js CHANGED
@@ -721,6 +721,21 @@ class Runtime extends EventEmitter {
721
721
  return createReadStream(filePath)
722
722
  }
723
723
 
724
+ async sendCommandToService (id, name, message) {
725
+ const service = await this.#getServiceById(id)
726
+
727
+ try {
728
+ return await sendViaITC(service, name, message)
729
+ } catch (e) {
730
+ // The service exports no meta, return an empty object
731
+ if (e.code === 'PLT_ITC_HANDLER_NOT_FOUND') {
732
+ return {}
733
+ }
734
+
735
+ throw e
736
+ }
737
+ }
738
+
724
739
  #updateStatus (status) {
725
740
  this.#status = status
726
741
  this.emit(status)
@@ -13,6 +13,7 @@ const defaultStackable = {
13
13
  getEnv: () => null,
14
14
  getInfo: () => null,
15
15
  getDispatchFunc: () => null,
16
+ getDispatchTarget: () => null,
16
17
  getOpenapiSchema: () => null,
17
18
  getGraphqlSchema: () => null,
18
19
  getMeta: () => ({}),
package/lib/worker/itc.js CHANGED
@@ -72,12 +72,8 @@ function setupITC (app, service, dispatcher) {
72
72
  await app.listen()
73
73
  }
74
74
 
75
- const url = app.stackable.getUrl()
76
-
77
- const dispatchFunc = await app.stackable.getDispatchFunc()
78
- dispatcher.replaceServer(url ?? dispatchFunc)
79
-
80
- return service.entrypoint ? url : null
75
+ dispatcher.replaceServer(await app.stackable.getDispatchTarget())
76
+ return service.entrypoint ? app.stackable.getUrl() : null
81
77
  },
82
78
 
83
79
  async stop () {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platformatic/runtime",
3
- "version": "2.14.0",
3
+ "version": "2.15.0",
4
4
  "description": "",
5
5
  "main": "index.js",
6
6
  "bin": {
@@ -35,12 +35,12 @@
35
35
  "typescript": "^5.5.4",
36
36
  "undici-oidc-interceptor": "^0.5.0",
37
37
  "why-is-node-running": "^2.2.2",
38
- "@platformatic/composer": "2.14.0",
39
- "@platformatic/db": "2.14.0",
40
- "@platformatic/node": "2.14.0",
41
- "@platformatic/service": "2.14.0",
42
- "@platformatic/sql-mapper": "2.14.0",
43
- "@platformatic/sql-graphql": "2.14.0"
38
+ "@platformatic/db": "2.15.0",
39
+ "@platformatic/node": "2.15.0",
40
+ "@platformatic/composer": "2.15.0",
41
+ "@platformatic/service": "2.15.0",
42
+ "@platformatic/sql-graphql": "2.15.0",
43
+ "@platformatic/sql-mapper": "2.15.0"
44
44
  },
45
45
  "dependencies": {
46
46
  "@fastify/error": "^4.0.0",
@@ -70,13 +70,13 @@
70
70
  "undici": "^6.9.0",
71
71
  "undici-thread-interceptor": "^0.9.0",
72
72
  "ws": "^8.16.0",
73
- "@platformatic/basic": "2.14.0",
74
- "@platformatic/itc": "2.14.0",
75
- "@platformatic/config": "2.14.0",
76
- "@platformatic/generators": "2.14.0",
77
- "@platformatic/telemetry": "2.14.0",
78
- "@platformatic/ts-compiler": "2.14.0",
79
- "@platformatic/utils": "2.14.0"
73
+ "@platformatic/basic": "2.15.0",
74
+ "@platformatic/generators": "2.15.0",
75
+ "@platformatic/config": "2.15.0",
76
+ "@platformatic/ts-compiler": "2.15.0",
77
+ "@platformatic/itc": "2.15.0",
78
+ "@platformatic/telemetry": "2.15.0",
79
+ "@platformatic/utils": "2.15.0"
80
80
  },
81
81
  "scripts": {
82
82
  "test": "npm run lint && borp --concurrency=1 --timeout=300000 && tsd",
package/schema.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.14.0.json",
2
+ "$id": "https://schemas.platformatic.dev/@platformatic/runtime/2.15.0.json",
3
3
  "$schema": "http://json-schema.org/draft-07/schema#",
4
4
  "type": "object",
5
5
  "properties": {