@zohoim/client-sdk 1.1.0-calls → 1.1.0-calls1
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/application/services/channels/ChannelService.js +6 -1
- package/es/application/services/index.js +2 -0
- package/es/application/services/integrationServices/IntegrationService.js +21 -0
- package/es/application/services/integrationServices/index.js +2 -0
- package/es/application/services/sessions/SessionService.js +6 -1
- package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
- package/es/application/services/userPreferences/index.js +2 -0
- package/es/core/constants/ModuleNames.js +2 -0
- package/es/core/utils/validateSchema.js +22 -9
- package/es/domain/dto/channels/getChannelRequest.js +13 -0
- package/es/domain/dto/channels/getChannelsRequest.js +3 -1
- package/es/domain/dto/channels/index.js +2 -1
- package/es/domain/dto/index.js +2 -0
- package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
- package/es/domain/dto/integrationServices/index.js +1 -0
- package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
- package/es/domain/dto/sessions/index.js +2 -1
- package/es/domain/dto/userPreferences/getPreferencesRequest.js +7 -0
- package/es/domain/dto/userPreferences/index.js +2 -0
- package/es/domain/dto/userPreferences/updatePreferencesRequest.js +9 -0
- package/es/domain/entities/Channel/Channel.js +22 -4
- package/es/domain/entities/IntegrationService/IntegrationService.js +8 -1
- package/es/domain/entities/Session/SessionMetrics.js +21 -0
- package/es/domain/entities/Session/index.js +2 -1
- package/es/domain/entities/UserPreference/UserPreference.js +26 -0
- package/es/domain/entities/UserPreference/index.js +2 -0
- package/es/domain/entities/index.js +1 -0
- package/es/domain/enum/index.js +1 -0
- package/es/domain/enum/session/AssigneeFilter.js +6 -0
- package/es/domain/enum/session/SessionStatus.js +2 -1
- package/es/domain/enum/session/index.js +2 -1
- package/es/domain/enum/userPreference/CollapseSidePanel.js +5 -0
- package/es/domain/enum/userPreference/index.js +2 -0
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
- package/es/domain/interfaces/repositories/index.js +2 -0
- package/es/domain/interfaces/repositories/integrationServices/IIntegrationServiceRepository.js +17 -0
- package/es/domain/interfaces/repositories/integrationServices/index.js +2 -0
- package/es/domain/interfaces/repositories/sessions/ISessionRepository.js +6 -1
- package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
- package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
- package/es/domain/schema/channel/ChannelSchema.js +39 -5
- package/es/domain/schema/index.js +1 -0
- package/es/domain/schema/integrationService/IntegrationServiceSchema.js +12 -0
- package/es/domain/schema/session/SessionMetrics/AssigneeSchema.js +20 -0
- package/es/domain/schema/session/SessionMetrics/SessionMetricsForAssigneeSchema.js +32 -0
- package/es/domain/schema/session/SessionMetrics/index.js +2 -0
- package/es/domain/schema/session/SessionMetricsSchema.js +9 -0
- package/es/domain/schema/session/index.js +2 -1
- package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
- package/es/domain/schema/userPreference/index.js +2 -0
- package/es/frameworks/managers/ModuleFactory.js +25 -3
- package/es/frameworks/managers/ModuleManager.js +1 -1
- package/es/frameworks/sdk/IMSDK.js +10 -0
- package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
- package/es/frameworks/sdk/integrationServices/index.js +2 -0
- package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
- package/es/frameworks/sdk/userPreferences/index.js +2 -0
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
- package/es/infrastructure/adapters/index.js +2 -0
- package/es/infrastructure/adapters/integrationServices/IntegrationServiceAdapter.js +25 -0
- package/es/infrastructure/adapters/integrationServices/index.js +2 -0
- package/es/infrastructure/adapters/sessions/SessionMetricsAdapter.js +19 -0
- package/es/infrastructure/adapters/sessions/index.js +2 -1
- package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
- package/es/infrastructure/adapters/userPreferences/index.js +2 -0
- package/es/infrastructure/api/index.js +2 -0
- package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
- package/es/infrastructure/api/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +4 -0
- package/es/infrastructure/api/registry/integrationServices/constructIntegrationServiceEndPoint.js +10 -0
- package/es/infrastructure/api/registry/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/integrationServices/integrationServiceAPIRegistry.js +12 -0
- package/es/infrastructure/api/registry/sessions/sessionAPIRegistry.js +8 -2
- package/es/infrastructure/api/registry/userPreferences/constructUserPreferencesEndPoint.js +10 -0
- package/es/infrastructure/api/registry/userPreferences/index.js +2 -0
- package/es/infrastructure/api/registry/userPreferences/userPreferenceAPIRegistry.js +17 -0
- package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
- package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
- package/es/infrastructure/api/userPreferences/index.js +2 -0
- package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
- package/es/infrastructure/repositories/index.js +2 -0
- package/es/infrastructure/repositories/integrationServices/IntegrationServiceRepository.js +49 -0
- package/es/infrastructure/repositories/integrationServices/index.js +2 -0
- package/es/infrastructure/repositories/sessions/SessionRepository.js +14 -3
- package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
- package/es/infrastructure/repositories/userPreferences/index.js +2 -0
- package/package.json +1 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AttachmentAdapter, MessageAdapter, SessionAdapter } from '../../adapters/index';
|
|
1
|
+
import { AttachmentAdapter, MessageAdapter, SessionAdapter, SessionMetricsAdapter } from '../../adapters/index';
|
|
2
2
|
import { ISessionRepository } from '../../../domain/interfaces/repositories';
|
|
3
3
|
import { SessionAPI } from '../../api';
|
|
4
4
|
import { ResponseTypes } from '../../../core/constants';
|
|
@@ -8,7 +8,8 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
8
8
|
sessionAPI,
|
|
9
9
|
sessionAdapter,
|
|
10
10
|
attachmentAdapter,
|
|
11
|
-
messageAdapter
|
|
11
|
+
messageAdapter,
|
|
12
|
+
sessionMetricsAdapter
|
|
12
13
|
} = _ref;
|
|
13
14
|
super();
|
|
14
15
|
this.defaultAPI = new SessionAPI();
|
|
@@ -17,6 +18,7 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
17
18
|
this.sessionAdapter = sessionAdapter || new SessionAdapter();
|
|
18
19
|
this.attachmentAdapter = attachmentAdapter || new AttachmentAdapter();
|
|
19
20
|
this.messageAdapter = messageAdapter || new MessageAdapter();
|
|
21
|
+
this.sessionMetricsAdapter = sessionMetricsAdapter || new SessionMetricsAdapter();
|
|
20
22
|
}
|
|
21
23
|
|
|
22
24
|
async invokeAPI(_ref2) {
|
|
@@ -97,6 +99,14 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
97
99
|
});
|
|
98
100
|
}
|
|
99
101
|
|
|
102
|
+
async getSessionMetrics(request) {
|
|
103
|
+
return this.invokeAPI({
|
|
104
|
+
operation: 'getSessionMetrics',
|
|
105
|
+
request,
|
|
106
|
+
adapter: this.sessionMetricsAdapter
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
|
|
100
110
|
toJSON() {
|
|
101
111
|
return {
|
|
102
112
|
pickupSession: this.pickupSession.bind(this),
|
|
@@ -106,7 +116,8 @@ export default class SessionRepository extends ISessionRepository {
|
|
|
106
116
|
getSessionAttachments: this.getSessionAttachments.bind(this),
|
|
107
117
|
getSessionLastMessages: this.getSessionLastMessages.bind(this),
|
|
108
118
|
markSessionAsRead: this.markSessionAsRead.bind(this),
|
|
109
|
-
updateSessionStatus: this.updateSessionStatus.bind(this)
|
|
119
|
+
updateSessionStatus: this.updateSessionStatus.bind(this),
|
|
120
|
+
getSessionMetrics: this.getSessionMetrics.bind(this)
|
|
110
121
|
};
|
|
111
122
|
}
|
|
112
123
|
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
import { IUserPreferenceRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { UserPreferenceAdapter } from '../../adapters';
|
|
3
|
+
import { UserPreferenceAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class UserPreferenceRepository extends IUserPreferenceRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
userPreferenceAPI,
|
|
9
|
+
userPreferenceAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new UserPreferenceAPI();
|
|
13
|
+
this.customAPI = userPreferenceAPI;
|
|
14
|
+
this.userPreferenceAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.userPreferenceAdapter = userPreferenceAdapter || new UserPreferenceAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.userPreferenceAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.userPreferenceAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getPreferences(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getPreferences',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.SINGLE
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async updatePreferences(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'updatePreferences',
|
|
46
|
+
request,
|
|
47
|
+
responseType: ResponseTypes.SINGLE
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
toJSON() {
|
|
52
|
+
return {
|
|
53
|
+
getPreferences: this.getPreferences.bind(this),
|
|
54
|
+
updatePreferences: this.updatePreferences.bind(this)
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
}
|