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

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,4 +1,5 @@
1
- import HTTP_METHODS from "./HttpMethods";
1
+ import { HttpMethods } from '@zohoim/http-client';
2
2
  import ModuleNames from "./ModuleNames";
3
3
  const IM_API_PREFIX = '/api/v1';
4
+ const HTTP_METHODS = HttpMethods;
4
5
  export { ModuleNames, IM_API_PREFIX, HTTP_METHODS };
@@ -3,6 +3,7 @@ class RequestBuilder {
3
3
  this._params = {};
4
4
  this._query = {};
5
5
  this._body = {};
6
+ this._context = {};
6
7
  }
7
8
 
8
9
  withParams() {
@@ -33,7 +34,8 @@ class RequestBuilder {
33
34
  return {
34
35
  params: this._params,
35
36
  query: this._query,
36
- body: Object.keys(this._body).length ? this._body : undefined
37
+ body: Object.keys(this._body).length ? this._body : undefined,
38
+ context: this._context
37
39
  };
38
40
  }
39
41
 
@@ -1,4 +1,5 @@
1
1
  import { validateSchema } from "../../../core/utils";
2
+ import { ActorType } from "../../enum";
2
3
  import { ActorSchema } from "../../schema";
3
4
  export default class Actor {
4
5
  constructor() {
@@ -15,6 +16,10 @@ export default class Actor {
15
16
  };
16
17
  }
17
18
 
19
+ static isBot(type) {
20
+ return type === ActorType.BOT;
21
+ }
22
+
18
23
  toJSON() {
19
24
  return { ...this.data
20
25
  };
@@ -2,7 +2,7 @@ import { ActorType } from "../../enum";
2
2
  const ActorSchema = {
3
3
  name: {
4
4
  type: 'string',
5
- required: true
5
+ required: false
6
6
  },
7
7
  type: {
8
8
  type: 'string',
@@ -19,7 +19,7 @@ const ActorSchema = {
19
19
  },
20
20
  id: {
21
21
  type: 'string',
22
- required: true
22
+ required: false
23
23
  },
24
24
  email: {
25
25
  type: 'string',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc43",
3
+ "version": "1.0.0-poc45",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",
@@ -24,6 +24,9 @@
24
24
  "test": "react-cli test",
25
25
  "docs": "react-cli docs"
26
26
  },
27
+ "dependencies": {
28
+ "@zohoim/http-client": "1.0.0-poc12"
29
+ },
27
30
  "devDependencies": {
28
31
  "@zohodesk-private/client_dev_cert": "1.0.5",
29
32
  "@zohodesk/client_build_tool": "0.0.6-exp.37",
@@ -1,8 +0,0 @@
1
- const HTTP_METHODS = {
2
- GET: 'GET',
3
- POST: 'POST',
4
- PUT: 'PUT',
5
- PATCH: 'PATCH',
6
- DELETE: 'DELETE'
7
- };
8
- export default HTTP_METHODS;