@zohoim/client-sdk 1.1.0-attachmentsList → 1.1.0-calls
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/calls/CallService.js +36 -0
- package/es/application/services/calls/index.js +1 -0
- package/es/application/services/index.js +3 -1
- package/es/application/services/whatsAppPricing/WhatsAppPricingService.js +21 -0
- package/es/application/services/whatsAppPricing/index.js +2 -0
- package/es/core/constants/ModuleNames.js +3 -1
- package/es/core/constants/ModuleTypes.js +5 -0
- package/es/core/constants/index.js +2 -1
- package/es/core/utils/validateSchema.js +12 -0
- package/es/domain/dto/calls/getCallRequest.js +14 -0
- package/es/domain/dto/calls/getCallsRequest.js +20 -0
- package/es/domain/dto/calls/index.js +4 -0
- package/es/domain/dto/calls/initiateCallRequest.js +15 -0
- package/es/domain/dto/calls/updateCallStatusRequest.js +15 -0
- package/es/domain/dto/index.js +3 -1
- package/es/domain/dto/sessions/getSessionAttachmentsRequest.js +5 -2
- package/es/domain/dto/whatsAppPricing/calculateWhatsAppPricingRequest.js +14 -0
- package/es/domain/dto/whatsAppPricing/index.js +1 -0
- package/es/domain/entities/Actor/Actor.js +4 -0
- package/es/domain/entities/Call/Call.js +47 -0
- package/es/domain/entities/Call/index.js +1 -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 +3 -1
- package/es/domain/enum/call/CallStatus.js +8 -0
- package/es/domain/enum/call/index.js +1 -0
- package/es/domain/enum/index.js +2 -1
- package/es/domain/interfaces/repositories/calls/ICallRepository.js +32 -0
- package/es/domain/interfaces/repositories/calls/index.js +1 -0
- package/es/domain/interfaces/repositories/index.js +3 -1
- package/es/domain/interfaces/repositories/whatsAppPricing/IWhatsAppPricingRepository.js +18 -0
- package/es/domain/interfaces/repositories/whatsAppPricing/index.js +2 -0
- package/es/domain/schema/call/CallSchema.js +63 -0
- package/es/domain/schema/call/index.js +1 -0
- package/es/domain/schema/index.js +3 -1
- 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 +59 -23
- package/es/frameworks/managers/ModuleManager.js +25 -2
- package/es/frameworks/sdk/IMSDK.js +23 -11
- package/es/frameworks/sdk/calls/CallSDK.js +27 -0
- package/es/frameworks/sdk/calls/index.js +1 -0
- package/es/frameworks/sdk/whatsAppPricing/WhatsAppPricingSDK.js +28 -0
- package/es/frameworks/sdk/whatsAppPricing/index.js +2 -0
- package/es/infrastructure/adapters/calls/CallAdapter.js +31 -0
- package/es/infrastructure/adapters/calls/index.js +1 -0
- package/es/infrastructure/adapters/index.js +3 -1
- 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/calls/CallAPI.js +44 -0
- package/es/infrastructure/api/calls/index.js +1 -0
- package/es/infrastructure/api/index.js +3 -1
- package/es/infrastructure/api/registry/calls/callAPIRegistry.js +29 -0
- package/es/infrastructure/api/registry/calls/constructCallEndPoint.js +10 -0
- package/es/infrastructure/api/registry/calls/index.js +1 -0
- package/es/infrastructure/api/registry/createPublicBaseUrl.js +4 -0
- package/es/infrastructure/api/registry/getRegistryConfig.js +5 -1
- 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/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/calls/CallRepository.js +73 -0
- package/es/infrastructure/repositories/calls/index.js +1 -0
- package/es/infrastructure/repositories/index.js +3 -1
- package/es/infrastructure/repositories/whatsAppPricing/WhatsAppPricingRepository.js +49 -0
- package/es/infrastructure/repositories/whatsAppPricing/index.js +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import { ICallRepository } from '../../../domain/interfaces/repositories';
|
|
2
|
+
export default class CallService extends ICallRepository {
|
|
3
|
+
constructor(_ref) {
|
|
4
|
+
let {
|
|
5
|
+
callRepository
|
|
6
|
+
} = _ref;
|
|
7
|
+
super();
|
|
8
|
+
this.callRepository = callRepository;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
async getCalls(request) {
|
|
12
|
+
return this.callRepository.getCalls(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async getCall(request) {
|
|
16
|
+
return this.callRepository.getCall(request);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
async updateCallStatus(request) {
|
|
20
|
+
return this.callRepository.updateCallStatus(request);
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
async initiateCall(request) {
|
|
24
|
+
return this.callRepository.initiateCall(request);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
toJSON() {
|
|
28
|
+
return {
|
|
29
|
+
getCalls: this.getCalls.bind(this),
|
|
30
|
+
getCall: this.getCall.bind(this),
|
|
31
|
+
updateCallStatus: this.updateCallStatus.bind(this),
|
|
32
|
+
initiateCall: this.initiateCall.bind(this)
|
|
33
|
+
};
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CallService } from './CallService';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { IWhatsAppPricingRepository } from '../../../domain/interfaces/repositories';
|
|
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 calculateWhatsAppPricing(request) {
|
|
12
|
+
return this.whatsAppPricingRepository.calculateWhatsAppPricing(request);
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
toJSON() {
|
|
16
|
+
return {
|
|
17
|
+
calculateWhatsAppPricing: this.calculateWhatsAppPricing.bind(this)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
}
|
|
@@ -7,6 +7,8 @@ const ModuleNames = {
|
|
|
7
7
|
AGENTS: 'agents',
|
|
8
8
|
CANNED_MESSAGES: 'cannedMessages',
|
|
9
9
|
TEMPLATE_MESSAGES: 'templateMessages',
|
|
10
|
-
CUSTOM_REPLY_EXTENSIONS: 'articles'
|
|
10
|
+
CUSTOM_REPLY_EXTENSIONS: 'articles',
|
|
11
|
+
WHATSAPP_PRICING: 'whatsAppPricing',
|
|
12
|
+
CALLS: 'calls'
|
|
11
13
|
};
|
|
12
14
|
export default ModuleNames;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { HttpMethods } from '@zohoim/http-client';
|
|
2
2
|
import ModuleNames from './ModuleNames';
|
|
3
|
+
import ModuleTypes from './ModuleTypes';
|
|
3
4
|
import ResponseTypes from './ResponseTypes';
|
|
4
5
|
const IM_API_PREFIX = '/api/v1';
|
|
5
6
|
const HTTP_METHODS = HttpMethods;
|
|
6
|
-
export { ModuleNames, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
|
7
|
+
export { ModuleNames, ModuleTypes, IM_API_PREFIX, HTTP_METHODS, ResponseTypes };
|
|
@@ -94,6 +94,18 @@ export const validateSchema = _ref4 => {
|
|
|
94
94
|
path: fieldPath,
|
|
95
95
|
entityName
|
|
96
96
|
});
|
|
97
|
+
} // Array item validation
|
|
98
|
+
|
|
99
|
+
|
|
100
|
+
if (rules.type === 'array' && rules.schema && Array.isArray(value)) {
|
|
101
|
+
value.forEach((item, index) => {
|
|
102
|
+
validate({
|
|
103
|
+
schema: rules.schema,
|
|
104
|
+
data: item,
|
|
105
|
+
path: `${fieldPath}[${index}]`,
|
|
106
|
+
entityName
|
|
107
|
+
});
|
|
108
|
+
});
|
|
97
109
|
}
|
|
98
110
|
}
|
|
99
111
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function getCallRequest() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
query = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withQuery({
|
|
11
|
+
include: null,
|
|
12
|
+
...query
|
|
13
|
+
}).build();
|
|
14
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function getCallsRequest() {
|
|
3
|
+
let {
|
|
4
|
+
query = {}
|
|
5
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
return new RequestBuilder().withQuery({
|
|
7
|
+
from: 0,
|
|
8
|
+
limit: 10,
|
|
9
|
+
status: null,
|
|
10
|
+
integrationServiceId: null,
|
|
11
|
+
userType: null,
|
|
12
|
+
callIds: null,
|
|
13
|
+
sessionIds: null,
|
|
14
|
+
include: null,
|
|
15
|
+
userId: null,
|
|
16
|
+
channelIds: null,
|
|
17
|
+
exclude: null,
|
|
18
|
+
...query
|
|
19
|
+
}).build();
|
|
20
|
+
}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export { default as getCallRequest } from './getCallRequest';
|
|
2
|
+
export { default as getCallsRequest } from './getCallsRequest';
|
|
3
|
+
export { default as initiateCallRequest } from './initiateCallRequest';
|
|
4
|
+
export { default as updateCallStatusRequest } from './updateCallStatusRequest';
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function initiateCall() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withBody({
|
|
11
|
+
platform: null,
|
|
12
|
+
meta: null,
|
|
13
|
+
...body
|
|
14
|
+
}).build();
|
|
15
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
export default function updateCallStatusRequest() {
|
|
3
|
+
let {
|
|
4
|
+
params = {},
|
|
5
|
+
body = {}
|
|
6
|
+
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
return new RequestBuilder().withParams({
|
|
8
|
+
callId: null,
|
|
9
|
+
...params
|
|
10
|
+
}).withBody({
|
|
11
|
+
status: null,
|
|
12
|
+
meta: null,
|
|
13
|
+
...body
|
|
14
|
+
}).build();
|
|
15
|
+
}
|
package/es/domain/dto/index.js
CHANGED
|
@@ -2,13 +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,
|
|
10
|
+
...params
|
|
11
|
+
}).withQuery({
|
|
9
12
|
from: null,
|
|
10
13
|
limit: null,
|
|
11
|
-
...
|
|
14
|
+
...query
|
|
12
15
|
}).build();
|
|
13
16
|
}
|
|
14
17
|
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import RequestBuilder from '../RequestBuilder';
|
|
2
|
+
|
|
3
|
+
function calculateWhatsAppPricingRequest() {
|
|
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 calculateWhatsAppPricingRequest;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as calculateWhatsAppPricingRequest } from './calculateWhatsAppPricingRequest';
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { CallSchema } from '../../schema';
|
|
3
|
+
import { Actor } from '../Actor';
|
|
4
|
+
export default class Call {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: CallSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'Call'
|
|
11
|
+
}); // Set required properties from schema
|
|
12
|
+
|
|
13
|
+
this.id = validatedData.id;
|
|
14
|
+
this.integrationServiceId = validatedData.integrationServiceId;
|
|
15
|
+
this.actor = new Actor(validatedData.actor).toJSON();
|
|
16
|
+
this.channelId = validatedData.channelId;
|
|
17
|
+
this.createdTime = validatedData.createdTime;
|
|
18
|
+
this.direction = validatedData.direction;
|
|
19
|
+
this.sessionId = validatedData.sessionId;
|
|
20
|
+
this.status = validatedData.status; // Set optional properties from schema
|
|
21
|
+
|
|
22
|
+
this.meta = validatedData.meta || null;
|
|
23
|
+
this.participants = validatedData.participants || null;
|
|
24
|
+
this.session = validatedData.session || false;
|
|
25
|
+
this.statuses = validatedData.statuses || null;
|
|
26
|
+
this.duration = validatedData.duration || null;
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
toJSON() {
|
|
30
|
+
return {
|
|
31
|
+
id: this.id,
|
|
32
|
+
integrationServiceId: this.integrationServiceId,
|
|
33
|
+
actor: this.actor,
|
|
34
|
+
channelId: this.channelId,
|
|
35
|
+
createdTime: this.createdTime,
|
|
36
|
+
direction: this.direction,
|
|
37
|
+
sessionId: this.sessionId,
|
|
38
|
+
status: this.status,
|
|
39
|
+
meta: this.meta,
|
|
40
|
+
participants: this.participants,
|
|
41
|
+
session: this.session,
|
|
42
|
+
statuses: this.statuses,
|
|
43
|
+
duration: this.duration
|
|
44
|
+
};
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as Call } from './Call';
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { WhatsAppPricingSchema } from '../../schema';
|
|
3
|
+
import WhatsAppPricingCategory from './WhatsAppPricingCategory';
|
|
4
|
+
export default class WhatsAppPricing {
|
|
5
|
+
constructor() {
|
|
6
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
+
const validatedData = validateSchema({
|
|
8
|
+
schema: WhatsAppPricingSchema,
|
|
9
|
+
data,
|
|
10
|
+
entityName: 'WhatsAppPricing'
|
|
11
|
+
});
|
|
12
|
+
this.data = {
|
|
13
|
+
total: validatedData.total,
|
|
14
|
+
creditsCount: validatedData.creditsCount,
|
|
15
|
+
actutalCreditsAmount: validatedData.actutalCreditsAmount,
|
|
16
|
+
category: validatedData.category.map(item => new WhatsAppPricingCategory(item).toJSON())
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
toJSON() {
|
|
21
|
+
return { ...this.data
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { validateSchema } from '../../../core/utils';
|
|
2
|
+
import { WhatsAppPricingCategorySchema } from '../../schema';
|
|
3
|
+
export default class WhatsAppPricingCategory {
|
|
4
|
+
constructor() {
|
|
5
|
+
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
+
const validatedData = validateSchema({
|
|
7
|
+
schema: WhatsAppPricingCategorySchema,
|
|
8
|
+
data,
|
|
9
|
+
entityName: 'WhatsAppPricingCategory'
|
|
10
|
+
});
|
|
11
|
+
this.data = {
|
|
12
|
+
type: validatedData.type,
|
|
13
|
+
value: validatedData.value
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
toJSON() {
|
|
18
|
+
return { ...this.data
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
}
|
|
@@ -9,4 +9,6 @@ export * from './Contact';
|
|
|
9
9
|
export * from './IntegrationService';
|
|
10
10
|
export * from './CannedMessage';
|
|
11
11
|
export * from './TemplateMessage';
|
|
12
|
-
export * from './CustomReplyExtension';
|
|
12
|
+
export * from './CustomReplyExtension';
|
|
13
|
+
export * from './WhatsAppPricing';
|
|
14
|
+
export * from './Call';
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CallStatus } from './CallStatus';
|
package/es/domain/enum/index.js
CHANGED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { ModuleNames } from '../../../../core/constants';
|
|
3
|
+
import BaseAPI from '../../../../infrastructure/api/BaseAPI';
|
|
4
|
+
import { getCallsRequest, getCallRequest, initiateCallRequest, updateCallStatusRequest } from '../../../dto';
|
|
5
|
+
export default class ICallRepository extends BaseAPI {
|
|
6
|
+
constructor() {
|
|
7
|
+
super({
|
|
8
|
+
module: ModuleNames.CALLS
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
getCalls() {
|
|
13
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getCallsRequest();
|
|
14
|
+
throw new Error('Method not implemented.');
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
getCall() {
|
|
18
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : getCallRequest();
|
|
19
|
+
throw new Error('Method not implemented.');
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
updateCallStatus() {
|
|
23
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : updateCallStatusRequest();
|
|
24
|
+
throw new Error('Method not implemented.');
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
initiateCall() {
|
|
28
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : initiateCallRequest();
|
|
29
|
+
throw new Error('Method not implemented.');
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as ICallRepository } from './ICallRepository';
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/* eslint-disable no-unused-vars */
|
|
2
|
+
import { ModuleNames, ModuleTypes } from '../../../../core/constants';
|
|
3
|
+
import BaseAPI from '../../../../infrastructure/api/BaseAPI';
|
|
4
|
+
import { calculateWhatsAppPricingRequest } from '../../../dto';
|
|
5
|
+
export default class IWhatsAppPricingRepository extends BaseAPI {
|
|
6
|
+
constructor() {
|
|
7
|
+
super({
|
|
8
|
+
module: ModuleNames.WHATSAPP_PRICING,
|
|
9
|
+
moduleType: ModuleTypes.PUBLIC
|
|
10
|
+
});
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
async calculateWhatsAppPricing() {
|
|
14
|
+
let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : calculateWhatsAppPricingRequest();
|
|
15
|
+
throw new Error('Method not implemented');
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { MessageDirection } from '../../enum/message';
|
|
2
|
+
import { CallStatus } from '../../enum/call';
|
|
3
|
+
import { ActorSchema } from '../actor';
|
|
4
|
+
import { IntegrationServices } from '../../enum';
|
|
5
|
+
const CallSchema = {
|
|
6
|
+
id: {
|
|
7
|
+
type: 'string',
|
|
8
|
+
required: true
|
|
9
|
+
},
|
|
10
|
+
actor: {
|
|
11
|
+
type: 'object',
|
|
12
|
+
required: true,
|
|
13
|
+
schema: ActorSchema
|
|
14
|
+
},
|
|
15
|
+
channelId: {
|
|
16
|
+
type: 'string',
|
|
17
|
+
required: true
|
|
18
|
+
},
|
|
19
|
+
createdTime: {
|
|
20
|
+
type: 'string',
|
|
21
|
+
required: true
|
|
22
|
+
},
|
|
23
|
+
direction: {
|
|
24
|
+
type: 'string',
|
|
25
|
+
required: true,
|
|
26
|
+
enum: Object.values(MessageDirection)
|
|
27
|
+
},
|
|
28
|
+
integrationServiceId: {
|
|
29
|
+
type: 'string',
|
|
30
|
+
required: true,
|
|
31
|
+
enum: Object.values(IntegrationServices)
|
|
32
|
+
},
|
|
33
|
+
meta: {
|
|
34
|
+
type: 'array',
|
|
35
|
+
required: false
|
|
36
|
+
},
|
|
37
|
+
participants: {
|
|
38
|
+
type: 'array',
|
|
39
|
+
required: false
|
|
40
|
+
},
|
|
41
|
+
sessionId: {
|
|
42
|
+
type: 'string',
|
|
43
|
+
required: true
|
|
44
|
+
},
|
|
45
|
+
session: {
|
|
46
|
+
type: 'object',
|
|
47
|
+
required: false
|
|
48
|
+
},
|
|
49
|
+
status: {
|
|
50
|
+
type: 'string',
|
|
51
|
+
required: true,
|
|
52
|
+
enum: Object.values(CallStatus)
|
|
53
|
+
},
|
|
54
|
+
statuses: {
|
|
55
|
+
type: 'array',
|
|
56
|
+
required: false
|
|
57
|
+
},
|
|
58
|
+
duration: {
|
|
59
|
+
type: 'string',
|
|
60
|
+
required: false
|
|
61
|
+
}
|
|
62
|
+
};
|
|
63
|
+
export default CallSchema;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as CallSchema } from './CallSchema';
|
|
@@ -8,4 +8,6 @@ export * from './integrationService';
|
|
|
8
8
|
export * from './contact';
|
|
9
9
|
export * from './cannedMessage';
|
|
10
10
|
export * from './templateMessage';
|
|
11
|
-
export * from './customReplyExtension';
|
|
11
|
+
export * from './customReplyExtension';
|
|
12
|
+
export * from './whatsAppPricing';
|
|
13
|
+
export * from './call';
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import WhatsAppPricingCategorySchema from './WhatsAppPricingCategorySchema';
|
|
2
|
+
const WhatsAppPricingSchema = {
|
|
3
|
+
total: {
|
|
4
|
+
type: 'number',
|
|
5
|
+
required: true
|
|
6
|
+
},
|
|
7
|
+
creditsCount: {
|
|
8
|
+
type: 'number',
|
|
9
|
+
required: true
|
|
10
|
+
},
|
|
11
|
+
actutalCreditsAmount: {
|
|
12
|
+
type: 'number',
|
|
13
|
+
required: true
|
|
14
|
+
},
|
|
15
|
+
category: {
|
|
16
|
+
type: 'array',
|
|
17
|
+
required: true,
|
|
18
|
+
schema: WhatsAppPricingCategorySchema
|
|
19
|
+
}
|
|
20
|
+
};
|
|
21
|
+
export default WhatsAppPricingSchema;
|