@zohoim/client-sdk 1.0.0-whatsAppPricing.4 → 1.2.0-attachmentsList
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/index.js +1 -3
- package/es/core/constants/ModuleNames.js +1 -3
- package/es/core/constants/index.js +1 -2
- package/es/domain/dto/index.js +1 -3
- package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +6 -1
- package/es/domain/entities/index.js +1 -4
- package/es/domain/enum/index.js +1 -2
- package/es/domain/interfaces/repositories/index.js +1 -3
- package/es/domain/schema/index.js +1 -3
- package/es/frameworks/managers/ModuleFactory.js +24 -62
- package/es/frameworks/managers/ModuleManager.js +4 -20
- package/es/frameworks/sdk/IMSDK.js +11 -23
- package/es/infrastructure/adapters/index.js +1 -3
- package/es/infrastructure/api/BaseAPI.js +4 -5
- package/es/infrastructure/api/index.js +1 -3
- package/es/infrastructure/api/registry/getRegistryConfig.js +1 -5
- package/es/infrastructure/config/configRegistry.js +1 -8
- package/es/infrastructure/repositories/index.js +1 -3
- package/package.json +1 -1
- package/es/application/services/subscription/SubscriptionService.js +0 -36
- package/es/application/services/subscription/index.js +0 -2
- package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +0 -21
- package/es/application/services/whatsAppPricing/index.js +0 -2
- package/es/core/constants/ModuleTypes.js +0 -5
- package/es/domain/dto/subscription/buyAddOnPackageRequest.js +0 -18
- package/es/domain/dto/subscription/getAddOnPackagesRequest.js +0 -15
- package/es/domain/dto/subscription/getLicenseDetailsRequest.js +0 -7
- package/es/domain/dto/subscription/index.js +0 -5
- package/es/domain/dto/subscription/modifyAddOnPackageRequest.js +0 -18
- package/es/domain/dto/whatsAppPricing/calculatePricingRequest.js +0 -14
- package/es/domain/dto/whatsAppPricing/index.js +0 -2
- package/es/domain/entities/AddOnPackage/AddOnPackage.js +0 -34
- package/es/domain/entities/AddOnPackage/index.js +0 -2
- package/es/domain/entities/LicenseDetails/LicenseDetails.js +0 -23
- package/es/domain/entities/LicenseDetails/index.js +0 -2
- package/es/domain/entities/WhatsAppPricingResult/WhatsAppPricingResult.js +0 -24
- package/es/domain/entities/WhatsAppPricingResult/index.js +0 -2
- package/es/domain/enum/subscription/AddOnSubscriptionStatus.js +0 -7
- package/es/domain/enum/subscription/index.js +0 -2
- package/es/domain/interfaces/repositories/subscription/ISubscriptionRepository.js +0 -35
- package/es/domain/interfaces/repositories/subscription/index.js +0 -2
- package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +0 -18
- package/es/domain/interfaces/repositories/whatsAppPricing/index.js +0 -2
- package/es/domain/schema/subscription/AddOnPackageSchema.js +0 -33
- package/es/domain/schema/subscription/AddOnSubscriptionSchema.js +0 -29
- package/es/domain/schema/subscription/LicenseDetailsSchema.js +0 -11
- package/es/domain/schema/subscription/index.js +0 -4
- package/es/domain/schema/whatsAppPricing/PricingCategorySchema.js +0 -11
- package/es/domain/schema/whatsAppPricing/WhatsAppPricingResultSchema.js +0 -21
- package/es/domain/schema/whatsAppPricing/index.js +0 -3
- package/es/frameworks/sdk/subscription/SubscriptionSDK.js +0 -29
- package/es/frameworks/sdk/subscription/index.js +0 -2
- package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +0 -27
- package/es/frameworks/sdk/whatsAppPricing/index.js +0 -2
- package/es/infrastructure/adapters/subscription/AddOnPackageAdapter.js +0 -25
- package/es/infrastructure/adapters/subscription/LicenseDetailsAdapter.js +0 -20
- package/es/infrastructure/adapters/subscription/index.js +0 -3
- package/es/infrastructure/adapters/whatsAppPricing/WhatsAppPricingResultAdapter.js +0 -22
- package/es/infrastructure/adapters/whatsAppPricing/index.js +0 -2
- package/es/infrastructure/api/registry/createPublicBaseUrl.js +0 -4
- package/es/infrastructure/api/registry/subscription/constructSubscriptionEndPoint.js +0 -10
- package/es/infrastructure/api/registry/subscription/index.js +0 -3
- package/es/infrastructure/api/registry/subscription/subscriptionAPIRegistry.js +0 -28
- package/es/infrastructure/api/registry/whatsAppPricing/constructWhatsAppPricingEndPoint.js +0 -5
- package/es/infrastructure/api/registry/whatsAppPricing/index.js +0 -2
- package/es/infrastructure/api/registry/whatsAppPricing/whatsAppPricingAPIRegistry.js +0 -13
- package/es/infrastructure/api/subscription/SubscriptionAPI.js +0 -44
- package/es/infrastructure/api/subscription/index.js +0 -2
- package/es/infrastructure/api/whatsAppPricing/WhatsAppPricingAPI.js +0 -14
- package/es/infrastructure/api/whatsAppPricing/index.js +0 -2
- package/es/infrastructure/repositories/subscription/SubscriptionRepository.js +0 -82
- package/es/infrastructure/repositories/subscription/index.js +0 -2
- package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +0 -50
- package/es/infrastructure/repositories/whatsAppPricing/index.js +0 -2
|
@@ -7,8 +7,6 @@ const ModuleNames = {
|
|
|
7
7
|
AGENTS: 'agents',
|
|
8
8
|
CANNED_MESSAGES: 'cannedMessages',
|
|
9
9
|
TEMPLATE_MESSAGES: 'templateMessages',
|
|
10
|
-
CUSTOM_REPLY_EXTENSIONS: 'articles'
|
|
11
|
-
SUBSCRIPTION: 'subscription',
|
|
12
|
-
WHATSAPP_PRICING: 'whatsAppPricing'
|
|
10
|
+
CUSTOM_REPLY_EXTENSIONS: 'articles'
|
|
13
11
|
};
|
|
14
12
|
export default ModuleNames;
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
2
|
import ModuleNames from './ModuleNames';
|
|
3
|
-
import ModuleTypes from './ModuleTypes';
|
|
4
3
|
import ResponseTypes from './ResponseTypes';
|
|
5
4
|
const IM_API_PREFIX = '/api/v1';
|
|
6
5
|
const HTTP_METHODS = HttpMethods;
|
|
7
|
-
export { ModuleNames,
|
|
6
|
+
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
package/es/domain/dto/index.js
CHANGED
|
@@ -2,11 +2,16 @@ import RequestBuilder from '../RequestBuilder';
|
|
|
2
2
|
|
|
3
3
|
function getSessionAttachmentsRequest() {
|
|
4
4
|
let {
|
|
5
|
-
params = {}
|
|
5
|
+
params = {},
|
|
6
|
+
query = {}
|
|
6
7
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
8
|
return new RequestBuilder().withParams({
|
|
8
9
|
sessionId: null,
|
|
9
10
|
...params
|
|
11
|
+
}).withQuery({
|
|
12
|
+
from: null,
|
|
13
|
+
limit: null,
|
|
14
|
+
...query
|
|
10
15
|
}).build();
|
|
11
16
|
}
|
|
12
17
|
|
|
@@ -9,7 +9,4 @@ export * from './Contact';
|
|
|
9
9
|
export * from './IntegrationService';
|
|
10
10
|
export * from './CannedMessage';
|
|
11
11
|
export * from './TemplateMessage';
|
|
12
|
-
export * from './CustomReplyExtension';
|
|
13
|
-
export * from './AddOnPackage';
|
|
14
|
-
export * from './LicenseDetails';
|
|
15
|
-
export * from './WhatsAppPricingResult';
|
|
12
|
+
export * from './CustomReplyExtension';
|
package/es/domain/enum/index.js
CHANGED
|
@@ -8,6 +8,4 @@ export * from './integrationService';
|
|
|
8
8
|
export * from './contact';
|
|
9
9
|
export * from './cannedMessage';
|
|
10
10
|
export * from './templateMessage';
|
|
11
|
-
export * from './customReplyExtension';
|
|
12
|
-
export * from './subscription';
|
|
13
|
-
export * from './whatsAppPricing';
|
|
11
|
+
export * from './customReplyExtension';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleNames
|
|
1
|
+
import { ModuleNames } from '../../core/constants';
|
|
2
2
|
import { BotSDK } from '../sdk/bots';
|
|
3
3
|
import { ChannelSDK } from '../sdk/channels';
|
|
4
4
|
import { SessionSDK } from '../sdk/sessions';
|
|
@@ -7,108 +7,70 @@ import { AgentSDK } from '../sdk/agents';
|
|
|
7
7
|
import { ContactSDK } from '../sdk/contacts';
|
|
8
8
|
import { CannedMessageSDK } from '../sdk/cannedMessages';
|
|
9
9
|
import { TemplateMessageSDK } from '../sdk/templateMessages';
|
|
10
|
-
import { SubscriptionSDK } from '../sdk/subscription';
|
|
11
|
-
import { WhatsAppPricingSDK } from '../sdk/whatsAppPricing';
|
|
12
10
|
const ModuleFactory = {
|
|
13
11
|
[ModuleNames.CHANNELS]: _ref => {
|
|
14
12
|
let {
|
|
15
13
|
config
|
|
16
14
|
} = _ref;
|
|
17
|
-
return {
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
}).toJSON()
|
|
21
|
-
};
|
|
15
|
+
return new ChannelSDK({
|
|
16
|
+
config
|
|
17
|
+
}).toJSON();
|
|
22
18
|
},
|
|
23
19
|
[ModuleNames.SESSIONS]: _ref2 => {
|
|
24
20
|
let {
|
|
25
21
|
config
|
|
26
22
|
} = _ref2;
|
|
27
|
-
return {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
}).toJSON()
|
|
31
|
-
};
|
|
23
|
+
return new SessionSDK({
|
|
24
|
+
config
|
|
25
|
+
}).toJSON();
|
|
32
26
|
},
|
|
33
27
|
[ModuleNames.BOTS]: _ref3 => {
|
|
34
28
|
let {
|
|
35
29
|
config
|
|
36
30
|
} = _ref3;
|
|
37
|
-
return {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}).toJSON()
|
|
41
|
-
};
|
|
31
|
+
return new BotSDK({
|
|
32
|
+
config
|
|
33
|
+
}).toJSON();
|
|
42
34
|
},
|
|
43
35
|
[ModuleNames.AGENTS]: _ref4 => {
|
|
44
36
|
let {
|
|
45
37
|
config
|
|
46
38
|
} = _ref4;
|
|
47
|
-
return {
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
}).toJSON()
|
|
51
|
-
};
|
|
39
|
+
return new AgentSDK({
|
|
40
|
+
config
|
|
41
|
+
}).toJSON();
|
|
52
42
|
},
|
|
53
43
|
[ModuleNames.CONTACTS]: _ref5 => {
|
|
54
44
|
let {
|
|
55
45
|
config
|
|
56
46
|
} = _ref5;
|
|
57
|
-
return {
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
}).toJSON()
|
|
61
|
-
};
|
|
47
|
+
return new ContactSDK({
|
|
48
|
+
config
|
|
49
|
+
}).toJSON();
|
|
62
50
|
},
|
|
63
51
|
[ModuleNames.MESSAGES]: _ref6 => {
|
|
64
52
|
let {
|
|
65
53
|
config
|
|
66
54
|
} = _ref6;
|
|
67
|
-
return {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
}).toJSON()
|
|
71
|
-
};
|
|
55
|
+
return new MessageSDK({
|
|
56
|
+
config
|
|
57
|
+
}).toJSON();
|
|
72
58
|
},
|
|
73
59
|
[ModuleNames.CANNED_MESSAGES]: _ref7 => {
|
|
74
60
|
let {
|
|
75
61
|
config
|
|
76
62
|
} = _ref7;
|
|
77
|
-
return {
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
}).toJSON()
|
|
81
|
-
};
|
|
63
|
+
return new CannedMessageSDK({
|
|
64
|
+
config
|
|
65
|
+
}).toJSON();
|
|
82
66
|
},
|
|
83
67
|
[ModuleNames.TEMPLATE_MESSAGES]: _ref8 => {
|
|
84
68
|
let {
|
|
85
69
|
config
|
|
86
70
|
} = _ref8;
|
|
87
|
-
return {
|
|
88
|
-
[ModuleTypes.AUTHENTICATED]: new TemplateMessageSDK({
|
|
89
|
-
config
|
|
90
|
-
}).toJSON()
|
|
91
|
-
};
|
|
92
|
-
},
|
|
93
|
-
[ModuleNames.SUBSCRIPTION]: _ref9 => {
|
|
94
|
-
let {
|
|
95
|
-
config
|
|
96
|
-
} = _ref9;
|
|
97
|
-
return {
|
|
98
|
-
[ModuleTypes.AUTHENTICATED]: new SubscriptionSDK({
|
|
99
|
-
config
|
|
100
|
-
}).toJSON()
|
|
101
|
-
};
|
|
102
|
-
},
|
|
103
|
-
[ModuleNames.WHATSAPP_PRICING]: _ref10 => {
|
|
104
|
-
let {
|
|
71
|
+
return new TemplateMessageSDK({
|
|
105
72
|
config
|
|
106
|
-
}
|
|
107
|
-
return {
|
|
108
|
-
[ModuleTypes.PUBLIC]: new WhatsAppPricingSDK({
|
|
109
|
-
config
|
|
110
|
-
}).toJSON()
|
|
111
|
-
};
|
|
73
|
+
}).toJSON();
|
|
112
74
|
}
|
|
113
75
|
};
|
|
114
76
|
export default ModuleFactory;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ModuleNames } from '../../core/constants';
|
|
2
2
|
import ModuleFactory from './ModuleFactory';
|
|
3
3
|
export default class ModuleManager {
|
|
4
4
|
constructor() {
|
|
5
5
|
this._modules = new Map();
|
|
6
|
-
this.supportedModules =
|
|
6
|
+
this.supportedModules = [ModuleNames.CHANNELS, ModuleNames.SESSIONS, ModuleNames.BOTS, ModuleNames.MESSAGES, ModuleNames.AGENTS, ModuleNames.CONTACTS, ModuleNames.CANNED_MESSAGES, ModuleNames.TEMPLATE_MESSAGES];
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
initialize(_ref) {
|
|
@@ -33,28 +33,12 @@ export default class ModuleManager {
|
|
|
33
33
|
}
|
|
34
34
|
}
|
|
35
35
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
const module = this._modules.get(moduleName);
|
|
40
|
-
|
|
41
|
-
return module ? module[moduleType] : undefined;
|
|
36
|
+
getModule(moduleName) {
|
|
37
|
+
return this._modules.get(moduleName);
|
|
42
38
|
}
|
|
43
39
|
|
|
44
40
|
hasModule(moduleName) {
|
|
45
41
|
return this._modules.has(moduleName);
|
|
46
42
|
}
|
|
47
43
|
|
|
48
|
-
getModulesByType(moduleType) {
|
|
49
|
-
const result = {};
|
|
50
|
-
|
|
51
|
-
this._modules.forEach((module, moduleName) => {
|
|
52
|
-
if (module[moduleType]) {
|
|
53
|
-
result[moduleName] = module[moduleType];
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
return result;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
44
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ModuleNames
|
|
1
|
+
import { ModuleNames } from '../../core/constants';
|
|
2
2
|
import configRegistry from '../../infrastructure/config/configRegistry';
|
|
3
3
|
import { ModuleManager } from '../managers';
|
|
4
4
|
export default class IMSDK {
|
|
@@ -6,13 +6,11 @@ export default class IMSDK {
|
|
|
6
6
|
let {
|
|
7
7
|
baseURL,
|
|
8
8
|
apiConfig = {},
|
|
9
|
-
httpClient
|
|
10
|
-
publicHttpClient
|
|
9
|
+
httpClient
|
|
11
10
|
} = _ref;
|
|
12
11
|
configRegistry.setConfig({
|
|
13
12
|
baseURL,
|
|
14
|
-
httpClient
|
|
15
|
-
publicHttpClient
|
|
13
|
+
httpClient
|
|
16
14
|
});
|
|
17
15
|
this._moduleManager = new ModuleManager();
|
|
18
16
|
|
|
@@ -22,43 +20,35 @@ export default class IMSDK {
|
|
|
22
20
|
}
|
|
23
21
|
|
|
24
22
|
get channels() {
|
|
25
|
-
return this._moduleManager.
|
|
23
|
+
return this._moduleManager.getModule(ModuleNames.CHANNELS);
|
|
26
24
|
}
|
|
27
25
|
|
|
28
26
|
get sessions() {
|
|
29
|
-
return this._moduleManager.
|
|
27
|
+
return this._moduleManager.getModule(ModuleNames.SESSIONS);
|
|
30
28
|
}
|
|
31
29
|
|
|
32
30
|
get bots() {
|
|
33
|
-
return this._moduleManager.
|
|
31
|
+
return this._moduleManager.getModule(ModuleNames.BOTS);
|
|
34
32
|
}
|
|
35
33
|
|
|
36
34
|
get messages() {
|
|
37
|
-
return this._moduleManager.
|
|
35
|
+
return this._moduleManager.getModule(ModuleNames.MESSAGES);
|
|
38
36
|
}
|
|
39
37
|
|
|
40
38
|
get agents() {
|
|
41
|
-
return this._moduleManager.
|
|
39
|
+
return this._moduleManager.getModule(ModuleNames.AGENTS);
|
|
42
40
|
}
|
|
43
41
|
|
|
44
42
|
get contacts() {
|
|
45
|
-
return this._moduleManager.
|
|
43
|
+
return this._moduleManager.getModule(ModuleNames.CONTACTS);
|
|
46
44
|
}
|
|
47
45
|
|
|
48
46
|
get cannedMessages() {
|
|
49
|
-
return this._moduleManager.
|
|
47
|
+
return this._moduleManager.getModule(ModuleNames.CANNED_MESSAGES);
|
|
50
48
|
}
|
|
51
49
|
|
|
52
50
|
get templateMessages() {
|
|
53
|
-
return this._moduleManager.
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
get subscription() {
|
|
57
|
-
return this._moduleManager.getModuleByType(ModuleNames.SUBSCRIPTION);
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
get public() {
|
|
61
|
-
return this._moduleManager.getModulesByType(ModuleTypes.PUBLIC);
|
|
51
|
+
return this._moduleManager.getModule(ModuleNames.TEMPLATE_MESSAGES);
|
|
62
52
|
}
|
|
63
53
|
|
|
64
54
|
hasModule(moduleName) {
|
|
@@ -75,8 +65,6 @@ export default class IMSDK {
|
|
|
75
65
|
contacts: this.contacts,
|
|
76
66
|
cannedMessages: this.cannedMessages,
|
|
77
67
|
templateMessages: this.templateMessages,
|
|
78
|
-
subscription: this.subscription,
|
|
79
|
-
public: this.public,
|
|
80
68
|
hasModule: this.hasModule.bind(this)
|
|
81
69
|
};
|
|
82
70
|
}
|
|
@@ -7,6 +7,4 @@ export * from './agents';
|
|
|
7
7
|
export * from './contacts';
|
|
8
8
|
export * from './cannedMessages';
|
|
9
9
|
export * from './templateMessages';
|
|
10
|
-
export * from './customReplyExtension';
|
|
11
|
-
export * from './subscription';
|
|
12
|
-
export * from './whatsAppPricing';
|
|
10
|
+
export * from './customReplyExtension';
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResponseTypes } from '../../core/constants';
|
|
2
2
|
import { ResponseUtils } from '../../core/utils';
|
|
3
3
|
import configRegistry from '../config/configRegistry';
|
|
4
4
|
import { getRegistryConfig } from './registry';
|
|
@@ -7,19 +7,18 @@ export default class BaseAPI {
|
|
|
7
7
|
constructor() {
|
|
8
8
|
let {
|
|
9
9
|
module,
|
|
10
|
-
moduleType,
|
|
11
10
|
configProvider = configRegistry,
|
|
12
11
|
registryProvider = {
|
|
13
12
|
getRegistryConfig
|
|
14
13
|
},
|
|
15
|
-
urlBuilder
|
|
14
|
+
urlBuilder = new UrlBuilder()
|
|
16
15
|
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
17
16
|
this.configProvider = configProvider;
|
|
18
17
|
this.registryProvider = registryProvider;
|
|
19
|
-
this.httpClient =
|
|
18
|
+
this.httpClient = this.configProvider.getHttpClient();
|
|
20
19
|
this.baseURL = this.configProvider.getBaseURL();
|
|
21
20
|
this.module = module;
|
|
22
|
-
this.urlBuilder = urlBuilder
|
|
21
|
+
this.urlBuilder = urlBuilder;
|
|
23
22
|
}
|
|
24
23
|
|
|
25
24
|
async request(_ref) {
|
|
@@ -7,8 +7,6 @@ import { agentAPIRegistry } from './agents';
|
|
|
7
7
|
import { contactAPIRegistry } from './contacts';
|
|
8
8
|
import { cannedMessageAPIRegistry } from './cannedMessages';
|
|
9
9
|
import { templateMessageAPIRegistry } from './templateMessages';
|
|
10
|
-
import { subscriptionAPIRegistry } from './subscription';
|
|
11
|
-
import { whatsAppPricingAPIRegistry } from './whatsAppPricing';
|
|
12
10
|
import { ModuleNames } from '../../../core/constants';
|
|
13
11
|
const APIRegistry = {
|
|
14
12
|
[ModuleNames.CHANNELS]: channelAPIRegistry,
|
|
@@ -18,9 +16,7 @@ const APIRegistry = {
|
|
|
18
16
|
[ModuleNames.AGENTS]: agentAPIRegistry,
|
|
19
17
|
[ModuleNames.CONTACTS]: contactAPIRegistry,
|
|
20
18
|
[ModuleNames.CANNED_MESSAGES]: cannedMessageAPIRegistry,
|
|
21
|
-
[ModuleNames.TEMPLATE_MESSAGES]: templateMessageAPIRegistry
|
|
22
|
-
[ModuleNames.SUBSCRIPTION]: subscriptionAPIRegistry,
|
|
23
|
-
[ModuleNames.WHATSAPP_PRICING]: whatsAppPricingAPIRegistry
|
|
19
|
+
[ModuleNames.TEMPLATE_MESSAGES]: templateMessageAPIRegistry
|
|
24
20
|
};
|
|
25
21
|
export default function getRegistryConfig(module, operation) {
|
|
26
22
|
const moduleConfig = selectn(module, APIRegistry);
|
|
@@ -2,18 +2,15 @@ class ConfigRegistry {
|
|
|
2
2
|
constructor() {
|
|
3
3
|
this.baseURL = null;
|
|
4
4
|
this.httpClient = null;
|
|
5
|
-
this.publicHttpClient = null;
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
setConfig(_ref) {
|
|
9
8
|
let {
|
|
10
9
|
baseURL,
|
|
11
|
-
httpClient
|
|
12
|
-
publicHttpClient
|
|
10
|
+
httpClient
|
|
13
11
|
} = _ref;
|
|
14
12
|
this.baseURL = baseURL;
|
|
15
13
|
this.httpClient = httpClient;
|
|
16
|
-
this.publicHttpClient = publicHttpClient;
|
|
17
14
|
}
|
|
18
15
|
|
|
19
16
|
getBaseURL() {
|
|
@@ -24,10 +21,6 @@ class ConfigRegistry {
|
|
|
24
21
|
return this.httpClient;
|
|
25
22
|
}
|
|
26
23
|
|
|
27
|
-
getPublicHttpClient() {
|
|
28
|
-
return this.publicHttpClient;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
24
|
}
|
|
32
25
|
|
|
33
26
|
const configRegistry = new ConfigRegistry();
|
package/package.json
CHANGED
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
import { ISubscriptionRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
-
export default class SubscriptionService extends ISubscriptionRepository {
|
|
3
|
-
constructor(_ref) {
|
|
4
|
-
let {
|
|
5
|
-
subscriptionRepository
|
|
6
|
-
} = _ref;
|
|
7
|
-
super();
|
|
8
|
-
this.subscriptionRepository = subscriptionRepository;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
async getAddOnPackages(request) {
|
|
12
|
-
return this.subscriptionRepository.getAddOnPackages(request);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
async getLicenseDetails(request) {
|
|
16
|
-
return this.subscriptionRepository.getLicenseDetails(request);
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async buyAddOnPackage(request) {
|
|
20
|
-
return this.subscriptionRepository.buyAddOnPackage(request);
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async modifyAddOnPackage(request) {
|
|
24
|
-
return this.subscriptionRepository.modifyAddOnPackage(request);
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
toJSON() {
|
|
28
|
-
return {
|
|
29
|
-
getAddOnPackages: this.getAddOnPackages.bind(this),
|
|
30
|
-
getLicenseDetails: this.getLicenseDetails.bind(this),
|
|
31
|
-
buyAddOnPackage: this.buyAddOnPackage.bind(this),
|
|
32
|
-
modifyAddOnPackage: this.modifyAddOnPackage.bind(this)
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import IWhatsAppPricingRepository from '../../../domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository';
|
|
2
|
-
export default class WhatsAppPricingService extends IWhatsAppPricingRepository {
|
|
3
|
-
constructor(_ref) {
|
|
4
|
-
let {
|
|
5
|
-
whatsAppPricingRepository
|
|
6
|
-
} = _ref;
|
|
7
|
-
super();
|
|
8
|
-
this.whatsAppPricingRepository = whatsAppPricingRepository;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
async calculatePricing(request) {
|
|
12
|
-
return this.whatsAppPricingRepository.calculatePricing(request);
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
toJSON() {
|
|
16
|
-
return {
|
|
17
|
-
calculatePricing: this.calculatePricing.bind(this)
|
|
18
|
-
};
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
}
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function buyAddOnPackageRequest() {
|
|
4
|
-
let {
|
|
5
|
-
body = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withBody({
|
|
8
|
-
name: null,
|
|
9
|
-
count: null,
|
|
10
|
-
source: null,
|
|
11
|
-
autoRenewal: null,
|
|
12
|
-
renewalCount: null,
|
|
13
|
-
renewalThreshold: null,
|
|
14
|
-
...body
|
|
15
|
-
}).build();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default buyAddOnPackageRequest;
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function getAddOnPackagesRequest() {
|
|
4
|
-
let {
|
|
5
|
-
query = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withQuery({
|
|
8
|
-
integrationServiceId: null,
|
|
9
|
-
subscription: null,
|
|
10
|
-
currencyCode: null,
|
|
11
|
-
...query
|
|
12
|
-
}).build();
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
export default getAddOnPackagesRequest;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import getAddOnPackagesRequest from './getAddOnPackagesRequest';
|
|
2
|
-
import getLicenseDetailsRequest from './getLicenseDetailsRequest';
|
|
3
|
-
import buyAddOnPackageRequest from './buyAddOnPackageRequest';
|
|
4
|
-
import modifyAddOnPackageRequest from './modifyAddOnPackageRequest';
|
|
5
|
-
export { getAddOnPackagesRequest, getLicenseDetailsRequest, buyAddOnPackageRequest, modifyAddOnPackageRequest };
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function modifyAddOnPackageRequest() {
|
|
4
|
-
let {
|
|
5
|
-
body = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withBody({
|
|
8
|
-
name: null,
|
|
9
|
-
count: null,
|
|
10
|
-
source: null,
|
|
11
|
-
autoRenewal: null,
|
|
12
|
-
renewalCount: null,
|
|
13
|
-
renewalThreshold: null,
|
|
14
|
-
...body
|
|
15
|
-
}).build();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default modifyAddOnPackageRequest;
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function calculatePricingRequest() {
|
|
4
|
-
let {
|
|
5
|
-
body = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withBody({
|
|
8
|
-
currency: null,
|
|
9
|
-
data: null,
|
|
10
|
-
...body
|
|
11
|
-
}).build();
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export default calculatePricingRequest;
|