@or-sdk/hitl 0.34.49 → 0.34.50

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 (143) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/dist/cjs/api/Agents.js +37 -55
  3. package/dist/cjs/api/Agents.js.map +1 -1
  4. package/dist/cjs/api/CannedMessages.js +28 -24
  5. package/dist/cjs/api/CannedMessages.js.map +1 -1
  6. package/dist/cjs/api/Commands.js +12 -6
  7. package/dist/cjs/api/Commands.js.map +1 -1
  8. package/dist/cjs/api/Conferences.js +14 -14
  9. package/dist/cjs/api/Conferences.js.map +1 -1
  10. package/dist/cjs/api/ContactRuleGroups.js +26 -21
  11. package/dist/cjs/api/ContactRuleGroups.js.map +1 -1
  12. package/dist/cjs/api/Contacts.js +12 -5
  13. package/dist/cjs/api/Contacts.js.map +1 -1
  14. package/dist/cjs/api/ContactsMeta.js +14 -6
  15. package/dist/cjs/api/ContactsMeta.js.map +1 -1
  16. package/dist/cjs/api/EventTemplates.js +18 -22
  17. package/dist/cjs/api/EventTemplates.js.map +1 -1
  18. package/dist/cjs/api/Filters.js +6 -31
  19. package/dist/cjs/api/Filters.js.map +1 -1
  20. package/dist/cjs/api/HITLBase.js +8 -0
  21. package/dist/cjs/api/HITLBase.js.map +1 -1
  22. package/dist/cjs/api/Helpers.js +12 -4
  23. package/dist/cjs/api/Helpers.js.map +1 -1
  24. package/dist/cjs/api/Listeners.js +29 -27
  25. package/dist/cjs/api/Listeners.js.map +1 -1
  26. package/dist/cjs/api/Migrations.js +40 -41
  27. package/dist/cjs/api/Migrations.js.map +1 -1
  28. package/dist/cjs/api/RuleGroups.js +26 -21
  29. package/dist/cjs/api/RuleGroups.js.map +1 -1
  30. package/dist/cjs/api/SessionEvents.js +30 -32
  31. package/dist/cjs/api/SessionEvents.js.map +1 -1
  32. package/dist/cjs/api/SessionRelations.js +18 -18
  33. package/dist/cjs/api/SessionRelations.js.map +1 -1
  34. package/dist/cjs/api/Sessions.js +39 -79
  35. package/dist/cjs/api/Sessions.js.map +1 -1
  36. package/dist/cjs/api/Settings.js +26 -18
  37. package/dist/cjs/api/Settings.js.map +1 -1
  38. package/dist/cjs/api/Tasks.js +12 -6
  39. package/dist/cjs/api/Tasks.js.map +1 -1
  40. package/dist/cjs/api/Versions.js +13 -6
  41. package/dist/cjs/api/Versions.js.map +1 -1
  42. package/dist/cjs/constants.js +2 -1
  43. package/dist/cjs/constants.js.map +1 -1
  44. package/dist/cjs/types/common.js.map +1 -1
  45. package/dist/esm/api/Agents.js +26 -52
  46. package/dist/esm/api/Agents.js.map +1 -1
  47. package/dist/esm/api/CannedMessages.js +12 -23
  48. package/dist/esm/api/CannedMessages.js.map +1 -1
  49. package/dist/esm/api/Commands.js +2 -5
  50. package/dist/esm/api/Commands.js.map +1 -1
  51. package/dist/esm/api/Conferences.js +6 -14
  52. package/dist/esm/api/Conferences.js.map +1 -1
  53. package/dist/esm/api/ContactRuleGroups.js +10 -20
  54. package/dist/esm/api/ContactRuleGroups.js.map +1 -1
  55. package/dist/esm/api/Contacts.js +1 -5
  56. package/dist/esm/api/Contacts.js.map +1 -1
  57. package/dist/esm/api/ContactsMeta.js +4 -6
  58. package/dist/esm/api/ContactsMeta.js.map +1 -1
  59. package/dist/esm/api/EventTemplates.js +11 -22
  60. package/dist/esm/api/EventTemplates.js.map +1 -1
  61. package/dist/esm/api/Filters.js +12 -30
  62. package/dist/esm/api/Filters.js.map +1 -1
  63. package/dist/esm/api/HITLBase.js +4 -0
  64. package/dist/esm/api/HITLBase.js.map +1 -1
  65. package/dist/esm/api/Helpers.js +1 -4
  66. package/dist/esm/api/Helpers.js.map +1 -1
  67. package/dist/esm/api/Listeners.js +13 -27
  68. package/dist/esm/api/Listeners.js.map +1 -1
  69. package/dist/esm/api/Migrations.js +18 -41
  70. package/dist/esm/api/Migrations.js.map +1 -1
  71. package/dist/esm/api/RuleGroups.js +10 -20
  72. package/dist/esm/api/RuleGroups.js.map +1 -1
  73. package/dist/esm/api/SessionEvents.js +15 -29
  74. package/dist/esm/api/SessionEvents.js.map +1 -1
  75. package/dist/esm/api/SessionRelations.js +10 -18
  76. package/dist/esm/api/SessionRelations.js.map +1 -1
  77. package/dist/esm/api/Sessions.js +30 -74
  78. package/dist/esm/api/Sessions.js.map +1 -1
  79. package/dist/esm/api/Settings.js +8 -17
  80. package/dist/esm/api/Settings.js.map +1 -1
  81. package/dist/esm/api/Tasks.js +2 -5
  82. package/dist/esm/api/Tasks.js.map +1 -1
  83. package/dist/esm/api/Versions.js +2 -6
  84. package/dist/esm/api/Versions.js.map +1 -1
  85. package/dist/esm/constants.js +1 -0
  86. package/dist/esm/constants.js.map +1 -1
  87. package/dist/esm/types/common.js.map +1 -1
  88. package/dist/types/api/Agents.d.ts +1 -1
  89. package/dist/types/api/Agents.d.ts.map +1 -1
  90. package/dist/types/api/CannedMessages.d.ts +1 -1
  91. package/dist/types/api/CannedMessages.d.ts.map +1 -1
  92. package/dist/types/api/Commands.d.ts.map +1 -1
  93. package/dist/types/api/Conferences.d.ts.map +1 -1
  94. package/dist/types/api/ContactRuleGroups.d.ts.map +1 -1
  95. package/dist/types/api/Contacts.d.ts.map +1 -1
  96. package/dist/types/api/ContactsMeta.d.ts.map +1 -1
  97. package/dist/types/api/EventTemplates.d.ts.map +1 -1
  98. package/dist/types/api/Filters.d.ts +1 -1
  99. package/dist/types/api/Filters.d.ts.map +1 -1
  100. package/dist/types/api/HITLBase.d.ts +1 -0
  101. package/dist/types/api/HITLBase.d.ts.map +1 -1
  102. package/dist/types/api/Helpers.d.ts.map +1 -1
  103. package/dist/types/api/Listeners.d.ts +1 -1
  104. package/dist/types/api/Listeners.d.ts.map +1 -1
  105. package/dist/types/api/Migrations.d.ts +5 -4
  106. package/dist/types/api/Migrations.d.ts.map +1 -1
  107. package/dist/types/api/RuleGroups.d.ts.map +1 -1
  108. package/dist/types/api/SessionEvents.d.ts.map +1 -1
  109. package/dist/types/api/SessionRelations.d.ts +1 -1
  110. package/dist/types/api/SessionRelations.d.ts.map +1 -1
  111. package/dist/types/api/Sessions.d.ts.map +1 -1
  112. package/dist/types/api/Settings.d.ts.map +1 -1
  113. package/dist/types/api/Tasks.d.ts +1 -1
  114. package/dist/types/api/Tasks.d.ts.map +1 -1
  115. package/dist/types/api/Versions.d.ts +1 -1
  116. package/dist/types/api/Versions.d.ts.map +1 -1
  117. package/dist/types/constants.d.ts +1 -0
  118. package/dist/types/constants.d.ts.map +1 -1
  119. package/dist/types/types/common.d.ts +2 -1
  120. package/dist/types/types/common.d.ts.map +1 -1
  121. package/package.json +3 -3
  122. package/src/api/Agents.ts +20 -7
  123. package/src/api/CannedMessages.ts +10 -4
  124. package/src/api/Commands.ts +2 -0
  125. package/src/api/Conferences.ts +4 -0
  126. package/src/api/ContactRuleGroups.ts +7 -1
  127. package/src/api/Contacts.ts +2 -0
  128. package/src/api/ContactsMeta.ts +4 -1
  129. package/src/api/EventTemplates.ts +8 -2
  130. package/src/api/Filters.ts +8 -1
  131. package/src/api/HITLBase.ts +6 -0
  132. package/src/api/Helpers.ts +2 -0
  133. package/src/api/Listeners.ts +11 -4
  134. package/src/api/Migrations.ts +19 -7
  135. package/src/api/RuleGroups.ts +7 -1
  136. package/src/api/SessionEvents.ts +10 -4
  137. package/src/api/SessionRelations.ts +9 -4
  138. package/src/api/Sessions.ts +20 -3
  139. package/src/api/Settings.ts +7 -2
  140. package/src/api/Tasks.ts +3 -1
  141. package/src/api/Versions.ts +4 -1
  142. package/src/constants.ts +1 -0
  143. package/src/types/common.ts +2 -1
@@ -1,4 +1,8 @@
1
1
  import _ from 'lodash';
2
+ import URI from 'urijs';
3
+
4
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
5
+ import { ApiVersionOptions } from '../types';
2
6
  import {
3
7
  GetMigrationsOptions,
4
8
  GetMigrationsResponse,
@@ -12,8 +16,8 @@ import {
12
16
  SyncDefaultRecordsOptions,
13
17
  SyncDefaultRecordsResponse,
14
18
  } from '../types/migrations';
19
+
15
20
  import { HITLBase } from './HITLBase';
16
- import URI from 'urijs';
17
21
 
18
22
  export class Migrations extends HITLBase {
19
23
  protected static readonly MODULE_URL = 'migrations';
@@ -31,6 +35,7 @@ export class Migrations extends HITLBase {
31
35
  return this.request({
32
36
  route,
33
37
  params,
38
+ ...this.getBaseSettings(options),
34
39
  });
35
40
  }
36
41
 
@@ -38,7 +43,7 @@ export class Migrations extends HITLBase {
38
43
  options: RunMigrationsOptions = {}
39
44
  ): Promise<RunMigrationsResponse> {
40
45
  const route = this.getBaseUrl(options);
41
- const params = _.omit(options, ['version', 'meta']);
46
+ const params = _.omit(options, [...DEFAULT_OMIT_FIELDS, 'meta']);
42
47
  const data = _.pick(options, ['meta']);
43
48
 
44
49
  return this.request({
@@ -46,34 +51,38 @@ export class Migrations extends HITLBase {
46
51
  method: 'POST',
47
52
  params,
48
53
  data,
54
+ ...this.getBaseSettings(options),
49
55
  });
50
56
  }
51
57
 
52
- public static async getRunMigrationsStatus(): Promise<GetRunMigrationsStatusResponse> {
58
+ public static async getRunMigrationsStatus(options: ApiVersionOptions = {}): Promise<GetRunMigrationsStatusResponse> {
53
59
  const baseUrl = this.getBaseUrl({});
54
60
  const route = new URI(baseUrl).segment(this.MIGRATIONS_STATUS_URL).href();
55
61
 
56
62
  return this.request({
57
63
  route,
64
+ ...this.getBaseSettings(options),
58
65
  });
59
66
  }
60
67
 
61
- public static async deleteMigrationsTableLock() {
68
+ public static async deleteMigrationsTableLock(options: ApiVersionOptions = {}) {
62
69
  const baseUrl = this.getBaseUrl({});
63
70
  const route = new URI(baseUrl).segment(this.MIGRATIONS_LOCK_URL).href();
64
71
 
65
72
  return this.request({
66
73
  route,
67
74
  method: 'DELETE',
75
+ ...this.getBaseSettings(options),
68
76
  });
69
77
  }
70
78
 
71
- public static async getMigrationsInfo(): Promise<GetMigrationsInfoResponse> {
79
+ public static async getMigrationsInfo(options: ApiVersionOptions = {}): Promise<GetMigrationsInfoResponse> {
72
80
  const baseUrl = this.getBaseUrl({});
73
81
  const route = new URI(baseUrl).segment(this.MIGRATIONS_INFO_URL).href();
74
82
 
75
83
  return this.request({
76
84
  route,
85
+ ...this.getBaseSettings(options),
77
86
  });
78
87
  }
79
88
 
@@ -86,28 +95,31 @@ export class Migrations extends HITLBase {
86
95
  route,
87
96
  method: 'GET',
88
97
  params,
98
+ ...this.getBaseSettings(options),
89
99
  });
90
100
  }
91
101
 
92
- public static async createTableDefaultRecords(): Promise<CreateDefaultRecordsResponse> {
102
+ public static async createTableDefaultRecords(options: ApiVersionOptions = {}): Promise<CreateDefaultRecordsResponse> {
93
103
  const baseUrl = this.getBaseUrl({});
94
104
  const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
95
105
 
96
106
  return this.request({
97
107
  route,
98
108
  method: 'POST',
109
+ ...this.getBaseSettings(options),
99
110
  });
100
111
  }
101
112
 
102
113
  public static async syncTableDefaultRecords(options: SyncDefaultRecordsOptions): Promise<SyncDefaultRecordsResponse> {
103
114
  const baseUrl = this.getBaseUrl({});
104
115
  const route = new URI(baseUrl).segment(this.DEFAULT_RECORDS_URL).href();
105
- const params = _.omit(options, ['version']);
116
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
106
117
 
107
118
  return this.request({
108
119
  route,
109
120
  method: 'PUT',
110
121
  params,
122
+ ...this.getBaseSettings(options),
111
123
  });
112
124
  }
113
125
  }
@@ -1,5 +1,6 @@
1
1
  import _ from 'lodash';
2
2
 
3
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
3
4
  import {
4
5
  SearchRuleGroupsOptions,
5
6
  SearchRuleGroupsResponse,
@@ -8,6 +9,7 @@ import {
8
9
  UpdateRuleGroupOptions,
9
10
  DeleteRuleGroupOptions,
10
11
  } from '../types/rule-groups';
12
+
11
13
  import { HITLBase } from './HITLBase';
12
14
 
13
15
  export class RuleGroups extends HITLBase {
@@ -17,13 +19,14 @@ export class RuleGroups extends HITLBase {
17
19
  options: SearchRuleGroupsOptions = {}
18
20
  ): Promise<SearchRuleGroupsResponse | RuleGroup> {
19
21
  const route = this.getBaseUrl(options);
20
- const params = _.omit(options, ['version', 'groupIdList', 'accountId']);
22
+ const params = _.omit(options, [...DEFAULT_OMIT_FIELDS, 'groupIdList', 'accountId']);
21
23
  const data = _.pick(options, 'groupIdList');
22
24
 
23
25
  return this.request({
24
26
  route,
25
27
  params,
26
28
  data,
29
+ ...this.getBaseSettings(options),
27
30
  });
28
31
  }
29
32
 
@@ -37,6 +40,7 @@ export class RuleGroups extends HITLBase {
37
40
  method: 'POST',
38
41
  route,
39
42
  data,
43
+ ...this.getBaseSettings(options),
40
44
  });
41
45
  }
42
46
 
@@ -50,6 +54,7 @@ export class RuleGroups extends HITLBase {
50
54
  method: 'PUT',
51
55
  route,
52
56
  data,
57
+ ...this.getBaseSettings(options),
53
58
  });
54
59
  }
55
60
 
@@ -63,6 +68,7 @@ export class RuleGroups extends HITLBase {
63
68
  method: 'DELETE',
64
69
  route,
65
70
  params,
71
+ ...this.getBaseSettings(options),
66
72
  });
67
73
  }
68
74
  }
@@ -1,6 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import URI from 'urijs';
3
3
 
4
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
4
5
  import {
5
6
  GetNewEventsCountOptions,
6
7
  GetNewEventsCountResponse,
@@ -27,12 +28,13 @@ export class SessionEvents extends HITLBase {
27
28
  options: GetSessionEventsOptions
28
29
  ): Promise<GetSessionEventsResponse> {
29
30
  const route = this.getBaseUrl(options);
30
- const params = _.omit(options, ['version']);
31
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
31
32
 
32
33
  return this.request({
33
34
  method: 'GET',
34
35
  route,
35
36
  params,
37
+ ...this.getBaseSettings(options),
36
38
  });
37
39
  }
38
40
 
@@ -41,12 +43,13 @@ export class SessionEvents extends HITLBase {
41
43
  ): Promise<GetBulkSessionsEventsResponse> {
42
44
  const baseUrl = this.getBaseUrl(options);
43
45
  const route = new URI(baseUrl).segment(this.GET_BULK_EVENTS_URL).href();
44
- const params = _.omit(options, ['version']);
46
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
45
47
 
46
48
  return this.request({
47
49
  method: 'GET',
48
50
  route,
49
51
  params,
52
+ ...this.getBaseSettings(options),
50
53
  });
51
54
  }
52
55
 
@@ -62,6 +65,7 @@ export class SessionEvents extends HITLBase {
62
65
  route,
63
66
  params,
64
67
  data,
68
+ ...this.getBaseSettings(options),
65
69
  });
66
70
  }
67
71
 
@@ -71,13 +75,14 @@ export class SessionEvents extends HITLBase {
71
75
  const baseUrl = this.getBaseUrl(options);
72
76
  const route = new URI(baseUrl).segment(this.GET_EVENTS_COUNT_URL).href();
73
77
  const params = _.pick(options, ['userId']);
74
- const data = _.omit(options, ['userId', 'version']);
78
+ const data = _.omit(options, ['userId', ...DEFAULT_OMIT_FIELDS]);
75
79
 
76
80
  return this.request({
77
81
  method: 'POST',
78
82
  route,
79
83
  params,
80
84
  data,
85
+ ...this.getBaseSettings(options),
81
86
  });
82
87
  }
83
88
 
@@ -87,13 +92,14 @@ export class SessionEvents extends HITLBase {
87
92
  const baseUrl = this.getBaseUrl(options);
88
93
  const route = new URI(baseUrl).segment(this.SAVE_READ_EVENT_URL).href();
89
94
  const params = _.pick(options, ['userId']);
90
- const data = _.omit(options, ['userId', 'version']);
95
+ const data = _.omit(options, ['userId', ...DEFAULT_OMIT_FIELDS]);
91
96
 
92
97
  return this.request({
93
98
  method: 'POST',
94
99
  route,
95
100
  params,
96
101
  data,
102
+ ...this.getBaseSettings(options),
97
103
  });
98
104
  }
99
105
  }
@@ -1,6 +1,6 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { HITLBase } from './HITLBase';
3
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
4
4
  import {
5
5
  GetSessionRelationsOptions,
6
6
  GetSessionRelationsResponse,
@@ -9,6 +9,8 @@ import {
9
9
  DeleteSessionRelationsOptions,
10
10
  } from '../types/session-relations';
11
11
 
12
+ import { HITLBase } from './HITLBase';
13
+
12
14
  export class SessionRelations extends HITLBase {
13
15
  protected static MODULE_URL = 'session-relations';
14
16
 
@@ -16,23 +18,25 @@ export class SessionRelations extends HITLBase {
16
18
  options: GetSessionRelationsOptions
17
19
  ): Promise<GetSessionRelationsResponse> {
18
20
  const route = this.getBaseUrl(options);
19
- const params = _.omit(options, ['version']);
21
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
20
22
 
21
23
  return this.request({
22
24
  method: 'GET',
23
25
  route,
24
26
  params,
27
+ ...this.getBaseSettings(options),
25
28
  });
26
29
  }
27
30
 
28
31
  public static createSessionRelations(options: CreateSessionRelationsOptions): Promise<CreateSessionRelationsResponse> {
29
32
  const route = this.getBaseUrl(options);
30
- const data = _.omit(options, ['version']);
33
+ const data = _.omit(options, DEFAULT_OMIT_FIELDS);
31
34
 
32
35
  return this.request({
33
36
  method: 'POST',
34
37
  route,
35
38
  data,
39
+ ...this.getBaseSettings(options),
36
40
  });
37
41
  }
38
42
 
@@ -41,12 +45,13 @@ export class SessionRelations extends HITLBase {
41
45
  options: DeleteSessionRelationsOptions
42
46
  ) {
43
47
  const route = this.getBaseUrl(options);
44
- const data = _.omit(options, ['version']);
48
+ const data = _.omit(options, DEFAULT_OMIT_FIELDS);
45
49
 
46
50
  return this.request({
47
51
  method: 'DELETE',
48
52
  route,
49
53
  data,
54
+ ...this.getBaseSettings(options),
50
55
  });
51
56
  }
52
57
  }
@@ -1,6 +1,7 @@
1
1
  import _ from 'lodash';
2
2
  import URI from 'urijs';
3
3
 
4
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
4
5
  import {
5
6
  Session,
6
7
  GetSessionsOptions,
@@ -25,6 +26,7 @@ import {
25
26
  CreateSessionsResponse,
26
27
  BulkDeleteSessionsOptions,
27
28
  } from '../types/sessions';
29
+
28
30
  import { HITLBase } from './HITLBase';
29
31
 
30
32
  export class Sessions extends HITLBase {
@@ -45,12 +47,13 @@ export class Sessions extends HITLBase {
45
47
  options: GetSessionsOptions = {}
46
48
  ): Promise<GetSessionsResponse> {
47
49
  const route = this.getBaseUrl(options);
48
- const params = _.omit(options, ['version']);
50
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
49
51
 
50
52
  return this.request({
51
53
  method: 'GET',
52
54
  route,
53
55
  params,
56
+ ...this.getBaseSettings(options),
54
57
  });
55
58
  }
56
59
 
@@ -65,6 +68,7 @@ export class Sessions extends HITLBase {
65
68
  method: 'GET',
66
69
  route,
67
70
  params,
71
+ ...this.getBaseSettings(options),
68
72
  });
69
73
  }
70
74
 
@@ -74,13 +78,14 @@ export class Sessions extends HITLBase {
74
78
  const baseUrl = this.getBaseUrl(options);
75
79
  const route = new URI(baseUrl).segment(this.SEARCH_URL).href();
76
80
  const params = _.pick(options, ['agentId']);
77
- const data = _.omit(options, ['agentId', 'version']);
81
+ const data = _.omit(options, ['agentId', ...DEFAULT_OMIT_FIELDS]);
78
82
 
79
83
  return this.request({
80
84
  method: 'POST',
81
85
  route,
82
86
  params,
83
87
  data,
88
+ ...this.getBaseSettings(options),
84
89
  });
85
90
  }
86
91
 
@@ -93,13 +98,14 @@ export class Sessions extends HITLBase {
93
98
  .href();
94
99
 
95
100
  const params = _.pick(options, ['agentId']);
96
- const data = _.omit(options, ['agentId', 'version']);
101
+ const data = _.omit(options, ['agentId', ...DEFAULT_OMIT_FIELDS]);
97
102
 
98
103
  return this.request({
99
104
  method: 'POST',
100
105
  route,
101
106
  params,
102
107
  data,
108
+ ...this.getBaseSettings(options),
103
109
  });
104
110
  }
105
111
 
@@ -114,6 +120,7 @@ export class Sessions extends HITLBase {
114
120
  method: 'GET',
115
121
  route,
116
122
  params,
123
+ ...this.getBaseSettings(options),
117
124
  });
118
125
  }
119
126
 
@@ -126,6 +133,7 @@ export class Sessions extends HITLBase {
126
133
  return this.request({
127
134
  method: 'GET',
128
135
  route,
136
+ ...this.getBaseSettings(options),
129
137
  });
130
138
  }
131
139
 
@@ -146,6 +154,7 @@ export class Sessions extends HITLBase {
146
154
  route,
147
155
  params,
148
156
  data,
157
+ ...this.getBaseSettings(options),
149
158
  });
150
159
  }
151
160
 
@@ -166,6 +175,7 @@ export class Sessions extends HITLBase {
166
175
  route,
167
176
  params,
168
177
  data,
178
+ ...this.getBaseSettings(options),
169
179
  });
170
180
  }
171
181
 
@@ -183,6 +193,7 @@ export class Sessions extends HITLBase {
183
193
  route,
184
194
  params,
185
195
  data,
196
+ ...this.getBaseSettings(options),
186
197
  });
187
198
  }
188
199
 
@@ -197,6 +208,7 @@ export class Sessions extends HITLBase {
197
208
  method: 'PUT',
198
209
  route,
199
210
  data,
211
+ ...this.getBaseSettings(options),
200
212
  });
201
213
  }
202
214
 
@@ -209,6 +221,7 @@ export class Sessions extends HITLBase {
209
221
  method: 'POST',
210
222
  route,
211
223
  data,
224
+ ...this.getBaseSettings(options),
212
225
  });
213
226
  }
214
227
 
@@ -224,6 +237,7 @@ export class Sessions extends HITLBase {
224
237
  return this.request({
225
238
  method: 'POST',
226
239
  route,
240
+ ...this.getBaseSettings(options),
227
241
  });
228
242
  }
229
243
 
@@ -240,6 +254,7 @@ export class Sessions extends HITLBase {
240
254
  return this.request({
241
255
  method: 'POST',
242
256
  route,
257
+ ...this.getBaseSettings(options),
243
258
  });
244
259
  }
245
260
  public static async deleteClosedSession(
@@ -250,6 +265,7 @@ export class Sessions extends HITLBase {
250
265
  return this.request({
251
266
  method: 'DELETE',
252
267
  route,
268
+ ...this.getBaseSettings(options),
253
269
  });
254
270
  }
255
271
 
@@ -262,6 +278,7 @@ export class Sessions extends HITLBase {
262
278
  method: 'DELETE',
263
279
  route,
264
280
  params,
281
+ ...this.getBaseSettings(options),
265
282
  });
266
283
  }
267
284
  }
@@ -1,5 +1,6 @@
1
1
  import _ from 'lodash';
2
2
 
3
+ import { DEFAULT_OMIT_FIELDS } from '../constants';
3
4
  import {
4
5
  DeleteSettingOptions,
5
6
  GetSettingsOptions,
@@ -7,6 +8,7 @@ import {
7
8
  UpdateSettingsOptions,
8
9
  UpdateSettingsResponse,
9
10
  } from '../types/settings';
11
+
10
12
  import { HITLBase } from './HITLBase';
11
13
 
12
14
  export class Settings extends HITLBase {
@@ -17,13 +19,14 @@ export class Settings extends HITLBase {
17
19
  options: GetSettingsOptions = {}
18
20
  ): Promise<GetSettingsResponse> {
19
21
  const route = this.getBaseUrl(options);
20
- const params = _.omit(options, ['version', 'accountId', 'ignoreRuleTags']);
22
+ const params = _.omit(options, [...DEFAULT_OMIT_FIELDS, 'accountId', 'ignoreRuleTags']);
21
23
  const customHeaders = { [this.IGNORE_RULE_TAGS_HEADER]: `${_.get(options, ['ignoreRuleTags']) || false}` };
22
24
 
23
25
  return this.request({
24
26
  route,
25
27
  params,
26
28
  customHeaders,
29
+ ...this.getBaseSettings(options),
27
30
  });
28
31
  }
29
32
 
@@ -42,6 +45,7 @@ export class Settings extends HITLBase {
42
45
  method: 'PUT',
43
46
  params,
44
47
  data,
48
+ ...this.getBaseSettings(options),
45
49
  });
46
50
  }
47
51
 
@@ -49,12 +53,13 @@ export class Settings extends HITLBase {
49
53
  options: DeleteSettingOptions
50
54
  ): Promise<GetSettingsResponse> {
51
55
  const route = this.getBaseUrl(options);
52
- const params = _.omit(options, ['version']);
56
+ const params = _.omit(options, DEFAULT_OMIT_FIELDS);
53
57
 
54
58
  return this.request({
55
59
  route,
56
60
  method: 'DELETE',
57
61
  params,
62
+ ...this.getBaseSettings(options),
58
63
  });
59
64
  }
60
65
  }
package/src/api/Tasks.ts CHANGED
@@ -1,8 +1,9 @@
1
1
  import _ from 'lodash';
2
2
 
3
- import { HITLBase } from './HITLBase';
4
3
  import { RunTaskOptions } from '../types/tasks';
5
4
 
5
+ import { HITLBase } from './HITLBase';
6
+
6
7
  export class Tasks extends HITLBase {
7
8
  protected static MODULE_URL = 'tasks';
8
9
 
@@ -18,6 +19,7 @@ export class Tasks extends HITLBase {
18
19
  route,
19
20
  params,
20
21
  data,
22
+ ...this.getBaseSettings(options),
21
23
  });
22
24
  }
23
25
  }
@@ -1,9 +1,10 @@
1
1
  import URI from 'urijs';
2
2
 
3
3
  import { ApiVersionOptions } from '../types';
4
- import { HITLBase } from './HITLBase';
5
4
  import { GetVersionsListResponse, GetVersionInfoResponse } from '../types/versions';
6
5
 
6
+ import { HITLBase } from './HITLBase';
7
+
7
8
  export class Versions extends HITLBase {
8
9
  protected static MODULE_URL = 'ui-versions';
9
10
  protected static VERSION_INFO = 'version-info';
@@ -15,6 +16,7 @@ export class Versions extends HITLBase {
15
16
 
16
17
  return this.request({
17
18
  route,
19
+ ...this.getBaseSettings(options),
18
20
  });
19
21
  }
20
22
 
@@ -26,6 +28,7 @@ export class Versions extends HITLBase {
26
28
 
27
29
  return this.request({
28
30
  route,
31
+ ...this.getBaseSettings(options),
29
32
  });
30
33
  }
31
34
  }
package/src/constants.ts CHANGED
@@ -1,4 +1,5 @@
1
1
  export const SERVICE_KEY = 'hitl-api';
2
2
  export const EKS_SERVICE_KEY = 'hitl-eks-api';
3
3
  export const HITL_API_SERVICE_KEY = SERVICE_KEY;
4
+ export const DEFAULT_OMIT_FIELDS = ['version', 'timeout'];
4
5
 
@@ -1,4 +1,3 @@
1
- import { Token, CalApiParams } from '@or-sdk/base';
2
1
  import {
3
2
  AGENT_STATUS,
4
3
  APP_ERROR_TYPE,
@@ -8,6 +7,7 @@ import {
8
7
  CALL_MEMBER_TYPE,
9
8
  SESSION_STATUS,
10
9
  } from '@onereach/types-hitl-api';
10
+ import { Token, CalApiParams } from '@or-sdk/base';
11
11
 
12
12
  export type HITLConfig = {
13
13
  readonly token: Token;
@@ -22,6 +22,7 @@ export type Request = <T>(params: CalApiParams) => Promise<T>;
22
22
 
23
23
  export interface ApiVersionOptions {
24
24
  readonly version?: number | string;
25
+ readonly timeout?: number;
25
26
  }
26
27
 
27
28
  export interface BaseUrlOptions extends ApiVersionOptions {