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.PerformanceCalibrationApi = exports.PerformanceCalibrationApiApiKeys = 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 PerformanceCalibrationApiApiKeys;
|
|
|
30
47
|
PerformanceCalibrationApiApiKeys[PerformanceCalibrationApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(PerformanceCalibrationApiApiKeys = exports.PerformanceCalibrationApiApiKeys || (exports.PerformanceCalibrationApiApiKeys = {}));
|
|
32
49
|
class PerformanceCalibrationApi {
|
|
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 PerformanceCalibrationApi {
|
|
|
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
|
}
|
|
@@ -88,9 +122,11 @@ class PerformanceCalibrationApi {
|
|
|
88
122
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/clear'
|
|
89
123
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
90
124
|
let localVarQueryParameters = {};
|
|
91
|
-
let localVarHeaderParams =
|
|
92
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
93
|
-
|
|
125
|
+
let localVarHeaderParams = {
|
|
126
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
127
|
+
'Content-Type': 'application/json',
|
|
128
|
+
...this.defaultHeaders,
|
|
129
|
+
};
|
|
94
130
|
const produces = ['application/json'];
|
|
95
131
|
// give precedence to 'application/json'
|
|
96
132
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -99,7 +135,7 @@ class PerformanceCalibrationApi {
|
|
|
99
135
|
else {
|
|
100
136
|
localVarHeaderParams.Accept = produces.join(',');
|
|
101
137
|
}
|
|
102
|
-
let localVarFormParams
|
|
138
|
+
let localVarFormParams;
|
|
103
139
|
// verify required parameter 'projectId' is not null or undefined
|
|
104
140
|
if (projectId === null || projectId === undefined) {
|
|
105
141
|
throw new Error('Required parameter projectId was null or undefined when calling clearPerformanceCalibrationState.');
|
|
@@ -107,55 +143,51 @@ class PerformanceCalibrationApi {
|
|
|
107
143
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
108
144
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
109
145
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
146
|
+
localVarHeaderParams = {
|
|
147
|
+
...localVarHeaderParams,
|
|
148
|
+
...options.headers,
|
|
149
|
+
...this.opts.extraHeaders,
|
|
150
|
+
};
|
|
151
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
152
|
+
.filter(([, value]) => value !== undefined)
|
|
153
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
154
|
+
.join('&');
|
|
155
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
113
156
|
let localVarRequestOptions = {
|
|
114
157
|
method: 'POST',
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
158
|
+
headers: { ...localVarHeaderParams },
|
|
159
|
+
};
|
|
160
|
+
let requestOptions = localVarRequestOptions;
|
|
161
|
+
let url = localVarUrl;
|
|
162
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
163
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
164
|
+
url = auth_ApiKeyAuthentication.url;
|
|
165
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
166
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
167
|
+
url = auth_JWTAuthentication.url;
|
|
168
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
169
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
170
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
171
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
172
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
173
|
+
url = auth_OAuth2.url;
|
|
174
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
175
|
+
requestOptions = authDefault.requestOptions;
|
|
176
|
+
url = authDefault.url;
|
|
177
|
+
if (localVarFormParams) {
|
|
178
|
+
delete requestOptions.headers['Content-Type'];
|
|
179
|
+
if (localVarFormParams instanceof FormData) {
|
|
180
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
181
|
+
requestOptions.body = localVarFormParams;
|
|
136
182
|
}
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
146
|
-
reject(new Error(body.error || errString));
|
|
147
|
-
}
|
|
148
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
149
|
-
resolve(body);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
153
|
-
reject(errString);
|
|
154
|
-
}
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
});
|
|
183
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
184
|
+
// URL-encoded form
|
|
185
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
186
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const response = await fetch(url, requestOptions);
|
|
190
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
159
191
|
}
|
|
160
192
|
/**
|
|
161
193
|
* Clears the current performance calibration parameters
|
|
@@ -167,9 +199,11 @@ class PerformanceCalibrationApi {
|
|
|
167
199
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameters'
|
|
168
200
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
169
201
|
let localVarQueryParameters = {};
|
|
170
|
-
let localVarHeaderParams =
|
|
171
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
172
|
-
|
|
202
|
+
let localVarHeaderParams = {
|
|
203
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
204
|
+
'Content-Type': 'application/json',
|
|
205
|
+
...this.defaultHeaders,
|
|
206
|
+
};
|
|
173
207
|
const produces = ['application/json'];
|
|
174
208
|
// give precedence to 'application/json'
|
|
175
209
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -178,7 +212,7 @@ class PerformanceCalibrationApi {
|
|
|
178
212
|
else {
|
|
179
213
|
localVarHeaderParams.Accept = produces.join(',');
|
|
180
214
|
}
|
|
181
|
-
let localVarFormParams
|
|
215
|
+
let localVarFormParams;
|
|
182
216
|
// verify required parameter 'projectId' is not null or undefined
|
|
183
217
|
if (projectId === null || projectId === undefined) {
|
|
184
218
|
throw new Error('Required parameter projectId was null or undefined when calling deletePerformanceCalibrationSavedParameters.');
|
|
@@ -186,55 +220,51 @@ class PerformanceCalibrationApi {
|
|
|
186
220
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
187
221
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
188
222
|
}
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
223
|
+
localVarHeaderParams = {
|
|
224
|
+
...localVarHeaderParams,
|
|
225
|
+
...options.headers,
|
|
226
|
+
...this.opts.extraHeaders,
|
|
227
|
+
};
|
|
228
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
229
|
+
.filter(([, value]) => value !== undefined)
|
|
230
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
231
|
+
.join('&');
|
|
232
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
192
233
|
let localVarRequestOptions = {
|
|
193
234
|
method: 'DELETE',
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
235
|
+
headers: { ...localVarHeaderParams },
|
|
236
|
+
};
|
|
237
|
+
let requestOptions = localVarRequestOptions;
|
|
238
|
+
let url = localVarUrl;
|
|
239
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
240
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
241
|
+
url = auth_ApiKeyAuthentication.url;
|
|
242
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
243
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
244
|
+
url = auth_JWTAuthentication.url;
|
|
245
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
246
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
247
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
248
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
249
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
250
|
+
url = auth_OAuth2.url;
|
|
251
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
252
|
+
requestOptions = authDefault.requestOptions;
|
|
253
|
+
url = authDefault.url;
|
|
254
|
+
if (localVarFormParams) {
|
|
255
|
+
delete requestOptions.headers['Content-Type'];
|
|
256
|
+
if (localVarFormParams instanceof FormData) {
|
|
257
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
258
|
+
requestOptions.body = localVarFormParams;
|
|
215
259
|
}
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
225
|
-
reject(new Error(body.error || errString));
|
|
226
|
-
}
|
|
227
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
228
|
-
resolve(body);
|
|
229
|
-
}
|
|
230
|
-
else {
|
|
231
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
232
|
-
reject(errString);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
235
|
-
});
|
|
236
|
-
});
|
|
237
|
-
});
|
|
260
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
261
|
+
// URL-encoded form
|
|
262
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
263
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
const response = await fetch(url, requestOptions);
|
|
267
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
238
268
|
}
|
|
239
269
|
/**
|
|
240
270
|
* Get performance calibration ground truth data
|
|
@@ -246,9 +276,11 @@ class PerformanceCalibrationApi {
|
|
|
246
276
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/ground-truth'
|
|
247
277
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
248
278
|
let localVarQueryParameters = {};
|
|
249
|
-
let localVarHeaderParams =
|
|
250
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
251
|
-
|
|
279
|
+
let localVarHeaderParams = {
|
|
280
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
281
|
+
'Content-Type': 'application/json',
|
|
282
|
+
...this.defaultHeaders,
|
|
283
|
+
};
|
|
252
284
|
const produces = ['application/json'];
|
|
253
285
|
// give precedence to 'application/json'
|
|
254
286
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -257,7 +289,7 @@ class PerformanceCalibrationApi {
|
|
|
257
289
|
else {
|
|
258
290
|
localVarHeaderParams.Accept = produces.join(',');
|
|
259
291
|
}
|
|
260
|
-
let localVarFormParams
|
|
292
|
+
let localVarFormParams;
|
|
261
293
|
// verify required parameter 'projectId' is not null or undefined
|
|
262
294
|
if (projectId === null || projectId === undefined) {
|
|
263
295
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationGroundTruth.');
|
|
@@ -265,55 +297,51 @@ class PerformanceCalibrationApi {
|
|
|
265
297
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
266
298
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
267
299
|
}
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
300
|
+
localVarHeaderParams = {
|
|
301
|
+
...localVarHeaderParams,
|
|
302
|
+
...options.headers,
|
|
303
|
+
...this.opts.extraHeaders,
|
|
304
|
+
};
|
|
305
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
306
|
+
.filter(([, value]) => value !== undefined)
|
|
307
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
308
|
+
.join('&');
|
|
309
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
271
310
|
let localVarRequestOptions = {
|
|
272
311
|
method: 'GET',
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
312
|
+
headers: { ...localVarHeaderParams },
|
|
313
|
+
};
|
|
314
|
+
let requestOptions = localVarRequestOptions;
|
|
315
|
+
let url = localVarUrl;
|
|
316
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
317
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
318
|
+
url = auth_ApiKeyAuthentication.url;
|
|
319
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
320
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
321
|
+
url = auth_JWTAuthentication.url;
|
|
322
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
323
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
324
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
325
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
326
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
327
|
+
url = auth_OAuth2.url;
|
|
328
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
329
|
+
requestOptions = authDefault.requestOptions;
|
|
330
|
+
url = authDefault.url;
|
|
331
|
+
if (localVarFormParams) {
|
|
332
|
+
delete requestOptions.headers['Content-Type'];
|
|
333
|
+
if (localVarFormParams instanceof FormData) {
|
|
334
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
335
|
+
requestOptions.body = localVarFormParams;
|
|
294
336
|
}
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
304
|
-
reject(new Error(body.error || errString));
|
|
305
|
-
}
|
|
306
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
307
|
-
resolve(body);
|
|
308
|
-
}
|
|
309
|
-
else {
|
|
310
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
311
|
-
reject(errString);
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
});
|
|
315
|
-
});
|
|
316
|
-
});
|
|
337
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
338
|
+
// URL-encoded form
|
|
339
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
340
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
341
|
+
}
|
|
342
|
+
}
|
|
343
|
+
const response = await fetch(url, requestOptions);
|
|
344
|
+
return this.handleResponse(response, 'GetPerformanceCalibrationGroundTruthResponse');
|
|
317
345
|
}
|
|
318
346
|
/**
|
|
319
347
|
* Get performance calibration parameter sets
|
|
@@ -325,9 +353,11 @@ class PerformanceCalibrationApi {
|
|
|
325
353
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameter-sets'
|
|
326
354
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
327
355
|
let localVarQueryParameters = {};
|
|
328
|
-
let localVarHeaderParams =
|
|
329
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
330
|
-
|
|
356
|
+
let localVarHeaderParams = {
|
|
357
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
358
|
+
'Content-Type': 'application/json',
|
|
359
|
+
...this.defaultHeaders,
|
|
360
|
+
};
|
|
331
361
|
const produces = ['application/json'];
|
|
332
362
|
// give precedence to 'application/json'
|
|
333
363
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -336,7 +366,7 @@ class PerformanceCalibrationApi {
|
|
|
336
366
|
else {
|
|
337
367
|
localVarHeaderParams.Accept = produces.join(',');
|
|
338
368
|
}
|
|
339
|
-
let localVarFormParams
|
|
369
|
+
let localVarFormParams;
|
|
340
370
|
// verify required parameter 'projectId' is not null or undefined
|
|
341
371
|
if (projectId === null || projectId === undefined) {
|
|
342
372
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationParameterSets.');
|
|
@@ -344,55 +374,51 @@ class PerformanceCalibrationApi {
|
|
|
344
374
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
345
375
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
346
376
|
}
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
377
|
+
localVarHeaderParams = {
|
|
378
|
+
...localVarHeaderParams,
|
|
379
|
+
...options.headers,
|
|
380
|
+
...this.opts.extraHeaders,
|
|
381
|
+
};
|
|
382
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
383
|
+
.filter(([, value]) => value !== undefined)
|
|
384
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
385
|
+
.join('&');
|
|
386
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
350
387
|
let localVarRequestOptions = {
|
|
351
388
|
method: 'GET',
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
389
|
+
headers: { ...localVarHeaderParams },
|
|
390
|
+
};
|
|
391
|
+
let requestOptions = localVarRequestOptions;
|
|
392
|
+
let url = localVarUrl;
|
|
393
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
394
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
395
|
+
url = auth_ApiKeyAuthentication.url;
|
|
396
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
397
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
398
|
+
url = auth_JWTAuthentication.url;
|
|
399
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
400
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
401
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
402
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
403
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
404
|
+
url = auth_OAuth2.url;
|
|
405
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
406
|
+
requestOptions = authDefault.requestOptions;
|
|
407
|
+
url = authDefault.url;
|
|
408
|
+
if (localVarFormParams) {
|
|
409
|
+
delete requestOptions.headers['Content-Type'];
|
|
410
|
+
if (localVarFormParams instanceof FormData) {
|
|
411
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
412
|
+
requestOptions.body = localVarFormParams;
|
|
373
413
|
}
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
383
|
-
reject(new Error(body.error || errString));
|
|
384
|
-
}
|
|
385
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
386
|
-
resolve(body);
|
|
387
|
-
}
|
|
388
|
-
else {
|
|
389
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
390
|
-
reject(errString);
|
|
391
|
-
}
|
|
392
|
-
}
|
|
393
|
-
});
|
|
394
|
-
});
|
|
395
|
-
});
|
|
414
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
415
|
+
// URL-encoded form
|
|
416
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
417
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
418
|
+
}
|
|
419
|
+
}
|
|
420
|
+
const response = await fetch(url, requestOptions);
|
|
421
|
+
return this.handleResponse(response, 'GetPerformanceCalibrationParameterSetsResponse');
|
|
396
422
|
}
|
|
397
423
|
/**
|
|
398
424
|
* Get performance calibration raw result
|
|
@@ -404,9 +430,11 @@ class PerformanceCalibrationApi {
|
|
|
404
430
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/raw-result'
|
|
405
431
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
406
432
|
let localVarQueryParameters = {};
|
|
407
|
-
let localVarHeaderParams =
|
|
408
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
409
|
-
|
|
433
|
+
let localVarHeaderParams = {
|
|
434
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
435
|
+
'Content-Type': 'application/json',
|
|
436
|
+
...this.defaultHeaders,
|
|
437
|
+
};
|
|
410
438
|
const produces = ['application/json'];
|
|
411
439
|
// give precedence to 'application/json'
|
|
412
440
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -415,7 +443,7 @@ class PerformanceCalibrationApi {
|
|
|
415
443
|
else {
|
|
416
444
|
localVarHeaderParams.Accept = produces.join(',');
|
|
417
445
|
}
|
|
418
|
-
let localVarFormParams
|
|
446
|
+
let localVarFormParams;
|
|
419
447
|
// verify required parameter 'projectId' is not null or undefined
|
|
420
448
|
if (projectId === null || projectId === undefined) {
|
|
421
449
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationRawResult.');
|
|
@@ -423,55 +451,51 @@ class PerformanceCalibrationApi {
|
|
|
423
451
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
424
452
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
425
453
|
}
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
454
|
+
localVarHeaderParams = {
|
|
455
|
+
...localVarHeaderParams,
|
|
456
|
+
...options.headers,
|
|
457
|
+
...this.opts.extraHeaders,
|
|
458
|
+
};
|
|
459
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
460
|
+
.filter(([, value]) => value !== undefined)
|
|
461
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
462
|
+
.join('&');
|
|
463
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
429
464
|
let localVarRequestOptions = {
|
|
430
465
|
method: 'GET',
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
466
|
+
headers: { ...localVarHeaderParams },
|
|
467
|
+
};
|
|
468
|
+
let requestOptions = localVarRequestOptions;
|
|
469
|
+
let url = localVarUrl;
|
|
470
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
471
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
472
|
+
url = auth_ApiKeyAuthentication.url;
|
|
473
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
474
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
475
|
+
url = auth_JWTAuthentication.url;
|
|
476
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
477
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
478
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
479
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
480
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
481
|
+
url = auth_OAuth2.url;
|
|
482
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
483
|
+
requestOptions = authDefault.requestOptions;
|
|
484
|
+
url = authDefault.url;
|
|
485
|
+
if (localVarFormParams) {
|
|
486
|
+
delete requestOptions.headers['Content-Type'];
|
|
487
|
+
if (localVarFormParams instanceof FormData) {
|
|
488
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
489
|
+
requestOptions.body = localVarFormParams;
|
|
452
490
|
}
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
462
|
-
reject(new Error(body.error || errString));
|
|
463
|
-
}
|
|
464
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
465
|
-
resolve(body);
|
|
466
|
-
}
|
|
467
|
-
else {
|
|
468
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
469
|
-
reject(errString);
|
|
470
|
-
}
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
});
|
|
474
|
-
});
|
|
491
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
492
|
+
// URL-encoded form
|
|
493
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
494
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
495
|
+
}
|
|
496
|
+
}
|
|
497
|
+
const response = await fetch(url, requestOptions);
|
|
498
|
+
return this.handleResponse(response, 'GetPerformanceCalibrationRawResultResponse');
|
|
475
499
|
}
|
|
476
500
|
/**
|
|
477
501
|
* Get performance calibration stored parameters
|
|
@@ -483,9 +507,11 @@ class PerformanceCalibrationApi {
|
|
|
483
507
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameters'
|
|
484
508
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
485
509
|
let localVarQueryParameters = {};
|
|
486
|
-
let localVarHeaderParams =
|
|
487
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
488
|
-
|
|
510
|
+
let localVarHeaderParams = {
|
|
511
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
512
|
+
'Content-Type': 'application/json',
|
|
513
|
+
...this.defaultHeaders,
|
|
514
|
+
};
|
|
489
515
|
const produces = ['application/json'];
|
|
490
516
|
// give precedence to 'application/json'
|
|
491
517
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -494,7 +520,7 @@ class PerformanceCalibrationApi {
|
|
|
494
520
|
else {
|
|
495
521
|
localVarHeaderParams.Accept = produces.join(',');
|
|
496
522
|
}
|
|
497
|
-
let localVarFormParams
|
|
523
|
+
let localVarFormParams;
|
|
498
524
|
// verify required parameter 'projectId' is not null or undefined
|
|
499
525
|
if (projectId === null || projectId === undefined) {
|
|
500
526
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationSavedParameters.');
|
|
@@ -502,55 +528,51 @@ class PerformanceCalibrationApi {
|
|
|
502
528
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
503
529
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
504
530
|
}
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
531
|
+
localVarHeaderParams = {
|
|
532
|
+
...localVarHeaderParams,
|
|
533
|
+
...options.headers,
|
|
534
|
+
...this.opts.extraHeaders,
|
|
535
|
+
};
|
|
536
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
537
|
+
.filter(([, value]) => value !== undefined)
|
|
538
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
539
|
+
.join('&');
|
|
540
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
508
541
|
let localVarRequestOptions = {
|
|
509
542
|
method: 'GET',
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
522
|
-
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
543
|
+
headers: { ...localVarHeaderParams },
|
|
544
|
+
};
|
|
545
|
+
let requestOptions = localVarRequestOptions;
|
|
546
|
+
let url = localVarUrl;
|
|
547
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
548
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
549
|
+
url = auth_ApiKeyAuthentication.url;
|
|
550
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
551
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
552
|
+
url = auth_JWTAuthentication.url;
|
|
553
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
554
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
555
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
556
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
557
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
558
|
+
url = auth_OAuth2.url;
|
|
559
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
560
|
+
requestOptions = authDefault.requestOptions;
|
|
561
|
+
url = authDefault.url;
|
|
562
|
+
if (localVarFormParams) {
|
|
563
|
+
delete requestOptions.headers['Content-Type'];
|
|
564
|
+
if (localVarFormParams instanceof FormData) {
|
|
565
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
566
|
+
requestOptions.body = localVarFormParams;
|
|
531
567
|
}
|
|
532
|
-
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
541
|
-
reject(new Error(body.error || errString));
|
|
542
|
-
}
|
|
543
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
544
|
-
resolve(body);
|
|
545
|
-
}
|
|
546
|
-
else {
|
|
547
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
548
|
-
reject(errString);
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
});
|
|
552
|
-
});
|
|
553
|
-
});
|
|
568
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
569
|
+
// URL-encoded form
|
|
570
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
571
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
572
|
+
}
|
|
573
|
+
}
|
|
574
|
+
const response = await fetch(url, requestOptions);
|
|
575
|
+
return this.handleResponse(response, 'GetPerformanceCalibrationParametersResponse');
|
|
554
576
|
}
|
|
555
577
|
/**
|
|
556
578
|
* Get performance calibration status
|
|
@@ -562,9 +584,11 @@ class PerformanceCalibrationApi {
|
|
|
562
584
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/status'
|
|
563
585
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
564
586
|
let localVarQueryParameters = {};
|
|
565
|
-
let localVarHeaderParams =
|
|
566
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
567
|
-
|
|
587
|
+
let localVarHeaderParams = {
|
|
588
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
589
|
+
'Content-Type': 'application/json',
|
|
590
|
+
...this.defaultHeaders,
|
|
591
|
+
};
|
|
568
592
|
const produces = ['application/json'];
|
|
569
593
|
// give precedence to 'application/json'
|
|
570
594
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -573,7 +597,7 @@ class PerformanceCalibrationApi {
|
|
|
573
597
|
else {
|
|
574
598
|
localVarHeaderParams.Accept = produces.join(',');
|
|
575
599
|
}
|
|
576
|
-
let localVarFormParams
|
|
600
|
+
let localVarFormParams;
|
|
577
601
|
// verify required parameter 'projectId' is not null or undefined
|
|
578
602
|
if (projectId === null || projectId === undefined) {
|
|
579
603
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceCalibrationStatus.');
|
|
@@ -581,55 +605,51 @@ class PerformanceCalibrationApi {
|
|
|
581
605
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
582
606
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
583
607
|
}
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
608
|
+
localVarHeaderParams = {
|
|
609
|
+
...localVarHeaderParams,
|
|
610
|
+
...options.headers,
|
|
611
|
+
...this.opts.extraHeaders,
|
|
612
|
+
};
|
|
613
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
614
|
+
.filter(([, value]) => value !== undefined)
|
|
615
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
616
|
+
.join('&');
|
|
617
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
587
618
|
let localVarRequestOptions = {
|
|
588
619
|
method: 'GET',
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
620
|
+
headers: { ...localVarHeaderParams },
|
|
621
|
+
};
|
|
622
|
+
let requestOptions = localVarRequestOptions;
|
|
623
|
+
let url = localVarUrl;
|
|
624
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
625
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
626
|
+
url = auth_ApiKeyAuthentication.url;
|
|
627
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
628
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
629
|
+
url = auth_JWTAuthentication.url;
|
|
630
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
631
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
632
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
633
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
634
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
635
|
+
url = auth_OAuth2.url;
|
|
636
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
637
|
+
requestOptions = authDefault.requestOptions;
|
|
638
|
+
url = authDefault.url;
|
|
639
|
+
if (localVarFormParams) {
|
|
640
|
+
delete requestOptions.headers['Content-Type'];
|
|
641
|
+
if (localVarFormParams instanceof FormData) {
|
|
642
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
643
|
+
requestOptions.body = localVarFormParams;
|
|
610
644
|
}
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
620
|
-
reject(new Error(body.error || errString));
|
|
621
|
-
}
|
|
622
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
623
|
-
resolve(body);
|
|
624
|
-
}
|
|
625
|
-
else {
|
|
626
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
627
|
-
reject(errString);
|
|
628
|
-
}
|
|
629
|
-
}
|
|
630
|
-
});
|
|
631
|
-
});
|
|
632
|
-
});
|
|
645
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
646
|
+
// URL-encoded form
|
|
647
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
648
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
649
|
+
}
|
|
650
|
+
}
|
|
651
|
+
const response = await fetch(url, requestOptions);
|
|
652
|
+
return this.handleResponse(response, 'GetPerformanceCalibrationStatusResponse');
|
|
633
653
|
}
|
|
634
654
|
/**
|
|
635
655
|
* Internal endpoint, API is subject to change. Get results of most recent post processing run.
|
|
@@ -641,9 +661,11 @@ class PerformanceCalibrationApi {
|
|
|
641
661
|
const localVarPath = this.basePath + '/api/{projectId}/post-processing/results'
|
|
642
662
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
643
663
|
let localVarQueryParameters = {};
|
|
644
|
-
let localVarHeaderParams =
|
|
645
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
646
|
-
|
|
664
|
+
let localVarHeaderParams = {
|
|
665
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
666
|
+
'Content-Type': 'application/json',
|
|
667
|
+
...this.defaultHeaders,
|
|
668
|
+
};
|
|
647
669
|
const produces = ['application/json'];
|
|
648
670
|
// give precedence to 'application/json'
|
|
649
671
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -652,7 +674,7 @@ class PerformanceCalibrationApi {
|
|
|
652
674
|
else {
|
|
653
675
|
localVarHeaderParams.Accept = produces.join(',');
|
|
654
676
|
}
|
|
655
|
-
let localVarFormParams
|
|
677
|
+
let localVarFormParams;
|
|
656
678
|
// verify required parameter 'projectId' is not null or undefined
|
|
657
679
|
if (projectId === null || projectId === undefined) {
|
|
658
680
|
throw new Error('Required parameter projectId was null or undefined when calling getPostProcessingResults.');
|
|
@@ -660,55 +682,51 @@ class PerformanceCalibrationApi {
|
|
|
660
682
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
661
683
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
662
684
|
}
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
685
|
+
localVarHeaderParams = {
|
|
686
|
+
...localVarHeaderParams,
|
|
687
|
+
...options.headers,
|
|
688
|
+
...this.opts.extraHeaders,
|
|
689
|
+
};
|
|
690
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
691
|
+
.filter(([, value]) => value !== undefined)
|
|
692
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
693
|
+
.join('&');
|
|
694
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
666
695
|
let localVarRequestOptions = {
|
|
667
696
|
method: 'GET',
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
697
|
+
headers: { ...localVarHeaderParams },
|
|
698
|
+
};
|
|
699
|
+
let requestOptions = localVarRequestOptions;
|
|
700
|
+
let url = localVarUrl;
|
|
701
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
702
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
703
|
+
url = auth_ApiKeyAuthentication.url;
|
|
704
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
705
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
706
|
+
url = auth_JWTAuthentication.url;
|
|
707
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
708
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
709
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
710
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
711
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
712
|
+
url = auth_OAuth2.url;
|
|
713
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
714
|
+
requestOptions = authDefault.requestOptions;
|
|
715
|
+
url = authDefault.url;
|
|
716
|
+
if (localVarFormParams) {
|
|
717
|
+
delete requestOptions.headers['Content-Type'];
|
|
718
|
+
if (localVarFormParams instanceof FormData) {
|
|
719
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
720
|
+
requestOptions.body = localVarFormParams;
|
|
689
721
|
}
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
699
|
-
reject(new Error(body.error || errString));
|
|
700
|
-
}
|
|
701
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
702
|
-
resolve(body);
|
|
703
|
-
}
|
|
704
|
-
else {
|
|
705
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
706
|
-
reject(errString);
|
|
707
|
-
}
|
|
708
|
-
}
|
|
709
|
-
});
|
|
710
|
-
});
|
|
711
|
-
});
|
|
722
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
723
|
+
// URL-encoded form
|
|
724
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
725
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
726
|
+
}
|
|
727
|
+
}
|
|
728
|
+
const response = await fetch(url, requestOptions);
|
|
729
|
+
return this.handleResponse(response, 'GetPostProcessingResultsResponse');
|
|
712
730
|
}
|
|
713
731
|
/**
|
|
714
732
|
* Get the synthetic sample as a WAV file
|
|
@@ -720,9 +738,11 @@ class PerformanceCalibrationApi {
|
|
|
720
738
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/wav'
|
|
721
739
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
722
740
|
let localVarQueryParameters = {};
|
|
723
|
-
let localVarHeaderParams =
|
|
724
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
725
|
-
|
|
741
|
+
let localVarHeaderParams = {
|
|
742
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
743
|
+
'Content-Type': 'application/json',
|
|
744
|
+
...this.defaultHeaders,
|
|
745
|
+
};
|
|
726
746
|
const produces = ['audio/wav'];
|
|
727
747
|
// give precedence to 'application/json'
|
|
728
748
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -731,7 +751,7 @@ class PerformanceCalibrationApi {
|
|
|
731
751
|
else {
|
|
732
752
|
localVarHeaderParams.Accept = produces.join(',');
|
|
733
753
|
}
|
|
734
|
-
let localVarFormParams
|
|
754
|
+
let localVarFormParams;
|
|
735
755
|
// verify required parameter 'projectId' is not null or undefined
|
|
736
756
|
if (projectId === null || projectId === undefined) {
|
|
737
757
|
throw new Error('Required parameter projectId was null or undefined when calling getWavFile.');
|
|
@@ -739,55 +759,51 @@ class PerformanceCalibrationApi {
|
|
|
739
759
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
740
760
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
741
761
|
}
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
762
|
+
localVarHeaderParams = {
|
|
763
|
+
...localVarHeaderParams,
|
|
764
|
+
...options.headers,
|
|
765
|
+
...this.opts.extraHeaders,
|
|
766
|
+
};
|
|
767
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
768
|
+
.filter(([, value]) => value !== undefined)
|
|
769
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
770
|
+
.join('&');
|
|
771
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
745
772
|
let localVarRequestOptions = {
|
|
746
773
|
method: 'GET',
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
774
|
+
headers: { ...localVarHeaderParams },
|
|
775
|
+
};
|
|
776
|
+
let requestOptions = localVarRequestOptions;
|
|
777
|
+
let url = localVarUrl;
|
|
778
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
779
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
780
|
+
url = auth_ApiKeyAuthentication.url;
|
|
781
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
782
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
783
|
+
url = auth_JWTAuthentication.url;
|
|
784
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
785
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
786
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
787
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
788
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
789
|
+
url = auth_OAuth2.url;
|
|
790
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
791
|
+
requestOptions = authDefault.requestOptions;
|
|
792
|
+
url = authDefault.url;
|
|
793
|
+
if (localVarFormParams) {
|
|
794
|
+
delete requestOptions.headers['Content-Type'];
|
|
795
|
+
if (localVarFormParams instanceof FormData) {
|
|
796
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
797
|
+
requestOptions.body = localVarFormParams;
|
|
768
798
|
}
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
776
|
-
|
|
777
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
778
|
-
reject(new Error(body.error || errString));
|
|
779
|
-
}
|
|
780
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
781
|
-
resolve(body);
|
|
782
|
-
}
|
|
783
|
-
else {
|
|
784
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
785
|
-
reject(errString);
|
|
786
|
-
}
|
|
787
|
-
}
|
|
788
|
-
});
|
|
789
|
-
});
|
|
790
|
-
});
|
|
799
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
800
|
+
// URL-encoded form
|
|
801
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
802
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
803
|
+
}
|
|
804
|
+
}
|
|
805
|
+
const response = await fetch(url, requestOptions);
|
|
806
|
+
return this.handleResponse(response, 'Buffer');
|
|
791
807
|
}
|
|
792
808
|
/**
|
|
793
809
|
* Set the current performance calibration parameters
|
|
@@ -800,9 +816,11 @@ class PerformanceCalibrationApi {
|
|
|
800
816
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/parameters'
|
|
801
817
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
802
818
|
let localVarQueryParameters = {};
|
|
803
|
-
let localVarHeaderParams =
|
|
804
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
805
|
-
|
|
819
|
+
let localVarHeaderParams = {
|
|
820
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
821
|
+
'Content-Type': 'application/json',
|
|
822
|
+
...this.defaultHeaders,
|
|
823
|
+
};
|
|
806
824
|
const produces = ['application/json'];
|
|
807
825
|
// give precedence to 'application/json'
|
|
808
826
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -811,7 +829,7 @@ class PerformanceCalibrationApi {
|
|
|
811
829
|
else {
|
|
812
830
|
localVarHeaderParams.Accept = produces.join(',');
|
|
813
831
|
}
|
|
814
|
-
let localVarFormParams
|
|
832
|
+
let localVarFormParams;
|
|
815
833
|
// verify required parameter 'projectId' is not null or undefined
|
|
816
834
|
if (projectId === null || projectId === undefined) {
|
|
817
835
|
throw new Error('Required parameter projectId was null or undefined when calling setPerformanceCalibrationSavedParameters.');
|
|
@@ -823,56 +841,52 @@ class PerformanceCalibrationApi {
|
|
|
823
841
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
824
842
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
825
843
|
}
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
844
|
+
localVarHeaderParams = {
|
|
845
|
+
...localVarHeaderParams,
|
|
846
|
+
...options.headers,
|
|
847
|
+
...this.opts.extraHeaders,
|
|
848
|
+
};
|
|
849
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
850
|
+
.filter(([, value]) => value !== undefined)
|
|
851
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
852
|
+
.join('&');
|
|
853
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
829
854
|
let localVarRequestOptions = {
|
|
830
855
|
method: 'POST',
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
856
|
+
headers: { ...localVarHeaderParams },
|
|
857
|
+
};
|
|
858
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(performanceCalibrationSaveParameterSetRequest, "PerformanceCalibrationSaveParameterSetRequest"));
|
|
859
|
+
let requestOptions = localVarRequestOptions;
|
|
860
|
+
let url = localVarUrl;
|
|
861
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
862
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
863
|
+
url = auth_ApiKeyAuthentication.url;
|
|
864
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
865
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
866
|
+
url = auth_JWTAuthentication.url;
|
|
867
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
868
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
869
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
870
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
871
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
872
|
+
url = auth_OAuth2.url;
|
|
873
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
874
|
+
requestOptions = authDefault.requestOptions;
|
|
875
|
+
url = authDefault.url;
|
|
876
|
+
if (localVarFormParams) {
|
|
877
|
+
delete requestOptions.headers['Content-Type'];
|
|
878
|
+
if (localVarFormParams instanceof FormData) {
|
|
879
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
880
|
+
requestOptions.body = localVarFormParams;
|
|
853
881
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
863
|
-
reject(new Error(body.error || errString));
|
|
864
|
-
}
|
|
865
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
866
|
-
resolve(body);
|
|
867
|
-
}
|
|
868
|
-
else {
|
|
869
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
870
|
-
reject(errString);
|
|
871
|
-
}
|
|
872
|
-
}
|
|
873
|
-
});
|
|
874
|
-
});
|
|
875
|
-
});
|
|
882
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
883
|
+
// URL-encoded form
|
|
884
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
885
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
886
|
+
}
|
|
887
|
+
}
|
|
888
|
+
const response = await fetch(url, requestOptions);
|
|
889
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
876
890
|
}
|
|
877
891
|
/**
|
|
878
892
|
* Upload a zip files with a wav file and its Label metadata to run performance calibration on it.
|
|
@@ -885,9 +899,11 @@ class PerformanceCalibrationApi {
|
|
|
885
899
|
const localVarPath = this.basePath + '/api/{projectId}/performance-calibration/files'
|
|
886
900
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
887
901
|
let localVarQueryParameters = {};
|
|
888
|
-
let localVarHeaderParams =
|
|
889
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
890
|
-
|
|
902
|
+
let localVarHeaderParams = {
|
|
903
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
904
|
+
'Content-Type': 'application/json',
|
|
905
|
+
...this.defaultHeaders,
|
|
906
|
+
};
|
|
891
907
|
const produces = ['application/json'];
|
|
892
908
|
// give precedence to 'application/json'
|
|
893
909
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -896,7 +912,7 @@ class PerformanceCalibrationApi {
|
|
|
896
912
|
else {
|
|
897
913
|
localVarHeaderParams.Accept = produces.join(',');
|
|
898
914
|
}
|
|
899
|
-
let localVarFormParams
|
|
915
|
+
let localVarFormParams;
|
|
900
916
|
// verify required parameter 'projectId' is not null or undefined
|
|
901
917
|
if (projectId === null || projectId === undefined) {
|
|
902
918
|
throw new Error('Required parameter projectId was null or undefined when calling uploadLabeledAudio.');
|
|
@@ -908,59 +924,69 @@ class PerformanceCalibrationApi {
|
|
|
908
924
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
909
925
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
910
926
|
}
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
927
|
+
localVarHeaderParams = {
|
|
928
|
+
...localVarHeaderParams,
|
|
929
|
+
...options.headers,
|
|
930
|
+
...this.opts.extraHeaders,
|
|
931
|
+
};
|
|
914
932
|
if (params.zip !== undefined) {
|
|
915
|
-
localVarFormParams
|
|
933
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
934
|
+
const existingParams = localVarFormParams;
|
|
935
|
+
localVarFormParams = new FormData();
|
|
936
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
937
|
+
Object.keys(existingParams).forEach(key => {
|
|
938
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
939
|
+
});
|
|
940
|
+
}
|
|
941
|
+
}
|
|
942
|
+
const zipFiles = Array.isArray(params.zip) ? params.zip : [params.zip];
|
|
943
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
944
|
+
zipFiles.forEach((f) => {
|
|
945
|
+
localVarFormParams.append('zip', new Blob([f.value], {
|
|
946
|
+
type: f.options.contentType
|
|
947
|
+
}), f.options.filename);
|
|
948
|
+
});
|
|
916
949
|
}
|
|
917
|
-
|
|
950
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
951
|
+
.filter(([, value]) => value !== undefined)
|
|
952
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
953
|
+
.join('&');
|
|
954
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
918
955
|
let localVarRequestOptions = {
|
|
919
956
|
method: 'POST',
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
957
|
+
headers: { ...localVarHeaderParams },
|
|
958
|
+
};
|
|
959
|
+
let requestOptions = localVarRequestOptions;
|
|
960
|
+
let url = localVarUrl;
|
|
961
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
962
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
963
|
+
url = auth_ApiKeyAuthentication.url;
|
|
964
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
965
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
966
|
+
url = auth_JWTAuthentication.url;
|
|
967
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
968
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
969
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
970
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
971
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
972
|
+
url = auth_OAuth2.url;
|
|
973
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
974
|
+
requestOptions = authDefault.requestOptions;
|
|
975
|
+
url = authDefault.url;
|
|
976
|
+
if (localVarFormParams) {
|
|
977
|
+
delete requestOptions.headers['Content-Type'];
|
|
978
|
+
if (localVarFormParams instanceof FormData) {
|
|
979
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
980
|
+
requestOptions.body = localVarFormParams;
|
|
941
981
|
}
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
951
|
-
reject(new Error(body.error || errString));
|
|
952
|
-
}
|
|
953
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
954
|
-
resolve(body);
|
|
955
|
-
}
|
|
956
|
-
else {
|
|
957
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
958
|
-
reject(errString);
|
|
959
|
-
}
|
|
960
|
-
}
|
|
961
|
-
});
|
|
962
|
-
});
|
|
963
|
-
});
|
|
982
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
983
|
+
// URL-encoded form
|
|
984
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
985
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
const response = await fetch(url, requestOptions);
|
|
989
|
+
return this.handleResponse(response, 'PerformanceCalibrationUploadLabeledAudioResponse');
|
|
964
990
|
}
|
|
965
991
|
}
|
|
966
992
|
exports.PerformanceCalibrationApi = PerformanceCalibrationApi;
|