@zohoim/client-sdk 1.0.0-replyAreaPoc9 → 1.0.0-subscription2
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 +5 -1
- 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/subscription/SubscriptionService.js +36 -0
- package/es/application/services/subscription/index.js +2 -0
- package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
- package/es/application/services/userPreferences/index.js +2 -0
- package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +21 -0
- package/es/application/services/whatsAppPricing/index.js +2 -0
- package/es/core/constants/ModuleNames.js +5 -1
- package/es/core/constants/ModuleTypes.js +5 -0
- package/es/core/constants/index.js +2 -1
- package/es/core/utils/validateSchema.js +25 -0
- 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 +5 -1
- package/es/domain/dto/integrationServices/getIntegrationsRequest.js +7 -0
- package/es/domain/dto/integrationServices/index.js +1 -0
- package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +6 -1
- package/es/domain/dto/sessions/getSessionMetricsRequest.js +16 -0
- package/es/domain/dto/sessions/index.js +2 -1
- package/es/domain/dto/subscription/buyAddOnRequest.js +18 -0
- package/es/domain/dto/subscription/getAddOnsRequest.js +15 -0
- package/es/domain/dto/subscription/getLicenseDetailsRequest.js +7 -0
- package/es/domain/dto/subscription/index.js +4 -0
- package/es/domain/dto/subscription/modifyAddOnRequest.js +18 -0
- 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/dto/whatsAppPricing/calculateWhatsAppPricingRequest.js +14 -0
- package/es/domain/dto/whatsAppPricing/index.js +1 -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/Subscription/AddOn.js +26 -0
- package/es/domain/entities/Subscription/LicenseDetails.js +21 -0
- package/es/domain/entities/Subscription/SubscriptionInfo.js +26 -0
- package/es/domain/entities/Subscription/index.js +4 -0
- package/es/domain/entities/UserPreference/UserPreference.js +26 -0
- package/es/domain/entities/UserPreference/index.js +2 -0
- package/es/domain/entities/WhatsAppPricing/WhatsAppPricing.js +25 -0
- package/es/domain/entities/WhatsAppPricing/WhatsAppPricingCategory.js +22 -0
- package/es/domain/entities/WhatsAppPricing/index.js +3 -0
- package/es/domain/entities/index.js +4 -1
- package/es/domain/enum/index.js +3 -1
- package/es/domain/enum/session/AssigneeFilter.js +6 -0
- package/es/domain/enum/session/SessionReplyStatus.js +4 -1
- package/es/domain/enum/session/SessionStatus.js +2 -1
- package/es/domain/enum/session/index.js +2 -1
- package/es/domain/enum/subscription/AddOnModule.js +5 -0
- package/es/domain/enum/subscription/AddOnName.js +5 -0
- package/es/domain/enum/subscription/AddOnType.js +5 -0
- package/es/domain/enum/subscription/SubscriptionStatus.js +4 -0
- package/es/domain/enum/subscription/index.js +5 -0
- 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 +5 -1
- 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/subscription/ISubscriptionRepository.js +32 -0
- package/es/domain/interfaces/repositories/subscription/index.js +2 -0
- package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
- package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +18 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
- package/es/domain/schema/channel/ChannelSchema.js +39 -5
- package/es/domain/schema/index.js +4 -1
- 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/subscription/AddOnSchema.js +29 -0
- package/es/domain/schema/subscription/LicenseDetailsSchema.js +7 -0
- package/es/domain/schema/subscription/SubscriptionInfoSchema.js +29 -0
- package/es/domain/schema/subscription/index.js +4 -0
- package/es/domain/schema/userPreference/UserPreferenceSchema.js +9 -0
- package/es/domain/schema/userPreference/index.js +2 -0
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingCategorySchema.js +11 -0
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingSchema.js +21 -0
- package/es/domain/schema/whatsAppPricing/index.js +3 -0
- package/es/frameworks/managers/ModuleFactory.js +84 -24
- package/es/frameworks/managers/ModuleManager.js +25 -2
- package/es/frameworks/sdk/IMSDK.js +33 -11
- package/es/frameworks/sdk/integrationServices/IntegrationServiceSDK.js +30 -0
- package/es/frameworks/sdk/integrationServices/index.js +2 -0
- package/es/frameworks/sdk/subscription/SubscriptionSDK.js +32 -0
- package/es/frameworks/sdk/subscription/index.js +2 -0
- package/es/frameworks/sdk/userPreferences/UserPreferencesSDK.js +30 -0
- package/es/frameworks/sdk/userPreferences/index.js +2 -0
- package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +28 -0
- package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
- package/es/infrastructure/adapters/index.js +5 -1
- 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/subscription/AddOnAdapter.js +24 -0
- package/es/infrastructure/adapters/subscription/LicenseDetailsAdapter.js +20 -0
- package/es/infrastructure/adapters/subscription/index.js +3 -0
- package/es/infrastructure/adapters/userPreferences/UserPreferenceAdapter.js +19 -0
- package/es/infrastructure/adapters/userPreferences/index.js +2 -0
- package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingAdapter.js +22 -0
- package/es/infrastructure/adapters/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/BaseAPI.js +5 -4
- package/es/infrastructure/api/index.js +5 -1
- package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
- package/es/infrastructure/api/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +9 -1
- 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/subscription/constructSubscriptionEndPoint.js +10 -0
- package/es/infrastructure/api/registry/subscription/index.js +2 -0
- package/es/infrastructure/api/registry/subscription/subscriptionAPIRegistry.js +30 -0
- 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/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +10 -0
- package/es/infrastructure/api/registry/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +13 -0
- package/es/infrastructure/api/sessions/SessionAPI.js +11 -1
- package/es/infrastructure/api/subscription/SubscriptionAPI.js +48 -0
- package/es/infrastructure/api/subscription/index.js +2 -0
- package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
- package/es/infrastructure/api/userPreferences/index.js +2 -0
- package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +14 -0
- package/es/infrastructure/api/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/config/configRegistry.js +8 -1
- package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
- package/es/infrastructure/repositories/index.js +5 -1
- 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/subscription/SubscriptionRepository.js +83 -0
- package/es/infrastructure/repositories/subscription/index.js +2 -0
- package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
- package/es/infrastructure/repositories/userPreferences/index.js +2 -0
- package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +49 -0
- package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
- package/package.json +1 -1
|
@@ -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
|
+
}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
import { WhatsAppPricingAdapter } from '../../adapters';
|
|
3
|
+
import { WhatsAppPricingAPI } from '../../api';
|
|
4
|
+
import { ResponseTypes } from '../../../core/constants';
|
|
5
|
+
export default class WhatsAppPricingRepository extends IWhatsAppPricingRepository {
|
|
6
|
+
constructor(_ref) {
|
|
7
|
+
let {
|
|
8
|
+
whatsAppPricingAPI,
|
|
9
|
+
whatsAppPricingAdapter
|
|
10
|
+
} = _ref;
|
|
11
|
+
super();
|
|
12
|
+
this.defaultAPI = new WhatsAppPricingAPI();
|
|
13
|
+
this.customAPI = whatsAppPricingAPI;
|
|
14
|
+
this.whatsAppPricingAPI = this.createAPIProxy(this.customAPI, this.defaultAPI);
|
|
15
|
+
this.whatsAppPricingAdapter = whatsAppPricingAdapter || new WhatsAppPricingAdapter();
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
async invokeAPI(_ref2) {
|
|
19
|
+
let {
|
|
20
|
+
operation,
|
|
21
|
+
request,
|
|
22
|
+
adapter = this.whatsAppPricingAdapter,
|
|
23
|
+
responseType
|
|
24
|
+
} = _ref2;
|
|
25
|
+
return this.executeAPICall({
|
|
26
|
+
operation,
|
|
27
|
+
request,
|
|
28
|
+
apiProxy: this.whatsAppPricingAPI,
|
|
29
|
+
customAPI: this.customAPI,
|
|
30
|
+
adapter,
|
|
31
|
+
responseType
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
async calculateWhatsAppPricing(request) {
|
|
36
|
+
return this.invokeAPI({
|
|
37
|
+
operation: 'calculateWhatsAppPricing',
|
|
38
|
+
request,
|
|
39
|
+
responseType: ResponseTypes.SINGLE
|
|
40
|
+
});
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
toJSON() {
|
|
44
|
+
return {
|
|
45
|
+
calculateWhatsAppPricing: this.calculateWhatsAppPricing.bind(this)
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
}
|