@zohoim/client-sdk 0.0.5-poc01 → 0.0.5-poc02

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,10 +1,10 @@
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
- // }
1
+ function validateSchemaKeys(schema, data) {
2
+ Object.keys(schema).forEach(key => {
3
+ if (!(key in data)) {
4
+ console.warn(`Key '${key}' is missing in the data`);
5
+ }
6
+ });
7
+ }
8
8
 
9
9
  function isEmpty(value) {
10
10
  if (value === null || value === undefined || value === '') {
@@ -22,7 +22,7 @@ function validateRequiredCheck(_ref) {
22
22
  } = _ref;
23
23
 
24
24
  if (rules.required && isEmpty(value)) {
25
- throw new ValidationError(rules.message || `${path} is required`);
25
+ console.warn(`${path} is required`);
26
26
  }
27
27
  }
28
28
 
@@ -34,7 +34,7 @@ function validateEnumCheck(_ref2) {
34
34
  } = _ref2;
35
35
 
36
36
  if (rules.enum && !rules.enum.includes(value)) {
37
- throw new ValidationError(`${path} must be one of: ${rules.enum.join(', ')}`);
37
+ console.warn(`${path} must be one of: ${rules.enum.join(', ')}. Received: ${value}`);
38
38
  }
39
39
  }
40
40
 
@@ -42,8 +42,8 @@ export const validateSchema = (schema, data) => {
42
42
  const validate = function (schemaObj, dataObj) {
43
43
  let path = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
44
44
  // Check if all schema keys exist in data
45
- // validateSchemaKeys(schemaObj, dataObj);
46
- // Validate each field
45
+ validateSchemaKeys(schemaObj, dataObj); // Validate each field
46
+
47
47
  Object.entries(schemaObj).forEach(_ref3 => {
48
48
  let [field, rules] = _ref3;
49
49
  const value = dataObj[field];
@@ -19,7 +19,7 @@ function getSessionsRequest() {
19
19
  assigneeFilter: null,
20
20
  workspaceId: null,
21
21
  botIds: null,
22
- excludeSyncingChannels: null,
22
+ excludeSyncingChannels: false,
23
23
  ...query
24
24
  }).build();
25
25
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "0.0.5-poc01",
3
+ "version": "0.0.5-poc02",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",