@or-sdk/hitl 0.28.1 → 0.28.3-beta.590.0

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.
Files changed (109) hide show
  1. package/CHANGELOG.md +8 -0
  2. package/dist/cjs/api/Agents.js +0 -14
  3. package/dist/cjs/api/Agents.js.map +1 -1
  4. package/dist/cjs/api/CannedMessages.js +0 -14
  5. package/dist/cjs/api/CannedMessages.js.map +1 -1
  6. package/dist/cjs/api/Commands.js +0 -14
  7. package/dist/cjs/api/Commands.js.map +1 -1
  8. package/dist/cjs/api/Conferences.js +0 -14
  9. package/dist/cjs/api/Conferences.js.map +1 -1
  10. package/dist/cjs/api/EventTemplates.js +0 -14
  11. package/dist/cjs/api/EventTemplates.js.map +1 -1
  12. package/dist/cjs/api/Filters.js +0 -14
  13. package/dist/cjs/api/Filters.js.map +1 -1
  14. package/dist/cjs/api/HITLBase.js +2 -1
  15. package/dist/cjs/api/HITLBase.js.map +1 -1
  16. package/dist/cjs/api/Listeners.js +0 -14
  17. package/dist/cjs/api/Listeners.js.map +1 -1
  18. package/dist/cjs/api/Migrations.js +0 -14
  19. package/dist/cjs/api/Migrations.js.map +1 -1
  20. package/dist/cjs/api/RuleGroups.js +0 -14
  21. package/dist/cjs/api/RuleGroups.js.map +1 -1
  22. package/dist/cjs/api/SessionEvents.js +11 -14
  23. package/dist/cjs/api/SessionEvents.js.map +1 -1
  24. package/dist/cjs/api/Sessions.js +162 -15
  25. package/dist/cjs/api/Sessions.js.map +1 -1
  26. package/dist/cjs/api/Settings.js +0 -14
  27. package/dist/cjs/api/Settings.js.map +1 -1
  28. package/dist/cjs/types/common.js +6 -1
  29. package/dist/cjs/types/common.js.map +1 -1
  30. package/dist/esm/api/Agents.js +0 -3
  31. package/dist/esm/api/Agents.js.map +1 -1
  32. package/dist/esm/api/CannedMessages.js +0 -3
  33. package/dist/esm/api/CannedMessages.js.map +1 -1
  34. package/dist/esm/api/Commands.js +0 -3
  35. package/dist/esm/api/Commands.js.map +1 -1
  36. package/dist/esm/api/Conferences.js +0 -3
  37. package/dist/esm/api/Conferences.js.map +1 -1
  38. package/dist/esm/api/EventTemplates.js +0 -3
  39. package/dist/esm/api/EventTemplates.js.map +1 -1
  40. package/dist/esm/api/Filters.js +0 -3
  41. package/dist/esm/api/Filters.js.map +1 -1
  42. package/dist/esm/api/HITLBase.js +2 -1
  43. package/dist/esm/api/HITLBase.js.map +1 -1
  44. package/dist/esm/api/Listeners.js +0 -3
  45. package/dist/esm/api/Listeners.js.map +1 -1
  46. package/dist/esm/api/Migrations.js +0 -3
  47. package/dist/esm/api/Migrations.js.map +1 -1
  48. package/dist/esm/api/RuleGroups.js +0 -3
  49. package/dist/esm/api/RuleGroups.js.map +1 -1
  50. package/dist/esm/api/SessionEvents.js +11 -3
  51. package/dist/esm/api/SessionEvents.js.map +1 -1
  52. package/dist/esm/api/Sessions.js +132 -4
  53. package/dist/esm/api/Sessions.js.map +1 -1
  54. package/dist/esm/api/Settings.js +0 -3
  55. package/dist/esm/api/Settings.js.map +1 -1
  56. package/dist/esm/types/common.js +2 -2
  57. package/dist/esm/types/common.js.map +1 -1
  58. package/dist/types/api/Agents.d.ts +0 -2
  59. package/dist/types/api/Agents.d.ts.map +1 -1
  60. package/dist/types/api/CannedMessages.d.ts +0 -2
  61. package/dist/types/api/CannedMessages.d.ts.map +1 -1
  62. package/dist/types/api/Commands.d.ts +0 -2
  63. package/dist/types/api/Commands.d.ts.map +1 -1
  64. package/dist/types/api/Conferences.d.ts +0 -2
  65. package/dist/types/api/Conferences.d.ts.map +1 -1
  66. package/dist/types/api/EventTemplates.d.ts +0 -2
  67. package/dist/types/api/EventTemplates.d.ts.map +1 -1
  68. package/dist/types/api/Filters.d.ts +0 -2
  69. package/dist/types/api/Filters.d.ts.map +1 -1
  70. package/dist/types/api/HITLBase.d.ts +1 -0
  71. package/dist/types/api/HITLBase.d.ts.map +1 -1
  72. package/dist/types/api/Listeners.d.ts +0 -2
  73. package/dist/types/api/Listeners.d.ts.map +1 -1
  74. package/dist/types/api/Migrations.d.ts +0 -2
  75. package/dist/types/api/Migrations.d.ts.map +1 -1
  76. package/dist/types/api/RuleGroups.d.ts +0 -2
  77. package/dist/types/api/RuleGroups.d.ts.map +1 -1
  78. package/dist/types/api/SessionEvents.d.ts +2 -3
  79. package/dist/types/api/SessionEvents.d.ts.map +1 -1
  80. package/dist/types/api/Sessions.d.ts +19 -5
  81. package/dist/types/api/Sessions.d.ts.map +1 -1
  82. package/dist/types/api/Settings.d.ts +0 -2
  83. package/dist/types/api/Settings.d.ts.map +1 -1
  84. package/dist/types/types/common.d.ts +3 -3
  85. package/dist/types/types/common.d.ts.map +1 -1
  86. package/dist/types/types/read-events.d.ts +2 -2
  87. package/dist/types/types/read-events.d.ts.map +1 -1
  88. package/dist/types/types/session-events.d.ts +2 -0
  89. package/dist/types/types/session-events.d.ts.map +1 -1
  90. package/dist/types/types/sessions.d.ts +19 -3
  91. package/dist/types/types/sessions.d.ts.map +1 -1
  92. package/package.json +4 -5
  93. package/src/api/Agents.ts +0 -8
  94. package/src/api/CannedMessages.ts +0 -8
  95. package/src/api/Commands.ts +0 -8
  96. package/src/api/Conferences.ts +0 -8
  97. package/src/api/EventTemplates.ts +0 -8
  98. package/src/api/Filters.ts +0 -8
  99. package/src/api/HITLBase.ts +7 -1
  100. package/src/api/Listeners.ts +0 -8
  101. package/src/api/Migrations.ts +0 -8
  102. package/src/api/RuleGroups.ts +0 -8
  103. package/src/api/SessionEvents.ts +17 -8
  104. package/src/api/Sessions.ts +172 -9
  105. package/src/api/Settings.ts +0 -8
  106. package/src/types/common.ts +17 -3
  107. package/src/types/read-events.ts +3 -3
  108. package/src/types/session-events.ts +5 -0
  109. package/src/types/sessions.ts +45 -3
package/src/api/Agents.ts CHANGED
@@ -1,7 +1,6 @@
1
1
  import _ from 'lodash';
2
2
  import URI from 'urijs';
3
3
 
4
- import { ApiVersionOptions } from '../types';
5
4
  import { GetAgentStatusResponse, AgentStatusOptions } from '../types/agents';
6
5
  import { HITLBase } from './HITLBase';
7
6
 
@@ -36,11 +35,4 @@ export class Agents extends HITLBase {
36
35
  params,
37
36
  });
38
37
  }
39
-
40
- protected static getBaseUrl(options: ApiVersionOptions): string {
41
- return HITLBase.getBaseUrl({
42
- ...options,
43
- module: this.MODULE_URL,
44
- });
45
- }
46
38
  }
@@ -1,7 +1,6 @@
1
1
  import _ from 'lodash';
2
2
 
3
3
  import { HITLBase } from './HITLBase';
4
- import { ApiVersionOptions } from '../types';
5
4
  import {
6
5
  CannedMessage,
7
6
  GetCannedMessagesOptions,
@@ -67,11 +66,4 @@ export class CannedMessages extends HITLBase {
67
66
  params,
68
67
  });
69
68
  }
70
-
71
- protected static getBaseUrl(options: ApiVersionOptions): string {
72
- return HITLBase.getBaseUrl({
73
- ...options,
74
- module: this.MODULE_URL,
75
- });
76
- }
77
69
  }
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { ApiVersionOptions } from '../types';
4
3
  import { ApplyCommandOptions } from '../types/commands';
5
4
  import { HITLBase } from './HITLBase';
6
5
 
@@ -21,11 +20,4 @@ export class Commands extends HITLBase {
21
20
  data,
22
21
  });
23
22
  }
24
-
25
- protected static getBaseUrl(options: ApiVersionOptions): string {
26
- return HITLBase.getBaseUrl({
27
- ...options,
28
- module: this.MODULE_URL,
29
- });
30
- }
31
23
  }
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { ApiVersionOptions } from '../types';
4
3
  import {
5
4
  GetConferenceMembersOptions,
6
5
  GetConferenceMembersResponse,
@@ -58,11 +57,4 @@ export class Conferences extends HITLBase {
58
57
  params,
59
58
  });
60
59
  }
61
-
62
- protected static getBaseUrl(options: ApiVersionOptions): string {
63
- return HITLBase.getBaseUrl({
64
- ...options,
65
- module: this.MODULE_URL,
66
- });
67
- }
68
60
  }
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { ApiVersionOptions } from '../types';
4
3
  import {
5
4
  GetEventTemplatesOptions,
6
5
  GetEventTemplatesResponse,
@@ -65,11 +64,4 @@ export class EventTemplates extends HITLBase {
65
64
  params,
66
65
  });
67
66
  }
68
-
69
- protected static getBaseUrl(options: ApiVersionOptions): string {
70
- return HITLBase.getBaseUrl({
71
- ...options,
72
- module: this.MODULE_URL,
73
- });
74
- }
75
67
  }
@@ -1,7 +1,6 @@
1
1
  import _ from 'lodash';
2
2
 
3
3
  import { HITLBase } from './HITLBase';
4
- import { ApiVersionOptions } from '../types';
5
4
  import {
6
5
  Filter,
7
6
  GetFiltersOptions,
@@ -69,11 +68,4 @@ export class Filters extends HITLBase {
69
68
  params,
70
69
  });
71
70
  }
72
-
73
- protected static getBaseUrl(options: ApiVersionOptions): string {
74
- return HITLBase.getBaseUrl({
75
- ...options,
76
- module: this.MODULE_URL,
77
- });
78
- }
79
71
  }
@@ -3,6 +3,8 @@ import { Request, BaseUrlOptions } from '../types';
3
3
  export class HITLBase {
4
4
  protected static readonly BASE_URL = '/api/v{version}/{module}';
5
5
  protected static readonly LATEST_VERSION = 1;
6
+ /** This variable should be overridden in child classes */
7
+ protected static readonly MODULE_URL: string = '';
6
8
 
7
9
  protected static request: Request;
8
10
 
@@ -24,7 +26,11 @@ export class HITLBase {
24
26
  }
25
27
 
26
28
  protected static getBaseUrl(options: BaseUrlOptions): string {
27
- const { version = this.LATEST_VERSION, module } = options;
29
+ const {
30
+ version = this.LATEST_VERSION,
31
+ module = this.MODULE_URL,
32
+ } = options;
33
+
28
34
  const content = {
29
35
  version: version.toString(),
30
36
  module,
@@ -2,7 +2,6 @@ import _ from 'lodash';
2
2
  import URI from 'urijs';
3
3
 
4
4
  import { HITLBase } from './HITLBase';
5
- import { ApiVersionOptions } from '../types';
6
5
  import {
7
6
  Listener,
8
7
  GetListenersOptions,
@@ -66,11 +65,4 @@ export class Listeners extends HITLBase {
66
65
  route,
67
66
  });
68
67
  }
69
-
70
- protected static getBaseUrl(options: ApiVersionOptions): string {
71
- return HITLBase.getBaseUrl({
72
- ...options,
73
- module: this.MODULE_URL,
74
- });
75
- }
76
68
  }
@@ -1,5 +1,4 @@
1
1
  import _ from 'lodash';
2
- import { ApiVersionOptions } from '../types';
3
2
  import {
4
3
  GetMigrationsOptions,
5
4
  GetMigrationsResponse,
@@ -35,11 +34,4 @@ export class Migrations extends HITLBase {
35
34
  params,
36
35
  });
37
36
  }
38
-
39
- protected static getBaseUrl(options: ApiVersionOptions): string {
40
- return HITLBase.getBaseUrl({
41
- ...options,
42
- module: this.MODULE_URL,
43
- });
44
- }
45
37
  }
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { ApiVersionOptions } from '../types';
4
3
  import {
5
4
  SearchRuleGroupsOptions,
6
5
  SearchRuleGroupsResponse,
@@ -66,11 +65,4 @@ export class RuleGroups extends HITLBase {
66
65
  params,
67
66
  });
68
67
  }
69
-
70
- protected static getBaseUrl(options: ApiVersionOptions): string {
71
- return HITLBase.getBaseUrl({
72
- ...options,
73
- module: this.MODULE_URL,
74
- });
75
- }
76
68
  }
@@ -2,10 +2,11 @@ import _ from 'lodash';
2
2
  import URI from 'urijs';
3
3
 
4
4
  import { HITLBase } from './HITLBase';
5
- import { ApiVersionOptions } from '../types';
6
5
  import {
7
6
  GetSessionEventsOptions,
8
7
  GetSessionEventsResponse,
8
+ AddEventsOptions,
9
+ AddEventsResponse,
9
10
  } from '../types/session-events';
10
11
  import {
11
12
  GetNewEventsCountOptions,
@@ -31,6 +32,21 @@ export class SessionEvents extends HITLBase {
31
32
  });
32
33
  }
33
34
 
35
+ public static addEvents(
36
+ options: AddEventsOptions
37
+ ): Promise<AddEventsResponse> {
38
+ const route = this.getBaseUrl(options);
39
+ const params = _.pick(options, ['sessionId']);
40
+ const data = _.pick(options, ['events']);
41
+
42
+ return this.request({
43
+ method: 'POST',
44
+ route,
45
+ params,
46
+ data,
47
+ });
48
+ }
49
+
34
50
  public static async getNewEventsCount(
35
51
  options: GetNewEventsCountOptions
36
52
  ): Promise<GetNewEventsCountResponse> {
@@ -62,11 +78,4 @@ export class SessionEvents extends HITLBase {
62
78
  data,
63
79
  });
64
80
  }
65
-
66
- protected static getBaseUrl(options: ApiVersionOptions): string {
67
- return HITLBase.getBaseUrl({
68
- ...options,
69
- module: this.MODULE_URL,
70
- });
71
- }
72
81
  }
@@ -1,28 +1,191 @@
1
+ import _ from 'lodash';
1
2
  import URI from 'urijs';
2
3
 
3
- import { ApiVersionOptions } from '../types';
4
- import { GetInitTriggersResponse, InitTriggersOptions } from '../types/sessions';
4
+ import {
5
+ ClaimSessionByAgentOptions,
6
+ CloseSessionOptions,
7
+ GetInitTriggersOptions,
8
+ GetInitTriggersResponse,
9
+ GetQueueSessionOptions,
10
+ GetQueueSessionResponse,
11
+ GetSessionsOptions,
12
+ GetSessionsResponse,
13
+ SearchSessionsOptions,
14
+ SearchSessionsResponse,
15
+ Session,
16
+ StartConversationOptions,
17
+ TransferToBotOptions,
18
+ UpdateSessionOptions,
19
+ SearchSessionsWithContactsOptions,
20
+ SearchSessionsWithContactsResponse,
21
+ } from '../types/sessions';
5
22
  import { HITLBase } from './HITLBase';
6
23
 
7
24
  export class Sessions extends HITLBase {
8
25
  protected static MODULE_URL = 'sessions';
9
- protected static INIT_TRIGGERS_URL = 'triggers';
26
+
27
+ protected static SEARCH_URL = 'search';
28
+ protected static SEARCH_WITH_CONTACTS_URL = 'search-with-contacts';
29
+ protected static GET_TRIGGERS_URL = 'triggers';
30
+ protected static GET_QUEUE_SESSION_URL = 'queue';
31
+
32
+ protected static CLAIM_URL = 'claim';
33
+ protected static TRANSFER_TO_BOT_URL = 'transfer-to-bot';
34
+ protected static START_CONVERSATION_URL = 'start-conversation';
35
+ protected static CLOSE_URL = 'close';
36
+
37
+ public static async getSessions(
38
+ options: GetSessionsOptions = {}
39
+ ): Promise<GetSessionsResponse> {
40
+ const route = this.getBaseUrl(options);
41
+ const params = _.omit(options, ['version']);
42
+
43
+ return this.request({
44
+ method: 'GET',
45
+ route,
46
+ params,
47
+ });
48
+ }
49
+
50
+ public static async searchSessions(
51
+ options: SearchSessionsOptions = {}
52
+ ): Promise<SearchSessionsResponse> {
53
+ const baseUrl = this.getBaseUrl(options);
54
+ const route = new URI(baseUrl).segment(this.SEARCH_URL).href();
55
+ const params = _.omit(options, ['version']);
56
+
57
+ return this.request({
58
+ method: 'POST',
59
+ route,
60
+ params,
61
+ });
62
+ }
63
+
64
+ public static async searchSessionsWithContacts(
65
+ options: SearchSessionsWithContactsOptions = {}
66
+ ): Promise<SearchSessionsWithContactsResponse> {
67
+ const baseUrl = this.getBaseUrl(options);
68
+ const route = new URI(baseUrl)
69
+ .segment(this.SEARCH_WITH_CONTACTS_URL)
70
+ .href();
71
+
72
+ const params = _.omit(options, ['version']);
73
+ return this.request({
74
+ method: 'POST',
75
+ route,
76
+ params,
77
+ });
78
+ }
79
+
80
+ public static async getQueueSession(
81
+ options: GetQueueSessionOptions
82
+ ): Promise<GetQueueSessionResponse> {
83
+ const baseUrl = this.getBaseUrl(options);
84
+ const route = new URI(baseUrl).segment(this.GET_QUEUE_SESSION_URL).href();
85
+ const params = _.pick(options, ['agentId', 'ruleTags']);
86
+
87
+ return this.request({
88
+ method: 'GET',
89
+ route,
90
+ params,
91
+ });
92
+ }
10
93
 
11
94
  public static async getSessionInitTriggers(
12
- options: InitTriggersOptions = {}
95
+ options: GetInitTriggersOptions = {}
13
96
  ): Promise<GetInitTriggersResponse> {
14
97
  const baseUrl = this.getBaseUrl(options);
15
- const route = new URI(baseUrl).segment(this.INIT_TRIGGERS_URL).href();
98
+ const route = new URI(baseUrl).segment(this.GET_TRIGGERS_URL).href();
99
+
100
+ return this.request({
101
+ method: 'GET',
102
+ route,
103
+ });
104
+ }
105
+
106
+ public static async claimSessionByAgent(
107
+ options: ClaimSessionByAgentOptions
108
+ ): Promise<Session> {
109
+ const baseUrl = this.getBaseUrl(options);
110
+ const route = new URI(baseUrl)
111
+ .segment(options.sessionId)
112
+ .segment(this.CLAIM_URL)
113
+ .href();
114
+
115
+ const params = _.pick(options, ['claimBy']);
116
+ const data = _.pick(options, ['params']);
117
+
118
+ return this.request({
119
+ method: 'POST',
120
+ route,
121
+ params,
122
+ data,
123
+ });
124
+ }
125
+
126
+ public static async transferToBot(
127
+ options: TransferToBotOptions
128
+ ): Promise<Session> {
129
+ const baseUrl = this.getBaseUrl(options);
130
+ const route = new URI(baseUrl)
131
+ .segment(options.sessionId)
132
+ .segment(this.TRANSFER_TO_BOT_URL)
133
+ .href();
134
+
135
+ const params = _.pick(options, ['agentId']);
136
+ const data = _.pick(options, ['params']);
137
+
138
+ return this.request({
139
+ method: 'POST',
140
+ route,
141
+ params,
142
+ data,
143
+ });
144
+ }
145
+
146
+ public static async startConversation(
147
+ options: StartConversationOptions
148
+ ): Promise<Session> {
149
+ const baseUrl = this.getBaseUrl(options);
150
+ const route = new URI(baseUrl).segment(this.TRANSFER_TO_BOT_URL).href();
151
+
152
+ const params = _.pick(options, ['contactId', 'triggerId']);
153
+ const data = _.pick(options, ['params']);
154
+
155
+ return this.request({
156
+ method: 'POST',
157
+ route,
158
+ params,
159
+ data,
160
+ });
161
+ }
162
+
163
+ public static async updateSession(
164
+ options: UpdateSessionOptions
165
+ ): Promise<Session> {
166
+ const baseUrl = this.getBaseUrl(options);
167
+ const route = new URI(baseUrl).segment(options.sessionId).href();
16
168
 
169
+ const data = _.pick(options, ['tags']);
17
170
  return this.request({
171
+ method: 'PUT',
18
172
  route,
173
+ data,
19
174
  });
20
175
  }
21
176
 
22
- protected static getBaseUrl(options: ApiVersionOptions): string {
23
- return HITLBase.getBaseUrl({
24
- ...options,
25
- module: this.MODULE_URL,
177
+ public static async closeSession(
178
+ options: CloseSessionOptions
179
+ ): Promise<Session> {
180
+ const baseUrl = this.getBaseUrl(options);
181
+ const route = new URI(baseUrl)
182
+ .segment(options.sessionId)
183
+ .segment(this.CLOSE_URL)
184
+ .href();
185
+
186
+ return this.request({
187
+ method: 'POST',
188
+ route,
26
189
  });
27
190
  }
28
191
  }
@@ -1,6 +1,5 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { ApiVersionOptions } from '../types';
4
3
  import {
5
4
  GetSettingsOptions,
6
5
  GetSettingsResponse,
@@ -38,11 +37,4 @@ export class Settings extends HITLBase {
38
37
  data,
39
38
  });
40
39
  }
41
-
42
- protected static getBaseUrl(options: ApiVersionOptions): string {
43
- return HITLBase.getBaseUrl({
44
- ...options,
45
- module: this.MODULE_URL,
46
- });
47
- }
48
40
  }
@@ -1,5 +1,12 @@
1
1
  import { Token, CalApiParams } from '@or-sdk/base';
2
- import { APP_ERROR_TYPE } from '@onereach/types-hitl-api';
2
+ import {
3
+ AGENT_STATUS,
4
+ APP_ERROR_TYPE,
5
+ BROADCAST_EVENTS,
6
+ CALL_MEMBER_STATUS,
7
+ CALL_MEMBER_TYPE,
8
+ SESSION_STATUS,
9
+ } from '@onereach/types-hitl-api';
3
10
 
4
11
  export type HITLConfig = {
5
12
  readonly token: Token;
@@ -16,7 +23,7 @@ export interface ApiVersionOptions {
16
23
  }
17
24
 
18
25
  export interface BaseUrlOptions extends ApiVersionOptions {
19
- readonly module: string;
26
+ readonly module?: string;
20
27
  }
21
28
 
22
29
  export interface IAppError {
@@ -28,4 +35,11 @@ export interface IAppError {
28
35
  readonly timestamp: number;
29
36
  }
30
37
 
31
- export { APP_ERROR_TYPE };
38
+ export {
39
+ AGENT_STATUS,
40
+ APP_ERROR_TYPE,
41
+ BROADCAST_EVENTS,
42
+ CALL_MEMBER_STATUS,
43
+ CALL_MEMBER_TYPE,
44
+ SESSION_STATUS,
45
+ };
@@ -5,10 +5,10 @@ import { ApiVersionOptions, NoAccountId } from './common';
5
5
  export type ReadEvent = ReadEvents.IReadEvent;
6
6
 
7
7
  export type GetNewEventsCountOptions = ApiVersionOptions
8
- & NoAccountId<ReadEvents.IGetNewEventsAmountQuery>
9
- & ReadEvents.IGetNewEventsAmountBody;
8
+ & NoAccountId<ReadEvents.IGetNewEventsCountQuery>
9
+ & ReadEvents.IGetNewEventsCountBody;
10
10
  export type GetNewEventsCountResponse
11
- = ReadEvents.IGetNewEventsAmountResponse;
11
+ = ReadEvents.IGetNewEventsCountResponse;
12
12
 
13
13
  export type SaveLastReadEventOptions = ApiVersionOptions
14
14
  & NoAccountId<ReadEvents.ISaveLastReadEventQuery>
@@ -3,8 +3,13 @@ import { ApiVersionOptions, NoAccountId } from './common';
3
3
 
4
4
  /* eslint-disable @typescript-eslint/indent */
5
5
  export type SessionEvent = SessionEvents.ISessionEvent;
6
+
6
7
  export type GetSessionEventsOptions = ApiVersionOptions
7
8
  & NoAccountId<SessionEvents.IGetSessionEventsQuery>;
8
9
  export type GetSessionEventsResponse
9
10
  = SessionEvents.IGetSessionEventsResponse;
10
11
 
12
+ export type AddEventsOptions = ApiVersionOptions
13
+ & NoAccountId<SessionEvents.IAddEventsBySessionIdQuery>
14
+ & SessionEvents.IAddEventsBySessionIdBody;
15
+ export type AddEventsResponse = SessionEvents.IAddEventsBySessionIdResponse;
@@ -1,5 +1,47 @@
1
- import { Sessions } from '@onereach/types-hitl-api';
2
- import { ApiVersionOptions } from './common';
1
+ import { ISessionId, Sessions } from '@onereach/types-hitl-api';
2
+ import { ApiVersionOptions, NoAccountId } from './common';
3
3
 
4
+ export type Session = Sessions.ISession;
5
+ export type TransferToBot = Sessions.ITransferToBot;
6
+ export type Command = Sessions.ICommand;
7
+
8
+ /* eslint-disable @typescript-eslint/indent */
9
+ export type GetSessionsOptions = ApiVersionOptions
10
+ & NoAccountId<Sessions.IGetSessionsQuery>;
11
+ export type GetSessionsResponse = Session | Sessions.IGetSessionsResponse;
12
+
13
+ export type SearchSessionsOptions = ApiVersionOptions
14
+ & NoAccountId<Sessions.ISearchSessionsQuery>;
15
+ export type SearchSessionsResponse = Sessions.IGetSessionsResponse;
16
+
17
+ export type SearchSessionsWithContactsOptions = ApiVersionOptions
18
+ & NoAccountId<Sessions.ISearchSessionsWithContactsQuery>;
19
+ export type SearchSessionsWithContactsResponse
20
+ = Sessions.ISearchSessionsWithContactsResponse;
21
+
22
+ export type GetQueueSessionOptions = ApiVersionOptions
23
+ & NoAccountId<Sessions.IGetQueueSessionQuery>;
24
+ export type GetQueueSessionResponse = Sessions.IGetQueueSessionResponse;
25
+
26
+ export type ClaimSessionByAgentOptions = ApiVersionOptions
27
+ & ISessionId
28
+ & NoAccountId<Sessions.IClaimSessionQuery>
29
+ & Sessions.IClaimSessionBody;
30
+
31
+ export type TransferToBotOptions = ApiVersionOptions
32
+ & ISessionId
33
+ & NoAccountId<Sessions.ITransferToBotQuery>
34
+ & Sessions.ITransferToBotBody;
35
+
36
+ export type StartConversationOptions = ApiVersionOptions
37
+ & Sessions.IInitConversationQuery
38
+ & Sessions.IInitConversationBody;
39
+
40
+ export type UpdateSessionOptions = ApiVersionOptions
41
+ & ISessionId
42
+ & Sessions.IUpdateSessionBody;
43
+
44
+ export type CloseSessionOptions = ApiVersionOptions & ISessionId;
45
+
46
+ export type GetInitTriggersOptions = ApiVersionOptions;
4
47
  export type GetInitTriggersResponse = Sessions.IGetInitTriggersResponse;
5
- export type InitTriggersOptions = ApiVersionOptions;