@zohoim/client-sdk 1.0.0-poc45 → 1.0.0-poc46

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.
@@ -8,6 +8,14 @@ function validateSchemaKeys(schema, data) {
8
8
  });
9
9
  }
10
10
 
11
+ function isEmpty(value) {
12
+ if (value === null || value === undefined || value === '') {
13
+ return true;
14
+ }
15
+
16
+ return false;
17
+ }
18
+
11
19
  function validateRequiredCheck(_ref) {
12
20
  let {
13
21
  value,
@@ -15,7 +23,7 @@ function validateRequiredCheck(_ref) {
15
23
  path
16
24
  } = _ref;
17
25
 
18
- if (rules.required && !value) {
26
+ if (rules.required && isEmpty(value)) {
19
27
  throw new ValidationError(rules.message || `${path} is required`);
20
28
  }
21
29
  }
@@ -29,7 +29,7 @@ const SessionSchema = {
29
29
  },
30
30
  subject: {
31
31
  type: 'string',
32
- required: true
32
+ required: false
33
33
  },
34
34
  messagesCount: {
35
35
  type: 'string',
@@ -67,7 +67,7 @@ const SessionSchema = {
67
67
  },
68
68
  contactId: {
69
69
  type: 'string',
70
- required: true
70
+ required: false
71
71
  },
72
72
  meta: {
73
73
  type: 'array',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc45",
3
+ "version": "1.0.0-poc46",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",