hume 0.11.1 → 0.11.2

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 (176) hide show
  1. package/.mock/definition/empathic-voice/__package__.yml +24 -0
  2. package/.mock/definition/empathic-voice/configs.yml +2 -0
  3. package/.mock/definition/tts/__package__.yml +28 -0
  4. package/.mock/fern.config.json +1 -1
  5. package/Client.d.ts +11 -7
  6. package/Client.js +54 -6
  7. package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  8. package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  9. package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  10. package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
  11. package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  12. package/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
  13. package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  14. package/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
  15. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  16. package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  17. package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  18. package/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
  19. package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  20. package/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
  21. package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  22. package/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
  23. package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  24. package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  25. package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  26. package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  27. package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  28. package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  29. package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  30. package/api/resources/empathicVoice/types/index.d.ts +2 -0
  31. package/api/resources/empathicVoice/types/index.js +2 -0
  32. package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  33. package/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  34. package/api/resources/tts/client/Client.d.ts +24 -18
  35. package/api/resources/tts/client/Client.js +84 -46
  36. package/api/resources/tts/client/index.d.ts +1 -1
  37. package/api/resources/tts/client/index.js +15 -0
  38. package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  39. package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  40. package/api/resources/tts/client/requests/index.d.ts +1 -0
  41. package/api/resources/tts/client/requests/index.js +2 -0
  42. package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  43. package/api/resources/tts/errors/BadRequestError.js +2 -1
  44. package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  45. package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  46. package/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
  47. package/api/resources/tts/resources/voices/client/Client.js +45 -22
  48. package/api/resources/tts/types/Snippet.d.ts +2 -0
  49. package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  50. package/core/fetcher/APIResponse.d.ts +10 -0
  51. package/core/fetcher/Fetcher.js +7 -0
  52. package/core/fetcher/Headers.d.ts +2 -0
  53. package/core/fetcher/Headers.js +84 -0
  54. package/core/fetcher/HttpResponsePromise.d.ts +58 -0
  55. package/core/fetcher/HttpResponsePromise.js +103 -0
  56. package/core/fetcher/RawResponse.d.ts +29 -0
  57. package/core/fetcher/RawResponse.js +44 -0
  58. package/core/fetcher/index.d.ts +3 -0
  59. package/core/fetcher/index.js +7 -1
  60. package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  61. package/core/form-data-utils/FormDataWrapper.js +48 -9
  62. package/core/pagination/Page.d.ts +5 -2
  63. package/core/pagination/Page.js +5 -2
  64. package/core/pagination/Pageable.d.ts +2 -0
  65. package/dist/Client.d.ts +11 -7
  66. package/dist/Client.js +54 -6
  67. package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
  68. package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
  69. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +4 -2
  70. package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +74 -40
  71. package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +2 -1
  72. package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +55 -30
  73. package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +14 -7
  74. package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +134 -64
  75. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
  76. package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
  77. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +10 -5
  78. package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +88 -41
  79. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +16 -8
  80. package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +133 -62
  81. package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +14 -7
  82. package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +134 -64
  83. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
  84. package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
  85. package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
  86. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
  87. package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
  88. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
  89. package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  90. package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
  91. package/dist/api/resources/empathicVoice/types/index.js +2 -0
  92. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +12 -6
  93. package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +89 -38
  94. package/dist/api/resources/tts/client/Client.d.ts +24 -18
  95. package/dist/api/resources/tts/client/Client.js +84 -46
  96. package/dist/api/resources/tts/client/index.d.ts +1 -1
  97. package/dist/api/resources/tts/client/index.js +15 -0
  98. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
  99. package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
  100. package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
  101. package/dist/api/resources/tts/client/requests/index.js +2 -0
  102. package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
  103. package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
  104. package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
  105. package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
  106. package/dist/api/resources/tts/resources/voices/client/Client.d.ts +4 -2
  107. package/dist/api/resources/tts/resources/voices/client/Client.js +45 -22
  108. package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
  109. package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
  110. package/dist/core/fetcher/APIResponse.d.ts +10 -0
  111. package/dist/core/fetcher/Fetcher.js +7 -0
  112. package/dist/core/fetcher/Headers.d.ts +2 -0
  113. package/dist/core/fetcher/Headers.js +84 -0
  114. package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
  115. package/dist/core/fetcher/HttpResponsePromise.js +103 -0
  116. package/dist/core/fetcher/RawResponse.d.ts +29 -0
  117. package/dist/core/fetcher/RawResponse.js +44 -0
  118. package/dist/core/fetcher/index.d.ts +3 -0
  119. package/dist/core/fetcher/index.js +7 -1
  120. package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
  121. package/dist/core/form-data-utils/FormDataWrapper.js +48 -9
  122. package/dist/core/pagination/Page.d.ts +5 -2
  123. package/dist/core/pagination/Page.js +5 -2
  124. package/dist/core/pagination/Pageable.d.ts +2 -0
  125. package/dist/errors/HumeError.d.ts +7 -2
  126. package/dist/errors/HumeError.js +10 -10
  127. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  128. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  129. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  130. package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  131. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  132. package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  133. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  134. package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  135. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  136. package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  137. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  138. package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  139. package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  140. package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
  141. package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
  142. package/dist/serialization/resources/tts/types/Snippet.js +1 -0
  143. package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  144. package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  145. package/dist/version.d.ts +1 -1
  146. package/dist/version.js +1 -1
  147. package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  148. package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  149. package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
  150. package/errors/HumeError.d.ts +7 -2
  151. package/errors/HumeError.js +10 -10
  152. package/package.json +3 -2
  153. package/reference.md +17 -15
  154. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
  155. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
  156. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
  157. package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
  158. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
  159. package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
  160. package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
  161. package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
  162. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
  163. package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
  164. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
  165. package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
  166. package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
  167. package/serialization/resources/empathicVoice/types/index.js +2 -0
  168. package/serialization/resources/tts/types/Snippet.d.ts +1 -0
  169. package/serialization/resources/tts/types/Snippet.js +1 -0
  170. package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
  171. package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
  172. package/version.d.ts +1 -1
  173. package/version.js +1 -1
  174. package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
  175. package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
  176. package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
@@ -76,7 +76,7 @@ class Chats {
76
76
  */
77
77
  listChats() {
78
78
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
79
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
79
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
80
80
  var _a, _b, _c;
81
81
  const { pageNumber, pageSize, ascendingOrder, configId } = request;
82
82
  const _queryParams = {};
@@ -95,7 +95,7 @@ class Chats {
95
95
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
96
96
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, "v0/evi/chats"),
97
97
  method: "GET",
98
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
98
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
99
99
  contentType: "application/json",
100
100
  queryParameters: _queryParams,
101
101
  requestType: "json",
@@ -104,12 +104,15 @@ class Chats {
104
104
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
105
105
  });
106
106
  if (_response.ok) {
107
- return serializers.empathicVoice.ReturnPagedChats.parseOrThrow(_response.body, {
108
- unrecognizedObjectKeys: "passthrough",
109
- allowUnrecognizedUnionMembers: true,
110
- allowUnrecognizedEnumValues: true,
111
- breadcrumbsPrefix: ["response"],
112
- });
107
+ return {
108
+ data: serializers.empathicVoice.ReturnPagedChats.parseOrThrow(_response.body, {
109
+ unrecognizedObjectKeys: "passthrough",
110
+ allowUnrecognizedUnionMembers: true,
111
+ allowUnrecognizedEnumValues: true,
112
+ breadcrumbsPrefix: ["response"],
113
+ }),
114
+ rawResponse: _response.rawResponse,
115
+ };
113
116
  }
114
117
  if (_response.error.reason === "status-code") {
115
118
  switch (_response.error.statusCode) {
@@ -119,11 +122,12 @@ class Chats {
119
122
  allowUnrecognizedUnionMembers: true,
120
123
  allowUnrecognizedEnumValues: true,
121
124
  breadcrumbsPrefix: ["response"],
122
- }));
125
+ }), _response.rawResponse);
123
126
  default:
124
127
  throw new errors.HumeError({
125
128
  statusCode: _response.error.statusCode,
126
129
  body: _response.error.body,
130
+ rawResponse: _response.rawResponse,
127
131
  });
128
132
  }
129
133
  }
@@ -132,18 +136,22 @@ class Chats {
132
136
  throw new errors.HumeError({
133
137
  statusCode: _response.error.statusCode,
134
138
  body: _response.error.rawBody,
139
+ rawResponse: _response.rawResponse,
135
140
  });
136
141
  case "timeout":
137
142
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats.");
138
143
  case "unknown":
139
144
  throw new errors.HumeError({
140
145
  message: _response.error.errorMessage,
146
+ rawResponse: _response.rawResponse,
141
147
  });
142
148
  }
143
- });
149
+ }));
144
150
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
151
+ const dataWithRawResponse = yield list(request).withRawResponse();
145
152
  return new core.Pageable({
146
- response: yield list(request),
153
+ response: dataWithRawResponse.data,
154
+ rawResponse: dataWithRawResponse.rawResponse,
147
155
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
148
156
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []; },
149
157
  loadPage: (_response) => {
@@ -171,7 +179,7 @@ class Chats {
171
179
  */
172
180
  listChatEvents(id_1) {
173
181
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
174
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
182
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
175
183
  var _a, _b, _c;
176
184
  const { pageSize, pageNumber, ascendingOrder } = request;
177
185
  const _queryParams = {};
@@ -187,7 +195,7 @@ class Chats {
187
195
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
196
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/chats/${encodeURIComponent(id)}`),
189
197
  method: "GET",
190
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
198
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
191
199
  contentType: "application/json",
192
200
  queryParameters: _queryParams,
193
201
  requestType: "json",
@@ -196,12 +204,15 @@ class Chats {
196
204
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
205
  });
198
206
  if (_response.ok) {
199
- return serializers.empathicVoice.ReturnChatPagedEvents.parseOrThrow(_response.body, {
200
- unrecognizedObjectKeys: "passthrough",
201
- allowUnrecognizedUnionMembers: true,
202
- allowUnrecognizedEnumValues: true,
203
- breadcrumbsPrefix: ["response"],
204
- });
207
+ return {
208
+ data: serializers.empathicVoice.ReturnChatPagedEvents.parseOrThrow(_response.body, {
209
+ unrecognizedObjectKeys: "passthrough",
210
+ allowUnrecognizedUnionMembers: true,
211
+ allowUnrecognizedEnumValues: true,
212
+ breadcrumbsPrefix: ["response"],
213
+ }),
214
+ rawResponse: _response.rawResponse,
215
+ };
205
216
  }
206
217
  if (_response.error.reason === "status-code") {
207
218
  switch (_response.error.statusCode) {
@@ -211,11 +222,12 @@ class Chats {
211
222
  allowUnrecognizedUnionMembers: true,
212
223
  allowUnrecognizedEnumValues: true,
213
224
  breadcrumbsPrefix: ["response"],
214
- }));
225
+ }), _response.rawResponse);
215
226
  default:
216
227
  throw new errors.HumeError({
217
228
  statusCode: _response.error.statusCode,
218
229
  body: _response.error.body,
230
+ rawResponse: _response.rawResponse,
219
231
  });
220
232
  }
221
233
  }
@@ -224,18 +236,22 @@ class Chats {
224
236
  throw new errors.HumeError({
225
237
  statusCode: _response.error.statusCode,
226
238
  body: _response.error.rawBody,
239
+ rawResponse: _response.rawResponse,
227
240
  });
228
241
  case "timeout":
229
242
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}.");
230
243
  case "unknown":
231
244
  throw new errors.HumeError({
232
245
  message: _response.error.errorMessage,
246
+ rawResponse: _response.rawResponse,
233
247
  });
234
248
  }
235
- });
249
+ }));
236
250
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
251
+ const dataWithRawResponse = yield list(request).withRawResponse();
237
252
  return new core.Pageable({
238
- response: yield list(request),
253
+ response: dataWithRawResponse.data,
254
+ rawResponse: dataWithRawResponse.rawResponse,
239
255
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
240
256
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
241
257
  loadPage: (_response) => {
@@ -257,12 +273,15 @@ class Chats {
257
273
  * await client.empathicVoice.chats.getAudio("470a49f6-1dec-4afe-8b61-035d3b2d63b0")
258
274
  */
259
275
  getAudio(id, requestOptions) {
276
+ return core.HttpResponsePromise.fromPromise(this.__getAudio(id, requestOptions));
277
+ }
278
+ __getAudio(id, requestOptions) {
260
279
  return __awaiter(this, void 0, void 0, function* () {
261
280
  var _a, _b, _c;
262
281
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
263
282
  url: (0, url_join_1.default)((_c = (_b = (yield core.Supplier.get(this._options.baseUrl))) !== null && _b !== void 0 ? _b : (yield core.Supplier.get(this._options.environment))) !== null && _c !== void 0 ? _c : environments.HumeEnvironment.Production, `v0/evi/chats/${encodeURIComponent(id)}/audio`),
264
283
  method: "GET",
265
- headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.1", "User-Agent": "hume/0.11.1", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
284
+ headers: Object.assign(Object.assign({ "X-Fern-Language": "JavaScript", "X-Fern-SDK-Name": "hume", "X-Fern-SDK-Version": "0.11.2", "User-Agent": "hume/0.11.2", "X-Fern-Runtime": core.RUNTIME.type, "X-Fern-Runtime-Version": core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
266
285
  contentType: "application/json",
267
286
  requestType: "json",
268
287
  timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
@@ -270,12 +289,15 @@ class Chats {
270
289
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
271
290
  });
272
291
  if (_response.ok) {
273
- return serializers.empathicVoice.ReturnChatAudioReconstruction.parseOrThrow(_response.body, {
274
- unrecognizedObjectKeys: "passthrough",
275
- allowUnrecognizedUnionMembers: true,
276
- allowUnrecognizedEnumValues: true,
277
- breadcrumbsPrefix: ["response"],
278
- });
292
+ return {
293
+ data: serializers.empathicVoice.ReturnChatAudioReconstruction.parseOrThrow(_response.body, {
294
+ unrecognizedObjectKeys: "passthrough",
295
+ allowUnrecognizedUnionMembers: true,
296
+ allowUnrecognizedEnumValues: true,
297
+ breadcrumbsPrefix: ["response"],
298
+ }),
299
+ rawResponse: _response.rawResponse,
300
+ };
279
301
  }
280
302
  if (_response.error.reason === "status-code") {
281
303
  switch (_response.error.statusCode) {
@@ -285,11 +307,12 @@ class Chats {
285
307
  allowUnrecognizedUnionMembers: true,
286
308
  allowUnrecognizedEnumValues: true,
287
309
  breadcrumbsPrefix: ["response"],
288
- }));
310
+ }), _response.rawResponse);
289
311
  default:
290
312
  throw new errors.HumeError({
291
313
  statusCode: _response.error.statusCode,
292
314
  body: _response.error.body,
315
+ rawResponse: _response.rawResponse,
293
316
  });
294
317
  }
295
318
  }
@@ -298,12 +321,14 @@ class Chats {
298
321
  throw new errors.HumeError({
299
322
  statusCode: _response.error.statusCode,
300
323
  body: _response.error.rawBody,
324
+ rawResponse: _response.rawResponse,
301
325
  });
302
326
  case "timeout":
303
327
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chats/{id}/audio.");
304
328
  case "unknown":
305
329
  throw new errors.HumeError({
306
330
  message: _response.error.errorMessage,
331
+ rawResponse: _response.rawResponse,
307
332
  });
308
333
  }
309
334
  });
@@ -86,7 +86,8 @@ export declare class Configs {
86
86
  * }
87
87
  * })
88
88
  */
89
- createConfig(request: Hume.empathicVoice.PostedConfig, requestOptions?: Configs.RequestOptions): Promise<Hume.empathicVoice.ReturnConfig>;
89
+ createConfig(request: Hume.empathicVoice.PostedConfig, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
90
+ private __createConfig;
90
91
  /**
91
92
  * Fetches a list of a **Config's** versions.
92
93
  *
@@ -149,7 +150,8 @@ export declare class Configs {
149
150
  * }
150
151
  * })
151
152
  */
152
- createConfigVersion(id: string, request: Hume.empathicVoice.PostedConfigVersion, requestOptions?: Configs.RequestOptions): Promise<Hume.empathicVoice.ReturnConfig>;
153
+ createConfigVersion(id: string, request: Hume.empathicVoice.PostedConfigVersion, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
154
+ private __createConfigVersion;
153
155
  /**
154
156
  * Deletes a **Config** and its versions.
155
157
  *
@@ -163,7 +165,8 @@ export declare class Configs {
163
165
  * @example
164
166
  * await client.empathicVoice.configs.deleteConfig("1b60e1a0-cc59-424a-8d2c-189d354db3f3")
165
167
  */
166
- deleteConfig(id: string, requestOptions?: Configs.RequestOptions): Promise<void>;
168
+ deleteConfig(id: string, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<void>;
169
+ private __deleteConfig;
167
170
  /**
168
171
  * Updates the name of a **Config**.
169
172
  *
@@ -180,7 +183,8 @@ export declare class Configs {
180
183
  * name: "Updated Weather Assistant Config Name"
181
184
  * })
182
185
  */
183
- updateConfigName(id: string, request: Hume.empathicVoice.PostedConfigName, requestOptions?: Configs.RequestOptions): Promise<string>;
186
+ updateConfigName(id: string, request: Hume.empathicVoice.PostedConfigName, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<string>;
187
+ private __updateConfigName;
184
188
  /**
185
189
  * Fetches a specified version of a **Config**.
186
190
  *
@@ -199,7 +203,8 @@ export declare class Configs {
199
203
  * @example
200
204
  * await client.empathicVoice.configs.getConfigVersion("1b60e1a0-cc59-424a-8d2c-189d354db3f3", 1)
201
205
  */
202
- getConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): Promise<Hume.empathicVoice.ReturnConfig>;
206
+ getConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
207
+ private __getConfigVersion;
203
208
  /**
204
209
  * Deletes a specified version of a **Config**.
205
210
  *
@@ -218,7 +223,8 @@ export declare class Configs {
218
223
  * @example
219
224
  * await client.empathicVoice.configs.deleteConfigVersion("1b60e1a0-cc59-424a-8d2c-189d354db3f3", 1)
220
225
  */
221
- deleteConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): Promise<void>;
226
+ deleteConfigVersion(id: string, version: number, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<void>;
227
+ private __deleteConfigVersion;
222
228
  /**
223
229
  * Updates the description of a **Config**.
224
230
  *
@@ -240,7 +246,8 @@ export declare class Configs {
240
246
  * versionDescription: "This is an updated version_description."
241
247
  * })
242
248
  */
243
- updateConfigDescription(id: string, version: number, request?: Hume.empathicVoice.PostedConfigVersionDescription, requestOptions?: Configs.RequestOptions): Promise<Hume.empathicVoice.ReturnConfig>;
249
+ updateConfigDescription(id: string, version: number, request?: Hume.empathicVoice.PostedConfigVersionDescription, requestOptions?: Configs.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnConfig>;
250
+ private __updateConfigDescription;
244
251
  protected _getCustomAuthorizationHeaders(): Promise<{
245
252
  "X-Hume-Api-Key": string | undefined;
246
253
  }>;