@zohoim/client-sdk 1.0.0-poc68 → 1.0.0-poc69
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.
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
export default class ResponseUtils {
|
|
2
|
-
static adaptListResponse(response, adapter) {
|
|
2
|
+
static async adaptListResponse(response, adapter) {
|
|
3
3
|
if (!response || !adapter) {
|
|
4
4
|
return response;
|
|
5
5
|
}
|
|
@@ -9,7 +9,7 @@ export default class ResponseUtils {
|
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
return { ...response,
|
|
12
|
-
data: response.data.map(item => adapter(item))
|
|
12
|
+
data: await Promise.all(response.data.map(item => adapter(item)))
|
|
13
13
|
};
|
|
14
14
|
}
|
|
15
15
|
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
import { ValidationError } from "../errors";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
});
|
|
9
|
-
}
|
|
1
|
+
import { ValidationError } from "../errors"; // function validateSchemaKeys(schema, data) {
|
|
2
|
+
// Object.keys(schema).forEach((key) => {
|
|
3
|
+
// if (!(key in data)) {
|
|
4
|
+
// throw new ValidationError(`Key '${key}' is missing in the data`);
|
|
5
|
+
// }
|
|
6
|
+
// });
|
|
7
|
+
// }
|
|
10
8
|
|
|
11
9
|
function isEmpty(value) {
|
|
12
10
|
if (value === null || value === undefined || value === '') {
|
|
@@ -44,8 +42,8 @@ export const validateSchema = (schema, data) => {
|
|
|
44
42
|
const validate = function (schemaObj, dataObj) {
|
|
45
43
|
let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
46
44
|
// Check if all schema keys exist in data
|
|
47
|
-
validateSchemaKeys(schemaObj, dataObj);
|
|
48
|
-
|
|
45
|
+
// validateSchemaKeys(schemaObj, dataObj);
|
|
46
|
+
// Validate each field
|
|
49
47
|
Object.entries(schemaObj).forEach(_ref3 => {
|
|
50
48
|
let [field, rules] = _ref3;
|
|
51
49
|
const value = dataObj[field];
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
const uiConfig = {
|
|
2
|
+
theme: {
|
|
3
|
+
primaryColor: '#1A73E8'
|
|
4
|
+
},
|
|
5
|
+
labels: {
|
|
6
|
+
session: {},
|
|
7
|
+
conversation: {}
|
|
8
|
+
},
|
|
9
|
+
renderers: {
|
|
10
|
+
session: {},
|
|
11
|
+
conversation: {
|
|
12
|
+
renderInfoMessage: () => {},
|
|
13
|
+
getHoverActions: () => {}
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
navigation: {}
|
|
17
|
+
};
|
|
18
|
+
const serviceInfo = {
|
|
19
|
+
serviceName: 'desk',
|
|
20
|
+
bundledServiceName: 'crmPlus'
|
|
21
|
+
};
|