hume 0.11.1 → 0.11.3
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.
- package/.mock/definition/empathic-voice/__package__.yml +24 -0
- package/.mock/definition/empathic-voice/configs.yml +2 -0
- package/.mock/definition/tts/__package__.yml +28 -0
- package/.mock/fern.config.json +1 -1
- package/Client.d.ts +11 -7
- package/Client.js +54 -6
- package/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
- package/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
- package/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
- package/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
- package/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
- package/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/api/resources/empathicVoice/types/index.js +2 -0
- package/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
- package/api/resources/tts/client/Client.d.ts +27 -19
- package/api/resources/tts/client/Client.js +89 -50
- package/api/resources/tts/client/index.d.ts +1 -1
- package/api/resources/tts/client/index.js +15 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/api/resources/tts/client/requests/index.d.ts +1 -0
- package/api/resources/tts/client/requests/index.js +2 -0
- package/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/api/resources/tts/errors/BadRequestError.js +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
- package/api/resources/tts/resources/voices/client/Client.js +49 -29
- package/api/resources/tts/types/Snippet.d.ts +2 -0
- package/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/core/fetcher/APIResponse.d.ts +10 -0
- package/core/fetcher/Fetcher.d.ts +2 -1
- package/core/fetcher/Fetcher.js +29 -9
- package/core/fetcher/Headers.d.ts +2 -0
- package/core/fetcher/Headers.js +84 -0
- package/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/core/fetcher/HttpResponsePromise.js +103 -0
- package/core/fetcher/RawResponse.d.ts +29 -0
- package/core/fetcher/RawResponse.js +44 -0
- package/core/fetcher/index.d.ts +3 -0
- package/core/fetcher/index.js +7 -1
- package/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/core/form-data-utils/FormDataWrapper.js +53 -13
- package/core/form-data-utils/toReadableStream.d.ts +1 -0
- package/core/form-data-utils/toReadableStream.js +50 -0
- package/core/headers.d.ts +3 -0
- package/core/headers.js +29 -0
- package/core/index.d.ts +4 -4
- package/core/index.js +5 -4
- package/core/pagination/Page.d.ts +5 -2
- package/core/pagination/Page.js +5 -2
- package/core/pagination/Pageable.d.ts +2 -0
- package/core/runtime/runtime.js +0 -1
- package/dist/Client.d.ts +11 -7
- package/dist/Client.js +54 -6
- package/dist/api/resources/empathicVoice/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/empathicVoice/errors/BadRequestError.js +2 -1
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +7 -3
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +79 -52
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +5 -2
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +59 -39
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +17 -8
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +144 -83
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +1 -0
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.d.ts +13 -6
- package/dist/api/resources/empathicVoice/resources/customVoices/client/Client.js +95 -53
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -9
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +143 -81
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +17 -8
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +144 -83
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/PostedNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/ReturnConfig.d.ts +1 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +12 -0
- package/dist/api/resources/empathicVoice/types/ReturnNudgeSpec.js +5 -0
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +2 -1
- package/dist/api/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/api/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/api/resources/empathicVoice/types/index.js +2 -0
- package/dist/api/resources/expressionMeasurement/client/Client.d.ts +2 -0
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +15 -7
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +96 -52
- package/dist/api/resources/tts/client/Client.d.ts +27 -19
- package/dist/api/resources/tts/client/Client.js +89 -50
- package/dist/api/resources/tts/client/index.d.ts +1 -1
- package/dist/api/resources/tts/client/index.js +15 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.d.ts +36 -0
- package/dist/api/resources/tts/client/requests/SynthesizeJsonRequest.js +5 -0
- package/dist/api/resources/tts/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tts/client/requests/index.js +2 -0
- package/dist/api/resources/tts/errors/BadRequestError.d.ts +2 -1
- package/dist/api/resources/tts/errors/BadRequestError.js +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.d.ts +2 -1
- package/dist/api/resources/tts/errors/UnprocessableEntityError.js +2 -1
- package/dist/api/resources/tts/resources/voices/client/Client.d.ts +7 -3
- package/dist/api/resources/tts/resources/voices/client/Client.js +49 -29
- package/dist/api/resources/tts/types/Snippet.d.ts +2 -0
- package/dist/api/resources/tts/types/SnippetAudioChunk.d.ts +2 -0
- package/dist/core/fetcher/APIResponse.d.ts +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +2 -1
- package/dist/core/fetcher/Fetcher.js +29 -9
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +84 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +103 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +44 -0
- package/dist/core/fetcher/index.d.ts +3 -0
- package/dist/core/fetcher/index.js +7 -1
- package/dist/core/form-data-utils/FormDataWrapper.d.ts +3 -0
- package/dist/core/form-data-utils/FormDataWrapper.js +53 -13
- package/dist/core/form-data-utils/toReadableStream.d.ts +1 -0
- package/dist/core/form-data-utils/toReadableStream.js +50 -0
- package/dist/core/headers.d.ts +3 -0
- package/dist/core/headers.js +29 -0
- package/dist/core/index.d.ts +4 -4
- package/dist/core/index.js +5 -4
- package/dist/core/pagination/Page.d.ts +5 -2
- package/dist/core/pagination/Page.js +5 -2
- package/dist/core/pagination/Pageable.d.ts +2 -0
- package/dist/core/runtime/runtime.js +0 -1
- package/dist/errors/HumeError.d.ts +7 -2
- package/dist/errors/HumeError.js +10 -10
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/dist/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/dist/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/dist/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/dist/serialization/resources/empathicVoice/types/index.js +2 -0
- package/dist/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/dist/serialization/resources/tts/types/Snippet.js +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/dist/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/dist/version.d.ts +1 -1
- package/dist/version.js +1 -1
- package/dist/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/dist/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
- package/errors/HumeError.d.ts +7 -2
- package/errors/HumeError.js +10 -10
- package/package.json +9 -4
- package/reference.md +17 -15
- package/scripts/rename-to-esm-files.js +10 -2
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfig.js +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +2 -0
- package/serialization/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.js +2 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/PostedNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/ReturnConfig.js +2 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.d.ts +13 -0
- package/serialization/resources/empathicVoice/types/ReturnNudgeSpec.js +44 -0
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.d.ts +1 -1
- package/serialization/resources/empathicVoice/types/WebhookEventChatStatus.js +1 -0
- package/serialization/resources/empathicVoice/types/index.d.ts +2 -0
- package/serialization/resources/empathicVoice/types/index.js +2 -0
- package/serialization/resources/tts/types/Snippet.d.ts +1 -0
- package/serialization/resources/tts/types/Snippet.js +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.d.ts +1 -0
- package/serialization/resources/tts/types/SnippetAudioChunk.js +1 -0
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/wrapper/expressionMeasurement/ExpressionMeasurementClient.js +2 -0
- package/wrapper/expressionMeasurement/batch/BatchClient.d.ts +2 -1
- package/wrapper/expressionMeasurement/batch/BatchClient.js +43 -17
- /package/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/core/{streaming-fetcher → stream}/index.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/Stream.js +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.d.ts +0 -0
- /package/dist/core/{streaming-fetcher → stream}/index.js +0 -0
|
@@ -1182,6 +1182,7 @@ types:
|
|
|
1182
1182
|
- USER_TIMEOUT
|
|
1183
1183
|
- INACTIVITY_TIMEOUT
|
|
1184
1184
|
- MAX_DURATION_TIMEOUT
|
|
1185
|
+
- SILENCE_TIMEOUT
|
|
1185
1186
|
- ERROR
|
|
1186
1187
|
source:
|
|
1187
1188
|
openapi: evi-openapi.json
|
|
@@ -1869,6 +1870,7 @@ types:
|
|
|
1869
1870
|
docs: List of built-in tools associated with this Config.
|
|
1870
1871
|
event_messages: optional<ReturnEventMessageSpecs>
|
|
1871
1872
|
timeouts: optional<ReturnTimeoutSpecs>
|
|
1873
|
+
nudges: optional<ReturnNudgeSpec>
|
|
1872
1874
|
webhooks:
|
|
1873
1875
|
type: optional<list<optional<ReturnWebhookSpec>>>
|
|
1874
1876
|
docs: Map of webhooks associated with this config.
|
|
@@ -2564,6 +2566,17 @@ types:
|
|
|
2564
2566
|
the time limit for the chat has been reached.
|
|
2565
2567
|
source:
|
|
2566
2568
|
openapi: evi-openapi.json
|
|
2569
|
+
PostedNudgeSpec:
|
|
2570
|
+
docs: A nudge specification posted to the server
|
|
2571
|
+
properties:
|
|
2572
|
+
enabled:
|
|
2573
|
+
type: optional<boolean>
|
|
2574
|
+
docs: EVI will nudge user after inactivity
|
|
2575
|
+
interval_secs:
|
|
2576
|
+
type: optional<integer>
|
|
2577
|
+
docs: Time interval in seconds after which the nudge will be sent.
|
|
2578
|
+
source:
|
|
2579
|
+
openapi: evi-openapi.json
|
|
2567
2580
|
PostedTimeoutSpecsInactivity:
|
|
2568
2581
|
docs: >-
|
|
2569
2582
|
Specifies the duration of user inactivity (in seconds) after which the EVI
|
|
@@ -2815,6 +2828,17 @@ types:
|
|
|
2815
2828
|
seconds.
|
|
2816
2829
|
source:
|
|
2817
2830
|
openapi: evi-openapi.json
|
|
2831
|
+
ReturnNudgeSpec:
|
|
2832
|
+
docs: A specific nudge configuration returned from the server
|
|
2833
|
+
properties:
|
|
2834
|
+
enabled:
|
|
2835
|
+
type: boolean
|
|
2836
|
+
docs: EVI will nudge user after inactivity
|
|
2837
|
+
interval_secs:
|
|
2838
|
+
type: optional<integer>
|
|
2839
|
+
docs: Time interval in seconds after which the nudge will be sent.
|
|
2840
|
+
source:
|
|
2841
|
+
openapi: evi-openapi.json
|
|
2818
2842
|
ReturnWebhookEventType:
|
|
2819
2843
|
enum:
|
|
2820
2844
|
- chat_started
|
|
@@ -202,6 +202,7 @@ service:
|
|
|
202
202
|
type: optional<list<optional<root.PostedBuiltinTool>>>
|
|
203
203
|
docs: List of built-in tools associated with this Config.
|
|
204
204
|
event_messages: optional<root.PostedEventMessageSpecs>
|
|
205
|
+
nudges: optional<root.PostedNudgeSpec>
|
|
205
206
|
timeouts: optional<root.PostedTimeoutSpecs>
|
|
206
207
|
webhooks:
|
|
207
208
|
type: optional<list<optional<root.PostedWebhookSpec>>>
|
|
@@ -505,6 +506,7 @@ service:
|
|
|
505
506
|
docs: List of built-in tools associated with this Config version.
|
|
506
507
|
event_messages: optional<root.PostedEventMessageSpecs>
|
|
507
508
|
timeouts: optional<root.PostedTimeoutSpecs>
|
|
509
|
+
nudges: optional<root.PostedNudgeSpec>
|
|
508
510
|
webhooks:
|
|
509
511
|
type: optional<list<optional<root.PostedWebhookSpec>>>
|
|
510
512
|
docs: Webhook config specifications for each subscriber.
|
|
@@ -34,6 +34,23 @@ service:
|
|
|
34
34
|
request:
|
|
35
35
|
body:
|
|
36
36
|
type: PostedTts
|
|
37
|
+
query-parameters:
|
|
38
|
+
access_token:
|
|
39
|
+
type: optional<string>
|
|
40
|
+
default: ''
|
|
41
|
+
docs: >-
|
|
42
|
+
Access token used for authenticating the client. If not provided,
|
|
43
|
+
an `api_key` must be provided to authenticate.
|
|
44
|
+
|
|
45
|
+
|
|
46
|
+
The access token is generated using both an API key and a Secret
|
|
47
|
+
key, which provides an additional layer of security compared to
|
|
48
|
+
using just an API key.
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
For more details, refer to the [Authentication Strategies
|
|
52
|
+
Guide](/docs/introduction/api-key#authentication-strategies).
|
|
53
|
+
name: SynthesizeJsonRequest
|
|
37
54
|
content-type: application/json
|
|
38
55
|
response:
|
|
39
56
|
docs: Successful Response
|
|
@@ -444,6 +461,11 @@ types:
|
|
|
444
461
|
text:
|
|
445
462
|
type: string
|
|
446
463
|
docs: The text for this **Snippet**.
|
|
464
|
+
transcribed_text:
|
|
465
|
+
type: optional<string>
|
|
466
|
+
docs: >-
|
|
467
|
+
The transcribed text of the generated audio. It is only present if
|
|
468
|
+
`instant_mode` is set to `false`.
|
|
447
469
|
utterance_index:
|
|
448
470
|
type: optional<integer>
|
|
449
471
|
docs: The index of the utterance in the request this snippet corresponds to.
|
|
@@ -473,6 +495,12 @@ types:
|
|
|
473
495
|
text:
|
|
474
496
|
type: string
|
|
475
497
|
docs: The text of the parent snippet that this chunk corresponds to.
|
|
498
|
+
transcribed_text:
|
|
499
|
+
type: optional<string>
|
|
500
|
+
docs: >-
|
|
501
|
+
The transcribed text of the generated audio of the parent snippet that
|
|
502
|
+
this chunk corresponds to. It is only present if `instant_mode` is set
|
|
503
|
+
to `false`.
|
|
476
504
|
utterance_index:
|
|
477
505
|
type: optional<integer>
|
|
478
506
|
docs: >-
|
package/.mock/fern.config.json
CHANGED
package/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/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
|
|
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/
|
|
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
|
|
60
|
+
get tts() {
|
|
13
61
|
var _a;
|
|
14
|
-
return ((_a = this.
|
|
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
|
|
68
|
+
get expressionMeasurement() {
|
|
21
69
|
var _a;
|
|
22
|
-
return ((_a = this.
|
|
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
|
}
|
|
@@ -10,6 +10,8 @@ export declare namespace ChatGroups {
|
|
|
10
10
|
/** Specify a custom URL to connect the client to. */
|
|
11
11
|
baseUrl?: core.Supplier<string>;
|
|
12
12
|
apiKey?: core.Supplier<string | undefined>;
|
|
13
|
+
/** Additional headers to include in requests. */
|
|
14
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
13
15
|
fetcher?: core.FetchFunction;
|
|
14
16
|
}
|
|
15
17
|
interface RequestOptions {
|
|
@@ -20,7 +22,7 @@ export declare namespace ChatGroups {
|
|
|
20
22
|
/** A hook to abort the request. */
|
|
21
23
|
abortSignal?: AbortSignal;
|
|
22
24
|
/** Additional headers to include in the request. */
|
|
23
|
-
headers?: Record<string, string>;
|
|
25
|
+
headers?: Record<string, string | core.Supplier<string | undefined> | undefined>;
|
|
24
26
|
}
|
|
25
27
|
}
|
|
26
28
|
export declare class ChatGroups {
|
|
@@ -59,7 +61,8 @@ export declare class ChatGroups {
|
|
|
59
61
|
* ascendingOrder: true
|
|
60
62
|
* })
|
|
61
63
|
*/
|
|
62
|
-
getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions):
|
|
64
|
+
getChatGroup(id: string, request?: Hume.empathicVoice.ChatGroupsGetChatGroupRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedChats>;
|
|
65
|
+
private __getChatGroup;
|
|
63
66
|
/**
|
|
64
67
|
* Fetches a paginated list of **Chat** events associated with a **Chat Group**.
|
|
65
68
|
*
|
|
@@ -93,7 +96,8 @@ export declare class ChatGroups {
|
|
|
93
96
|
* ascendingOrder: true
|
|
94
97
|
* })
|
|
95
98
|
*/
|
|
96
|
-
getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions):
|
|
99
|
+
getAudio(id: string, request?: Hume.empathicVoice.ChatGroupsGetAudioRequest, requestOptions?: ChatGroups.RequestOptions): core.HttpResponsePromise<Hume.empathicVoice.ReturnChatGroupPagedAudioReconstructions>;
|
|
100
|
+
private __getAudio;
|
|
97
101
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
98
102
|
"X-Hume-Api-Key": string | undefined;
|
|
99
103
|
}>;
|
|
@@ -52,6 +52,7 @@ exports.ChatGroups = void 0;
|
|
|
52
52
|
const environments = __importStar(require("../../../../../../environments"));
|
|
53
53
|
const core = __importStar(require("../../../../../../core"));
|
|
54
54
|
const Hume = __importStar(require("../../../../../index"));
|
|
55
|
+
const headers_js_1 = require("../../../../../../core/headers.js");
|
|
55
56
|
const url_join_1 = __importDefault(require("url-join"));
|
|
56
57
|
const serializers = __importStar(require("../../../../../../serialization/index"));
|
|
57
58
|
const errors = __importStar(require("../../../../../../errors/index"));
|
|
@@ -77,8 +78,8 @@ class ChatGroups {
|
|
|
77
78
|
*/
|
|
78
79
|
listChatGroups() {
|
|
79
80
|
return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
|
|
80
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
81
|
-
var _a, _b, _c;
|
|
81
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
var _a, _b, _c, _d;
|
|
82
83
|
const { pageNumber, pageSize, ascendingOrder, configId } = request;
|
|
83
84
|
const _queryParams = {};
|
|
84
85
|
if (pageNumber != null) {
|
|
@@ -96,21 +97,22 @@ class ChatGroups {
|
|
|
96
97
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
97
98
|
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
99
|
method: "GET",
|
|
99
|
-
headers:
|
|
100
|
-
contentType: "application/json",
|
|
100
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
101
101
|
queryParameters: _queryParams,
|
|
102
|
-
requestType: "json",
|
|
103
102
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
104
103
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
105
104
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
106
105
|
});
|
|
107
106
|
if (_response.ok) {
|
|
108
|
-
return
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
107
|
+
return {
|
|
108
|
+
data: serializers.empathicVoice.ReturnPagedChatGroups.parseOrThrow(_response.body, {
|
|
109
|
+
unrecognizedObjectKeys: "passthrough",
|
|
110
|
+
allowUnrecognizedUnionMembers: true,
|
|
111
|
+
allowUnrecognizedEnumValues: true,
|
|
112
|
+
breadcrumbsPrefix: ["response"],
|
|
113
|
+
}),
|
|
114
|
+
rawResponse: _response.rawResponse,
|
|
115
|
+
};
|
|
114
116
|
}
|
|
115
117
|
if (_response.error.reason === "status-code") {
|
|
116
118
|
switch (_response.error.statusCode) {
|
|
@@ -120,11 +122,12 @@ class ChatGroups {
|
|
|
120
122
|
allowUnrecognizedUnionMembers: true,
|
|
121
123
|
allowUnrecognizedEnumValues: true,
|
|
122
124
|
breadcrumbsPrefix: ["response"],
|
|
123
|
-
}));
|
|
125
|
+
}), _response.rawResponse);
|
|
124
126
|
default:
|
|
125
127
|
throw new errors.HumeError({
|
|
126
128
|
statusCode: _response.error.statusCode,
|
|
127
129
|
body: _response.error.body,
|
|
130
|
+
rawResponse: _response.rawResponse,
|
|
128
131
|
});
|
|
129
132
|
}
|
|
130
133
|
}
|
|
@@ -133,18 +136,22 @@ class ChatGroups {
|
|
|
133
136
|
throw new errors.HumeError({
|
|
134
137
|
statusCode: _response.error.statusCode,
|
|
135
138
|
body: _response.error.rawBody,
|
|
139
|
+
rawResponse: _response.rawResponse,
|
|
136
140
|
});
|
|
137
141
|
case "timeout":
|
|
138
142
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups.");
|
|
139
143
|
case "unknown":
|
|
140
144
|
throw new errors.HumeError({
|
|
141
145
|
message: _response.error.errorMessage,
|
|
146
|
+
rawResponse: _response.rawResponse,
|
|
142
147
|
});
|
|
143
148
|
}
|
|
144
|
-
});
|
|
149
|
+
}));
|
|
145
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();
|
|
146
152
|
return new core.Pageable({
|
|
147
|
-
response:
|
|
153
|
+
response: dataWithRawResponse.data,
|
|
154
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
148
155
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
149
156
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatGroupsPage) !== null && _a !== void 0 ? _a : []; },
|
|
150
157
|
loadPage: (_response) => {
|
|
@@ -170,9 +177,12 @@ class ChatGroups {
|
|
|
170
177
|
* ascendingOrder: true
|
|
171
178
|
* })
|
|
172
179
|
*/
|
|
173
|
-
getChatGroup(
|
|
180
|
+
getChatGroup(id, request = {}, requestOptions) {
|
|
181
|
+
return core.HttpResponsePromise.fromPromise(this.__getChatGroup(id, request, requestOptions));
|
|
182
|
+
}
|
|
183
|
+
__getChatGroup(id_1) {
|
|
174
184
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
175
|
-
var _a, _b, _c;
|
|
185
|
+
var _a, _b, _c, _d;
|
|
176
186
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
177
187
|
const _queryParams = {};
|
|
178
188
|
if (pageSize != null) {
|
|
@@ -187,21 +197,22 @@ class ChatGroups {
|
|
|
187
197
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
188
198
|
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
199
|
method: "GET",
|
|
190
|
-
headers:
|
|
191
|
-
contentType: "application/json",
|
|
200
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
192
201
|
queryParameters: _queryParams,
|
|
193
|
-
requestType: "json",
|
|
194
202
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
195
203
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
196
204
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
197
205
|
});
|
|
198
206
|
if (_response.ok) {
|
|
199
|
-
return
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
207
|
+
return {
|
|
208
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedChats.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 ChatGroups {
|
|
|
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,12 +236,14 @@ class ChatGroups {
|
|
|
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/chat_groups/{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
|
});
|
|
@@ -252,8 +266,8 @@ class ChatGroups {
|
|
|
252
266
|
*/
|
|
253
267
|
listChatGroupEvents(id_1) {
|
|
254
268
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
255
|
-
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
256
|
-
var _a, _b, _c;
|
|
269
|
+
const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
|
|
270
|
+
var _a, _b, _c, _d;
|
|
257
271
|
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
258
272
|
const _queryParams = {};
|
|
259
273
|
if (pageSize != null) {
|
|
@@ -268,21 +282,22 @@ class ChatGroups {
|
|
|
268
282
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
269
283
|
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
284
|
method: "GET",
|
|
271
|
-
headers:
|
|
272
|
-
contentType: "application/json",
|
|
285
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
273
286
|
queryParameters: _queryParams,
|
|
274
|
-
requestType: "json",
|
|
275
287
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
276
288
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
277
289
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
278
290
|
});
|
|
279
291
|
if (_response.ok) {
|
|
280
|
-
return
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
292
|
+
return {
|
|
293
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedEvents.parseOrThrow(_response.body, {
|
|
294
|
+
unrecognizedObjectKeys: "passthrough",
|
|
295
|
+
allowUnrecognizedUnionMembers: true,
|
|
296
|
+
allowUnrecognizedEnumValues: true,
|
|
297
|
+
breadcrumbsPrefix: ["response"],
|
|
298
|
+
}),
|
|
299
|
+
rawResponse: _response.rawResponse,
|
|
300
|
+
};
|
|
286
301
|
}
|
|
287
302
|
if (_response.error.reason === "status-code") {
|
|
288
303
|
switch (_response.error.statusCode) {
|
|
@@ -292,11 +307,12 @@ class ChatGroups {
|
|
|
292
307
|
allowUnrecognizedUnionMembers: true,
|
|
293
308
|
allowUnrecognizedEnumValues: true,
|
|
294
309
|
breadcrumbsPrefix: ["response"],
|
|
295
|
-
}));
|
|
310
|
+
}), _response.rawResponse);
|
|
296
311
|
default:
|
|
297
312
|
throw new errors.HumeError({
|
|
298
313
|
statusCode: _response.error.statusCode,
|
|
299
314
|
body: _response.error.body,
|
|
315
|
+
rawResponse: _response.rawResponse,
|
|
300
316
|
});
|
|
301
317
|
}
|
|
302
318
|
}
|
|
@@ -305,18 +321,22 @@ class ChatGroups {
|
|
|
305
321
|
throw new errors.HumeError({
|
|
306
322
|
statusCode: _response.error.statusCode,
|
|
307
323
|
body: _response.error.rawBody,
|
|
324
|
+
rawResponse: _response.rawResponse,
|
|
308
325
|
});
|
|
309
326
|
case "timeout":
|
|
310
327
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/events.");
|
|
311
328
|
case "unknown":
|
|
312
329
|
throw new errors.HumeError({
|
|
313
330
|
message: _response.error.errorMessage,
|
|
331
|
+
rawResponse: _response.rawResponse,
|
|
314
332
|
});
|
|
315
333
|
}
|
|
316
|
-
});
|
|
334
|
+
}));
|
|
317
335
|
let _offset = (request === null || request === void 0 ? void 0 : request.pageNumber) != null ? request === null || request === void 0 ? void 0 : request.pageNumber : 0;
|
|
336
|
+
const dataWithRawResponse = yield list(request).withRawResponse();
|
|
318
337
|
return new core.Pageable({
|
|
319
|
-
response:
|
|
338
|
+
response: dataWithRawResponse.data,
|
|
339
|
+
rawResponse: dataWithRawResponse.rawResponse,
|
|
320
340
|
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
321
341
|
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
|
|
322
342
|
loadPage: (_response) => {
|
|
@@ -342,9 +362,12 @@ class ChatGroups {
|
|
|
342
362
|
* ascendingOrder: true
|
|
343
363
|
* })
|
|
344
364
|
*/
|
|
345
|
-
getAudio(
|
|
365
|
+
getAudio(id, request = {}, requestOptions) {
|
|
366
|
+
return core.HttpResponsePromise.fromPromise(this.__getAudio(id, request, requestOptions));
|
|
367
|
+
}
|
|
368
|
+
__getAudio(id_1) {
|
|
346
369
|
return __awaiter(this, arguments, void 0, function* (id, request = {}, requestOptions) {
|
|
347
|
-
var _a, _b, _c;
|
|
370
|
+
var _a, _b, _c, _d;
|
|
348
371
|
const { pageNumber, pageSize, ascendingOrder } = request;
|
|
349
372
|
const _queryParams = {};
|
|
350
373
|
if (pageNumber != null) {
|
|
@@ -359,21 +382,22 @@ class ChatGroups {
|
|
|
359
382
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
360
383
|
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
384
|
method: "GET",
|
|
362
|
-
headers:
|
|
363
|
-
contentType: "application/json",
|
|
385
|
+
headers: (0, headers_js_1.mergeHeaders)((_d = this._options) === null || _d === void 0 ? void 0 : _d.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)(Object.assign({}, (yield this._getCustomAuthorizationHeaders()))), requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.headers),
|
|
364
386
|
queryParameters: _queryParams,
|
|
365
|
-
requestType: "json",
|
|
366
387
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
367
388
|
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
368
389
|
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
369
390
|
});
|
|
370
391
|
if (_response.ok) {
|
|
371
|
-
return
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
392
|
+
return {
|
|
393
|
+
data: serializers.empathicVoice.ReturnChatGroupPagedAudioReconstructions.parseOrThrow(_response.body, {
|
|
394
|
+
unrecognizedObjectKeys: "passthrough",
|
|
395
|
+
allowUnrecognizedUnionMembers: true,
|
|
396
|
+
allowUnrecognizedEnumValues: true,
|
|
397
|
+
breadcrumbsPrefix: ["response"],
|
|
398
|
+
}),
|
|
399
|
+
rawResponse: _response.rawResponse,
|
|
400
|
+
};
|
|
377
401
|
}
|
|
378
402
|
if (_response.error.reason === "status-code") {
|
|
379
403
|
switch (_response.error.statusCode) {
|
|
@@ -383,11 +407,12 @@ class ChatGroups {
|
|
|
383
407
|
allowUnrecognizedUnionMembers: true,
|
|
384
408
|
allowUnrecognizedEnumValues: true,
|
|
385
409
|
breadcrumbsPrefix: ["response"],
|
|
386
|
-
}));
|
|
410
|
+
}), _response.rawResponse);
|
|
387
411
|
default:
|
|
388
412
|
throw new errors.HumeError({
|
|
389
413
|
statusCode: _response.error.statusCode,
|
|
390
414
|
body: _response.error.body,
|
|
415
|
+
rawResponse: _response.rawResponse,
|
|
391
416
|
});
|
|
392
417
|
}
|
|
393
418
|
}
|
|
@@ -396,12 +421,14 @@ class ChatGroups {
|
|
|
396
421
|
throw new errors.HumeError({
|
|
397
422
|
statusCode: _response.error.statusCode,
|
|
398
423
|
body: _response.error.rawBody,
|
|
424
|
+
rawResponse: _response.rawResponse,
|
|
399
425
|
});
|
|
400
426
|
case "timeout":
|
|
401
427
|
throw new errors.HumeTimeoutError("Timeout exceeded when calling GET /v0/evi/chat_groups/{id}/audio.");
|
|
402
428
|
case "unknown":
|
|
403
429
|
throw new errors.HumeError({
|
|
404
430
|
message: _response.error.errorMessage,
|
|
431
|
+
rawResponse: _response.rawResponse,
|
|
405
432
|
});
|
|
406
433
|
}
|
|
407
434
|
});
|