@onlineapps/service-wrapper 3.0.16 → 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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@onlineapps/service-wrapper",
3
- "version": "3.0.16",
3
+ "version": "3.1.0",
4
4
  "description": "Thin orchestration layer for microservices - delegates all infrastructure concerns to specialized connectors",
5
5
  "main": "src/index.js",
6
6
  "scripts": {
@@ -29,10 +29,10 @@
29
29
  "@onlineapps/conn-base-state": "1.0.1",
30
30
  "@onlineapps/conn-infra-error-handler": "1.0.11",
31
31
  "@onlineapps/conn-infra-mq": "1.1.70",
32
- "@onlineapps/conn-orch-cookbook": "2.1.2",
33
- "@onlineapps/conn-orch-orchestrator": "2.0.2",
32
+ "@onlineapps/conn-orch-cookbook": "2.1.3",
33
+ "@onlineapps/conn-orch-orchestrator": "2.1.0",
34
34
  "@onlineapps/conn-orch-registry": "1.2.1",
35
- "@onlineapps/conn-orch-validator": "^3.1.2",
35
+ "@onlineapps/conn-orch-validator": "3.1.2",
36
36
  "@onlineapps/monitoring-core": "1.0.23",
37
37
  "@onlineapps/runtime-config": "1.0.2",
38
38
  "@onlineapps/service-common": "1.1.2",
@@ -1761,7 +1761,24 @@ class ServiceWrapper {
1761
1761
  cache: this.cacheConnector,
1762
1762
  errorHandler: errorHandler,
1763
1763
  logger: this.logger,
1764
- defaultTimeout: timeout
1764
+ defaultTimeout: timeout,
1765
+ operationMutatesLookup: (_executingServiceName, step) => {
1766
+ const opsMap =
1767
+ (this.operations && this.operations.operations) ||
1768
+ this.operations ||
1769
+ {};
1770
+ const opKey =
1771
+ step && typeof step.operation === 'string' && step.operation.length > 0
1772
+ ? step.operation
1773
+ : step && typeof step.step_id === 'string'
1774
+ ? step.step_id
1775
+ : '';
1776
+ const spec = opsMap[opKey];
1777
+ return {
1778
+ mutates: !!(spec && spec.mutates === true),
1779
+ resource_type: spec ? spec.resource_type : undefined
1780
+ };
1781
+ }
1765
1782
  });
1766
1783
 
1767
1784
  this.logger?.info('Orchestrator initialized');