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
@@ -21,6 +21,7 @@ export declare class Node18FormData implements CrossPlatformFormData {
21
21
  private fd;
22
22
  setup(): Promise<void>;
23
23
  append(key: string, value: any): void;
24
+ private getFileName;
24
25
  appendFile(key: string, value: unknown, fileName?: string): Promise<void>;
25
26
  getRequest(): Promise<FormDataRequest<unknown>>;
26
27
  }
@@ -41,6 +42,7 @@ export declare class Node16FormData implements CrossPlatformFormData {
41
42
  private fd;
42
43
  setup(): Promise<void>;
43
44
  append(key: string, value: any): void;
45
+ private getFileName;
44
46
  appendFile(key: string, value: unknown, fileName?: string): Promise<void>;
45
47
  getRequest(): FormDataRequest<Node16FormDataFd>;
46
48
  }
@@ -54,6 +56,7 @@ export declare class WebFormData implements CrossPlatformFormData {
54
56
  protected fd: WebFormDataFd;
55
57
  setup(): Promise<void>;
56
58
  append(key: string, value: any): void;
59
+ private getFileName;
57
60
  appendFile(key: string, value: any, fileName?: string): Promise<void>;
58
61
  getRequest(): FormDataRequest<WebFormDataFd>;
59
62
  }
@@ -48,6 +48,15 @@ const runtime_1 = require("../runtime");
48
48
  function isNamedValue(value) {
49
49
  return typeof value === "object" && value != null && "name" in value;
50
50
  }
51
+ function isPathedValue(value) {
52
+ return typeof value === "object" && value != null && "path" in value;
53
+ }
54
+ function getLastPathSegment(pathStr) {
55
+ const lastForwardSlash = pathStr.lastIndexOf("/");
56
+ const lastBackSlash = pathStr.lastIndexOf("\\");
57
+ const lastSlashIndex = Math.max(lastForwardSlash, lastBackSlash);
58
+ return lastSlashIndex >= 0 ? pathStr.substring(lastSlashIndex + 1) : pathStr;
59
+ }
51
60
  function newFormData() {
52
61
  return __awaiter(this, void 0, void 0, function* () {
53
62
  let formdata;
@@ -77,12 +86,22 @@ class Node18FormData {
77
86
  var _a;
78
87
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
79
88
  }
89
+ getFileName(value, filename) {
90
+ if (filename != null) {
91
+ return filename;
92
+ }
93
+ if (isNamedValue(value)) {
94
+ return value.name;
95
+ }
96
+ if (isPathedValue(value) && value.path) {
97
+ return getLastPathSegment(value.path.toString());
98
+ }
99
+ return undefined;
100
+ }
80
101
  appendFile(key, value, fileName) {
81
102
  return __awaiter(this, void 0, void 0, function* () {
82
103
  var _a, _b;
83
- if (fileName == null && isNamedValue(value)) {
84
- fileName = value.name;
85
- }
104
+ fileName = this.getFileName(value, fileName);
86
105
  if (value instanceof Blob) {
87
106
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
88
107
  }
@@ -123,12 +142,22 @@ class Node16FormData {
123
142
  var _a;
124
143
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
125
144
  }
145
+ getFileName(value, filename) {
146
+ if (filename != null) {
147
+ return filename;
148
+ }
149
+ if (isNamedValue(value)) {
150
+ return value.name;
151
+ }
152
+ if (isPathedValue(value) && value.path) {
153
+ return getLastPathSegment(value.path.toString());
154
+ }
155
+ return undefined;
156
+ }
126
157
  appendFile(key, value, fileName) {
127
158
  return __awaiter(this, void 0, void 0, function* () {
128
159
  var _a, _b;
129
- if (fileName == null && isNamedValue(value)) {
130
- fileName = value.name;
131
- }
160
+ fileName = this.getFileName(value, fileName);
132
161
  let bufferedValue;
133
162
  if (value instanceof Blob) {
134
163
  bufferedValue = Buffer.from(yield value.arrayBuffer());
@@ -165,12 +194,22 @@ class WebFormData {
165
194
  var _a;
166
195
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value);
167
196
  }
197
+ getFileName(value, filename) {
198
+ if (filename != null) {
199
+ return filename;
200
+ }
201
+ if (isNamedValue(value)) {
202
+ return value.name;
203
+ }
204
+ if (isPathedValue(value) && value.path) {
205
+ return getLastPathSegment(value.path.toString());
206
+ }
207
+ return undefined;
208
+ }
168
209
  appendFile(key, value, fileName) {
169
210
  return __awaiter(this, void 0, void 0, function* () {
170
211
  var _a, _b;
171
- if (fileName == null && isNamedValue(value)) {
172
- fileName = value.name;
173
- }
212
+ fileName = this.getFileName(value, fileName);
174
213
  if (value instanceof Blob) {
175
214
  (_a = this.fd) === null || _a === void 0 ? void 0 : _a.append(key, value, fileName);
176
215
  return;
@@ -1,3 +1,4 @@
1
+ import { HttpResponsePromise, RawResponse } from "../fetcher";
1
2
  /**
2
3
  * A page of results from a paginated API.
3
4
  *
@@ -5,15 +6,17 @@
5
6
  */
6
7
  export declare class Page<T> implements AsyncIterable<T> {
7
8
  data: T[];
9
+ rawResponse: RawResponse;
8
10
  private response;
9
11
  private _hasNextPage;
10
12
  private getItems;
11
13
  private loadNextPage;
12
- constructor({ response, hasNextPage, getItems, loadPage, }: {
14
+ constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }: {
13
15
  response: unknown;
16
+ rawResponse: RawResponse;
14
17
  hasNextPage: (response: unknown) => boolean;
15
18
  getItems: (response: unknown) => T[];
16
- loadPage: (response: unknown) => Promise<any>;
19
+ loadPage: (response: unknown) => HttpResponsePromise<any>;
17
20
  });
18
21
  /**
19
22
  * Retrieves the next page
@@ -36,8 +36,9 @@ exports.Page = void 0;
36
36
  * @template T The type of the items in the page.
37
37
  */
38
38
  class Page {
39
- constructor({ response, hasNextPage, getItems, loadPage, }) {
39
+ constructor({ response, rawResponse, hasNextPage, getItems, loadPage, }) {
40
40
  this.response = response;
41
+ this.rawResponse = rawResponse;
41
42
  this.data = getItems(response);
42
43
  this._hasNextPage = hasNextPage;
43
44
  this.getItems = getItems;
@@ -49,7 +50,9 @@ class Page {
49
50
  */
50
51
  getNextPage() {
51
52
  return __awaiter(this, void 0, void 0, function* () {
52
- this.response = yield this.loadNextPage(this.response);
53
+ const { data, rawResponse } = yield this.loadNextPage(this.response).withRawResponse();
54
+ this.response = data;
55
+ this.rawResponse = rawResponse;
53
56
  this.data = this.getItems(this.response);
54
57
  return this;
55
58
  });
@@ -1,7 +1,9 @@
1
+ import { RawResponse } from "../fetcher";
1
2
  import { Page } from "./Page";
2
3
  export declare namespace Pageable {
3
4
  interface Args<Response, Item> {
4
5
  response: Response;
6
+ rawResponse: RawResponse;
5
7
  hasNextPage: (response: Response) => boolean;
6
8
  getItems: (response: Response) => Item[];
7
9
  loadPage: (response: Response) => Promise<Response>;
package/dist/Client.d.ts CHANGED
@@ -1,12 +1,14 @@
1
1
  /** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
2
2
  import * as environments from "./environments";
3
3
  import * as core from "./core";
4
- import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
5
- import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
6
4
  import { Tts } from "./api/resources/tts/client/Client";
5
+ import { EmpathicVoice } from "./api/resources/empathicVoice/client/Client";
6
+ import { ExpressionMeasurement } from "./api/resources/expressionMeasurement/client/Client";
7
7
  export declare namespace HumeClient {
8
8
  interface Options {
9
9
  environment?: core.Supplier<environments.HumeEnvironment | string>;
10
+ /** Specify a custom URL to connect the client to. */
11
+ baseUrl?: core.Supplier<string>;
10
12
  apiKey?: core.Supplier<string | undefined>;
11
13
  accessToken?: core.Supplier<string | undefined>;
12
14
  fetcher?: core.FetchFunction;
@@ -18,15 +20,17 @@ export declare namespace HumeClient {
18
20
  maxRetries?: number;
19
21
  /** A hook to abort the request. */
20
22
  abortSignal?: AbortSignal;
23
+ /** Additional headers to include in the request. */
24
+ headers?: Record<string, string>;
21
25
  }
22
26
  }
23
27
  export declare class HumeClient {
24
28
  protected readonly _options: HumeClient.Options;
25
- constructor(_options?: HumeClient.Options);
26
- protected _expressionMeasurement: ExpressionMeasurement | undefined;
27
- get expressionMeasurement(): ExpressionMeasurement;
28
- protected _empathicVoice: EmpathicVoice | undefined;
29
- get empathicVoice(): EmpathicVoice;
30
29
  protected _tts: Tts | undefined;
30
+ protected _empathicVoice: EmpathicVoice | undefined;
31
+ protected _expressionMeasurement: ExpressionMeasurement | undefined;
32
+ constructor(_options?: HumeClient.Options);
31
33
  get tts(): Tts;
34
+ get empathicVoice(): EmpathicVoice;
35
+ get expressionMeasurement(): ExpressionMeasurement;
32
36
  }
package/dist/Client.js CHANGED
@@ -1,25 +1,73 @@
1
1
  "use strict";
2
2
  /** THIS FILE IS MANUALLY MAINAINED: see .fernignore */
3
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
4
+ if (k2 === undefined) k2 = k;
5
+ var desc = Object.getOwnPropertyDescriptor(m, k);
6
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
7
+ desc = { enumerable: true, get: function() { return m[k]; } };
8
+ }
9
+ Object.defineProperty(o, k2, desc);
10
+ }) : (function(o, m, k, k2) {
11
+ if (k2 === undefined) k2 = k;
12
+ o[k2] = m[k];
13
+ }));
14
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
15
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
16
+ }) : function(o, v) {
17
+ o["default"] = v;
18
+ });
19
+ var __importStar = (this && this.__importStar) || (function () {
20
+ var ownKeys = function(o) {
21
+ ownKeys = Object.getOwnPropertyNames || function (o) {
22
+ var ar = [];
23
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
24
+ return ar;
25
+ };
26
+ return ownKeys(o);
27
+ };
28
+ return function (mod) {
29
+ if (mod && mod.__esModule) return mod;
30
+ var result = {};
31
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
32
+ __setModuleDefault(result, mod);
33
+ return result;
34
+ };
35
+ })();
3
36
  Object.defineProperty(exports, "__esModule", { value: true });
4
37
  exports.HumeClient = void 0;
5
- const Client_1 = require("./api/resources/expressionMeasurement/client/Client");
38
+ const core = __importStar(require("./core"));
39
+ const Client_1 = require("./api/resources/tts/client/Client");
6
40
  const Client_2 = require("./api/resources/empathicVoice/client/Client");
7
- const Client_3 = require("./api/resources/tts/client/Client");
41
+ const Client_3 = require("./api/resources/expressionMeasurement/client/Client");
42
+ const version_1 = require("./version");
43
+ const fetcherThatAddsHeaders = (fetcherToWrap) => {
44
+ return (args) => {
45
+ var _a;
46
+ const newArgs = Object.assign({}, args);
47
+ newArgs.headers = (_a = newArgs.headers) !== null && _a !== void 0 ? _a : {};
48
+ (newArgs.headers["X-Hume-Client-Name"] = "typescript_sdk"),
49
+ (newArgs.headers["X-Hume-Client-Version"] = version_1.SDK_VERSION);
50
+ return fetcherToWrap(args);
51
+ };
52
+ };
8
53
  class HumeClient {
9
54
  constructor(_options = {}) {
55
+ var _a;
10
56
  this._options = _options;
57
+ const defaultFetcher = (_a = _options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher;
58
+ this._options.fetcher = fetcherThatAddsHeaders(defaultFetcher);
11
59
  }
12
- get expressionMeasurement() {
60
+ get tts() {
13
61
  var _a;
14
- return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_1.ExpressionMeasurement(this._options)));
62
+ return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_1.Tts(this._options)));
15
63
  }
16
64
  get empathicVoice() {
17
65
  var _a;
18
66
  return ((_a = this._empathicVoice) !== null && _a !== void 0 ? _a : (this._empathicVoice = new Client_2.EmpathicVoice(this._options)));
19
67
  }
20
- get tts() {
68
+ get expressionMeasurement() {
21
69
  var _a;
22
- return ((_a = this._tts) !== null && _a !== void 0 ? _a : (this._tts = new Client_3.Tts(this._options)));
70
+ return ((_a = this._expressionMeasurement) !== null && _a !== void 0 ? _a : (this._expressionMeasurement = new Client_3.ExpressionMeasurement(this._options)));
23
71
  }
24
72
  }
25
73
  exports.HumeClient = HumeClient;
@@ -3,6 +3,7 @@
3
3
  */
4
4
  import * as errors from "../../../../errors/index";
5
5
  import * as Hume from "../../../index";
6
+ import * as core from "../../../../core";
6
7
  export declare class BadRequestError extends errors.HumeError {
7
- constructor(body: Hume.empathicVoice.ErrorResponse);
8
+ constructor(body: Hume.empathicVoice.ErrorResponse, rawResponse?: core.RawResponse);
8
9
  }
@@ -39,11 +39,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
39
39
  exports.BadRequestError = void 0;
40
40
  const errors = __importStar(require("../../../../errors/index"));
41
41
  class BadRequestError extends errors.HumeError {
42
- constructor(body) {
42
+ constructor(body, rawResponse) {
43
43
  super({
44
44
  message: "BadRequestError",
45
45
  statusCode: 400,
46
46
  body: body,
47
+ rawResponse: rawResponse,
47
48
  });
48
49
  Object.setPrototypeOf(this, BadRequestError.prototype);
49
50
  }
@@ -59,7 +59,8 @@ export declare class ChatGroups {
59
59
  * ascendingOrder: true
60
60
  * })
61
61
  */
62
- getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
62
+ getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
63
+ private __getChatGroup;
63
64
  /**
64
65
  * Fetches a paginated list of **Chat** events associated with a **Chat Group**.
65
66
  *
@@ -93,7 +94,8 @@ export declare class ChatGroups {
93
94
  * ascendingOrder: true
94
95
  * })
95
96
  */
96
- getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
97
+ getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
98
+ private __getAudio;
97
99
  protected _getCustomAuthorizationHeaders(): Promise<{
98
100
  "X-Hume-Api-Key": string | undefined;
99
101
  }>;
@@ -77,7 +77,7 @@ class ChatGroups {
77
77
  */
78
78
  listChatGroups() {
79
79
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
80
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
80
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
81
81
  var _a, _b, _c;
82
82
  const { pageNumber, pageSize, ascendingOrder, configId } = request;
83
83
  const _queryParams = {};
@@ -96,7 +96,7 @@ class ChatGroups {
96
96
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
97
97
  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/chat_groups"),
98
98
  method: "GET",
99
- 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),
99
+ 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),
100
100
  contentType: "application/json",
101
101
  queryParameters: _queryParams,
102
102
  requestType: "json",
@@ -105,12 +105,15 @@ class ChatGroups {
105
105
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
106
106
  });
107
107
  if (_response.ok) {
108
- return serializers.empathicVoice.ReturnPagedChatGroups.parseOrThrow(_response.body, {
109
- unrecognizedObjectKeys: "passthrough",
110
- allowUnrecognizedUnionMembers: true,
111
- allowUnrecognizedEnumValues: true,
112
- breadcrumbsPrefix: ["response"],
113
- });
108
+ return {
109
+ data: serializers.empathicVoice.ReturnPagedChatGroups.parseOrThrow(_response.body, {
110
+ unrecognizedObjectKeys: "passthrough",
111
+ allowUnrecognizedUnionMembers: true,
112
+ allowUnrecognizedEnumValues: true,
113
+ breadcrumbsPrefix: ["response"],
114
+ }),
115
+ rawResponse: _response.rawResponse,
116
+ };
114
117
  }
115
118
  if (_response.error.reason === "status-code") {
116
119
  switch (_response.error.statusCode) {
@@ -120,11 +123,12 @@ class ChatGroups {
120
123
  allowUnrecognizedUnionMembers: true,
121
124
  allowUnrecognizedEnumValues: true,
122
125
  breadcrumbsPrefix: ["response"],
123
- }));
126
+ }), _response.rawResponse);
124
127
  default:
125
128
  throw new errors.HumeError({
126
129
  statusCode: _response.error.statusCode,
127
130
  body: _response.error.body,
131
+ rawResponse: _response.rawResponse,
128
132
  });
129
133
  }
130
134
  }
@@ -133,18 +137,22 @@ class ChatGroups {
133
137
  throw new errors.HumeError({
134
138
  statusCode: _response.error.statusCode,
135
139
  body: _response.error.rawBody,
140
+ rawResponse: _response.rawResponse,
136
141
  });
137
142
  case "timeout":
138
143
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups.");
139
144
  case "unknown":
140
145
  throw new errors.HumeError({
141
146
  message: _response.error.errorMessage,
147
+ rawResponse: _response.rawResponse,
142
148
  });
143
149
  }
144
- });
150
+ }));
145
151
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
152
+ const dataWithRawResponse = yield list(request).withRawResponse();
146
153
  return new core.Pageable({
147
- response: yield list(request),
154
+ response: dataWithRawResponse.data,
155
+ rawResponse: dataWithRawResponse.rawResponse,
148
156
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
149
157
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []; },
150
158
  loadPage: (_response) => {
@@ -170,7 +178,10 @@ class ChatGroups {
170
178
  * ascendingOrder: true
171
179
  * })
172
180
  */
173
- getChatGroup(id_1) {
181
+ getChatGroup(id, request = {}, requestOptions) {
182
+ return core.HttpResponsePromise.fromPromise(this.__getChatGroup(id, request, requestOptions));
183
+ }
184
+ __getChatGroup(id_1) {
174
185
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
175
186
  var _a, _b, _c;
176
187
  const { pageSize, pageNumber, ascendingOrder } = request;
@@ -187,7 +198,7 @@ class ChatGroups {
187
198
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
188
199
  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/chat_groups/${encodeURIComponent(id)}`),
189
200
  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),
201
+ 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
202
  contentType: "application/json",
192
203
  queryParameters: _queryParams,
193
204
  requestType: "json",
@@ -196,12 +207,15 @@ class ChatGroups {
196
207
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
197
208
  });
198
209
  if (_response.ok) {
199
- return serializers.empathicVoice.ReturnChatGroupPagedChats.parseOrThrow(_response.body, {
200
- unrecognizedObjectKeys: "passthrough",
201
- allowUnrecognizedUnionMembers: true,
202
- allowUnrecognizedEnumValues: true,
203
- breadcrumbsPrefix: ["response"],
204
- });
210
+ return {
211
+ data: serializers.empathicVoice.ReturnChatGroupPagedChats.parseOrThrow(_response.body, {
212
+ unrecognizedObjectKeys: "passthrough",
213
+ allowUnrecognizedUnionMembers: true,
214
+ allowUnrecognizedEnumValues: true,
215
+ breadcrumbsPrefix: ["response"],
216
+ }),
217
+ rawResponse: _response.rawResponse,
218
+ };
205
219
  }
206
220
  if (_response.error.reason === "status-code") {
207
221
  switch (_response.error.statusCode) {
@@ -211,11 +225,12 @@ class ChatGroups {
211
225
  allowUnrecognizedUnionMembers: true,
212
226
  allowUnrecognizedEnumValues: true,
213
227
  breadcrumbsPrefix: ["response"],
214
- }));
228
+ }), _response.rawResponse);
215
229
  default:
216
230
  throw new errors.HumeError({
217
231
  statusCode: _response.error.statusCode,
218
232
  body: _response.error.body,
233
+ rawResponse: _response.rawResponse,
219
234
  });
220
235
  }
221
236
  }
@@ -224,12 +239,14 @@ class ChatGroups {
224
239
  throw new errors.HumeError({
225
240
  statusCode: _response.error.statusCode,
226
241
  body: _response.error.rawBody,
242
+ rawResponse: _response.rawResponse,
227
243
  });
228
244
  case "timeout":
229
245
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}.");
230
246
  case "unknown":
231
247
  throw new errors.HumeError({
232
248
  message: _response.error.errorMessage,
249
+ rawResponse: _response.rawResponse,
233
250
  });
234
251
  }
235
252
  });
@@ -252,7 +269,7 @@ class ChatGroups {
252
269
  */
253
270
  listChatGroupEvents(id_1) {
254
271
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
255
- const list = (request) => __awaiter(this, void 0, void 0, function* () {
272
+ const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
256
273
  var _a, _b, _c;
257
274
  const { pageSize, pageNumber, ascendingOrder } = request;
258
275
  const _queryParams = {};
@@ -268,7 +285,7 @@ class ChatGroups {
268
285
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
269
286
  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/chat_groups/${encodeURIComponent(id)}/events`),
270
287
  method: "GET",
271
- 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),
288
+ 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),
272
289
  contentType: "application/json",
273
290
  queryParameters: _queryParams,
274
291
  requestType: "json",
@@ -277,12 +294,15 @@ class ChatGroups {
277
294
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
278
295
  });
279
296
  if (_response.ok) {
280
- return serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
281
- unrecognizedObjectKeys: "passthrough",
282
- allowUnrecognizedUnionMembers: true,
283
- allowUnrecognizedEnumValues: true,
284
- breadcrumbsPrefix: ["response"],
285
- });
297
+ return {
298
+ data: serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
299
+ unrecognizedObjectKeys: "passthrough",
300
+ allowUnrecognizedUnionMembers: true,
301
+ allowUnrecognizedEnumValues: true,
302
+ breadcrumbsPrefix: ["response"],
303
+ }),
304
+ rawResponse: _response.rawResponse,
305
+ };
286
306
  }
287
307
  if (_response.error.reason === "status-code") {
288
308
  switch (_response.error.statusCode) {
@@ -292,11 +312,12 @@ class ChatGroups {
292
312
  allowUnrecognizedUnionMembers: true,
293
313
  allowUnrecognizedEnumValues: true,
294
314
  breadcrumbsPrefix: ["response"],
295
- }));
315
+ }), _response.rawResponse);
296
316
  default:
297
317
  throw new errors.HumeError({
298
318
  statusCode: _response.error.statusCode,
299
319
  body: _response.error.body,
320
+ rawResponse: _response.rawResponse,
300
321
  });
301
322
  }
302
323
  }
@@ -305,18 +326,22 @@ class ChatGroups {
305
326
  throw new errors.HumeError({
306
327
  statusCode: _response.error.statusCode,
307
328
  body: _response.error.rawBody,
329
+ rawResponse: _response.rawResponse,
308
330
  });
309
331
  case "timeout":
310
332
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/events.");
311
333
  case "unknown":
312
334
  throw new errors.HumeError({
313
335
  message: _response.error.errorMessage,
336
+ rawResponse: _response.rawResponse,
314
337
  });
315
338
  }
316
- });
339
+ }));
317
340
  let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
341
+ const dataWithRawResponse = yield list(request).withRawResponse();
318
342
  return new core.Pageable({
319
- response: yield list(request),
343
+ response: dataWithRawResponse.data,
344
+ rawResponse: dataWithRawResponse.rawResponse,
320
345
  hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
321
346
  getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
322
347
  loadPage: (_response) => {
@@ -342,7 +367,10 @@ class ChatGroups {
342
367
  * ascendingOrder: true
343
368
  * })
344
369
  */
345
- getAudio(id_1) {
370
+ getAudio(id, request = {}, requestOptions) {
371
+ return core.HttpResponsePromise.fromPromise(this.__getAudio(id, request, requestOptions));
372
+ }
373
+ __getAudio(id_1) {
346
374
  return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
347
375
  var _a, _b, _c;
348
376
  const { pageNumber, pageSize, ascendingOrder } = request;
@@ -359,7 +387,7 @@ class ChatGroups {
359
387
  const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
360
388
  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/chat_groups/${encodeURIComponent(id)}/audio`),
361
389
  method: "GET",
362
- 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),
390
+ 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),
363
391
  contentType: "application/json",
364
392
  queryParameters: _queryParams,
365
393
  requestType: "json",
@@ -368,12 +396,15 @@ class ChatGroups {
368
396
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
369
397
  });
370
398
  if (_response.ok) {
371
- return serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
372
- unrecognizedObjectKeys: "passthrough",
373
- allowUnrecognizedUnionMembers: true,
374
- allowUnrecognizedEnumValues: true,
375
- breadcrumbsPrefix: ["response"],
376
- });
399
+ return {
400
+ data: serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
401
+ unrecognizedObjectKeys: "passthrough",
402
+ allowUnrecognizedUnionMembers: true,
403
+ allowUnrecognizedEnumValues: true,
404
+ breadcrumbsPrefix: ["response"],
405
+ }),
406
+ rawResponse: _response.rawResponse,
407
+ };
377
408
  }
378
409
  if (_response.error.reason === "status-code") {
379
410
  switch (_response.error.statusCode) {
@@ -383,11 +414,12 @@ class ChatGroups {
383
414
  allowUnrecognizedUnionMembers: true,
384
415
  allowUnrecognizedEnumValues: true,
385
416
  breadcrumbsPrefix: ["response"],
386
- }));
417
+ }), _response.rawResponse);
387
418
  default:
388
419
  throw new errors.HumeError({
389
420
  statusCode: _response.error.statusCode,
390
421
  body: _response.error.body,
422
+ rawResponse: _response.rawResponse,
391
423
  });
392
424
  }
393
425
  }
@@ -396,12 +428,14 @@ class ChatGroups {
396
428
  throw new errors.HumeError({
397
429
  statusCode: _response.error.statusCode,
398
430
  body: _response.error.rawBody,
431
+ rawResponse: _response.rawResponse,
399
432
  });
400
433
  case "timeout":
401
434
  throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/audio.");
402
435
  case "unknown":
403
436
  throw new errors.HumeError({
404
437
  message: _response.error.errorMessage,
438
+ rawResponse: _response.rawResponse,
405
439
  });
406
440
  }
407
441
  });