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.LearnApi = exports.LearnApiApiKeys = 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 LearnApiApiKeys;
|
|
|
30
47
|
LearnApiApiKeys[LearnApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(LearnApiApiKeys = exports.LearnApiApiKeys || (exports.LearnApiApiKeys = {}));
|
|
32
49
|
class LearnApi {
|
|
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 LearnApi {
|
|
|
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 LearnApi {
|
|
|
90
124
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
91
125
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
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 LearnApi {
|
|
|
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 addKerasFiles.');
|
|
@@ -114,59 +150,69 @@ class LearnApi {
|
|
|
114
150
|
if (params.zip === null || params.zip === undefined) {
|
|
115
151
|
throw new Error('Required parameter params.zip was null or undefined when calling addKerasFiles.');
|
|
116
152
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
153
|
+
localVarHeaderParams = {
|
|
154
|
+
...localVarHeaderParams,
|
|
155
|
+
...options.headers,
|
|
156
|
+
...this.opts.extraHeaders,
|
|
157
|
+
};
|
|
120
158
|
if (params.zip !== undefined) {
|
|
121
|
-
localVarFormParams
|
|
159
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
160
|
+
const existingParams = localVarFormParams;
|
|
161
|
+
localVarFormParams = new FormData();
|
|
162
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
163
|
+
Object.keys(existingParams).forEach(key => {
|
|
164
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
const zipFiles = Array.isArray(params.zip) ? params.zip : [params.zip];
|
|
169
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
170
|
+
zipFiles.forEach((f) => {
|
|
171
|
+
localVarFormParams.append('zip', new Blob([f.value], {
|
|
172
|
+
type: f.options.contentType
|
|
173
|
+
}), f.options.filename);
|
|
174
|
+
});
|
|
122
175
|
}
|
|
123
|
-
|
|
176
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
177
|
+
.filter(([, value]) => value !== undefined)
|
|
178
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
179
|
+
.join('&');
|
|
180
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
124
181
|
let localVarRequestOptions = {
|
|
125
182
|
method: 'POST',
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
183
|
+
headers: { ...localVarHeaderParams },
|
|
184
|
+
};
|
|
185
|
+
let requestOptions = localVarRequestOptions;
|
|
186
|
+
let url = localVarUrl;
|
|
187
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
188
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
189
|
+
url = auth_ApiKeyAuthentication.url;
|
|
190
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
191
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
192
|
+
url = auth_JWTAuthentication.url;
|
|
193
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
194
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
195
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
196
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
197
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
198
|
+
url = auth_OAuth2.url;
|
|
199
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
200
|
+
requestOptions = authDefault.requestOptions;
|
|
201
|
+
url = authDefault.url;
|
|
202
|
+
if (localVarFormParams) {
|
|
203
|
+
delete requestOptions.headers['Content-Type'];
|
|
204
|
+
if (localVarFormParams instanceof FormData) {
|
|
205
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
206
|
+
requestOptions.body = localVarFormParams;
|
|
147
207
|
}
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
157
|
-
reject(new Error(body.error || errString));
|
|
158
|
-
}
|
|
159
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
160
|
-
resolve(body);
|
|
161
|
-
}
|
|
162
|
-
else {
|
|
163
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
164
|
-
reject(errString);
|
|
165
|
-
}
|
|
166
|
-
}
|
|
167
|
-
});
|
|
168
|
-
});
|
|
169
|
-
});
|
|
208
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
209
|
+
// URL-encoded form
|
|
210
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
211
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
212
|
+
}
|
|
213
|
+
}
|
|
214
|
+
const response = await fetch(url, requestOptions);
|
|
215
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
170
216
|
}
|
|
171
217
|
/**
|
|
172
218
|
* Get a sample of trained features, this extracts a number of samples and their features.
|
|
@@ -181,9 +227,11 @@ class LearnApi {
|
|
|
181
227
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
182
228
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
183
229
|
let localVarQueryParameters = {};
|
|
184
|
-
let localVarHeaderParams =
|
|
185
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
186
|
-
|
|
230
|
+
let localVarHeaderParams = {
|
|
231
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
232
|
+
'Content-Type': 'application/json',
|
|
233
|
+
...this.defaultHeaders,
|
|
234
|
+
};
|
|
187
235
|
const produces = ['application/json'];
|
|
188
236
|
// give precedence to 'application/json'
|
|
189
237
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -192,7 +240,7 @@ class LearnApi {
|
|
|
192
240
|
else {
|
|
193
241
|
localVarHeaderParams.Accept = produces.join(',');
|
|
194
242
|
}
|
|
195
|
-
let localVarFormParams
|
|
243
|
+
let localVarFormParams;
|
|
196
244
|
// verify required parameter 'projectId' is not null or undefined
|
|
197
245
|
if (projectId === null || projectId === undefined) {
|
|
198
246
|
throw new Error('Required parameter projectId was null or undefined when calling anomalyTrainedFeatures.');
|
|
@@ -215,55 +263,51 @@ class LearnApi {
|
|
|
215
263
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.featureAx2) !== undefined) {
|
|
216
264
|
localVarQueryParameters['featureAx2'] = models_1.ObjectSerializer.serialize(queryParams.featureAx2, "number");
|
|
217
265
|
}
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
266
|
+
localVarHeaderParams = {
|
|
267
|
+
...localVarHeaderParams,
|
|
268
|
+
...options.headers,
|
|
269
|
+
...this.opts.extraHeaders,
|
|
270
|
+
};
|
|
271
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
272
|
+
.filter(([, value]) => value !== undefined)
|
|
273
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
274
|
+
.join('&');
|
|
275
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
221
276
|
let localVarRequestOptions = {
|
|
222
277
|
method: 'GET',
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
278
|
+
headers: { ...localVarHeaderParams },
|
|
279
|
+
};
|
|
280
|
+
let requestOptions = localVarRequestOptions;
|
|
281
|
+
let url = localVarUrl;
|
|
282
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
283
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
284
|
+
url = auth_ApiKeyAuthentication.url;
|
|
285
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
286
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
287
|
+
url = auth_JWTAuthentication.url;
|
|
288
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
289
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
290
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
291
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
292
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
293
|
+
url = auth_OAuth2.url;
|
|
294
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
295
|
+
requestOptions = authDefault.requestOptions;
|
|
296
|
+
url = authDefault.url;
|
|
297
|
+
if (localVarFormParams) {
|
|
298
|
+
delete requestOptions.headers['Content-Type'];
|
|
299
|
+
if (localVarFormParams instanceof FormData) {
|
|
300
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
301
|
+
requestOptions.body = localVarFormParams;
|
|
244
302
|
}
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
254
|
-
reject(new Error(body.error || errString));
|
|
255
|
-
}
|
|
256
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
257
|
-
resolve(body);
|
|
258
|
-
}
|
|
259
|
-
else {
|
|
260
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
261
|
-
reject(errString);
|
|
262
|
-
}
|
|
263
|
-
}
|
|
264
|
-
});
|
|
265
|
-
});
|
|
266
|
-
});
|
|
303
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
304
|
+
// URL-encoded form
|
|
305
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
306
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
const response = await fetch(url, requestOptions);
|
|
310
|
+
return this.handleResponse(response, 'AnomalyTrainedFeaturesResponse');
|
|
267
311
|
}
|
|
268
312
|
/**
|
|
269
313
|
* Get trained features for a single sample. This runs both the DSP prerequisites and the anomaly classifier.
|
|
@@ -278,9 +322,11 @@ class LearnApi {
|
|
|
278
322
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)))
|
|
279
323
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
280
324
|
let localVarQueryParameters = {};
|
|
281
|
-
let localVarHeaderParams =
|
|
282
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
283
|
-
|
|
325
|
+
let localVarHeaderParams = {
|
|
326
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
327
|
+
'Content-Type': 'application/json',
|
|
328
|
+
...this.defaultHeaders,
|
|
329
|
+
};
|
|
284
330
|
const produces = ['application/json'];
|
|
285
331
|
// give precedence to 'application/json'
|
|
286
332
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -289,7 +335,7 @@ class LearnApi {
|
|
|
289
335
|
else {
|
|
290
336
|
localVarHeaderParams.Accept = produces.join(',');
|
|
291
337
|
}
|
|
292
|
-
let localVarFormParams
|
|
338
|
+
let localVarFormParams;
|
|
293
339
|
// verify required parameter 'projectId' is not null or undefined
|
|
294
340
|
if (projectId === null || projectId === undefined) {
|
|
295
341
|
throw new Error('Required parameter projectId was null or undefined when calling anomalyTrainedFeaturesPerSample.');
|
|
@@ -302,55 +348,51 @@ class LearnApi {
|
|
|
302
348
|
if (sampleId === null || sampleId === undefined) {
|
|
303
349
|
throw new Error('Required parameter sampleId was null or undefined when calling anomalyTrainedFeaturesPerSample.');
|
|
304
350
|
}
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
351
|
+
localVarHeaderParams = {
|
|
352
|
+
...localVarHeaderParams,
|
|
353
|
+
...options.headers,
|
|
354
|
+
...this.opts.extraHeaders,
|
|
355
|
+
};
|
|
356
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
357
|
+
.filter(([, value]) => value !== undefined)
|
|
358
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
359
|
+
.join('&');
|
|
360
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
308
361
|
let localVarRequestOptions = {
|
|
309
362
|
method: 'GET',
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
363
|
+
headers: { ...localVarHeaderParams },
|
|
364
|
+
};
|
|
365
|
+
let requestOptions = localVarRequestOptions;
|
|
366
|
+
let url = localVarUrl;
|
|
367
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
368
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
369
|
+
url = auth_ApiKeyAuthentication.url;
|
|
370
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
371
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
372
|
+
url = auth_JWTAuthentication.url;
|
|
373
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
374
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
375
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
376
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
377
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
378
|
+
url = auth_OAuth2.url;
|
|
379
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
380
|
+
requestOptions = authDefault.requestOptions;
|
|
381
|
+
url = authDefault.url;
|
|
382
|
+
if (localVarFormParams) {
|
|
383
|
+
delete requestOptions.headers['Content-Type'];
|
|
384
|
+
if (localVarFormParams instanceof FormData) {
|
|
385
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
386
|
+
requestOptions.body = localVarFormParams;
|
|
331
387
|
}
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
341
|
-
reject(new Error(body.error || errString));
|
|
342
|
-
}
|
|
343
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
344
|
-
resolve(body);
|
|
345
|
-
}
|
|
346
|
-
else {
|
|
347
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
348
|
-
reject(errString);
|
|
349
|
-
}
|
|
350
|
-
}
|
|
351
|
-
});
|
|
352
|
-
});
|
|
353
|
-
});
|
|
388
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
389
|
+
// URL-encoded form
|
|
390
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
391
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
392
|
+
}
|
|
393
|
+
}
|
|
394
|
+
const response = await fetch(url, requestOptions);
|
|
395
|
+
return this.handleResponse(response, 'AnomalyTrainedFeaturesResponse');
|
|
354
396
|
}
|
|
355
397
|
/**
|
|
356
398
|
* Download the data of an exported Keras block - needs to be exported via \'exportKerasBlockData\' first
|
|
@@ -363,9 +405,11 @@ class LearnApi {
|
|
|
363
405
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
364
406
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
365
407
|
let localVarQueryParameters = {};
|
|
366
|
-
let localVarHeaderParams =
|
|
367
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
368
|
-
|
|
408
|
+
let localVarHeaderParams = {
|
|
409
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
410
|
+
'Content-Type': 'application/json',
|
|
411
|
+
...this.defaultHeaders,
|
|
412
|
+
};
|
|
369
413
|
const produces = ['application/zip'];
|
|
370
414
|
// give precedence to 'application/json'
|
|
371
415
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -374,7 +418,7 @@ class LearnApi {
|
|
|
374
418
|
else {
|
|
375
419
|
localVarHeaderParams.Accept = produces.join(',');
|
|
376
420
|
}
|
|
377
|
-
let localVarFormParams
|
|
421
|
+
let localVarFormParams;
|
|
378
422
|
// verify required parameter 'projectId' is not null or undefined
|
|
379
423
|
if (projectId === null || projectId === undefined) {
|
|
380
424
|
throw new Error('Required parameter projectId was null or undefined when calling downloadKerasData.');
|
|
@@ -383,55 +427,51 @@ class LearnApi {
|
|
|
383
427
|
if (learnId === null || learnId === undefined) {
|
|
384
428
|
throw new Error('Required parameter learnId was null or undefined when calling downloadKerasData.');
|
|
385
429
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
430
|
+
localVarHeaderParams = {
|
|
431
|
+
...localVarHeaderParams,
|
|
432
|
+
...options.headers,
|
|
433
|
+
...this.opts.extraHeaders,
|
|
434
|
+
};
|
|
435
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
436
|
+
.filter(([, value]) => value !== undefined)
|
|
437
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
438
|
+
.join('&');
|
|
439
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
389
440
|
let localVarRequestOptions = {
|
|
390
441
|
method: 'GET',
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
442
|
+
headers: { ...localVarHeaderParams },
|
|
443
|
+
};
|
|
444
|
+
let requestOptions = localVarRequestOptions;
|
|
445
|
+
let url = localVarUrl;
|
|
446
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
447
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
448
|
+
url = auth_ApiKeyAuthentication.url;
|
|
449
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
450
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
451
|
+
url = auth_JWTAuthentication.url;
|
|
452
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
453
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
454
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
455
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
456
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
457
|
+
url = auth_OAuth2.url;
|
|
458
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
459
|
+
requestOptions = authDefault.requestOptions;
|
|
460
|
+
url = authDefault.url;
|
|
461
|
+
if (localVarFormParams) {
|
|
462
|
+
delete requestOptions.headers['Content-Type'];
|
|
463
|
+
if (localVarFormParams instanceof FormData) {
|
|
464
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
465
|
+
requestOptions.body = localVarFormParams;
|
|
412
466
|
}
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
|
|
420
|
-
|
|
421
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
422
|
-
reject(new Error(body.error || errString));
|
|
423
|
-
}
|
|
424
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
425
|
-
resolve(body);
|
|
426
|
-
}
|
|
427
|
-
else {
|
|
428
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
429
|
-
reject(errString);
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
});
|
|
433
|
-
});
|
|
434
|
-
});
|
|
467
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
468
|
+
// URL-encoded form
|
|
469
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
470
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
471
|
+
}
|
|
472
|
+
}
|
|
473
|
+
const response = await fetch(url, requestOptions);
|
|
474
|
+
return this.handleResponse(response, 'Buffer');
|
|
435
475
|
}
|
|
436
476
|
/**
|
|
437
477
|
* Download an exported Keras block - needs to be exported via \'exportKerasBlock\' first
|
|
@@ -444,9 +484,11 @@ class LearnApi {
|
|
|
444
484
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
445
485
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
446
486
|
let localVarQueryParameters = {};
|
|
447
|
-
let localVarHeaderParams =
|
|
448
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
449
|
-
|
|
487
|
+
let localVarHeaderParams = {
|
|
488
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
489
|
+
'Content-Type': 'application/json',
|
|
490
|
+
...this.defaultHeaders,
|
|
491
|
+
};
|
|
450
492
|
const produces = ['application/zip'];
|
|
451
493
|
// give precedence to 'application/json'
|
|
452
494
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -455,7 +497,7 @@ class LearnApi {
|
|
|
455
497
|
else {
|
|
456
498
|
localVarHeaderParams.Accept = produces.join(',');
|
|
457
499
|
}
|
|
458
|
-
let localVarFormParams
|
|
500
|
+
let localVarFormParams;
|
|
459
501
|
// verify required parameter 'projectId' is not null or undefined
|
|
460
502
|
if (projectId === null || projectId === undefined) {
|
|
461
503
|
throw new Error('Required parameter projectId was null or undefined when calling downloadKerasExport.');
|
|
@@ -464,55 +506,51 @@ class LearnApi {
|
|
|
464
506
|
if (learnId === null || learnId === undefined) {
|
|
465
507
|
throw new Error('Required parameter learnId was null or undefined when calling downloadKerasExport.');
|
|
466
508
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
509
|
+
localVarHeaderParams = {
|
|
510
|
+
...localVarHeaderParams,
|
|
511
|
+
...options.headers,
|
|
512
|
+
...this.opts.extraHeaders,
|
|
513
|
+
};
|
|
514
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
515
|
+
.filter(([, value]) => value !== undefined)
|
|
516
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
517
|
+
.join('&');
|
|
518
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
470
519
|
let localVarRequestOptions = {
|
|
471
520
|
method: 'GET',
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
521
|
+
headers: { ...localVarHeaderParams },
|
|
522
|
+
};
|
|
523
|
+
let requestOptions = localVarRequestOptions;
|
|
524
|
+
let url = localVarUrl;
|
|
525
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
526
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
527
|
+
url = auth_ApiKeyAuthentication.url;
|
|
528
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
529
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
530
|
+
url = auth_JWTAuthentication.url;
|
|
531
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
532
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
533
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
534
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
535
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
536
|
+
url = auth_OAuth2.url;
|
|
537
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
538
|
+
requestOptions = authDefault.requestOptions;
|
|
539
|
+
url = authDefault.url;
|
|
540
|
+
if (localVarFormParams) {
|
|
541
|
+
delete requestOptions.headers['Content-Type'];
|
|
542
|
+
if (localVarFormParams instanceof FormData) {
|
|
543
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
544
|
+
requestOptions.body = localVarFormParams;
|
|
493
545
|
}
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
503
|
-
reject(new Error(body.error || errString));
|
|
504
|
-
}
|
|
505
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
506
|
-
resolve(body);
|
|
507
|
-
}
|
|
508
|
-
else {
|
|
509
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
510
|
-
reject(errString);
|
|
511
|
-
}
|
|
512
|
-
}
|
|
513
|
-
});
|
|
514
|
-
});
|
|
515
|
-
});
|
|
546
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
547
|
+
// URL-encoded form
|
|
548
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
549
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
550
|
+
}
|
|
551
|
+
}
|
|
552
|
+
const response = await fetch(url, requestOptions);
|
|
553
|
+
return this.handleResponse(response, 'Buffer');
|
|
516
554
|
}
|
|
517
555
|
/**
|
|
518
556
|
* Download a trained model for a learning block. Depending on the block this can be a TensorFlow model, or the cluster centroids.
|
|
@@ -527,9 +565,11 @@ class LearnApi {
|
|
|
527
565
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)))
|
|
528
566
|
.replace('{' + 'modelDownloadId' + '}', encodeURIComponent(String(modelDownloadId)));
|
|
529
567
|
let localVarQueryParameters = {};
|
|
530
|
-
let localVarHeaderParams =
|
|
531
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
532
|
-
|
|
568
|
+
let localVarHeaderParams = {
|
|
569
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
570
|
+
'Content-Type': 'application/json',
|
|
571
|
+
...this.defaultHeaders,
|
|
572
|
+
};
|
|
533
573
|
const produces = ['application/octet-stream'];
|
|
534
574
|
// give precedence to 'application/json'
|
|
535
575
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -538,7 +578,7 @@ class LearnApi {
|
|
|
538
578
|
else {
|
|
539
579
|
localVarHeaderParams.Accept = produces.join(',');
|
|
540
580
|
}
|
|
541
|
-
let localVarFormParams
|
|
581
|
+
let localVarFormParams;
|
|
542
582
|
// verify required parameter 'projectId' is not null or undefined
|
|
543
583
|
if (projectId === null || projectId === undefined) {
|
|
544
584
|
throw new Error('Required parameter projectId was null or undefined when calling downloadLearnModel.');
|
|
@@ -551,55 +591,51 @@ class LearnApi {
|
|
|
551
591
|
if (modelDownloadId === null || modelDownloadId === undefined) {
|
|
552
592
|
throw new Error('Required parameter modelDownloadId was null or undefined when calling downloadLearnModel.');
|
|
553
593
|
}
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
594
|
+
localVarHeaderParams = {
|
|
595
|
+
...localVarHeaderParams,
|
|
596
|
+
...options.headers,
|
|
597
|
+
...this.opts.extraHeaders,
|
|
598
|
+
};
|
|
599
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
600
|
+
.filter(([, value]) => value !== undefined)
|
|
601
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
602
|
+
.join('&');
|
|
603
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
557
604
|
let localVarRequestOptions = {
|
|
558
605
|
method: 'GET',
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
606
|
+
headers: { ...localVarHeaderParams },
|
|
607
|
+
};
|
|
608
|
+
let requestOptions = localVarRequestOptions;
|
|
609
|
+
let url = localVarUrl;
|
|
610
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
611
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
612
|
+
url = auth_ApiKeyAuthentication.url;
|
|
613
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
614
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
615
|
+
url = auth_JWTAuthentication.url;
|
|
616
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
617
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
618
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
619
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
620
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
621
|
+
url = auth_OAuth2.url;
|
|
622
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
623
|
+
requestOptions = authDefault.requestOptions;
|
|
624
|
+
url = authDefault.url;
|
|
625
|
+
if (localVarFormParams) {
|
|
626
|
+
delete requestOptions.headers['Content-Type'];
|
|
627
|
+
if (localVarFormParams instanceof FormData) {
|
|
628
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
629
|
+
requestOptions.body = localVarFormParams;
|
|
580
630
|
}
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
590
|
-
reject(new Error(body.error || errString));
|
|
591
|
-
}
|
|
592
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
593
|
-
resolve(body);
|
|
594
|
-
}
|
|
595
|
-
else {
|
|
596
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
597
|
-
reject(errString);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
|
-
});
|
|
601
|
-
});
|
|
602
|
-
});
|
|
631
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
632
|
+
// URL-encoded form
|
|
633
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
634
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
635
|
+
}
|
|
636
|
+
}
|
|
637
|
+
const response = await fetch(url, requestOptions);
|
|
638
|
+
return this.handleResponse(response, 'Buffer');
|
|
603
639
|
}
|
|
604
640
|
/**
|
|
605
641
|
* Download a pretrained model file
|
|
@@ -613,9 +649,11 @@ class LearnApi {
|
|
|
613
649
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
614
650
|
.replace('{' + 'pretrainedModelDownloadType' + '}', encodeURIComponent(String(pretrainedModelDownloadType)));
|
|
615
651
|
let localVarQueryParameters = {};
|
|
616
|
-
let localVarHeaderParams =
|
|
617
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
618
|
-
|
|
652
|
+
let localVarHeaderParams = {
|
|
653
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
654
|
+
'Content-Type': 'application/json',
|
|
655
|
+
...this.defaultHeaders,
|
|
656
|
+
};
|
|
619
657
|
const produces = ['application/octet-stream'];
|
|
620
658
|
// give precedence to 'application/json'
|
|
621
659
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -624,7 +662,7 @@ class LearnApi {
|
|
|
624
662
|
else {
|
|
625
663
|
localVarHeaderParams.Accept = produces.join(',');
|
|
626
664
|
}
|
|
627
|
-
let localVarFormParams
|
|
665
|
+
let localVarFormParams;
|
|
628
666
|
// verify required parameter 'projectId' is not null or undefined
|
|
629
667
|
if (projectId === null || projectId === undefined) {
|
|
630
668
|
throw new Error('Required parameter projectId was null or undefined when calling downloadPretrainedModel.');
|
|
@@ -636,55 +674,51 @@ class LearnApi {
|
|
|
636
674
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
637
675
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
638
676
|
}
|
|
639
|
-
|
|
640
|
-
|
|
641
|
-
|
|
677
|
+
localVarHeaderParams = {
|
|
678
|
+
...localVarHeaderParams,
|
|
679
|
+
...options.headers,
|
|
680
|
+
...this.opts.extraHeaders,
|
|
681
|
+
};
|
|
682
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
683
|
+
.filter(([, value]) => value !== undefined)
|
|
684
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
685
|
+
.join('&');
|
|
686
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
642
687
|
let localVarRequestOptions = {
|
|
643
688
|
method: 'GET',
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
689
|
+
headers: { ...localVarHeaderParams },
|
|
690
|
+
};
|
|
691
|
+
let requestOptions = localVarRequestOptions;
|
|
692
|
+
let url = localVarUrl;
|
|
693
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
694
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
695
|
+
url = auth_ApiKeyAuthentication.url;
|
|
696
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
697
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
698
|
+
url = auth_JWTAuthentication.url;
|
|
699
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
700
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
701
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
702
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
703
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
704
|
+
url = auth_OAuth2.url;
|
|
705
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
706
|
+
requestOptions = authDefault.requestOptions;
|
|
707
|
+
url = authDefault.url;
|
|
708
|
+
if (localVarFormParams) {
|
|
709
|
+
delete requestOptions.headers['Content-Type'];
|
|
710
|
+
if (localVarFormParams instanceof FormData) {
|
|
711
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
712
|
+
requestOptions.body = localVarFormParams;
|
|
665
713
|
}
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
675
|
-
reject(new Error(body.error || errString));
|
|
676
|
-
}
|
|
677
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
678
|
-
resolve(body);
|
|
679
|
-
}
|
|
680
|
-
else {
|
|
681
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
682
|
-
reject(errString);
|
|
683
|
-
}
|
|
684
|
-
}
|
|
685
|
-
});
|
|
686
|
-
});
|
|
687
|
-
});
|
|
714
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
715
|
+
// URL-encoded form
|
|
716
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
717
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
const response = await fetch(url, requestOptions);
|
|
721
|
+
return this.handleResponse(response, 'Buffer');
|
|
688
722
|
}
|
|
689
723
|
/**
|
|
690
724
|
* Get information about an anomaly block, such as its dependencies. Use the impulse blocks to find the learnId.
|
|
@@ -697,9 +731,11 @@ class LearnApi {
|
|
|
697
731
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
698
732
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
699
733
|
let localVarQueryParameters = {};
|
|
700
|
-
let localVarHeaderParams =
|
|
701
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
702
|
-
|
|
734
|
+
let localVarHeaderParams = {
|
|
735
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
736
|
+
'Content-Type': 'application/json',
|
|
737
|
+
...this.defaultHeaders,
|
|
738
|
+
};
|
|
703
739
|
const produces = ['application/json'];
|
|
704
740
|
// give precedence to 'application/json'
|
|
705
741
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -708,7 +744,7 @@ class LearnApi {
|
|
|
708
744
|
else {
|
|
709
745
|
localVarHeaderParams.Accept = produces.join(',');
|
|
710
746
|
}
|
|
711
|
-
let localVarFormParams
|
|
747
|
+
let localVarFormParams;
|
|
712
748
|
// verify required parameter 'projectId' is not null or undefined
|
|
713
749
|
if (projectId === null || projectId === undefined) {
|
|
714
750
|
throw new Error('Required parameter projectId was null or undefined when calling getAnomaly.');
|
|
@@ -717,55 +753,51 @@ class LearnApi {
|
|
|
717
753
|
if (learnId === null || learnId === undefined) {
|
|
718
754
|
throw new Error('Required parameter learnId was null or undefined when calling getAnomaly.');
|
|
719
755
|
}
|
|
720
|
-
|
|
721
|
-
|
|
722
|
-
|
|
756
|
+
localVarHeaderParams = {
|
|
757
|
+
...localVarHeaderParams,
|
|
758
|
+
...options.headers,
|
|
759
|
+
...this.opts.extraHeaders,
|
|
760
|
+
};
|
|
761
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
762
|
+
.filter(([, value]) => value !== undefined)
|
|
763
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
764
|
+
.join('&');
|
|
765
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
723
766
|
let localVarRequestOptions = {
|
|
724
767
|
method: 'GET',
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
768
|
+
headers: { ...localVarHeaderParams },
|
|
769
|
+
};
|
|
770
|
+
let requestOptions = localVarRequestOptions;
|
|
771
|
+
let url = localVarUrl;
|
|
772
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
773
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
774
|
+
url = auth_ApiKeyAuthentication.url;
|
|
775
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
776
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
777
|
+
url = auth_JWTAuthentication.url;
|
|
778
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
779
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
780
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
781
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
782
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
783
|
+
url = auth_OAuth2.url;
|
|
784
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
785
|
+
requestOptions = authDefault.requestOptions;
|
|
786
|
+
url = authDefault.url;
|
|
787
|
+
if (localVarFormParams) {
|
|
788
|
+
delete requestOptions.headers['Content-Type'];
|
|
789
|
+
if (localVarFormParams instanceof FormData) {
|
|
790
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
791
|
+
requestOptions.body = localVarFormParams;
|
|
746
792
|
}
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
756
|
-
reject(new Error(body.error || errString));
|
|
757
|
-
}
|
|
758
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
759
|
-
resolve(body);
|
|
760
|
-
}
|
|
761
|
-
else {
|
|
762
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
763
|
-
reject(errString);
|
|
764
|
-
}
|
|
765
|
-
}
|
|
766
|
-
});
|
|
767
|
-
});
|
|
768
|
-
});
|
|
793
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
794
|
+
// URL-encoded form
|
|
795
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
796
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
797
|
+
}
|
|
798
|
+
}
|
|
799
|
+
const response = await fetch(url, requestOptions);
|
|
800
|
+
return this.handleResponse(response, 'AnomalyConfigResponse');
|
|
769
801
|
}
|
|
770
802
|
/**
|
|
771
803
|
* Get metadata about a trained anomaly block. Use the impulse blocks to find the learnId.
|
|
@@ -778,9 +810,11 @@ class LearnApi {
|
|
|
778
810
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
779
811
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
780
812
|
let localVarQueryParameters = {};
|
|
781
|
-
let localVarHeaderParams =
|
|
782
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
783
|
-
|
|
813
|
+
let localVarHeaderParams = {
|
|
814
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
815
|
+
'Content-Type': 'application/json',
|
|
816
|
+
...this.defaultHeaders,
|
|
817
|
+
};
|
|
784
818
|
const produces = ['application/json'];
|
|
785
819
|
// give precedence to 'application/json'
|
|
786
820
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -789,7 +823,7 @@ class LearnApi {
|
|
|
789
823
|
else {
|
|
790
824
|
localVarHeaderParams.Accept = produces.join(',');
|
|
791
825
|
}
|
|
792
|
-
let localVarFormParams
|
|
826
|
+
let localVarFormParams;
|
|
793
827
|
// verify required parameter 'projectId' is not null or undefined
|
|
794
828
|
if (projectId === null || projectId === undefined) {
|
|
795
829
|
throw new Error('Required parameter projectId was null or undefined when calling getAnomalyMetadata.');
|
|
@@ -798,55 +832,51 @@ class LearnApi {
|
|
|
798
832
|
if (learnId === null || learnId === undefined) {
|
|
799
833
|
throw new Error('Required parameter learnId was null or undefined when calling getAnomalyMetadata.');
|
|
800
834
|
}
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
835
|
+
localVarHeaderParams = {
|
|
836
|
+
...localVarHeaderParams,
|
|
837
|
+
...options.headers,
|
|
838
|
+
...this.opts.extraHeaders,
|
|
839
|
+
};
|
|
840
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
841
|
+
.filter(([, value]) => value !== undefined)
|
|
842
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
843
|
+
.join('&');
|
|
844
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
804
845
|
let localVarRequestOptions = {
|
|
805
846
|
method: 'GET',
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
847
|
+
headers: { ...localVarHeaderParams },
|
|
848
|
+
};
|
|
849
|
+
let requestOptions = localVarRequestOptions;
|
|
850
|
+
let url = localVarUrl;
|
|
851
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
852
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
853
|
+
url = auth_ApiKeyAuthentication.url;
|
|
854
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
855
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
856
|
+
url = auth_JWTAuthentication.url;
|
|
857
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
858
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
859
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
860
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
861
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
862
|
+
url = auth_OAuth2.url;
|
|
863
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
864
|
+
requestOptions = authDefault.requestOptions;
|
|
865
|
+
url = authDefault.url;
|
|
866
|
+
if (localVarFormParams) {
|
|
867
|
+
delete requestOptions.headers['Content-Type'];
|
|
868
|
+
if (localVarFormParams instanceof FormData) {
|
|
869
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
870
|
+
requestOptions.body = localVarFormParams;
|
|
827
871
|
}
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
837
|
-
reject(new Error(body.error || errString));
|
|
838
|
-
}
|
|
839
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
840
|
-
resolve(body);
|
|
841
|
-
}
|
|
842
|
-
else {
|
|
843
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
844
|
-
reject(errString);
|
|
845
|
-
}
|
|
846
|
-
}
|
|
847
|
-
});
|
|
848
|
-
});
|
|
849
|
-
});
|
|
872
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
873
|
+
// URL-encoded form
|
|
874
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
875
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
876
|
+
}
|
|
877
|
+
}
|
|
878
|
+
const response = await fetch(url, requestOptions);
|
|
879
|
+
return this.handleResponse(response, 'AnomalyModelMetadataResponse');
|
|
850
880
|
}
|
|
851
881
|
/**
|
|
852
882
|
* Get raw model metadata of the Gaussian mixture model (GMM) for a trained anomaly block. Use the impulse blocks to find the learnId.
|
|
@@ -859,9 +889,11 @@ class LearnApi {
|
|
|
859
889
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
860
890
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
861
891
|
let localVarQueryParameters = {};
|
|
862
|
-
let localVarHeaderParams =
|
|
863
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
864
|
-
|
|
892
|
+
let localVarHeaderParams = {
|
|
893
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
894
|
+
'Content-Type': 'application/json',
|
|
895
|
+
...this.defaultHeaders,
|
|
896
|
+
};
|
|
865
897
|
const produces = ['application/json'];
|
|
866
898
|
// give precedence to 'application/json'
|
|
867
899
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -870,7 +902,7 @@ class LearnApi {
|
|
|
870
902
|
else {
|
|
871
903
|
localVarHeaderParams.Accept = produces.join(',');
|
|
872
904
|
}
|
|
873
|
-
let localVarFormParams
|
|
905
|
+
let localVarFormParams;
|
|
874
906
|
// verify required parameter 'projectId' is not null or undefined
|
|
875
907
|
if (projectId === null || projectId === undefined) {
|
|
876
908
|
throw new Error('Required parameter projectId was null or undefined when calling getGmmMetadata.');
|
|
@@ -879,55 +911,51 @@ class LearnApi {
|
|
|
879
911
|
if (learnId === null || learnId === undefined) {
|
|
880
912
|
throw new Error('Required parameter learnId was null or undefined when calling getGmmMetadata.');
|
|
881
913
|
}
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
914
|
+
localVarHeaderParams = {
|
|
915
|
+
...localVarHeaderParams,
|
|
916
|
+
...options.headers,
|
|
917
|
+
...this.opts.extraHeaders,
|
|
918
|
+
};
|
|
919
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
920
|
+
.filter(([, value]) => value !== undefined)
|
|
921
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
922
|
+
.join('&');
|
|
923
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
885
924
|
let localVarRequestOptions = {
|
|
886
925
|
method: 'GET',
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
926
|
+
headers: { ...localVarHeaderParams },
|
|
927
|
+
};
|
|
928
|
+
let requestOptions = localVarRequestOptions;
|
|
929
|
+
let url = localVarUrl;
|
|
930
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
931
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
932
|
+
url = auth_ApiKeyAuthentication.url;
|
|
933
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
934
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
935
|
+
url = auth_JWTAuthentication.url;
|
|
936
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
937
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
938
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
939
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
940
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
941
|
+
url = auth_OAuth2.url;
|
|
942
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
943
|
+
requestOptions = authDefault.requestOptions;
|
|
944
|
+
url = authDefault.url;
|
|
945
|
+
if (localVarFormParams) {
|
|
946
|
+
delete requestOptions.headers['Content-Type'];
|
|
947
|
+
if (localVarFormParams instanceof FormData) {
|
|
948
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
949
|
+
requestOptions.body = localVarFormParams;
|
|
908
950
|
}
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
918
|
-
reject(new Error(body.error || errString));
|
|
919
|
-
}
|
|
920
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
921
|
-
resolve(body);
|
|
922
|
-
}
|
|
923
|
-
else {
|
|
924
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
925
|
-
reject(errString);
|
|
926
|
-
}
|
|
927
|
-
}
|
|
928
|
-
});
|
|
929
|
-
});
|
|
930
|
-
});
|
|
951
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
952
|
+
// URL-encoded form
|
|
953
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
954
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
955
|
+
}
|
|
956
|
+
}
|
|
957
|
+
const response = await fetch(url, requestOptions);
|
|
958
|
+
return this.handleResponse(response, 'AnomalyGmmMetadataResponse');
|
|
931
959
|
}
|
|
932
960
|
/**
|
|
933
961
|
* Get information about a Keras block, such as its dependencies. Use the impulse blocks to find the learnId.
|
|
@@ -940,9 +968,11 @@ class LearnApi {
|
|
|
940
968
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
941
969
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
942
970
|
let localVarQueryParameters = {};
|
|
943
|
-
let localVarHeaderParams =
|
|
944
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
945
|
-
|
|
971
|
+
let localVarHeaderParams = {
|
|
972
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
973
|
+
'Content-Type': 'application/json',
|
|
974
|
+
...this.defaultHeaders,
|
|
975
|
+
};
|
|
946
976
|
const produces = ['application/json'];
|
|
947
977
|
// give precedence to 'application/json'
|
|
948
978
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -951,7 +981,7 @@ class LearnApi {
|
|
|
951
981
|
else {
|
|
952
982
|
localVarHeaderParams.Accept = produces.join(',');
|
|
953
983
|
}
|
|
954
|
-
let localVarFormParams
|
|
984
|
+
let localVarFormParams;
|
|
955
985
|
// verify required parameter 'projectId' is not null or undefined
|
|
956
986
|
if (projectId === null || projectId === undefined) {
|
|
957
987
|
throw new Error('Required parameter projectId was null or undefined when calling getKeras.');
|
|
@@ -960,55 +990,51 @@ class LearnApi {
|
|
|
960
990
|
if (learnId === null || learnId === undefined) {
|
|
961
991
|
throw new Error('Required parameter learnId was null or undefined when calling getKeras.');
|
|
962
992
|
}
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
993
|
+
localVarHeaderParams = {
|
|
994
|
+
...localVarHeaderParams,
|
|
995
|
+
...options.headers,
|
|
996
|
+
...this.opts.extraHeaders,
|
|
997
|
+
};
|
|
998
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
999
|
+
.filter(([, value]) => value !== undefined)
|
|
1000
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1001
|
+
.join('&');
|
|
1002
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
966
1003
|
let localVarRequestOptions = {
|
|
967
1004
|
method: 'GET',
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
1005
|
+
headers: { ...localVarHeaderParams },
|
|
1006
|
+
};
|
|
1007
|
+
let requestOptions = localVarRequestOptions;
|
|
1008
|
+
let url = localVarUrl;
|
|
1009
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1010
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1011
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1012
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1013
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1014
|
+
url = auth_JWTAuthentication.url;
|
|
1015
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1016
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1017
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1018
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1019
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1020
|
+
url = auth_OAuth2.url;
|
|
1021
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1022
|
+
requestOptions = authDefault.requestOptions;
|
|
1023
|
+
url = authDefault.url;
|
|
1024
|
+
if (localVarFormParams) {
|
|
1025
|
+
delete requestOptions.headers['Content-Type'];
|
|
1026
|
+
if (localVarFormParams instanceof FormData) {
|
|
1027
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1028
|
+
requestOptions.body = localVarFormParams;
|
|
989
1029
|
}
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
999
|
-
reject(new Error(body.error || errString));
|
|
1000
|
-
}
|
|
1001
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1002
|
-
resolve(body);
|
|
1003
|
-
}
|
|
1004
|
-
else {
|
|
1005
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1006
|
-
reject(errString);
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
});
|
|
1010
|
-
});
|
|
1011
|
-
});
|
|
1030
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1031
|
+
// URL-encoded form
|
|
1032
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1033
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
const response = await fetch(url, requestOptions);
|
|
1037
|
+
return this.handleResponse(response, 'KerasResponse');
|
|
1012
1038
|
}
|
|
1013
1039
|
/**
|
|
1014
1040
|
* t-SNE2 output of the raw dataset using embeddings from this Keras block
|
|
@@ -1021,9 +1047,11 @@ class LearnApi {
|
|
|
1021
1047
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1022
1048
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1023
1049
|
let localVarQueryParameters = {};
|
|
1024
|
-
let localVarHeaderParams =
|
|
1025
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1026
|
-
|
|
1050
|
+
let localVarHeaderParams = {
|
|
1051
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1052
|
+
'Content-Type': 'application/json',
|
|
1053
|
+
...this.defaultHeaders,
|
|
1054
|
+
};
|
|
1027
1055
|
const produces = ['application/json'];
|
|
1028
1056
|
// give precedence to 'application/json'
|
|
1029
1057
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1032,7 +1060,7 @@ class LearnApi {
|
|
|
1032
1060
|
else {
|
|
1033
1061
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1034
1062
|
}
|
|
1035
|
-
let localVarFormParams
|
|
1063
|
+
let localVarFormParams;
|
|
1036
1064
|
// verify required parameter 'projectId' is not null or undefined
|
|
1037
1065
|
if (projectId === null || projectId === undefined) {
|
|
1038
1066
|
throw new Error('Required parameter projectId was null or undefined when calling getKerasDataExplorerFeatures.');
|
|
@@ -1041,55 +1069,51 @@ class LearnApi {
|
|
|
1041
1069
|
if (learnId === null || learnId === undefined) {
|
|
1042
1070
|
throw new Error('Required parameter learnId was null or undefined when calling getKerasDataExplorerFeatures.');
|
|
1043
1071
|
}
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1072
|
+
localVarHeaderParams = {
|
|
1073
|
+
...localVarHeaderParams,
|
|
1074
|
+
...options.headers,
|
|
1075
|
+
...this.opts.extraHeaders,
|
|
1076
|
+
};
|
|
1077
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1078
|
+
.filter(([, value]) => value !== undefined)
|
|
1079
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1080
|
+
.join('&');
|
|
1081
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1047
1082
|
let localVarRequestOptions = {
|
|
1048
1083
|
method: 'GET',
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1084
|
+
headers: { ...localVarHeaderParams },
|
|
1085
|
+
};
|
|
1086
|
+
let requestOptions = localVarRequestOptions;
|
|
1087
|
+
let url = localVarUrl;
|
|
1088
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1089
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1090
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1091
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1092
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1093
|
+
url = auth_JWTAuthentication.url;
|
|
1094
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1095
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1096
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1097
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1098
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1099
|
+
url = auth_OAuth2.url;
|
|
1100
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1101
|
+
requestOptions = authDefault.requestOptions;
|
|
1102
|
+
url = authDefault.url;
|
|
1103
|
+
if (localVarFormParams) {
|
|
1104
|
+
delete requestOptions.headers['Content-Type'];
|
|
1105
|
+
if (localVarFormParams instanceof FormData) {
|
|
1106
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1107
|
+
requestOptions.body = localVarFormParams;
|
|
1070
1108
|
}
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1080
|
-
reject(new Error(body.error || errString));
|
|
1081
|
-
}
|
|
1082
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1083
|
-
resolve(body);
|
|
1084
|
-
}
|
|
1085
|
-
else {
|
|
1086
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1087
|
-
reject(errString);
|
|
1088
|
-
}
|
|
1089
|
-
}
|
|
1090
|
-
});
|
|
1091
|
-
});
|
|
1092
|
-
});
|
|
1109
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1110
|
+
// URL-encoded form
|
|
1111
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1112
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1113
|
+
}
|
|
1114
|
+
}
|
|
1115
|
+
const response = await fetch(url, requestOptions);
|
|
1116
|
+
return this.handleResponse(response, 'GetDataExplorerFeaturesResponse');
|
|
1093
1117
|
}
|
|
1094
1118
|
/**
|
|
1095
1119
|
* Get metadata about a trained Keras block. Use the impulse blocks to find the learnId.
|
|
@@ -1103,9 +1127,11 @@ class LearnApi {
|
|
|
1103
1127
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1104
1128
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1105
1129
|
let localVarQueryParameters = {};
|
|
1106
|
-
let localVarHeaderParams =
|
|
1107
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1108
|
-
|
|
1130
|
+
let localVarHeaderParams = {
|
|
1131
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1132
|
+
'Content-Type': 'application/json',
|
|
1133
|
+
...this.defaultHeaders,
|
|
1134
|
+
};
|
|
1109
1135
|
const produces = ['application/json'];
|
|
1110
1136
|
// give precedence to 'application/json'
|
|
1111
1137
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1114,7 +1140,7 @@ class LearnApi {
|
|
|
1114
1140
|
else {
|
|
1115
1141
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1116
1142
|
}
|
|
1117
|
-
let localVarFormParams
|
|
1143
|
+
let localVarFormParams;
|
|
1118
1144
|
// verify required parameter 'projectId' is not null or undefined
|
|
1119
1145
|
if (projectId === null || projectId === undefined) {
|
|
1120
1146
|
throw new Error('Required parameter projectId was null or undefined when calling getKerasMetadata.');
|
|
@@ -1126,55 +1152,51 @@ class LearnApi {
|
|
|
1126
1152
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeLabels) !== undefined) {
|
|
1127
1153
|
localVarQueryParameters['excludeLabels'] = models_1.ObjectSerializer.serialize(queryParams.excludeLabels, "boolean");
|
|
1128
1154
|
}
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
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}` : '');
|
|
1132
1165
|
let localVarRequestOptions = {
|
|
1133
1166
|
method: 'GET',
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1167
|
+
headers: { ...localVarHeaderParams },
|
|
1168
|
+
};
|
|
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;
|
|
1155
1191
|
}
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1165
|
-
reject(new Error(body.error || errString));
|
|
1166
|
-
}
|
|
1167
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1168
|
-
resolve(body);
|
|
1169
|
-
}
|
|
1170
|
-
else {
|
|
1171
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1172
|
-
reject(errString);
|
|
1173
|
-
}
|
|
1174
|
-
}
|
|
1175
|
-
});
|
|
1176
|
-
});
|
|
1177
|
-
});
|
|
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, 'KerasModelMetadataResponse');
|
|
1178
1200
|
}
|
|
1179
1201
|
/**
|
|
1180
1202
|
* Download the processed data for this learning block. This is data already processed by the signal processing blocks.
|
|
@@ -1187,9 +1209,11 @@ class LearnApi {
|
|
|
1187
1209
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1188
1210
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1189
1211
|
let localVarQueryParameters = {};
|
|
1190
|
-
let localVarHeaderParams =
|
|
1191
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1192
|
-
|
|
1212
|
+
let localVarHeaderParams = {
|
|
1213
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1214
|
+
'Content-Type': 'application/json',
|
|
1215
|
+
...this.defaultHeaders,
|
|
1216
|
+
};
|
|
1193
1217
|
const produces = ['application/octet-stream'];
|
|
1194
1218
|
// give precedence to 'application/json'
|
|
1195
1219
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1198,7 +1222,7 @@ class LearnApi {
|
|
|
1198
1222
|
else {
|
|
1199
1223
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1200
1224
|
}
|
|
1201
|
-
let localVarFormParams
|
|
1225
|
+
let localVarFormParams;
|
|
1202
1226
|
// verify required parameter 'projectId' is not null or undefined
|
|
1203
1227
|
if (projectId === null || projectId === undefined) {
|
|
1204
1228
|
throw new Error('Required parameter projectId was null or undefined when calling getLearnXData.');
|
|
@@ -1207,55 +1231,51 @@ class LearnApi {
|
|
|
1207
1231
|
if (learnId === null || learnId === undefined) {
|
|
1208
1232
|
throw new Error('Required parameter learnId was null or undefined when calling getLearnXData.');
|
|
1209
1233
|
}
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1234
|
+
localVarHeaderParams = {
|
|
1235
|
+
...localVarHeaderParams,
|
|
1236
|
+
...options.headers,
|
|
1237
|
+
...this.opts.extraHeaders,
|
|
1238
|
+
};
|
|
1239
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1240
|
+
.filter(([, value]) => value !== undefined)
|
|
1241
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1242
|
+
.join('&');
|
|
1243
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1213
1244
|
let localVarRequestOptions = {
|
|
1214
1245
|
method: 'GET',
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1230
|
-
|
|
1231
|
-
|
|
1232
|
-
|
|
1233
|
-
|
|
1234
|
-
|
|
1235
|
-
|
|
1246
|
+
headers: { ...localVarHeaderParams },
|
|
1247
|
+
};
|
|
1248
|
+
let requestOptions = localVarRequestOptions;
|
|
1249
|
+
let url = localVarUrl;
|
|
1250
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1251
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1252
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1253
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1254
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1255
|
+
url = auth_JWTAuthentication.url;
|
|
1256
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1257
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1258
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1259
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1260
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1261
|
+
url = auth_OAuth2.url;
|
|
1262
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1263
|
+
requestOptions = authDefault.requestOptions;
|
|
1264
|
+
url = authDefault.url;
|
|
1265
|
+
if (localVarFormParams) {
|
|
1266
|
+
delete requestOptions.headers['Content-Type'];
|
|
1267
|
+
if (localVarFormParams instanceof FormData) {
|
|
1268
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1269
|
+
requestOptions.body = localVarFormParams;
|
|
1236
1270
|
}
|
|
1237
|
-
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1246
|
-
reject(new Error(body.error || errString));
|
|
1247
|
-
}
|
|
1248
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1249
|
-
resolve(body);
|
|
1250
|
-
}
|
|
1251
|
-
else {
|
|
1252
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1253
|
-
reject(errString);
|
|
1254
|
-
}
|
|
1255
|
-
}
|
|
1256
|
-
});
|
|
1257
|
-
});
|
|
1258
|
-
});
|
|
1271
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1272
|
+
// URL-encoded form
|
|
1273
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1274
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1275
|
+
}
|
|
1276
|
+
}
|
|
1277
|
+
const response = await fetch(url, requestOptions);
|
|
1278
|
+
return this.handleResponse(response, 'Buffer');
|
|
1259
1279
|
}
|
|
1260
1280
|
/**
|
|
1261
1281
|
* Download the labels for this learning block. This is data already processed by the signal processing blocks. Not all blocks support this function. If so, a GenericApiResponse is returned with an error message.
|
|
@@ -1268,9 +1288,11 @@ class LearnApi {
|
|
|
1268
1288
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1269
1289
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1270
1290
|
let localVarQueryParameters = {};
|
|
1271
|
-
let localVarHeaderParams =
|
|
1272
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1273
|
-
|
|
1291
|
+
let localVarHeaderParams = {
|
|
1292
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1293
|
+
'Content-Type': 'application/json',
|
|
1294
|
+
...this.defaultHeaders,
|
|
1295
|
+
};
|
|
1274
1296
|
const produces = ['application/octet-stream'];
|
|
1275
1297
|
// give precedence to 'application/json'
|
|
1276
1298
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1279,7 +1301,7 @@ class LearnApi {
|
|
|
1279
1301
|
else {
|
|
1280
1302
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1281
1303
|
}
|
|
1282
|
-
let localVarFormParams
|
|
1304
|
+
let localVarFormParams;
|
|
1283
1305
|
// verify required parameter 'projectId' is not null or undefined
|
|
1284
1306
|
if (projectId === null || projectId === undefined) {
|
|
1285
1307
|
throw new Error('Required parameter projectId was null or undefined when calling getLearnYData.');
|
|
@@ -1288,55 +1310,51 @@ class LearnApi {
|
|
|
1288
1310
|
if (learnId === null || learnId === undefined) {
|
|
1289
1311
|
throw new Error('Required parameter learnId was null or undefined when calling getLearnYData.');
|
|
1290
1312
|
}
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1313
|
+
localVarHeaderParams = {
|
|
1314
|
+
...localVarHeaderParams,
|
|
1315
|
+
...options.headers,
|
|
1316
|
+
...this.opts.extraHeaders,
|
|
1317
|
+
};
|
|
1318
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1319
|
+
.filter(([, value]) => value !== undefined)
|
|
1320
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1321
|
+
.join('&');
|
|
1322
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1294
1323
|
let localVarRequestOptions = {
|
|
1295
1324
|
method: 'GET',
|
|
1296
|
-
|
|
1297
|
-
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1312
|
-
|
|
1313
|
-
|
|
1314
|
-
|
|
1315
|
-
|
|
1316
|
-
|
|
1325
|
+
headers: { ...localVarHeaderParams },
|
|
1326
|
+
};
|
|
1327
|
+
let requestOptions = localVarRequestOptions;
|
|
1328
|
+
let url = localVarUrl;
|
|
1329
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1330
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1331
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1332
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1333
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1334
|
+
url = auth_JWTAuthentication.url;
|
|
1335
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1336
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1337
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1338
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1339
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1340
|
+
url = auth_OAuth2.url;
|
|
1341
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1342
|
+
requestOptions = authDefault.requestOptions;
|
|
1343
|
+
url = authDefault.url;
|
|
1344
|
+
if (localVarFormParams) {
|
|
1345
|
+
delete requestOptions.headers['Content-Type'];
|
|
1346
|
+
if (localVarFormParams instanceof FormData) {
|
|
1347
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1348
|
+
requestOptions.body = localVarFormParams;
|
|
1317
1349
|
}
|
|
1318
|
-
|
|
1319
|
-
|
|
1320
|
-
|
|
1321
|
-
|
|
1322
|
-
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
|
|
1326
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1327
|
-
reject(new Error(body.error || errString));
|
|
1328
|
-
}
|
|
1329
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1330
|
-
resolve(body);
|
|
1331
|
-
}
|
|
1332
|
-
else {
|
|
1333
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1334
|
-
reject(errString);
|
|
1335
|
-
}
|
|
1336
|
-
}
|
|
1337
|
-
});
|
|
1338
|
-
});
|
|
1339
|
-
});
|
|
1350
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1351
|
+
// URL-encoded form
|
|
1352
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1353
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1354
|
+
}
|
|
1355
|
+
}
|
|
1356
|
+
const response = await fetch(url, requestOptions);
|
|
1357
|
+
return this.handleResponse(response, 'Buffer');
|
|
1340
1358
|
}
|
|
1341
1359
|
/**
|
|
1342
1360
|
* Receive info back about the earlier uploaded pretrained model (via `uploadPretrainedModel`) input/output tensors. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
|
|
@@ -1348,9 +1366,11 @@ class LearnApi {
|
|
|
1348
1366
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model'
|
|
1349
1367
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1350
1368
|
let localVarQueryParameters = {};
|
|
1351
|
-
let localVarHeaderParams =
|
|
1352
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1353
|
-
|
|
1369
|
+
let localVarHeaderParams = {
|
|
1370
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1371
|
+
'Content-Type': 'application/json',
|
|
1372
|
+
...this.defaultHeaders,
|
|
1373
|
+
};
|
|
1354
1374
|
const produces = ['application/json'];
|
|
1355
1375
|
// give precedence to 'application/json'
|
|
1356
1376
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1359,7 +1379,7 @@ class LearnApi {
|
|
|
1359
1379
|
else {
|
|
1360
1380
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1361
1381
|
}
|
|
1362
|
-
let localVarFormParams
|
|
1382
|
+
let localVarFormParams;
|
|
1363
1383
|
// verify required parameter 'projectId' is not null or undefined
|
|
1364
1384
|
if (projectId === null || projectId === undefined) {
|
|
1365
1385
|
throw new Error('Required parameter projectId was null or undefined when calling getPretrainedModelInfo.');
|
|
@@ -1367,55 +1387,51 @@ class LearnApi {
|
|
|
1367
1387
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
1368
1388
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
1369
1389
|
}
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1390
|
+
localVarHeaderParams = {
|
|
1391
|
+
...localVarHeaderParams,
|
|
1392
|
+
...options.headers,
|
|
1393
|
+
...this.opts.extraHeaders,
|
|
1394
|
+
};
|
|
1395
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1396
|
+
.filter(([, value]) => value !== undefined)
|
|
1397
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1398
|
+
.join('&');
|
|
1399
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1373
1400
|
let localVarRequestOptions = {
|
|
1374
1401
|
method: 'GET',
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1384
|
-
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
|
|
1394
|
-
|
|
1395
|
-
|
|
1402
|
+
headers: { ...localVarHeaderParams },
|
|
1403
|
+
};
|
|
1404
|
+
let requestOptions = localVarRequestOptions;
|
|
1405
|
+
let url = localVarUrl;
|
|
1406
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1407
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1408
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1409
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1410
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1411
|
+
url = auth_JWTAuthentication.url;
|
|
1412
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1413
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1414
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1415
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1416
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1417
|
+
url = auth_OAuth2.url;
|
|
1418
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1419
|
+
requestOptions = authDefault.requestOptions;
|
|
1420
|
+
url = authDefault.url;
|
|
1421
|
+
if (localVarFormParams) {
|
|
1422
|
+
delete requestOptions.headers['Content-Type'];
|
|
1423
|
+
if (localVarFormParams instanceof FormData) {
|
|
1424
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1425
|
+
requestOptions.body = localVarFormParams;
|
|
1396
1426
|
}
|
|
1397
|
-
|
|
1398
|
-
|
|
1399
|
-
|
|
1400
|
-
|
|
1401
|
-
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1406
|
-
reject(new Error(body.error || errString));
|
|
1407
|
-
}
|
|
1408
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1409
|
-
resolve(body);
|
|
1410
|
-
}
|
|
1411
|
-
else {
|
|
1412
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1413
|
-
reject(errString);
|
|
1414
|
-
}
|
|
1415
|
-
}
|
|
1416
|
-
});
|
|
1417
|
-
});
|
|
1418
|
-
});
|
|
1427
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1428
|
+
// URL-encoded form
|
|
1429
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1430
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1431
|
+
}
|
|
1432
|
+
}
|
|
1433
|
+
const response = await fetch(url, requestOptions);
|
|
1434
|
+
return this.handleResponse(response, 'GetPretrainedModelResponse');
|
|
1419
1435
|
}
|
|
1420
1436
|
/**
|
|
1421
1437
|
* Get config for a VLM learn block, including prompt and other model parameters
|
|
@@ -1428,9 +1444,11 @@ class LearnApi {
|
|
|
1428
1444
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1429
1445
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1430
1446
|
let localVarQueryParameters = {};
|
|
1431
|
-
let localVarHeaderParams =
|
|
1432
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1433
|
-
|
|
1447
|
+
let localVarHeaderParams = {
|
|
1448
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1449
|
+
'Content-Type': 'application/json',
|
|
1450
|
+
...this.defaultHeaders,
|
|
1451
|
+
};
|
|
1434
1452
|
const produces = ['application/json'];
|
|
1435
1453
|
// give precedence to 'application/json'
|
|
1436
1454
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1439,7 +1457,7 @@ class LearnApi {
|
|
|
1439
1457
|
else {
|
|
1440
1458
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1441
1459
|
}
|
|
1442
|
-
let localVarFormParams
|
|
1460
|
+
let localVarFormParams;
|
|
1443
1461
|
// verify required parameter 'projectId' is not null or undefined
|
|
1444
1462
|
if (projectId === null || projectId === undefined) {
|
|
1445
1463
|
throw new Error('Required parameter projectId was null or undefined when calling getVlmConfig.');
|
|
@@ -1448,55 +1466,51 @@ class LearnApi {
|
|
|
1448
1466
|
if (learnId === null || learnId === undefined) {
|
|
1449
1467
|
throw new Error('Required parameter learnId was null or undefined when calling getVlmConfig.');
|
|
1450
1468
|
}
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1469
|
+
localVarHeaderParams = {
|
|
1470
|
+
...localVarHeaderParams,
|
|
1471
|
+
...options.headers,
|
|
1472
|
+
...this.opts.extraHeaders,
|
|
1473
|
+
};
|
|
1474
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1475
|
+
.filter(([, value]) => value !== undefined)
|
|
1476
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1477
|
+
.join('&');
|
|
1478
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1454
1479
|
let localVarRequestOptions = {
|
|
1455
1480
|
method: 'GET',
|
|
1456
|
-
|
|
1457
|
-
|
|
1458
|
-
|
|
1459
|
-
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1475
|
-
|
|
1476
|
-
|
|
1481
|
+
headers: { ...localVarHeaderParams },
|
|
1482
|
+
};
|
|
1483
|
+
let requestOptions = localVarRequestOptions;
|
|
1484
|
+
let url = localVarUrl;
|
|
1485
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1486
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1487
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1488
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1489
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1490
|
+
url = auth_JWTAuthentication.url;
|
|
1491
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1492
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1493
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1494
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1495
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1496
|
+
url = auth_OAuth2.url;
|
|
1497
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1498
|
+
requestOptions = authDefault.requestOptions;
|
|
1499
|
+
url = authDefault.url;
|
|
1500
|
+
if (localVarFormParams) {
|
|
1501
|
+
delete requestOptions.headers['Content-Type'];
|
|
1502
|
+
if (localVarFormParams instanceof FormData) {
|
|
1503
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1504
|
+
requestOptions.body = localVarFormParams;
|
|
1477
1505
|
}
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1487
|
-
reject(new Error(body.error || errString));
|
|
1488
|
-
}
|
|
1489
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1490
|
-
resolve(body);
|
|
1491
|
-
}
|
|
1492
|
-
else {
|
|
1493
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1494
|
-
reject(errString);
|
|
1495
|
-
}
|
|
1496
|
-
}
|
|
1497
|
-
});
|
|
1498
|
-
});
|
|
1499
|
-
});
|
|
1506
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1507
|
+
// URL-encoded form
|
|
1508
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1509
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1510
|
+
}
|
|
1511
|
+
}
|
|
1512
|
+
const response = await fetch(url, requestOptions);
|
|
1513
|
+
return this.handleResponse(response, 'VlmConfigResponse');
|
|
1500
1514
|
}
|
|
1501
1515
|
/**
|
|
1502
1516
|
* Returns the latency, RAM and ROM used for the pretrained model - upload first via `uploadPretrainedModel`. This is using the project\'s selected latency device. Updates are streamed over the websocket API (or can be retrieved through the /stdout endpoint). Use getProfileTfliteJobResult to get the results when the job is completed.
|
|
@@ -1508,9 +1522,11 @@ class LearnApi {
|
|
|
1508
1522
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/profile'
|
|
1509
1523
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1510
1524
|
let localVarQueryParameters = {};
|
|
1511
|
-
let localVarHeaderParams =
|
|
1512
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1513
|
-
|
|
1525
|
+
let localVarHeaderParams = {
|
|
1526
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1527
|
+
'Content-Type': 'application/json',
|
|
1528
|
+
...this.defaultHeaders,
|
|
1529
|
+
};
|
|
1514
1530
|
const produces = ['application/json'];
|
|
1515
1531
|
// give precedence to 'application/json'
|
|
1516
1532
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1519,7 +1535,7 @@ class LearnApi {
|
|
|
1519
1535
|
else {
|
|
1520
1536
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1521
1537
|
}
|
|
1522
|
-
let localVarFormParams
|
|
1538
|
+
let localVarFormParams;
|
|
1523
1539
|
// verify required parameter 'projectId' is not null or undefined
|
|
1524
1540
|
if (projectId === null || projectId === undefined) {
|
|
1525
1541
|
throw new Error('Required parameter projectId was null or undefined when calling profilePretrainedModel.');
|
|
@@ -1527,55 +1543,51 @@ class LearnApi {
|
|
|
1527
1543
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
1528
1544
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
1529
1545
|
}
|
|
1530
|
-
|
|
1531
|
-
|
|
1532
|
-
|
|
1546
|
+
localVarHeaderParams = {
|
|
1547
|
+
...localVarHeaderParams,
|
|
1548
|
+
...options.headers,
|
|
1549
|
+
...this.opts.extraHeaders,
|
|
1550
|
+
};
|
|
1551
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1552
|
+
.filter(([, value]) => value !== undefined)
|
|
1553
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1554
|
+
.join('&');
|
|
1555
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1533
1556
|
let localVarRequestOptions = {
|
|
1534
1557
|
method: 'POST',
|
|
1535
|
-
|
|
1536
|
-
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1549
|
-
|
|
1550
|
-
|
|
1551
|
-
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
|
|
1555
|
-
|
|
1558
|
+
headers: { ...localVarHeaderParams },
|
|
1559
|
+
};
|
|
1560
|
+
let requestOptions = localVarRequestOptions;
|
|
1561
|
+
let url = localVarUrl;
|
|
1562
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1563
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1564
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1565
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1566
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1567
|
+
url = auth_JWTAuthentication.url;
|
|
1568
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1569
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1570
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1571
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1572
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1573
|
+
url = auth_OAuth2.url;
|
|
1574
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1575
|
+
requestOptions = authDefault.requestOptions;
|
|
1576
|
+
url = authDefault.url;
|
|
1577
|
+
if (localVarFormParams) {
|
|
1578
|
+
delete requestOptions.headers['Content-Type'];
|
|
1579
|
+
if (localVarFormParams instanceof FormData) {
|
|
1580
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1581
|
+
requestOptions.body = localVarFormParams;
|
|
1556
1582
|
}
|
|
1557
|
-
|
|
1558
|
-
|
|
1559
|
-
|
|
1560
|
-
|
|
1561
|
-
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1566
|
-
reject(new Error(body.error || errString));
|
|
1567
|
-
}
|
|
1568
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1569
|
-
resolve(body);
|
|
1570
|
-
}
|
|
1571
|
-
else {
|
|
1572
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1573
|
-
reject(errString);
|
|
1574
|
-
}
|
|
1575
|
-
}
|
|
1576
|
-
});
|
|
1577
|
-
});
|
|
1578
|
-
});
|
|
1583
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1584
|
+
// URL-encoded form
|
|
1585
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1586
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1587
|
+
}
|
|
1588
|
+
}
|
|
1589
|
+
const response = await fetch(url, requestOptions);
|
|
1590
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
1579
1591
|
}
|
|
1580
1592
|
/**
|
|
1581
1593
|
* Save input / model configuration for a pretrained model. This overrides the current impulse. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
|
|
@@ -1588,9 +1600,11 @@ class LearnApi {
|
|
|
1588
1600
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/save'
|
|
1589
1601
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1590
1602
|
let localVarQueryParameters = {};
|
|
1591
|
-
let localVarHeaderParams =
|
|
1592
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1593
|
-
|
|
1603
|
+
let localVarHeaderParams = {
|
|
1604
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1605
|
+
'Content-Type': 'application/json',
|
|
1606
|
+
...this.defaultHeaders,
|
|
1607
|
+
};
|
|
1594
1608
|
const produces = ['application/json'];
|
|
1595
1609
|
// give precedence to 'application/json'
|
|
1596
1610
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1599,7 +1613,7 @@ class LearnApi {
|
|
|
1599
1613
|
else {
|
|
1600
1614
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1601
1615
|
}
|
|
1602
|
-
let localVarFormParams
|
|
1616
|
+
let localVarFormParams;
|
|
1603
1617
|
// verify required parameter 'projectId' is not null or undefined
|
|
1604
1618
|
if (projectId === null || projectId === undefined) {
|
|
1605
1619
|
throw new Error('Required parameter projectId was null or undefined when calling savePretrainedModelParameters.');
|
|
@@ -1611,56 +1625,52 @@ class LearnApi {
|
|
|
1611
1625
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
1612
1626
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
1613
1627
|
}
|
|
1614
|
-
|
|
1615
|
-
|
|
1616
|
-
|
|
1628
|
+
localVarHeaderParams = {
|
|
1629
|
+
...localVarHeaderParams,
|
|
1630
|
+
...options.headers,
|
|
1631
|
+
...this.opts.extraHeaders,
|
|
1632
|
+
};
|
|
1633
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1634
|
+
.filter(([, value]) => value !== undefined)
|
|
1635
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1636
|
+
.join('&');
|
|
1637
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1617
1638
|
let localVarRequestOptions = {
|
|
1618
1639
|
method: 'POST',
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1640
|
+
headers: { ...localVarHeaderParams },
|
|
1641
|
+
};
|
|
1642
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(savePretrainedModelRequest, "SavePretrainedModelRequest"));
|
|
1643
|
+
let requestOptions = localVarRequestOptions;
|
|
1644
|
+
let url = localVarUrl;
|
|
1645
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1646
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1647
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1648
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1649
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1650
|
+
url = auth_JWTAuthentication.url;
|
|
1651
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1652
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1653
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1654
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1655
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1656
|
+
url = auth_OAuth2.url;
|
|
1657
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1658
|
+
requestOptions = authDefault.requestOptions;
|
|
1659
|
+
url = authDefault.url;
|
|
1660
|
+
if (localVarFormParams) {
|
|
1661
|
+
delete requestOptions.headers['Content-Type'];
|
|
1662
|
+
if (localVarFormParams instanceof FormData) {
|
|
1663
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1664
|
+
requestOptions.body = localVarFormParams;
|
|
1641
1665
|
}
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1651
|
-
reject(new Error(body.error || errString));
|
|
1652
|
-
}
|
|
1653
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1654
|
-
resolve(body);
|
|
1655
|
-
}
|
|
1656
|
-
else {
|
|
1657
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1658
|
-
reject(errString);
|
|
1659
|
-
}
|
|
1660
|
-
}
|
|
1661
|
-
});
|
|
1662
|
-
});
|
|
1663
|
-
});
|
|
1666
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1667
|
+
// URL-encoded form
|
|
1668
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1669
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1670
|
+
}
|
|
1671
|
+
}
|
|
1672
|
+
const response = await fetch(url, requestOptions);
|
|
1673
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1664
1674
|
}
|
|
1665
1675
|
/**
|
|
1666
1676
|
* Configure the anomaly block, such as its minimum confidence score. Use the impulse blocks to find the learnId.
|
|
@@ -1674,9 +1684,11 @@ class LearnApi {
|
|
|
1674
1684
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1675
1685
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1676
1686
|
let localVarQueryParameters = {};
|
|
1677
|
-
let localVarHeaderParams =
|
|
1678
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1679
|
-
|
|
1687
|
+
let localVarHeaderParams = {
|
|
1688
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1689
|
+
'Content-Type': 'application/json',
|
|
1690
|
+
...this.defaultHeaders,
|
|
1691
|
+
};
|
|
1680
1692
|
const produces = ['application/json'];
|
|
1681
1693
|
// give precedence to 'application/json'
|
|
1682
1694
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1685,7 +1697,7 @@ class LearnApi {
|
|
|
1685
1697
|
else {
|
|
1686
1698
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1687
1699
|
}
|
|
1688
|
-
let localVarFormParams
|
|
1700
|
+
let localVarFormParams;
|
|
1689
1701
|
// verify required parameter 'projectId' is not null or undefined
|
|
1690
1702
|
if (projectId === null || projectId === undefined) {
|
|
1691
1703
|
throw new Error('Required parameter projectId was null or undefined when calling setAnomaly.');
|
|
@@ -1698,56 +1710,52 @@ class LearnApi {
|
|
|
1698
1710
|
if (setAnomalyParameterRequest === null || setAnomalyParameterRequest === undefined) {
|
|
1699
1711
|
throw new Error('Required parameter setAnomalyParameterRequest was null or undefined when calling setAnomaly.');
|
|
1700
1712
|
}
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1713
|
+
localVarHeaderParams = {
|
|
1714
|
+
...localVarHeaderParams,
|
|
1715
|
+
...options.headers,
|
|
1716
|
+
...this.opts.extraHeaders,
|
|
1717
|
+
};
|
|
1718
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1719
|
+
.filter(([, value]) => value !== undefined)
|
|
1720
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1721
|
+
.join('&');
|
|
1722
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1704
1723
|
let localVarRequestOptions = {
|
|
1705
1724
|
method: 'POST',
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1725
|
+
headers: { ...localVarHeaderParams },
|
|
1726
|
+
};
|
|
1727
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(setAnomalyParameterRequest, "SetAnomalyParameterRequest"));
|
|
1728
|
+
let requestOptions = localVarRequestOptions;
|
|
1729
|
+
let url = localVarUrl;
|
|
1730
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1731
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1732
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1733
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1734
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1735
|
+
url = auth_JWTAuthentication.url;
|
|
1736
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1737
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1738
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1739
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1740
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1741
|
+
url = auth_OAuth2.url;
|
|
1742
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1743
|
+
requestOptions = authDefault.requestOptions;
|
|
1744
|
+
url = authDefault.url;
|
|
1745
|
+
if (localVarFormParams) {
|
|
1746
|
+
delete requestOptions.headers['Content-Type'];
|
|
1747
|
+
if (localVarFormParams instanceof FormData) {
|
|
1748
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1749
|
+
requestOptions.body = localVarFormParams;
|
|
1728
1750
|
}
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
|
|
1733
|
-
|
|
1734
|
-
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1738
|
-
reject(new Error(body.error || errString));
|
|
1739
|
-
}
|
|
1740
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1741
|
-
resolve(body);
|
|
1742
|
-
}
|
|
1743
|
-
else {
|
|
1744
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1745
|
-
reject(errString);
|
|
1746
|
-
}
|
|
1747
|
-
}
|
|
1748
|
-
});
|
|
1749
|
-
});
|
|
1750
|
-
});
|
|
1751
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1752
|
+
// URL-encoded form
|
|
1753
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1754
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1755
|
+
}
|
|
1756
|
+
}
|
|
1757
|
+
const response = await fetch(url, requestOptions);
|
|
1758
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1751
1759
|
}
|
|
1752
1760
|
/**
|
|
1753
1761
|
* Configure the Keras block, such as its minimum confidence score. Use the impulse blocks to find the learnId.
|
|
@@ -1761,9 +1769,11 @@ class LearnApi {
|
|
|
1761
1769
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1762
1770
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1763
1771
|
let localVarQueryParameters = {};
|
|
1764
|
-
let localVarHeaderParams =
|
|
1765
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1766
|
-
|
|
1772
|
+
let localVarHeaderParams = {
|
|
1773
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1774
|
+
'Content-Type': 'application/json',
|
|
1775
|
+
...this.defaultHeaders,
|
|
1776
|
+
};
|
|
1767
1777
|
const produces = ['application/json'];
|
|
1768
1778
|
// give precedence to 'application/json'
|
|
1769
1779
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1772,7 +1782,7 @@ class LearnApi {
|
|
|
1772
1782
|
else {
|
|
1773
1783
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1774
1784
|
}
|
|
1775
|
-
let localVarFormParams
|
|
1785
|
+
let localVarFormParams;
|
|
1776
1786
|
// verify required parameter 'projectId' is not null or undefined
|
|
1777
1787
|
if (projectId === null || projectId === undefined) {
|
|
1778
1788
|
throw new Error('Required parameter projectId was null or undefined when calling setKeras.');
|
|
@@ -1785,56 +1795,52 @@ class LearnApi {
|
|
|
1785
1795
|
if (setKerasParameterRequest === null || setKerasParameterRequest === undefined) {
|
|
1786
1796
|
throw new Error('Required parameter setKerasParameterRequest was null or undefined when calling setKeras.');
|
|
1787
1797
|
}
|
|
1788
|
-
|
|
1789
|
-
|
|
1790
|
-
|
|
1798
|
+
localVarHeaderParams = {
|
|
1799
|
+
...localVarHeaderParams,
|
|
1800
|
+
...options.headers,
|
|
1801
|
+
...this.opts.extraHeaders,
|
|
1802
|
+
};
|
|
1803
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1804
|
+
.filter(([, value]) => value !== undefined)
|
|
1805
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1806
|
+
.join('&');
|
|
1807
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1791
1808
|
let localVarRequestOptions = {
|
|
1792
1809
|
method: 'POST',
|
|
1793
|
-
|
|
1794
|
-
|
|
1795
|
-
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
1800
|
-
|
|
1801
|
-
|
|
1802
|
-
|
|
1803
|
-
|
|
1804
|
-
|
|
1805
|
-
|
|
1806
|
-
|
|
1807
|
-
|
|
1808
|
-
|
|
1809
|
-
|
|
1810
|
-
|
|
1811
|
-
|
|
1812
|
-
|
|
1813
|
-
|
|
1814
|
-
|
|
1810
|
+
headers: { ...localVarHeaderParams },
|
|
1811
|
+
};
|
|
1812
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(setKerasParameterRequest, "SetKerasParameterRequest"));
|
|
1813
|
+
let requestOptions = localVarRequestOptions;
|
|
1814
|
+
let url = localVarUrl;
|
|
1815
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1816
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1817
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1818
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1819
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1820
|
+
url = auth_JWTAuthentication.url;
|
|
1821
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1822
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1823
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1824
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1825
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1826
|
+
url = auth_OAuth2.url;
|
|
1827
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1828
|
+
requestOptions = authDefault.requestOptions;
|
|
1829
|
+
url = authDefault.url;
|
|
1830
|
+
if (localVarFormParams) {
|
|
1831
|
+
delete requestOptions.headers['Content-Type'];
|
|
1832
|
+
if (localVarFormParams instanceof FormData) {
|
|
1833
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1834
|
+
requestOptions.body = localVarFormParams;
|
|
1815
1835
|
}
|
|
1816
|
-
|
|
1817
|
-
|
|
1818
|
-
|
|
1819
|
-
|
|
1820
|
-
|
|
1821
|
-
|
|
1822
|
-
|
|
1823
|
-
|
|
1824
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1825
|
-
reject(new Error(body.error || errString));
|
|
1826
|
-
}
|
|
1827
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1828
|
-
resolve(body);
|
|
1829
|
-
}
|
|
1830
|
-
else {
|
|
1831
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1832
|
-
reject(errString);
|
|
1833
|
-
}
|
|
1834
|
-
}
|
|
1835
|
-
});
|
|
1836
|
-
});
|
|
1837
|
-
});
|
|
1836
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1837
|
+
// URL-encoded form
|
|
1838
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1839
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1840
|
+
}
|
|
1841
|
+
}
|
|
1842
|
+
const response = await fetch(url, requestOptions);
|
|
1843
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1838
1844
|
}
|
|
1839
1845
|
/**
|
|
1840
1846
|
* Update config for a VLM learn block, including prompt and other model parameters.
|
|
@@ -1848,9 +1854,11 @@ class LearnApi {
|
|
|
1848
1854
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1849
1855
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1850
1856
|
let localVarQueryParameters = {};
|
|
1851
|
-
let localVarHeaderParams =
|
|
1852
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1853
|
-
|
|
1857
|
+
let localVarHeaderParams = {
|
|
1858
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1859
|
+
'Content-Type': 'application/json',
|
|
1860
|
+
...this.defaultHeaders,
|
|
1861
|
+
};
|
|
1854
1862
|
const produces = ['application/json'];
|
|
1855
1863
|
// give precedence to 'application/json'
|
|
1856
1864
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1859,7 +1867,7 @@ class LearnApi {
|
|
|
1859
1867
|
else {
|
|
1860
1868
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1861
1869
|
}
|
|
1862
|
-
let localVarFormParams
|
|
1870
|
+
let localVarFormParams;
|
|
1863
1871
|
// verify required parameter 'projectId' is not null or undefined
|
|
1864
1872
|
if (projectId === null || projectId === undefined) {
|
|
1865
1873
|
throw new Error('Required parameter projectId was null or undefined when calling setVlmConfig.');
|
|
@@ -1872,56 +1880,52 @@ class LearnApi {
|
|
|
1872
1880
|
if (vlmConfigurationBase === null || vlmConfigurationBase === undefined) {
|
|
1873
1881
|
throw new Error('Required parameter vlmConfigurationBase was null or undefined when calling setVlmConfig.');
|
|
1874
1882
|
}
|
|
1875
|
-
|
|
1876
|
-
|
|
1877
|
-
|
|
1883
|
+
localVarHeaderParams = {
|
|
1884
|
+
...localVarHeaderParams,
|
|
1885
|
+
...options.headers,
|
|
1886
|
+
...this.opts.extraHeaders,
|
|
1887
|
+
};
|
|
1888
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1889
|
+
.filter(([, value]) => value !== undefined)
|
|
1890
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1891
|
+
.join('&');
|
|
1892
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1878
1893
|
let localVarRequestOptions = {
|
|
1879
1894
|
method: 'POST',
|
|
1880
|
-
|
|
1881
|
-
|
|
1882
|
-
|
|
1883
|
-
|
|
1884
|
-
|
|
1885
|
-
|
|
1886
|
-
|
|
1887
|
-
|
|
1888
|
-
|
|
1889
|
-
|
|
1890
|
-
|
|
1891
|
-
|
|
1892
|
-
|
|
1893
|
-
|
|
1894
|
-
|
|
1895
|
-
|
|
1896
|
-
|
|
1897
|
-
|
|
1898
|
-
|
|
1899
|
-
|
|
1900
|
-
|
|
1901
|
-
|
|
1895
|
+
headers: { ...localVarHeaderParams },
|
|
1896
|
+
};
|
|
1897
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(vlmConfigurationBase, "VlmConfigurationBase"));
|
|
1898
|
+
let requestOptions = localVarRequestOptions;
|
|
1899
|
+
let url = localVarUrl;
|
|
1900
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1901
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1902
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1903
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1904
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1905
|
+
url = auth_JWTAuthentication.url;
|
|
1906
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1907
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1908
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1909
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1910
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1911
|
+
url = auth_OAuth2.url;
|
|
1912
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1913
|
+
requestOptions = authDefault.requestOptions;
|
|
1914
|
+
url = authDefault.url;
|
|
1915
|
+
if (localVarFormParams) {
|
|
1916
|
+
delete requestOptions.headers['Content-Type'];
|
|
1917
|
+
if (localVarFormParams instanceof FormData) {
|
|
1918
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1919
|
+
requestOptions.body = localVarFormParams;
|
|
1902
1920
|
}
|
|
1903
|
-
|
|
1904
|
-
|
|
1905
|
-
|
|
1906
|
-
|
|
1907
|
-
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1912
|
-
reject(new Error(body.error || errString));
|
|
1913
|
-
}
|
|
1914
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1915
|
-
resolve(body);
|
|
1916
|
-
}
|
|
1917
|
-
else {
|
|
1918
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1919
|
-
reject(errString);
|
|
1920
|
-
}
|
|
1921
|
-
}
|
|
1922
|
-
});
|
|
1923
|
-
});
|
|
1924
|
-
});
|
|
1921
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1922
|
+
// URL-encoded form
|
|
1923
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1924
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1925
|
+
}
|
|
1926
|
+
}
|
|
1927
|
+
const response = await fetch(url, requestOptions);
|
|
1928
|
+
return this.handleResponse(response, 'VlmSetConfigResponse');
|
|
1925
1929
|
}
|
|
1926
1930
|
/**
|
|
1927
1931
|
* Starts an asynchronous profiling job, if there\'s no profiling information for the currently selected latency device. Afterwards, re-fetch model metadata to get the profiling job IDs.
|
|
@@ -1934,9 +1938,11 @@ class LearnApi {
|
|
|
1934
1938
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1935
1939
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
1936
1940
|
let localVarQueryParameters = {};
|
|
1937
|
-
let localVarHeaderParams =
|
|
1938
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1939
|
-
|
|
1941
|
+
let localVarHeaderParams = {
|
|
1942
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1943
|
+
'Content-Type': 'application/json',
|
|
1944
|
+
...this.defaultHeaders,
|
|
1945
|
+
};
|
|
1940
1946
|
const produces = ['application/json'];
|
|
1941
1947
|
// give precedence to 'application/json'
|
|
1942
1948
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1945,7 +1951,7 @@ class LearnApi {
|
|
|
1945
1951
|
else {
|
|
1946
1952
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1947
1953
|
}
|
|
1948
|
-
let localVarFormParams
|
|
1954
|
+
let localVarFormParams;
|
|
1949
1955
|
// verify required parameter 'projectId' is not null or undefined
|
|
1950
1956
|
if (projectId === null || projectId === undefined) {
|
|
1951
1957
|
throw new Error('Required parameter projectId was null or undefined when calling startAnomalyProfileJob.');
|
|
@@ -1954,55 +1960,51 @@ class LearnApi {
|
|
|
1954
1960
|
if (learnId === null || learnId === undefined) {
|
|
1955
1961
|
throw new Error('Required parameter learnId was null or undefined when calling startAnomalyProfileJob.');
|
|
1956
1962
|
}
|
|
1957
|
-
|
|
1958
|
-
|
|
1959
|
-
|
|
1963
|
+
localVarHeaderParams = {
|
|
1964
|
+
...localVarHeaderParams,
|
|
1965
|
+
...options.headers,
|
|
1966
|
+
...this.opts.extraHeaders,
|
|
1967
|
+
};
|
|
1968
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1969
|
+
.filter(([, value]) => value !== undefined)
|
|
1970
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1971
|
+
.join('&');
|
|
1972
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1960
1973
|
let localVarRequestOptions = {
|
|
1961
1974
|
method: 'POST',
|
|
1962
|
-
|
|
1963
|
-
|
|
1964
|
-
|
|
1965
|
-
|
|
1966
|
-
|
|
1967
|
-
|
|
1968
|
-
|
|
1969
|
-
|
|
1970
|
-
|
|
1971
|
-
|
|
1972
|
-
|
|
1973
|
-
|
|
1974
|
-
|
|
1975
|
-
|
|
1976
|
-
|
|
1977
|
-
|
|
1978
|
-
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
|
|
1982
|
-
|
|
1975
|
+
headers: { ...localVarHeaderParams },
|
|
1976
|
+
};
|
|
1977
|
+
let requestOptions = localVarRequestOptions;
|
|
1978
|
+
let url = localVarUrl;
|
|
1979
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1980
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1981
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1982
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1983
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1984
|
+
url = auth_JWTAuthentication.url;
|
|
1985
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1986
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1987
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1988
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1989
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1990
|
+
url = auth_OAuth2.url;
|
|
1991
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1992
|
+
requestOptions = authDefault.requestOptions;
|
|
1993
|
+
url = authDefault.url;
|
|
1994
|
+
if (localVarFormParams) {
|
|
1995
|
+
delete requestOptions.headers['Content-Type'];
|
|
1996
|
+
if (localVarFormParams instanceof FormData) {
|
|
1997
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1998
|
+
requestOptions.body = localVarFormParams;
|
|
1983
1999
|
}
|
|
1984
|
-
|
|
1985
|
-
|
|
1986
|
-
|
|
1987
|
-
|
|
1988
|
-
|
|
1989
|
-
|
|
1990
|
-
|
|
1991
|
-
|
|
1992
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1993
|
-
reject(new Error(body.error || errString));
|
|
1994
|
-
}
|
|
1995
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1996
|
-
resolve(body);
|
|
1997
|
-
}
|
|
1998
|
-
else {
|
|
1999
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2000
|
-
reject(errString);
|
|
2001
|
-
}
|
|
2002
|
-
}
|
|
2003
|
-
});
|
|
2004
|
-
});
|
|
2005
|
-
});
|
|
2000
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2001
|
+
// URL-encoded form
|
|
2002
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2003
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2004
|
+
}
|
|
2005
|
+
}
|
|
2006
|
+
const response = await fetch(url, requestOptions);
|
|
2007
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
2006
2008
|
}
|
|
2007
2009
|
/**
|
|
2008
2010
|
* Starts an asynchronous profiling job, if there\'s no profiling information for the currently selected latency device. Afterwards, re-fetch model metadata to get the profiling job IDs.
|
|
@@ -2015,9 +2017,11 @@ class LearnApi {
|
|
|
2015
2017
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
2016
2018
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
2017
2019
|
let localVarQueryParameters = {};
|
|
2018
|
-
let localVarHeaderParams =
|
|
2019
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2020
|
-
|
|
2020
|
+
let localVarHeaderParams = {
|
|
2021
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2022
|
+
'Content-Type': 'application/json',
|
|
2023
|
+
...this.defaultHeaders,
|
|
2024
|
+
};
|
|
2021
2025
|
const produces = ['application/json'];
|
|
2022
2026
|
// give precedence to 'application/json'
|
|
2023
2027
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -2026,7 +2030,7 @@ class LearnApi {
|
|
|
2026
2030
|
else {
|
|
2027
2031
|
localVarHeaderParams.Accept = produces.join(',');
|
|
2028
2032
|
}
|
|
2029
|
-
let localVarFormParams
|
|
2033
|
+
let localVarFormParams;
|
|
2030
2034
|
// verify required parameter 'projectId' is not null or undefined
|
|
2031
2035
|
if (projectId === null || projectId === undefined) {
|
|
2032
2036
|
throw new Error('Required parameter projectId was null or undefined when calling startKerasProfileJob.');
|
|
@@ -2035,55 +2039,51 @@ class LearnApi {
|
|
|
2035
2039
|
if (learnId === null || learnId === undefined) {
|
|
2036
2040
|
throw new Error('Required parameter learnId was null or undefined when calling startKerasProfileJob.');
|
|
2037
2041
|
}
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2042
|
+
localVarHeaderParams = {
|
|
2043
|
+
...localVarHeaderParams,
|
|
2044
|
+
...options.headers,
|
|
2045
|
+
...this.opts.extraHeaders,
|
|
2046
|
+
};
|
|
2047
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2048
|
+
.filter(([, value]) => value !== undefined)
|
|
2049
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2050
|
+
.join('&');
|
|
2051
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2041
2052
|
let localVarRequestOptions = {
|
|
2042
2053
|
method: 'POST',
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2054
|
+
headers: { ...localVarHeaderParams },
|
|
2055
|
+
};
|
|
2056
|
+
let requestOptions = localVarRequestOptions;
|
|
2057
|
+
let url = localVarUrl;
|
|
2058
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2059
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2060
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2061
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2062
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2063
|
+
url = auth_JWTAuthentication.url;
|
|
2064
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2065
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2066
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2067
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2068
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2069
|
+
url = auth_OAuth2.url;
|
|
2070
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2071
|
+
requestOptions = authDefault.requestOptions;
|
|
2072
|
+
url = authDefault.url;
|
|
2073
|
+
if (localVarFormParams) {
|
|
2074
|
+
delete requestOptions.headers['Content-Type'];
|
|
2075
|
+
if (localVarFormParams instanceof FormData) {
|
|
2076
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2077
|
+
requestOptions.body = localVarFormParams;
|
|
2064
2078
|
}
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2074
|
-
reject(new Error(body.error || errString));
|
|
2075
|
-
}
|
|
2076
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2077
|
-
resolve(body);
|
|
2078
|
-
}
|
|
2079
|
-
else {
|
|
2080
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2081
|
-
reject(errString);
|
|
2082
|
-
}
|
|
2083
|
-
}
|
|
2084
|
-
});
|
|
2085
|
-
});
|
|
2086
|
-
});
|
|
2079
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2080
|
+
// URL-encoded form
|
|
2081
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2082
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2083
|
+
}
|
|
2084
|
+
}
|
|
2085
|
+
const response = await fetch(url, requestOptions);
|
|
2086
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
2087
2087
|
}
|
|
2088
2088
|
/**
|
|
2089
2089
|
* Test out a pretrained model (using raw features) - upload first via `uploadPretrainedModel`. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
|
|
@@ -2096,9 +2096,11 @@ class LearnApi {
|
|
|
2096
2096
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/test'
|
|
2097
2097
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
2098
2098
|
let localVarQueryParameters = {};
|
|
2099
|
-
let localVarHeaderParams =
|
|
2100
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2101
|
-
|
|
2099
|
+
let localVarHeaderParams = {
|
|
2100
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2101
|
+
'Content-Type': 'application/json',
|
|
2102
|
+
...this.defaultHeaders,
|
|
2103
|
+
};
|
|
2102
2104
|
const produces = ['application/json'];
|
|
2103
2105
|
// give precedence to 'application/json'
|
|
2104
2106
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -2107,7 +2109,7 @@ class LearnApi {
|
|
|
2107
2109
|
else {
|
|
2108
2110
|
localVarHeaderParams.Accept = produces.join(',');
|
|
2109
2111
|
}
|
|
2110
|
-
let localVarFormParams
|
|
2112
|
+
let localVarFormParams;
|
|
2111
2113
|
// verify required parameter 'projectId' is not null or undefined
|
|
2112
2114
|
if (projectId === null || projectId === undefined) {
|
|
2113
2115
|
throw new Error('Required parameter projectId was null or undefined when calling testPretrainedModel.');
|
|
@@ -2119,56 +2121,52 @@ class LearnApi {
|
|
|
2119
2121
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
2120
2122
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
2121
2123
|
}
|
|
2122
|
-
|
|
2123
|
-
|
|
2124
|
-
|
|
2124
|
+
localVarHeaderParams = {
|
|
2125
|
+
...localVarHeaderParams,
|
|
2126
|
+
...options.headers,
|
|
2127
|
+
...this.opts.extraHeaders,
|
|
2128
|
+
};
|
|
2129
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2130
|
+
.filter(([, value]) => value !== undefined)
|
|
2131
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2132
|
+
.join('&');
|
|
2133
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2125
2134
|
let localVarRequestOptions = {
|
|
2126
2135
|
method: 'POST',
|
|
2127
|
-
|
|
2128
|
-
|
|
2129
|
-
|
|
2130
|
-
|
|
2131
|
-
|
|
2132
|
-
|
|
2133
|
-
|
|
2134
|
-
|
|
2135
|
-
|
|
2136
|
-
|
|
2137
|
-
|
|
2138
|
-
|
|
2139
|
-
|
|
2140
|
-
|
|
2141
|
-
|
|
2142
|
-
|
|
2143
|
-
|
|
2144
|
-
|
|
2145
|
-
|
|
2146
|
-
|
|
2147
|
-
|
|
2148
|
-
|
|
2136
|
+
headers: { ...localVarHeaderParams },
|
|
2137
|
+
};
|
|
2138
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(testPretrainedModelRequest, "TestPretrainedModelRequest"));
|
|
2139
|
+
let requestOptions = localVarRequestOptions;
|
|
2140
|
+
let url = localVarUrl;
|
|
2141
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2142
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2143
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2144
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2145
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2146
|
+
url = auth_JWTAuthentication.url;
|
|
2147
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2148
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2149
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2150
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2151
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2152
|
+
url = auth_OAuth2.url;
|
|
2153
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2154
|
+
requestOptions = authDefault.requestOptions;
|
|
2155
|
+
url = authDefault.url;
|
|
2156
|
+
if (localVarFormParams) {
|
|
2157
|
+
delete requestOptions.headers['Content-Type'];
|
|
2158
|
+
if (localVarFormParams instanceof FormData) {
|
|
2159
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2160
|
+
requestOptions.body = localVarFormParams;
|
|
2149
2161
|
}
|
|
2150
|
-
|
|
2151
|
-
|
|
2152
|
-
|
|
2153
|
-
|
|
2154
|
-
|
|
2155
|
-
|
|
2156
|
-
|
|
2157
|
-
|
|
2158
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2159
|
-
reject(new Error(body.error || errString));
|
|
2160
|
-
}
|
|
2161
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2162
|
-
resolve(body);
|
|
2163
|
-
}
|
|
2164
|
-
else {
|
|
2165
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2166
|
-
reject(errString);
|
|
2167
|
-
}
|
|
2168
|
-
}
|
|
2169
|
-
});
|
|
2170
|
-
});
|
|
2171
|
-
});
|
|
2162
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2163
|
+
// URL-encoded form
|
|
2164
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2165
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2166
|
+
}
|
|
2167
|
+
}
|
|
2168
|
+
const response = await fetch(url, requestOptions);
|
|
2169
|
+
return this.handleResponse(response, 'TestPretrainedModelResponse');
|
|
2172
2170
|
}
|
|
2173
2171
|
/**
|
|
2174
2172
|
* Test out a pretrained model (using image data) - upload first via `uploadPretrainedModel`. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`. This will transform raw image data (e.g. RGB to grayscale, resize) before classifying. To classify raw features, see `testPretrainedModel`.
|
|
@@ -2181,9 +2179,11 @@ class LearnApi {
|
|
|
2181
2179
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/test-image'
|
|
2182
2180
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
2183
2181
|
let localVarQueryParameters = {};
|
|
2184
|
-
let localVarHeaderParams =
|
|
2185
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2186
|
-
|
|
2182
|
+
let localVarHeaderParams = {
|
|
2183
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2184
|
+
'Content-Type': 'application/json',
|
|
2185
|
+
...this.defaultHeaders,
|
|
2186
|
+
};
|
|
2187
2187
|
const produces = ['application/json'];
|
|
2188
2188
|
// give precedence to 'application/json'
|
|
2189
2189
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -2192,7 +2192,7 @@ class LearnApi {
|
|
|
2192
2192
|
else {
|
|
2193
2193
|
localVarHeaderParams.Accept = produces.join(',');
|
|
2194
2194
|
}
|
|
2195
|
-
let localVarFormParams
|
|
2195
|
+
let localVarFormParams;
|
|
2196
2196
|
// verify required parameter 'projectId' is not null or undefined
|
|
2197
2197
|
if (projectId === null || projectId === undefined) {
|
|
2198
2198
|
throw new Error('Required parameter projectId was null or undefined when calling testPretrainedModelImages.');
|
|
@@ -2204,56 +2204,52 @@ class LearnApi {
|
|
|
2204
2204
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
2205
2205
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
2206
2206
|
}
|
|
2207
|
-
|
|
2208
|
-
|
|
2209
|
-
|
|
2207
|
+
localVarHeaderParams = {
|
|
2208
|
+
...localVarHeaderParams,
|
|
2209
|
+
...options.headers,
|
|
2210
|
+
...this.opts.extraHeaders,
|
|
2211
|
+
};
|
|
2212
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2213
|
+
.filter(([, value]) => value !== undefined)
|
|
2214
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2215
|
+
.join('&');
|
|
2216
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2210
2217
|
let localVarRequestOptions = {
|
|
2211
2218
|
method: 'POST',
|
|
2212
|
-
|
|
2213
|
-
|
|
2214
|
-
|
|
2215
|
-
|
|
2216
|
-
|
|
2217
|
-
|
|
2218
|
-
|
|
2219
|
-
|
|
2220
|
-
|
|
2221
|
-
|
|
2222
|
-
|
|
2223
|
-
|
|
2224
|
-
|
|
2225
|
-
|
|
2226
|
-
|
|
2227
|
-
|
|
2228
|
-
|
|
2229
|
-
|
|
2230
|
-
|
|
2231
|
-
|
|
2232
|
-
|
|
2233
|
-
|
|
2219
|
+
headers: { ...localVarHeaderParams },
|
|
2220
|
+
};
|
|
2221
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(testPretrainedModelImagesRequest, "TestPretrainedModelImagesRequest"));
|
|
2222
|
+
let requestOptions = localVarRequestOptions;
|
|
2223
|
+
let url = localVarUrl;
|
|
2224
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2225
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2226
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2227
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2228
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2229
|
+
url = auth_JWTAuthentication.url;
|
|
2230
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2231
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2232
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2233
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2234
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2235
|
+
url = auth_OAuth2.url;
|
|
2236
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2237
|
+
requestOptions = authDefault.requestOptions;
|
|
2238
|
+
url = authDefault.url;
|
|
2239
|
+
if (localVarFormParams) {
|
|
2240
|
+
delete requestOptions.headers['Content-Type'];
|
|
2241
|
+
if (localVarFormParams instanceof FormData) {
|
|
2242
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2243
|
+
requestOptions.body = localVarFormParams;
|
|
2234
2244
|
}
|
|
2235
|
-
|
|
2236
|
-
|
|
2237
|
-
|
|
2238
|
-
|
|
2239
|
-
|
|
2240
|
-
|
|
2241
|
-
|
|
2242
|
-
|
|
2243
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2244
|
-
reject(new Error(body.error || errString));
|
|
2245
|
-
}
|
|
2246
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2247
|
-
resolve(body);
|
|
2248
|
-
}
|
|
2249
|
-
else {
|
|
2250
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2251
|
-
reject(errString);
|
|
2252
|
-
}
|
|
2253
|
-
}
|
|
2254
|
-
});
|
|
2255
|
-
});
|
|
2256
|
-
});
|
|
2245
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2246
|
+
// URL-encoded form
|
|
2247
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2248
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2249
|
+
}
|
|
2250
|
+
}
|
|
2251
|
+
const response = await fetch(url, requestOptions);
|
|
2252
|
+
return this.handleResponse(response, 'TestPretrainedModelResponse');
|
|
2257
2253
|
}
|
|
2258
2254
|
/**
|
|
2259
2255
|
* Replace Keras block files with the contents of a zip. This is an internal API.
|
|
@@ -2267,9 +2263,11 @@ class LearnApi {
|
|
|
2267
2263
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
2268
2264
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
2269
2265
|
let localVarQueryParameters = {};
|
|
2270
|
-
let localVarHeaderParams =
|
|
2271
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2272
|
-
|
|
2266
|
+
let localVarHeaderParams = {
|
|
2267
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2268
|
+
'Content-Type': 'application/json',
|
|
2269
|
+
...this.defaultHeaders,
|
|
2270
|
+
};
|
|
2273
2271
|
const produces = ['application/json'];
|
|
2274
2272
|
// give precedence to 'application/json'
|
|
2275
2273
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -2278,7 +2276,7 @@ class LearnApi {
|
|
|
2278
2276
|
else {
|
|
2279
2277
|
localVarHeaderParams.Accept = produces.join(',');
|
|
2280
2278
|
}
|
|
2281
|
-
let localVarFormParams
|
|
2279
|
+
let localVarFormParams;
|
|
2282
2280
|
// verify required parameter 'projectId' is not null or undefined
|
|
2283
2281
|
if (projectId === null || projectId === undefined) {
|
|
2284
2282
|
throw new Error('Required parameter projectId was null or undefined when calling uploadKerasFiles.');
|
|
@@ -2291,59 +2289,69 @@ class LearnApi {
|
|
|
2291
2289
|
if (params.zip === null || params.zip === undefined) {
|
|
2292
2290
|
throw new Error('Required parameter params.zip was null or undefined when calling uploadKerasFiles.');
|
|
2293
2291
|
}
|
|
2294
|
-
|
|
2295
|
-
|
|
2296
|
-
|
|
2292
|
+
localVarHeaderParams = {
|
|
2293
|
+
...localVarHeaderParams,
|
|
2294
|
+
...options.headers,
|
|
2295
|
+
...this.opts.extraHeaders,
|
|
2296
|
+
};
|
|
2297
2297
|
if (params.zip !== undefined) {
|
|
2298
|
-
localVarFormParams
|
|
2298
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
2299
|
+
const existingParams = localVarFormParams;
|
|
2300
|
+
localVarFormParams = new FormData();
|
|
2301
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
2302
|
+
Object.keys(existingParams).forEach(key => {
|
|
2303
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
2304
|
+
});
|
|
2305
|
+
}
|
|
2306
|
+
}
|
|
2307
|
+
const zipFiles = Array.isArray(params.zip) ? params.zip : [params.zip];
|
|
2308
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
2309
|
+
zipFiles.forEach((f) => {
|
|
2310
|
+
localVarFormParams.append('zip', new Blob([f.value], {
|
|
2311
|
+
type: f.options.contentType
|
|
2312
|
+
}), f.options.filename);
|
|
2313
|
+
});
|
|
2299
2314
|
}
|
|
2300
|
-
|
|
2315
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2316
|
+
.filter(([, value]) => value !== undefined)
|
|
2317
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2318
|
+
.join('&');
|
|
2319
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2301
2320
|
let localVarRequestOptions = {
|
|
2302
2321
|
method: 'POST',
|
|
2303
|
-
|
|
2304
|
-
|
|
2305
|
-
|
|
2306
|
-
|
|
2307
|
-
|
|
2308
|
-
|
|
2309
|
-
|
|
2310
|
-
|
|
2311
|
-
|
|
2312
|
-
|
|
2313
|
-
|
|
2314
|
-
|
|
2315
|
-
|
|
2316
|
-
|
|
2317
|
-
|
|
2318
|
-
|
|
2319
|
-
|
|
2320
|
-
|
|
2321
|
-
|
|
2322
|
-
|
|
2323
|
-
|
|
2322
|
+
headers: { ...localVarHeaderParams },
|
|
2323
|
+
};
|
|
2324
|
+
let requestOptions = localVarRequestOptions;
|
|
2325
|
+
let url = localVarUrl;
|
|
2326
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2327
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2328
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2329
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2330
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2331
|
+
url = auth_JWTAuthentication.url;
|
|
2332
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2333
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2334
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2335
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2336
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2337
|
+
url = auth_OAuth2.url;
|
|
2338
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2339
|
+
requestOptions = authDefault.requestOptions;
|
|
2340
|
+
url = authDefault.url;
|
|
2341
|
+
if (localVarFormParams) {
|
|
2342
|
+
delete requestOptions.headers['Content-Type'];
|
|
2343
|
+
if (localVarFormParams instanceof FormData) {
|
|
2344
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2345
|
+
requestOptions.body = localVarFormParams;
|
|
2324
2346
|
}
|
|
2325
|
-
|
|
2326
|
-
|
|
2327
|
-
|
|
2328
|
-
|
|
2329
|
-
|
|
2330
|
-
|
|
2331
|
-
|
|
2332
|
-
|
|
2333
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2334
|
-
reject(new Error(body.error || errString));
|
|
2335
|
-
}
|
|
2336
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
2337
|
-
resolve(body);
|
|
2338
|
-
}
|
|
2339
|
-
else {
|
|
2340
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
2341
|
-
reject(errString);
|
|
2342
|
-
}
|
|
2343
|
-
}
|
|
2344
|
-
});
|
|
2345
|
-
});
|
|
2346
|
-
});
|
|
2347
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2348
|
+
// URL-encoded form
|
|
2349
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2350
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
const response = await fetch(url, requestOptions);
|
|
2354
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
2347
2355
|
}
|
|
2348
2356
|
/**
|
|
2349
2357
|
* Upload a pretrained model and receive info back about the input/output tensors. If you want to deploy a pretrained model from the API, see `startDeployPretrainedModelJob`.
|
|
@@ -2355,14 +2363,17 @@ class LearnApi {
|
|
|
2355
2363
|
* @param impulseId Impulse ID. If this is unset then the default impulse is used.
|
|
2356
2364
|
* @param representativeFeatures
|
|
2357
2365
|
* @param device MCU used for calculating latency, query `latencyDevices` in `listProject` for a list of supported devices (and use the \\\"mcu\\\" property here). If this is kept empty then we\\\'ll show an overview of multiple devices.
|
|
2366
|
+
* @param overrideInputShape Optional for ONNX files: overrides the input shape of the model. This is highly suggested if the model has dynamic dimensions. If this field is not set, then all dynamic dimensions will be set to \'1\'.
|
|
2358
2367
|
*/
|
|
2359
2368
|
async uploadPretrainedModel(projectId, params, queryParams, options = { headers: {} }) {
|
|
2360
2369
|
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/upload'
|
|
2361
2370
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
2362
2371
|
let localVarQueryParameters = {};
|
|
2363
|
-
let localVarHeaderParams =
|
|
2364
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
2365
|
-
|
|
2372
|
+
let localVarHeaderParams = {
|
|
2373
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2374
|
+
'Content-Type': 'application/json',
|
|
2375
|
+
...this.defaultHeaders,
|
|
2376
|
+
};
|
|
2366
2377
|
const produces = ['application/json'];
|
|
2367
2378
|
// give precedence to 'application/json'
|
|
2368
2379
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -2371,7 +2382,7 @@ class LearnApi {
|
|
|
2371
2382
|
else {
|
|
2372
2383
|
localVarHeaderParams.Accept = produces.join(',');
|
|
2373
2384
|
}
|
|
2374
|
-
let localVarFormParams
|
|
2385
|
+
let localVarFormParams;
|
|
2375
2386
|
// verify required parameter 'projectId' is not null or undefined
|
|
2376
2387
|
if (projectId === null || projectId === undefined) {
|
|
2377
2388
|
throw new Error('Required parameter projectId was null or undefined when calling uploadPretrainedModel.');
|
|
@@ -2391,72 +2402,234 @@ class LearnApi {
|
|
|
2391
2402
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
2392
2403
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
2393
2404
|
}
|
|
2394
|
-
|
|
2395
|
-
|
|
2396
|
-
|
|
2405
|
+
localVarHeaderParams = {
|
|
2406
|
+
...localVarHeaderParams,
|
|
2407
|
+
...options.headers,
|
|
2408
|
+
...this.opts.extraHeaders,
|
|
2409
|
+
};
|
|
2397
2410
|
if (params.modelFile !== undefined) {
|
|
2398
|
-
localVarFormParams
|
|
2411
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
2412
|
+
const existingParams = localVarFormParams;
|
|
2413
|
+
localVarFormParams = new FormData();
|
|
2414
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
2415
|
+
Object.keys(existingParams).forEach(key => {
|
|
2416
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
}
|
|
2420
|
+
const modelFileFiles = Array.isArray(params.modelFile) ? params.modelFile : [params.modelFile];
|
|
2421
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
2422
|
+
modelFileFiles.forEach((f) => {
|
|
2423
|
+
localVarFormParams.append('modelFile', new Blob([f.value], {
|
|
2424
|
+
type: f.options.contentType
|
|
2425
|
+
}), f.options.filename);
|
|
2426
|
+
});
|
|
2399
2427
|
}
|
|
2400
|
-
localVarUseFormData = true;
|
|
2401
2428
|
if (params.modelFileName !== undefined) {
|
|
2402
|
-
|
|
2429
|
+
const isParametersField = "modelFileName" === "parameters";
|
|
2430
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
2431
|
+
const modelFileNameSerialized = serializableParams
|
|
2432
|
+
? JSON.stringify(params.parameters)
|
|
2433
|
+
: models_1.ObjectSerializer.serializeFormData(params.modelFileName, "string");
|
|
2434
|
+
if (localVarFormParams instanceof FormData) {
|
|
2435
|
+
localVarFormParams.append('modelFileName', modelFileNameSerialized);
|
|
2436
|
+
}
|
|
2437
|
+
else {
|
|
2438
|
+
if (!localVarFormParams) {
|
|
2439
|
+
localVarFormParams = {};
|
|
2440
|
+
}
|
|
2441
|
+
localVarFormParams['modelFileName'] = modelFileNameSerialized;
|
|
2442
|
+
}
|
|
2403
2443
|
}
|
|
2404
2444
|
if (params.modelFileType !== undefined) {
|
|
2405
|
-
|
|
2445
|
+
const isParametersField = "modelFileType" === "parameters";
|
|
2446
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
2447
|
+
const modelFileTypeSerialized = serializableParams
|
|
2448
|
+
? JSON.stringify(params.parameters)
|
|
2449
|
+
: models_1.ObjectSerializer.serializeFormData(params.modelFileType, "string");
|
|
2450
|
+
if (localVarFormParams instanceof FormData) {
|
|
2451
|
+
localVarFormParams.append('modelFileType', modelFileTypeSerialized);
|
|
2452
|
+
}
|
|
2453
|
+
else {
|
|
2454
|
+
if (!localVarFormParams) {
|
|
2455
|
+
localVarFormParams = {};
|
|
2456
|
+
}
|
|
2457
|
+
localVarFormParams['modelFileType'] = modelFileTypeSerialized;
|
|
2458
|
+
}
|
|
2406
2459
|
}
|
|
2407
2460
|
if (params.representativeFeatures !== undefined) {
|
|
2408
|
-
localVarFormParams
|
|
2461
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
2462
|
+
const existingParams = localVarFormParams;
|
|
2463
|
+
localVarFormParams = new FormData();
|
|
2464
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
2465
|
+
Object.keys(existingParams).forEach(key => {
|
|
2466
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
2467
|
+
});
|
|
2468
|
+
}
|
|
2469
|
+
}
|
|
2470
|
+
const representativeFeaturesFiles = Array.isArray(params.representativeFeatures) ? params.representativeFeatures : [params.representativeFeatures];
|
|
2471
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
2472
|
+
representativeFeaturesFiles.forEach((f) => {
|
|
2473
|
+
localVarFormParams.append('representativeFeatures', new Blob([f.value], {
|
|
2474
|
+
type: f.options.contentType
|
|
2475
|
+
}), f.options.filename);
|
|
2476
|
+
});
|
|
2409
2477
|
}
|
|
2410
|
-
localVarUseFormData = true;
|
|
2411
2478
|
if (params.device !== undefined) {
|
|
2412
|
-
|
|
2479
|
+
const isParametersField = "device" === "parameters";
|
|
2480
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
2481
|
+
const deviceSerialized = serializableParams
|
|
2482
|
+
? JSON.stringify(params.parameters)
|
|
2483
|
+
: models_1.ObjectSerializer.serializeFormData(params.device, "string");
|
|
2484
|
+
if (localVarFormParams instanceof FormData) {
|
|
2485
|
+
localVarFormParams.append('device', deviceSerialized);
|
|
2486
|
+
}
|
|
2487
|
+
else {
|
|
2488
|
+
if (!localVarFormParams) {
|
|
2489
|
+
localVarFormParams = {};
|
|
2490
|
+
}
|
|
2491
|
+
localVarFormParams['device'] = deviceSerialized;
|
|
2492
|
+
}
|
|
2413
2493
|
}
|
|
2494
|
+
if (params.overrideInputShape !== undefined) {
|
|
2495
|
+
const isParametersField = "overrideInputShape" === "parameters";
|
|
2496
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
2497
|
+
const overrideInputShapeSerialized = serializableParams
|
|
2498
|
+
? JSON.stringify(params.parameters)
|
|
2499
|
+
: models_1.ObjectSerializer.serializeFormData(params.overrideInputShape, "Array<number>");
|
|
2500
|
+
if (localVarFormParams instanceof FormData) {
|
|
2501
|
+
localVarFormParams.append('overrideInputShape', overrideInputShapeSerialized);
|
|
2502
|
+
}
|
|
2503
|
+
else {
|
|
2504
|
+
if (!localVarFormParams) {
|
|
2505
|
+
localVarFormParams = {};
|
|
2506
|
+
}
|
|
2507
|
+
localVarFormParams['overrideInputShape'] = overrideInputShapeSerialized;
|
|
2508
|
+
}
|
|
2509
|
+
}
|
|
2510
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2511
|
+
.filter(([, value]) => value !== undefined)
|
|
2512
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2513
|
+
.join('&');
|
|
2514
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2414
2515
|
let localVarRequestOptions = {
|
|
2415
2516
|
method: 'POST',
|
|
2416
|
-
|
|
2417
|
-
|
|
2418
|
-
|
|
2419
|
-
|
|
2420
|
-
|
|
2421
|
-
|
|
2422
|
-
|
|
2423
|
-
|
|
2424
|
-
|
|
2425
|
-
|
|
2426
|
-
|
|
2427
|
-
|
|
2428
|
-
|
|
2429
|
-
|
|
2430
|
-
|
|
2431
|
-
|
|
2432
|
-
|
|
2433
|
-
|
|
2434
|
-
|
|
2435
|
-
|
|
2436
|
-
|
|
2517
|
+
headers: { ...localVarHeaderParams },
|
|
2518
|
+
};
|
|
2519
|
+
let requestOptions = localVarRequestOptions;
|
|
2520
|
+
let url = localVarUrl;
|
|
2521
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2522
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2523
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2524
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2525
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2526
|
+
url = auth_JWTAuthentication.url;
|
|
2527
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2528
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2529
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2530
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2531
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2532
|
+
url = auth_OAuth2.url;
|
|
2533
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2534
|
+
requestOptions = authDefault.requestOptions;
|
|
2535
|
+
url = authDefault.url;
|
|
2536
|
+
if (localVarFormParams) {
|
|
2537
|
+
delete requestOptions.headers['Content-Type'];
|
|
2538
|
+
if (localVarFormParams instanceof FormData) {
|
|
2539
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2540
|
+
requestOptions.body = localVarFormParams;
|
|
2437
2541
|
}
|
|
2438
|
-
|
|
2439
|
-
|
|
2440
|
-
|
|
2441
|
-
|
|
2442
|
-
|
|
2443
|
-
|
|
2444
|
-
|
|
2445
|
-
|
|
2446
|
-
|
|
2447
|
-
|
|
2448
|
-
|
|
2449
|
-
|
|
2450
|
-
|
|
2451
|
-
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2455
|
-
|
|
2456
|
-
|
|
2457
|
-
|
|
2458
|
-
|
|
2459
|
-
|
|
2542
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2543
|
+
// URL-encoded form
|
|
2544
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2545
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2546
|
+
}
|
|
2547
|
+
}
|
|
2548
|
+
const response = await fetch(url, requestOptions);
|
|
2549
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
2550
|
+
}
|
|
2551
|
+
/**
|
|
2552
|
+
* Internal API, used in tests (only available on *.test.edgeimpulse.com). Upload a pretrained model by providing a URL - rather than uploading the file itself (as we have a request size limit on test).
|
|
2553
|
+
* @summary Upload a pretrained model
|
|
2554
|
+
* @param projectId Project ID
|
|
2555
|
+
* @param uploadPretrainedModelByUrlRequest
|
|
2556
|
+
* @param impulseId Impulse ID. If this is unset then the default impulse is used.
|
|
2557
|
+
*/
|
|
2558
|
+
async uploadPretrainedModelByUrl(projectId, uploadPretrainedModelByUrlRequest, queryParams, options = { headers: {} }) {
|
|
2559
|
+
const localVarPath = this.basePath + '/api/{projectId}/pretrained-model/upload-by-url'
|
|
2560
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
2561
|
+
let localVarQueryParameters = {};
|
|
2562
|
+
let localVarHeaderParams = {
|
|
2563
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
2564
|
+
'Content-Type': 'application/json',
|
|
2565
|
+
...this.defaultHeaders,
|
|
2566
|
+
};
|
|
2567
|
+
const produces = ['application/json'];
|
|
2568
|
+
// give precedence to 'application/json'
|
|
2569
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
2570
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
2571
|
+
}
|
|
2572
|
+
else {
|
|
2573
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
2574
|
+
}
|
|
2575
|
+
let localVarFormParams;
|
|
2576
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
2577
|
+
if (projectId === null || projectId === undefined) {
|
|
2578
|
+
throw new Error('Required parameter projectId was null or undefined when calling uploadPretrainedModelByUrl.');
|
|
2579
|
+
}
|
|
2580
|
+
// verify required parameter 'uploadPretrainedModelByUrlRequest' is not null or undefined
|
|
2581
|
+
if (uploadPretrainedModelByUrlRequest === null || uploadPretrainedModelByUrlRequest === undefined) {
|
|
2582
|
+
throw new Error('Required parameter uploadPretrainedModelByUrlRequest was null or undefined when calling uploadPretrainedModelByUrl.');
|
|
2583
|
+
}
|
|
2584
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
2585
|
+
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
2586
|
+
}
|
|
2587
|
+
localVarHeaderParams = {
|
|
2588
|
+
...localVarHeaderParams,
|
|
2589
|
+
...options.headers,
|
|
2590
|
+
...this.opts.extraHeaders,
|
|
2591
|
+
};
|
|
2592
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
2593
|
+
.filter(([, value]) => value !== undefined)
|
|
2594
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
2595
|
+
.join('&');
|
|
2596
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
2597
|
+
let localVarRequestOptions = {
|
|
2598
|
+
method: 'POST',
|
|
2599
|
+
headers: { ...localVarHeaderParams },
|
|
2600
|
+
};
|
|
2601
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(uploadPretrainedModelByUrlRequest, "UploadPretrainedModelByUrlRequest"));
|
|
2602
|
+
let requestOptions = localVarRequestOptions;
|
|
2603
|
+
let url = localVarUrl;
|
|
2604
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
2605
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
2606
|
+
url = auth_ApiKeyAuthentication.url;
|
|
2607
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
2608
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
2609
|
+
url = auth_JWTAuthentication.url;
|
|
2610
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
2611
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
2612
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
2613
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
2614
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
2615
|
+
url = auth_OAuth2.url;
|
|
2616
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
2617
|
+
requestOptions = authDefault.requestOptions;
|
|
2618
|
+
url = authDefault.url;
|
|
2619
|
+
if (localVarFormParams) {
|
|
2620
|
+
delete requestOptions.headers['Content-Type'];
|
|
2621
|
+
if (localVarFormParams instanceof FormData) {
|
|
2622
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
2623
|
+
requestOptions.body = localVarFormParams;
|
|
2624
|
+
}
|
|
2625
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
2626
|
+
// URL-encoded form
|
|
2627
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
2628
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
2629
|
+
}
|
|
2630
|
+
}
|
|
2631
|
+
const response = await fetch(url, requestOptions);
|
|
2632
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
2460
2633
|
}
|
|
2461
2634
|
}
|
|
2462
2635
|
exports.LearnApi = LearnApi;
|