@zohoim/client-sdk 1.0.0-poc35 → 1.0.0-poc36

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,14 +1,23 @@
1
1
  export default class ResponseUtils {
2
2
  static adaptListResponse(response, adapter) {
3
- if (!response) return response;
4
- if (!response.data) return response;
3
+ if (!response) {
4
+ return response;
5
+ }
6
+
7
+ if (!response.data) {
8
+ return response;
9
+ }
10
+
5
11
  return { ...response,
6
12
  data: response.data.map(item => adapter(item))
7
13
  };
8
14
  }
9
15
 
10
16
  static adaptSingleResponse(response, adapter) {
11
- if (!response) return response;
17
+ if (!response) {
18
+ return response;
19
+ }
20
+
12
21
  return adapter(response);
13
22
  }
14
23
 
@@ -10,7 +10,7 @@ export default class Bot {
10
10
  name: validatedData.name,
11
11
  isActive: validatedData.isActive,
12
12
  createdTime: validatedData.createdTime,
13
- logoURL: validatedData.logoURL,
13
+ photoURL: validatedData.photoURL,
14
14
  createdBy: validatedData.createdBy
15
15
  };
16
16
  }
@@ -16,7 +16,7 @@ export default class Channel {
16
16
  this.isSubscribed = validatedData.isSubscribed || false;
17
17
  this.createdBy = validatedData.createdBy || null;
18
18
  this.isOwner = validatedData.isOwner || false;
19
- this.logoURL = validatedData.logoURL || null;
19
+ this.photoURL = validatedData.photoURL || null;
20
20
  }
21
21
 
22
22
  toJSON() {
@@ -31,7 +31,7 @@ export default class Channel {
31
31
  isSubscribed: this.isSubscribed,
32
32
  createdBy: this.createdBy,
33
33
  isOwner: this.isOwner,
34
- logoURL: this.logoURL
34
+ photoURL: this.photoURL
35
35
  };
36
36
  }
37
37
 
@@ -1,5 +1,7 @@
1
1
  const BotServiceType = {
2
2
  DESK_GC_BOT: 'DESK_GC_BOT',
3
- DESK_ZIA_BOT: 'DESK_ZIA_BOT'
3
+ DESK_ZIA_BOT: 'DESK_ZIA_BOT',
4
+ ZOHO_GC_BOT: 'ZOHO_GC_BOT',
5
+ ZOHO_ZIA_BOT: 'ZOHO_ZIA_BOT'
4
6
  };
5
7
  export default BotServiceType;
@@ -1,3 +1,5 @@
1
+ import IAdapter from "./IAdapter";
1
2
  export * from "./channels";
2
3
  export * from "./sessions";
3
- export * from "./bots";
4
+ export * from "./bots";
5
+ export { IAdapter };
@@ -7,7 +7,7 @@ const BotSchema = {
7
7
  botServiceType: {
8
8
  type: 'string',
9
9
  required: true,
10
- enum: [BotServiceType.DESK_GC_BOT, BotServiceType.DESK_ZIA_BOT]
10
+ enum: [BotServiceType.DESK_GC_BOT, BotServiceType.DESK_ZIA_BOT, BotServiceType.ZOHO_GC_BOT, BotServiceType.ZOHO_ZIA_BOT]
11
11
  },
12
12
  name: {
13
13
  type: 'string',
@@ -21,7 +21,7 @@ const BotSchema = {
21
21
  type: 'string',
22
22
  required: true
23
23
  },
24
- logoURL: {
24
+ photoURL: {
25
25
  type: 'string',
26
26
  required: true
27
27
  },
@@ -41,7 +41,7 @@ const ChannelSchema = {
41
41
  type: 'boolean',
42
42
  required: false
43
43
  },
44
- logoURL: {
44
+ photoURL: {
45
45
  type: 'string',
46
46
  required: false
47
47
  }
@@ -14,7 +14,7 @@ export default class BotAdapter extends IAdapter {
14
14
  name: botData.name,
15
15
  isActive: botData.isActive,
16
16
  createdTime: botData.createdTime,
17
- logoURL: botData.logoURL,
17
+ photoURL: botData.logoURL,
18
18
  createdBy: botData.createdBy
19
19
  }).toJSON();
20
20
  } catch (error) {
@@ -19,7 +19,7 @@ export default class ChannelAdapter extends IAdapter {
19
19
  isSubscribed: rawChannel.isSubscribed,
20
20
  createdBy: rawChannel.createdBy,
21
21
  isOwner: rawChannel.isOwner,
22
- logoURL: rawChannel.logoURL
22
+ photoURL: rawChannel.logoURL
23
23
  }).toJSON();
24
24
  } catch (error) {
25
25
  throw new AdapterError(`Failed to adapt channel: ${error.message}`);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc35",
3
+ "version": "1.0.0-poc36",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",