@zohoim/client-sdk 1.0.0-poc5 → 1.0.0-poc7

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,4 @@
1
- import ValidationError from '../../errors/ValidationError';
1
+ import { ValidationError } from '../../errors';
2
2
  import ActorType from '../Actor/ActorType';
3
3
  export default class Agent {
4
4
  constructor() {
@@ -0,0 +1,2 @@
1
+ import ValidationError from './ValidationError';
2
+ export { ValidationError };
@@ -1,5 +1,8 @@
1
+ import GetChannelAgentsRequest from '../../types/channels/GetChannelAgentsRequest';
1
2
  export default class IChannelAgent {
2
- static getChannelAgents() {
3
+ // eslint-disable-next-line no-unused-vars
4
+ getChannelAgents() {
5
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : GetChannelAgentsRequest;
3
6
  throw new Error('Method not implemented.');
4
7
  }
5
8
 
@@ -1,4 +1,5 @@
1
1
  import IChannelAgent from '../../interfaces/channels/IChannelAgent';
2
+ import GetChannelAgentsRequest from '../../types/channels/GetChannelAgentsRequest';
2
3
  export default class ChannelAgentService extends IChannelAgent {
3
4
  constructor(channelAPI, channelAgentAdapter) {
4
5
  super();
@@ -7,7 +8,8 @@ export default class ChannelAgentService extends IChannelAgent {
7
8
  }
8
9
 
9
10
  async getChannelAgents() {
10
- const channelAgents = await this.channelAPI.getChannelAgents();
11
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : GetChannelAgentsRequest;
12
+ const channelAgents = await this.channelAPI.getChannelAgents(request);
11
13
  return channelAgents.map(this.channelAgentAdapter.adapt);
12
14
  }
13
15
 
@@ -0,0 +1,7 @@
1
+ const GetChannelAgentsRequest = {
2
+ channelId: '',
3
+ from: 0,
4
+ limit: 20,
5
+ searchStr: ''
6
+ };
7
+ export default GetChannelAgentsRequest;
@@ -0,0 +1,2 @@
1
+ import GetChannelAgentsRequest from './GetChannelAgentsRequest';
2
+ export { GetChannelAgentsRequest };
@@ -0,0 +1 @@
1
+ export * from './channels';
package/es/index.js CHANGED
@@ -1,6 +1,4 @@
1
- import * as _entities from './domain/entities';
2
- export { _entities as entities };
3
- import * as _interfaces from './domain/interfaces';
4
- export { _interfaces as interfaces };
5
- import * as _services from './domain/services';
6
- export { _services as services };
1
+ export * from './domain/entities';
2
+ export * from './domain/interfaces';
3
+ export * from './domain/services';
4
+ export * from './sdk';
@@ -0,0 +1 @@
1
+ export * from './sdk';
@@ -0,0 +1,13 @@
1
+ import { ChannelAgentService } from '../../../domain/services';
2
+ import { GetChannelAgentsRequest } from '../../../domain/types';
3
+ export default class ChannelAgentsSDK {
4
+ constructor(agentAPI, agentAdapter) {
5
+ this.channelAgentService = new ChannelAgentService(agentAPI, agentAdapter);
6
+ }
7
+
8
+ async getAgents() {
9
+ let request = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : GetChannelAgentsRequest;
10
+ return this.channelAgentService.getChannelAgents(request);
11
+ }
12
+
13
+ }
@@ -0,0 +1,7 @@
1
+ import ChannelAgentsSDK from './ChannelAgentsSDK';
2
+ export default class ChannelSDK {
3
+ constructor(config) {
4
+ this.agents = new ChannelAgentsSDK(config.agentAPI, config.agentAdapter);
5
+ }
6
+
7
+ }
@@ -0,0 +1,2 @@
1
+ import ChannelSDK from './ChannelSDK';
2
+ export { ChannelSDK };
@@ -0,0 +1 @@
1
+ export * from './channels';
@@ -0,0 +1,7 @@
1
+ import { ChannelSDK } from '../modules';
2
+ export default class IMSDK {
3
+ constructor(config) {
4
+ this.channels = new ChannelSDK(config.channels);
5
+ }
6
+
7
+ }
@@ -0,0 +1,2 @@
1
+ import IMSDK from './IMSDK';
2
+ export { IMSDK };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zohoim/client-sdk",
3
- "version": "1.0.0-poc5",
3
+ "version": "1.0.0-poc7",
4
4
  "description": "To have the client sdk for the IM",
5
5
  "main": "es/index.js",
6
6
  "module": "es/index.js",