edge-impulse-api 1.82.6 → 1.82.7
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/build/library/sdk/api/adminApi.d.ts +4 -6
- package/build/library/sdk/api/adminApi.js +4782 -4928
- package/build/library/sdk/api/adminApi.js.map +1 -1
- package/build/library/sdk/api/authApi.d.ts +4 -6
- package/build/library/sdk/api/authApi.js +88 -56
- package/build/library/sdk/api/authApi.js.map +1 -1
- package/build/library/sdk/api/cDNApi.d.ts +4 -6
- package/build/library/sdk/api/cDNApi.js +76 -53
- package/build/library/sdk/api/cDNApi.js.map +1 -1
- package/build/library/sdk/api/canaryApi.d.ts +4 -6
- package/build/library/sdk/api/canaryApi.js +79 -53
- package/build/library/sdk/api/canaryApi.js.map +1 -1
- package/build/library/sdk/api/classifyApi.d.ts +4 -6
- package/build/library/sdk/api/classifyApi.js +527 -499
- package/build/library/sdk/api/classifyApi.js.map +1 -1
- package/build/library/sdk/api/dSPApi.d.ts +4 -6
- package/build/library/sdk/api/dSPApi.js +938 -942
- package/build/library/sdk/api/dSPApi.js.map +1 -1
- package/build/library/sdk/api/deploymentApi.d.ts +4 -6
- package/build/library/sdk/api/deploymentApi.js +680 -603
- package/build/library/sdk/api/deploymentApi.js.map +1 -1
- package/build/library/sdk/api/devicesApi.d.ts +4 -6
- package/build/library/sdk/api/devicesApi.js +802 -800
- package/build/library/sdk/api/devicesApi.js.map +1 -1
- package/build/library/sdk/api/emailVerificationApi.d.ts +4 -6
- package/build/library/sdk/api/emailVerificationApi.js +184 -190
- package/build/library/sdk/api/emailVerificationApi.js.map +1 -1
- package/build/library/sdk/api/exportApi.d.ts +4 -6
- package/build/library/sdk/api/exportApi.js +88 -56
- package/build/library/sdk/api/exportApi.js.map +1 -1
- package/build/library/sdk/api/featureFlagsApi.d.ts +4 -6
- package/build/library/sdk/api/featureFlagsApi.js +76 -52
- package/build/library/sdk/api/featureFlagsApi.js.map +1 -1
- package/build/library/sdk/api/healthApi.d.ts +4 -6
- package/build/library/sdk/api/healthApi.js +111 -97
- package/build/library/sdk/api/healthApi.js.map +1 -1
- package/build/library/sdk/api/impulseApi.d.ts +4 -6
- package/build/library/sdk/api/impulseApi.js +942 -902
- package/build/library/sdk/api/impulseApi.js.map +1 -1
- package/build/library/sdk/api/integrationsApi.d.ts +4 -6
- package/build/library/sdk/api/integrationsApi.js +136 -106
- package/build/library/sdk/api/integrationsApi.js.map +1 -1
- package/build/library/sdk/api/jobsApi.d.ts +4 -6
- package/build/library/sdk/api/jobsApi.js +2270 -2326
- package/build/library/sdk/api/jobsApi.js.map +1 -1
- package/build/library/sdk/api/learnApi.d.ts +22 -6
- package/build/library/sdk/api/learnApi.js +1597 -1424
- package/build/library/sdk/api/learnApi.js.map +1 -1
- package/build/library/sdk/api/loginApi.d.ts +4 -6
- package/build/library/sdk/api/loginApi.js +112 -98
- package/build/library/sdk/api/loginApi.js.map +1 -1
- package/build/library/sdk/api/metricsApi.d.ts +4 -6
- package/build/library/sdk/api/metricsApi.js +148 -144
- package/build/library/sdk/api/metricsApi.js.map +1 -1
- package/build/library/sdk/api/optimizationApi.d.ts +4 -6
- package/build/library/sdk/api/optimizationApi.js +844 -844
- package/build/library/sdk/api/optimizationApi.js.map +1 -1
- package/build/library/sdk/api/organizationBlocksApi.d.ts +4 -6
- package/build/library/sdk/api/organizationBlocksApi.js +1968 -1550
- package/build/library/sdk/api/organizationBlocksApi.js.map +1 -1
- package/build/library/sdk/api/organizationCreateProjectApi.d.ts +4 -6
- package/build/library/sdk/api/organizationCreateProjectApi.js +700 -652
- package/build/library/sdk/api/organizationCreateProjectApi.js.map +1 -1
- package/build/library/sdk/api/organizationDataApi.d.ts +4 -6
- package/build/library/sdk/api/organizationDataApi.js +2074 -1985
- package/build/library/sdk/api/organizationDataApi.js.map +1 -1
- package/build/library/sdk/api/organizationDataCampaignsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationDataCampaignsApi.js +626 -602
- package/build/library/sdk/api/organizationDataCampaignsApi.js.map +1 -1
- package/build/library/sdk/api/organizationJobsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationJobsApi.js +417 -399
- package/build/library/sdk/api/organizationJobsApi.js.map +1 -1
- package/build/library/sdk/api/organizationPipelinesApi.d.ts +4 -6
- package/build/library/sdk/api/organizationPipelinesApi.js +419 -401
- package/build/library/sdk/api/organizationPipelinesApi.js.map +1 -1
- package/build/library/sdk/api/organizationPortalsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationPortalsApi.js +372 -352
- package/build/library/sdk/api/organizationPortalsApi.js.map +1 -1
- package/build/library/sdk/api/organizationsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationsApi.js +4024 -4050
- package/build/library/sdk/api/organizationsApi.js.map +1 -1
- package/build/library/sdk/api/performanceCalibrationApi.d.ts +4 -6
- package/build/library/sdk/api/performanceCalibrationApi.js +586 -560
- package/build/library/sdk/api/performanceCalibrationApi.js.map +1 -1
- package/build/library/sdk/api/postProcessingApi.d.ts +4 -6
- package/build/library/sdk/api/postProcessingApi.js +279 -255
- package/build/library/sdk/api/postProcessingApi.js.map +1 -1
- package/build/library/sdk/api/projectsApi.d.ts +4 -6
- package/build/library/sdk/api/projectsApi.js +2758 -2818
- package/build/library/sdk/api/projectsApi.js.map +1 -1
- package/build/library/sdk/api/rawDataApi.d.ts +4 -6
- package/build/library/sdk/api/rawDataApi.js +3055 -3131
- package/build/library/sdk/api/rawDataApi.js.map +1 -1
- package/build/library/sdk/api/testApi.d.ts +4 -6
- package/build/library/sdk/api/testApi.js +152 -108
- package/build/library/sdk/api/testApi.js.map +1 -1
- package/build/library/sdk/api/themesApi.d.ts +4 -6
- package/build/library/sdk/api/themesApi.js +341 -305
- package/build/library/sdk/api/themesApi.js.map +1 -1
- package/build/library/sdk/api/thirdPartyAuthApi.d.ts +4 -6
- package/build/library/sdk/api/thirdPartyAuthApi.js +387 -353
- package/build/library/sdk/api/thirdPartyAuthApi.js.map +1 -1
- package/build/library/sdk/api/uploadPortalApi.d.ts +4 -6
- package/build/library/sdk/api/uploadPortalApi.js +375 -355
- package/build/library/sdk/api/uploadPortalApi.js.map +1 -1
- package/build/library/sdk/api/userApi.d.ts +4 -6
- package/build/library/sdk/api/userApi.js +2345 -2452
- package/build/library/sdk/api/userApi.js.map +1 -1
- package/build/library/sdk/api/vlmApi.d.ts +4 -6
- package/build/library/sdk/api/vlmApi.js +277 -253
- package/build/library/sdk/api/vlmApi.js.map +1 -1
- package/build/library/sdk/api/whitelabelsApi.d.ts +4 -6
- package/build/library/sdk/api/whitelabelsApi.js +408 -398
- package/build/library/sdk/api/whitelabelsApi.js.map +1 -1
- package/build/library/sdk/model/deployPretrainedModelRequest.d.ts +4 -0
- package/build/library/sdk/model/deployPretrainedModelRequest.js +5 -0
- package/build/library/sdk/model/deployPretrainedModelRequest.js.map +1 -1
- package/build/library/sdk/model/models.d.ts +47 -7
- package/build/library/sdk/model/models.js +33 -22
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.d.ts +47 -0
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.js +55 -0
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.js.map +1 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.d.ts +4 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.js +5 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.js.map +1 -1
- package/package.json +3 -2
|
@@ -12,14 +12,31 @@
|
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.OptimizationApi = exports.OptimizationApiApiKeys = void 0;
|
|
15
|
-
// tslint:disable-next-line: variable-name, no-var-requires
|
|
16
15
|
const PATH = require('path');
|
|
17
|
-
// tslint:disable-next-line: no-unsafe-any
|
|
18
16
|
module.paths.push(PATH.join(process.cwd(), 'node_modules'));
|
|
19
|
-
|
|
17
|
+
let fetch;
|
|
18
|
+
let FormData;
|
|
19
|
+
if (globalThis.fetch && globalThis.FormData) {
|
|
20
|
+
fetch = globalThis.fetch;
|
|
21
|
+
FormData = globalThis.FormData;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const undici = require('undici');
|
|
25
|
+
fetch = undici.fetch;
|
|
26
|
+
FormData = undici.FormData;
|
|
27
|
+
}
|
|
20
28
|
const models_1 = require("../model/models");
|
|
21
29
|
const models_2 = require("../model/models");
|
|
22
30
|
let defaultBasePath = 'https://studio.edgeimpulse.com/v1';
|
|
31
|
+
async function parseResponse(res) {
|
|
32
|
+
const ct = (res.headers.get('content-type') || '').toLowerCase();
|
|
33
|
+
if (ct.includes('application/json'))
|
|
34
|
+
return res.json();
|
|
35
|
+
if (/^(image|video|audio)\/|application\/(octet-stream|zip|x-tar|cbor)/.test(ct)) {
|
|
36
|
+
return Buffer.from(await res.arrayBuffer());
|
|
37
|
+
}
|
|
38
|
+
return res.text();
|
|
39
|
+
}
|
|
23
40
|
// ===============================================
|
|
24
41
|
// This file is autogenerated - Please do not edit
|
|
25
42
|
// ===============================================
|
|
@@ -30,10 +47,30 @@ var OptimizationApiApiKeys;
|
|
|
30
47
|
OptimizationApiApiKeys[OptimizationApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(OptimizationApiApiKeys = exports.OptimizationApiApiKeys || (exports.OptimizationApiApiKeys = {}));
|
|
32
49
|
class OptimizationApi {
|
|
50
|
+
async handleResponse(response, returnType) {
|
|
51
|
+
let body = await parseResponse(response);
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
let errorMsg;
|
|
54
|
+
if (typeof body === 'object' && body !== null && 'error' in body) {
|
|
55
|
+
errorMsg = body.error;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
errorMsg = `Failed to call "${response.url}", returned ${response.status}: ` + (typeof body === 'string' ? body : JSON.stringify(body));
|
|
59
|
+
}
|
|
60
|
+
throw new Error(errorMsg);
|
|
61
|
+
}
|
|
62
|
+
if (returnType) {
|
|
63
|
+
body = models_1.ObjectSerializer.deserialize(body, returnType);
|
|
64
|
+
}
|
|
65
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
66
|
+
const errString = `Failed to call "${response.url}", returned ${response.status}: ` + body.error;
|
|
67
|
+
throw new Error(body.error || errString);
|
|
68
|
+
}
|
|
69
|
+
return body;
|
|
70
|
+
}
|
|
33
71
|
constructor(basePathOrUsername, opts, password, basePath) {
|
|
34
72
|
this._basePath = defaultBasePath;
|
|
35
73
|
this.defaultHeaders = {};
|
|
36
|
-
this._useQuerystring = false;
|
|
37
74
|
this._opts = {};
|
|
38
75
|
this.authentications = {
|
|
39
76
|
'default': new models_1.VoidAuth(),
|
|
@@ -54,9 +91,6 @@ class OptimizationApi {
|
|
|
54
91
|
}
|
|
55
92
|
this.opts = opts !== null && opts !== void 0 ? opts : {};
|
|
56
93
|
}
|
|
57
|
-
set useQuerystring(value) {
|
|
58
|
-
this._useQuerystring = value;
|
|
59
|
-
}
|
|
60
94
|
set basePath(basePath) {
|
|
61
95
|
this._basePath = basePath;
|
|
62
96
|
}
|
|
@@ -90,9 +124,11 @@ class OptimizationApi {
|
|
|
90
124
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
91
125
|
.replace('{' + 'jobId' + '}', encodeURIComponent(String(jobId)));
|
|
92
126
|
let localVarQueryParameters = {};
|
|
93
|
-
let localVarHeaderParams =
|
|
94
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
95
|
-
|
|
127
|
+
let localVarHeaderParams = {
|
|
128
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
129
|
+
'Content-Type': 'application/json',
|
|
130
|
+
...this.defaultHeaders,
|
|
131
|
+
};
|
|
96
132
|
const produces = ['application/json'];
|
|
97
133
|
// give precedence to 'application/json'
|
|
98
134
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -101,7 +137,7 @@ class OptimizationApi {
|
|
|
101
137
|
else {
|
|
102
138
|
localVarHeaderParams.Accept = produces.join(',');
|
|
103
139
|
}
|
|
104
|
-
let localVarFormParams
|
|
140
|
+
let localVarFormParams;
|
|
105
141
|
// verify required parameter 'projectId' is not null or undefined
|
|
106
142
|
if (projectId === null || projectId === undefined) {
|
|
107
143
|
throw new Error('Required parameter projectId was null or undefined when calling completeSearch.');
|
|
@@ -114,56 +150,52 @@ class OptimizationApi {
|
|
|
114
150
|
if (tunerCompleteSearch === null || tunerCompleteSearch === undefined) {
|
|
115
151
|
throw new Error('Required parameter tunerCompleteSearch was null or undefined when calling completeSearch.');
|
|
116
152
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
153
|
+
localVarHeaderParams = {
|
|
154
|
+
...localVarHeaderParams,
|
|
155
|
+
...options.headers,
|
|
156
|
+
...this.opts.extraHeaders,
|
|
157
|
+
};
|
|
158
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
159
|
+
.filter(([, value]) => value !== undefined)
|
|
160
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
161
|
+
.join('&');
|
|
162
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
120
163
|
let localVarRequestOptions = {
|
|
121
164
|
method: 'POST',
|
|
122
|
-
|
|
123
|
-
headers: localVarHeaderParams,
|
|
124
|
-
uri: localVarPath,
|
|
125
|
-
useQuerystring: this._useQuerystring,
|
|
126
|
-
agentOptions: { keepAlive: false },
|
|
127
|
-
json: true,
|
|
128
|
-
body: models_1.ObjectSerializer.serialize(tunerCompleteSearch, "TunerCompleteSearch")
|
|
165
|
+
headers: { ...localVarHeaderParams },
|
|
129
166
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
167
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(tunerCompleteSearch, "TunerCompleteSearch"));
|
|
168
|
+
let requestOptions = localVarRequestOptions;
|
|
169
|
+
let url = localVarUrl;
|
|
170
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
171
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
172
|
+
url = auth_ApiKeyAuthentication.url;
|
|
173
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
174
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
175
|
+
url = auth_JWTAuthentication.url;
|
|
176
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
177
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
178
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
179
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
180
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
181
|
+
url = auth_OAuth2.url;
|
|
182
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
183
|
+
requestOptions = authDefault.requestOptions;
|
|
184
|
+
url = authDefault.url;
|
|
185
|
+
if (localVarFormParams) {
|
|
186
|
+
delete requestOptions.headers['Content-Type'];
|
|
187
|
+
if (localVarFormParams instanceof FormData) {
|
|
188
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
189
|
+
requestOptions.body = localVarFormParams;
|
|
144
190
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
154
|
-
reject(new Error(body.error || errString));
|
|
155
|
-
}
|
|
156
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
-
resolve(body);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
161
|
-
reject(errString);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
191
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
192
|
+
// URL-encoded form
|
|
193
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
194
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const response = await fetch(url, requestOptions);
|
|
198
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
167
199
|
}
|
|
168
200
|
/**
|
|
169
201
|
* Create trial
|
|
@@ -177,9 +209,11 @@ class OptimizationApi {
|
|
|
177
209
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
178
210
|
.replace('{' + 'jobId' + '}', encodeURIComponent(String(jobId)));
|
|
179
211
|
let localVarQueryParameters = {};
|
|
180
|
-
let localVarHeaderParams =
|
|
181
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
182
|
-
|
|
212
|
+
let localVarHeaderParams = {
|
|
213
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
214
|
+
'Content-Type': 'application/json',
|
|
215
|
+
...this.defaultHeaders,
|
|
216
|
+
};
|
|
183
217
|
const produces = ['application/json'];
|
|
184
218
|
// give precedence to 'application/json'
|
|
185
219
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -188,7 +222,7 @@ class OptimizationApi {
|
|
|
188
222
|
else {
|
|
189
223
|
localVarHeaderParams.Accept = produces.join(',');
|
|
190
224
|
}
|
|
191
|
-
let localVarFormParams
|
|
225
|
+
let localVarFormParams;
|
|
192
226
|
// verify required parameter 'projectId' is not null or undefined
|
|
193
227
|
if (projectId === null || projectId === undefined) {
|
|
194
228
|
throw new Error('Required parameter projectId was null or undefined when calling createTrial.');
|
|
@@ -201,56 +235,52 @@ class OptimizationApi {
|
|
|
201
235
|
if (tunerCreateTrialImpulse === null || tunerCreateTrialImpulse === undefined) {
|
|
202
236
|
throw new Error('Required parameter tunerCreateTrialImpulse was null or undefined when calling createTrial.');
|
|
203
237
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
238
|
+
localVarHeaderParams = {
|
|
239
|
+
...localVarHeaderParams,
|
|
240
|
+
...options.headers,
|
|
241
|
+
...this.opts.extraHeaders,
|
|
242
|
+
};
|
|
243
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
244
|
+
.filter(([, value]) => value !== undefined)
|
|
245
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
246
|
+
.join('&');
|
|
247
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
207
248
|
let localVarRequestOptions = {
|
|
208
249
|
method: 'POST',
|
|
209
|
-
|
|
210
|
-
headers: localVarHeaderParams,
|
|
211
|
-
uri: localVarPath,
|
|
212
|
-
useQuerystring: this._useQuerystring,
|
|
213
|
-
agentOptions: { keepAlive: false },
|
|
214
|
-
json: true,
|
|
215
|
-
body: models_1.ObjectSerializer.serialize(tunerCreateTrialImpulse, "TunerCreateTrialImpulse")
|
|
250
|
+
headers: { ...localVarHeaderParams },
|
|
216
251
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
252
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(tunerCreateTrialImpulse, "TunerCreateTrialImpulse"));
|
|
253
|
+
let requestOptions = localVarRequestOptions;
|
|
254
|
+
let url = localVarUrl;
|
|
255
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
256
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
257
|
+
url = auth_ApiKeyAuthentication.url;
|
|
258
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
259
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
260
|
+
url = auth_JWTAuthentication.url;
|
|
261
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
262
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
263
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
264
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
265
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
266
|
+
url = auth_OAuth2.url;
|
|
267
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
268
|
+
requestOptions = authDefault.requestOptions;
|
|
269
|
+
url = authDefault.url;
|
|
270
|
+
if (localVarFormParams) {
|
|
271
|
+
delete requestOptions.headers['Content-Type'];
|
|
272
|
+
if (localVarFormParams instanceof FormData) {
|
|
273
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
274
|
+
requestOptions.body = localVarFormParams;
|
|
275
|
+
}
|
|
276
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
277
|
+
// URL-encoded form
|
|
278
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
279
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
231
280
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
reject(error);
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
239
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
240
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
241
|
-
reject(new Error(body.error || errString));
|
|
242
|
-
}
|
|
243
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
244
|
-
resolve(body);
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
248
|
-
reject(errString);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
});
|
|
281
|
+
}
|
|
282
|
+
const response = await fetch(url, requestOptions);
|
|
283
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
254
284
|
}
|
|
255
285
|
/**
|
|
256
286
|
* Completely clears the EON tuner state for this project.
|
|
@@ -261,9 +291,11 @@ class OptimizationApi {
|
|
|
261
291
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/state'
|
|
262
292
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
263
293
|
let localVarQueryParameters = {};
|
|
264
|
-
let localVarHeaderParams =
|
|
265
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
266
|
-
|
|
294
|
+
let localVarHeaderParams = {
|
|
295
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
296
|
+
'Content-Type': 'application/json',
|
|
297
|
+
...this.defaultHeaders,
|
|
298
|
+
};
|
|
267
299
|
const produces = ['application/json'];
|
|
268
300
|
// give precedence to 'application/json'
|
|
269
301
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -272,60 +304,56 @@ class OptimizationApi {
|
|
|
272
304
|
else {
|
|
273
305
|
localVarHeaderParams.Accept = produces.join(',');
|
|
274
306
|
}
|
|
275
|
-
let localVarFormParams
|
|
307
|
+
let localVarFormParams;
|
|
276
308
|
// verify required parameter 'projectId' is not null or undefined
|
|
277
309
|
if (projectId === null || projectId === undefined) {
|
|
278
310
|
throw new Error('Required parameter projectId was null or undefined when calling deleteState.');
|
|
279
311
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
312
|
+
localVarHeaderParams = {
|
|
313
|
+
...localVarHeaderParams,
|
|
314
|
+
...options.headers,
|
|
315
|
+
...this.opts.extraHeaders,
|
|
316
|
+
};
|
|
317
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
318
|
+
.filter(([, value]) => value !== undefined)
|
|
319
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
320
|
+
.join('&');
|
|
321
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
283
322
|
let localVarRequestOptions = {
|
|
284
323
|
method: 'DELETE',
|
|
285
|
-
|
|
286
|
-
headers: localVarHeaderParams,
|
|
287
|
-
uri: localVarPath,
|
|
288
|
-
useQuerystring: this._useQuerystring,
|
|
289
|
-
agentOptions: { keepAlive: false },
|
|
290
|
-
json: true,
|
|
324
|
+
headers: { ...localVarHeaderParams },
|
|
291
325
|
};
|
|
292
|
-
let
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
326
|
+
let requestOptions = localVarRequestOptions;
|
|
327
|
+
let url = localVarUrl;
|
|
328
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
329
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
330
|
+
url = auth_ApiKeyAuthentication.url;
|
|
331
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
332
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
333
|
+
url = auth_JWTAuthentication.url;
|
|
334
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
335
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
336
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
337
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
338
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
339
|
+
url = auth_OAuth2.url;
|
|
340
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
341
|
+
requestOptions = authDefault.requestOptions;
|
|
342
|
+
url = authDefault.url;
|
|
343
|
+
if (localVarFormParams) {
|
|
344
|
+
delete requestOptions.headers['Content-Type'];
|
|
345
|
+
if (localVarFormParams instanceof FormData) {
|
|
346
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
347
|
+
requestOptions.body = localVarFormParams;
|
|
348
|
+
}
|
|
349
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
350
|
+
// URL-encoded form
|
|
351
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
352
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
306
353
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
reject(error);
|
|
311
|
-
}
|
|
312
|
-
else {
|
|
313
|
-
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
314
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
315
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
316
|
-
reject(new Error(body.error || errString));
|
|
317
|
-
}
|
|
318
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
319
|
-
resolve(body);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
323
|
-
reject(errString);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
});
|
|
354
|
+
}
|
|
355
|
+
const response = await fetch(url, requestOptions);
|
|
356
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
329
357
|
}
|
|
330
358
|
/**
|
|
331
359
|
* End an EON trial early. This can for example be used to implement early stopping.
|
|
@@ -340,9 +368,11 @@ class OptimizationApi {
|
|
|
340
368
|
.replace('{' + 'jobId' + '}', encodeURIComponent(String(jobId)))
|
|
341
369
|
.replace('{' + 'trialId' + '}', encodeURIComponent(String(trialId)));
|
|
342
370
|
let localVarQueryParameters = {};
|
|
343
|
-
let localVarHeaderParams =
|
|
344
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
345
|
-
|
|
371
|
+
let localVarHeaderParams = {
|
|
372
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
373
|
+
'Content-Type': 'application/json',
|
|
374
|
+
...this.defaultHeaders,
|
|
375
|
+
};
|
|
346
376
|
const produces = ['application/json'];
|
|
347
377
|
// give precedence to 'application/json'
|
|
348
378
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -351,7 +381,7 @@ class OptimizationApi {
|
|
|
351
381
|
else {
|
|
352
382
|
localVarHeaderParams.Accept = produces.join(',');
|
|
353
383
|
}
|
|
354
|
-
let localVarFormParams
|
|
384
|
+
let localVarFormParams;
|
|
355
385
|
// verify required parameter 'projectId' is not null or undefined
|
|
356
386
|
if (projectId === null || projectId === undefined) {
|
|
357
387
|
throw new Error('Required parameter projectId was null or undefined when calling endTrial.');
|
|
@@ -364,55 +394,51 @@ class OptimizationApi {
|
|
|
364
394
|
if (trialId === null || trialId === undefined) {
|
|
365
395
|
throw new Error('Required parameter trialId was null or undefined when calling endTrial.');
|
|
366
396
|
}
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
397
|
+
localVarHeaderParams = {
|
|
398
|
+
...localVarHeaderParams,
|
|
399
|
+
...options.headers,
|
|
400
|
+
...this.opts.extraHeaders,
|
|
401
|
+
};
|
|
402
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
403
|
+
.filter(([, value]) => value !== undefined)
|
|
404
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
405
|
+
.join('&');
|
|
406
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
370
407
|
let localVarRequestOptions = {
|
|
371
408
|
method: 'GET',
|
|
372
|
-
|
|
373
|
-
headers: localVarHeaderParams,
|
|
374
|
-
uri: localVarPath,
|
|
375
|
-
useQuerystring: this._useQuerystring,
|
|
376
|
-
agentOptions: { keepAlive: false },
|
|
377
|
-
json: true,
|
|
409
|
+
headers: { ...localVarHeaderParams },
|
|
378
410
|
};
|
|
379
|
-
let
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
411
|
+
let requestOptions = localVarRequestOptions;
|
|
412
|
+
let url = localVarUrl;
|
|
413
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
414
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
415
|
+
url = auth_ApiKeyAuthentication.url;
|
|
416
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
417
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
418
|
+
url = auth_JWTAuthentication.url;
|
|
419
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
420
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
421
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
422
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
423
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
424
|
+
url = auth_OAuth2.url;
|
|
425
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
426
|
+
requestOptions = authDefault.requestOptions;
|
|
427
|
+
url = authDefault.url;
|
|
428
|
+
if (localVarFormParams) {
|
|
429
|
+
delete requestOptions.headers['Content-Type'];
|
|
430
|
+
if (localVarFormParams instanceof FormData) {
|
|
431
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
432
|
+
requestOptions.body = localVarFormParams;
|
|
393
433
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
403
|
-
reject(new Error(body.error || errString));
|
|
404
|
-
}
|
|
405
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
406
|
-
resolve(body);
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
410
|
-
reject(errString);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
});
|
|
415
|
-
});
|
|
434
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
435
|
+
// URL-encoded form
|
|
436
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
437
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const response = await fetch(url, requestOptions);
|
|
441
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
416
442
|
}
|
|
417
443
|
/**
|
|
418
444
|
* Lists all possible blocks that can be used in the impulse, including any additional information required by the EON tuner that the getImpulseBlocks endpoint does not return
|
|
@@ -423,9 +449,11 @@ class OptimizationApi {
|
|
|
423
449
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/all-blocks'
|
|
424
450
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
425
451
|
let localVarQueryParameters = {};
|
|
426
|
-
let localVarHeaderParams =
|
|
427
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
428
|
-
|
|
452
|
+
let localVarHeaderParams = {
|
|
453
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
454
|
+
'Content-Type': 'application/json',
|
|
455
|
+
...this.defaultHeaders,
|
|
456
|
+
};
|
|
429
457
|
const produces = ['application/json'];
|
|
430
458
|
// give precedence to 'application/json'
|
|
431
459
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -434,60 +462,56 @@ class OptimizationApi {
|
|
|
434
462
|
else {
|
|
435
463
|
localVarHeaderParams.Accept = produces.join(',');
|
|
436
464
|
}
|
|
437
|
-
let localVarFormParams
|
|
465
|
+
let localVarFormParams;
|
|
438
466
|
// verify required parameter 'projectId' is not null or undefined
|
|
439
467
|
if (projectId === null || projectId === undefined) {
|
|
440
468
|
throw new Error('Required parameter projectId was null or undefined when calling getAllBlocks.');
|
|
441
469
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
470
|
+
localVarHeaderParams = {
|
|
471
|
+
...localVarHeaderParams,
|
|
472
|
+
...options.headers,
|
|
473
|
+
...this.opts.extraHeaders,
|
|
474
|
+
};
|
|
475
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
476
|
+
.filter(([, value]) => value !== undefined)
|
|
477
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
478
|
+
.join('&');
|
|
479
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
445
480
|
let localVarRequestOptions = {
|
|
446
481
|
method: 'GET',
|
|
447
|
-
|
|
448
|
-
headers: localVarHeaderParams,
|
|
449
|
-
uri: localVarPath,
|
|
450
|
-
useQuerystring: this._useQuerystring,
|
|
451
|
-
agentOptions: { keepAlive: false },
|
|
452
|
-
json: true,
|
|
482
|
+
headers: { ...localVarHeaderParams },
|
|
453
483
|
};
|
|
454
|
-
let
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
484
|
+
let requestOptions = localVarRequestOptions;
|
|
485
|
+
let url = localVarUrl;
|
|
486
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
487
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
488
|
+
url = auth_ApiKeyAuthentication.url;
|
|
489
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
490
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
491
|
+
url = auth_JWTAuthentication.url;
|
|
492
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
493
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
494
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
495
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
496
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
497
|
+
url = auth_OAuth2.url;
|
|
498
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
499
|
+
requestOptions = authDefault.requestOptions;
|
|
500
|
+
url = authDefault.url;
|
|
501
|
+
if (localVarFormParams) {
|
|
502
|
+
delete requestOptions.headers['Content-Type'];
|
|
503
|
+
if (localVarFormParams instanceof FormData) {
|
|
504
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
505
|
+
requestOptions.body = localVarFormParams;
|
|
506
|
+
}
|
|
507
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
508
|
+
// URL-encoded form
|
|
509
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
510
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
468
511
|
}
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
reject(error);
|
|
473
|
-
}
|
|
474
|
-
else {
|
|
475
|
-
body = models_1.ObjectSerializer.deserialize(body, "AllBlocksResponse");
|
|
476
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
477
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
478
|
-
reject(new Error(body.error || errString));
|
|
479
|
-
}
|
|
480
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
481
|
-
resolve(body);
|
|
482
|
-
}
|
|
483
|
-
else {
|
|
484
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
485
|
-
reject(errString);
|
|
486
|
-
}
|
|
487
|
-
}
|
|
488
|
-
});
|
|
489
|
-
});
|
|
490
|
-
});
|
|
512
|
+
}
|
|
513
|
+
const response = await fetch(url, requestOptions);
|
|
514
|
+
return this.handleResponse(response, 'AllBlocksResponse');
|
|
491
515
|
}
|
|
492
516
|
/**
|
|
493
517
|
* Get all available learn blocks
|
|
@@ -498,9 +522,11 @@ class OptimizationApi {
|
|
|
498
522
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/all-learn-blocks'
|
|
499
523
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
500
524
|
let localVarQueryParameters = {};
|
|
501
|
-
let localVarHeaderParams =
|
|
502
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
503
|
-
|
|
525
|
+
let localVarHeaderParams = {
|
|
526
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
527
|
+
'Content-Type': 'application/json',
|
|
528
|
+
...this.defaultHeaders,
|
|
529
|
+
};
|
|
504
530
|
const produces = ['application/json'];
|
|
505
531
|
// give precedence to 'application/json'
|
|
506
532
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -509,60 +535,56 @@ class OptimizationApi {
|
|
|
509
535
|
else {
|
|
510
536
|
localVarHeaderParams.Accept = produces.join(',');
|
|
511
537
|
}
|
|
512
|
-
let localVarFormParams
|
|
538
|
+
let localVarFormParams;
|
|
513
539
|
// verify required parameter 'projectId' is not null or undefined
|
|
514
540
|
if (projectId === null || projectId === undefined) {
|
|
515
541
|
throw new Error('Required parameter projectId was null or undefined when calling getAllLearnBlocks.');
|
|
516
542
|
}
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
543
|
+
localVarHeaderParams = {
|
|
544
|
+
...localVarHeaderParams,
|
|
545
|
+
...options.headers,
|
|
546
|
+
...this.opts.extraHeaders,
|
|
547
|
+
};
|
|
548
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
549
|
+
.filter(([, value]) => value !== undefined)
|
|
550
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
551
|
+
.join('&');
|
|
552
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
520
553
|
let localVarRequestOptions = {
|
|
521
554
|
method: 'GET',
|
|
522
|
-
|
|
523
|
-
headers: localVarHeaderParams,
|
|
524
|
-
uri: localVarPath,
|
|
525
|
-
useQuerystring: this._useQuerystring,
|
|
526
|
-
agentOptions: { keepAlive: false },
|
|
527
|
-
json: true,
|
|
555
|
+
headers: { ...localVarHeaderParams },
|
|
528
556
|
};
|
|
529
|
-
let
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
557
|
+
let requestOptions = localVarRequestOptions;
|
|
558
|
+
let url = localVarUrl;
|
|
559
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
560
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
561
|
+
url = auth_ApiKeyAuthentication.url;
|
|
562
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
563
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
564
|
+
url = auth_JWTAuthentication.url;
|
|
565
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
566
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
567
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
568
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
569
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
570
|
+
url = auth_OAuth2.url;
|
|
571
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
572
|
+
requestOptions = authDefault.requestOptions;
|
|
573
|
+
url = authDefault.url;
|
|
574
|
+
if (localVarFormParams) {
|
|
575
|
+
delete requestOptions.headers['Content-Type'];
|
|
576
|
+
if (localVarFormParams instanceof FormData) {
|
|
577
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
578
|
+
requestOptions.body = localVarFormParams;
|
|
543
579
|
}
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
553
|
-
reject(new Error(body.error || errString));
|
|
554
|
-
}
|
|
555
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
556
|
-
resolve(body);
|
|
557
|
-
}
|
|
558
|
-
else {
|
|
559
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
560
|
-
reject(errString);
|
|
561
|
-
}
|
|
562
|
-
}
|
|
563
|
-
});
|
|
564
|
-
});
|
|
565
|
-
});
|
|
580
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
581
|
+
// URL-encoded form
|
|
582
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
583
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
const response = await fetch(url, requestOptions);
|
|
587
|
+
return this.handleResponse(response, 'AllLearnBlocksResponse');
|
|
566
588
|
}
|
|
567
589
|
/**
|
|
568
590
|
* Get config
|
|
@@ -573,9 +595,11 @@ class OptimizationApi {
|
|
|
573
595
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/config'
|
|
574
596
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
575
597
|
let localVarQueryParameters = {};
|
|
576
|
-
let localVarHeaderParams =
|
|
577
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
578
|
-
|
|
598
|
+
let localVarHeaderParams = {
|
|
599
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
600
|
+
'Content-Type': 'application/json',
|
|
601
|
+
...this.defaultHeaders,
|
|
602
|
+
};
|
|
579
603
|
const produces = ['application/json'];
|
|
580
604
|
// give precedence to 'application/json'
|
|
581
605
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -584,60 +608,56 @@ class OptimizationApi {
|
|
|
584
608
|
else {
|
|
585
609
|
localVarHeaderParams.Accept = produces.join(',');
|
|
586
610
|
}
|
|
587
|
-
let localVarFormParams
|
|
611
|
+
let localVarFormParams;
|
|
588
612
|
// verify required parameter 'projectId' is not null or undefined
|
|
589
613
|
if (projectId === null || projectId === undefined) {
|
|
590
614
|
throw new Error('Required parameter projectId was null or undefined when calling getConfig.');
|
|
591
615
|
}
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
616
|
+
localVarHeaderParams = {
|
|
617
|
+
...localVarHeaderParams,
|
|
618
|
+
...options.headers,
|
|
619
|
+
...this.opts.extraHeaders,
|
|
620
|
+
};
|
|
621
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
622
|
+
.filter(([, value]) => value !== undefined)
|
|
623
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
624
|
+
.join('&');
|
|
625
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
595
626
|
let localVarRequestOptions = {
|
|
596
627
|
method: 'GET',
|
|
597
|
-
|
|
598
|
-
headers: localVarHeaderParams,
|
|
599
|
-
uri: localVarPath,
|
|
600
|
-
useQuerystring: this._useQuerystring,
|
|
601
|
-
agentOptions: { keepAlive: false },
|
|
602
|
-
json: true,
|
|
628
|
+
headers: { ...localVarHeaderParams },
|
|
603
629
|
};
|
|
604
|
-
let
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
630
|
+
let requestOptions = localVarRequestOptions;
|
|
631
|
+
let url = localVarUrl;
|
|
632
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
633
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
634
|
+
url = auth_ApiKeyAuthentication.url;
|
|
635
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
636
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
637
|
+
url = auth_JWTAuthentication.url;
|
|
638
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
639
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
640
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
641
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
642
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
643
|
+
url = auth_OAuth2.url;
|
|
644
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
645
|
+
requestOptions = authDefault.requestOptions;
|
|
646
|
+
url = authDefault.url;
|
|
647
|
+
if (localVarFormParams) {
|
|
648
|
+
delete requestOptions.headers['Content-Type'];
|
|
649
|
+
if (localVarFormParams instanceof FormData) {
|
|
650
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
651
|
+
requestOptions.body = localVarFormParams;
|
|
652
|
+
}
|
|
653
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
654
|
+
// URL-encoded form
|
|
655
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
656
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
618
657
|
}
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
reject(error);
|
|
623
|
-
}
|
|
624
|
-
else {
|
|
625
|
-
body = models_1.ObjectSerializer.deserialize(body, "OptimizeConfigResponse");
|
|
626
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
627
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
628
|
-
reject(new Error(body.error || errString));
|
|
629
|
-
}
|
|
630
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
631
|
-
resolve(body);
|
|
632
|
-
}
|
|
633
|
-
else {
|
|
634
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
635
|
-
reject(errString);
|
|
636
|
-
}
|
|
637
|
-
}
|
|
638
|
-
});
|
|
639
|
-
});
|
|
640
|
-
});
|
|
658
|
+
}
|
|
659
|
+
const response = await fetch(url, requestOptions);
|
|
660
|
+
return this.handleResponse(response, 'OptimizeConfigResponse');
|
|
641
661
|
}
|
|
642
662
|
/**
|
|
643
663
|
* Retrieves DSP block parameters
|
|
@@ -650,9 +670,11 @@ class OptimizationApi {
|
|
|
650
670
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/dsp-parameters'
|
|
651
671
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
652
672
|
let localVarQueryParameters = {};
|
|
653
|
-
let localVarHeaderParams =
|
|
654
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
655
|
-
|
|
673
|
+
let localVarHeaderParams = {
|
|
674
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
675
|
+
'Content-Type': 'application/json',
|
|
676
|
+
...this.defaultHeaders,
|
|
677
|
+
};
|
|
656
678
|
const produces = ['application/json'];
|
|
657
679
|
// give precedence to 'application/json'
|
|
658
680
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -661,7 +683,7 @@ class OptimizationApi {
|
|
|
661
683
|
else {
|
|
662
684
|
localVarHeaderParams.Accept = produces.join(',');
|
|
663
685
|
}
|
|
664
|
-
let localVarFormParams
|
|
686
|
+
let localVarFormParams;
|
|
665
687
|
// verify required parameter 'projectId' is not null or undefined
|
|
666
688
|
if (projectId === null || projectId === undefined) {
|
|
667
689
|
throw new Error('Required parameter projectId was null or undefined when calling getDspParameters.');
|
|
@@ -680,55 +702,51 @@ class OptimizationApi {
|
|
|
680
702
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.organizationDspId) !== undefined) {
|
|
681
703
|
localVarQueryParameters['organizationDspId'] = models_1.ObjectSerializer.serialize(queryParams.organizationDspId, "number");
|
|
682
704
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
705
|
+
localVarHeaderParams = {
|
|
706
|
+
...localVarHeaderParams,
|
|
707
|
+
...options.headers,
|
|
708
|
+
...this.opts.extraHeaders,
|
|
709
|
+
};
|
|
710
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
711
|
+
.filter(([, value]) => value !== undefined)
|
|
712
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
713
|
+
.join('&');
|
|
714
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
686
715
|
let localVarRequestOptions = {
|
|
687
716
|
method: 'GET',
|
|
688
|
-
|
|
689
|
-
headers: localVarHeaderParams,
|
|
690
|
-
uri: localVarPath,
|
|
691
|
-
useQuerystring: this._useQuerystring,
|
|
692
|
-
agentOptions: { keepAlive: false },
|
|
693
|
-
json: true,
|
|
717
|
+
headers: { ...localVarHeaderParams },
|
|
694
718
|
};
|
|
695
|
-
let
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
719
|
+
let requestOptions = localVarRequestOptions;
|
|
720
|
+
let url = localVarUrl;
|
|
721
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
722
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
723
|
+
url = auth_ApiKeyAuthentication.url;
|
|
724
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
725
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
726
|
+
url = auth_JWTAuthentication.url;
|
|
727
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
728
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
729
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
730
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
731
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
732
|
+
url = auth_OAuth2.url;
|
|
733
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
734
|
+
requestOptions = authDefault.requestOptions;
|
|
735
|
+
url = authDefault.url;
|
|
736
|
+
if (localVarFormParams) {
|
|
737
|
+
delete requestOptions.headers['Content-Type'];
|
|
738
|
+
if (localVarFormParams instanceof FormData) {
|
|
739
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
740
|
+
requestOptions.body = localVarFormParams;
|
|
741
|
+
}
|
|
742
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
743
|
+
// URL-encoded form
|
|
744
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
745
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
709
746
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
reject(error);
|
|
714
|
-
}
|
|
715
|
-
else {
|
|
716
|
-
body = models_1.ObjectSerializer.deserialize(body, "OptimizeDSPParametersResponse");
|
|
717
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
718
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
719
|
-
reject(new Error(body.error || errString));
|
|
720
|
-
}
|
|
721
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
722
|
-
resolve(body);
|
|
723
|
-
}
|
|
724
|
-
else {
|
|
725
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
726
|
-
reject(errString);
|
|
727
|
-
}
|
|
728
|
-
}
|
|
729
|
-
});
|
|
730
|
-
});
|
|
731
|
-
});
|
|
747
|
+
}
|
|
748
|
+
const response = await fetch(url, requestOptions);
|
|
749
|
+
return this.handleResponse(response, 'OptimizeDSPParametersResponse');
|
|
732
750
|
}
|
|
733
751
|
/**
|
|
734
752
|
* Search space
|
|
@@ -739,9 +757,11 @@ class OptimizationApi {
|
|
|
739
757
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/space'
|
|
740
758
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
741
759
|
let localVarQueryParameters = {};
|
|
742
|
-
let localVarHeaderParams =
|
|
743
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
744
|
-
|
|
760
|
+
let localVarHeaderParams = {
|
|
761
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
762
|
+
'Content-Type': 'application/json',
|
|
763
|
+
...this.defaultHeaders,
|
|
764
|
+
};
|
|
745
765
|
const produces = ['application/json'];
|
|
746
766
|
// give precedence to 'application/json'
|
|
747
767
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -750,60 +770,56 @@ class OptimizationApi {
|
|
|
750
770
|
else {
|
|
751
771
|
localVarHeaderParams.Accept = produces.join(',');
|
|
752
772
|
}
|
|
753
|
-
let localVarFormParams
|
|
773
|
+
let localVarFormParams;
|
|
754
774
|
// verify required parameter 'projectId' is not null or undefined
|
|
755
775
|
if (projectId === null || projectId === undefined) {
|
|
756
776
|
throw new Error('Required parameter projectId was null or undefined when calling getSpace.');
|
|
757
777
|
}
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
778
|
+
localVarHeaderParams = {
|
|
779
|
+
...localVarHeaderParams,
|
|
780
|
+
...options.headers,
|
|
781
|
+
...this.opts.extraHeaders,
|
|
782
|
+
};
|
|
783
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
784
|
+
.filter(([, value]) => value !== undefined)
|
|
785
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
786
|
+
.join('&');
|
|
787
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
761
788
|
let localVarRequestOptions = {
|
|
762
789
|
method: 'GET',
|
|
763
|
-
|
|
764
|
-
headers: localVarHeaderParams,
|
|
765
|
-
uri: localVarPath,
|
|
766
|
-
useQuerystring: this._useQuerystring,
|
|
767
|
-
agentOptions: { keepAlive: false },
|
|
768
|
-
json: true,
|
|
790
|
+
headers: { ...localVarHeaderParams },
|
|
769
791
|
};
|
|
770
|
-
let
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
792
|
+
let requestOptions = localVarRequestOptions;
|
|
793
|
+
let url = localVarUrl;
|
|
794
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
795
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
796
|
+
url = auth_ApiKeyAuthentication.url;
|
|
797
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
798
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
799
|
+
url = auth_JWTAuthentication.url;
|
|
800
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
801
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
802
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
803
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
804
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
805
|
+
url = auth_OAuth2.url;
|
|
806
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
807
|
+
requestOptions = authDefault.requestOptions;
|
|
808
|
+
url = authDefault.url;
|
|
809
|
+
if (localVarFormParams) {
|
|
810
|
+
delete requestOptions.headers['Content-Type'];
|
|
811
|
+
if (localVarFormParams instanceof FormData) {
|
|
812
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
813
|
+
requestOptions.body = localVarFormParams;
|
|
784
814
|
}
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
794
|
-
reject(new Error(body.error || errString));
|
|
795
|
-
}
|
|
796
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
797
|
-
resolve(body);
|
|
798
|
-
}
|
|
799
|
-
else {
|
|
800
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
801
|
-
reject(errString);
|
|
802
|
-
}
|
|
803
|
-
}
|
|
804
|
-
});
|
|
805
|
-
});
|
|
806
|
-
});
|
|
815
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
816
|
+
// URL-encoded form
|
|
817
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
818
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
819
|
+
}
|
|
820
|
+
}
|
|
821
|
+
const response = await fetch(url, requestOptions);
|
|
822
|
+
return this.handleResponse(response, 'OptimizeSpaceResponse');
|
|
807
823
|
}
|
|
808
824
|
/**
|
|
809
825
|
* Retrieves the EON tuner state
|
|
@@ -814,9 +830,11 @@ class OptimizationApi {
|
|
|
814
830
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/state'
|
|
815
831
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
816
832
|
let localVarQueryParameters = {};
|
|
817
|
-
let localVarHeaderParams =
|
|
818
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
819
|
-
|
|
833
|
+
let localVarHeaderParams = {
|
|
834
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
835
|
+
'Content-Type': 'application/json',
|
|
836
|
+
...this.defaultHeaders,
|
|
837
|
+
};
|
|
820
838
|
const produces = ['application/json'];
|
|
821
839
|
// give precedence to 'application/json'
|
|
822
840
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -825,60 +843,56 @@ class OptimizationApi {
|
|
|
825
843
|
else {
|
|
826
844
|
localVarHeaderParams.Accept = produces.join(',');
|
|
827
845
|
}
|
|
828
|
-
let localVarFormParams
|
|
846
|
+
let localVarFormParams;
|
|
829
847
|
// verify required parameter 'projectId' is not null or undefined
|
|
830
848
|
if (projectId === null || projectId === undefined) {
|
|
831
849
|
throw new Error('Required parameter projectId was null or undefined when calling getState.');
|
|
832
850
|
}
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
851
|
+
localVarHeaderParams = {
|
|
852
|
+
...localVarHeaderParams,
|
|
853
|
+
...options.headers,
|
|
854
|
+
...this.opts.extraHeaders,
|
|
855
|
+
};
|
|
856
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
857
|
+
.filter(([, value]) => value !== undefined)
|
|
858
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
859
|
+
.join('&');
|
|
860
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
836
861
|
let localVarRequestOptions = {
|
|
837
862
|
method: 'GET',
|
|
838
|
-
|
|
839
|
-
headers: localVarHeaderParams,
|
|
840
|
-
uri: localVarPath,
|
|
841
|
-
useQuerystring: this._useQuerystring,
|
|
842
|
-
agentOptions: { keepAlive: false },
|
|
843
|
-
json: true,
|
|
863
|
+
headers: { ...localVarHeaderParams },
|
|
844
864
|
};
|
|
845
|
-
let
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
865
|
+
let requestOptions = localVarRequestOptions;
|
|
866
|
+
let url = localVarUrl;
|
|
867
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
868
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
869
|
+
url = auth_ApiKeyAuthentication.url;
|
|
870
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
871
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
872
|
+
url = auth_JWTAuthentication.url;
|
|
873
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
874
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
875
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
876
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
877
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
878
|
+
url = auth_OAuth2.url;
|
|
879
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
880
|
+
requestOptions = authDefault.requestOptions;
|
|
881
|
+
url = authDefault.url;
|
|
882
|
+
if (localVarFormParams) {
|
|
883
|
+
delete requestOptions.headers['Content-Type'];
|
|
884
|
+
if (localVarFormParams instanceof FormData) {
|
|
885
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
886
|
+
requestOptions.body = localVarFormParams;
|
|
887
|
+
}
|
|
888
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
889
|
+
// URL-encoded form
|
|
890
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
891
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
859
892
|
}
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
reject(error);
|
|
864
|
-
}
|
|
865
|
-
else {
|
|
866
|
-
body = models_1.ObjectSerializer.deserialize(body, "OptimizeStateResponse");
|
|
867
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
868
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
869
|
-
reject(new Error(body.error || errString));
|
|
870
|
-
}
|
|
871
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
872
|
-
resolve(body);
|
|
873
|
-
}
|
|
874
|
-
else {
|
|
875
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
876
|
-
reject(errString);
|
|
877
|
-
}
|
|
878
|
-
}
|
|
879
|
-
});
|
|
880
|
-
});
|
|
881
|
-
});
|
|
893
|
+
}
|
|
894
|
+
const response = await fetch(url, requestOptions);
|
|
895
|
+
return this.handleResponse(response, 'OptimizeStateResponse');
|
|
882
896
|
}
|
|
883
897
|
/**
|
|
884
898
|
* Retrieves available transfer learning models
|
|
@@ -889,9 +903,11 @@ class OptimizationApi {
|
|
|
889
903
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/transfer-learning-models'
|
|
890
904
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
891
905
|
let localVarQueryParameters = {};
|
|
892
|
-
let localVarHeaderParams =
|
|
893
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
894
|
-
|
|
906
|
+
let localVarHeaderParams = {
|
|
907
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
908
|
+
'Content-Type': 'application/json',
|
|
909
|
+
...this.defaultHeaders,
|
|
910
|
+
};
|
|
895
911
|
const produces = ['application/json'];
|
|
896
912
|
// give precedence to 'application/json'
|
|
897
913
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -900,60 +916,56 @@ class OptimizationApi {
|
|
|
900
916
|
else {
|
|
901
917
|
localVarHeaderParams.Accept = produces.join(',');
|
|
902
918
|
}
|
|
903
|
-
let localVarFormParams
|
|
919
|
+
let localVarFormParams;
|
|
904
920
|
// verify required parameter 'projectId' is not null or undefined
|
|
905
921
|
if (projectId === null || projectId === undefined) {
|
|
906
922
|
throw new Error('Required parameter projectId was null or undefined when calling getTransferLearningModels.');
|
|
907
923
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
924
|
+
localVarHeaderParams = {
|
|
925
|
+
...localVarHeaderParams,
|
|
926
|
+
...options.headers,
|
|
927
|
+
...this.opts.extraHeaders,
|
|
928
|
+
};
|
|
929
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
930
|
+
.filter(([, value]) => value !== undefined)
|
|
931
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
932
|
+
.join('&');
|
|
933
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
911
934
|
let localVarRequestOptions = {
|
|
912
935
|
method: 'GET',
|
|
913
|
-
|
|
914
|
-
headers: localVarHeaderParams,
|
|
915
|
-
uri: localVarPath,
|
|
916
|
-
useQuerystring: this._useQuerystring,
|
|
917
|
-
agentOptions: { keepAlive: false },
|
|
918
|
-
json: true,
|
|
936
|
+
headers: { ...localVarHeaderParams },
|
|
919
937
|
};
|
|
920
|
-
let
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
938
|
+
let requestOptions = localVarRequestOptions;
|
|
939
|
+
let url = localVarUrl;
|
|
940
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
941
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
942
|
+
url = auth_ApiKeyAuthentication.url;
|
|
943
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
944
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
945
|
+
url = auth_JWTAuthentication.url;
|
|
946
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
947
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
948
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
949
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
950
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
951
|
+
url = auth_OAuth2.url;
|
|
952
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
953
|
+
requestOptions = authDefault.requestOptions;
|
|
954
|
+
url = authDefault.url;
|
|
955
|
+
if (localVarFormParams) {
|
|
956
|
+
delete requestOptions.headers['Content-Type'];
|
|
957
|
+
if (localVarFormParams instanceof FormData) {
|
|
958
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
959
|
+
requestOptions.body = localVarFormParams;
|
|
934
960
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
944
|
-
reject(new Error(body.error || errString));
|
|
945
|
-
}
|
|
946
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
947
|
-
resolve(body);
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
951
|
-
reject(errString);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
});
|
|
956
|
-
});
|
|
961
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
962
|
+
// URL-encoded form
|
|
963
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
964
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const response = await fetch(url, requestOptions);
|
|
968
|
+
return this.handleResponse(response, 'OptimizeTransferLearningModelsResponse');
|
|
957
969
|
}
|
|
958
970
|
/**
|
|
959
971
|
* Get the logs for a trial.
|
|
@@ -966,9 +978,11 @@ class OptimizationApi {
|
|
|
966
978
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
967
979
|
.replace('{' + 'trialId' + '}', encodeURIComponent(String(trialId)));
|
|
968
980
|
let localVarQueryParameters = {};
|
|
969
|
-
let localVarHeaderParams =
|
|
970
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
971
|
-
|
|
981
|
+
let localVarHeaderParams = {
|
|
982
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
983
|
+
'Content-Type': 'application/json',
|
|
984
|
+
...this.defaultHeaders,
|
|
985
|
+
};
|
|
972
986
|
const produces = ['application/json'];
|
|
973
987
|
// give precedence to 'application/json'
|
|
974
988
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -977,7 +991,7 @@ class OptimizationApi {
|
|
|
977
991
|
else {
|
|
978
992
|
localVarHeaderParams.Accept = produces.join(',');
|
|
979
993
|
}
|
|
980
|
-
let localVarFormParams
|
|
994
|
+
let localVarFormParams;
|
|
981
995
|
// verify required parameter 'projectId' is not null or undefined
|
|
982
996
|
if (projectId === null || projectId === undefined) {
|
|
983
997
|
throw new Error('Required parameter projectId was null or undefined when calling getTrialLogs.');
|
|
@@ -986,55 +1000,51 @@ class OptimizationApi {
|
|
|
986
1000
|
if (trialId === null || trialId === undefined) {
|
|
987
1001
|
throw new Error('Required parameter trialId was null or undefined when calling getTrialLogs.');
|
|
988
1002
|
}
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
1003
|
+
localVarHeaderParams = {
|
|
1004
|
+
...localVarHeaderParams,
|
|
1005
|
+
...options.headers,
|
|
1006
|
+
...this.opts.extraHeaders,
|
|
1007
|
+
};
|
|
1008
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1009
|
+
.filter(([, value]) => value !== undefined)
|
|
1010
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1011
|
+
.join('&');
|
|
1012
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
992
1013
|
let localVarRequestOptions = {
|
|
993
1014
|
method: 'GET',
|
|
994
|
-
|
|
995
|
-
headers: localVarHeaderParams,
|
|
996
|
-
uri: localVarPath,
|
|
997
|
-
useQuerystring: this._useQuerystring,
|
|
998
|
-
agentOptions: { keepAlive: false },
|
|
999
|
-
json: true,
|
|
1015
|
+
headers: { ...localVarHeaderParams },
|
|
1000
1016
|
};
|
|
1001
|
-
let
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1017
|
+
let requestOptions = localVarRequestOptions;
|
|
1018
|
+
let url = localVarUrl;
|
|
1019
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1020
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1021
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1022
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1023
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1024
|
+
url = auth_JWTAuthentication.url;
|
|
1025
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1026
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1027
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1028
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1029
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1030
|
+
url = auth_OAuth2.url;
|
|
1031
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1032
|
+
requestOptions = authDefault.requestOptions;
|
|
1033
|
+
url = authDefault.url;
|
|
1034
|
+
if (localVarFormParams) {
|
|
1035
|
+
delete requestOptions.headers['Content-Type'];
|
|
1036
|
+
if (localVarFormParams instanceof FormData) {
|
|
1037
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1038
|
+
requestOptions.body = localVarFormParams;
|
|
1039
|
+
}
|
|
1040
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1041
|
+
// URL-encoded form
|
|
1042
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1043
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1015
1044
|
}
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
reject(error);
|
|
1020
|
-
}
|
|
1021
|
-
else {
|
|
1022
|
-
body = models_1.ObjectSerializer.deserialize(body, "LogStdoutResponse");
|
|
1023
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1024
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1025
|
-
reject(new Error(body.error || errString));
|
|
1026
|
-
}
|
|
1027
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1028
|
-
resolve(body);
|
|
1029
|
-
}
|
|
1030
|
-
else {
|
|
1031
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1032
|
-
reject(errString);
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1037
|
-
});
|
|
1045
|
+
}
|
|
1046
|
+
const response = await fetch(url, requestOptions);
|
|
1047
|
+
return this.handleResponse(response, 'LogStdoutResponse');
|
|
1038
1048
|
}
|
|
1039
1049
|
/**
|
|
1040
1050
|
* Retrieves the EON tuner state for a specific run.
|
|
@@ -1047,9 +1057,11 @@ class OptimizationApi {
|
|
|
1047
1057
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1048
1058
|
.replace('{' + 'tunerCoordinatorJobId' + '}', encodeURIComponent(String(tunerCoordinatorJobId)));
|
|
1049
1059
|
let localVarQueryParameters = {};
|
|
1050
|
-
let localVarHeaderParams =
|
|
1051
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1052
|
-
|
|
1060
|
+
let localVarHeaderParams = {
|
|
1061
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1062
|
+
'Content-Type': 'application/json',
|
|
1063
|
+
...this.defaultHeaders,
|
|
1064
|
+
};
|
|
1053
1065
|
const produces = ['application/json'];
|
|
1054
1066
|
// give precedence to 'application/json'
|
|
1055
1067
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1058,7 +1070,7 @@ class OptimizationApi {
|
|
|
1058
1070
|
else {
|
|
1059
1071
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1060
1072
|
}
|
|
1061
|
-
let localVarFormParams
|
|
1073
|
+
let localVarFormParams;
|
|
1062
1074
|
// verify required parameter 'projectId' is not null or undefined
|
|
1063
1075
|
if (projectId === null || projectId === undefined) {
|
|
1064
1076
|
throw new Error('Required parameter projectId was null or undefined when calling getTunerRunState.');
|
|
@@ -1067,55 +1079,51 @@ class OptimizationApi {
|
|
|
1067
1079
|
if (tunerCoordinatorJobId === null || tunerCoordinatorJobId === undefined) {
|
|
1068
1080
|
throw new Error('Required parameter tunerCoordinatorJobId was null or undefined when calling getTunerRunState.');
|
|
1069
1081
|
}
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1082
|
+
localVarHeaderParams = {
|
|
1083
|
+
...localVarHeaderParams,
|
|
1084
|
+
...options.headers,
|
|
1085
|
+
...this.opts.extraHeaders,
|
|
1086
|
+
};
|
|
1087
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1088
|
+
.filter(([, value]) => value !== undefined)
|
|
1089
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1090
|
+
.join('&');
|
|
1091
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1073
1092
|
let localVarRequestOptions = {
|
|
1074
1093
|
method: 'GET',
|
|
1075
|
-
|
|
1076
|
-
headers: localVarHeaderParams,
|
|
1077
|
-
uri: localVarPath,
|
|
1078
|
-
useQuerystring: this._useQuerystring,
|
|
1079
|
-
agentOptions: { keepAlive: false },
|
|
1080
|
-
json: true,
|
|
1094
|
+
headers: { ...localVarHeaderParams },
|
|
1081
1095
|
};
|
|
1082
|
-
let
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
+
let requestOptions = localVarRequestOptions;
|
|
1097
|
+
let url = localVarUrl;
|
|
1098
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1099
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1100
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1101
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1102
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1103
|
+
url = auth_JWTAuthentication.url;
|
|
1104
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1105
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1106
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1107
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1108
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1109
|
+
url = auth_OAuth2.url;
|
|
1110
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1111
|
+
requestOptions = authDefault.requestOptions;
|
|
1112
|
+
url = authDefault.url;
|
|
1113
|
+
if (localVarFormParams) {
|
|
1114
|
+
delete requestOptions.headers['Content-Type'];
|
|
1115
|
+
if (localVarFormParams instanceof FormData) {
|
|
1116
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1117
|
+
requestOptions.body = localVarFormParams;
|
|
1118
|
+
}
|
|
1119
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1120
|
+
// URL-encoded form
|
|
1121
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1122
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1096
1123
|
}
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
reject(error);
|
|
1101
|
-
}
|
|
1102
|
-
else {
|
|
1103
|
-
body = models_1.ObjectSerializer.deserialize(body, "OptimizeStateResponse");
|
|
1104
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1105
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1106
|
-
reject(new Error(body.error || errString));
|
|
1107
|
-
}
|
|
1108
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1109
|
-
resolve(body);
|
|
1110
|
-
}
|
|
1111
|
-
else {
|
|
1112
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1113
|
-
reject(errString);
|
|
1114
|
-
}
|
|
1115
|
-
}
|
|
1116
|
-
});
|
|
1117
|
-
});
|
|
1118
|
-
});
|
|
1124
|
+
}
|
|
1125
|
+
const response = await fetch(url, requestOptions);
|
|
1126
|
+
return this.handleResponse(response, 'OptimizeStateResponse');
|
|
1119
1127
|
}
|
|
1120
1128
|
/**
|
|
1121
1129
|
* Get window settings
|
|
@@ -1126,9 +1134,11 @@ class OptimizationApi {
|
|
|
1126
1134
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/window-settings'
|
|
1127
1135
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1128
1136
|
let localVarQueryParameters = {};
|
|
1129
|
-
let localVarHeaderParams =
|
|
1130
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1131
|
-
|
|
1137
|
+
let localVarHeaderParams = {
|
|
1138
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1139
|
+
'Content-Type': 'application/json',
|
|
1140
|
+
...this.defaultHeaders,
|
|
1141
|
+
};
|
|
1132
1142
|
const produces = ['application/json'];
|
|
1133
1143
|
// give precedence to 'application/json'
|
|
1134
1144
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1137,60 +1147,56 @@ class OptimizationApi {
|
|
|
1137
1147
|
else {
|
|
1138
1148
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1139
1149
|
}
|
|
1140
|
-
let localVarFormParams
|
|
1150
|
+
let localVarFormParams;
|
|
1141
1151
|
// verify required parameter 'projectId' is not null or undefined
|
|
1142
1152
|
if (projectId === null || projectId === undefined) {
|
|
1143
1153
|
throw new Error('Required parameter projectId was null or undefined when calling getWindowSettings.');
|
|
1144
1154
|
}
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1155
|
+
localVarHeaderParams = {
|
|
1156
|
+
...localVarHeaderParams,
|
|
1157
|
+
...options.headers,
|
|
1158
|
+
...this.opts.extraHeaders,
|
|
1159
|
+
};
|
|
1160
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1161
|
+
.filter(([, value]) => value !== undefined)
|
|
1162
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1163
|
+
.join('&');
|
|
1164
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1148
1165
|
let localVarRequestOptions = {
|
|
1149
1166
|
method: 'GET',
|
|
1150
|
-
|
|
1151
|
-
headers: localVarHeaderParams,
|
|
1152
|
-
uri: localVarPath,
|
|
1153
|
-
useQuerystring: this._useQuerystring,
|
|
1154
|
-
agentOptions: { keepAlive: false },
|
|
1155
|
-
json: true,
|
|
1167
|
+
headers: { ...localVarHeaderParams },
|
|
1156
1168
|
};
|
|
1157
|
-
let
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1169
|
+
let requestOptions = localVarRequestOptions;
|
|
1170
|
+
let url = localVarUrl;
|
|
1171
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1172
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1173
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1174
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1175
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1176
|
+
url = auth_JWTAuthentication.url;
|
|
1177
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1178
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1179
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1180
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1181
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1182
|
+
url = auth_OAuth2.url;
|
|
1183
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1184
|
+
requestOptions = authDefault.requestOptions;
|
|
1185
|
+
url = authDefault.url;
|
|
1186
|
+
if (localVarFormParams) {
|
|
1187
|
+
delete requestOptions.headers['Content-Type'];
|
|
1188
|
+
if (localVarFormParams instanceof FormData) {
|
|
1189
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1190
|
+
requestOptions.body = localVarFormParams;
|
|
1171
1191
|
}
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1181
|
-
reject(new Error(body.error || errString));
|
|
1182
|
-
}
|
|
1183
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1184
|
-
resolve(body);
|
|
1185
|
-
}
|
|
1186
|
-
else {
|
|
1187
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1188
|
-
reject(errString);
|
|
1189
|
-
}
|
|
1190
|
-
}
|
|
1191
|
-
});
|
|
1192
|
-
});
|
|
1193
|
-
});
|
|
1192
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1193
|
+
// URL-encoded form
|
|
1194
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1195
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
const response = await fetch(url, requestOptions);
|
|
1199
|
+
return this.handleResponse(response, 'WindowSettingsResponse');
|
|
1194
1200
|
}
|
|
1195
1201
|
/**
|
|
1196
1202
|
* List all the tuner runs for a project.
|
|
@@ -1201,9 +1207,11 @@ class OptimizationApi {
|
|
|
1201
1207
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/runs'
|
|
1202
1208
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1203
1209
|
let localVarQueryParameters = {};
|
|
1204
|
-
let localVarHeaderParams =
|
|
1205
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1206
|
-
|
|
1210
|
+
let localVarHeaderParams = {
|
|
1211
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1212
|
+
'Content-Type': 'application/json',
|
|
1213
|
+
...this.defaultHeaders,
|
|
1214
|
+
};
|
|
1207
1215
|
const produces = ['application/json'];
|
|
1208
1216
|
// give precedence to 'application/json'
|
|
1209
1217
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1212,60 +1220,56 @@ class OptimizationApi {
|
|
|
1212
1220
|
else {
|
|
1213
1221
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1214
1222
|
}
|
|
1215
|
-
let localVarFormParams
|
|
1223
|
+
let localVarFormParams;
|
|
1216
1224
|
// verify required parameter 'projectId' is not null or undefined
|
|
1217
1225
|
if (projectId === null || projectId === undefined) {
|
|
1218
1226
|
throw new Error('Required parameter projectId was null or undefined when calling listTunerRuns.');
|
|
1219
1227
|
}
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1228
|
+
localVarHeaderParams = {
|
|
1229
|
+
...localVarHeaderParams,
|
|
1230
|
+
...options.headers,
|
|
1231
|
+
...this.opts.extraHeaders,
|
|
1232
|
+
};
|
|
1233
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1234
|
+
.filter(([, value]) => value !== undefined)
|
|
1235
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1236
|
+
.join('&');
|
|
1237
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1223
1238
|
let localVarRequestOptions = {
|
|
1224
1239
|
method: 'GET',
|
|
1225
|
-
|
|
1226
|
-
headers: localVarHeaderParams,
|
|
1227
|
-
uri: localVarPath,
|
|
1228
|
-
useQuerystring: this._useQuerystring,
|
|
1229
|
-
agentOptions: { keepAlive: false },
|
|
1230
|
-
json: true,
|
|
1240
|
+
headers: { ...localVarHeaderParams },
|
|
1231
1241
|
};
|
|
1232
|
-
let
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1236
|
-
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1242
|
+
let requestOptions = localVarRequestOptions;
|
|
1243
|
+
let url = localVarUrl;
|
|
1244
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1245
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1246
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1247
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1248
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1249
|
+
url = auth_JWTAuthentication.url;
|
|
1250
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1251
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1252
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1253
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1254
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1255
|
+
url = auth_OAuth2.url;
|
|
1256
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1257
|
+
requestOptions = authDefault.requestOptions;
|
|
1258
|
+
url = authDefault.url;
|
|
1259
|
+
if (localVarFormParams) {
|
|
1260
|
+
delete requestOptions.headers['Content-Type'];
|
|
1261
|
+
if (localVarFormParams instanceof FormData) {
|
|
1262
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1263
|
+
requestOptions.body = localVarFormParams;
|
|
1264
|
+
}
|
|
1265
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1266
|
+
// URL-encoded form
|
|
1267
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1268
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1246
1269
|
}
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
reject(error);
|
|
1251
|
-
}
|
|
1252
|
-
else {
|
|
1253
|
-
body = models_1.ObjectSerializer.deserialize(body, "ListTunerRunsResponse");
|
|
1254
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1255
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1256
|
-
reject(new Error(body.error || errString));
|
|
1257
|
-
}
|
|
1258
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1259
|
-
resolve(body);
|
|
1260
|
-
}
|
|
1261
|
-
else {
|
|
1262
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1263
|
-
reject(errString);
|
|
1264
|
-
}
|
|
1265
|
-
}
|
|
1266
|
-
});
|
|
1267
|
-
});
|
|
1268
|
-
});
|
|
1270
|
+
}
|
|
1271
|
+
const response = await fetch(url, requestOptions);
|
|
1272
|
+
return this.handleResponse(response, 'ListTunerRunsResponse');
|
|
1269
1273
|
}
|
|
1270
1274
|
/**
|
|
1271
1275
|
* Update config
|
|
@@ -1277,9 +1281,11 @@ class OptimizationApi {
|
|
|
1277
1281
|
const localVarPath = this.basePath + '/api/{projectId}/optimize/config'
|
|
1278
1282
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1279
1283
|
let localVarQueryParameters = {};
|
|
1280
|
-
let localVarHeaderParams =
|
|
1281
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1282
|
-
|
|
1284
|
+
let localVarHeaderParams = {
|
|
1285
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1286
|
+
'Content-Type': 'application/json',
|
|
1287
|
+
...this.defaultHeaders,
|
|
1288
|
+
};
|
|
1283
1289
|
const produces = ['application/json'];
|
|
1284
1290
|
// give precedence to 'application/json'
|
|
1285
1291
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1288,7 +1294,7 @@ class OptimizationApi {
|
|
|
1288
1294
|
else {
|
|
1289
1295
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1290
1296
|
}
|
|
1291
|
-
let localVarFormParams
|
|
1297
|
+
let localVarFormParams;
|
|
1292
1298
|
// verify required parameter 'projectId' is not null or undefined
|
|
1293
1299
|
if (projectId === null || projectId === undefined) {
|
|
1294
1300
|
throw new Error('Required parameter projectId was null or undefined when calling updateConfig.');
|
|
@@ -1297,56 +1303,52 @@ class OptimizationApi {
|
|
|
1297
1303
|
if (optimizeConfig === null || optimizeConfig === undefined) {
|
|
1298
1304
|
throw new Error('Required parameter optimizeConfig was null or undefined when calling updateConfig.');
|
|
1299
1305
|
}
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1306
|
+
localVarHeaderParams = {
|
|
1307
|
+
...localVarHeaderParams,
|
|
1308
|
+
...options.headers,
|
|
1309
|
+
...this.opts.extraHeaders,
|
|
1310
|
+
};
|
|
1311
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1312
|
+
.filter(([, value]) => value !== undefined)
|
|
1313
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1314
|
+
.join('&');
|
|
1315
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1303
1316
|
let localVarRequestOptions = {
|
|
1304
1317
|
method: 'POST',
|
|
1305
|
-
|
|
1306
|
-
headers: localVarHeaderParams,
|
|
1307
|
-
uri: localVarPath,
|
|
1308
|
-
useQuerystring: this._useQuerystring,
|
|
1309
|
-
agentOptions: { keepAlive: false },
|
|
1310
|
-
json: true,
|
|
1311
|
-
body: models_1.ObjectSerializer.serialize(optimizeConfig, "OptimizeConfig")
|
|
1318
|
+
headers: { ...localVarHeaderParams },
|
|
1312
1319
|
};
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
|
|
1320
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(optimizeConfig, "OptimizeConfig"));
|
|
1321
|
+
let requestOptions = localVarRequestOptions;
|
|
1322
|
+
let url = localVarUrl;
|
|
1323
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1324
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1325
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1326
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1327
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1328
|
+
url = auth_JWTAuthentication.url;
|
|
1329
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1330
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1331
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1332
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1333
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1334
|
+
url = auth_OAuth2.url;
|
|
1335
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1336
|
+
requestOptions = authDefault.requestOptions;
|
|
1337
|
+
url = authDefault.url;
|
|
1338
|
+
if (localVarFormParams) {
|
|
1339
|
+
delete requestOptions.headers['Content-Type'];
|
|
1340
|
+
if (localVarFormParams instanceof FormData) {
|
|
1341
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1342
|
+
requestOptions.body = localVarFormParams;
|
|
1327
1343
|
}
|
|
1328
|
-
|
|
1329
|
-
|
|
1330
|
-
|
|
1331
|
-
|
|
1332
|
-
|
|
1333
|
-
|
|
1334
|
-
|
|
1335
|
-
|
|
1336
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1337
|
-
reject(new Error(body.error || errString));
|
|
1338
|
-
}
|
|
1339
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1340
|
-
resolve(body);
|
|
1341
|
-
}
|
|
1342
|
-
else {
|
|
1343
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1344
|
-
reject(errString);
|
|
1345
|
-
}
|
|
1346
|
-
}
|
|
1347
|
-
});
|
|
1348
|
-
});
|
|
1349
|
-
});
|
|
1344
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1345
|
+
// URL-encoded form
|
|
1346
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1347
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1348
|
+
}
|
|
1349
|
+
}
|
|
1350
|
+
const response = await fetch(url, requestOptions);
|
|
1351
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1350
1352
|
}
|
|
1351
1353
|
/**
|
|
1352
1354
|
* Updates the EON tuner state for a specific run.
|
|
@@ -1360,9 +1362,11 @@ class OptimizationApi {
|
|
|
1360
1362
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1361
1363
|
.replace('{' + 'tunerCoordinatorJobId' + '}', encodeURIComponent(String(tunerCoordinatorJobId)));
|
|
1362
1364
|
let localVarQueryParameters = {};
|
|
1363
|
-
let localVarHeaderParams =
|
|
1364
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1365
|
-
|
|
1365
|
+
let localVarHeaderParams = {
|
|
1366
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1367
|
+
'Content-Type': 'application/json',
|
|
1368
|
+
...this.defaultHeaders,
|
|
1369
|
+
};
|
|
1366
1370
|
const produces = ['application/json'];
|
|
1367
1371
|
// give precedence to 'application/json'
|
|
1368
1372
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1371,7 +1375,7 @@ class OptimizationApi {
|
|
|
1371
1375
|
else {
|
|
1372
1376
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1373
1377
|
}
|
|
1374
|
-
let localVarFormParams
|
|
1378
|
+
let localVarFormParams;
|
|
1375
1379
|
// verify required parameter 'projectId' is not null or undefined
|
|
1376
1380
|
if (projectId === null || projectId === undefined) {
|
|
1377
1381
|
throw new Error('Required parameter projectId was null or undefined when calling updateTunerRun.');
|
|
@@ -1384,56 +1388,52 @@ class OptimizationApi {
|
|
|
1384
1388
|
if (updateTunerRunRequest === null || updateTunerRunRequest === undefined) {
|
|
1385
1389
|
throw new Error('Required parameter updateTunerRunRequest was null or undefined when calling updateTunerRun.');
|
|
1386
1390
|
}
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1391
|
+
localVarHeaderParams = {
|
|
1392
|
+
...localVarHeaderParams,
|
|
1393
|
+
...options.headers,
|
|
1394
|
+
...this.opts.extraHeaders,
|
|
1395
|
+
};
|
|
1396
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1397
|
+
.filter(([, value]) => value !== undefined)
|
|
1398
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1399
|
+
.join('&');
|
|
1400
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1390
1401
|
let localVarRequestOptions = {
|
|
1391
1402
|
method: 'POST',
|
|
1392
|
-
|
|
1393
|
-
headers: localVarHeaderParams,
|
|
1394
|
-
uri: localVarPath,
|
|
1395
|
-
useQuerystring: this._useQuerystring,
|
|
1396
|
-
agentOptions: { keepAlive: false },
|
|
1397
|
-
json: true,
|
|
1398
|
-
body: models_1.ObjectSerializer.serialize(updateTunerRunRequest, "UpdateTunerRunRequest")
|
|
1403
|
+
headers: { ...localVarHeaderParams },
|
|
1399
1404
|
};
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1405
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateTunerRunRequest, "UpdateTunerRunRequest"));
|
|
1406
|
+
let requestOptions = localVarRequestOptions;
|
|
1407
|
+
let url = localVarUrl;
|
|
1408
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1409
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1410
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1411
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1412
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1413
|
+
url = auth_JWTAuthentication.url;
|
|
1414
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1415
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1416
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1417
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1418
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1419
|
+
url = auth_OAuth2.url;
|
|
1420
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1421
|
+
requestOptions = authDefault.requestOptions;
|
|
1422
|
+
url = authDefault.url;
|
|
1423
|
+
if (localVarFormParams) {
|
|
1424
|
+
delete requestOptions.headers['Content-Type'];
|
|
1425
|
+
if (localVarFormParams instanceof FormData) {
|
|
1426
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1427
|
+
requestOptions.body = localVarFormParams;
|
|
1414
1428
|
}
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
|
|
1423
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1424
|
-
reject(new Error(body.error || errString));
|
|
1425
|
-
}
|
|
1426
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1427
|
-
resolve(body);
|
|
1428
|
-
}
|
|
1429
|
-
else {
|
|
1430
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1431
|
-
reject(errString);
|
|
1432
|
-
}
|
|
1433
|
-
}
|
|
1434
|
-
});
|
|
1435
|
-
});
|
|
1436
|
-
});
|
|
1429
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1430
|
+
// URL-encoded form
|
|
1431
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1432
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1433
|
+
}
|
|
1434
|
+
}
|
|
1435
|
+
const response = await fetch(url, requestOptions);
|
|
1436
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1437
1437
|
}
|
|
1438
1438
|
}
|
|
1439
1439
|
exports.OptimizationApi = OptimizationApi;
|