hume 0.8.5 → 0.8.6
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 +35 -34
- package/.mock/definition/empathic-voice/chatGroups.yml +338 -27
- package/.mock/definition/empathic-voice/chats.yml +353 -36
- package/.mock/definition/empathic-voice/configs.yml +282 -210
- package/.mock/definition/empathic-voice/prompts.yml +140 -64
- package/.mock/definition/empathic-voice/tools.yml +11 -8
- package/.mock/definition/expression-measurement/__package__.yml +203 -59
- package/.mock/definition/expression-measurement/batch.yml +64 -35
- package/.mock/fern.config.json +1 -1
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +11 -2
- package/api/resources/empathicVoice/resources/chatGroups/client/Client.js +13 -4
- package/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.ts +7 -3
- package/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.ts +8 -3
- package/api/resources/empathicVoice/resources/chats/client/Client.d.ts +12 -4
- package/api/resources/empathicVoice/resources/chats/client/Client.js +128 -96
- package/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.ts +7 -3
- package/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts +7 -3
- package/api/resources/empathicVoice/resources/configs/client/Client.d.ts +74 -10
- package/api/resources/empathicVoice/resources/configs/client/Client.js +83 -19
- package/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.ts +2 -2
- package/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigsRequest.d.ts +6 -3
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +28 -1
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigName.d.ts +1 -1
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +33 -1
- package/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.ts +3 -1
- package/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -13
- package/api/resources/empathicVoice/resources/prompts/client/Client.js +89 -70
- package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +2 -2
- package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptName.d.ts +1 -1
- package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +2 -1
- package/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.ts +3 -1
- package/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.ts +2 -2
- package/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptsRequest.d.ts +6 -3
- package/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -1
- package/api/resources/empathicVoice/resources/tools/client/Client.js +71 -58
- package/api/resources/empathicVoice/resources/tools/client/requests/ToolsListToolVersionsRequest.d.ts +2 -2
- package/api/resources/empathicVoice/resources/tools/client/requests/ToolsListToolsRequest.d.ts +2 -2
- package/api/resources/empathicVoice/types/AudioInput.d.ts +4 -2
- package/api/resources/empathicVoice/types/JsonMessage.d.ts +1 -1
- package/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +4 -4
- package/api/resources/expressionMeasurement/resources/batch/client/Client.js +11 -19
- package/api/resources/expressionMeasurement/resources/batch/client/requests/BatchListJobsRequest.d.ts +25 -9
- package/api/resources/expressionMeasurement/resources/batch/client/requests/BatchStartInferenceJobFromLocalFileRequest.d.ts +1 -0
- package/api/resources/expressionMeasurement/types/{UnionJobJobInference.d.ts → CustomModelsInferenceJob.d.ts} +2 -1
- package/api/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.d.ts → CustomModelsTrainingJob.d.ts} +2 -1
- package/api/resources/expressionMeasurement/types/EmbeddingGenerationJob.d.ts +7 -0
- package/api/resources/expressionMeasurement/types/Face.d.ts +5 -0
- package/api/resources/expressionMeasurement/types/File_.d.ts +3 -0
- package/api/resources/expressionMeasurement/types/Granularity.d.ts +9 -1
- package/api/resources/expressionMeasurement/types/InferenceBaseRequest.d.ts +6 -1
- package/api/resources/expressionMeasurement/types/InferenceJob.d.ts +12 -0
- package/api/resources/expressionMeasurement/types/JobInference.d.ts +3 -0
- package/api/resources/expressionMeasurement/types/Language.d.ts +5 -0
- package/api/resources/expressionMeasurement/types/Models.d.ts +3 -0
- package/api/resources/expressionMeasurement/types/Ner.d.ts +5 -0
- package/api/resources/expressionMeasurement/types/Prosody.d.ts +5 -0
- package/api/resources/expressionMeasurement/types/Transcription.d.ts +40 -0
- package/api/resources/expressionMeasurement/types/UnionJob.d.ts +1 -15
- package/api/resources/expressionMeasurement/types/UnionPredictResult.d.ts +1 -1
- package/api/resources/expressionMeasurement/types/Window.d.ts +5 -0
- package/api/resources/expressionMeasurement/types/index.d.ts +4 -4
- package/api/resources/expressionMeasurement/types/index.js +4 -4
- package/api/resources/index.d.ts +1 -1
- package/api/resources/index.js +2 -2
- package/core/index.d.ts +1 -0
- package/core/index.js +1 -0
- package/core/pagination/Page.d.ts +29 -0
- package/core/pagination/Page.js +94 -0
- package/core/pagination/Pageable.d.ts +12 -0
- package/core/pagination/Pageable.js +10 -0
- package/core/pagination/index.d.ts +2 -0
- package/core/pagination/index.js +7 -0
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.d.ts +11 -2
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/Client.js +13 -4
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupEventsRequest.d.ts +7 -3
- package/dist/api/resources/empathicVoice/resources/chatGroups/client/requests/ChatGroupsListChatGroupsRequest.d.ts +8 -3
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.d.ts +12 -4
- package/dist/api/resources/empathicVoice/resources/chats/client/Client.js +128 -96
- package/dist/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatEventsRequest.d.ts +7 -3
- package/dist/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts +7 -3
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.d.ts +74 -10
- package/dist/api/resources/empathicVoice/resources/configs/client/Client.js +83 -19
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigVersionsRequest.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/ConfigsListConfigsRequest.d.ts +6 -3
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfig.d.ts +28 -1
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigName.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersion.d.ts +33 -1
- package/dist/api/resources/empathicVoice/resources/configs/client/requests/PostedConfigVersionDescription.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.d.ts +19 -13
- package/dist/api/resources/empathicVoice/resources/prompts/client/Client.js +89 -70
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPrompt.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptName.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersion.d.ts +2 -1
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PostedPromptVersionDescription.d.ts +3 -1
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptVersionsRequest.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/prompts/client/requests/PromptsListPromptsRequest.d.ts +6 -3
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.d.ts +1 -1
- package/dist/api/resources/empathicVoice/resources/tools/client/Client.js +71 -58
- package/dist/api/resources/empathicVoice/resources/tools/client/requests/ToolsListToolVersionsRequest.d.ts +2 -2
- package/dist/api/resources/empathicVoice/resources/tools/client/requests/ToolsListToolsRequest.d.ts +2 -2
- package/dist/api/resources/empathicVoice/types/AudioInput.d.ts +4 -2
- package/dist/api/resources/empathicVoice/types/JsonMessage.d.ts +1 -1
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.d.ts +4 -4
- package/dist/api/resources/expressionMeasurement/resources/batch/client/Client.js +11 -19
- package/dist/api/resources/expressionMeasurement/resources/batch/client/requests/BatchListJobsRequest.d.ts +25 -9
- package/dist/api/resources/expressionMeasurement/resources/batch/client/requests/BatchStartInferenceJobFromLocalFileRequest.d.ts +1 -0
- package/{api/resources/expressionMeasurement/types/UnionJobJobTraining.d.ts → dist/api/resources/expressionMeasurement/types/CustomModelsInferenceJob.d.ts} +2 -1
- package/{api/resources/expressionMeasurement/types/UnionJobJobTlInference.d.ts → dist/api/resources/expressionMeasurement/types/CustomModelsTrainingJob.d.ts} +2 -1
- package/dist/api/resources/expressionMeasurement/types/EmbeddingGenerationJob.d.ts +7 -0
- package/dist/api/resources/expressionMeasurement/types/Face.d.ts +5 -0
- package/dist/api/resources/expressionMeasurement/types/File_.d.ts +3 -0
- package/dist/api/resources/expressionMeasurement/types/Granularity.d.ts +9 -1
- package/dist/api/resources/expressionMeasurement/types/InferenceBaseRequest.d.ts +6 -1
- package/dist/api/resources/expressionMeasurement/types/InferenceJob.d.ts +12 -0
- package/dist/api/resources/expressionMeasurement/types/JobInference.d.ts +3 -0
- package/dist/api/resources/expressionMeasurement/types/Language.d.ts +5 -0
- package/dist/api/resources/expressionMeasurement/types/Models.d.ts +3 -0
- package/dist/api/resources/expressionMeasurement/types/Ner.d.ts +5 -0
- package/dist/api/resources/expressionMeasurement/types/Prosody.d.ts +5 -0
- package/dist/api/resources/expressionMeasurement/types/Transcription.d.ts +40 -0
- package/dist/api/resources/expressionMeasurement/types/UnionJob.d.ts +1 -15
- package/dist/api/resources/expressionMeasurement/types/UnionPredictResult.d.ts +1 -1
- package/dist/api/resources/expressionMeasurement/types/Window.d.ts +5 -0
- package/dist/api/resources/expressionMeasurement/types/index.d.ts +4 -4
- package/dist/api/resources/expressionMeasurement/types/index.js +4 -4
- package/dist/api/resources/index.d.ts +1 -1
- package/dist/api/resources/index.js +2 -2
- package/dist/core/index.d.ts +1 -0
- package/dist/core/index.js +1 -0
- package/dist/core/pagination/Page.d.ts +29 -0
- package/dist/core/pagination/Page.js +94 -0
- package/dist/core/pagination/Pageable.d.ts +12 -0
- package/dist/core/pagination/Pageable.js +10 -0
- package/dist/core/pagination/index.d.ts +2 -0
- package/dist/core/pagination/index.js +7 -0
- package/dist/serialization/resources/empathicVoice/types/JsonMessage.d.ts +2 -1
- package/dist/serialization/resources/empathicVoice/types/JsonMessage.js +2 -0
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobTlInference.d.ts → dist/serialization/resources/expressionMeasurement/types/CustomModelsInferenceJob.d.ts} +3 -2
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobTlInference.js → dist/serialization/resources/expressionMeasurement/types/CustomModelsInferenceJob.js} +6 -2
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobTraining.d.ts → dist/serialization/resources/expressionMeasurement/types/CustomModelsTrainingJob.d.ts} +3 -2
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobTraining.js → dist/serialization/resources/expressionMeasurement/types/CustomModelsTrainingJob.js} +6 -2
- package/dist/serialization/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.d.ts → EmbeddingGenerationJob.d.ts} +3 -2
- package/dist/serialization/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.js → EmbeddingGenerationJob.js} +6 -2
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobInference.d.ts → dist/serialization/resources/expressionMeasurement/types/InferenceJob.d.ts} +3 -2
- package/{serialization/resources/expressionMeasurement/types/UnionJobJobInference.js → dist/serialization/resources/expressionMeasurement/types/InferenceJob.js} +6 -2
- package/dist/serialization/resources/expressionMeasurement/types/UnionJob.d.ts +3 -18
- package/dist/serialization/resources/expressionMeasurement/types/UnionJob.js +2 -39
- package/dist/serialization/resources/expressionMeasurement/types/UnionPredictResult.d.ts +2 -3
- package/dist/serialization/resources/expressionMeasurement/types/UnionPredictResult.js +1 -29
- package/dist/serialization/resources/expressionMeasurement/types/index.d.ts +4 -4
- package/dist/serialization/resources/expressionMeasurement/types/index.js +4 -4
- package/dist/serialization/resources/index.d.ts +1 -1
- package/dist/serialization/resources/index.js +2 -2
- package/package.json +1 -1
- package/reference.md +596 -544
- package/serialization/resources/empathicVoice/types/JsonMessage.d.ts +2 -1
- package/serialization/resources/empathicVoice/types/JsonMessage.js +2 -0
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobTlInference.d.ts → serialization/resources/expressionMeasurement/types/CustomModelsInferenceJob.d.ts} +3 -2
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobTlInference.js → serialization/resources/expressionMeasurement/types/CustomModelsInferenceJob.js} +6 -2
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobTraining.d.ts → serialization/resources/expressionMeasurement/types/CustomModelsTrainingJob.d.ts} +3 -2
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobTraining.js → serialization/resources/expressionMeasurement/types/CustomModelsTrainingJob.js} +6 -2
- package/serialization/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.d.ts → EmbeddingGenerationJob.d.ts} +3 -2
- package/serialization/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.js → EmbeddingGenerationJob.js} +6 -2
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobInference.d.ts → serialization/resources/expressionMeasurement/types/InferenceJob.d.ts} +3 -2
- package/{dist/serialization/resources/expressionMeasurement/types/UnionJobJobInference.js → serialization/resources/expressionMeasurement/types/InferenceJob.js} +6 -2
- package/serialization/resources/expressionMeasurement/types/UnionJob.d.ts +3 -18
- package/serialization/resources/expressionMeasurement/types/UnionJob.js +2 -39
- package/serialization/resources/expressionMeasurement/types/UnionPredictResult.d.ts +2 -3
- package/serialization/resources/expressionMeasurement/types/UnionPredictResult.js +1 -29
- package/serialization/resources/expressionMeasurement/types/index.d.ts +4 -4
- package/serialization/resources/expressionMeasurement/types/index.js +4 -4
- package/serialization/resources/index.d.ts +1 -1
- package/serialization/resources/index.js +2 -2
- package/dist/api/resources/expressionMeasurement/types/UnionJobJobEmbeddingGeneration.d.ts +0 -6
- package/dist/api/resources/expressionMeasurement/types/UnionJobJobInference.d.ts +0 -6
- package/dist/api/resources/expressionMeasurement/types/UnionJobJobTlInference.d.ts +0 -6
- package/dist/api/resources/expressionMeasurement/types/UnionJobJobTraining.d.ts +0 -6
- /package/api/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.js → CustomModelsInferenceJob.js} +0 -0
- /package/api/resources/expressionMeasurement/types/{UnionJobJobInference.js → CustomModelsTrainingJob.js} +0 -0
- /package/api/resources/expressionMeasurement/types/{UnionJobJobTlInference.js → EmbeddingGenerationJob.js} +0 -0
- /package/api/resources/expressionMeasurement/types/{UnionJobJobTraining.js → InferenceJob.js} +0 -0
- /package/dist/api/resources/expressionMeasurement/types/{UnionJobJobEmbeddingGeneration.js → CustomModelsInferenceJob.js} +0 -0
- /package/dist/api/resources/expressionMeasurement/types/{UnionJobJobInference.js → CustomModelsTrainingJob.js} +0 -0
- /package/dist/api/resources/expressionMeasurement/types/{UnionJobJobTlInference.js → EmbeddingGenerationJob.js} +0 -0
- /package/dist/api/resources/expressionMeasurement/types/{UnionJobJobTraining.js → InferenceJob.js} +0 -0
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
12
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
13
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
14
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
15
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
16
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
17
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
18
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
19
|
+
function fulfill(value) { resume("next", value); }
|
|
20
|
+
function reject(value) { resume("throw", value); }
|
|
21
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
22
|
+
};
|
|
23
|
+
var __asyncValues = (this && this.__asyncValues) || function (o) {
|
|
24
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
25
|
+
var m = o[Symbol.asyncIterator], i;
|
|
26
|
+
return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i);
|
|
27
|
+
function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }
|
|
28
|
+
function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }
|
|
29
|
+
};
|
|
30
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
31
|
+
exports.Page = void 0;
|
|
32
|
+
/**
|
|
33
|
+
* A page of results from a paginated API.
|
|
34
|
+
*
|
|
35
|
+
* @template T The type of the items in the page.
|
|
36
|
+
*/
|
|
37
|
+
class Page {
|
|
38
|
+
constructor({ response, hasNextPage, getItems, loadPage, }) {
|
|
39
|
+
this.response = response;
|
|
40
|
+
this.data = getItems(response);
|
|
41
|
+
this._hasNextPage = hasNextPage;
|
|
42
|
+
this.getItems = getItems;
|
|
43
|
+
this.loadNextPage = loadPage;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Retrieves the next page
|
|
47
|
+
* @returns this
|
|
48
|
+
*/
|
|
49
|
+
getNextPage() {
|
|
50
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
51
|
+
this.response = yield this.loadNextPage(this.response);
|
|
52
|
+
this.data = this.getItems(this.response);
|
|
53
|
+
return this;
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* @returns whether there is a next page to load
|
|
58
|
+
*/
|
|
59
|
+
hasNextPage() {
|
|
60
|
+
return this._hasNextPage(this.response);
|
|
61
|
+
}
|
|
62
|
+
iterMessages() {
|
|
63
|
+
return __asyncGenerator(this, arguments, function* iterMessages_1() {
|
|
64
|
+
for (const item of this.data) {
|
|
65
|
+
yield yield __await(item);
|
|
66
|
+
}
|
|
67
|
+
while (this.hasNextPage()) {
|
|
68
|
+
yield __await(this.getNextPage());
|
|
69
|
+
for (const item of this.data) {
|
|
70
|
+
yield yield __await(item);
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
[Symbol.asyncIterator]() {
|
|
76
|
+
return __asyncGenerator(this, arguments, function* _a() {
|
|
77
|
+
var e_1, _b;
|
|
78
|
+
try {
|
|
79
|
+
for (var _c = __asyncValues(this.iterMessages()), _d; _d = yield __await(_c.next()), !_d.done;) {
|
|
80
|
+
const message = _d.value;
|
|
81
|
+
yield yield __await(message);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
catch (e_1_1) { e_1 = { error: e_1_1 }; }
|
|
85
|
+
finally {
|
|
86
|
+
try {
|
|
87
|
+
if (_d && !_d.done && (_b = _c.return)) yield __await(_b.call(_c));
|
|
88
|
+
}
|
|
89
|
+
finally { if (e_1) throw e_1.error; }
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
exports.Page = Page;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Page } from './Page';
|
|
2
|
+
export declare namespace Pageable {
|
|
3
|
+
interface Args<Response, Item> {
|
|
4
|
+
response: Response;
|
|
5
|
+
hasNextPage: (response: Response) => boolean;
|
|
6
|
+
getItems: (response: Response) => Item[];
|
|
7
|
+
loadPage: (response: Response) => Promise<Response>;
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class Pageable<R, T> extends Page<T> {
|
|
11
|
+
constructor(args: Pageable.Args<R, T>);
|
|
12
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Pageable = exports.Page = void 0;
|
|
4
|
+
var Page_1 = require("./Page");
|
|
5
|
+
Object.defineProperty(exports, "Page", { enumerable: true, get: function () { return Page_1.Page; } });
|
|
6
|
+
var Pageable_1 = require("./Pageable");
|
|
7
|
+
Object.defineProperty(exports, "Pageable", { enumerable: true, get: function () { return Pageable_1.Pageable; } });
|
|
@@ -27,7 +27,12 @@ export declare class ChatGroups {
|
|
|
27
27
|
* @param {ChatGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
|
-
* await client.empathicVoice.chatGroups.listChatGroups(
|
|
30
|
+
* await client.empathicVoice.chatGroups.listChatGroups({
|
|
31
|
+
* pageNumber: 0,
|
|
32
|
+
* pageSize: 1,
|
|
33
|
+
* ascendingOrder: true,
|
|
34
|
+
* configId: "1b60e1a0-cc59-424a-8d2c-189d354db3f3"
|
|
35
|
+
* })
|
|
31
36
|
*/
|
|
32
37
|
listChatGroups(request?: Hume.empathicVoice.ChatGroupsListChatGroupsRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnPagedChatGroups>;
|
|
33
38
|
/**
|
|
@@ -36,7 +41,11 @@ export declare class ChatGroups {
|
|
|
36
41
|
* @param {ChatGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
42
|
*
|
|
38
43
|
* @example
|
|
39
|
-
* await client.empathicVoice.chatGroups.listChatGroupEvents("
|
|
44
|
+
* await client.empathicVoice.chatGroups.listChatGroupEvents("697056f0-6c7e-487d-9bd8-9c19df79f05f", {
|
|
45
|
+
* pageNumber: 0,
|
|
46
|
+
* pageSize: 3,
|
|
47
|
+
* ascendingOrder: true
|
|
48
|
+
* })
|
|
40
49
|
*/
|
|
41
50
|
listChatGroupEvents(id: string, request?: Hume.empathicVoice.ChatGroupsListChatGroupEventsRequest, requestOptions?: ChatGroups.RequestOptions): Promise<Hume.empathicVoice.ReturnChatGroupPagedEvents>;
|
|
42
51
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
@@ -53,7 +53,12 @@ class ChatGroups {
|
|
|
53
53
|
* @param {ChatGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
|
-
* await client.empathicVoice.chatGroups.listChatGroups(
|
|
56
|
+
* await client.empathicVoice.chatGroups.listChatGroups({
|
|
57
|
+
* pageNumber: 0,
|
|
58
|
+
* pageSize: 1,
|
|
59
|
+
* ascendingOrder: true,
|
|
60
|
+
* configId: "1b60e1a0-cc59-424a-8d2c-189d354db3f3"
|
|
61
|
+
* })
|
|
57
62
|
*/
|
|
58
63
|
listChatGroups(request = {}, requestOptions) {
|
|
59
64
|
var _a, _b;
|
|
@@ -75,7 +80,7 @@ class ChatGroups {
|
|
|
75
80
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
76
81
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, 'v0/evi/chat_groups'),
|
|
77
82
|
method: 'GET',
|
|
78
|
-
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.
|
|
83
|
+
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
79
84
|
contentType: 'application/json',
|
|
80
85
|
queryParameters: _queryParams,
|
|
81
86
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
@@ -119,7 +124,11 @@ class ChatGroups {
|
|
|
119
124
|
* @param {ChatGroups.RequestOptions} requestOptions - Request-specific configuration.
|
|
120
125
|
*
|
|
121
126
|
* @example
|
|
122
|
-
* await client.empathicVoice.chatGroups.listChatGroupEvents("
|
|
127
|
+
* await client.empathicVoice.chatGroups.listChatGroupEvents("697056f0-6c7e-487d-9bd8-9c19df79f05f", {
|
|
128
|
+
* pageNumber: 0,
|
|
129
|
+
* pageSize: 3,
|
|
130
|
+
* ascendingOrder: true
|
|
131
|
+
* })
|
|
123
132
|
*/
|
|
124
133
|
listChatGroupEvents(id, request = {}, requestOptions) {
|
|
125
134
|
var _a, _b;
|
|
@@ -138,7 +147,7 @@ class ChatGroups {
|
|
|
138
147
|
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
139
148
|
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chat_groups/${encodeURIComponent(id)}/events`),
|
|
140
149
|
method: 'GET',
|
|
141
|
-
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.
|
|
150
|
+
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
142
151
|
contentType: 'application/json',
|
|
143
152
|
queryParameters: _queryParams,
|
|
144
153
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
6
|
+
* {
|
|
7
|
+
* pageNumber: 0,
|
|
8
|
+
* pageSize: 3,
|
|
9
|
+
* ascendingOrder: true
|
|
10
|
+
* }
|
|
7
11
|
*/
|
|
8
12
|
export interface ChatGroupsListChatGroupEventsRequest {
|
|
9
13
|
/**
|
|
10
|
-
* Specifies the maximum number of results to include per page, enabling pagination.
|
|
14
|
+
* Specifies the maximum number of results to include per page, enabling pagination. The value must be between 1 and 100, inclusive.
|
|
11
15
|
*
|
|
12
|
-
*
|
|
16
|
+
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
13
17
|
*/
|
|
14
18
|
pageSize?: number;
|
|
15
19
|
/**
|
|
@@ -3,7 +3,12 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
6
|
+
* {
|
|
7
|
+
* pageNumber: 0,
|
|
8
|
+
* pageSize: 1,
|
|
9
|
+
* ascendingOrder: true,
|
|
10
|
+
* configId: "1b60e1a0-cc59-424a-8d2c-189d354db3f3"
|
|
11
|
+
* }
|
|
7
12
|
*/
|
|
8
13
|
export interface ChatGroupsListChatGroupsRequest {
|
|
9
14
|
/**
|
|
@@ -13,9 +18,9 @@ export interface ChatGroupsListChatGroupsRequest {
|
|
|
13
18
|
*/
|
|
14
19
|
pageNumber?: number;
|
|
15
20
|
/**
|
|
16
|
-
* Specifies the maximum number of results to include per page, enabling pagination.
|
|
21
|
+
* Specifies the maximum number of results to include per page, enabling pagination. The value must be between 1 and 100, inclusive.
|
|
17
22
|
*
|
|
18
|
-
*
|
|
23
|
+
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
19
24
|
*/
|
|
20
25
|
pageSize?: number;
|
|
21
26
|
/**
|
|
@@ -27,18 +27,26 @@ export declare class Chats {
|
|
|
27
27
|
* @param {Chats.RequestOptions} requestOptions - Request-specific configuration.
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
|
-
* await client.empathicVoice.chats.listChats(
|
|
30
|
+
* await client.empathicVoice.chats.listChats({
|
|
31
|
+
* pageNumber: 0,
|
|
32
|
+
* pageSize: 1,
|
|
33
|
+
* ascendingOrder: true
|
|
34
|
+
* })
|
|
31
35
|
*/
|
|
32
|
-
listChats(request?: Hume.empathicVoice.ChatsListChatsRequest, requestOptions?: Chats.RequestOptions): Promise<Hume.empathicVoice.
|
|
36
|
+
listChats(request?: Hume.empathicVoice.ChatsListChatsRequest, requestOptions?: Chats.RequestOptions): Promise<core.Page<Hume.empathicVoice.ReturnChat>>;
|
|
33
37
|
/**
|
|
34
38
|
* @param {string} id - Identifier for a Chat. Formatted as a UUID.
|
|
35
39
|
* @param {Hume.empathicVoice.ChatsListChatEventsRequest} request
|
|
36
40
|
* @param {Chats.RequestOptions} requestOptions - Request-specific configuration.
|
|
37
41
|
*
|
|
38
42
|
* @example
|
|
39
|
-
* await client.empathicVoice.chats.listChatEvents("
|
|
43
|
+
* await client.empathicVoice.chats.listChatEvents("470a49f6-1dec-4afe-8b61-035d3b2d63b0", {
|
|
44
|
+
* pageNumber: 0,
|
|
45
|
+
* pageSize: 3,
|
|
46
|
+
* ascendingOrder: true
|
|
47
|
+
* })
|
|
40
48
|
*/
|
|
41
|
-
listChatEvents(id: string, request?: Hume.empathicVoice.ChatsListChatEventsRequest, requestOptions?: Chats.RequestOptions): Promise<Hume.empathicVoice.
|
|
49
|
+
listChatEvents(id: string, request?: Hume.empathicVoice.ChatsListChatEventsRequest, requestOptions?: Chats.RequestOptions): Promise<core.Page<Hume.empathicVoice.ReturnChatEvent>>;
|
|
42
50
|
protected _getCustomAuthorizationHeaders(): Promise<{
|
|
43
51
|
'X-Hume-Api-Key': string | undefined;
|
|
44
52
|
}>;
|
|
@@ -53,61 +53,77 @@ class Chats {
|
|
|
53
53
|
* @param {Chats.RequestOptions} requestOptions - Request-specific configuration.
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
|
-
* await client.empathicVoice.chats.listChats(
|
|
56
|
+
* await client.empathicVoice.chats.listChats({
|
|
57
|
+
* pageNumber: 0,
|
|
58
|
+
* pageSize: 1,
|
|
59
|
+
* ascendingOrder: true
|
|
60
|
+
* })
|
|
57
61
|
*/
|
|
58
62
|
listChats(request = {}, requestOptions) {
|
|
59
|
-
var _a, _b;
|
|
60
63
|
return __awaiter(this, void 0, void 0, function* () {
|
|
61
|
-
const
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
_queryParams
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
:
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
return serializers.empathicVoice.ReturnPagedChats.parseOrThrow(_response.body, {
|
|
86
|
-
unrecognizedObjectKeys: 'passthrough',
|
|
87
|
-
allowUnrecognizedUnionMembers: true,
|
|
88
|
-
allowUnrecognizedEnumValues: true,
|
|
89
|
-
breadcrumbsPrefix: ['response'],
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
if (_response.error.reason === 'status-code') {
|
|
93
|
-
throw new errors.HumeError({
|
|
94
|
-
statusCode: _response.error.statusCode,
|
|
95
|
-
body: _response.error.body,
|
|
64
|
+
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
65
|
+
var _a, _b;
|
|
66
|
+
const { pageNumber, pageSize, ascendingOrder } = request;
|
|
67
|
+
const _queryParams = {};
|
|
68
|
+
if (pageNumber != null) {
|
|
69
|
+
_queryParams['page_number'] = pageNumber.toString();
|
|
70
|
+
}
|
|
71
|
+
if (pageSize != null) {
|
|
72
|
+
_queryParams['page_size'] = pageSize.toString();
|
|
73
|
+
}
|
|
74
|
+
if (ascendingOrder != null) {
|
|
75
|
+
_queryParams['ascending_order'] = ascendingOrder.toString();
|
|
76
|
+
}
|
|
77
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
78
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, 'v0/evi/chats'),
|
|
79
|
+
method: 'GET',
|
|
80
|
+
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
81
|
+
contentType: 'application/json',
|
|
82
|
+
queryParameters: _queryParams,
|
|
83
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
84
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
85
|
+
: 60000,
|
|
86
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
87
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
96
88
|
});
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
89
|
+
if (_response.ok) {
|
|
90
|
+
return serializers.empathicVoice.ReturnPagedChats.parseOrThrow(_response.body, {
|
|
91
|
+
unrecognizedObjectKeys: 'passthrough',
|
|
92
|
+
allowUnrecognizedUnionMembers: true,
|
|
93
|
+
allowUnrecognizedEnumValues: true,
|
|
94
|
+
breadcrumbsPrefix: ['response'],
|
|
103
95
|
});
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
case 'unknown':
|
|
96
|
+
}
|
|
97
|
+
if (_response.error.reason === 'status-code') {
|
|
107
98
|
throw new errors.HumeError({
|
|
108
|
-
|
|
99
|
+
statusCode: _response.error.statusCode,
|
|
100
|
+
body: _response.error.body,
|
|
109
101
|
});
|
|
110
|
-
|
|
102
|
+
}
|
|
103
|
+
switch (_response.error.reason) {
|
|
104
|
+
case 'non-json':
|
|
105
|
+
throw new errors.HumeError({
|
|
106
|
+
statusCode: _response.error.statusCode,
|
|
107
|
+
body: _response.error.rawBody,
|
|
108
|
+
});
|
|
109
|
+
case 'timeout':
|
|
110
|
+
throw new errors.HumeTimeoutError();
|
|
111
|
+
case 'unknown':
|
|
112
|
+
throw new errors.HumeError({
|
|
113
|
+
message: _response.error.errorMessage,
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
});
|
|
117
|
+
let _offset = request.pageNumber != null ? request.pageNumber : 1;
|
|
118
|
+
return new core.Pageable({
|
|
119
|
+
response: yield list(request),
|
|
120
|
+
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
121
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.chatsPage) !== null && _a !== void 0 ? _a : []; },
|
|
122
|
+
loadPage: (_response) => {
|
|
123
|
+
_offset += 1;
|
|
124
|
+
return list(Object.assign(Object.assign({}, request), { pageNumber: _offset }));
|
|
125
|
+
},
|
|
126
|
+
});
|
|
111
127
|
});
|
|
112
128
|
}
|
|
113
129
|
/**
|
|
@@ -116,61 +132,77 @@ class Chats {
|
|
|
116
132
|
* @param {Chats.RequestOptions} requestOptions - Request-specific configuration.
|
|
117
133
|
*
|
|
118
134
|
* @example
|
|
119
|
-
* await client.empathicVoice.chats.listChatEvents("
|
|
135
|
+
* await client.empathicVoice.chats.listChatEvents("470a49f6-1dec-4afe-8b61-035d3b2d63b0", {
|
|
136
|
+
* pageNumber: 0,
|
|
137
|
+
* pageSize: 3,
|
|
138
|
+
* ascendingOrder: true
|
|
139
|
+
* })
|
|
120
140
|
*/
|
|
121
141
|
listChatEvents(id, request = {}, requestOptions) {
|
|
122
|
-
var _a, _b;
|
|
123
142
|
return __awaiter(this, void 0, void 0, function* () {
|
|
124
|
-
const
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
_queryParams
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
:
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
return serializers.empathicVoice.ReturnChatPagedEvents.parseOrThrow(_response.body, {
|
|
149
|
-
unrecognizedObjectKeys: 'passthrough',
|
|
150
|
-
allowUnrecognizedUnionMembers: true,
|
|
151
|
-
allowUnrecognizedEnumValues: true,
|
|
152
|
-
breadcrumbsPrefix: ['response'],
|
|
153
|
-
});
|
|
154
|
-
}
|
|
155
|
-
if (_response.error.reason === 'status-code') {
|
|
156
|
-
throw new errors.HumeError({
|
|
157
|
-
statusCode: _response.error.statusCode,
|
|
158
|
-
body: _response.error.body,
|
|
143
|
+
const list = (request) => __awaiter(this, void 0, void 0, function* () {
|
|
144
|
+
var _a, _b;
|
|
145
|
+
const { pageSize, pageNumber, ascendingOrder } = request;
|
|
146
|
+
const _queryParams = {};
|
|
147
|
+
if (pageSize != null) {
|
|
148
|
+
_queryParams['page_size'] = pageSize.toString();
|
|
149
|
+
}
|
|
150
|
+
if (pageNumber != null) {
|
|
151
|
+
_queryParams['page_number'] = pageNumber.toString();
|
|
152
|
+
}
|
|
153
|
+
if (ascendingOrder != null) {
|
|
154
|
+
_queryParams['ascending_order'] = ascendingOrder.toString();
|
|
155
|
+
}
|
|
156
|
+
const _response = yield ((_a = this._options.fetcher) !== null && _a !== void 0 ? _a : core.fetcher)({
|
|
157
|
+
url: (0, url_join_1.default)((_b = (yield core.Supplier.get(this._options.environment))) !== null && _b !== void 0 ? _b : environments.HumeEnvironment.Production, `v0/evi/chats/${encodeURIComponent(id)}`),
|
|
158
|
+
method: 'GET',
|
|
159
|
+
headers: Object.assign({ 'X-Fern-Language': 'JavaScript', 'X-Fern-SDK-Name': 'hume', 'X-Fern-SDK-Version': '0.8.6', 'X-Fern-Runtime': core.RUNTIME.type, 'X-Fern-Runtime-Version': core.RUNTIME.version }, (yield this._getCustomAuthorizationHeaders())),
|
|
160
|
+
contentType: 'application/json',
|
|
161
|
+
queryParameters: _queryParams,
|
|
162
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null
|
|
163
|
+
? requestOptions.timeoutInSeconds * 1000
|
|
164
|
+
: 60000,
|
|
165
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
166
|
+
abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
|
|
159
167
|
});
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return serializers.empathicVoice.ReturnChatPagedEvents.parseOrThrow(_response.body, {
|
|
170
|
+
unrecognizedObjectKeys: 'passthrough',
|
|
171
|
+
allowUnrecognizedUnionMembers: true,
|
|
172
|
+
allowUnrecognizedEnumValues: true,
|
|
173
|
+
breadcrumbsPrefix: ['response'],
|
|
166
174
|
});
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
case 'unknown':
|
|
175
|
+
}
|
|
176
|
+
if (_response.error.reason === 'status-code') {
|
|
170
177
|
throw new errors.HumeError({
|
|
171
|
-
|
|
178
|
+
statusCode: _response.error.statusCode,
|
|
179
|
+
body: _response.error.body,
|
|
172
180
|
});
|
|
173
|
-
|
|
181
|
+
}
|
|
182
|
+
switch (_response.error.reason) {
|
|
183
|
+
case 'non-json':
|
|
184
|
+
throw new errors.HumeError({
|
|
185
|
+
statusCode: _response.error.statusCode,
|
|
186
|
+
body: _response.error.rawBody,
|
|
187
|
+
});
|
|
188
|
+
case 'timeout':
|
|
189
|
+
throw new errors.HumeTimeoutError();
|
|
190
|
+
case 'unknown':
|
|
191
|
+
throw new errors.HumeError({
|
|
192
|
+
message: _response.error.errorMessage,
|
|
193
|
+
});
|
|
194
|
+
}
|
|
195
|
+
});
|
|
196
|
+
let _offset = request.pageNumber != null ? request.pageNumber : 1;
|
|
197
|
+
return new core.Pageable({
|
|
198
|
+
response: yield list(request),
|
|
199
|
+
hasNextPage: (response) => { var _a; return ((_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []).length > 0; },
|
|
200
|
+
getItems: (response) => { var _a; return (_a = response === null || response === void 0 ? void 0 : response.eventsPage) !== null && _a !== void 0 ? _a : []; },
|
|
201
|
+
loadPage: (_response) => {
|
|
202
|
+
_offset += 1;
|
|
203
|
+
return list(Object.assign(Object.assign({}, request), { pageNumber: _offset }));
|
|
204
|
+
},
|
|
205
|
+
});
|
|
174
206
|
});
|
|
175
207
|
}
|
|
176
208
|
_getCustomAuthorizationHeaders() {
|
|
@@ -3,13 +3,17 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
6
|
+
* {
|
|
7
|
+
* pageNumber: 0,
|
|
8
|
+
* pageSize: 3,
|
|
9
|
+
* ascendingOrder: true
|
|
10
|
+
* }
|
|
7
11
|
*/
|
|
8
12
|
export interface ChatsListChatEventsRequest {
|
|
9
13
|
/**
|
|
10
|
-
* Specifies the maximum number of results to include per page, enabling pagination.
|
|
14
|
+
* Specifies the maximum number of results to include per page, enabling pagination. The value must be between 1 and 100, inclusive.
|
|
11
15
|
*
|
|
12
|
-
*
|
|
16
|
+
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
13
17
|
*/
|
|
14
18
|
pageSize?: number;
|
|
15
19
|
/**
|
package/dist/api/resources/empathicVoice/resources/chats/client/requests/ChatsListChatsRequest.d.ts
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
*/
|
|
4
4
|
/**
|
|
5
5
|
* @example
|
|
6
|
-
* {
|
|
6
|
+
* {
|
|
7
|
+
* pageNumber: 0,
|
|
8
|
+
* pageSize: 1,
|
|
9
|
+
* ascendingOrder: true
|
|
10
|
+
* }
|
|
7
11
|
*/
|
|
8
12
|
export interface ChatsListChatsRequest {
|
|
9
13
|
/**
|
|
@@ -13,9 +17,9 @@ export interface ChatsListChatsRequest {
|
|
|
13
17
|
*/
|
|
14
18
|
pageNumber?: number;
|
|
15
19
|
/**
|
|
16
|
-
* Specifies the maximum number of results to include per page, enabling pagination.
|
|
20
|
+
* Specifies the maximum number of results to include per page, enabling pagination. The value must be between 1 and 100, inclusive.
|
|
17
21
|
*
|
|
18
|
-
*
|
|
22
|
+
* For example, if `page_size` is set to 10, each page will include up to 10 items. Defaults to 10.
|
|
19
23
|
*/
|
|
20
24
|
pageSize?: number;
|
|
21
25
|
/**
|