@breign/client 1.0.1 → 1.0.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/{target/typescript/dist → dist}/apis/BrainApi.d.ts +10 -0
- package/dist/apis/BrainApi.js +637 -0
- package/{target/typescript/dist → dist}/models/AdditionalUio.js +1 -2
- package/{target/typescript/dist → dist}/models/BrainFlowCreateUio.js +4 -5
- package/{target/typescript/dist → dist}/models/BrainFlowUio.js +4 -5
- package/{target/typescript/dist → dist}/models/BrainMetricsEventUio.js +2 -3
- package/{target/typescript/dist → dist}/models/BrainMetricsOverviewUio.js +3 -4
- package/{target/typescript/dist → dist}/models/BrainMetricsUnitsTypeUio.js +1 -1
- package/{target/typescript/dist → dist}/models/BrainMetricsValueUio.js +2 -3
- package/{target/typescript/dist → dist}/models/BrainModuleTypeUio.js +1 -1
- package/{target/typescript/dist → dist}/models/BrainModuleUio.js +2 -3
- package/{target/typescript/dist → dist}/models/BrainPatchUio.d.ts +72 -0
- package/{target/typescript/dist → dist}/models/BrainPatchUio.js +31 -6
- package/{target/typescript/dist → dist}/models/BrainRequestImageBrainUio.js +1 -2
- package/{target/typescript/dist → dist}/models/BrainRequestUio.d.ts +54 -0
- package/{target/typescript/dist → dist}/models/BrainRequestUio.js +25 -6
- package/{target/typescript/dist → dist}/models/BrainSubscriptionTextInteractionsUio.js +2 -3
- package/{target/typescript/dist → dist}/models/BrainSubscriptionUio.js +2 -3
- package/{target/typescript/dist → dist}/models/BrainUio.d.ts +72 -0
- package/{target/typescript/dist → dist}/models/BrainUio.js +31 -6
- package/{target/typescript/dist → dist}/models/BrainUsageMetricsIdUio.js +1 -2
- package/{target/typescript/dist → dist}/models/BrainUsageMetricsUio.js +3 -4
- package/{target/typescript/dist → dist}/models/ContentsToolsUio.js +1 -2
- package/{target/typescript/dist → dist}/models/CostMetricUio.js +2 -3
- package/{target/typescript/dist → dist}/models/EngineTypeUio.js +1 -1
- package/{target/typescript/dist → dist}/models/EngineUio.js +2 -3
- package/{target/typescript/dist → dist}/models/FileCreationRequestUio.js +1 -2
- package/{target/typescript/dist → dist}/models/FileStatusUio.js +1 -1
- package/{target/typescript/dist → dist}/models/FileUio.js +2 -3
- package/{target/typescript/dist → dist}/models/FlowContentsSuggestionUio.js +1 -2
- package/{target/typescript/dist → dist}/models/FlowContentsUio.js +3 -4
- package/{target/typescript/dist → dist}/models/FlowEntrypointsUio.js +1 -2
- package/{target/typescript/dist → dist}/models/FlowOptionsUio.js +1 -2
- package/{target/typescript/dist → dist}/models/PersonaUio.js +9 -15
- package/{target/typescript/dist → dist}/models/PromptInitUio.js +9 -15
- package/{target/typescript/dist → dist}/models/SubscriptionMetricUio.js +1 -2
- package/{target/typescript/dist → dist}/models/TransactionUio.js +1 -2
- package/dist/openapi.json +1668 -0
- package/dist/runtime.js +338 -0
- package/package.json +11 -6
- package/README.md +0 -10
- package/target/typescript/dist/apis/BrainApi.js +0 -1013
- package/target/typescript/dist/runtime.js +0 -564
- /package/{target/typescript/dist → dist}/apis/index.d.ts +0 -0
- /package/{target/typescript/dist → dist}/apis/index.js +0 -0
- /package/{target/typescript/dist → dist}/index.d.ts +0 -0
- /package/{target/typescript/dist → dist}/index.js +0 -0
- /package/{target/typescript/dist → dist}/models/AdditionalUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainFlowCreateUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainFlowUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainMetricsEventUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainMetricsOverviewUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainMetricsUnitsTypeUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainMetricsValueUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainModuleTypeUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainModuleUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainRequestImageBrainUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainSubscriptionTextInteractionsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainSubscriptionUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainUsageMetricsIdUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/BrainUsageMetricsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/ContentsToolsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/CostMetricUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/EngineTypeUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/EngineUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FileCreationRequestUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FileStatusUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FileUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FlowContentsSuggestionUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FlowContentsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FlowEntrypointsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/FlowOptionsUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/PersonaUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/PromptInitUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/SubscriptionMetricUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/TransactionUio.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/index.d.ts +0 -0
- /package/{target/typescript/dist → dist}/models/index.js +0 -0
- /package/{target/typescript/dist → dist}/runtime.d.ts +0 -0
|
@@ -1,1013 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
/* tslint:disable */
|
|
3
|
-
/* eslint-disable */
|
|
4
|
-
/**
|
|
5
|
-
* brain-client
|
|
6
|
-
* Api ands models for brain-app and brain-app
|
|
7
|
-
*
|
|
8
|
-
* The version of the OpenAPI document: 0.0.0-SNAPSHOT
|
|
9
|
-
*
|
|
10
|
-
*
|
|
11
|
-
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
12
|
-
* https://openapi-generator.tech
|
|
13
|
-
* Do not edit the class manually.
|
|
14
|
-
*/
|
|
15
|
-
var __extends = (this && this.__extends) || (function () {
|
|
16
|
-
var extendStatics = function (d, b) {
|
|
17
|
-
extendStatics = Object.setPrototypeOf ||
|
|
18
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
19
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
20
|
-
return extendStatics(d, b);
|
|
21
|
-
};
|
|
22
|
-
return function (d, b) {
|
|
23
|
-
if (typeof b !== "function" && b !== null)
|
|
24
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
25
|
-
extendStatics(d, b);
|
|
26
|
-
function __() { this.constructor = d; }
|
|
27
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
28
|
-
};
|
|
29
|
-
})();
|
|
30
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
31
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
32
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
33
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
34
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
35
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
36
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
37
|
-
});
|
|
38
|
-
};
|
|
39
|
-
var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
40
|
-
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g = Object.create((typeof Iterator === "function" ? Iterator : Object).prototype);
|
|
41
|
-
return g.next = verb(0), g["throw"] = verb(1), g["return"] = verb(2), typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
42
|
-
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
43
|
-
function step(op) {
|
|
44
|
-
if (f) throw new TypeError("Generator is already executing.");
|
|
45
|
-
while (g && (g = 0, op[0] && (_ = 0)), _) try {
|
|
46
|
-
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
47
|
-
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
48
|
-
switch (op[0]) {
|
|
49
|
-
case 0: case 1: t = op; break;
|
|
50
|
-
case 4: _.label++; return { value: op[1], done: false };
|
|
51
|
-
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
52
|
-
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
53
|
-
default:
|
|
54
|
-
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
55
|
-
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
56
|
-
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
57
|
-
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
58
|
-
if (t[2]) _.ops.pop();
|
|
59
|
-
_.trys.pop(); continue;
|
|
60
|
-
}
|
|
61
|
-
op = body.call(thisArg, _);
|
|
62
|
-
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
63
|
-
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
64
|
-
}
|
|
65
|
-
};
|
|
66
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
67
|
-
exports.BrainApi = void 0;
|
|
68
|
-
var runtime = require("../runtime");
|
|
69
|
-
var index_1 = require("../models/index");
|
|
70
|
-
/**
|
|
71
|
-
*
|
|
72
|
-
*/
|
|
73
|
-
var BrainApi = /** @class */ (function (_super) {
|
|
74
|
-
__extends(BrainApi, _super);
|
|
75
|
-
function BrainApi() {
|
|
76
|
-
return _super !== null && _super.apply(this, arguments) || this;
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Adds a new module to the specified brain
|
|
80
|
-
* Add a module to a brain
|
|
81
|
-
*/
|
|
82
|
-
BrainApi.prototype.addModuleRaw = function (requestParameters, initOverrides) {
|
|
83
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
84
|
-
var queryParameters, headerParameters, response;
|
|
85
|
-
return __generator(this, function (_a) {
|
|
86
|
-
switch (_a.label) {
|
|
87
|
-
case 0:
|
|
88
|
-
if (requestParameters['brainId'] == null) {
|
|
89
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling addModule().');
|
|
90
|
-
}
|
|
91
|
-
if (requestParameters['brainModuleUio'] == null) {
|
|
92
|
-
throw new runtime.RequiredError('brainModuleUio', 'Required parameter "brainModuleUio" was null or undefined when calling addModule().');
|
|
93
|
-
}
|
|
94
|
-
queryParameters = {};
|
|
95
|
-
headerParameters = {};
|
|
96
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
97
|
-
return [4 /*yield*/, this.request({
|
|
98
|
-
path: "/brains/{brainId}/modules".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
99
|
-
method: 'POST',
|
|
100
|
-
headers: headerParameters,
|
|
101
|
-
query: queryParameters,
|
|
102
|
-
body: (0, index_1.BrainModuleUioToJSON)(requestParameters['brainModuleUio']),
|
|
103
|
-
}, initOverrides)];
|
|
104
|
-
case 1:
|
|
105
|
-
response = _a.sent();
|
|
106
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainModuleUioFromJSON)(jsonValue); })];
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
};
|
|
111
|
-
/**
|
|
112
|
-
* Adds a new module to the specified brain
|
|
113
|
-
* Add a module to a brain
|
|
114
|
-
*/
|
|
115
|
-
BrainApi.prototype.addModule = function (requestParameters, initOverrides) {
|
|
116
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
117
|
-
var response;
|
|
118
|
-
return __generator(this, function (_a) {
|
|
119
|
-
switch (_a.label) {
|
|
120
|
-
case 0: return [4 /*yield*/, this.addModuleRaw(requestParameters, initOverrides)];
|
|
121
|
-
case 1:
|
|
122
|
-
response = _a.sent();
|
|
123
|
-
return [4 /*yield*/, response.value()];
|
|
124
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
125
|
-
}
|
|
126
|
-
});
|
|
127
|
-
});
|
|
128
|
-
};
|
|
129
|
-
/**
|
|
130
|
-
* Creates a new brain with specified configuration (admin only)
|
|
131
|
-
* Create a new brain
|
|
132
|
-
*/
|
|
133
|
-
BrainApi.prototype.createBrainRaw = function (requestParameters, initOverrides) {
|
|
134
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
135
|
-
var queryParameters, headerParameters, response;
|
|
136
|
-
return __generator(this, function (_a) {
|
|
137
|
-
switch (_a.label) {
|
|
138
|
-
case 0:
|
|
139
|
-
if (requestParameters['brainRequestUio'] == null) {
|
|
140
|
-
throw new runtime.RequiredError('brainRequestUio', 'Required parameter "brainRequestUio" was null or undefined when calling createBrain().');
|
|
141
|
-
}
|
|
142
|
-
queryParameters = {};
|
|
143
|
-
headerParameters = {};
|
|
144
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
145
|
-
return [4 /*yield*/, this.request({
|
|
146
|
-
path: "/brains",
|
|
147
|
-
method: 'POST',
|
|
148
|
-
headers: headerParameters,
|
|
149
|
-
query: queryParameters,
|
|
150
|
-
body: (0, index_1.BrainRequestUioToJSON)(requestParameters['brainRequestUio']),
|
|
151
|
-
}, initOverrides)];
|
|
152
|
-
case 1:
|
|
153
|
-
response = _a.sent();
|
|
154
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainUioFromJSON)(jsonValue); })];
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
};
|
|
159
|
-
/**
|
|
160
|
-
* Creates a new brain with specified configuration (admin only)
|
|
161
|
-
* Create a new brain
|
|
162
|
-
*/
|
|
163
|
-
BrainApi.prototype.createBrain = function (requestParameters, initOverrides) {
|
|
164
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
165
|
-
var response;
|
|
166
|
-
return __generator(this, function (_a) {
|
|
167
|
-
switch (_a.label) {
|
|
168
|
-
case 0: return [4 /*yield*/, this.createBrainRaw(requestParameters, initOverrides)];
|
|
169
|
-
case 1:
|
|
170
|
-
response = _a.sent();
|
|
171
|
-
return [4 /*yield*/, response.value()];
|
|
172
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
173
|
-
}
|
|
174
|
-
});
|
|
175
|
-
});
|
|
176
|
-
};
|
|
177
|
-
/**
|
|
178
|
-
* Creates a new conversation flow for a specific brain
|
|
179
|
-
* Create a new flow
|
|
180
|
-
*/
|
|
181
|
-
BrainApi.prototype.createFlowRaw = function (requestParameters, initOverrides) {
|
|
182
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
183
|
-
var queryParameters, headerParameters, response;
|
|
184
|
-
return __generator(this, function (_a) {
|
|
185
|
-
switch (_a.label) {
|
|
186
|
-
case 0:
|
|
187
|
-
if (requestParameters['brainId'] == null) {
|
|
188
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling createFlow().');
|
|
189
|
-
}
|
|
190
|
-
if (requestParameters['brainFlowCreateUio'] == null) {
|
|
191
|
-
throw new runtime.RequiredError('brainFlowCreateUio', 'Required parameter "brainFlowCreateUio" was null or undefined when calling createFlow().');
|
|
192
|
-
}
|
|
193
|
-
queryParameters = {};
|
|
194
|
-
headerParameters = {};
|
|
195
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
196
|
-
return [4 /*yield*/, this.request({
|
|
197
|
-
path: "/brains/{brainId}/flows".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
198
|
-
method: 'POST',
|
|
199
|
-
headers: headerParameters,
|
|
200
|
-
query: queryParameters,
|
|
201
|
-
body: (0, index_1.BrainFlowCreateUioToJSON)(requestParameters['brainFlowCreateUio']),
|
|
202
|
-
}, initOverrides)];
|
|
203
|
-
case 1:
|
|
204
|
-
response = _a.sent();
|
|
205
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainFlowUioFromJSON)(jsonValue); })];
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
});
|
|
209
|
-
};
|
|
210
|
-
/**
|
|
211
|
-
* Creates a new conversation flow for a specific brain
|
|
212
|
-
* Create a new flow
|
|
213
|
-
*/
|
|
214
|
-
BrainApi.prototype.createFlow = function (requestParameters, initOverrides) {
|
|
215
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
216
|
-
var response;
|
|
217
|
-
return __generator(this, function (_a) {
|
|
218
|
-
switch (_a.label) {
|
|
219
|
-
case 0: return [4 /*yield*/, this.createFlowRaw(requestParameters, initOverrides)];
|
|
220
|
-
case 1:
|
|
221
|
-
response = _a.sent();
|
|
222
|
-
return [4 /*yield*/, response.value()];
|
|
223
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
224
|
-
}
|
|
225
|
-
});
|
|
226
|
-
});
|
|
227
|
-
};
|
|
228
|
-
/**
|
|
229
|
-
* Deletes a brain and all its associated agents
|
|
230
|
-
* Delete a brain
|
|
231
|
-
*/
|
|
232
|
-
BrainApi.prototype.deleteBrainByIdRaw = function (requestParameters, initOverrides) {
|
|
233
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
234
|
-
var queryParameters, headerParameters, response;
|
|
235
|
-
return __generator(this, function (_a) {
|
|
236
|
-
switch (_a.label) {
|
|
237
|
-
case 0:
|
|
238
|
-
if (requestParameters['brainId'] == null) {
|
|
239
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling deleteBrainById().');
|
|
240
|
-
}
|
|
241
|
-
queryParameters = {};
|
|
242
|
-
headerParameters = {};
|
|
243
|
-
return [4 /*yield*/, this.request({
|
|
244
|
-
path: "/brains/{brainId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
245
|
-
method: 'DELETE',
|
|
246
|
-
headers: headerParameters,
|
|
247
|
-
query: queryParameters,
|
|
248
|
-
}, initOverrides)];
|
|
249
|
-
case 1:
|
|
250
|
-
response = _a.sent();
|
|
251
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
252
|
-
}
|
|
253
|
-
});
|
|
254
|
-
});
|
|
255
|
-
};
|
|
256
|
-
/**
|
|
257
|
-
* Deletes a brain and all its associated agents
|
|
258
|
-
* Delete a brain
|
|
259
|
-
*/
|
|
260
|
-
BrainApi.prototype.deleteBrainById = function (requestParameters, initOverrides) {
|
|
261
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
262
|
-
return __generator(this, function (_a) {
|
|
263
|
-
switch (_a.label) {
|
|
264
|
-
case 0: return [4 /*yield*/, this.deleteBrainByIdRaw(requestParameters, initOverrides)];
|
|
265
|
-
case 1:
|
|
266
|
-
_a.sent();
|
|
267
|
-
return [2 /*return*/];
|
|
268
|
-
}
|
|
269
|
-
});
|
|
270
|
-
});
|
|
271
|
-
};
|
|
272
|
-
/**
|
|
273
|
-
* Deletes a specific conversation flow
|
|
274
|
-
* Delete a flow
|
|
275
|
-
*/
|
|
276
|
-
BrainApi.prototype.deleteFlowRaw = function (requestParameters, initOverrides) {
|
|
277
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
278
|
-
var queryParameters, headerParameters, response;
|
|
279
|
-
return __generator(this, function (_a) {
|
|
280
|
-
switch (_a.label) {
|
|
281
|
-
case 0:
|
|
282
|
-
if (requestParameters['brainId'] == null) {
|
|
283
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling deleteFlow().');
|
|
284
|
-
}
|
|
285
|
-
if (requestParameters['flowId'] == null) {
|
|
286
|
-
throw new runtime.RequiredError('flowId', 'Required parameter "flowId" was null or undefined when calling deleteFlow().');
|
|
287
|
-
}
|
|
288
|
-
queryParameters = {};
|
|
289
|
-
headerParameters = {};
|
|
290
|
-
return [4 /*yield*/, this.request({
|
|
291
|
-
path: "/brains/{brainId}/flows/{flowId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))).replace("{".concat("flowId", "}"), encodeURIComponent(String(requestParameters['flowId']))),
|
|
292
|
-
method: 'DELETE',
|
|
293
|
-
headers: headerParameters,
|
|
294
|
-
query: queryParameters,
|
|
295
|
-
}, initOverrides)];
|
|
296
|
-
case 1:
|
|
297
|
-
response = _a.sent();
|
|
298
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
299
|
-
}
|
|
300
|
-
});
|
|
301
|
-
});
|
|
302
|
-
};
|
|
303
|
-
/**
|
|
304
|
-
* Deletes a specific conversation flow
|
|
305
|
-
* Delete a flow
|
|
306
|
-
*/
|
|
307
|
-
BrainApi.prototype.deleteFlow = function (requestParameters, initOverrides) {
|
|
308
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
309
|
-
return __generator(this, function (_a) {
|
|
310
|
-
switch (_a.label) {
|
|
311
|
-
case 0: return [4 /*yield*/, this.deleteFlowRaw(requestParameters, initOverrides)];
|
|
312
|
-
case 1:
|
|
313
|
-
_a.sent();
|
|
314
|
-
return [2 /*return*/];
|
|
315
|
-
}
|
|
316
|
-
});
|
|
317
|
-
});
|
|
318
|
-
};
|
|
319
|
-
/**
|
|
320
|
-
* Deletes a specific module from the brain
|
|
321
|
-
* Remove a module from a brain
|
|
322
|
-
*/
|
|
323
|
-
BrainApi.prototype.deleteModuleRaw = function (requestParameters, initOverrides) {
|
|
324
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
325
|
-
var queryParameters, headerParameters, response;
|
|
326
|
-
return __generator(this, function (_a) {
|
|
327
|
-
switch (_a.label) {
|
|
328
|
-
case 0:
|
|
329
|
-
if (requestParameters['brainId'] == null) {
|
|
330
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling deleteModule().');
|
|
331
|
-
}
|
|
332
|
-
if (requestParameters['moduleName'] == null) {
|
|
333
|
-
throw new runtime.RequiredError('moduleName', 'Required parameter "moduleName" was null or undefined when calling deleteModule().');
|
|
334
|
-
}
|
|
335
|
-
queryParameters = {};
|
|
336
|
-
headerParameters = {};
|
|
337
|
-
return [4 /*yield*/, this.request({
|
|
338
|
-
path: "/brains/{brainId}/modules/{moduleName}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))).replace("{".concat("moduleName", "}"), encodeURIComponent(String(requestParameters['moduleName']))),
|
|
339
|
-
method: 'DELETE',
|
|
340
|
-
headers: headerParameters,
|
|
341
|
-
query: queryParameters,
|
|
342
|
-
}, initOverrides)];
|
|
343
|
-
case 1:
|
|
344
|
-
response = _a.sent();
|
|
345
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
346
|
-
}
|
|
347
|
-
});
|
|
348
|
-
});
|
|
349
|
-
};
|
|
350
|
-
/**
|
|
351
|
-
* Deletes a specific module from the brain
|
|
352
|
-
* Remove a module from a brain
|
|
353
|
-
*/
|
|
354
|
-
BrainApi.prototype.deleteModule = function (requestParameters, initOverrides) {
|
|
355
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
356
|
-
return __generator(this, function (_a) {
|
|
357
|
-
switch (_a.label) {
|
|
358
|
-
case 0: return [4 /*yield*/, this.deleteModuleRaw(requestParameters, initOverrides)];
|
|
359
|
-
case 1:
|
|
360
|
-
_a.sent();
|
|
361
|
-
return [2 /*return*/];
|
|
362
|
-
}
|
|
363
|
-
});
|
|
364
|
-
});
|
|
365
|
-
};
|
|
366
|
-
/**
|
|
367
|
-
* Get a specific brain by ID
|
|
368
|
-
*/
|
|
369
|
-
BrainApi.prototype.getBrainByIdRaw = function (requestParameters, initOverrides) {
|
|
370
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
371
|
-
var queryParameters, headerParameters, response;
|
|
372
|
-
return __generator(this, function (_a) {
|
|
373
|
-
switch (_a.label) {
|
|
374
|
-
case 0:
|
|
375
|
-
if (requestParameters['brainId'] == null) {
|
|
376
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getBrainById().');
|
|
377
|
-
}
|
|
378
|
-
queryParameters = {};
|
|
379
|
-
headerParameters = {};
|
|
380
|
-
return [4 /*yield*/, this.request({
|
|
381
|
-
path: "/brains/{brainId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
382
|
-
method: 'GET',
|
|
383
|
-
headers: headerParameters,
|
|
384
|
-
query: queryParameters,
|
|
385
|
-
}, initOverrides)];
|
|
386
|
-
case 1:
|
|
387
|
-
response = _a.sent();
|
|
388
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainUioFromJSON)(jsonValue); })];
|
|
389
|
-
}
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
};
|
|
393
|
-
/**
|
|
394
|
-
* Get a specific brain by ID
|
|
395
|
-
*/
|
|
396
|
-
BrainApi.prototype.getBrainById = function (requestParameters, initOverrides) {
|
|
397
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
398
|
-
var response;
|
|
399
|
-
return __generator(this, function (_a) {
|
|
400
|
-
switch (_a.label) {
|
|
401
|
-
case 0: return [4 /*yield*/, this.getBrainByIdRaw(requestParameters, initOverrides)];
|
|
402
|
-
case 1:
|
|
403
|
-
response = _a.sent();
|
|
404
|
-
return [4 /*yield*/, response.value()];
|
|
405
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
406
|
-
}
|
|
407
|
-
});
|
|
408
|
-
});
|
|
409
|
-
};
|
|
410
|
-
/**
|
|
411
|
-
* Retrieves detailed usage metrics for a specific brain (admin only)
|
|
412
|
-
* Get detailed brain metrics
|
|
413
|
-
*/
|
|
414
|
-
BrainApi.prototype.getBrainMetricsRaw = function (requestParameters, initOverrides) {
|
|
415
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
416
|
-
var queryParameters, headerParameters, response;
|
|
417
|
-
return __generator(this, function (_a) {
|
|
418
|
-
switch (_a.label) {
|
|
419
|
-
case 0:
|
|
420
|
-
if (requestParameters['brainId'] == null) {
|
|
421
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getBrainMetrics().');
|
|
422
|
-
}
|
|
423
|
-
queryParameters = {};
|
|
424
|
-
if (requestParameters['startDate'] != null) {
|
|
425
|
-
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
426
|
-
}
|
|
427
|
-
if (requestParameters['endDate'] != null) {
|
|
428
|
-
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
429
|
-
}
|
|
430
|
-
headerParameters = {};
|
|
431
|
-
return [4 /*yield*/, this.request({
|
|
432
|
-
path: "/brains/{brainId}/metrics".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
433
|
-
method: 'GET',
|
|
434
|
-
headers: headerParameters,
|
|
435
|
-
query: queryParameters,
|
|
436
|
-
}, initOverrides)];
|
|
437
|
-
case 1:
|
|
438
|
-
response = _a.sent();
|
|
439
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.BrainUsageMetricsUioFromJSON); })];
|
|
440
|
-
}
|
|
441
|
-
});
|
|
442
|
-
});
|
|
443
|
-
};
|
|
444
|
-
/**
|
|
445
|
-
* Retrieves detailed usage metrics for a specific brain (admin only)
|
|
446
|
-
* Get detailed brain metrics
|
|
447
|
-
*/
|
|
448
|
-
BrainApi.prototype.getBrainMetrics = function (requestParameters, initOverrides) {
|
|
449
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
450
|
-
var response;
|
|
451
|
-
return __generator(this, function (_a) {
|
|
452
|
-
switch (_a.label) {
|
|
453
|
-
case 0: return [4 /*yield*/, this.getBrainMetricsRaw(requestParameters, initOverrides)];
|
|
454
|
-
case 1:
|
|
455
|
-
response = _a.sent();
|
|
456
|
-
return [4 /*yield*/, response.value()];
|
|
457
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
458
|
-
}
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
};
|
|
462
|
-
/**
|
|
463
|
-
* Retrieves detailed metric events for a specific brain (admin only)
|
|
464
|
-
* Get brain metrics events
|
|
465
|
-
*/
|
|
466
|
-
BrainApi.prototype.getBrainMetricsEventsRaw = function (requestParameters, initOverrides) {
|
|
467
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
468
|
-
var queryParameters, headerParameters, response;
|
|
469
|
-
return __generator(this, function (_a) {
|
|
470
|
-
switch (_a.label) {
|
|
471
|
-
case 0:
|
|
472
|
-
if (requestParameters['brainId'] == null) {
|
|
473
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getBrainMetricsEvents().');
|
|
474
|
-
}
|
|
475
|
-
queryParameters = {};
|
|
476
|
-
if (requestParameters['offset'] != null) {
|
|
477
|
-
queryParameters['offset'] = requestParameters['offset'];
|
|
478
|
-
}
|
|
479
|
-
if (requestParameters['startDate'] != null) {
|
|
480
|
-
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
481
|
-
}
|
|
482
|
-
if (requestParameters['endDate'] != null) {
|
|
483
|
-
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
484
|
-
}
|
|
485
|
-
headerParameters = {};
|
|
486
|
-
return [4 /*yield*/, this.request({
|
|
487
|
-
path: "/brains/{brainId}/metrics/events".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
488
|
-
method: 'GET',
|
|
489
|
-
headers: headerParameters,
|
|
490
|
-
query: queryParameters,
|
|
491
|
-
}, initOverrides)];
|
|
492
|
-
case 1:
|
|
493
|
-
response = _a.sent();
|
|
494
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.BrainMetricsEventUioFromJSON); })];
|
|
495
|
-
}
|
|
496
|
-
});
|
|
497
|
-
});
|
|
498
|
-
};
|
|
499
|
-
/**
|
|
500
|
-
* Retrieves detailed metric events for a specific brain (admin only)
|
|
501
|
-
* Get brain metrics events
|
|
502
|
-
*/
|
|
503
|
-
BrainApi.prototype.getBrainMetricsEvents = function (requestParameters, initOverrides) {
|
|
504
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
505
|
-
var response;
|
|
506
|
-
return __generator(this, function (_a) {
|
|
507
|
-
switch (_a.label) {
|
|
508
|
-
case 0: return [4 /*yield*/, this.getBrainMetricsEventsRaw(requestParameters, initOverrides)];
|
|
509
|
-
case 1:
|
|
510
|
-
response = _a.sent();
|
|
511
|
-
return [4 /*yield*/, response.value()];
|
|
512
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
513
|
-
}
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
};
|
|
517
|
-
/**
|
|
518
|
-
* Retrieves usage metrics overview for a specific brain
|
|
519
|
-
* Get brain metrics overview
|
|
520
|
-
*/
|
|
521
|
-
BrainApi.prototype.getBrainMetricsOverviewRaw = function (requestParameters, initOverrides) {
|
|
522
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
523
|
-
var queryParameters, headerParameters, response;
|
|
524
|
-
return __generator(this, function (_a) {
|
|
525
|
-
switch (_a.label) {
|
|
526
|
-
case 0:
|
|
527
|
-
if (requestParameters['brainId'] == null) {
|
|
528
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getBrainMetricsOverview().');
|
|
529
|
-
}
|
|
530
|
-
queryParameters = {};
|
|
531
|
-
if (requestParameters['startDate'] != null) {
|
|
532
|
-
queryParameters['startDate'] = requestParameters['startDate'].toISOString();
|
|
533
|
-
}
|
|
534
|
-
if (requestParameters['endDate'] != null) {
|
|
535
|
-
queryParameters['endDate'] = requestParameters['endDate'].toISOString();
|
|
536
|
-
}
|
|
537
|
-
headerParameters = {};
|
|
538
|
-
return [4 /*yield*/, this.request({
|
|
539
|
-
path: "/brains/{brainId}/metrics/overview".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
540
|
-
method: 'GET',
|
|
541
|
-
headers: headerParameters,
|
|
542
|
-
query: queryParameters,
|
|
543
|
-
}, initOverrides)];
|
|
544
|
-
case 1:
|
|
545
|
-
response = _a.sent();
|
|
546
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainMetricsOverviewUioFromJSON)(jsonValue); })];
|
|
547
|
-
}
|
|
548
|
-
});
|
|
549
|
-
});
|
|
550
|
-
};
|
|
551
|
-
/**
|
|
552
|
-
* Retrieves usage metrics overview for a specific brain
|
|
553
|
-
* Get brain metrics overview
|
|
554
|
-
*/
|
|
555
|
-
BrainApi.prototype.getBrainMetricsOverview = function (requestParameters, initOverrides) {
|
|
556
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
557
|
-
var response;
|
|
558
|
-
return __generator(this, function (_a) {
|
|
559
|
-
switch (_a.label) {
|
|
560
|
-
case 0: return [4 /*yield*/, this.getBrainMetricsOverviewRaw(requestParameters, initOverrides)];
|
|
561
|
-
case 1:
|
|
562
|
-
response = _a.sent();
|
|
563
|
-
return [4 /*yield*/, response.value()];
|
|
564
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
565
|
-
}
|
|
566
|
-
});
|
|
567
|
-
});
|
|
568
|
-
};
|
|
569
|
-
/**
|
|
570
|
-
* Retrieves a specific conversation flow by ID
|
|
571
|
-
* Get a specific flow
|
|
572
|
-
*/
|
|
573
|
-
BrainApi.prototype.getFlowRaw = function (requestParameters, initOverrides) {
|
|
574
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
575
|
-
var queryParameters, headerParameters, response;
|
|
576
|
-
return __generator(this, function (_a) {
|
|
577
|
-
switch (_a.label) {
|
|
578
|
-
case 0:
|
|
579
|
-
if (requestParameters['brainId'] == null) {
|
|
580
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getFlow().');
|
|
581
|
-
}
|
|
582
|
-
if (requestParameters['flowId'] == null) {
|
|
583
|
-
throw new runtime.RequiredError('flowId', 'Required parameter "flowId" was null or undefined when calling getFlow().');
|
|
584
|
-
}
|
|
585
|
-
queryParameters = {};
|
|
586
|
-
headerParameters = {};
|
|
587
|
-
return [4 /*yield*/, this.request({
|
|
588
|
-
path: "/brains/{brainId}/flows/{flowId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))).replace("{".concat("flowId", "}"), encodeURIComponent(String(requestParameters['flowId']))),
|
|
589
|
-
method: 'GET',
|
|
590
|
-
headers: headerParameters,
|
|
591
|
-
query: queryParameters,
|
|
592
|
-
}, initOverrides)];
|
|
593
|
-
case 1:
|
|
594
|
-
response = _a.sent();
|
|
595
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainFlowUioFromJSON)(jsonValue); })];
|
|
596
|
-
}
|
|
597
|
-
});
|
|
598
|
-
});
|
|
599
|
-
};
|
|
600
|
-
/**
|
|
601
|
-
* Retrieves a specific conversation flow by ID
|
|
602
|
-
* Get a specific flow
|
|
603
|
-
*/
|
|
604
|
-
BrainApi.prototype.getFlow = function (requestParameters, initOverrides) {
|
|
605
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
606
|
-
var response;
|
|
607
|
-
return __generator(this, function (_a) {
|
|
608
|
-
switch (_a.label) {
|
|
609
|
-
case 0: return [4 /*yield*/, this.getFlowRaw(requestParameters, initOverrides)];
|
|
610
|
-
case 1:
|
|
611
|
-
response = _a.sent();
|
|
612
|
-
return [4 /*yield*/, response.value()];
|
|
613
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
614
|
-
}
|
|
615
|
-
});
|
|
616
|
-
});
|
|
617
|
-
};
|
|
618
|
-
/**
|
|
619
|
-
* Retrieves all conversation flows associated with a specific brain
|
|
620
|
-
* Get all flows for a brain
|
|
621
|
-
*/
|
|
622
|
-
BrainApi.prototype.getFlowsRaw = function (requestParameters, initOverrides) {
|
|
623
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
624
|
-
var queryParameters, headerParameters, response;
|
|
625
|
-
return __generator(this, function (_a) {
|
|
626
|
-
switch (_a.label) {
|
|
627
|
-
case 0:
|
|
628
|
-
if (requestParameters['brainId'] == null) {
|
|
629
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getFlows().');
|
|
630
|
-
}
|
|
631
|
-
queryParameters = {};
|
|
632
|
-
headerParameters = {};
|
|
633
|
-
return [4 /*yield*/, this.request({
|
|
634
|
-
path: "/brains/{brainId}/flows".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
635
|
-
method: 'GET',
|
|
636
|
-
headers: headerParameters,
|
|
637
|
-
query: queryParameters,
|
|
638
|
-
}, initOverrides)];
|
|
639
|
-
case 1:
|
|
640
|
-
response = _a.sent();
|
|
641
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return jsonValue.map(index_1.BrainFlowUioFromJSON); })];
|
|
642
|
-
}
|
|
643
|
-
});
|
|
644
|
-
});
|
|
645
|
-
};
|
|
646
|
-
/**
|
|
647
|
-
* Retrieves all conversation flows associated with a specific brain
|
|
648
|
-
* Get all flows for a brain
|
|
649
|
-
*/
|
|
650
|
-
BrainApi.prototype.getFlows = function (requestParameters, initOverrides) {
|
|
651
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
652
|
-
var response;
|
|
653
|
-
return __generator(this, function (_a) {
|
|
654
|
-
switch (_a.label) {
|
|
655
|
-
case 0: return [4 /*yield*/, this.getFlowsRaw(requestParameters, initOverrides)];
|
|
656
|
-
case 1:
|
|
657
|
-
response = _a.sent();
|
|
658
|
-
return [4 /*yield*/, response.value()];
|
|
659
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
660
|
-
}
|
|
661
|
-
});
|
|
662
|
-
});
|
|
663
|
-
};
|
|
664
|
-
/**
|
|
665
|
-
* Retrieves all modules for a specific brain
|
|
666
|
-
* Get brain modules
|
|
667
|
-
*/
|
|
668
|
-
BrainApi.prototype.getModulesRaw = function (requestParameters, initOverrides) {
|
|
669
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
670
|
-
var queryParameters, headerParameters, response;
|
|
671
|
-
return __generator(this, function (_a) {
|
|
672
|
-
switch (_a.label) {
|
|
673
|
-
case 0:
|
|
674
|
-
if (requestParameters['brainId'] == null) {
|
|
675
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling getModules().');
|
|
676
|
-
}
|
|
677
|
-
queryParameters = {};
|
|
678
|
-
headerParameters = {};
|
|
679
|
-
return [4 /*yield*/, this.request({
|
|
680
|
-
path: "/brains/{brainId}/modules".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
681
|
-
method: 'GET',
|
|
682
|
-
headers: headerParameters,
|
|
683
|
-
query: queryParameters,
|
|
684
|
-
}, initOverrides)];
|
|
685
|
-
case 1:
|
|
686
|
-
response = _a.sent();
|
|
687
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainModuleUioFromJSON)(jsonValue); })];
|
|
688
|
-
}
|
|
689
|
-
});
|
|
690
|
-
});
|
|
691
|
-
};
|
|
692
|
-
/**
|
|
693
|
-
* Retrieves all modules for a specific brain
|
|
694
|
-
* Get brain modules
|
|
695
|
-
*/
|
|
696
|
-
BrainApi.prototype.getModules = function (requestParameters, initOverrides) {
|
|
697
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
698
|
-
var response;
|
|
699
|
-
return __generator(this, function (_a) {
|
|
700
|
-
switch (_a.label) {
|
|
701
|
-
case 0: return [4 /*yield*/, this.getModulesRaw(requestParameters, initOverrides)];
|
|
702
|
-
case 1:
|
|
703
|
-
response = _a.sent();
|
|
704
|
-
return [4 /*yield*/, response.value()];
|
|
705
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
706
|
-
}
|
|
707
|
-
});
|
|
708
|
-
});
|
|
709
|
-
};
|
|
710
|
-
/**
|
|
711
|
-
* Removes the profile image for a brain
|
|
712
|
-
* Remove brain profile image
|
|
713
|
-
*/
|
|
714
|
-
BrainApi.prototype.removeBrainProfileImageRaw = function (requestParameters, initOverrides) {
|
|
715
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
716
|
-
var queryParameters, headerParameters, response;
|
|
717
|
-
return __generator(this, function (_a) {
|
|
718
|
-
switch (_a.label) {
|
|
719
|
-
case 0:
|
|
720
|
-
if (requestParameters['brainId'] == null) {
|
|
721
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling removeBrainProfileImage().');
|
|
722
|
-
}
|
|
723
|
-
queryParameters = {};
|
|
724
|
-
headerParameters = {};
|
|
725
|
-
return [4 /*yield*/, this.request({
|
|
726
|
-
path: "/brains/{brainId}/files".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
727
|
-
method: 'DELETE',
|
|
728
|
-
headers: headerParameters,
|
|
729
|
-
query: queryParameters,
|
|
730
|
-
}, initOverrides)];
|
|
731
|
-
case 1:
|
|
732
|
-
response = _a.sent();
|
|
733
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
734
|
-
}
|
|
735
|
-
});
|
|
736
|
-
});
|
|
737
|
-
};
|
|
738
|
-
/**
|
|
739
|
-
* Removes the profile image for a brain
|
|
740
|
-
* Remove brain profile image
|
|
741
|
-
*/
|
|
742
|
-
BrainApi.prototype.removeBrainProfileImage = function (requestParameters, initOverrides) {
|
|
743
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
744
|
-
return __generator(this, function (_a) {
|
|
745
|
-
switch (_a.label) {
|
|
746
|
-
case 0: return [4 /*yield*/, this.removeBrainProfileImageRaw(requestParameters, initOverrides)];
|
|
747
|
-
case 1:
|
|
748
|
-
_a.sent();
|
|
749
|
-
return [2 /*return*/];
|
|
750
|
-
}
|
|
751
|
-
});
|
|
752
|
-
});
|
|
753
|
-
};
|
|
754
|
-
/**
|
|
755
|
-
* Removes the subscription plan from a brain (admin only)
|
|
756
|
-
* Remove brain subscription
|
|
757
|
-
*/
|
|
758
|
-
BrainApi.prototype.removeBrainSubscriptionRaw = function (requestParameters, initOverrides) {
|
|
759
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
760
|
-
var queryParameters, headerParameters, response;
|
|
761
|
-
return __generator(this, function (_a) {
|
|
762
|
-
switch (_a.label) {
|
|
763
|
-
case 0:
|
|
764
|
-
if (requestParameters['brainId'] == null) {
|
|
765
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling removeBrainSubscription().');
|
|
766
|
-
}
|
|
767
|
-
queryParameters = {};
|
|
768
|
-
headerParameters = {};
|
|
769
|
-
return [4 /*yield*/, this.request({
|
|
770
|
-
path: "/brains/{brainId}/subscription".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
771
|
-
method: 'DELETE',
|
|
772
|
-
headers: headerParameters,
|
|
773
|
-
query: queryParameters,
|
|
774
|
-
}, initOverrides)];
|
|
775
|
-
case 1:
|
|
776
|
-
response = _a.sent();
|
|
777
|
-
return [2 /*return*/, new runtime.VoidApiResponse(response)];
|
|
778
|
-
}
|
|
779
|
-
});
|
|
780
|
-
});
|
|
781
|
-
};
|
|
782
|
-
/**
|
|
783
|
-
* Removes the subscription plan from a brain (admin only)
|
|
784
|
-
* Remove brain subscription
|
|
785
|
-
*/
|
|
786
|
-
BrainApi.prototype.removeBrainSubscription = function (requestParameters, initOverrides) {
|
|
787
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
788
|
-
return __generator(this, function (_a) {
|
|
789
|
-
switch (_a.label) {
|
|
790
|
-
case 0: return [4 /*yield*/, this.removeBrainSubscriptionRaw(requestParameters, initOverrides)];
|
|
791
|
-
case 1:
|
|
792
|
-
_a.sent();
|
|
793
|
-
return [2 /*return*/];
|
|
794
|
-
}
|
|
795
|
-
});
|
|
796
|
-
});
|
|
797
|
-
};
|
|
798
|
-
/**
|
|
799
|
-
* Updates an existing brain\'s properties
|
|
800
|
-
* Update a brain
|
|
801
|
-
*/
|
|
802
|
-
BrainApi.prototype.updateBrainByIdRaw = function (requestParameters, initOverrides) {
|
|
803
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
804
|
-
var queryParameters, headerParameters, response;
|
|
805
|
-
return __generator(this, function (_a) {
|
|
806
|
-
switch (_a.label) {
|
|
807
|
-
case 0:
|
|
808
|
-
if (requestParameters['brainId'] == null) {
|
|
809
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling updateBrainById().');
|
|
810
|
-
}
|
|
811
|
-
if (requestParameters['brainPatchUio'] == null) {
|
|
812
|
-
throw new runtime.RequiredError('brainPatchUio', 'Required parameter "brainPatchUio" was null or undefined when calling updateBrainById().');
|
|
813
|
-
}
|
|
814
|
-
queryParameters = {};
|
|
815
|
-
headerParameters = {};
|
|
816
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
817
|
-
return [4 /*yield*/, this.request({
|
|
818
|
-
path: "/brains/{brainId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
819
|
-
method: 'PATCH',
|
|
820
|
-
headers: headerParameters,
|
|
821
|
-
query: queryParameters,
|
|
822
|
-
body: (0, index_1.BrainPatchUioToJSON)(requestParameters['brainPatchUio']),
|
|
823
|
-
}, initOverrides)];
|
|
824
|
-
case 1:
|
|
825
|
-
response = _a.sent();
|
|
826
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainPatchUioFromJSON)(jsonValue); })];
|
|
827
|
-
}
|
|
828
|
-
});
|
|
829
|
-
});
|
|
830
|
-
};
|
|
831
|
-
/**
|
|
832
|
-
* Updates an existing brain\'s properties
|
|
833
|
-
* Update a brain
|
|
834
|
-
*/
|
|
835
|
-
BrainApi.prototype.updateBrainById = function (requestParameters, initOverrides) {
|
|
836
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
837
|
-
var response;
|
|
838
|
-
return __generator(this, function (_a) {
|
|
839
|
-
switch (_a.label) {
|
|
840
|
-
case 0: return [4 /*yield*/, this.updateBrainByIdRaw(requestParameters, initOverrides)];
|
|
841
|
-
case 1:
|
|
842
|
-
response = _a.sent();
|
|
843
|
-
return [4 /*yield*/, response.value()];
|
|
844
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
845
|
-
}
|
|
846
|
-
});
|
|
847
|
-
});
|
|
848
|
-
};
|
|
849
|
-
/**
|
|
850
|
-
* Sets or updates a subscription plan for a brain (admin only)
|
|
851
|
-
* Update brain subscription
|
|
852
|
-
*/
|
|
853
|
-
BrainApi.prototype.updateBrainSubscriptionRaw = function (requestParameters, initOverrides) {
|
|
854
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
855
|
-
var queryParameters, headerParameters, response;
|
|
856
|
-
return __generator(this, function (_a) {
|
|
857
|
-
switch (_a.label) {
|
|
858
|
-
case 0:
|
|
859
|
-
if (requestParameters['brainId'] == null) {
|
|
860
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling updateBrainSubscription().');
|
|
861
|
-
}
|
|
862
|
-
if (requestParameters['brainSubscriptionUio'] == null) {
|
|
863
|
-
throw new runtime.RequiredError('brainSubscriptionUio', 'Required parameter "brainSubscriptionUio" was null or undefined when calling updateBrainSubscription().');
|
|
864
|
-
}
|
|
865
|
-
queryParameters = {};
|
|
866
|
-
headerParameters = {};
|
|
867
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
868
|
-
return [4 /*yield*/, this.request({
|
|
869
|
-
path: "/brains/{brainId}/subscription".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
870
|
-
method: 'PUT',
|
|
871
|
-
headers: headerParameters,
|
|
872
|
-
query: queryParameters,
|
|
873
|
-
body: (0, index_1.BrainSubscriptionUioToJSON)(requestParameters['brainSubscriptionUio']),
|
|
874
|
-
}, initOverrides)];
|
|
875
|
-
case 1:
|
|
876
|
-
response = _a.sent();
|
|
877
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainSubscriptionUioFromJSON)(jsonValue); })];
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
});
|
|
881
|
-
};
|
|
882
|
-
/**
|
|
883
|
-
* Sets or updates a subscription plan for a brain (admin only)
|
|
884
|
-
* Update brain subscription
|
|
885
|
-
*/
|
|
886
|
-
BrainApi.prototype.updateBrainSubscription = function (requestParameters, initOverrides) {
|
|
887
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
888
|
-
var response;
|
|
889
|
-
return __generator(this, function (_a) {
|
|
890
|
-
switch (_a.label) {
|
|
891
|
-
case 0: return [4 /*yield*/, this.updateBrainSubscriptionRaw(requestParameters, initOverrides)];
|
|
892
|
-
case 1:
|
|
893
|
-
response = _a.sent();
|
|
894
|
-
return [4 /*yield*/, response.value()];
|
|
895
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
896
|
-
}
|
|
897
|
-
});
|
|
898
|
-
});
|
|
899
|
-
};
|
|
900
|
-
/**
|
|
901
|
-
* Updates an existing conversation flow
|
|
902
|
-
* Update a flow
|
|
903
|
-
*/
|
|
904
|
-
BrainApi.prototype.updateFlowRaw = function (requestParameters, initOverrides) {
|
|
905
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
906
|
-
var queryParameters, headerParameters, response;
|
|
907
|
-
return __generator(this, function (_a) {
|
|
908
|
-
switch (_a.label) {
|
|
909
|
-
case 0:
|
|
910
|
-
if (requestParameters['brainId'] == null) {
|
|
911
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling updateFlow().');
|
|
912
|
-
}
|
|
913
|
-
if (requestParameters['flowId'] == null) {
|
|
914
|
-
throw new runtime.RequiredError('flowId', 'Required parameter "flowId" was null or undefined when calling updateFlow().');
|
|
915
|
-
}
|
|
916
|
-
if (requestParameters['brainFlowUio'] == null) {
|
|
917
|
-
throw new runtime.RequiredError('brainFlowUio', 'Required parameter "brainFlowUio" was null or undefined when calling updateFlow().');
|
|
918
|
-
}
|
|
919
|
-
queryParameters = {};
|
|
920
|
-
headerParameters = {};
|
|
921
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
922
|
-
return [4 /*yield*/, this.request({
|
|
923
|
-
path: "/brains/{brainId}/flows/{flowId}".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))).replace("{".concat("flowId", "}"), encodeURIComponent(String(requestParameters['flowId']))),
|
|
924
|
-
method: 'PUT',
|
|
925
|
-
headers: headerParameters,
|
|
926
|
-
query: queryParameters,
|
|
927
|
-
body: (0, index_1.BrainFlowUioToJSON)(requestParameters['brainFlowUio']),
|
|
928
|
-
}, initOverrides)];
|
|
929
|
-
case 1:
|
|
930
|
-
response = _a.sent();
|
|
931
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response, function (jsonValue) { return (0, index_1.BrainFlowUioFromJSON)(jsonValue); })];
|
|
932
|
-
}
|
|
933
|
-
});
|
|
934
|
-
});
|
|
935
|
-
};
|
|
936
|
-
/**
|
|
937
|
-
* Updates an existing conversation flow
|
|
938
|
-
* Update a flow
|
|
939
|
-
*/
|
|
940
|
-
BrainApi.prototype.updateFlow = function (requestParameters, initOverrides) {
|
|
941
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
942
|
-
var response;
|
|
943
|
-
return __generator(this, function (_a) {
|
|
944
|
-
switch (_a.label) {
|
|
945
|
-
case 0: return [4 /*yield*/, this.updateFlowRaw(requestParameters, initOverrides)];
|
|
946
|
-
case 1:
|
|
947
|
-
response = _a.sent();
|
|
948
|
-
return [4 /*yield*/, response.value()];
|
|
949
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
950
|
-
}
|
|
951
|
-
});
|
|
952
|
-
});
|
|
953
|
-
};
|
|
954
|
-
/**
|
|
955
|
-
* Uploads a profile image for a brain and returns an upload URL
|
|
956
|
-
* Upload brain profile image
|
|
957
|
-
*/
|
|
958
|
-
BrainApi.prototype.uploadBrainProfileImageRaw = function (requestParameters, initOverrides) {
|
|
959
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
960
|
-
var queryParameters, headerParameters, response;
|
|
961
|
-
return __generator(this, function (_a) {
|
|
962
|
-
switch (_a.label) {
|
|
963
|
-
case 0:
|
|
964
|
-
if (requestParameters['brainId'] == null) {
|
|
965
|
-
throw new runtime.RequiredError('brainId', 'Required parameter "brainId" was null or undefined when calling uploadBrainProfileImage().');
|
|
966
|
-
}
|
|
967
|
-
if (requestParameters['fileCreationRequestUio'] == null) {
|
|
968
|
-
throw new runtime.RequiredError('fileCreationRequestUio', 'Required parameter "fileCreationRequestUio" was null or undefined when calling uploadBrainProfileImage().');
|
|
969
|
-
}
|
|
970
|
-
queryParameters = {};
|
|
971
|
-
headerParameters = {};
|
|
972
|
-
headerParameters['Content-Type'] = 'application/json';
|
|
973
|
-
return [4 /*yield*/, this.request({
|
|
974
|
-
path: "/brains/{brainId}/files".replace("{".concat("brainId", "}"), encodeURIComponent(String(requestParameters['brainId']))),
|
|
975
|
-
method: 'POST',
|
|
976
|
-
headers: headerParameters,
|
|
977
|
-
query: queryParameters,
|
|
978
|
-
body: (0, index_1.FileCreationRequestUioToJSON)(requestParameters['fileCreationRequestUio']),
|
|
979
|
-
}, initOverrides)];
|
|
980
|
-
case 1:
|
|
981
|
-
response = _a.sent();
|
|
982
|
-
if (this.isJsonMime(response.headers.get('content-type'))) {
|
|
983
|
-
return [2 /*return*/, new runtime.JSONApiResponse(response)];
|
|
984
|
-
}
|
|
985
|
-
else {
|
|
986
|
-
return [2 /*return*/, new runtime.TextApiResponse(response)];
|
|
987
|
-
}
|
|
988
|
-
return [2 /*return*/];
|
|
989
|
-
}
|
|
990
|
-
});
|
|
991
|
-
});
|
|
992
|
-
};
|
|
993
|
-
/**
|
|
994
|
-
* Uploads a profile image for a brain and returns an upload URL
|
|
995
|
-
* Upload brain profile image
|
|
996
|
-
*/
|
|
997
|
-
BrainApi.prototype.uploadBrainProfileImage = function (requestParameters, initOverrides) {
|
|
998
|
-
return __awaiter(this, void 0, void 0, function () {
|
|
999
|
-
var response;
|
|
1000
|
-
return __generator(this, function (_a) {
|
|
1001
|
-
switch (_a.label) {
|
|
1002
|
-
case 0: return [4 /*yield*/, this.uploadBrainProfileImageRaw(requestParameters, initOverrides)];
|
|
1003
|
-
case 1:
|
|
1004
|
-
response = _a.sent();
|
|
1005
|
-
return [4 /*yield*/, response.value()];
|
|
1006
|
-
case 2: return [2 /*return*/, _a.sent()];
|
|
1007
|
-
}
|
|
1008
|
-
});
|
|
1009
|
-
});
|
|
1010
|
-
};
|
|
1011
|
-
return BrainApi;
|
|
1012
|
-
}(runtime.BaseAPI));
|
|
1013
|
-
exports.BrainApi = BrainApi;
|