@zohoim/client-sdk 1.0.0-canned08 → 1.0.0-leftPanelPoc2
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 +1 -21
- package/es/application/services/channels/ChannelService.js +6 -1
- package/es/application/services/index.js +3 -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/templateMessages/TemplateMessageService.js +1 -6
- package/es/application/services/userPreferences/UserPreferenceService.js +26 -0
- package/es/application/services/userPreferences/index.js +2 -0
- package/es/core/constants/ModuleNames.js +3 -1
- package/es/domain/dto/cannedMessages/index.js +1 -5
- package/es/domain/dto/{cannedMessages/deleteTranslationRequest.js → channels/getChannelRequest.js} +3 -4
- package/es/domain/dto/channels/getChannelsRequest.js +3 -1
- package/es/domain/dto/channels/index.js +2 -1
- package/es/domain/dto/index.js +3 -1
- package/es/domain/dto/{templateMessages/getTemplateTagsRequest.js → integrationServices/getIntegrationsRequest.js} +2 -2
- 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/templateMessages/index.js +1 -2
- 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/CannedMessage/CannedMessage.js +6 -34
- package/es/domain/entities/CannedMessage/index.js +1 -2
- 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/TemplateMessage/index.js +1 -4
- 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 -1
- package/es/domain/enum/cannedMessage/CannedMessageStatus.js +1 -11
- package/es/domain/enum/cannedMessage/CannedMessageType.js +1 -3
- package/es/domain/enum/cannedMessage/TemplateItemButtonType.js +1 -7
- package/es/domain/enum/cannedMessage/TemplateItemHeaderType.js +1 -3
- package/es/domain/enum/index.js +2 -1
- 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/cannedMessages/ICannedMessageRepository.js +1 -21
- package/es/domain/interfaces/repositories/channels/IChannelRepository.js +7 -1
- package/es/domain/interfaces/repositories/index.js +3 -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/templateMessages/ITemplateMessageRepository.js +1 -7
- package/es/domain/interfaces/repositories/userPreferences/IUserPreferenceRepository.js +23 -0
- package/es/domain/interfaces/repositories/userPreferences/index.js +2 -0
- package/es/domain/schema/cannedMessage/CannedMessageSchema.js +0 -12
- package/es/domain/schema/cannedMessage/TemplateItem/TemplateItemButtonsSchema.js +1 -1
- package/es/domain/schema/cannedMessage/TranslationsSchema.js +1 -1
- package/es/domain/schema/cannedMessage/index.js +1 -3
- package/es/domain/schema/channel/ChannelSchema.js +39 -5
- package/es/domain/schema/index.js +1 -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/userPreference/UserPreferenceSchema.js +9 -0
- package/es/domain/schema/userPreference/index.js +2 -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/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/cannedMessages/CannedMessageAdapter.js +2 -3
- package/es/infrastructure/adapters/cannedMessages/index.js +1 -2
- package/es/infrastructure/adapters/channels/ChannelAdapter.js +16 -2
- package/es/infrastructure/adapters/index.js +2 -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/userPreferences/UserPreferenceAdapter.js +19 -0
- package/es/infrastructure/adapters/userPreferences/index.js +2 -0
- package/es/infrastructure/api/cannedMessages/CannedMessageAPI.js +1 -41
- package/es/infrastructure/api/index.js +3 -1
- package/es/infrastructure/api/integrationServices/IntegrationServiceAPI.js +14 -0
- package/es/infrastructure/api/integrationServices/index.js +2 -0
- package/es/infrastructure/api/registry/cannedMessages/cannedMessageAPIRegistry.js +2 -22
- package/es/infrastructure/api/registry/getRegistryConfig.js +5 -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/templateMessages/templateMessageAPIRegistry.js +2 -7
- 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/templateMessages/TemplateMessageAPI.js +1 -11
- package/es/infrastructure/api/userPreferences/UserPreferenceAPI.js +24 -0
- package/es/infrastructure/api/userPreferences/index.js +2 -0
- package/es/infrastructure/repositories/cannedMessages/CannedMessageRepository.js +7 -50
- package/es/infrastructure/repositories/channels/ChannelRepository.js +10 -1
- package/es/infrastructure/repositories/index.js +3 -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/templateMessages/TemplateMessageRepository.js +1 -10
- package/es/infrastructure/repositories/userPreferences/UserPreferenceRepository.js +58 -0
- package/es/infrastructure/repositories/userPreferences/index.js +2 -0
- package/package.json +1 -1
- package/es/domain/dto/cannedMessages/addTranslationRequest.js +0 -18
- package/es/domain/dto/cannedMessages/getCannedPlaceholdersRequest.js +0 -10
- package/es/domain/dto/cannedMessages/updateTranslationRequest.js +0 -18
- package/es/domain/entities/CannedMessage/Translation.js +0 -48
- package/es/domain/entities/Placeholder/Placeholder.js +0 -24
- package/es/domain/entities/Placeholder/index.js +0 -2
- package/es/domain/entities/TemplateMessage/TemplateItemButton.js +0 -48
- package/es/domain/entities/TemplateMessage/TemplateItemFooter.js +0 -27
- package/es/domain/entities/TemplateMessage/TemplateItemHeader.js +0 -48
- package/es/domain/schema/placeholder/PlaceholderSchema.js +0 -19
- package/es/domain/schema/placeholder/index.js +0 -2
- package/es/infrastructure/adapters/cannedMessages/TranslationAdapter.js +0 -27
- package/es/infrastructure/adapters/placeholders/PlaceholderAdapter.js +0 -22
- package/es/infrastructure/adapters/placeholders/index.js +0 -2
|
@@ -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
|
+
}
|
package/package.json
CHANGED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function addTranslationRequest() {
|
|
4
|
-
let {
|
|
5
|
-
params = {},
|
|
6
|
-
body = {}
|
|
7
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
-
return new RequestBuilder().withParams({
|
|
9
|
-
cannedMessageId: null,
|
|
10
|
-
translationId: null,
|
|
11
|
-
...params
|
|
12
|
-
}).withBody({
|
|
13
|
-
message: null,
|
|
14
|
-
...body
|
|
15
|
-
}).build();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default addTranslationRequest;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function getCannedPlaceholdersRequest() {
|
|
4
|
-
let {
|
|
5
|
-
params = {}
|
|
6
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
return new RequestBuilder().withParams(params).build();
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
export default getCannedPlaceholdersRequest;
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import RequestBuilder from '../RequestBuilder';
|
|
2
|
-
|
|
3
|
-
function updateTranslationRequest() {
|
|
4
|
-
let {
|
|
5
|
-
params = {},
|
|
6
|
-
body = {}
|
|
7
|
-
} = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
8
|
-
return new RequestBuilder().withParams({
|
|
9
|
-
cannedMessageId: null,
|
|
10
|
-
translationId: null,
|
|
11
|
-
...params
|
|
12
|
-
}).withBody({
|
|
13
|
-
message: null,
|
|
14
|
-
...body
|
|
15
|
-
}).build();
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
export default updateTranslationRequest;
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import TranslationsSchema from '../../schema/cannedMessage/TranslationsSchema';
|
|
3
|
-
import { TemplateItemButton, TemplateItemHeader, TemplateItemFooter } from '../TemplateMessage';
|
|
4
|
-
export default class Translation {
|
|
5
|
-
constructor() {
|
|
6
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
const validatedData = validateSchema({
|
|
8
|
-
schema: TranslationsSchema,
|
|
9
|
-
data,
|
|
10
|
-
entityName: `Translation${data?.id ? `_${data.id}` : ''}`
|
|
11
|
-
});
|
|
12
|
-
const {
|
|
13
|
-
templateItems
|
|
14
|
-
} = validatedData;
|
|
15
|
-
let adaptedTemplateItems = null;
|
|
16
|
-
|
|
17
|
-
if (templateItems) {
|
|
18
|
-
const {
|
|
19
|
-
header,
|
|
20
|
-
footer,
|
|
21
|
-
buttons
|
|
22
|
-
} = templateItems;
|
|
23
|
-
adaptedTemplateItems = {
|
|
24
|
-
header: header ? new TemplateItemHeader(header).toJSON() : null,
|
|
25
|
-
footer: footer ? new TemplateItemFooter(footer).toJSON() : null,
|
|
26
|
-
buttons: Array.isArray(buttons) ? buttons.map(btn => new TemplateItemButton(btn).toJSON()) : null
|
|
27
|
-
};
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
this.data = {
|
|
31
|
-
id: validatedData.id,
|
|
32
|
-
language: validatedData.language,
|
|
33
|
-
message: validatedData.message,
|
|
34
|
-
displayMessage: validatedData.displayMessage,
|
|
35
|
-
uuid: validatedData.uuid,
|
|
36
|
-
status: validatedData.status,
|
|
37
|
-
modifiedTime: validatedData.modifiedTime,
|
|
38
|
-
failedReason: validatedData.failedReason,
|
|
39
|
-
templateItems: adaptedTemplateItems
|
|
40
|
-
};
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
toJSON() {
|
|
44
|
-
return { ...this.data
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { PlaceholderSchema } from '../../schema/placeholder';
|
|
3
|
-
export default class Placeholder {
|
|
4
|
-
constructor() {
|
|
5
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
6
|
-
const validatedData = validateSchema({
|
|
7
|
-
schema: PlaceholderSchema,
|
|
8
|
-
data,
|
|
9
|
-
entityName: 'Placeholder'
|
|
10
|
-
});
|
|
11
|
-
this.data = {
|
|
12
|
-
apiName: validatedData.apiName,
|
|
13
|
-
i18nFieldLabel: validatedData.i18nFieldLabel,
|
|
14
|
-
fieldLabel: validatedData.fieldLabel,
|
|
15
|
-
placeHolder: validatedData.placeHolder
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
toJSON() {
|
|
20
|
-
return { ...this.data
|
|
21
|
-
};
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { TemplateItemButtonType } from '../../enum';
|
|
3
|
-
import { TemplateItemButtonsSchema } from '../../schema';
|
|
4
|
-
export default class TemplateItemButton {
|
|
5
|
-
constructor() {
|
|
6
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
const validatedData = validateSchema({
|
|
8
|
-
schema: TemplateItemButtonsSchema,
|
|
9
|
-
data,
|
|
10
|
-
entityName: 'TemplateItemButton'
|
|
11
|
-
});
|
|
12
|
-
this.data = {
|
|
13
|
-
type: validatedData.type,
|
|
14
|
-
message: validatedData.message,
|
|
15
|
-
action: validatedData.action
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static isPhoneNumber(type) {
|
|
20
|
-
return type === TemplateItemButtonType.PHONE_NUMBER;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static isURL(type) {
|
|
24
|
-
return type === TemplateItemButtonType.URL;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static isCallToAction(type) {
|
|
28
|
-
return TemplateItemButton.isPhoneNumber(type) || TemplateItemButton.isURL(type);
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static isQuickReply(type) {
|
|
32
|
-
return type === TemplateItemButtonType.QUICK_REPLY;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static isOTP(type) {
|
|
36
|
-
return type === TemplateItemButtonType.OTP;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static isCatalog(type) {
|
|
40
|
-
return type === TemplateItemButtonType.CATALOG;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
toJSON() {
|
|
44
|
-
return { ...this.data
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { TemplateItemFooterType } from '../../enum';
|
|
3
|
-
import { TemplateItemFooterSchema } from '../../schema';
|
|
4
|
-
export default class TemplateItemFooter {
|
|
5
|
-
constructor() {
|
|
6
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
const validatedData = validateSchema({
|
|
8
|
-
schema: TemplateItemFooterSchema,
|
|
9
|
-
data,
|
|
10
|
-
entityName: 'TemplateItemFooter'
|
|
11
|
-
});
|
|
12
|
-
this.data = {
|
|
13
|
-
type: validatedData.type,
|
|
14
|
-
message: validatedData.message
|
|
15
|
-
};
|
|
16
|
-
}
|
|
17
|
-
|
|
18
|
-
static isText(type) {
|
|
19
|
-
return type === TemplateItemFooterType.TEXT;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
toJSON() {
|
|
23
|
-
return { ...this.data
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
import { validateSchema } from '../../../core/utils';
|
|
2
|
-
import { TemplateItemHeaderType } from '../../enum';
|
|
3
|
-
import { TemplateItemHeaderSchema } from '../../schema';
|
|
4
|
-
export default class TemplateItemHeader {
|
|
5
|
-
constructor() {
|
|
6
|
-
let data = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
|
|
7
|
-
const validatedData = validateSchema({
|
|
8
|
-
schema: TemplateItemHeaderSchema,
|
|
9
|
-
data,
|
|
10
|
-
entityName: 'TemplateItemHeader'
|
|
11
|
-
});
|
|
12
|
-
this.data = {
|
|
13
|
-
type: validatedData.type,
|
|
14
|
-
message: validatedData.message,
|
|
15
|
-
attachment: validatedData.attachment
|
|
16
|
-
};
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
static isNone(type) {
|
|
20
|
-
return type === TemplateItemHeaderType.NONE;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
static isText(type) {
|
|
24
|
-
return type === TemplateItemHeaderType.TEXT;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
static isImage(type) {
|
|
28
|
-
return type === TemplateItemHeaderType.IMAGE;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
static isVideo(type) {
|
|
32
|
-
return type === TemplateItemHeaderType.VIDEO;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
static isDocument(type) {
|
|
36
|
-
return type === TemplateItemHeaderType.DOCUMENT;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
static isMedia(type) {
|
|
40
|
-
return TemplateItemHeader.isImage(type) || TemplateItemHeader.isVideo(type) || TemplateItemHeader.isDocument(type);
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
toJSON() {
|
|
44
|
-
return { ...this.data
|
|
45
|
-
};
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
const PlaceholderSchema = {
|
|
2
|
-
apiName: {
|
|
3
|
-
type: 'string',
|
|
4
|
-
required: false
|
|
5
|
-
},
|
|
6
|
-
i18nFieldLabel: {
|
|
7
|
-
type: 'string',
|
|
8
|
-
required: true
|
|
9
|
-
},
|
|
10
|
-
fieldLabel: {
|
|
11
|
-
type: 'string',
|
|
12
|
-
required: true
|
|
13
|
-
},
|
|
14
|
-
placeHolder: {
|
|
15
|
-
type: 'string',
|
|
16
|
-
required: true
|
|
17
|
-
}
|
|
18
|
-
};
|
|
19
|
-
export default PlaceholderSchema;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import { AdapterError } from '../../../core/errors';
|
|
2
|
-
import { Translation } from '../../../domain/entities';
|
|
3
|
-
import { IAdapter } from '../../../domain/interfaces';
|
|
4
|
-
export default class TranslationAdapter extends IAdapter {
|
|
5
|
-
adapt(translationData) {
|
|
6
|
-
if (!translationData) {
|
|
7
|
-
throw new AdapterError('Translation data is required');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
return new Translation({
|
|
12
|
-
id: translationData.id,
|
|
13
|
-
language: translationData.language,
|
|
14
|
-
message: translationData.message,
|
|
15
|
-
displayMessage: translationData.displayMessage,
|
|
16
|
-
uuid: translationData.uuid,
|
|
17
|
-
status: translationData.status,
|
|
18
|
-
modifiedTime: translationData.modifiedTime,
|
|
19
|
-
failedReason: translationData.failedReason,
|
|
20
|
-
templateItems: translationData.templateItems
|
|
21
|
-
}).toJSON();
|
|
22
|
-
} catch (error) {
|
|
23
|
-
throw new AdapterError(`Failed to adapt translation: ${error.message}`);
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { AdapterError } from '../../../core/errors';
|
|
2
|
-
import { Placeholder } from '../../../domain/entities/Placeholder';
|
|
3
|
-
import { IAdapter } from '../../../domain/interfaces';
|
|
4
|
-
export default class PlaceholderAdapter extends IAdapter {
|
|
5
|
-
adapt(placeholderData) {
|
|
6
|
-
if (!placeholderData) {
|
|
7
|
-
throw new AdapterError('Placeholder data is required');
|
|
8
|
-
}
|
|
9
|
-
|
|
10
|
-
try {
|
|
11
|
-
return new Placeholder({
|
|
12
|
-
apiName: placeholderData.apiName,
|
|
13
|
-
i18nFieldLabel: placeholderData.i18nFieldLabel,
|
|
14
|
-
fieldLabel: placeholderData.fieldLabel,
|
|
15
|
-
placeHolder: placeholderData.placeHolder
|
|
16
|
-
}).toJSON();
|
|
17
|
-
} catch (error) {
|
|
18
|
-
throw new AdapterError(`Failed to adapt placeholder: ${error.message}`);
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
}
|