@zohoim/client-sdk 1.0.0-canned12 → 1.0.0-canned13

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.
@@ -5,7 +5,7 @@ function validateSchemaKeys(_ref) {
5
5
  entityName = ''
6
6
  } = _ref;
7
7
  Object.keys(schema).forEach(key => {
8
- if (!(key in data)) {
8
+ if (!(key in data) && schema[key].required !== false) {
9
9
  console.warn(`${entityName} - Key '${key}' is missing in the data`);
10
10
  }
11
11
  });
@@ -8,8 +8,7 @@ export default class TemplateTags {
8
8
  data,
9
9
  entityName: 'TemplateTags'
10
10
  });
11
- this.data = {
12
- tags: validatedData.tags
11
+ this.data = { ...validatedData
13
12
  };
14
13
  }
15
14
 
@@ -15,7 +15,7 @@ const TranslationsSchema = {
15
15
  },
16
16
  message: {
17
17
  type: 'string',
18
- required: true
18
+ required: false
19
19
  },
20
20
  uuid: {
21
21
  type: 'string',
@@ -20,11 +20,13 @@ export default class CannedMessageAdapter extends IAdapter {
20
20
  isActive: cannedMessageData.isActive,
21
21
  isPrivate: cannedMessageData.isPrivate,
22
22
  translations: cannedMessageData.translations,
23
+ primaryLanguage: cannedMessageData.primaryLanguage,
23
24
  uuid: cannedMessageData.uuid,
24
25
  meta: cannedMessageData.meta,
25
26
  rejectedReason: cannedMessageData.rejectedReason,
26
27
  modifiedTime: cannedMessageData.modifiedTime,
27
- parameters: cannedMessageData.parameters || null
28
+ parameters: cannedMessageData.parameters || null,
29
+ wabaId: cannedMessageData.wabaId
28
30
  }).toJSON();
29
31
  } catch (error) {
30
32
  throw new AdapterError(`Failed to adapt canned message: ${error.message}`);
@@ -8,9 +8,7 @@ export default class TemplateTagsAdapter extends IAdapter {
8
8
  }
9
9
 
10
10
  try {
11
- return new TemplateTags({
12
- tags: templateTagsData.tags
13
- }).toJSON();
11
+ return new TemplateTags(templateTagsData.data).toJSON();
14
12
  } catch (error) {
15
13
  throw new AdapterError(`Failed to adapt TemplateTags: ${error.message}`);
16
14
  }
@@ -74,7 +74,7 @@ export default class TemplateMessageRepository extends ITemplateMessageRepositor
74
74
  operation: 'getTemplateTags',
75
75
  request,
76
76
  adapter: this.templateTagsAdapter,
77
- responseType: ResponseTypes.LIST
77
+ responseType: ResponseTypes.SINGLE
78
78
  });
79
79
  }
80
80
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-canned12",
3
+ "version": "1.0.0-canned13",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",