@zohoim/client-sdk 1.0.0-poc12 → 1.0.0-poc14

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.
@@ -1,4 +1,4 @@
1
- import HTTP_METHODS from './HttPMethods';
1
+ import HTTP_METHODS from './HttpMethods';
2
2
  import ModuleNames from './ModuleNames';
3
3
  const IM_API_PREFIX = '/api/v1';
4
4
  export { ModuleNames, IM_API_PREFIX, HTTP_METHODS };
@@ -1,15 +1,17 @@
1
+ import { ModuleNames } from '../../core/constants';
1
2
  import ModuleFactory from './ModuleFactory';
2
3
  export default class ModuleManager {
3
4
  constructor() {
4
5
  this._modules = new Map();
6
+ this.supportedModules = [ModuleNames.CHANNELS, ModuleNames.SESSIONS];
5
7
  }
6
8
 
7
9
  initialize(_ref) {
8
10
  let {
9
11
  config
10
12
  } = _ref;
11
- Object.entries(config).forEach(_ref2 => {
12
- let [moduleName, moduleConfig] = _ref2;
13
+ this.supportedModules.forEach(moduleName => {
14
+ const moduleConfig = config[moduleName] || {};
13
15
  this.initializeModule({
14
16
  moduleName,
15
17
  config: moduleConfig
@@ -17,11 +19,11 @@ export default class ModuleManager {
17
19
  });
18
20
  }
19
21
 
20
- initializeModule(_ref3) {
22
+ initializeModule(_ref2) {
21
23
  let {
22
24
  moduleName,
23
25
  config
24
- } = _ref3;
26
+ } = _ref2;
25
27
  const createModule = ModuleFactory[moduleName];
26
28
 
27
29
  if (createModule) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc12",
3
+ "version": "1.0.0-poc14",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",