@zohoim/client-sdk 1.0.0-poc99 → 1.0.0-replyAreaPoc2
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/cannedMessages/CannedMessageService.js +51 -0
- package/es/application/services/cannedMessages/index.js +2 -0
- package/es/application/services/index.js +3 -1
- package/es/application/services/templateMessages/TemplateMessageService.js +26 -0
- package/es/application/services/templateMessages/index.js +2 -0
- package/es/core/constants/ModuleNames.js +4 -1
- package/es/domain/dto/cannedMessages/createCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/deleteCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/disableCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/enableCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/getCannedMessageRequest.js +13 -0
- package/es/domain/dto/cannedMessages/getCannedMessagesRequest.js +18 -0
- package/es/domain/dto/cannedMessages/index.js +7 -0
- package/es/domain/dto/cannedMessages/updateCannedMessageRequest.js +13 -0
- package/es/domain/dto/index.js +3 -1
- package/es/domain/dto/messages/sendMessageRequest.js +1 -1
- package/es/domain/dto/templateMessages/getTemplateCreditExhaustStatusRequest.js +11 -0
- package/es/domain/dto/templateMessages/getTemplateLanguagesRequest.js +7 -0
- package/es/domain/dto/templateMessages/index.js +2 -0
- package/es/domain/entities/CannedMessage/CannedMessage.js +52 -0
- package/es/domain/entities/CannedMessage/index.js +2 -0
- package/es/domain/entities/CustomReplyExtension/CustomReplyExtension.js +22 -0
- package/es/domain/entities/CustomReplyExtension/index.js +2 -0
- package/es/domain/entities/TemplateMessage/TemplateCreditExhaustStatus.js +23 -0
- package/es/domain/entities/TemplateMessage/TemplateLanguage.js +18 -0
- package/es/domain/entities/TemplateMessage/index.js +3 -0
- package/es/domain/entities/index.js +4 -1
- package/es/domain/enum/cannedMessage/CannedMessageStatus.js +6 -0
- package/es/domain/enum/cannedMessage/index.js +2 -0
- package/es/domain/enum/index.js +3 -1
- package/es/domain/enum/templateMessage/TemplateCreditExhaustStatusCode.js +4 -0
- package/es/domain/enum/templateMessage/TemplateLanguage.js +74 -0
- package/es/domain/enum/templateMessage/index.js +3 -0
- package/es/domain/interfaces/repositories/cannedMessages/ICannedMessageRepository.js +47 -0
- package/es/domain/interfaces/repositories/cannedMessages/index.js +2 -0
- package/es/domain/interfaces/repositories/index.js +3 -1
- package/es/domain/interfaces/repositories/templateMessages/ITemplateMessageRepository.js +21 -0
- package/es/domain/interfaces/repositories/templateMessages/index.js +2 -0
- package/es/domain/schema/cannedMessage/CannedMessageSchema.js +54 -0
- package/es/domain/schema/cannedMessage/index.js +2 -0
- package/es/domain/schema/customReplyExtension/CustomReplyExtensionSchema.js +28 -0
- package/es/domain/schema/customReplyExtension/index.js +2 -0
- package/es/domain/schema/index.js +4 -1
- package/es/domain/schema/templateMessage/TemplateCreditExhaustStatusSchema.js +13 -0
- package/es/domain/schema/templateMessage/TemplateLanguageSchema.js +13 -0
- package/es/domain/schema/templateMessage/index.js +3 -0
- package/es/frameworks/managers/ModuleFactory.js +18 -0
- package/es/frameworks/managers/ModuleManager.js +1 -1
- package/es/frameworks/sdk/IMSDK.js +10 -0
- package/es/frameworks/sdk/cannedMessages/CannedMessageSDK.js +30 -0
- package/es/frameworks/sdk/cannedMessages/index.js +2 -0
- package/es/frameworks/sdk/templateMessages/TemplateMessageSDK.js +30 -0
- package/es/frameworks/sdk/templateMessages/index.js +2 -0
- package/es/infrastructure/adapters/cannedMessages/CannedMessageAdapter.js +28 -0
- package/es/infrastructure/adapters/cannedMessages/index.js +2 -0
- package/es/infrastructure/adapters/customReplyExtension/CustomReplyExtensionAdapter.js +24 -0
- package/es/infrastructure/adapters/customReplyExtension/index.js +2 -0
- package/es/infrastructure/adapters/index.js +4 -1
- package/es/infrastructure/adapters/templateMessages/TemplateCreditExhaustStatusAdapter.js +20 -0
- package/es/infrastructure/adapters/templateMessages/TemplateLanguageAdapter.js +20 -0
- package/es/infrastructure/adapters/templateMessages/index.js +3 -0
- package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +74 -0
- package/es/infrastructure/api/cannedMessages/index.js +2 -0
- package/es/infrastructure/api/index.js +3 -1
- package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +42 -0
- package/es/infrastructure/api/registry/cannedMessages/constructCannedMessageEndPoint.js +10 -0
- package/es/infrastructure/api/registry/cannedMessages/index.js +2 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +5 -1
- package/es/infrastructure/api/registry/templateMessages/constructTemplateMessageEndPoint.js +10 -0
- package/es/infrastructure/api/registry/templateMessages/index.js +2 -0
- package/es/infrastructure/api/registry/templateMessages/templateMessageAPIRegistry.js +18 -0
- package/es/infrastructure/api/templateMessages/TemplateMessageAPI.js +24 -0
- package/es/infrastructure/api/templateMessages/index.js +2 -0
- package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +97 -0
- package/es/infrastructure/repositories/cannedMessages/index.js +2 -0
- package/es/infrastructure/repositories/index.js +3 -1
- package/es/infrastructure/repositories/templateMessages/TemplateMessageRepository.js +77 -0
- package/es/infrastructure/repositories/templateMessages/index.js +2 -0
- package/package.json +1 -1
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { CannedMessageAdapter } from '../../adapters';
|
|
2
|
+
import { CannedMessageAPI } from '../../api';
|
|
3
|
+
import { ICannedMessageRepository } from '../../../domain/interfaces/repositories/cannedMessages';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class CannedMessageRepository extends ICannedMessageRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
cannedMessageAPI,
|
|
9
|
+
cannedMessageAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new CannedMessageAPI();
|
|
13
|
+
this.customAPI = cannedMessageAPI;
|
|
14
|
+
this.cannedMessageAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.cannedMessageAdapter = cannedMessageAdapter || new CannedMessageAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.cannedMessageAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.cannedMessageAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async getCannedMessages(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'getCannedMessages',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.LIST
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
async getCannedMessage(request) {
|
|
44
|
+
return this.invokeAPI({
|
|
45
|
+
operation: 'getCannedMessage',
|
|
46
|
+
request
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async createCannedMessage(request) {
|
|
51
|
+
return this.invokeAPI({
|
|
52
|
+
operation: 'createCannedMessage',
|
|
53
|
+
request
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
async deleteCannedMessage(request) {
|
|
58
|
+
return this.invokeAPI({
|
|
59
|
+
operation: 'deleteCannedMessage',
|
|
60
|
+
request
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
async updateCannedMessage(request) {
|
|
65
|
+
return this.invokeAPI({
|
|
66
|
+
operation: 'updateCannedMessage',
|
|
67
|
+
request
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async enableCannedMessage(request) {
|
|
72
|
+
return this.invokeAPI({
|
|
73
|
+
operation: 'enableCannedMessage',
|
|
74
|
+
request
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
async disableCannedMessage(request) {
|
|
79
|
+
return this.invokeAPI({
|
|
80
|
+
operation: 'disableCannedMessage',
|
|
81
|
+
request
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
toJSON() {
|
|
86
|
+
return {
|
|
87
|
+
getCannedMessages: this.getCannedMessages.bind(this),
|
|
88
|
+
getCannedMessage: this.getCannedMessage.bind(this),
|
|
89
|
+
createCannedMessage: this.createCannedMessage.bind(this),
|
|
90
|
+
updateCannedMessage: this.updateCannedMessage.bind(this),
|
|
91
|
+
deleteCannedMessage: this.deleteCannedMessage.bind(this),
|
|
92
|
+
enableCannedMssage: this.enableCannedMessage.bind(this),
|
|
93
|
+
disableCannedMessage: this.disableCannedMessage.bind(this)
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { ITemplateMessageRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { TemplateLanguageAdapter, TemplateCreditExhaustStatusAdapter } from '../../adapters';
|
|
3
|
+
import { TemplateMessageAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class TemplateMessageRepository extends ITemplateMessageRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
templateMessageAPI,
|
|
9
|
+
templateLanguageAdapter,
|
|
10
|
+
templateCreditExhaustStatusAdapter
|
|
11
|
+
} = _ref;
|
|
12
|
+
super();
|
|
13
|
+
this.defaultAPI = new TemplateMessageAPI();
|
|
14
|
+
this.customAPI = templateMessageAPI;
|
|
15
|
+
this.templateMessageAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
16
|
+
this.templateLanguageAdapter = templateLanguageAdapter || new TemplateLanguageAdapter();
|
|
17
|
+
this.templateCreditExhaustStatusAdapter = templateCreditExhaustStatusAdapter || new TemplateCreditExhaustStatusAdapter();
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
async invokeTemplateLanguageAPI(_ref2) {
|
|
21
|
+
let {
|
|
22
|
+
operation,
|
|
23
|
+
request,
|
|
24
|
+
adapter = this.templateLanguageAdapter,
|
|
25
|
+
responseType
|
|
26
|
+
} = _ref2;
|
|
27
|
+
return this.executeAPICall({
|
|
28
|
+
operation,
|
|
29
|
+
request,
|
|
30
|
+
apiProxy: this.templateMessageAPI,
|
|
31
|
+
customAPI: this.customAPI,
|
|
32
|
+
adapter,
|
|
33
|
+
responseType
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async invokeTemplateCreditExhaustStatusAPI(_ref3) {
|
|
38
|
+
let {
|
|
39
|
+
operation,
|
|
40
|
+
request,
|
|
41
|
+
adapter = this.templateLanguageAdapter,
|
|
42
|
+
responseType
|
|
43
|
+
} = _ref3;
|
|
44
|
+
return this.executeAPICall({
|
|
45
|
+
operation,
|
|
46
|
+
request,
|
|
47
|
+
apiProxy: this.templateMessageAPI,
|
|
48
|
+
customAPI: this.customAPI,
|
|
49
|
+
adapter,
|
|
50
|
+
responseType
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
async getTemplateLanguages(request) {
|
|
55
|
+
return this.invokeTemplateLanguageAPI({
|
|
56
|
+
operation: 'getTemplateLanguages',
|
|
57
|
+
request,
|
|
58
|
+
responseType: ResponseTypes.LIST
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
async getWhatsAppTemplateCreditExhaustStatus(request) {
|
|
63
|
+
return this.invokeTemplateCreditExhaustStatusAPI({
|
|
64
|
+
operation: 'getWhatsAppTemplateCreditExhaustStatus',
|
|
65
|
+
request,
|
|
66
|
+
responseType: ResponseTypes.SINGLE
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
toJSON() {
|
|
71
|
+
return {
|
|
72
|
+
getTemplateLanguages: this.getTemplateLanguages.bind(this),
|
|
73
|
+
getWhatsAppTemplateCreditExhaustStatus: this.getWhatsAppTemplateCreditExhaustStatus.bind(this)
|
|
74
|
+
};
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
}
|