@diia-inhouse/workflow 2.10.0 → 3.1.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.
@@ -35,6 +35,13 @@ interface TemporalConfig extends Omit<ClientOptions, "dataConverter"> {
35
35
  * when it shapes config before starting the app.
36
36
  */
37
37
  disableQueueConsumers?: boolean;
38
+ /**
39
+ * Whether a standalone worker should advertise no Moleculer actions. It stays a Moleculer client
40
+ * (outbound `act()` still works), so inbound actions go only to the main service.
41
+ *
42
+ * Defaults to `true`. Applied by `runStandaloneWorker` via `applyWorkerProcessConfig`.
43
+ */
44
+ disableMoleculerActions?: boolean;
38
45
  }
39
46
  interface AppConfig {
40
47
  temporal: TemporalConfig;
@@ -42,6 +49,11 @@ interface AppConfig {
42
49
  custom: MetricsConfig;
43
50
  };
44
51
  rabbit?: QueueConnectionConfig;
52
+ /**
53
+ * Set by `applyWorkerProcessConfig` for standalone workers; read by diia-app's
54
+ * `MoleculerService.onInit` to register the node with no actions.
55
+ */
56
+ disableMoleculerActions?: boolean;
45
57
  }
46
58
  //#endregion
47
59
  export { AppConfig, TemporalConfig };
@@ -36,11 +36,12 @@ function applyServiceProcessConfig(config) {
36
36
  * Mutates the config object in place. Safe to call when queue config is absent.
37
37
  */
38
38
  function applyWorkerProcessConfig(config) {
39
- const { disableQueueConsumers = true } = config.temporal;
39
+ const { disableQueueConsumers = true, disableMoleculerActions = true } = config.temporal;
40
40
  if (disableQueueConsumers && config.rabbit) for (const connectionType of [QueueConnectionType.Internal, QueueConnectionType.External]) {
41
41
  const connectionConfig = config.rabbit[connectionType];
42
42
  if (connectionConfig) connectionConfig.consumerEnabled = false;
43
43
  }
44
+ if (disableMoleculerActions) config.disableMoleculerActions = true;
44
45
  const workerScraper = config.metrics.custom.scrapers?.find((s) => s.name === "temporal-worker");
45
46
  if (workerScraper?.port !== void 0) {
46
47
  config.metrics.custom.port = workerScraper.port;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@diia-inhouse/workflow",
3
- "version": "2.10.0",
3
+ "version": "3.1.0",
4
4
  "description": "Workflow",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",