@servicetitan/titan-chatbot-api 7.1.2 → 9.0.0
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/CHANGELOG.md +25 -0
- package/dist/api-client/__mocks__/chatbot-api-client.mock.d.ts +1 -0
- package/dist/api-client/__mocks__/chatbot-api-client.mock.d.ts.map +1 -1
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js +22 -47
- package/dist/api-client/__mocks__/chatbot-api-client.mock.js.map +1 -1
- package/dist/api-client/base/chatbot-api-client.d.ts +7 -0
- package/dist/api-client/base/chatbot-api-client.d.ts.map +1 -1
- package/dist/api-client/base/chatbot-api-client.js +3 -4
- package/dist/api-client/base/chatbot-api-client.js.map +1 -1
- package/dist/api-client/index.d.ts +2 -2
- package/dist/api-client/index.d.ts.map +1 -1
- package/dist/api-client/index.js +12 -7
- package/dist/api-client/index.js.map +1 -1
- package/dist/api-client/models/__mocks__/models.mock.js +154 -124
- package/dist/api-client/models/__mocks__/models.mock.js.map +1 -1
- package/dist/api-client/models/index.d.ts +2 -1
- package/dist/api-client/models/index.d.ts.map +1 -1
- package/dist/api-client/models/index.js +8 -7
- package/dist/api-client/models/index.js.map +1 -1
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.d.ts +2 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.d.ts.map +1 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.js +240 -0
- package/dist/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.js.map +1 -0
- package/dist/api-client/titan-chat/__tests__/native-client.test.js +6 -6
- package/dist/api-client/titan-chat/__tests__/native-client.test.js.map +1 -1
- package/dist/api-client/titan-chat/chatbot-api-client.d.ts +11 -0
- package/dist/api-client/titan-chat/chatbot-api-client.d.ts.map +1 -1
- package/dist/api-client/titan-chat/chatbot-api-client.js +69 -35
- package/dist/api-client/titan-chat/chatbot-api-client.js.map +1 -1
- package/dist/api-client/titan-chat/index.d.ts +2 -1
- package/dist/api-client/titan-chat/index.d.ts.map +1 -1
- package/dist/api-client/titan-chat/index.js +1 -0
- package/dist/api-client/titan-chat/index.js.map +1 -1
- package/dist/api-client/titan-chat/native-client.js +359 -812
- package/dist/api-client/titan-chat/native-client.js.map +1 -1
- package/dist/api-client/utils/__tests__/model-utils.test.js +454 -191
- package/dist/api-client/utils/__tests__/model-utils.test.js.map +1 -1
- package/dist/api-client/utils/model-utils.d.ts.map +1 -1
- package/dist/api-client/utils/model-utils.js +28 -25
- package/dist/api-client/utils/model-utils.js.map +1 -1
- package/dist/hooks/use-customization-chatbot.js +2 -1
- package/dist/hooks/use-customization-chatbot.js.map +1 -1
- package/dist/index.d.ts +3 -2
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/models/__tests__/chatbot-customizations.test.d.ts +2 -0
- package/dist/models/__tests__/chatbot-customizations.test.d.ts.map +1 -0
- package/dist/models/__tests__/chatbot-customizations.test.js +36 -0
- package/dist/models/__tests__/chatbot-customizations.test.js.map +1 -0
- package/dist/models/chatbot-customizations.d.ts +17 -0
- package/dist/models/chatbot-customizations.d.ts.map +1 -1
- package/dist/models/chatbot-customizations.js +7 -1
- package/dist/models/chatbot-customizations.js.map +1 -1
- package/dist/models/index.js +1 -0
- package/dist/models/index.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.d.ts +2 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.d.ts.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.js +107 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.observability.test.js.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.d.ts +2 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.d.ts.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.js +312 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.streaming.test.js.map +1 -0
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js +267 -172
- package/dist/stores/__tests__/chatbot-ui-backend.store.test.js.map +1 -1
- package/dist/stores/__tests__/chatbot-ui.store.test.js +61 -64
- package/dist/stores/__tests__/chatbot-ui.store.test.js.map +1 -1
- package/dist/stores/__tests__/filter.store.test.js +243 -116
- package/dist/stores/__tests__/filter.store.test.js.map +1 -1
- package/dist/stores/__tests__/initialize.store.test.js +9 -8
- package/dist/stores/__tests__/initialize.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js +8 -7
- package/dist/stores/__tests__/message-feedback-guardrail.store.test.js.map +1 -1
- package/dist/stores/__tests__/message-feedback.store.test.js +34 -27
- package/dist/stores/__tests__/message-feedback.store.test.js.map +1 -1
- package/dist/stores/__tests__/session-feedback.store.test.js +9 -8
- package/dist/stores/__tests__/session-feedback.store.test.js.map +1 -1
- package/dist/stores/chatbot-ui-backend.store.d.ts +26 -2
- package/dist/stores/chatbot-ui-backend.store.d.ts.map +1 -1
- package/dist/stores/chatbot-ui-backend.store.js +295 -239
- package/dist/stores/chatbot-ui-backend.store.js.map +1 -1
- package/dist/stores/chatbot-ui.store.js +73 -46
- package/dist/stores/chatbot-ui.store.js.map +1 -1
- package/dist/stores/filter.store.js +298 -378
- package/dist/stores/filter.store.js.map +1 -1
- package/dist/stores/index.d.ts +5 -3
- package/dist/stores/index.d.ts.map +1 -1
- package/dist/stores/index.js +3 -2
- package/dist/stores/index.js.map +1 -1
- package/dist/stores/initialize.store.js +55 -51
- package/dist/stores/initialize.store.js.map +1 -1
- package/dist/stores/message-feedback-base.store.js +2 -1
- package/dist/stores/message-feedback-base.store.js.map +1 -1
- package/dist/stores/message-feedback-guardrail.store.js +50 -47
- package/dist/stores/message-feedback-guardrail.store.js.map +1 -1
- package/dist/stores/message-feedback.store.js +84 -89
- package/dist/stores/message-feedback.store.js.map +1 -1
- package/dist/stores/session-feedback.store.js +46 -39
- package/dist/stores/session-feedback.store.js.map +1 -1
- package/dist/streaming/__tests__/agent-stream.test.d.ts +2 -0
- package/dist/streaming/__tests__/agent-stream.test.d.ts.map +1 -0
- package/dist/streaming/__tests__/agent-stream.test.js +92 -0
- package/dist/streaming/__tests__/agent-stream.test.js.map +1 -0
- package/dist/streaming/agent-stream.d.ts +83 -0
- package/dist/streaming/agent-stream.d.ts.map +1 -0
- package/dist/streaming/agent-stream.js +28 -0
- package/dist/streaming/agent-stream.js.map +1 -0
- package/dist/streaming/index.d.ts +3 -0
- package/dist/streaming/index.d.ts.map +1 -0
- package/dist/streaming/index.js +4 -0
- package/dist/streaming/index.js.map +1 -0
- package/dist/streaming/run-agent-stream.d.ts +23 -0
- package/dist/streaming/run-agent-stream.d.ts.map +1 -0
- package/dist/streaming/run-agent-stream.js +83 -0
- package/dist/streaming/run-agent-stream.js.map +1 -0
- package/dist/utils/__tests__/axios-utils.test.js +8 -7
- package/dist/utils/__tests__/axios-utils.test.js.map +1 -1
- package/dist/utils/axios-utils.js +9 -7
- package/dist/utils/axios-utils.js.map +1 -1
- package/dist/utils/test-utils.js +5 -5
- package/dist/utils/test-utils.js.map +1 -1
- package/package.json +6 -3
- package/src/api-client/__mocks__/chatbot-api-client.mock.ts +1 -0
- package/src/api-client/base/chatbot-api-client.ts +11 -0
- package/src/api-client/index.ts +2 -7
- package/src/api-client/models/index.ts +15 -13
- package/src/api-client/titan-chat/__tests__/chatbot-api-client-stream.test.ts +208 -0
- package/src/api-client/titan-chat/chatbot-api-client.ts +46 -0
- package/src/api-client/titan-chat/index.ts +2 -1
- package/src/api-client/utils/model-utils.ts +4 -8
- package/src/index.ts +7 -2
- package/src/models/__tests__/chatbot-customizations.test.ts +26 -0
- package/src/models/chatbot-customizations.ts +20 -0
- package/src/stores/__tests__/chatbot-ui-backend.store.observability.test.ts +105 -0
- package/src/stores/__tests__/chatbot-ui-backend.store.streaming.test.ts +261 -0
- package/src/stores/chatbot-ui-backend.store.ts +179 -4
- package/src/stores/index.ts +5 -12
- package/src/streaming/__tests__/agent-stream.test.ts +80 -0
- package/src/streaming/agent-stream.ts +103 -0
- package/src/streaming/index.ts +2 -0
- package/src/streaming/run-agent-stream.ts +109 -0
- package/tsconfig.tsbuildinfo +1 -1
- package/dist/api-client/help-center/__tests__/converter-from-models.test.d.ts +0 -2
- package/dist/api-client/help-center/__tests__/converter-from-models.test.d.ts.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js +0 -34
- package/dist/api-client/help-center/__tests__/converter-from-models.test.js.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-to-models.test.d.ts +0 -2
- package/dist/api-client/help-center/__tests__/converter-to-models.test.d.ts.map +0 -1
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js +0 -82
- package/dist/api-client/help-center/__tests__/converter-to-models.test.js.map +0 -1
- package/dist/api-client/help-center/chatbot-api-client.d.ts +0 -32
- package/dist/api-client/help-center/chatbot-api-client.d.ts.map +0 -1
- package/dist/api-client/help-center/chatbot-api-client.js +0 -102
- package/dist/api-client/help-center/chatbot-api-client.js.map +0 -1
- package/dist/api-client/help-center/converter-from-models.d.ts +0 -13
- package/dist/api-client/help-center/converter-from-models.d.ts.map +0 -1
- package/dist/api-client/help-center/converter-from-models.js +0 -114
- package/dist/api-client/help-center/converter-from-models.js.map +0 -1
- package/dist/api-client/help-center/converter-to-models.d.ts +0 -13
- package/dist/api-client/help-center/converter-to-models.d.ts.map +0 -1
- package/dist/api-client/help-center/converter-to-models.js +0 -98
- package/dist/api-client/help-center/converter-to-models.js.map +0 -1
- package/dist/api-client/help-center/index.d.ts +0 -2
- package/dist/api-client/help-center/index.d.ts.map +0 -1
- package/dist/api-client/help-center/index.js +0 -2
- package/dist/api-client/help-center/index.js.map +0 -1
- package/dist/api-client/help-center/native-client.d.ts +0 -1268
- package/dist/api-client/help-center/native-client.d.ts.map +0 -1
- package/dist/api-client/help-center/native-client.js +0 -6242
- package/dist/api-client/help-center/native-client.js.map +0 -1
- package/src/api-client/help-center/__tests__/converter-from-models.test.ts +0 -41
- package/src/api-client/help-center/__tests__/converter-to-models.test.ts +0 -89
- package/src/api-client/help-center/chatbot-api-client.ts +0 -122
- package/src/api-client/help-center/converter-from-models.ts +0 -133
- package/src/api-client/help-center/converter-to-models.ts +0 -127
- package/src/api-client/help-center/index.ts +0 -1
- package/src/api-client/help-center/native-client.ts +0 -5727
|
@@ -1,43 +1,30 @@
|
|
|
1
|
+
function _define_property(obj, key, value) {
|
|
2
|
+
if (key in obj) {
|
|
3
|
+
Object.defineProperty(obj, key, {
|
|
4
|
+
value: value,
|
|
5
|
+
enumerable: true,
|
|
6
|
+
configurable: true,
|
|
7
|
+
writable: true
|
|
8
|
+
});
|
|
9
|
+
} else {
|
|
10
|
+
obj[key] = value;
|
|
11
|
+
}
|
|
12
|
+
return obj;
|
|
13
|
+
}
|
|
1
14
|
//----------------------
|
|
2
15
|
// <auto-generated>
|
|
3
16
|
// Generated using the NSwag toolchain v14.2.0.0 (NJsonSchema v11.1.0.0 (Newtonsoft.Json v13.0.0.0)) (http://NSwag.org)
|
|
4
17
|
// </auto-generated>
|
|
5
18
|
//----------------------
|
|
6
|
-
/* tslint:disable */
|
|
7
|
-
/* eslint-disable */
|
|
8
|
-
// ReSharper disable InconsistentNaming
|
|
19
|
+
/* tslint:disable */ /* eslint-disable */ // ReSharper disable InconsistentNaming
|
|
9
20
|
export class Client {
|
|
10
|
-
constructor(baseUrl, http) {
|
|
11
|
-
Object.defineProperty(this, "http", {
|
|
12
|
-
enumerable: true,
|
|
13
|
-
configurable: true,
|
|
14
|
-
writable: true,
|
|
15
|
-
value: void 0
|
|
16
|
-
});
|
|
17
|
-
Object.defineProperty(this, "baseUrl", {
|
|
18
|
-
enumerable: true,
|
|
19
|
-
configurable: true,
|
|
20
|
-
writable: true,
|
|
21
|
-
value: void 0
|
|
22
|
-
});
|
|
23
|
-
Object.defineProperty(this, "jsonParseReviver", {
|
|
24
|
-
enumerable: true,
|
|
25
|
-
configurable: true,
|
|
26
|
-
writable: true,
|
|
27
|
-
value: undefined
|
|
28
|
-
});
|
|
29
|
-
this.http = http ? http : window;
|
|
30
|
-
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : '';
|
|
31
|
-
}
|
|
32
21
|
/**
|
|
33
22
|
* @param x_Client_ID (optional)
|
|
34
23
|
* @param body (optional)
|
|
35
24
|
* @return Success
|
|
36
|
-
*/
|
|
37
|
-
feedback(version, x_Client_ID, body, signal) {
|
|
25
|
+
*/ feedback(version, x_Client_ID, body, signal) {
|
|
38
26
|
let url_ = this.baseUrl + '/api/v{version}/feedback';
|
|
39
|
-
if (version === undefined || version === null)
|
|
40
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
27
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
41
28
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
42
29
|
url_ = url_.replace(/[?&]$/, '');
|
|
43
30
|
const content_ = JSON.stringify(body);
|
|
@@ -48,10 +35,10 @@ export class Client {
|
|
|
48
35
|
headers: {
|
|
49
36
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
50
37
|
'Content-Type': 'application/json',
|
|
51
|
-
'Accept': 'text/plain'
|
|
52
|
-
}
|
|
38
|
+
'Accept': 'text/plain'
|
|
39
|
+
}
|
|
53
40
|
};
|
|
54
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
41
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
55
42
|
return this.processFeedback(_response);
|
|
56
43
|
});
|
|
57
44
|
}
|
|
@@ -59,18 +46,17 @@ export class Client {
|
|
|
59
46
|
const status = response.status;
|
|
60
47
|
let _headers = {};
|
|
61
48
|
if (response.headers && response.headers.forEach) {
|
|
62
|
-
response.headers.forEach((v, k)
|
|
49
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
63
50
|
}
|
|
64
51
|
if (status === 200) {
|
|
65
|
-
return response.text().then(_responseText
|
|
52
|
+
return response.text().then((_responseText)=>{
|
|
66
53
|
let result200 = null;
|
|
67
54
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
68
55
|
result200 = Feedback.fromJS(resultData200);
|
|
69
56
|
return result200;
|
|
70
57
|
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
return response.text().then(_responseText => {
|
|
58
|
+
} else if (status !== 200 && status !== 204) {
|
|
59
|
+
return response.text().then((_responseText)=>{
|
|
74
60
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
75
61
|
});
|
|
76
62
|
}
|
|
@@ -80,11 +66,9 @@ export class Client {
|
|
|
80
66
|
* @param x_Client_ID (optional)
|
|
81
67
|
* @param body (optional)
|
|
82
68
|
* @return Success
|
|
83
|
-
*/
|
|
84
|
-
followUpEmail(version, x_Client_ID, body, signal) {
|
|
69
|
+
*/ followUpEmail(version, x_Client_ID, body, signal) {
|
|
85
70
|
let url_ = this.baseUrl + '/api/v{version}/follow-up-email';
|
|
86
|
-
if (version === undefined || version === null)
|
|
87
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
71
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
88
72
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
89
73
|
url_ = url_.replace(/[?&]$/, '');
|
|
90
74
|
const content_ = JSON.stringify(body);
|
|
@@ -95,10 +79,10 @@ export class Client {
|
|
|
95
79
|
headers: {
|
|
96
80
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
97
81
|
'Content-Type': 'application/json',
|
|
98
|
-
'Accept': 'text/plain'
|
|
99
|
-
}
|
|
82
|
+
'Accept': 'text/plain'
|
|
83
|
+
}
|
|
100
84
|
};
|
|
101
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
85
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
102
86
|
return this.processFollowUpEmail(_response);
|
|
103
87
|
});
|
|
104
88
|
}
|
|
@@ -106,33 +90,29 @@ export class Client {
|
|
|
106
90
|
const status = response.status;
|
|
107
91
|
let _headers = {};
|
|
108
92
|
if (response.headers && response.headers.forEach) {
|
|
109
|
-
response.headers.forEach((v, k)
|
|
93
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
110
94
|
}
|
|
111
95
|
if (status === 200) {
|
|
112
|
-
return response.text().then(_responseText
|
|
96
|
+
return response.text().then((_responseText)=>{
|
|
113
97
|
let result200 = null;
|
|
114
98
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
115
99
|
result200 = BotMessage.fromJS(resultData200);
|
|
116
100
|
return result200;
|
|
117
101
|
});
|
|
118
|
-
}
|
|
119
|
-
|
|
120
|
-
return response.text().then(_responseText => {
|
|
102
|
+
} else if (status === 500) {
|
|
103
|
+
return response.text().then((_responseText)=>{
|
|
121
104
|
return throwException('Server Error', status, _responseText, _headers);
|
|
122
105
|
});
|
|
123
|
-
}
|
|
124
|
-
|
|
125
|
-
return response.text().then(_responseText => {
|
|
106
|
+
} else if (status === 502) {
|
|
107
|
+
return response.text().then((_responseText)=>{
|
|
126
108
|
return throwException('Server Error', status, _responseText, _headers);
|
|
127
109
|
});
|
|
128
|
-
}
|
|
129
|
-
|
|
130
|
-
return response.text().then(_responseText => {
|
|
110
|
+
} else if (status === 504) {
|
|
111
|
+
return response.text().then((_responseText)=>{
|
|
131
112
|
return throwException('Server Error', status, _responseText, _headers);
|
|
132
113
|
});
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
return response.text().then(_responseText => {
|
|
114
|
+
} else if (status !== 200 && status !== 204) {
|
|
115
|
+
return response.text().then((_responseText)=>{
|
|
136
116
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
137
117
|
});
|
|
138
118
|
}
|
|
@@ -142,11 +122,9 @@ export class Client {
|
|
|
142
122
|
* @param x_Client_ID (optional)
|
|
143
123
|
* @param body (optional)
|
|
144
124
|
* @return Success
|
|
145
|
-
*/
|
|
146
|
-
message(version, x_Client_ID, body, signal) {
|
|
125
|
+
*/ message(version, x_Client_ID, body, signal) {
|
|
147
126
|
let url_ = this.baseUrl + '/api/v{version}/message';
|
|
148
|
-
if (version === undefined || version === null)
|
|
149
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
127
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
150
128
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
151
129
|
url_ = url_.replace(/[?&]$/, '');
|
|
152
130
|
const content_ = JSON.stringify(body);
|
|
@@ -157,10 +135,10 @@ export class Client {
|
|
|
157
135
|
headers: {
|
|
158
136
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
159
137
|
'Content-Type': 'application/json',
|
|
160
|
-
'Accept': 'text/plain'
|
|
161
|
-
}
|
|
138
|
+
'Accept': 'text/plain'
|
|
139
|
+
}
|
|
162
140
|
};
|
|
163
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
141
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
164
142
|
return this.processMessage(_response);
|
|
165
143
|
});
|
|
166
144
|
}
|
|
@@ -168,33 +146,29 @@ export class Client {
|
|
|
168
146
|
const status = response.status;
|
|
169
147
|
let _headers = {};
|
|
170
148
|
if (response.headers && response.headers.forEach) {
|
|
171
|
-
response.headers.forEach((v, k)
|
|
149
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
172
150
|
}
|
|
173
151
|
if (status === 200) {
|
|
174
|
-
return response.text().then(_responseText
|
|
152
|
+
return response.text().then((_responseText)=>{
|
|
175
153
|
let result200 = null;
|
|
176
154
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
177
155
|
result200 = BotMessage.fromJS(resultData200);
|
|
178
156
|
return result200;
|
|
179
157
|
});
|
|
180
|
-
}
|
|
181
|
-
|
|
182
|
-
return response.text().then(_responseText => {
|
|
158
|
+
} else if (status === 500) {
|
|
159
|
+
return response.text().then((_responseText)=>{
|
|
183
160
|
return throwException('Server Error', status, _responseText, _headers);
|
|
184
161
|
});
|
|
185
|
-
}
|
|
186
|
-
|
|
187
|
-
return response.text().then(_responseText => {
|
|
162
|
+
} else if (status === 502) {
|
|
163
|
+
return response.text().then((_responseText)=>{
|
|
188
164
|
return throwException('Server Error', status, _responseText, _headers);
|
|
189
165
|
});
|
|
190
|
-
}
|
|
191
|
-
|
|
192
|
-
return response.text().then(_responseText => {
|
|
166
|
+
} else if (status === 504) {
|
|
167
|
+
return response.text().then((_responseText)=>{
|
|
193
168
|
return throwException('Server Error', status, _responseText, _headers);
|
|
194
169
|
});
|
|
195
|
-
}
|
|
196
|
-
|
|
197
|
-
return response.text().then(_responseText => {
|
|
170
|
+
} else if (status !== 200 && status !== 204) {
|
|
171
|
+
return response.text().then((_responseText)=>{
|
|
198
172
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
199
173
|
});
|
|
200
174
|
}
|
|
@@ -203,11 +177,9 @@ export class Client {
|
|
|
203
177
|
/**
|
|
204
178
|
* @param x_Client_ID (optional)
|
|
205
179
|
* @return Success
|
|
206
|
-
*/
|
|
207
|
-
options(version, x_Client_ID, signal) {
|
|
180
|
+
*/ options(version, x_Client_ID, signal) {
|
|
208
181
|
let url_ = this.baseUrl + '/api/v{version}/options';
|
|
209
|
-
if (version === undefined || version === null)
|
|
210
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
182
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
211
183
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
212
184
|
url_ = url_.replace(/[?&]$/, '');
|
|
213
185
|
let options_ = {
|
|
@@ -215,10 +187,10 @@ export class Client {
|
|
|
215
187
|
signal,
|
|
216
188
|
headers: {
|
|
217
189
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
218
|
-
'Accept': 'text/plain'
|
|
219
|
-
}
|
|
190
|
+
'Accept': 'text/plain'
|
|
191
|
+
}
|
|
220
192
|
};
|
|
221
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
193
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
222
194
|
return this.processOptions(_response);
|
|
223
195
|
});
|
|
224
196
|
}
|
|
@@ -226,18 +198,17 @@ export class Client {
|
|
|
226
198
|
const status = response.status;
|
|
227
199
|
let _headers = {};
|
|
228
200
|
if (response.headers && response.headers.forEach) {
|
|
229
|
-
response.headers.forEach((v, k)
|
|
201
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
230
202
|
}
|
|
231
203
|
if (status === 200) {
|
|
232
|
-
return response.text().then(_responseText
|
|
204
|
+
return response.text().then((_responseText)=>{
|
|
233
205
|
let result200 = null;
|
|
234
206
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
235
207
|
result200 = FrontendModel.fromJS(resultData200);
|
|
236
208
|
return result200;
|
|
237
209
|
});
|
|
238
|
-
}
|
|
239
|
-
|
|
240
|
-
return response.text().then(_responseText => {
|
|
210
|
+
} else if (status !== 200 && status !== 204) {
|
|
211
|
+
return response.text().then((_responseText)=>{
|
|
241
212
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
242
213
|
});
|
|
243
214
|
}
|
|
@@ -247,11 +218,9 @@ export class Client {
|
|
|
247
218
|
* @param x_Client_ID (optional)
|
|
248
219
|
* @param body (optional)
|
|
249
220
|
* @return Success
|
|
250
|
-
*/
|
|
251
|
-
sessionPOST(version, x_Client_ID, body, signal) {
|
|
221
|
+
*/ sessionPOST(version, x_Client_ID, body, signal) {
|
|
252
222
|
let url_ = this.baseUrl + '/api/v{version}/session';
|
|
253
|
-
if (version === undefined || version === null)
|
|
254
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
223
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
255
224
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
256
225
|
url_ = url_.replace(/[?&]$/, '');
|
|
257
226
|
const content_ = JSON.stringify(body);
|
|
@@ -262,10 +231,10 @@ export class Client {
|
|
|
262
231
|
headers: {
|
|
263
232
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
264
233
|
'Content-Type': 'application/json',
|
|
265
|
-
'Accept': 'text/plain'
|
|
266
|
-
}
|
|
234
|
+
'Accept': 'text/plain'
|
|
235
|
+
}
|
|
267
236
|
};
|
|
268
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
237
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
269
238
|
return this.processSessionPOST(_response);
|
|
270
239
|
});
|
|
271
240
|
}
|
|
@@ -273,18 +242,17 @@ export class Client {
|
|
|
273
242
|
const status = response.status;
|
|
274
243
|
let _headers = {};
|
|
275
244
|
if (response.headers && response.headers.forEach) {
|
|
276
|
-
response.headers.forEach((v, k)
|
|
245
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
277
246
|
}
|
|
278
247
|
if (status === 200) {
|
|
279
|
-
return response.text().then(_responseText
|
|
248
|
+
return response.text().then((_responseText)=>{
|
|
280
249
|
let result200 = null;
|
|
281
250
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
282
251
|
result200 = Session.fromJS(resultData200);
|
|
283
252
|
return result200;
|
|
284
253
|
});
|
|
285
|
-
}
|
|
286
|
-
|
|
287
|
-
return response.text().then(_responseText => {
|
|
254
|
+
} else if (status !== 200 && status !== 204) {
|
|
255
|
+
return response.text().then((_responseText)=>{
|
|
288
256
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
289
257
|
});
|
|
290
258
|
}
|
|
@@ -294,11 +262,9 @@ export class Client {
|
|
|
294
262
|
* @param x_Client_ID (optional)
|
|
295
263
|
* @param body (optional)
|
|
296
264
|
* @return Success
|
|
297
|
-
*/
|
|
298
|
-
sessionPATCH(version, x_Client_ID, body, signal) {
|
|
265
|
+
*/ sessionPATCH(version, x_Client_ID, body, signal) {
|
|
299
266
|
let url_ = this.baseUrl + '/api/v{version}/session';
|
|
300
|
-
if (version === undefined || version === null)
|
|
301
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
267
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
302
268
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
303
269
|
url_ = url_.replace(/[?&]$/, '');
|
|
304
270
|
const content_ = JSON.stringify(body);
|
|
@@ -309,10 +275,10 @@ export class Client {
|
|
|
309
275
|
headers: {
|
|
310
276
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
311
277
|
'Content-Type': 'application/json',
|
|
312
|
-
'Accept': 'text/plain'
|
|
313
|
-
}
|
|
278
|
+
'Accept': 'text/plain'
|
|
279
|
+
}
|
|
314
280
|
};
|
|
315
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
281
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
316
282
|
return this.processSessionPATCH(_response);
|
|
317
283
|
});
|
|
318
284
|
}
|
|
@@ -320,18 +286,17 @@ export class Client {
|
|
|
320
286
|
const status = response.status;
|
|
321
287
|
let _headers = {};
|
|
322
288
|
if (response.headers && response.headers.forEach) {
|
|
323
|
-
response.headers.forEach((v, k)
|
|
289
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
324
290
|
}
|
|
325
291
|
if (status === 200) {
|
|
326
|
-
return response.text().then(_responseText
|
|
292
|
+
return response.text().then((_responseText)=>{
|
|
327
293
|
let result200 = null;
|
|
328
294
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
329
295
|
result200 = Session.fromJS(resultData200);
|
|
330
296
|
return result200;
|
|
331
297
|
});
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
return response.text().then(_responseText => {
|
|
298
|
+
} else if (status !== 200 && status !== 204) {
|
|
299
|
+
return response.text().then((_responseText)=>{
|
|
335
300
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
336
301
|
});
|
|
337
302
|
}
|
|
@@ -341,11 +306,9 @@ export class Client {
|
|
|
341
306
|
* @param x_Client_ID (optional)
|
|
342
307
|
* @param body (optional)
|
|
343
308
|
* @return Success
|
|
344
|
-
*/
|
|
345
|
-
sessionDELETE(version, x_Client_ID, body, signal) {
|
|
309
|
+
*/ sessionDELETE(version, x_Client_ID, body, signal) {
|
|
346
310
|
let url_ = this.baseUrl + '/api/v{version}/session';
|
|
347
|
-
if (version === undefined || version === null)
|
|
348
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
311
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
349
312
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
350
313
|
url_ = url_.replace(/[?&]$/, '');
|
|
351
314
|
const content_ = JSON.stringify(body);
|
|
@@ -356,10 +319,10 @@ export class Client {
|
|
|
356
319
|
headers: {
|
|
357
320
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
358
321
|
'Content-Type': 'application/json',
|
|
359
|
-
'Accept': 'text/plain'
|
|
360
|
-
}
|
|
322
|
+
'Accept': 'text/plain'
|
|
323
|
+
}
|
|
361
324
|
};
|
|
362
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
325
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
363
326
|
return this.processSessionDELETE(_response);
|
|
364
327
|
});
|
|
365
328
|
}
|
|
@@ -367,18 +330,17 @@ export class Client {
|
|
|
367
330
|
const status = response.status;
|
|
368
331
|
let _headers = {};
|
|
369
332
|
if (response.headers && response.headers.forEach) {
|
|
370
|
-
response.headers.forEach((v, k)
|
|
333
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
371
334
|
}
|
|
372
335
|
if (status === 200) {
|
|
373
|
-
return response.text().then(_responseText
|
|
336
|
+
return response.text().then((_responseText)=>{
|
|
374
337
|
let result200 = null;
|
|
375
338
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
376
339
|
result200 = Session.fromJS(resultData200);
|
|
377
340
|
return result200;
|
|
378
341
|
});
|
|
379
|
-
}
|
|
380
|
-
|
|
381
|
-
return response.text().then(_responseText => {
|
|
342
|
+
} else if (status !== 200 && status !== 204) {
|
|
343
|
+
return response.text().then((_responseText)=>{
|
|
382
344
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
383
345
|
});
|
|
384
346
|
}
|
|
@@ -387,14 +349,11 @@ export class Client {
|
|
|
387
349
|
/**
|
|
388
350
|
* @param x_Client_ID (optional)
|
|
389
351
|
* @return Success
|
|
390
|
-
*/
|
|
391
|
-
sessionGET(sessionId, version, x_Client_ID, signal) {
|
|
352
|
+
*/ sessionGET(sessionId, version, x_Client_ID, signal) {
|
|
392
353
|
let url_ = this.baseUrl + '/api/v{version}/session/{sessionId}';
|
|
393
|
-
if (sessionId === undefined || sessionId === null)
|
|
394
|
-
throw new Error("The parameter 'sessionId' must be defined.");
|
|
354
|
+
if (sessionId === undefined || sessionId === null) throw new Error("The parameter 'sessionId' must be defined.");
|
|
395
355
|
url_ = url_.replace('{sessionId}', encodeURIComponent('' + sessionId));
|
|
396
|
-
if (version === undefined || version === null)
|
|
397
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
356
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
398
357
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
399
358
|
url_ = url_.replace(/[?&]$/, '');
|
|
400
359
|
let options_ = {
|
|
@@ -402,10 +361,10 @@ export class Client {
|
|
|
402
361
|
signal,
|
|
403
362
|
headers: {
|
|
404
363
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
405
|
-
'Accept': 'text/plain'
|
|
406
|
-
}
|
|
364
|
+
'Accept': 'text/plain'
|
|
365
|
+
}
|
|
407
366
|
};
|
|
408
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
367
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
409
368
|
return this.processSessionGET(_response);
|
|
410
369
|
});
|
|
411
370
|
}
|
|
@@ -413,18 +372,17 @@ export class Client {
|
|
|
413
372
|
const status = response.status;
|
|
414
373
|
let _headers = {};
|
|
415
374
|
if (response.headers && response.headers.forEach) {
|
|
416
|
-
response.headers.forEach((v, k)
|
|
375
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
417
376
|
}
|
|
418
377
|
if (status === 200) {
|
|
419
|
-
return response.text().then(_responseText
|
|
378
|
+
return response.text().then((_responseText)=>{
|
|
420
379
|
let result200 = null;
|
|
421
380
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
422
381
|
result200 = Session.fromJS(resultData200);
|
|
423
382
|
return result200;
|
|
424
383
|
});
|
|
425
|
-
}
|
|
426
|
-
|
|
427
|
-
return response.text().then(_responseText => {
|
|
384
|
+
} else if (status !== 200 && status !== 204) {
|
|
385
|
+
return response.text().then((_responseText)=>{
|
|
428
386
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
429
387
|
});
|
|
430
388
|
}
|
|
@@ -433,14 +391,11 @@ export class Client {
|
|
|
433
391
|
/**
|
|
434
392
|
* @param x_Client_ID (optional)
|
|
435
393
|
* @return Success
|
|
436
|
-
*/
|
|
437
|
-
messages(sessionId, version, x_Client_ID, signal) {
|
|
394
|
+
*/ messages(sessionId, version, x_Client_ID, signal) {
|
|
438
395
|
let url_ = this.baseUrl + '/api/v{version}/session/{sessionId}/messages';
|
|
439
|
-
if (sessionId === undefined || sessionId === null)
|
|
440
|
-
throw new Error("The parameter 'sessionId' must be defined.");
|
|
396
|
+
if (sessionId === undefined || sessionId === null) throw new Error("The parameter 'sessionId' must be defined.");
|
|
441
397
|
url_ = url_.replace('{sessionId}', encodeURIComponent('' + sessionId));
|
|
442
|
-
if (version === undefined || version === null)
|
|
443
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
398
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
444
399
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
445
400
|
url_ = url_.replace(/[?&]$/, '');
|
|
446
401
|
let options_ = {
|
|
@@ -448,10 +403,10 @@ export class Client {
|
|
|
448
403
|
signal,
|
|
449
404
|
headers: {
|
|
450
405
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
451
|
-
'Accept': 'text/plain'
|
|
452
|
-
}
|
|
406
|
+
'Accept': 'text/plain'
|
|
407
|
+
}
|
|
453
408
|
};
|
|
454
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
409
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
455
410
|
return this.processMessages(_response);
|
|
456
411
|
});
|
|
457
412
|
}
|
|
@@ -459,25 +414,22 @@ export class Client {
|
|
|
459
414
|
const status = response.status;
|
|
460
415
|
let _headers = {};
|
|
461
416
|
if (response.headers && response.headers.forEach) {
|
|
462
|
-
response.headers.forEach((v, k)
|
|
417
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
463
418
|
}
|
|
464
419
|
if (status === 200) {
|
|
465
|
-
return response.text().then(_responseText
|
|
420
|
+
return response.text().then((_responseText)=>{
|
|
466
421
|
let result200 = null;
|
|
467
422
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
468
423
|
if (Array.isArray(resultData200)) {
|
|
469
424
|
result200 = [];
|
|
470
|
-
for (let item of resultData200)
|
|
471
|
-
|
|
472
|
-
}
|
|
473
|
-
else {
|
|
425
|
+
for (let item of resultData200)result200.push(Message.fromJS(item));
|
|
426
|
+
} else {
|
|
474
427
|
result200 = null;
|
|
475
428
|
}
|
|
476
429
|
return result200;
|
|
477
430
|
});
|
|
478
|
-
}
|
|
479
|
-
|
|
480
|
-
return response.text().then(_responseText => {
|
|
431
|
+
} else if (status !== 200 && status !== 204) {
|
|
432
|
+
return response.text().then((_responseText)=>{
|
|
481
433
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
482
434
|
});
|
|
483
435
|
}
|
|
@@ -487,11 +439,9 @@ export class Client {
|
|
|
487
439
|
* @param x_Client_ID (optional)
|
|
488
440
|
* @param body (optional)
|
|
489
441
|
* @return Success
|
|
490
|
-
*/
|
|
491
|
-
summarize(version, x_Client_ID, body, signal) {
|
|
442
|
+
*/ summarize(version, x_Client_ID, body, signal) {
|
|
492
443
|
let url_ = this.baseUrl + '/api/v{version}/summarize';
|
|
493
|
-
if (version === undefined || version === null)
|
|
494
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
444
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
495
445
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
496
446
|
url_ = url_.replace(/[?&]$/, '');
|
|
497
447
|
const content_ = JSON.stringify(body);
|
|
@@ -502,10 +452,10 @@ export class Client {
|
|
|
502
452
|
headers: {
|
|
503
453
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
504
454
|
'Content-Type': 'application/json',
|
|
505
|
-
'Accept': 'text/plain'
|
|
506
|
-
}
|
|
455
|
+
'Accept': 'text/plain'
|
|
456
|
+
}
|
|
507
457
|
};
|
|
508
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
458
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
509
459
|
return this.processSummarize(_response);
|
|
510
460
|
});
|
|
511
461
|
}
|
|
@@ -513,33 +463,29 @@ export class Client {
|
|
|
513
463
|
const status = response.status;
|
|
514
464
|
let _headers = {};
|
|
515
465
|
if (response.headers && response.headers.forEach) {
|
|
516
|
-
response.headers.forEach((v, k)
|
|
466
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
517
467
|
}
|
|
518
468
|
if (status === 200) {
|
|
519
|
-
return response.text().then(_responseText
|
|
469
|
+
return response.text().then((_responseText)=>{
|
|
520
470
|
let result200 = null;
|
|
521
471
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
522
472
|
result200 = SummarizeResponse.fromJS(resultData200);
|
|
523
473
|
return result200;
|
|
524
474
|
});
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
return response.text().then(_responseText => {
|
|
475
|
+
} else if (status === 500) {
|
|
476
|
+
return response.text().then((_responseText)=>{
|
|
528
477
|
return throwException('Server Error', status, _responseText, _headers);
|
|
529
478
|
});
|
|
530
|
-
}
|
|
531
|
-
|
|
532
|
-
return response.text().then(_responseText => {
|
|
479
|
+
} else if (status === 502) {
|
|
480
|
+
return response.text().then((_responseText)=>{
|
|
533
481
|
return throwException('Server Error', status, _responseText, _headers);
|
|
534
482
|
});
|
|
535
|
-
}
|
|
536
|
-
|
|
537
|
-
return response.text().then(_responseText => {
|
|
483
|
+
} else if (status === 504) {
|
|
484
|
+
return response.text().then((_responseText)=>{
|
|
538
485
|
return throwException('Server Error', status, _responseText, _headers);
|
|
539
486
|
});
|
|
540
|
-
}
|
|
541
|
-
|
|
542
|
-
return response.text().then(_responseText => {
|
|
487
|
+
} else if (status !== 200 && status !== 204) {
|
|
488
|
+
return response.text().then((_responseText)=>{
|
|
543
489
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
544
490
|
});
|
|
545
491
|
}
|
|
@@ -550,30 +496,24 @@ export class Client {
|
|
|
550
496
|
* @param end (optional)
|
|
551
497
|
* @param x_Client_ID (optional)
|
|
552
498
|
* @return Success
|
|
553
|
-
*/
|
|
554
|
-
transcripts(start, end, version, x_Client_ID, signal) {
|
|
499
|
+
*/ transcripts(start, end, version, x_Client_ID, signal) {
|
|
555
500
|
let url_ = this.baseUrl + '/api/v{version}/transcripts?';
|
|
556
|
-
if (version === undefined || version === null)
|
|
557
|
-
throw new Error("The parameter 'version' must be defined.");
|
|
501
|
+
if (version === undefined || version === null) throw new Error("The parameter 'version' must be defined.");
|
|
558
502
|
url_ = url_.replace('{version}', encodeURIComponent('' + version));
|
|
559
|
-
if (start === null)
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
if (end === null)
|
|
564
|
-
throw new Error("The parameter 'end' cannot be null.");
|
|
565
|
-
else if (end !== undefined)
|
|
566
|
-
url_ += 'end=' + encodeURIComponent(end ? '' + end.toISOString() : '') + '&';
|
|
503
|
+
if (start === null) throw new Error("The parameter 'start' cannot be null.");
|
|
504
|
+
else if (start !== undefined) url_ += 'start=' + encodeURIComponent(start ? '' + start.toISOString() : '') + '&';
|
|
505
|
+
if (end === null) throw new Error("The parameter 'end' cannot be null.");
|
|
506
|
+
else if (end !== undefined) url_ += 'end=' + encodeURIComponent(end ? '' + end.toISOString() : '') + '&';
|
|
567
507
|
url_ = url_.replace(/[?&]$/, '');
|
|
568
508
|
let options_ = {
|
|
569
509
|
method: 'GET',
|
|
570
510
|
signal,
|
|
571
511
|
headers: {
|
|
572
512
|
'X-Client-ID': x_Client_ID !== undefined && x_Client_ID !== null ? '' + x_Client_ID : '',
|
|
573
|
-
'Accept': 'text/plain'
|
|
574
|
-
}
|
|
513
|
+
'Accept': 'text/plain'
|
|
514
|
+
}
|
|
575
515
|
};
|
|
576
|
-
return this.http.fetch(url_, options_).then((_response)
|
|
516
|
+
return this.http.fetch(url_, options_).then((_response)=>{
|
|
577
517
|
return this.processTranscripts(_response);
|
|
578
518
|
});
|
|
579
519
|
}
|
|
@@ -581,59 +521,36 @@ export class Client {
|
|
|
581
521
|
const status = response.status;
|
|
582
522
|
let _headers = {};
|
|
583
523
|
if (response.headers && response.headers.forEach) {
|
|
584
|
-
response.headers.forEach((v, k)
|
|
524
|
+
response.headers.forEach((v, k)=>_headers[k] = v);
|
|
585
525
|
}
|
|
586
526
|
if (status === 200) {
|
|
587
|
-
return response.text().then(_responseText
|
|
527
|
+
return response.text().then((_responseText)=>{
|
|
588
528
|
let result200 = null;
|
|
589
529
|
let resultData200 = _responseText === '' ? null : JSON.parse(_responseText, this.jsonParseReviver);
|
|
590
530
|
if (Array.isArray(resultData200)) {
|
|
591
531
|
result200 = [];
|
|
592
|
-
for (let item of resultData200)
|
|
593
|
-
|
|
594
|
-
}
|
|
595
|
-
else {
|
|
532
|
+
for (let item of resultData200)result200.push(ExportHistoryMessage.fromJS(item));
|
|
533
|
+
} else {
|
|
596
534
|
result200 = null;
|
|
597
535
|
}
|
|
598
536
|
return result200;
|
|
599
537
|
});
|
|
600
|
-
}
|
|
601
|
-
|
|
602
|
-
return response.text().then(_responseText => {
|
|
538
|
+
} else if (status !== 200 && status !== 204) {
|
|
539
|
+
return response.text().then((_responseText)=>{
|
|
603
540
|
return throwException('An unexpected server error occurred.', status, _responseText, _headers);
|
|
604
541
|
});
|
|
605
542
|
}
|
|
606
543
|
return Promise.resolve(null);
|
|
607
544
|
}
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
configurable: true,
|
|
615
|
-
writable: true,
|
|
616
|
-
value: void 0
|
|
617
|
-
});
|
|
618
|
-
Object.defineProperty(this, "passPhrase", {
|
|
619
|
-
enumerable: true,
|
|
620
|
-
configurable: true,
|
|
621
|
-
writable: true,
|
|
622
|
-
value: void 0
|
|
623
|
-
});
|
|
624
|
-
Object.defineProperty(this, "caption", {
|
|
625
|
-
enumerable: true,
|
|
626
|
-
configurable: true,
|
|
627
|
-
writable: true,
|
|
628
|
-
value: void 0
|
|
629
|
-
});
|
|
630
|
-
if (data) {
|
|
631
|
-
for (var property in data) {
|
|
632
|
-
if (data.hasOwnProperty(property))
|
|
633
|
-
this[property] = data[property];
|
|
634
|
-
}
|
|
635
|
-
}
|
|
545
|
+
constructor(baseUrl, http){
|
|
546
|
+
_define_property(this, "http", void 0);
|
|
547
|
+
_define_property(this, "baseUrl", void 0);
|
|
548
|
+
_define_property(this, "jsonParseReviver", undefined);
|
|
549
|
+
this.http = http ? http : window;
|
|
550
|
+
this.baseUrl = baseUrl !== null && baseUrl !== void 0 ? baseUrl : '';
|
|
636
551
|
}
|
|
552
|
+
}
|
|
553
|
+
/** One selectable agentic action choice. */ export class AgentOption {
|
|
637
554
|
init(_data) {
|
|
638
555
|
if (_data) {
|
|
639
556
|
this.agentId = _data['agentId'];
|
|
@@ -654,50 +571,23 @@ export class AgentOption {
|
|
|
654
571
|
data['caption'] = this.caption;
|
|
655
572
|
return data;
|
|
656
573
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
Object.defineProperty(this, "id", {
|
|
662
|
-
enumerable: true,
|
|
663
|
-
configurable: true,
|
|
664
|
-
writable: true,
|
|
665
|
-
value: void 0
|
|
666
|
-
});
|
|
667
|
-
/** Session ID. Required in multi-turn conversations after the session is created. */
|
|
668
|
-
Object.defineProperty(this, "sessionId", {
|
|
669
|
-
enumerable: true,
|
|
670
|
-
configurable: true,
|
|
671
|
-
writable: true,
|
|
672
|
-
value: void 0
|
|
673
|
-
});
|
|
674
|
-
Object.defineProperty(this, "timeStamp", {
|
|
675
|
-
enumerable: true,
|
|
676
|
-
configurable: true,
|
|
677
|
-
writable: true,
|
|
678
|
-
value: void 0
|
|
679
|
-
});
|
|
680
|
-
Object.defineProperty(this, "_discriminator", {
|
|
681
|
-
enumerable: true,
|
|
682
|
-
configurable: true,
|
|
683
|
-
writable: true,
|
|
684
|
-
value: void 0
|
|
685
|
-
});
|
|
574
|
+
constructor(data){
|
|
575
|
+
_define_property(this, "agentId", void 0);
|
|
576
|
+
_define_property(this, "passPhrase", void 0);
|
|
577
|
+
_define_property(this, "caption", void 0);
|
|
686
578
|
if (data) {
|
|
687
|
-
for
|
|
688
|
-
if (data.hasOwnProperty(property))
|
|
689
|
-
this[property] = data[property];
|
|
579
|
+
for(var property in data){
|
|
580
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
690
581
|
}
|
|
691
582
|
}
|
|
692
|
-
this._discriminator = 'Message';
|
|
693
583
|
}
|
|
584
|
+
}
|
|
585
|
+
export class Message {
|
|
694
586
|
init(_data) {
|
|
695
587
|
if (_data) {
|
|
696
588
|
this.id = _data['id'];
|
|
697
589
|
this.sessionId = _data['sessionId'];
|
|
698
|
-
this.timeStamp = _data['timeStamp']
|
|
699
|
-
? new Date(_data['timeStamp'].toString())
|
|
700
|
-
: undefined;
|
|
590
|
+
this.timeStamp = _data['timeStamp'] ? new Date(_data['timeStamp'].toString()) : undefined;
|
|
701
591
|
}
|
|
702
592
|
}
|
|
703
593
|
static fromJS(data) {
|
|
@@ -724,21 +614,27 @@ export class Message {
|
|
|
724
614
|
data['timeStamp'] = this.timeStamp ? this.timeStamp.toISOString() : undefined;
|
|
725
615
|
return data;
|
|
726
616
|
}
|
|
727
|
-
|
|
728
|
-
/**
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
617
|
+
constructor(data){
|
|
618
|
+
/** Primary key. */ _define_property(this, "id", void 0);
|
|
619
|
+
/** Session ID. Required in multi-turn conversations after the session is created. */ _define_property(this, "sessionId", void 0);
|
|
620
|
+
_define_property(this, "timeStamp", void 0);
|
|
621
|
+
_define_property(this, "_discriminator", void 0);
|
|
622
|
+
if (data) {
|
|
623
|
+
for(var property in data){
|
|
624
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
625
|
+
}
|
|
626
|
+
}
|
|
627
|
+
this._discriminator = 'Message';
|
|
733
628
|
}
|
|
629
|
+
}
|
|
630
|
+
/** Chatbot response message. */ export class BotMessage extends Message {
|
|
734
631
|
init(_data) {
|
|
735
632
|
super.init(_data);
|
|
736
633
|
if (_data) {
|
|
737
634
|
this.answer = _data['answer'];
|
|
738
635
|
if (Array.isArray(_data['scoredUrls'])) {
|
|
739
636
|
this.scoredUrls = [];
|
|
740
|
-
for (let item of _data['scoredUrls'])
|
|
741
|
-
this.scoredUrls.push(ScoredUrl.fromJS(item));
|
|
637
|
+
for (let item of _data['scoredUrls'])this.scoredUrls.push(ScoredUrl.fromJS(item));
|
|
742
638
|
}
|
|
743
639
|
this.guardFlag = _data['guardFlag'];
|
|
744
640
|
this.isGuardrailed = _data['isGuardrailed'];
|
|
@@ -748,12 +644,9 @@ export class BotMessage extends Message {
|
|
|
748
644
|
this.confidenceScore = _data['confidenceScore'];
|
|
749
645
|
if (Array.isArray(_data['agentOptions'])) {
|
|
750
646
|
this.agentOptions = [];
|
|
751
|
-
for (let item of _data['agentOptions'])
|
|
752
|
-
this.agentOptions.push(AgentOption.fromJS(item));
|
|
647
|
+
for (let item of _data['agentOptions'])this.agentOptions.push(AgentOption.fromJS(item));
|
|
753
648
|
}
|
|
754
|
-
this.workflowPlan = _data['workflowPlan']
|
|
755
|
-
? WorkflowPlan.fromJS(_data['workflowPlan'])
|
|
756
|
-
: undefined;
|
|
649
|
+
this.workflowPlan = _data['workflowPlan'] ? WorkflowPlan.fromJS(_data['workflowPlan']) : undefined;
|
|
757
650
|
}
|
|
758
651
|
}
|
|
759
652
|
static fromJS(data) {
|
|
@@ -767,8 +660,7 @@ export class BotMessage extends Message {
|
|
|
767
660
|
data['answer'] = this.answer;
|
|
768
661
|
if (Array.isArray(this.scoredUrls)) {
|
|
769
662
|
data['scoredUrls'] = [];
|
|
770
|
-
for (let item of this.scoredUrls)
|
|
771
|
-
data['scoredUrls'].push(item.toJSON());
|
|
663
|
+
for (let item of this.scoredUrls)data['scoredUrls'].push(item.toJSON());
|
|
772
664
|
}
|
|
773
665
|
data['guardFlag'] = this.guardFlag;
|
|
774
666
|
data['isGuardrailed'] = this.isGuardrailed;
|
|
@@ -778,159 +670,32 @@ export class BotMessage extends Message {
|
|
|
778
670
|
data['confidenceScore'] = this.confidenceScore;
|
|
779
671
|
if (Array.isArray(this.agentOptions)) {
|
|
780
672
|
data['agentOptions'] = [];
|
|
781
|
-
for (let item of this.agentOptions)
|
|
782
|
-
data['agentOptions'].push(item.toJSON());
|
|
673
|
+
for (let item of this.agentOptions)data['agentOptions'].push(item.toJSON());
|
|
783
674
|
}
|
|
784
675
|
data['workflowPlan'] = this.workflowPlan ? this.workflowPlan.toJSON() : undefined;
|
|
785
676
|
super.toJSON(data);
|
|
786
677
|
return data;
|
|
787
678
|
}
|
|
679
|
+
constructor(data){
|
|
680
|
+
super(data);
|
|
681
|
+
this._discriminator = 'BotMessage';
|
|
682
|
+
}
|
|
788
683
|
}
|
|
789
|
-
export var Experience
|
|
790
|
-
(function (Experience) {
|
|
684
|
+
export var Experience = /*#__PURE__*/ function(Experience) {
|
|
791
685
|
Experience[Experience["SingleTurn"] = 1] = "SingleTurn";
|
|
792
686
|
Experience[Experience["MultiTurn"] = 2] = "MultiTurn";
|
|
793
|
-
|
|
687
|
+
return Experience;
|
|
688
|
+
}({});
|
|
794
689
|
export class ExportHistoryMessage {
|
|
795
|
-
constructor(data) {
|
|
796
|
-
/** Primary key. */
|
|
797
|
-
Object.defineProperty(this, "id", {
|
|
798
|
-
enumerable: true,
|
|
799
|
-
configurable: true,
|
|
800
|
-
writable: true,
|
|
801
|
-
value: void 0
|
|
802
|
-
});
|
|
803
|
-
/** Session ID. Required in multi-turn conversations after the session is created. */
|
|
804
|
-
Object.defineProperty(this, "sessionId", {
|
|
805
|
-
enumerable: true,
|
|
806
|
-
configurable: true,
|
|
807
|
-
writable: true,
|
|
808
|
-
value: void 0
|
|
809
|
-
});
|
|
810
|
-
Object.defineProperty(this, "timeStamp", {
|
|
811
|
-
enumerable: true,
|
|
812
|
-
configurable: true,
|
|
813
|
-
writable: true,
|
|
814
|
-
value: void 0
|
|
815
|
-
});
|
|
816
|
-
Object.defineProperty(this, "clientId", {
|
|
817
|
-
enumerable: true,
|
|
818
|
-
configurable: true,
|
|
819
|
-
writable: true,
|
|
820
|
-
value: void 0
|
|
821
|
-
});
|
|
822
|
-
Object.defineProperty(this, "userId", {
|
|
823
|
-
enumerable: true,
|
|
824
|
-
configurable: true,
|
|
825
|
-
writable: true,
|
|
826
|
-
value: void 0
|
|
827
|
-
});
|
|
828
|
-
Object.defineProperty(this, "sessionStartTime", {
|
|
829
|
-
enumerable: true,
|
|
830
|
-
configurable: true,
|
|
831
|
-
writable: true,
|
|
832
|
-
value: void 0
|
|
833
|
-
});
|
|
834
|
-
Object.defineProperty(this, "sessionEndTime", {
|
|
835
|
-
enumerable: true,
|
|
836
|
-
configurable: true,
|
|
837
|
-
writable: true,
|
|
838
|
-
value: void 0
|
|
839
|
-
});
|
|
840
|
-
Object.defineProperty(this, "userName", {
|
|
841
|
-
enumerable: true,
|
|
842
|
-
configurable: true,
|
|
843
|
-
writable: true,
|
|
844
|
-
value: void 0
|
|
845
|
-
});
|
|
846
|
-
Object.defineProperty(this, "userEmail", {
|
|
847
|
-
enumerable: true,
|
|
848
|
-
configurable: true,
|
|
849
|
-
writable: true,
|
|
850
|
-
value: void 0
|
|
851
|
-
});
|
|
852
|
-
Object.defineProperty(this, "question", {
|
|
853
|
-
enumerable: true,
|
|
854
|
-
configurable: true,
|
|
855
|
-
writable: true,
|
|
856
|
-
value: void 0
|
|
857
|
-
});
|
|
858
|
-
Object.defineProperty(this, "answer", {
|
|
859
|
-
enumerable: true,
|
|
860
|
-
configurable: true,
|
|
861
|
-
writable: true,
|
|
862
|
-
value: void 0
|
|
863
|
-
});
|
|
864
|
-
Object.defineProperty(this, "messageType", {
|
|
865
|
-
enumerable: true,
|
|
866
|
-
configurable: true,
|
|
867
|
-
writable: true,
|
|
868
|
-
value: void 0
|
|
869
|
-
});
|
|
870
|
-
Object.defineProperty(this, "salesforceCaseId", {
|
|
871
|
-
enumerable: true,
|
|
872
|
-
configurable: true,
|
|
873
|
-
writable: true,
|
|
874
|
-
value: void 0
|
|
875
|
-
});
|
|
876
|
-
Object.defineProperty(this, "guardFlag", {
|
|
877
|
-
enumerable: true,
|
|
878
|
-
configurable: true,
|
|
879
|
-
writable: true,
|
|
880
|
-
value: void 0
|
|
881
|
-
});
|
|
882
|
-
Object.defineProperty(this, "isGuardrailed", {
|
|
883
|
-
enumerable: true,
|
|
884
|
-
configurable: true,
|
|
885
|
-
writable: true,
|
|
886
|
-
value: void 0
|
|
887
|
-
});
|
|
888
|
-
Object.defineProperty(this, "botVersion", {
|
|
889
|
-
enumerable: true,
|
|
890
|
-
configurable: true,
|
|
891
|
-
writable: true,
|
|
892
|
-
value: void 0
|
|
893
|
-
});
|
|
894
|
-
Object.defineProperty(this, "metadata", {
|
|
895
|
-
enumerable: true,
|
|
896
|
-
configurable: true,
|
|
897
|
-
writable: true,
|
|
898
|
-
value: void 0
|
|
899
|
-
});
|
|
900
|
-
Object.defineProperty(this, "feedback", {
|
|
901
|
-
enumerable: true,
|
|
902
|
-
configurable: true,
|
|
903
|
-
writable: true,
|
|
904
|
-
value: void 0
|
|
905
|
-
});
|
|
906
|
-
Object.defineProperty(this, "sessionFeedback", {
|
|
907
|
-
enumerable: true,
|
|
908
|
-
configurable: true,
|
|
909
|
-
writable: true,
|
|
910
|
-
value: void 0
|
|
911
|
-
});
|
|
912
|
-
if (data) {
|
|
913
|
-
for (var property in data) {
|
|
914
|
-
if (data.hasOwnProperty(property))
|
|
915
|
-
this[property] = data[property];
|
|
916
|
-
}
|
|
917
|
-
}
|
|
918
|
-
}
|
|
919
690
|
init(_data) {
|
|
920
691
|
if (_data) {
|
|
921
692
|
this.id = _data['id'];
|
|
922
693
|
this.sessionId = _data['sessionId'];
|
|
923
|
-
this.timeStamp = _data['timeStamp']
|
|
924
|
-
? new Date(_data['timeStamp'].toString())
|
|
925
|
-
: undefined;
|
|
694
|
+
this.timeStamp = _data['timeStamp'] ? new Date(_data['timeStamp'].toString()) : undefined;
|
|
926
695
|
this.clientId = _data['clientId'];
|
|
927
696
|
this.userId = _data['userId'];
|
|
928
|
-
this.sessionStartTime = _data['sessionStartTime']
|
|
929
|
-
|
|
930
|
-
: undefined;
|
|
931
|
-
this.sessionEndTime = _data['sessionEndTime']
|
|
932
|
-
? new Date(_data['sessionEndTime'].toString())
|
|
933
|
-
: undefined;
|
|
697
|
+
this.sessionStartTime = _data['sessionStartTime'] ? new Date(_data['sessionStartTime'].toString()) : undefined;
|
|
698
|
+
this.sessionEndTime = _data['sessionEndTime'] ? new Date(_data['sessionEndTime'].toString()) : undefined;
|
|
934
699
|
this.userName = _data['userName'];
|
|
935
700
|
this.userEmail = _data['userEmail'];
|
|
936
701
|
this.question = _data['question'];
|
|
@@ -942,9 +707,7 @@ export class ExportHistoryMessage {
|
|
|
942
707
|
this.botVersion = _data['botVersion'];
|
|
943
708
|
this.metadata = _data['metadata'];
|
|
944
709
|
this.feedback = _data['feedback'] ? Feedback.fromJS(_data['feedback']) : undefined;
|
|
945
|
-
this.sessionFeedback = _data['sessionFeedback']
|
|
946
|
-
? Feedback.fromJS(_data['sessionFeedback'])
|
|
947
|
-
: undefined;
|
|
710
|
+
this.sessionFeedback = _data['sessionFeedback'] ? Feedback.fromJS(_data['sessionFeedback']) : undefined;
|
|
948
711
|
}
|
|
949
712
|
}
|
|
950
713
|
static fromJS(data) {
|
|
@@ -960,12 +723,8 @@ export class ExportHistoryMessage {
|
|
|
960
723
|
data['timeStamp'] = this.timeStamp ? this.timeStamp.toISOString() : undefined;
|
|
961
724
|
data['clientId'] = this.clientId;
|
|
962
725
|
data['userId'] = this.userId;
|
|
963
|
-
data['sessionStartTime'] = this.sessionStartTime
|
|
964
|
-
|
|
965
|
-
: undefined;
|
|
966
|
-
data['sessionEndTime'] = this.sessionEndTime
|
|
967
|
-
? this.sessionEndTime.toISOString()
|
|
968
|
-
: undefined;
|
|
726
|
+
data['sessionStartTime'] = this.sessionStartTime ? this.sessionStartTime.toISOString() : undefined;
|
|
727
|
+
data['sessionEndTime'] = this.sessionEndTime ? this.sessionEndTime.toISOString() : undefined;
|
|
969
728
|
data['userName'] = this.userName;
|
|
970
729
|
data['userEmail'] = this.userEmail;
|
|
971
730
|
data['question'] = this.question;
|
|
@@ -977,63 +736,37 @@ export class ExportHistoryMessage {
|
|
|
977
736
|
data['botVersion'] = this.botVersion;
|
|
978
737
|
data['metadata'] = this.metadata;
|
|
979
738
|
data['feedback'] = this.feedback ? this.feedback.toJSON() : undefined;
|
|
980
|
-
data['sessionFeedback'] = this.sessionFeedback
|
|
981
|
-
? this.sessionFeedback.toJSON()
|
|
982
|
-
: undefined;
|
|
739
|
+
data['sessionFeedback'] = this.sessionFeedback ? this.sessionFeedback.toJSON() : undefined;
|
|
983
740
|
return data;
|
|
984
741
|
}
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
enumerable: true,
|
|
1006
|
-
configurable: true,
|
|
1007
|
-
writable: true,
|
|
1008
|
-
value: void 0
|
|
1009
|
-
});
|
|
1010
|
-
/** Message ID for message feedback. */
|
|
1011
|
-
Object.defineProperty(this, "messageId", {
|
|
1012
|
-
enumerable: true,
|
|
1013
|
-
configurable: true,
|
|
1014
|
-
writable: true,
|
|
1015
|
-
value: void 0
|
|
1016
|
-
});
|
|
1017
|
-
/** Selected options. */
|
|
1018
|
-
Object.defineProperty(this, "options", {
|
|
1019
|
-
enumerable: true,
|
|
1020
|
-
configurable: true,
|
|
1021
|
-
writable: true,
|
|
1022
|
-
value: void 0
|
|
1023
|
-
});
|
|
1024
|
-
Object.defineProperty(this, "rating", {
|
|
1025
|
-
enumerable: true,
|
|
1026
|
-
configurable: true,
|
|
1027
|
-
writable: true,
|
|
1028
|
-
value: void 0
|
|
1029
|
-
});
|
|
742
|
+
constructor(data){
|
|
743
|
+
/** Primary key. */ _define_property(this, "id", void 0);
|
|
744
|
+
/** Session ID. Required in multi-turn conversations after the session is created. */ _define_property(this, "sessionId", void 0);
|
|
745
|
+
_define_property(this, "timeStamp", void 0);
|
|
746
|
+
_define_property(this, "clientId", void 0);
|
|
747
|
+
_define_property(this, "userId", void 0);
|
|
748
|
+
_define_property(this, "sessionStartTime", void 0);
|
|
749
|
+
_define_property(this, "sessionEndTime", void 0);
|
|
750
|
+
_define_property(this, "userName", void 0);
|
|
751
|
+
_define_property(this, "userEmail", void 0);
|
|
752
|
+
_define_property(this, "question", void 0);
|
|
753
|
+
_define_property(this, "answer", void 0);
|
|
754
|
+
_define_property(this, "messageType", void 0);
|
|
755
|
+
_define_property(this, "salesforceCaseId", void 0);
|
|
756
|
+
_define_property(this, "guardFlag", void 0);
|
|
757
|
+
_define_property(this, "isGuardrailed", void 0);
|
|
758
|
+
_define_property(this, "botVersion", void 0);
|
|
759
|
+
_define_property(this, "metadata", void 0);
|
|
760
|
+
_define_property(this, "feedback", void 0);
|
|
761
|
+
_define_property(this, "sessionFeedback", void 0);
|
|
1030
762
|
if (data) {
|
|
1031
|
-
for
|
|
1032
|
-
if (data.hasOwnProperty(property))
|
|
1033
|
-
this[property] = data[property];
|
|
763
|
+
for(var property in data){
|
|
764
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1034
765
|
}
|
|
1035
766
|
}
|
|
1036
767
|
}
|
|
768
|
+
}
|
|
769
|
+
/** User feedback for chatbot interaction. */ export class Feedback {
|
|
1037
770
|
init(_data) {
|
|
1038
771
|
if (_data) {
|
|
1039
772
|
this.linkUrl = _data['linkUrl'];
|
|
@@ -1042,8 +775,7 @@ export class Feedback {
|
|
|
1042
775
|
this.messageId = _data['messageId'];
|
|
1043
776
|
if (Array.isArray(_data['options'])) {
|
|
1044
777
|
this.options = [];
|
|
1045
|
-
for (let item of _data['options'])
|
|
1046
|
-
this.options.push(item);
|
|
778
|
+
for (let item of _data['options'])this.options.push(item);
|
|
1047
779
|
}
|
|
1048
780
|
this.rating = _data['rating'];
|
|
1049
781
|
}
|
|
@@ -1062,45 +794,40 @@ export class Feedback {
|
|
|
1062
794
|
data['messageId'] = this.messageId;
|
|
1063
795
|
if (Array.isArray(this.options)) {
|
|
1064
796
|
data['options'] = [];
|
|
1065
|
-
for (let item of this.options)
|
|
1066
|
-
data['options'].push(item);
|
|
797
|
+
for (let item of this.options)data['options'].push(item);
|
|
1067
798
|
}
|
|
1068
799
|
data['rating'] = this.rating;
|
|
1069
800
|
return data;
|
|
1070
801
|
}
|
|
802
|
+
constructor(data){
|
|
803
|
+
/** A link to correct information according to user. */ _define_property(this, "linkUrl", void 0);
|
|
804
|
+
/** User typed input. */ _define_property(this, "description", void 0);
|
|
805
|
+
/** Session ID for session feedback. */ _define_property(this, "sessionId", void 0);
|
|
806
|
+
/** Message ID for message feedback. */ _define_property(this, "messageId", void 0);
|
|
807
|
+
/** Selected options. */ _define_property(this, "options", void 0);
|
|
808
|
+
_define_property(this, "rating", void 0);
|
|
809
|
+
if (data) {
|
|
810
|
+
for(var property in data){
|
|
811
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
812
|
+
}
|
|
813
|
+
}
|
|
814
|
+
}
|
|
1071
815
|
}
|
|
1072
|
-
export var FeedbackOptions
|
|
1073
|
-
(function (FeedbackOptions) {
|
|
816
|
+
export var FeedbackOptions = /*#__PURE__*/ function(FeedbackOptions) {
|
|
1074
817
|
FeedbackOptions[FeedbackOptions["Other"] = 1] = "Other";
|
|
1075
818
|
FeedbackOptions[FeedbackOptions["Unrelated"] = 2] = "Unrelated";
|
|
1076
819
|
FeedbackOptions[FeedbackOptions["Unclear"] = 4] = "Unclear";
|
|
1077
820
|
FeedbackOptions[FeedbackOptions["Incomplete"] = 8] = "Incomplete";
|
|
1078
821
|
FeedbackOptions[FeedbackOptions["Incorrect"] = 16] = "Incorrect";
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
822
|
+
return FeedbackOptions;
|
|
823
|
+
}({});
|
|
824
|
+
export var FeedbackRatings = /*#__PURE__*/ function(FeedbackRatings) {
|
|
1082
825
|
FeedbackRatings[FeedbackRatings["ThumbsDown"] = 0] = "ThumbsDown";
|
|
1083
826
|
FeedbackRatings[FeedbackRatings["ThumbsUp"] = 1] = "ThumbsUp";
|
|
1084
827
|
FeedbackRatings[FeedbackRatings["GuardrailFeedback"] = 2] = "GuardrailFeedback";
|
|
1085
|
-
|
|
828
|
+
return FeedbackRatings;
|
|
829
|
+
}({});
|
|
1086
830
|
export class FrontendModel {
|
|
1087
|
-
constructor(data) {
|
|
1088
|
-
Object.defineProperty(this, "options", {
|
|
1089
|
-
enumerable: true,
|
|
1090
|
-
configurable: true,
|
|
1091
|
-
writable: true,
|
|
1092
|
-
value: void 0
|
|
1093
|
-
});
|
|
1094
|
-
if (data) {
|
|
1095
|
-
for (var property in data) {
|
|
1096
|
-
if (data.hasOwnProperty(property))
|
|
1097
|
-
this[property] = data[property];
|
|
1098
|
-
}
|
|
1099
|
-
}
|
|
1100
|
-
if (!data) {
|
|
1101
|
-
this.options = new Option();
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
831
|
init(_data) {
|
|
1105
832
|
if (_data) {
|
|
1106
833
|
this.options = _data['options'] ? Option.fromJS(_data['options']) : new Option();
|
|
@@ -1117,44 +844,19 @@ export class FrontendModel {
|
|
|
1117
844
|
data['options'] = this.options ? this.options.toJSON() : undefined;
|
|
1118
845
|
return data;
|
|
1119
846
|
}
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
export class Option {
|
|
1123
|
-
constructor(data) {
|
|
1124
|
-
/** Identifier key. */
|
|
1125
|
-
Object.defineProperty(this, "key", {
|
|
1126
|
-
enumerable: true,
|
|
1127
|
-
configurable: true,
|
|
1128
|
-
writable: true,
|
|
1129
|
-
value: void 0
|
|
1130
|
-
});
|
|
1131
|
-
/** Display name. */
|
|
1132
|
-
Object.defineProperty(this, "displayName", {
|
|
1133
|
-
enumerable: true,
|
|
1134
|
-
configurable: true,
|
|
1135
|
-
writable: true,
|
|
1136
|
-
value: void 0
|
|
1137
|
-
});
|
|
1138
|
-
Object.defineProperty(this, "type", {
|
|
1139
|
-
enumerable: true,
|
|
1140
|
-
configurable: true,
|
|
1141
|
-
writable: true,
|
|
1142
|
-
value: void 0
|
|
1143
|
-
});
|
|
1144
|
-
/** Child options down the hierarchy. */
|
|
1145
|
-
Object.defineProperty(this, "subOptions", {
|
|
1146
|
-
enumerable: true,
|
|
1147
|
-
configurable: true,
|
|
1148
|
-
writable: true,
|
|
1149
|
-
value: void 0
|
|
1150
|
-
});
|
|
847
|
+
constructor(data){
|
|
848
|
+
_define_property(this, "options", void 0);
|
|
1151
849
|
if (data) {
|
|
1152
|
-
for
|
|
1153
|
-
if (data.hasOwnProperty(property))
|
|
1154
|
-
this[property] = data[property];
|
|
850
|
+
for(var property in data){
|
|
851
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1155
852
|
}
|
|
1156
853
|
}
|
|
854
|
+
if (!data) {
|
|
855
|
+
this.options = new Option();
|
|
856
|
+
}
|
|
1157
857
|
}
|
|
858
|
+
}
|
|
859
|
+
/** A meaningful selectable option or a parent node for other options. */ export class Option {
|
|
1158
860
|
init(_data) {
|
|
1159
861
|
if (_data) {
|
|
1160
862
|
this.key = _data['key'];
|
|
@@ -1162,8 +864,7 @@ export class Option {
|
|
|
1162
864
|
this.type = _data['type'];
|
|
1163
865
|
if (Array.isArray(_data['subOptions'])) {
|
|
1164
866
|
this.subOptions = [];
|
|
1165
|
-
for (let item of _data['subOptions'])
|
|
1166
|
-
this.subOptions.push(Option.fromJS(item));
|
|
867
|
+
for (let item of _data['subOptions'])this.subOptions.push(Option.fromJS(item));
|
|
1167
868
|
}
|
|
1168
869
|
}
|
|
1169
870
|
}
|
|
@@ -1180,46 +881,29 @@ export class Option {
|
|
|
1180
881
|
data['type'] = this.type;
|
|
1181
882
|
if (Array.isArray(this.subOptions)) {
|
|
1182
883
|
data['subOptions'] = [];
|
|
1183
|
-
for (let item of this.subOptions)
|
|
1184
|
-
data['subOptions'].push(item.toJSON());
|
|
884
|
+
for (let item of this.subOptions)data['subOptions'].push(item.toJSON());
|
|
1185
885
|
}
|
|
1186
886
|
return data;
|
|
1187
887
|
}
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
(
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
OptionType[OptionType["Selectable"] = 2] = "Selectable";
|
|
1194
|
-
})(OptionType || (OptionType = {}));
|
|
1195
|
-
/** A scored link to Knowledge Base article. */
|
|
1196
|
-
export class ScoredUrl {
|
|
1197
|
-
constructor(data) {
|
|
1198
|
-
Object.defineProperty(this, "url", {
|
|
1199
|
-
enumerable: true,
|
|
1200
|
-
configurable: true,
|
|
1201
|
-
writable: true,
|
|
1202
|
-
value: void 0
|
|
1203
|
-
});
|
|
1204
|
-
Object.defineProperty(this, "score", {
|
|
1205
|
-
enumerable: true,
|
|
1206
|
-
configurable: true,
|
|
1207
|
-
writable: true,
|
|
1208
|
-
value: void 0
|
|
1209
|
-
});
|
|
1210
|
-
Object.defineProperty(this, "title", {
|
|
1211
|
-
enumerable: true,
|
|
1212
|
-
configurable: true,
|
|
1213
|
-
writable: true,
|
|
1214
|
-
value: void 0
|
|
1215
|
-
});
|
|
888
|
+
constructor(data){
|
|
889
|
+
/** Identifier key. */ _define_property(this, "key", void 0);
|
|
890
|
+
/** Display name. */ _define_property(this, "displayName", void 0);
|
|
891
|
+
_define_property(this, "type", void 0);
|
|
892
|
+
/** Child options down the hierarchy. */ _define_property(this, "subOptions", void 0);
|
|
1216
893
|
if (data) {
|
|
1217
|
-
for
|
|
1218
|
-
if (data.hasOwnProperty(property))
|
|
1219
|
-
this[property] = data[property];
|
|
894
|
+
for(var property in data){
|
|
895
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1220
896
|
}
|
|
1221
897
|
}
|
|
1222
898
|
}
|
|
899
|
+
}
|
|
900
|
+
export var OptionType = /*#__PURE__*/ function(OptionType) {
|
|
901
|
+
OptionType[OptionType["None"] = 0] = "None";
|
|
902
|
+
OptionType[OptionType["Group"] = 1] = "Group";
|
|
903
|
+
OptionType[OptionType["Selectable"] = 2] = "Selectable";
|
|
904
|
+
return OptionType;
|
|
905
|
+
}({});
|
|
906
|
+
/** A scored link to Knowledge Base article. */ export class ScoredUrl {
|
|
1223
907
|
init(_data) {
|
|
1224
908
|
if (_data) {
|
|
1225
909
|
this.url = _data['url'];
|
|
@@ -1240,45 +924,28 @@ export class ScoredUrl {
|
|
|
1240
924
|
data['title'] = this.title;
|
|
1241
925
|
return data;
|
|
1242
926
|
}
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
/** Selected values. */
|
|
1248
|
-
Object.defineProperty(this, "values", {
|
|
1249
|
-
enumerable: true,
|
|
1250
|
-
configurable: true,
|
|
1251
|
-
writable: true,
|
|
1252
|
-
value: void 0
|
|
1253
|
-
});
|
|
1254
|
-
/** Child selections down the hierarchy. */
|
|
1255
|
-
Object.defineProperty(this, "subOptions", {
|
|
1256
|
-
enumerable: true,
|
|
1257
|
-
configurable: true,
|
|
1258
|
-
writable: true,
|
|
1259
|
-
value: void 0
|
|
1260
|
-
});
|
|
927
|
+
constructor(data){
|
|
928
|
+
_define_property(this, "url", void 0);
|
|
929
|
+
_define_property(this, "score", void 0);
|
|
930
|
+
_define_property(this, "title", void 0);
|
|
1261
931
|
if (data) {
|
|
1262
|
-
for
|
|
1263
|
-
if (data.hasOwnProperty(property))
|
|
1264
|
-
this[property] = data[property];
|
|
932
|
+
for(var property in data){
|
|
933
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1265
934
|
}
|
|
1266
935
|
}
|
|
1267
936
|
}
|
|
937
|
+
}
|
|
938
|
+
/** User-selected values from available options. Hierarchy of TitanChatbot.Host.API.Models.Selections must match hierarchy of TitanChatbot.Host.API.Models.Option. */ export class Selections {
|
|
1268
939
|
init(_data) {
|
|
1269
940
|
if (_data) {
|
|
1270
941
|
if (Array.isArray(_data['values'])) {
|
|
1271
942
|
this.values = [];
|
|
1272
|
-
for (let item of _data['values'])
|
|
1273
|
-
this.values.push(item);
|
|
943
|
+
for (let item of _data['values'])this.values.push(item);
|
|
1274
944
|
}
|
|
1275
945
|
if (_data['subOptions']) {
|
|
1276
946
|
this.subOptions = {};
|
|
1277
|
-
for
|
|
1278
|
-
if (_data['subOptions'].hasOwnProperty(key))
|
|
1279
|
-
this.subOptions[key] = _data['subOptions'][key]
|
|
1280
|
-
? Selections.fromJS(_data['subOptions'][key])
|
|
1281
|
-
: new Selections();
|
|
947
|
+
for(let key in _data['subOptions']){
|
|
948
|
+
if (_data['subOptions'].hasOwnProperty(key)) this.subOptions[key] = _data['subOptions'][key] ? Selections.fromJS(_data['subOptions'][key]) : new Selections();
|
|
1282
949
|
}
|
|
1283
950
|
}
|
|
1284
951
|
}
|
|
@@ -1293,53 +960,34 @@ export class Selections {
|
|
|
1293
960
|
data = typeof data === 'object' ? data : {};
|
|
1294
961
|
if (Array.isArray(this.values)) {
|
|
1295
962
|
data['values'] = [];
|
|
1296
|
-
for (let item of this.values)
|
|
1297
|
-
data['values'].push(item);
|
|
963
|
+
for (let item of this.values)data['values'].push(item);
|
|
1298
964
|
}
|
|
1299
965
|
if (this.subOptions) {
|
|
1300
966
|
data['subOptions'] = {};
|
|
1301
|
-
for
|
|
1302
|
-
if (this.subOptions.hasOwnProperty(key))
|
|
1303
|
-
data['subOptions'][key] = this.subOptions[key]
|
|
1304
|
-
? this.subOptions[key].toJSON()
|
|
1305
|
-
: undefined;
|
|
967
|
+
for(let key in this.subOptions){
|
|
968
|
+
if (this.subOptions.hasOwnProperty(key)) data['subOptions'][key] = this.subOptions[key] ? this.subOptions[key].toJSON() : undefined;
|
|
1306
969
|
}
|
|
1307
970
|
}
|
|
1308
971
|
return data;
|
|
1309
972
|
}
|
|
1310
|
-
|
|
1311
|
-
/**
|
|
1312
|
-
|
|
1313
|
-
constructor(data) {
|
|
1314
|
-
/** Primary key. */
|
|
1315
|
-
Object.defineProperty(this, "id", {
|
|
1316
|
-
enumerable: true,
|
|
1317
|
-
configurable: true,
|
|
1318
|
-
writable: true,
|
|
1319
|
-
value: void 0
|
|
1320
|
-
});
|
|
1321
|
-
/** Arbitrary data to be stored in session. */
|
|
1322
|
-
Object.defineProperty(this, "data", {
|
|
1323
|
-
enumerable: true,
|
|
1324
|
-
configurable: true,
|
|
1325
|
-
writable: true,
|
|
1326
|
-
value: void 0
|
|
1327
|
-
});
|
|
973
|
+
constructor(data){
|
|
974
|
+
/** Selected values. */ _define_property(this, "values", void 0);
|
|
975
|
+
/** Child selections down the hierarchy. */ _define_property(this, "subOptions", void 0);
|
|
1328
976
|
if (data) {
|
|
1329
|
-
for
|
|
1330
|
-
if (data.hasOwnProperty(property))
|
|
1331
|
-
this[property] = data[property];
|
|
977
|
+
for(var property in data){
|
|
978
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1332
979
|
}
|
|
1333
980
|
}
|
|
1334
981
|
}
|
|
982
|
+
}
|
|
983
|
+
/** Series of chatbot exchanges making a conversation. */ export class Session {
|
|
1335
984
|
init(_data) {
|
|
1336
985
|
if (_data) {
|
|
1337
986
|
this.id = _data['id'];
|
|
1338
987
|
if (_data['data']) {
|
|
1339
988
|
this.data = {};
|
|
1340
|
-
for
|
|
1341
|
-
if (_data['data'].hasOwnProperty(key))
|
|
1342
|
-
this.data[key] = _data['data'][key];
|
|
989
|
+
for(let key in _data['data']){
|
|
990
|
+
if (_data['data'].hasOwnProperty(key)) this.data[key] = _data['data'][key];
|
|
1343
991
|
}
|
|
1344
992
|
}
|
|
1345
993
|
}
|
|
@@ -1355,29 +1003,23 @@ export class Session {
|
|
|
1355
1003
|
data['id'] = this.id;
|
|
1356
1004
|
if (this.data) {
|
|
1357
1005
|
data['data'] = {};
|
|
1358
|
-
for
|
|
1359
|
-
if (this.data.hasOwnProperty(key))
|
|
1360
|
-
data['data'][key] = this.data[key];
|
|
1006
|
+
for(let key in this.data){
|
|
1007
|
+
if (this.data.hasOwnProperty(key)) data['data'][key] = this.data[key];
|
|
1361
1008
|
}
|
|
1362
1009
|
}
|
|
1363
1010
|
return data;
|
|
1364
1011
|
}
|
|
1365
|
-
|
|
1366
|
-
|
|
1367
|
-
|
|
1368
|
-
Object.defineProperty(this, "text", {
|
|
1369
|
-
enumerable: true,
|
|
1370
|
-
configurable: true,
|
|
1371
|
-
writable: true,
|
|
1372
|
-
value: void 0
|
|
1373
|
-
});
|
|
1012
|
+
constructor(data){
|
|
1013
|
+
/** Primary key. */ _define_property(this, "id", void 0);
|
|
1014
|
+
/** Arbitrary data to be stored in session. */ _define_property(this, "data", void 0);
|
|
1374
1015
|
if (data) {
|
|
1375
|
-
for
|
|
1376
|
-
if (data.hasOwnProperty(property))
|
|
1377
|
-
this[property] = data[property];
|
|
1016
|
+
for(var property in data){
|
|
1017
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1378
1018
|
}
|
|
1379
1019
|
}
|
|
1380
1020
|
}
|
|
1021
|
+
}
|
|
1022
|
+
export class SummarizeRequest {
|
|
1381
1023
|
init(_data) {
|
|
1382
1024
|
if (_data) {
|
|
1383
1025
|
this.text = _data['text'];
|
|
@@ -1394,22 +1036,16 @@ export class SummarizeRequest {
|
|
|
1394
1036
|
data['text'] = this.text;
|
|
1395
1037
|
return data;
|
|
1396
1038
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
constructor(data) {
|
|
1400
|
-
Object.defineProperty(this, "summary", {
|
|
1401
|
-
enumerable: true,
|
|
1402
|
-
configurable: true,
|
|
1403
|
-
writable: true,
|
|
1404
|
-
value: void 0
|
|
1405
|
-
});
|
|
1039
|
+
constructor(data){
|
|
1040
|
+
_define_property(this, "text", void 0);
|
|
1406
1041
|
if (data) {
|
|
1407
|
-
for
|
|
1408
|
-
if (data.hasOwnProperty(property))
|
|
1409
|
-
this[property] = data[property];
|
|
1042
|
+
for(var property in data){
|
|
1043
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1410
1044
|
}
|
|
1411
1045
|
}
|
|
1412
1046
|
}
|
|
1047
|
+
}
|
|
1048
|
+
export class SummarizeResponse {
|
|
1413
1049
|
init(_data) {
|
|
1414
1050
|
if (_data) {
|
|
1415
1051
|
this.summary = _data['summary'];
|
|
@@ -1426,29 +1062,16 @@ export class SummarizeResponse {
|
|
|
1426
1062
|
data['summary'] = this.summary;
|
|
1427
1063
|
return data;
|
|
1428
1064
|
}
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
export class UserInput {
|
|
1432
|
-
constructor(data) {
|
|
1433
|
-
Object.defineProperty(this, "label", {
|
|
1434
|
-
enumerable: true,
|
|
1435
|
-
configurable: true,
|
|
1436
|
-
writable: true,
|
|
1437
|
-
value: void 0
|
|
1438
|
-
});
|
|
1439
|
-
Object.defineProperty(this, "value", {
|
|
1440
|
-
enumerable: true,
|
|
1441
|
-
configurable: true,
|
|
1442
|
-
writable: true,
|
|
1443
|
-
value: void 0
|
|
1444
|
-
});
|
|
1065
|
+
constructor(data){
|
|
1066
|
+
_define_property(this, "summary", void 0);
|
|
1445
1067
|
if (data) {
|
|
1446
|
-
for
|
|
1447
|
-
if (data.hasOwnProperty(property))
|
|
1448
|
-
this[property] = data[property];
|
|
1068
|
+
for(var property in data){
|
|
1069
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1449
1070
|
}
|
|
1450
1071
|
}
|
|
1451
1072
|
}
|
|
1073
|
+
}
|
|
1074
|
+
/** One user-provided input collected for the workflow. */ export class UserInput {
|
|
1452
1075
|
init(_data) {
|
|
1453
1076
|
if (_data) {
|
|
1454
1077
|
this.label = _data['label'];
|
|
@@ -1467,26 +1090,27 @@ export class UserInput {
|
|
|
1467
1090
|
data['value'] = this.value;
|
|
1468
1091
|
return data;
|
|
1469
1092
|
}
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1093
|
+
constructor(data){
|
|
1094
|
+
_define_property(this, "label", void 0);
|
|
1095
|
+
_define_property(this, "value", void 0);
|
|
1096
|
+
if (data) {
|
|
1097
|
+
for(var property in data){
|
|
1098
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1099
|
+
}
|
|
1100
|
+
}
|
|
1476
1101
|
}
|
|
1102
|
+
}
|
|
1103
|
+
/** User request message. */ export class UserMessage extends Message {
|
|
1477
1104
|
init(_data) {
|
|
1478
1105
|
super.init(_data);
|
|
1479
1106
|
if (_data) {
|
|
1480
1107
|
this.question = _data['question'];
|
|
1481
1108
|
this.experience = _data['experience'];
|
|
1482
|
-
this.selections = _data['selections']
|
|
1483
|
-
? Selections.fromJS(_data['selections'])
|
|
1484
|
-
: undefined;
|
|
1109
|
+
this.selections = _data['selections'] ? Selections.fromJS(_data['selections']) : undefined;
|
|
1485
1110
|
if (_data['context']) {
|
|
1486
1111
|
this.context = {};
|
|
1487
|
-
for
|
|
1488
|
-
if (_data['context'].hasOwnProperty(key))
|
|
1489
|
-
this.context[key] = _data['context'][key];
|
|
1112
|
+
for(let key in _data['context']){
|
|
1113
|
+
if (_data['context'].hasOwnProperty(key)) this.context[key] = _data['context'][key];
|
|
1490
1114
|
}
|
|
1491
1115
|
}
|
|
1492
1116
|
}
|
|
@@ -1504,65 +1128,30 @@ export class UserMessage extends Message {
|
|
|
1504
1128
|
data['selections'] = this.selections ? this.selections.toJSON() : undefined;
|
|
1505
1129
|
if (this.context) {
|
|
1506
1130
|
data['context'] = {};
|
|
1507
|
-
for
|
|
1508
|
-
if (this.context.hasOwnProperty(key))
|
|
1509
|
-
data['context'][key] = this.context[key];
|
|
1131
|
+
for(let key in this.context){
|
|
1132
|
+
if (this.context.hasOwnProperty(key)) data['context'][key] = this.context[key];
|
|
1510
1133
|
}
|
|
1511
1134
|
}
|
|
1512
1135
|
super.toJSON(data);
|
|
1513
1136
|
return data;
|
|
1514
1137
|
}
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
constructor(data) {
|
|
1519
|
-
Object.defineProperty(this, "displayName", {
|
|
1520
|
-
enumerable: true,
|
|
1521
|
-
configurable: true,
|
|
1522
|
-
writable: true,
|
|
1523
|
-
value: void 0
|
|
1524
|
-
});
|
|
1525
|
-
Object.defineProperty(this, "estimatedRuntimeSec", {
|
|
1526
|
-
enumerable: true,
|
|
1527
|
-
configurable: true,
|
|
1528
|
-
writable: true,
|
|
1529
|
-
value: void 0
|
|
1530
|
-
});
|
|
1531
|
-
Object.defineProperty(this, "inputs", {
|
|
1532
|
-
enumerable: true,
|
|
1533
|
-
configurable: true,
|
|
1534
|
-
writable: true,
|
|
1535
|
-
value: void 0
|
|
1536
|
-
});
|
|
1537
|
-
Object.defineProperty(this, "steps", {
|
|
1538
|
-
enumerable: true,
|
|
1539
|
-
configurable: true,
|
|
1540
|
-
writable: true,
|
|
1541
|
-
value: void 0
|
|
1542
|
-
});
|
|
1543
|
-
if (data) {
|
|
1544
|
-
for (var property in data) {
|
|
1545
|
-
if (data.hasOwnProperty(property))
|
|
1546
|
-
this[property] = data[property];
|
|
1547
|
-
}
|
|
1548
|
-
}
|
|
1549
|
-
if (!data) {
|
|
1550
|
-
this.steps = [];
|
|
1551
|
-
}
|
|
1138
|
+
constructor(data){
|
|
1139
|
+
super(data);
|
|
1140
|
+
this._discriminator = 'UserMessage';
|
|
1552
1141
|
}
|
|
1142
|
+
}
|
|
1143
|
+
/** Pre-execution plan for an agentic UI workflow. */ export class WorkflowPlan {
|
|
1553
1144
|
init(_data) {
|
|
1554
1145
|
if (_data) {
|
|
1555
1146
|
this.displayName = _data['displayName'];
|
|
1556
1147
|
this.estimatedRuntimeSec = _data['estimatedRuntimeSec'];
|
|
1557
1148
|
if (Array.isArray(_data['inputs'])) {
|
|
1558
1149
|
this.inputs = [];
|
|
1559
|
-
for (let item of _data['inputs'])
|
|
1560
|
-
this.inputs.push(UserInput.fromJS(item));
|
|
1150
|
+
for (let item of _data['inputs'])this.inputs.push(UserInput.fromJS(item));
|
|
1561
1151
|
}
|
|
1562
1152
|
if (Array.isArray(_data['steps'])) {
|
|
1563
1153
|
this.steps = [];
|
|
1564
|
-
for (let item of _data['steps'])
|
|
1565
|
-
this.steps.push(WorkflowStep.fromJS(item));
|
|
1154
|
+
for (let item of _data['steps'])this.steps.push(WorkflowStep.fromJS(item));
|
|
1566
1155
|
}
|
|
1567
1156
|
}
|
|
1568
1157
|
}
|
|
@@ -1578,45 +1167,30 @@ export class WorkflowPlan {
|
|
|
1578
1167
|
data['estimatedRuntimeSec'] = this.estimatedRuntimeSec;
|
|
1579
1168
|
if (Array.isArray(this.inputs)) {
|
|
1580
1169
|
data['inputs'] = [];
|
|
1581
|
-
for (let item of this.inputs)
|
|
1582
|
-
data['inputs'].push(item.toJSON());
|
|
1170
|
+
for (let item of this.inputs)data['inputs'].push(item.toJSON());
|
|
1583
1171
|
}
|
|
1584
1172
|
if (Array.isArray(this.steps)) {
|
|
1585
1173
|
data['steps'] = [];
|
|
1586
|
-
for (let item of this.steps)
|
|
1587
|
-
data['steps'].push(item.toJSON());
|
|
1174
|
+
for (let item of this.steps)data['steps'].push(item.toJSON());
|
|
1588
1175
|
}
|
|
1589
1176
|
return data;
|
|
1590
1177
|
}
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
enumerable: true,
|
|
1597
|
-
configurable: true,
|
|
1598
|
-
writable: true,
|
|
1599
|
-
value: void 0
|
|
1600
|
-
});
|
|
1601
|
-
Object.defineProperty(this, "description", {
|
|
1602
|
-
enumerable: true,
|
|
1603
|
-
configurable: true,
|
|
1604
|
-
writable: true,
|
|
1605
|
-
value: void 0
|
|
1606
|
-
});
|
|
1607
|
-
Object.defineProperty(this, "pageUrl", {
|
|
1608
|
-
enumerable: true,
|
|
1609
|
-
configurable: true,
|
|
1610
|
-
writable: true,
|
|
1611
|
-
value: void 0
|
|
1612
|
-
});
|
|
1178
|
+
constructor(data){
|
|
1179
|
+
_define_property(this, "displayName", void 0);
|
|
1180
|
+
_define_property(this, "estimatedRuntimeSec", void 0);
|
|
1181
|
+
_define_property(this, "inputs", void 0);
|
|
1182
|
+
_define_property(this, "steps", void 0);
|
|
1613
1183
|
if (data) {
|
|
1614
|
-
for
|
|
1615
|
-
if (data.hasOwnProperty(property))
|
|
1616
|
-
this[property] = data[property];
|
|
1184
|
+
for(var property in data){
|
|
1185
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1617
1186
|
}
|
|
1618
1187
|
}
|
|
1188
|
+
if (!data) {
|
|
1189
|
+
this.steps = [];
|
|
1190
|
+
}
|
|
1619
1191
|
}
|
|
1192
|
+
}
|
|
1193
|
+
/** One step in the workflow's execution plan. `PageUrl` is set on navigation steps only. */ export class WorkflowStep {
|
|
1620
1194
|
init(_data) {
|
|
1621
1195
|
if (_data) {
|
|
1622
1196
|
this.number = _data['number'];
|
|
@@ -1637,60 +1211,33 @@ export class WorkflowStep {
|
|
|
1637
1211
|
data['pageUrl'] = this.pageUrl;
|
|
1638
1212
|
return data;
|
|
1639
1213
|
}
|
|
1214
|
+
constructor(data){
|
|
1215
|
+
_define_property(this, "number", void 0);
|
|
1216
|
+
_define_property(this, "description", void 0);
|
|
1217
|
+
_define_property(this, "pageUrl", void 0);
|
|
1218
|
+
if (data) {
|
|
1219
|
+
for(var property in data){
|
|
1220
|
+
if (data.hasOwnProperty(property)) this[property] = data[property];
|
|
1221
|
+
}
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1640
1224
|
}
|
|
1641
1225
|
export class ApiException extends Error {
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
writable: true,
|
|
1648
|
-
value: void 0
|
|
1649
|
-
});
|
|
1650
|
-
Object.defineProperty(this, "status", {
|
|
1651
|
-
enumerable: true,
|
|
1652
|
-
configurable: true,
|
|
1653
|
-
writable: true,
|
|
1654
|
-
value: void 0
|
|
1655
|
-
});
|
|
1656
|
-
Object.defineProperty(this, "response", {
|
|
1657
|
-
enumerable: true,
|
|
1658
|
-
configurable: true,
|
|
1659
|
-
writable: true,
|
|
1660
|
-
value: void 0
|
|
1661
|
-
});
|
|
1662
|
-
Object.defineProperty(this, "headers", {
|
|
1663
|
-
enumerable: true,
|
|
1664
|
-
configurable: true,
|
|
1665
|
-
writable: true,
|
|
1666
|
-
value: void 0
|
|
1667
|
-
});
|
|
1668
|
-
Object.defineProperty(this, "result", {
|
|
1669
|
-
enumerable: true,
|
|
1670
|
-
configurable: true,
|
|
1671
|
-
writable: true,
|
|
1672
|
-
value: void 0
|
|
1673
|
-
});
|
|
1674
|
-
Object.defineProperty(this, "isApiException", {
|
|
1675
|
-
enumerable: true,
|
|
1676
|
-
configurable: true,
|
|
1677
|
-
writable: true,
|
|
1678
|
-
value: true
|
|
1679
|
-
});
|
|
1226
|
+
static isApiException(obj) {
|
|
1227
|
+
return obj.isApiException === true;
|
|
1228
|
+
}
|
|
1229
|
+
constructor(message, status, response, headers, result){
|
|
1230
|
+
super(), _define_property(this, "message", void 0), _define_property(this, "status", void 0), _define_property(this, "response", void 0), _define_property(this, "headers", void 0), _define_property(this, "result", void 0), _define_property(this, "isApiException", true);
|
|
1680
1231
|
this.message = message;
|
|
1681
1232
|
this.status = status;
|
|
1682
1233
|
this.response = response;
|
|
1683
1234
|
this.headers = headers;
|
|
1684
1235
|
this.result = result;
|
|
1685
1236
|
}
|
|
1686
|
-
static isApiException(obj) {
|
|
1687
|
-
return obj.isApiException === true;
|
|
1688
|
-
}
|
|
1689
1237
|
}
|
|
1690
1238
|
function throwException(message, status, response, headers, result) {
|
|
1691
|
-
if (result !== null && result !== undefined)
|
|
1692
|
-
|
|
1693
|
-
else
|
|
1694
|
-
throw new ApiException(message, status, response, headers, null);
|
|
1239
|
+
if (result !== null && result !== undefined) throw result;
|
|
1240
|
+
else throw new ApiException(message, status, response, headers, null);
|
|
1695
1241
|
}
|
|
1242
|
+
|
|
1696
1243
|
//# sourceMappingURL=native-client.js.map
|