@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.
- package/es/core/utils/ResponseUtils.js +12 -3
- package/es/domain/entities/Bot/Bot.js +1 -1
- package/es/domain/entities/Channel/Channel.js +2 -2
- package/es/domain/enum/bot/BotServiceType.js +3 -1
- package/es/domain/interfaces/index.js +3 -1
- package/es/domain/schema/bot/BotSchema.js +2 -2
- package/es/domain/schema/channel/ChannelSchema.js +1 -1
- package/es/infrastructure/adapters/bots/BotAdapter.js +1 -1
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +1 -1
- package/package.json +1 -1
|
@@ -1,14 +1,23 @@
|
|
|
1
1
|
export default class ResponseUtils {
|
|
2
2
|
static adaptListResponse(response, adapter) {
|
|
3
|
-
if (!response)
|
|
4
|
-
|
|
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)
|
|
17
|
+
if (!response) {
|
|
18
|
+
return response;
|
|
19
|
+
}
|
|
20
|
+
|
|
12
21
|
return adapter(response);
|
|
13
22
|
}
|
|
14
23
|
|
|
@@ -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.
|
|
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
|
-
|
|
34
|
+
photoURL: this.photoURL
|
|
35
35
|
};
|
|
36
36
|
}
|
|
37
37
|
|
|
@@ -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
|
-
|
|
24
|
+
photoURL: {
|
|
25
25
|
type: 'string',
|
|
26
26
|
required: true
|
|
27
27
|
},
|
|
@@ -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
|
-
|
|
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
|
-
|
|
22
|
+
photoURL: rawChannel.logoURL
|
|
23
23
|
}).toJSON();
|
|
24
24
|
} catch (error) {
|
|
25
25
|
throw new AdapterError(`Failed to adapt channel: ${error.message}`);
|