arnacon-webrtc-service 0.1.3 → 0.1.4

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.
@@ -17,6 +17,50 @@
17
17
  "sapphireTestnet": {
18
18
  "rpc": "https://testnet.sapphire.oasis.io",
19
19
  "NFTCallerIdPool": "0xFB3DD146F1aFfbA661533Ec49298D01f20104CF6"
20
+ },
21
+ "services": {
22
+ "esimera": {
23
+ "providerId": "esimera",
24
+ "notifyPort": 9000,
25
+ "callbackPort": 9100,
26
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/esimera.json",
27
+ "modulePath": "./webRTCservice/services/esimera.js"
28
+ },
29
+ "secnum": {
30
+ "providerId": "secnum",
31
+ "notifyPort": 9001,
32
+ "callbackPort": 9101,
33
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/secnum.json",
34
+ "modulePath": "./webRTCservice/services/secnum.js"
35
+ },
36
+ "phonemyemail": {
37
+ "providerId": "phonemyemail",
38
+ "notifyPort": 9002,
39
+ "callbackPort": 9102,
40
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/phonemyemail.json",
41
+ "modulePath": "./webRTCservice/services/phonemyemail.js"
42
+ },
43
+ "email": {
44
+ "providerId": "email",
45
+ "notifyPort": 9003,
46
+ "callbackPort": 9103,
47
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/email.json",
48
+ "modulePath": "./webRTCservice/services/email.js"
49
+ },
50
+ "vodaphone": {
51
+ "providerId": "vodaphone",
52
+ "notifyPort": 9004,
53
+ "callbackPort": 9104,
54
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/vodaphone.json",
55
+ "modulePath": "./webRTCservice/services/vodaphone.js"
56
+ },
57
+ "basicService": {
58
+ "providerId": "basicService",
59
+ "notifyPort": 9005,
60
+ "callbackPort": 9105,
61
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/basicService.json",
62
+ "modulePath": "./webRTCservice/services/basicService.js"
63
+ }
20
64
  }
21
65
  },
22
66
  "production": {
@@ -37,6 +81,50 @@
37
81
  "sapphireTestnet": {
38
82
  "rpc": "https://sapphire.oasis.io",
39
83
  "NFTCallerIdPool": "0x903796dc34Bb9A5eD76A41bBA6C40CfebD1f4269"
84
+ },
85
+ "services": {
86
+ "esimera": {
87
+ "providerId": "esimera",
88
+ "notifyPort": 9000,
89
+ "callbackPort": 9100,
90
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/esimera.json",
91
+ "modulePath": "./webRTCservice/services/esimera.js"
92
+ },
93
+ "secnum": {
94
+ "providerId": "secnum",
95
+ "notifyPort": 9001,
96
+ "callbackPort": 9101,
97
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/secnum.json",
98
+ "modulePath": "./webRTCservice/services/secnum.js"
99
+ },
100
+ "phonemyemail": {
101
+ "providerId": "phonemyemail",
102
+ "notifyPort": 9002,
103
+ "callbackPort": 9102,
104
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/phonemyemail.json",
105
+ "modulePath": "./webRTCservice/services/phonemyemail.js"
106
+ },
107
+ "email": {
108
+ "providerId": "email",
109
+ "notifyPort": 9003,
110
+ "callbackPort": 9103,
111
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/email.json",
112
+ "modulePath": "./webRTCservice/services/email.js"
113
+ },
114
+ "vodaphone": {
115
+ "providerId": "vodaphone",
116
+ "notifyPort": 9004,
117
+ "callbackPort": 9104,
118
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/vodaphone.json",
119
+ "modulePath": "./webRTCservice/services/vodaphone.js"
120
+ },
121
+ "basicService": {
122
+ "providerId": "basicService",
123
+ "notifyPort": 9005,
124
+ "callbackPort": 9105,
125
+ "configPath": "/etc/webrtcservice/node_modules/arnacon-webrtc-service/services/basicService.json",
126
+ "modulePath": "./webRTCservice/services/basicService.js"
127
+ }
40
128
  }
41
129
  }
42
130
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "arnacon-webrtc-service",
3
- "version": "0.1.3",
3
+ "version": "0.1.4",
4
4
  "description": "Arnacon WebRTC core runtime and service modules",
5
5
  "main": "./webRTCservice/core.js",
6
6
  "type": "commonjs",
@@ -156,12 +156,14 @@ const CONFIG_OVERRIDE = process.env.WEBRTC_CONFIG_PATH || process.env.ARNACON_WE
156
156
  const CONFIG_PATH = CONFIG_OVERRIDE
157
157
  ? (path.isAbsolute(CONFIG_OVERRIDE) ? CONFIG_OVERRIDE : path.resolve(process.cwd(), CONFIG_OVERRIDE))
158
158
  : path.join(PACKAGE_ROOT, "config.json");
159
+ const CONFIG_BASE_DIR = path.dirname(CONFIG_PATH);
160
+ const fullConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, "utf8"));
161
+ const _deployEnvEarly = process.env.DEPLOY_ENV || "development";
162
+ const _commonEarly = (fullConfig[_deployEnvEarly] || {}).common || {};
159
163
  const GLOBAL_CONFIG_OVERRIDE = process.env.WEBRTC_GLOBAL_CONFIG_PATH || process.env.ARNACON_WEBRTC_GLOBAL_CONFIG_PATH || "";
160
164
  const GLOBAL_CONFIG_PATH = GLOBAL_CONFIG_OVERRIDE
161
165
  ? (path.isAbsolute(GLOBAL_CONFIG_OVERRIDE) ? GLOBAL_CONFIG_OVERRIDE : path.resolve(process.cwd(), GLOBAL_CONFIG_OVERRIDE))
162
- : path.join(PACKAGE_ROOT, "globalserviceconfig.json");
163
- const CONFIG_BASE_DIR = path.dirname(CONFIG_PATH);
164
- const fullConfig = JSON.parse(fs.readFileSync(CONFIG_PATH, "utf8"));
166
+ : (_commonEarly.globalServiceConfigPath || path.join(PACKAGE_ROOT, "globalserviceconfig.json"));
165
167
  let fullGlobalConfig = {};
166
168
  if (fs.existsSync(GLOBAL_CONFIG_PATH)) {
167
169
  fullGlobalConfig = JSON.parse(fs.readFileSync(GLOBAL_CONFIG_PATH, "utf8"));
@@ -178,7 +180,7 @@ const deployEnv = process.env.DEPLOY_ENV || "development";
178
180
  const envConfig = fullConfig[deployEnv] || {};
179
181
  const commonConfig = envConfig.common || {};
180
182
  const globalEnvConfig = fullGlobalConfig[deployEnv] || {};
181
- const serviceRegistry = envConfig.services || {};
183
+ const serviceRegistry = globalEnvConfig.services || envConfig.services || {};
182
184
  const loadedServices = {};
183
185
 
184
186
  for (const [serviceId, serviceEntry] of Object.entries(serviceRegistry)) {