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.ImpulseApi = exports.ImpulseApiApiKeys = 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 ImpulseApiApiKeys;
|
|
|
30
47
|
ImpulseApiApiKeys[ImpulseApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(ImpulseApiApiKeys = exports.ImpulseApiApiKeys || (exports.ImpulseApiApiKeys = {}));
|
|
32
49
|
class ImpulseApi {
|
|
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 ImpulseApi {
|
|
|
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 ImpulseApi {
|
|
|
90
124
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
91
125
|
.replace('{' + 'impulseId' + '}', encodeURIComponent(String(impulseId)));
|
|
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 ImpulseApi {
|
|
|
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 cloneImpulseComplete.');
|
|
@@ -114,56 +150,52 @@ class ImpulseApi {
|
|
|
114
150
|
if (cloneImpulseRequest === null || cloneImpulseRequest === undefined) {
|
|
115
151
|
throw new Error('Required parameter cloneImpulseRequest was null or undefined when calling cloneImpulseComplete.');
|
|
116
152
|
}
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
153
|
+
localVarHeaderParams = {
|
|
154
|
+
...localVarHeaderParams,
|
|
155
|
+
...options.headers,
|
|
156
|
+
...this.opts.extraHeaders,
|
|
157
|
+
};
|
|
158
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
159
|
+
.filter(([, value]) => value !== undefined)
|
|
160
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
161
|
+
.join('&');
|
|
162
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
120
163
|
let localVarRequestOptions = {
|
|
121
164
|
method: 'POST',
|
|
122
|
-
|
|
123
|
-
headers: localVarHeaderParams,
|
|
124
|
-
uri: localVarPath,
|
|
125
|
-
useQuerystring: this._useQuerystring,
|
|
126
|
-
agentOptions: { keepAlive: false },
|
|
127
|
-
json: true,
|
|
128
|
-
body: models_1.ObjectSerializer.serialize(cloneImpulseRequest, "CloneImpulseRequest")
|
|
165
|
+
headers: { ...localVarHeaderParams },
|
|
129
166
|
};
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
167
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(cloneImpulseRequest, "CloneImpulseRequest"));
|
|
168
|
+
let requestOptions = localVarRequestOptions;
|
|
169
|
+
let url = localVarUrl;
|
|
170
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
171
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
172
|
+
url = auth_ApiKeyAuthentication.url;
|
|
173
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
174
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
175
|
+
url = auth_JWTAuthentication.url;
|
|
176
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
177
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
178
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
179
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
180
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
181
|
+
url = auth_OAuth2.url;
|
|
182
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
183
|
+
requestOptions = authDefault.requestOptions;
|
|
184
|
+
url = authDefault.url;
|
|
185
|
+
if (localVarFormParams) {
|
|
186
|
+
delete requestOptions.headers['Content-Type'];
|
|
187
|
+
if (localVarFormParams instanceof FormData) {
|
|
188
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
189
|
+
requestOptions.body = localVarFormParams;
|
|
144
190
|
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
154
|
-
reject(new Error(body.error || errString));
|
|
155
|
-
}
|
|
156
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
157
|
-
resolve(body);
|
|
158
|
-
}
|
|
159
|
-
else {
|
|
160
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
161
|
-
reject(errString);
|
|
162
|
-
}
|
|
163
|
-
}
|
|
164
|
-
});
|
|
165
|
-
});
|
|
166
|
-
});
|
|
191
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
192
|
+
// URL-encoded form
|
|
193
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
194
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
const response = await fetch(url, requestOptions);
|
|
198
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
167
199
|
}
|
|
168
200
|
/**
|
|
169
201
|
* Clones the complete structure (incl. config) of an impulse. Does not copy data.
|
|
@@ -177,9 +209,11 @@ class ImpulseApi {
|
|
|
177
209
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
178
210
|
.replace('{' + 'impulseId' + '}', encodeURIComponent(String(impulseId)));
|
|
179
211
|
let localVarQueryParameters = {};
|
|
180
|
-
let localVarHeaderParams =
|
|
181
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
182
|
-
|
|
212
|
+
let localVarHeaderParams = {
|
|
213
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
214
|
+
'Content-Type': 'application/json',
|
|
215
|
+
...this.defaultHeaders,
|
|
216
|
+
};
|
|
183
217
|
const produces = ['application/json'];
|
|
184
218
|
// give precedence to 'application/json'
|
|
185
219
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -188,7 +222,7 @@ class ImpulseApi {
|
|
|
188
222
|
else {
|
|
189
223
|
localVarHeaderParams.Accept = produces.join(',');
|
|
190
224
|
}
|
|
191
|
-
let localVarFormParams
|
|
225
|
+
let localVarFormParams;
|
|
192
226
|
// verify required parameter 'projectId' is not null or undefined
|
|
193
227
|
if (projectId === null || projectId === undefined) {
|
|
194
228
|
throw new Error('Required parameter projectId was null or undefined when calling cloneImpulseStructure.');
|
|
@@ -201,56 +235,52 @@ class ImpulseApi {
|
|
|
201
235
|
if (cloneImpulseRequest === null || cloneImpulseRequest === undefined) {
|
|
202
236
|
throw new Error('Required parameter cloneImpulseRequest was null or undefined when calling cloneImpulseStructure.');
|
|
203
237
|
}
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
238
|
+
localVarHeaderParams = {
|
|
239
|
+
...localVarHeaderParams,
|
|
240
|
+
...options.headers,
|
|
241
|
+
...this.opts.extraHeaders,
|
|
242
|
+
};
|
|
243
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
244
|
+
.filter(([, value]) => value !== undefined)
|
|
245
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
246
|
+
.join('&');
|
|
247
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
207
248
|
let localVarRequestOptions = {
|
|
208
249
|
method: 'POST',
|
|
209
|
-
|
|
210
|
-
headers: localVarHeaderParams,
|
|
211
|
-
uri: localVarPath,
|
|
212
|
-
useQuerystring: this._useQuerystring,
|
|
213
|
-
agentOptions: { keepAlive: false },
|
|
214
|
-
json: true,
|
|
215
|
-
body: models_1.ObjectSerializer.serialize(cloneImpulseRequest, "CloneImpulseRequest")
|
|
250
|
+
headers: { ...localVarHeaderParams },
|
|
216
251
|
};
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
252
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(cloneImpulseRequest, "CloneImpulseRequest"));
|
|
253
|
+
let requestOptions = localVarRequestOptions;
|
|
254
|
+
let url = localVarUrl;
|
|
255
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
256
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
257
|
+
url = auth_ApiKeyAuthentication.url;
|
|
258
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
259
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
260
|
+
url = auth_JWTAuthentication.url;
|
|
261
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
262
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
263
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
264
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
265
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
266
|
+
url = auth_OAuth2.url;
|
|
267
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
268
|
+
requestOptions = authDefault.requestOptions;
|
|
269
|
+
url = authDefault.url;
|
|
270
|
+
if (localVarFormParams) {
|
|
271
|
+
delete requestOptions.headers['Content-Type'];
|
|
272
|
+
if (localVarFormParams instanceof FormData) {
|
|
273
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
274
|
+
requestOptions.body = localVarFormParams;
|
|
231
275
|
}
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
241
|
-
reject(new Error(body.error || errString));
|
|
242
|
-
}
|
|
243
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
244
|
-
resolve(body);
|
|
245
|
-
}
|
|
246
|
-
else {
|
|
247
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
248
|
-
reject(errString);
|
|
249
|
-
}
|
|
250
|
-
}
|
|
251
|
-
});
|
|
252
|
-
});
|
|
253
|
-
});
|
|
276
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
277
|
+
// URL-encoded form
|
|
278
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
279
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
const response = await fetch(url, requestOptions);
|
|
283
|
+
return this.handleResponse(response, 'CreateImpulseResponse');
|
|
254
284
|
}
|
|
255
285
|
/**
|
|
256
286
|
* Sets the impulse for this project. If you specify `impulseId` then that impulse is created/updated, otherwise the default impulse is created/updated.
|
|
@@ -263,9 +293,11 @@ class ImpulseApi {
|
|
|
263
293
|
const localVarPath = this.basePath + '/api/{projectId}/impulse'
|
|
264
294
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
265
295
|
let localVarQueryParameters = {};
|
|
266
|
-
let localVarHeaderParams =
|
|
267
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
268
|
-
|
|
296
|
+
let localVarHeaderParams = {
|
|
297
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
298
|
+
'Content-Type': 'application/json',
|
|
299
|
+
...this.defaultHeaders,
|
|
300
|
+
};
|
|
269
301
|
const produces = ['application/json'];
|
|
270
302
|
// give precedence to 'application/json'
|
|
271
303
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -274,7 +306,7 @@ class ImpulseApi {
|
|
|
274
306
|
else {
|
|
275
307
|
localVarHeaderParams.Accept = produces.join(',');
|
|
276
308
|
}
|
|
277
|
-
let localVarFormParams
|
|
309
|
+
let localVarFormParams;
|
|
278
310
|
// verify required parameter 'projectId' is not null or undefined
|
|
279
311
|
if (projectId === null || projectId === undefined) {
|
|
280
312
|
throw new Error('Required parameter projectId was null or undefined when calling createImpulse.');
|
|
@@ -286,56 +318,52 @@ class ImpulseApi {
|
|
|
286
318
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
287
319
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
288
320
|
}
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
321
|
+
localVarHeaderParams = {
|
|
322
|
+
...localVarHeaderParams,
|
|
323
|
+
...options.headers,
|
|
324
|
+
...this.opts.extraHeaders,
|
|
325
|
+
};
|
|
326
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
327
|
+
.filter(([, value]) => value !== undefined)
|
|
328
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
329
|
+
.join('&');
|
|
330
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
292
331
|
let localVarRequestOptions = {
|
|
293
332
|
method: 'POST',
|
|
294
|
-
|
|
295
|
-
headers: localVarHeaderParams,
|
|
296
|
-
uri: localVarPath,
|
|
297
|
-
useQuerystring: this._useQuerystring,
|
|
298
|
-
agentOptions: { keepAlive: false },
|
|
299
|
-
json: true,
|
|
300
|
-
body: models_1.ObjectSerializer.serialize(createImpulseRequest, "CreateImpulseRequest")
|
|
333
|
+
headers: { ...localVarHeaderParams },
|
|
301
334
|
};
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
335
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(createImpulseRequest, "CreateImpulseRequest"));
|
|
336
|
+
let requestOptions = localVarRequestOptions;
|
|
337
|
+
let url = localVarUrl;
|
|
338
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
339
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
340
|
+
url = auth_ApiKeyAuthentication.url;
|
|
341
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
342
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
343
|
+
url = auth_JWTAuthentication.url;
|
|
344
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
345
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
346
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
347
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
348
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
349
|
+
url = auth_OAuth2.url;
|
|
350
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
351
|
+
requestOptions = authDefault.requestOptions;
|
|
352
|
+
url = authDefault.url;
|
|
353
|
+
if (localVarFormParams) {
|
|
354
|
+
delete requestOptions.headers['Content-Type'];
|
|
355
|
+
if (localVarFormParams instanceof FormData) {
|
|
356
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
357
|
+
requestOptions.body = localVarFormParams;
|
|
316
358
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
326
|
-
reject(new Error(body.error || errString));
|
|
327
|
-
}
|
|
328
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
329
|
-
resolve(body);
|
|
330
|
-
}
|
|
331
|
-
else {
|
|
332
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
333
|
-
reject(errString);
|
|
334
|
-
}
|
|
335
|
-
}
|
|
336
|
-
});
|
|
337
|
-
});
|
|
338
|
-
});
|
|
359
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
360
|
+
// URL-encoded form
|
|
361
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
362
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
363
|
+
}
|
|
364
|
+
}
|
|
365
|
+
const response = await fetch(url, requestOptions);
|
|
366
|
+
return this.handleResponse(response, 'CreateImpulseResponse');
|
|
339
367
|
}
|
|
340
368
|
/**
|
|
341
369
|
* Create a new empty impulse, and return the ID.
|
|
@@ -347,9 +375,11 @@ class ImpulseApi {
|
|
|
347
375
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/new'
|
|
348
376
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
349
377
|
let localVarQueryParameters = {};
|
|
350
|
-
let localVarHeaderParams =
|
|
351
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
352
|
-
|
|
378
|
+
let localVarHeaderParams = {
|
|
379
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
380
|
+
'Content-Type': 'application/json',
|
|
381
|
+
...this.defaultHeaders,
|
|
382
|
+
};
|
|
353
383
|
const produces = ['application/json'];
|
|
354
384
|
// give precedence to 'application/json'
|
|
355
385
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -358,61 +388,57 @@ class ImpulseApi {
|
|
|
358
388
|
else {
|
|
359
389
|
localVarHeaderParams.Accept = produces.join(',');
|
|
360
390
|
}
|
|
361
|
-
let localVarFormParams
|
|
391
|
+
let localVarFormParams;
|
|
362
392
|
// verify required parameter 'projectId' is not null or undefined
|
|
363
393
|
if (projectId === null || projectId === undefined) {
|
|
364
394
|
throw new Error('Required parameter projectId was null or undefined when calling createNewEmptyImpulse.');
|
|
365
395
|
}
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
396
|
+
localVarHeaderParams = {
|
|
397
|
+
...localVarHeaderParams,
|
|
398
|
+
...options.headers,
|
|
399
|
+
...this.opts.extraHeaders,
|
|
400
|
+
};
|
|
401
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
402
|
+
.filter(([, value]) => value !== undefined)
|
|
403
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
404
|
+
.join('&');
|
|
405
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
369
406
|
let localVarRequestOptions = {
|
|
370
407
|
method: 'POST',
|
|
371
|
-
|
|
372
|
-
headers: localVarHeaderParams,
|
|
373
|
-
uri: localVarPath,
|
|
374
|
-
useQuerystring: this._useQuerystring,
|
|
375
|
-
agentOptions: { keepAlive: false },
|
|
376
|
-
json: true,
|
|
377
|
-
body: models_1.ObjectSerializer.serialize(createNewEmptyImpulseRequest, "CreateNewEmptyImpulseRequest")
|
|
408
|
+
headers: { ...localVarHeaderParams },
|
|
378
409
|
};
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
410
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(createNewEmptyImpulseRequest, "CreateNewEmptyImpulseRequest"));
|
|
411
|
+
let requestOptions = localVarRequestOptions;
|
|
412
|
+
let url = localVarUrl;
|
|
413
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
414
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
415
|
+
url = auth_ApiKeyAuthentication.url;
|
|
416
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
417
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
418
|
+
url = auth_JWTAuthentication.url;
|
|
419
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
420
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
421
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
422
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
423
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
424
|
+
url = auth_OAuth2.url;
|
|
425
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
426
|
+
requestOptions = authDefault.requestOptions;
|
|
427
|
+
url = authDefault.url;
|
|
428
|
+
if (localVarFormParams) {
|
|
429
|
+
delete requestOptions.headers['Content-Type'];
|
|
430
|
+
if (localVarFormParams instanceof FormData) {
|
|
431
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
432
|
+
requestOptions.body = localVarFormParams;
|
|
393
433
|
}
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
403
|
-
reject(new Error(body.error || errString));
|
|
404
|
-
}
|
|
405
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
406
|
-
resolve(body);
|
|
407
|
-
}
|
|
408
|
-
else {
|
|
409
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
410
|
-
reject(errString);
|
|
411
|
-
}
|
|
412
|
-
}
|
|
413
|
-
});
|
|
414
|
-
});
|
|
415
|
-
});
|
|
434
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
435
|
+
// URL-encoded form
|
|
436
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
437
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
const response = await fetch(url, requestOptions);
|
|
441
|
+
return this.handleResponse(response, 'CreateNewEmptyImpulseResponse');
|
|
416
442
|
}
|
|
417
443
|
/**
|
|
418
444
|
* Clears the impulse and all associated blocks for this project. If you specify `impulseId` then that impulse is cleared, otherwise the default impulse is cleared.
|
|
@@ -424,9 +450,11 @@ class ImpulseApi {
|
|
|
424
450
|
const localVarPath = this.basePath + '/api/{projectId}/impulse'
|
|
425
451
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
426
452
|
let localVarQueryParameters = {};
|
|
427
|
-
let localVarHeaderParams =
|
|
428
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
429
|
-
|
|
453
|
+
let localVarHeaderParams = {
|
|
454
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
455
|
+
'Content-Type': 'application/json',
|
|
456
|
+
...this.defaultHeaders,
|
|
457
|
+
};
|
|
430
458
|
const produces = ['application/json'];
|
|
431
459
|
// give precedence to 'application/json'
|
|
432
460
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -435,7 +463,7 @@ class ImpulseApi {
|
|
|
435
463
|
else {
|
|
436
464
|
localVarHeaderParams.Accept = produces.join(',');
|
|
437
465
|
}
|
|
438
|
-
let localVarFormParams
|
|
466
|
+
let localVarFormParams;
|
|
439
467
|
// verify required parameter 'projectId' is not null or undefined
|
|
440
468
|
if (projectId === null || projectId === undefined) {
|
|
441
469
|
throw new Error('Required parameter projectId was null or undefined when calling deleteImpulse.');
|
|
@@ -443,55 +471,51 @@ class ImpulseApi {
|
|
|
443
471
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
444
472
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
445
473
|
}
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
474
|
+
localVarHeaderParams = {
|
|
475
|
+
...localVarHeaderParams,
|
|
476
|
+
...options.headers,
|
|
477
|
+
...this.opts.extraHeaders,
|
|
478
|
+
};
|
|
479
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
480
|
+
.filter(([, value]) => value !== undefined)
|
|
481
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
482
|
+
.join('&');
|
|
483
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
449
484
|
let localVarRequestOptions = {
|
|
450
485
|
method: 'DELETE',
|
|
451
|
-
|
|
452
|
-
headers: localVarHeaderParams,
|
|
453
|
-
uri: localVarPath,
|
|
454
|
-
useQuerystring: this._useQuerystring,
|
|
455
|
-
agentOptions: { keepAlive: false },
|
|
456
|
-
json: true,
|
|
486
|
+
headers: { ...localVarHeaderParams },
|
|
457
487
|
};
|
|
458
|
-
let
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
488
|
+
let requestOptions = localVarRequestOptions;
|
|
489
|
+
let url = localVarUrl;
|
|
490
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
491
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
492
|
+
url = auth_ApiKeyAuthentication.url;
|
|
493
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
494
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
495
|
+
url = auth_JWTAuthentication.url;
|
|
496
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
497
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
498
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
499
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
500
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
501
|
+
url = auth_OAuth2.url;
|
|
502
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
503
|
+
requestOptions = authDefault.requestOptions;
|
|
504
|
+
url = authDefault.url;
|
|
505
|
+
if (localVarFormParams) {
|
|
506
|
+
delete requestOptions.headers['Content-Type'];
|
|
507
|
+
if (localVarFormParams instanceof FormData) {
|
|
508
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
509
|
+
requestOptions.body = localVarFormParams;
|
|
472
510
|
}
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
482
|
-
reject(new Error(body.error || errString));
|
|
483
|
-
}
|
|
484
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
485
|
-
resolve(body);
|
|
486
|
-
}
|
|
487
|
-
else {
|
|
488
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
489
|
-
reject(errString);
|
|
490
|
-
}
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
});
|
|
494
|
-
});
|
|
511
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
512
|
+
// URL-encoded form
|
|
513
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
514
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
const response = await fetch(url, requestOptions);
|
|
518
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
495
519
|
}
|
|
496
520
|
/**
|
|
497
521
|
* Download all impulse for a project, including accuracy and performance metrics, as JSON or CSV.
|
|
@@ -503,9 +527,11 @@ class ImpulseApi {
|
|
|
503
527
|
const localVarPath = this.basePath + '/api/{projectId}/download-impulses-detailed'
|
|
504
528
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
505
529
|
let localVarQueryParameters = {};
|
|
506
|
-
let localVarHeaderParams =
|
|
507
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
508
|
-
|
|
530
|
+
let localVarHeaderParams = {
|
|
531
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
532
|
+
'Content-Type': 'application/json',
|
|
533
|
+
...this.defaultHeaders,
|
|
534
|
+
};
|
|
509
535
|
const produces = ['application/octet-stream'];
|
|
510
536
|
// give precedence to 'application/json'
|
|
511
537
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -514,7 +540,7 @@ class ImpulseApi {
|
|
|
514
540
|
else {
|
|
515
541
|
localVarHeaderParams.Accept = produces.join(',');
|
|
516
542
|
}
|
|
517
|
-
let localVarFormParams
|
|
543
|
+
let localVarFormParams;
|
|
518
544
|
// verify required parameter 'projectId' is not null or undefined
|
|
519
545
|
if (projectId === null || projectId === undefined) {
|
|
520
546
|
throw new Error('Required parameter projectId was null or undefined when calling downloadDetailedImpulses.');
|
|
@@ -522,55 +548,51 @@ class ImpulseApi {
|
|
|
522
548
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.format) !== undefined) {
|
|
523
549
|
localVarQueryParameters['format'] = models_1.ObjectSerializer.serialize(queryParams.format, "'json' | 'csv'");
|
|
524
550
|
}
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
551
|
+
localVarHeaderParams = {
|
|
552
|
+
...localVarHeaderParams,
|
|
553
|
+
...options.headers,
|
|
554
|
+
...this.opts.extraHeaders,
|
|
555
|
+
};
|
|
556
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
557
|
+
.filter(([, value]) => value !== undefined)
|
|
558
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
559
|
+
.join('&');
|
|
560
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
528
561
|
let localVarRequestOptions = {
|
|
529
562
|
method: 'GET',
|
|
530
|
-
|
|
531
|
-
headers: localVarHeaderParams,
|
|
532
|
-
uri: localVarPath,
|
|
533
|
-
useQuerystring: this._useQuerystring,
|
|
534
|
-
agentOptions: { keepAlive: false },
|
|
535
|
-
encoding: null,
|
|
563
|
+
headers: { ...localVarHeaderParams },
|
|
536
564
|
};
|
|
537
|
-
let
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
565
|
+
let requestOptions = localVarRequestOptions;
|
|
566
|
+
let url = localVarUrl;
|
|
567
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
568
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
569
|
+
url = auth_ApiKeyAuthentication.url;
|
|
570
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
571
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
572
|
+
url = auth_JWTAuthentication.url;
|
|
573
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
574
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
575
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
576
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
577
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
578
|
+
url = auth_OAuth2.url;
|
|
579
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
580
|
+
requestOptions = authDefault.requestOptions;
|
|
581
|
+
url = authDefault.url;
|
|
582
|
+
if (localVarFormParams) {
|
|
583
|
+
delete requestOptions.headers['Content-Type'];
|
|
584
|
+
if (localVarFormParams instanceof FormData) {
|
|
585
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
586
|
+
requestOptions.body = localVarFormParams;
|
|
551
587
|
}
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
561
|
-
reject(new Error(body.error || errString));
|
|
562
|
-
}
|
|
563
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
564
|
-
resolve(body);
|
|
565
|
-
}
|
|
566
|
-
else {
|
|
567
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
568
|
-
reject(errString);
|
|
569
|
-
}
|
|
570
|
-
}
|
|
571
|
-
});
|
|
572
|
-
});
|
|
573
|
-
});
|
|
588
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
589
|
+
// URL-encoded form
|
|
590
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
591
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
592
|
+
}
|
|
593
|
+
}
|
|
594
|
+
const response = await fetch(url, requestOptions);
|
|
595
|
+
return this.handleResponse(response, 'Buffer');
|
|
574
596
|
}
|
|
575
597
|
/**
|
|
576
598
|
* Retrieve all impulse for a project, including accuracy and performance metrics.
|
|
@@ -581,9 +603,11 @@ class ImpulseApi {
|
|
|
581
603
|
const localVarPath = this.basePath + '/api/{projectId}/impulses-detailed'
|
|
582
604
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
583
605
|
let localVarQueryParameters = {};
|
|
584
|
-
let localVarHeaderParams =
|
|
585
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
586
|
-
|
|
606
|
+
let localVarHeaderParams = {
|
|
607
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
608
|
+
'Content-Type': 'application/json',
|
|
609
|
+
...this.defaultHeaders,
|
|
610
|
+
};
|
|
587
611
|
const produces = ['application/json'];
|
|
588
612
|
// give precedence to 'application/json'
|
|
589
613
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -592,60 +616,56 @@ class ImpulseApi {
|
|
|
592
616
|
else {
|
|
593
617
|
localVarHeaderParams.Accept = produces.join(',');
|
|
594
618
|
}
|
|
595
|
-
let localVarFormParams
|
|
619
|
+
let localVarFormParams;
|
|
596
620
|
// verify required parameter 'projectId' is not null or undefined
|
|
597
621
|
if (projectId === null || projectId === undefined) {
|
|
598
622
|
throw new Error('Required parameter projectId was null or undefined when calling getAllDetailedImpulses.');
|
|
599
623
|
}
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
624
|
+
localVarHeaderParams = {
|
|
625
|
+
...localVarHeaderParams,
|
|
626
|
+
...options.headers,
|
|
627
|
+
...this.opts.extraHeaders,
|
|
628
|
+
};
|
|
629
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
630
|
+
.filter(([, value]) => value !== undefined)
|
|
631
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
632
|
+
.join('&');
|
|
633
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
603
634
|
let localVarRequestOptions = {
|
|
604
635
|
method: 'GET',
|
|
605
|
-
|
|
606
|
-
headers: localVarHeaderParams,
|
|
607
|
-
uri: localVarPath,
|
|
608
|
-
useQuerystring: this._useQuerystring,
|
|
609
|
-
agentOptions: { keepAlive: false },
|
|
610
|
-
json: true,
|
|
636
|
+
headers: { ...localVarHeaderParams },
|
|
611
637
|
};
|
|
612
|
-
let
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
638
|
+
let requestOptions = localVarRequestOptions;
|
|
639
|
+
let url = localVarUrl;
|
|
640
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
641
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
642
|
+
url = auth_ApiKeyAuthentication.url;
|
|
643
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
644
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
645
|
+
url = auth_JWTAuthentication.url;
|
|
646
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
647
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
648
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
649
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
650
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
651
|
+
url = auth_OAuth2.url;
|
|
652
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
653
|
+
requestOptions = authDefault.requestOptions;
|
|
654
|
+
url = authDefault.url;
|
|
655
|
+
if (localVarFormParams) {
|
|
656
|
+
delete requestOptions.headers['Content-Type'];
|
|
657
|
+
if (localVarFormParams instanceof FormData) {
|
|
658
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
659
|
+
requestOptions.body = localVarFormParams;
|
|
626
660
|
}
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
636
|
-
reject(new Error(body.error || errString));
|
|
637
|
-
}
|
|
638
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
639
|
-
resolve(body);
|
|
640
|
-
}
|
|
641
|
-
else {
|
|
642
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
643
|
-
reject(errString);
|
|
644
|
-
}
|
|
645
|
-
}
|
|
646
|
-
});
|
|
647
|
-
});
|
|
648
|
-
});
|
|
661
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
662
|
+
// URL-encoded form
|
|
663
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
664
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
665
|
+
}
|
|
666
|
+
}
|
|
667
|
+
const response = await fetch(url, requestOptions);
|
|
668
|
+
return this.handleResponse(response, 'GetAllDetailedImpulsesResponse');
|
|
649
669
|
}
|
|
650
670
|
/**
|
|
651
671
|
* Retrieve all impulse for a project
|
|
@@ -656,9 +676,11 @@ class ImpulseApi {
|
|
|
656
676
|
const localVarPath = this.basePath + '/api/{projectId}/impulses'
|
|
657
677
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
658
678
|
let localVarQueryParameters = {};
|
|
659
|
-
let localVarHeaderParams =
|
|
660
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
661
|
-
|
|
679
|
+
let localVarHeaderParams = {
|
|
680
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
681
|
+
'Content-Type': 'application/json',
|
|
682
|
+
...this.defaultHeaders,
|
|
683
|
+
};
|
|
662
684
|
const produces = ['application/json'];
|
|
663
685
|
// give precedence to 'application/json'
|
|
664
686
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -667,60 +689,56 @@ class ImpulseApi {
|
|
|
667
689
|
else {
|
|
668
690
|
localVarHeaderParams.Accept = produces.join(',');
|
|
669
691
|
}
|
|
670
|
-
let localVarFormParams
|
|
692
|
+
let localVarFormParams;
|
|
671
693
|
// verify required parameter 'projectId' is not null or undefined
|
|
672
694
|
if (projectId === null || projectId === undefined) {
|
|
673
695
|
throw new Error('Required parameter projectId was null or undefined when calling getAllImpulses.');
|
|
674
696
|
}
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
697
|
+
localVarHeaderParams = {
|
|
698
|
+
...localVarHeaderParams,
|
|
699
|
+
...options.headers,
|
|
700
|
+
...this.opts.extraHeaders,
|
|
701
|
+
};
|
|
702
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
703
|
+
.filter(([, value]) => value !== undefined)
|
|
704
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
705
|
+
.join('&');
|
|
706
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
678
707
|
let localVarRequestOptions = {
|
|
679
708
|
method: 'GET',
|
|
680
|
-
|
|
681
|
-
headers: localVarHeaderParams,
|
|
682
|
-
uri: localVarPath,
|
|
683
|
-
useQuerystring: this._useQuerystring,
|
|
684
|
-
agentOptions: { keepAlive: false },
|
|
685
|
-
json: true,
|
|
709
|
+
headers: { ...localVarHeaderParams },
|
|
686
710
|
};
|
|
687
|
-
let
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
|
|
691
|
-
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
711
|
+
let requestOptions = localVarRequestOptions;
|
|
712
|
+
let url = localVarUrl;
|
|
713
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
714
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
715
|
+
url = auth_ApiKeyAuthentication.url;
|
|
716
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
717
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
718
|
+
url = auth_JWTAuthentication.url;
|
|
719
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
720
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
721
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
722
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
723
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
724
|
+
url = auth_OAuth2.url;
|
|
725
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
726
|
+
requestOptions = authDefault.requestOptions;
|
|
727
|
+
url = authDefault.url;
|
|
728
|
+
if (localVarFormParams) {
|
|
729
|
+
delete requestOptions.headers['Content-Type'];
|
|
730
|
+
if (localVarFormParams instanceof FormData) {
|
|
731
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
732
|
+
requestOptions.body = localVarFormParams;
|
|
701
733
|
}
|
|
702
|
-
|
|
703
|
-
|
|
704
|
-
|
|
705
|
-
|
|
706
|
-
|
|
707
|
-
|
|
708
|
-
|
|
709
|
-
|
|
710
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
711
|
-
reject(new Error(body.error || errString));
|
|
712
|
-
}
|
|
713
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
714
|
-
resolve(body);
|
|
715
|
-
}
|
|
716
|
-
else {
|
|
717
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
718
|
-
reject(errString);
|
|
719
|
-
}
|
|
720
|
-
}
|
|
721
|
-
});
|
|
722
|
-
});
|
|
723
|
-
});
|
|
734
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
735
|
+
// URL-encoded form
|
|
736
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
737
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
738
|
+
}
|
|
739
|
+
}
|
|
740
|
+
const response = await fetch(url, requestOptions);
|
|
741
|
+
return this.handleResponse(response, 'GetAllImpulsesResponse');
|
|
724
742
|
}
|
|
725
743
|
/**
|
|
726
744
|
* Retrieve all transfer learning models across all categories
|
|
@@ -731,9 +749,11 @@ class ImpulseApi {
|
|
|
731
749
|
const localVarPath = this.basePath + '/api/{projectId}/transfer-learning-models'
|
|
732
750
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
733
751
|
let localVarQueryParameters = {};
|
|
734
|
-
let localVarHeaderParams =
|
|
735
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
736
|
-
|
|
752
|
+
let localVarHeaderParams = {
|
|
753
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
754
|
+
'Content-Type': 'application/json',
|
|
755
|
+
...this.defaultHeaders,
|
|
756
|
+
};
|
|
737
757
|
const produces = ['application/json'];
|
|
738
758
|
// give precedence to 'application/json'
|
|
739
759
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -742,60 +762,56 @@ class ImpulseApi {
|
|
|
742
762
|
else {
|
|
743
763
|
localVarHeaderParams.Accept = produces.join(',');
|
|
744
764
|
}
|
|
745
|
-
let localVarFormParams
|
|
765
|
+
let localVarFormParams;
|
|
746
766
|
// verify required parameter 'projectId' is not null or undefined
|
|
747
767
|
if (projectId === null || projectId === undefined) {
|
|
748
768
|
throw new Error('Required parameter projectId was null or undefined when calling getAllTransferLearningModels.');
|
|
749
769
|
}
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
770
|
+
localVarHeaderParams = {
|
|
771
|
+
...localVarHeaderParams,
|
|
772
|
+
...options.headers,
|
|
773
|
+
...this.opts.extraHeaders,
|
|
774
|
+
};
|
|
775
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
776
|
+
.filter(([, value]) => value !== undefined)
|
|
777
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
778
|
+
.join('&');
|
|
779
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
753
780
|
let localVarRequestOptions = {
|
|
754
781
|
method: 'GET',
|
|
755
|
-
|
|
756
|
-
headers: localVarHeaderParams,
|
|
757
|
-
uri: localVarPath,
|
|
758
|
-
useQuerystring: this._useQuerystring,
|
|
759
|
-
agentOptions: { keepAlive: false },
|
|
760
|
-
json: true,
|
|
782
|
+
headers: { ...localVarHeaderParams },
|
|
761
783
|
};
|
|
762
|
-
let
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
|
|
774
|
-
|
|
775
|
-
|
|
784
|
+
let requestOptions = localVarRequestOptions;
|
|
785
|
+
let url = localVarUrl;
|
|
786
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
787
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
788
|
+
url = auth_ApiKeyAuthentication.url;
|
|
789
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
790
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
791
|
+
url = auth_JWTAuthentication.url;
|
|
792
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
793
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
794
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
795
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
796
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
797
|
+
url = auth_OAuth2.url;
|
|
798
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
799
|
+
requestOptions = authDefault.requestOptions;
|
|
800
|
+
url = authDefault.url;
|
|
801
|
+
if (localVarFormParams) {
|
|
802
|
+
delete requestOptions.headers['Content-Type'];
|
|
803
|
+
if (localVarFormParams instanceof FormData) {
|
|
804
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
805
|
+
requestOptions.body = localVarFormParams;
|
|
776
806
|
}
|
|
777
|
-
|
|
778
|
-
|
|
779
|
-
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
786
|
-
reject(new Error(body.error || errString));
|
|
787
|
-
}
|
|
788
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
789
|
-
resolve(body);
|
|
790
|
-
}
|
|
791
|
-
else {
|
|
792
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
793
|
-
reject(errString);
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
});
|
|
797
|
-
});
|
|
798
|
-
});
|
|
807
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
808
|
+
// URL-encoded form
|
|
809
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
810
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
811
|
+
}
|
|
812
|
+
}
|
|
813
|
+
const response = await fetch(url, requestOptions);
|
|
814
|
+
return this.handleResponse(response, 'GetAllTransferLearningModelsResponse');
|
|
799
815
|
}
|
|
800
816
|
/**
|
|
801
817
|
* Retrieve the impulse for this project. If you specify `impulseId` then that impulse is returned, otherwise the default impulse is returned.
|
|
@@ -807,9 +823,11 @@ class ImpulseApi {
|
|
|
807
823
|
const localVarPath = this.basePath + '/api/{projectId}/impulse'
|
|
808
824
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
809
825
|
let localVarQueryParameters = {};
|
|
810
|
-
let localVarHeaderParams =
|
|
811
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
812
|
-
|
|
826
|
+
let localVarHeaderParams = {
|
|
827
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
828
|
+
'Content-Type': 'application/json',
|
|
829
|
+
...this.defaultHeaders,
|
|
830
|
+
};
|
|
813
831
|
const produces = ['application/json'];
|
|
814
832
|
// give precedence to 'application/json'
|
|
815
833
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -818,7 +836,7 @@ class ImpulseApi {
|
|
|
818
836
|
else {
|
|
819
837
|
localVarHeaderParams.Accept = produces.join(',');
|
|
820
838
|
}
|
|
821
|
-
let localVarFormParams
|
|
839
|
+
let localVarFormParams;
|
|
822
840
|
// verify required parameter 'projectId' is not null or undefined
|
|
823
841
|
if (projectId === null || projectId === undefined) {
|
|
824
842
|
throw new Error('Required parameter projectId was null or undefined when calling getImpulse.');
|
|
@@ -826,55 +844,51 @@ class ImpulseApi {
|
|
|
826
844
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
827
845
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
828
846
|
}
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
847
|
+
localVarHeaderParams = {
|
|
848
|
+
...localVarHeaderParams,
|
|
849
|
+
...options.headers,
|
|
850
|
+
...this.opts.extraHeaders,
|
|
851
|
+
};
|
|
852
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
853
|
+
.filter(([, value]) => value !== undefined)
|
|
854
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
855
|
+
.join('&');
|
|
856
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
832
857
|
let localVarRequestOptions = {
|
|
833
858
|
method: 'GET',
|
|
834
|
-
|
|
835
|
-
headers: localVarHeaderParams,
|
|
836
|
-
uri: localVarPath,
|
|
837
|
-
useQuerystring: this._useQuerystring,
|
|
838
|
-
agentOptions: { keepAlive: false },
|
|
839
|
-
json: true,
|
|
859
|
+
headers: { ...localVarHeaderParams },
|
|
840
860
|
};
|
|
841
|
-
let
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
861
|
+
let requestOptions = localVarRequestOptions;
|
|
862
|
+
let url = localVarUrl;
|
|
863
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
864
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
865
|
+
url = auth_ApiKeyAuthentication.url;
|
|
866
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
867
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
868
|
+
url = auth_JWTAuthentication.url;
|
|
869
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
870
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
871
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
872
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
873
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
874
|
+
url = auth_OAuth2.url;
|
|
875
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
876
|
+
requestOptions = authDefault.requestOptions;
|
|
877
|
+
url = authDefault.url;
|
|
878
|
+
if (localVarFormParams) {
|
|
879
|
+
delete requestOptions.headers['Content-Type'];
|
|
880
|
+
if (localVarFormParams instanceof FormData) {
|
|
881
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
882
|
+
requestOptions.body = localVarFormParams;
|
|
855
883
|
}
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
865
|
-
reject(new Error(body.error || errString));
|
|
866
|
-
}
|
|
867
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
868
|
-
resolve(body);
|
|
869
|
-
}
|
|
870
|
-
else {
|
|
871
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
872
|
-
reject(errString);
|
|
873
|
-
}
|
|
874
|
-
}
|
|
875
|
-
});
|
|
876
|
-
});
|
|
877
|
-
});
|
|
884
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
885
|
+
// URL-encoded form
|
|
886
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
887
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
888
|
+
}
|
|
889
|
+
}
|
|
890
|
+
const response = await fetch(url, requestOptions);
|
|
891
|
+
return this.handleResponse(response, 'GetImpulseResponse');
|
|
878
892
|
}
|
|
879
893
|
/**
|
|
880
894
|
* Retrieve the impulse for this project including disabled blocks. If you specify `impulseId` then that impulse is returned, otherwise the default impulse is returned.
|
|
@@ -886,9 +900,11 @@ class ImpulseApi {
|
|
|
886
900
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/all'
|
|
887
901
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
888
902
|
let localVarQueryParameters = {};
|
|
889
|
-
let localVarHeaderParams =
|
|
890
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
891
|
-
|
|
903
|
+
let localVarHeaderParams = {
|
|
904
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
905
|
+
'Content-Type': 'application/json',
|
|
906
|
+
...this.defaultHeaders,
|
|
907
|
+
};
|
|
892
908
|
const produces = ['application/json'];
|
|
893
909
|
// give precedence to 'application/json'
|
|
894
910
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -897,7 +913,7 @@ class ImpulseApi {
|
|
|
897
913
|
else {
|
|
898
914
|
localVarHeaderParams.Accept = produces.join(',');
|
|
899
915
|
}
|
|
900
|
-
let localVarFormParams
|
|
916
|
+
let localVarFormParams;
|
|
901
917
|
// verify required parameter 'projectId' is not null or undefined
|
|
902
918
|
if (projectId === null || projectId === undefined) {
|
|
903
919
|
throw new Error('Required parameter projectId was null or undefined when calling getImpulseAll.');
|
|
@@ -905,55 +921,51 @@ class ImpulseApi {
|
|
|
905
921
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
906
922
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
907
923
|
}
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
924
|
+
localVarHeaderParams = {
|
|
925
|
+
...localVarHeaderParams,
|
|
926
|
+
...options.headers,
|
|
927
|
+
...this.opts.extraHeaders,
|
|
928
|
+
};
|
|
929
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
930
|
+
.filter(([, value]) => value !== undefined)
|
|
931
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
932
|
+
.join('&');
|
|
933
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
911
934
|
let localVarRequestOptions = {
|
|
912
935
|
method: 'GET',
|
|
913
|
-
|
|
914
|
-
headers: localVarHeaderParams,
|
|
915
|
-
uri: localVarPath,
|
|
916
|
-
useQuerystring: this._useQuerystring,
|
|
917
|
-
agentOptions: { keepAlive: false },
|
|
918
|
-
json: true,
|
|
936
|
+
headers: { ...localVarHeaderParams },
|
|
919
937
|
};
|
|
920
|
-
let
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
938
|
+
let requestOptions = localVarRequestOptions;
|
|
939
|
+
let url = localVarUrl;
|
|
940
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
941
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
942
|
+
url = auth_ApiKeyAuthentication.url;
|
|
943
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
944
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
945
|
+
url = auth_JWTAuthentication.url;
|
|
946
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
947
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
948
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
949
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
950
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
951
|
+
url = auth_OAuth2.url;
|
|
952
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
953
|
+
requestOptions = authDefault.requestOptions;
|
|
954
|
+
url = authDefault.url;
|
|
955
|
+
if (localVarFormParams) {
|
|
956
|
+
delete requestOptions.headers['Content-Type'];
|
|
957
|
+
if (localVarFormParams instanceof FormData) {
|
|
958
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
959
|
+
requestOptions.body = localVarFormParams;
|
|
934
960
|
}
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
944
|
-
reject(new Error(body.error || errString));
|
|
945
|
-
}
|
|
946
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
947
|
-
resolve(body);
|
|
948
|
-
}
|
|
949
|
-
else {
|
|
950
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
951
|
-
reject(errString);
|
|
952
|
-
}
|
|
953
|
-
}
|
|
954
|
-
});
|
|
955
|
-
});
|
|
956
|
-
});
|
|
961
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
962
|
+
// URL-encoded form
|
|
963
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
964
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
const response = await fetch(url, requestOptions);
|
|
968
|
+
return this.handleResponse(response, 'GetImpulseResponse');
|
|
957
969
|
}
|
|
958
970
|
/**
|
|
959
971
|
* Lists all possible blocks that can be used in the impulse
|
|
@@ -964,9 +976,11 @@ class ImpulseApi {
|
|
|
964
976
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/blocks'
|
|
965
977
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
966
978
|
let localVarQueryParameters = {};
|
|
967
|
-
let localVarHeaderParams =
|
|
968
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
969
|
-
|
|
979
|
+
let localVarHeaderParams = {
|
|
980
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
981
|
+
'Content-Type': 'application/json',
|
|
982
|
+
...this.defaultHeaders,
|
|
983
|
+
};
|
|
970
984
|
const produces = ['application/json'];
|
|
971
985
|
// give precedence to 'application/json'
|
|
972
986
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -975,60 +989,56 @@ class ImpulseApi {
|
|
|
975
989
|
else {
|
|
976
990
|
localVarHeaderParams.Accept = produces.join(',');
|
|
977
991
|
}
|
|
978
|
-
let localVarFormParams
|
|
992
|
+
let localVarFormParams;
|
|
979
993
|
// verify required parameter 'projectId' is not null or undefined
|
|
980
994
|
if (projectId === null || projectId === undefined) {
|
|
981
995
|
throw new Error('Required parameter projectId was null or undefined when calling getImpulseBlocks.');
|
|
982
996
|
}
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
997
|
+
localVarHeaderParams = {
|
|
998
|
+
...localVarHeaderParams,
|
|
999
|
+
...options.headers,
|
|
1000
|
+
...this.opts.extraHeaders,
|
|
1001
|
+
};
|
|
1002
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1003
|
+
.filter(([, value]) => value !== undefined)
|
|
1004
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1005
|
+
.join('&');
|
|
1006
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
986
1007
|
let localVarRequestOptions = {
|
|
987
1008
|
method: 'GET',
|
|
988
|
-
|
|
989
|
-
headers: localVarHeaderParams,
|
|
990
|
-
uri: localVarPath,
|
|
991
|
-
useQuerystring: this._useQuerystring,
|
|
992
|
-
agentOptions: { keepAlive: false },
|
|
993
|
-
json: true,
|
|
1009
|
+
headers: { ...localVarHeaderParams },
|
|
994
1010
|
};
|
|
995
|
-
let
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1011
|
+
let requestOptions = localVarRequestOptions;
|
|
1012
|
+
let url = localVarUrl;
|
|
1013
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1014
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1015
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1016
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1017
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1018
|
+
url = auth_JWTAuthentication.url;
|
|
1019
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1020
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1021
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1022
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1023
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1024
|
+
url = auth_OAuth2.url;
|
|
1025
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1026
|
+
requestOptions = authDefault.requestOptions;
|
|
1027
|
+
url = authDefault.url;
|
|
1028
|
+
if (localVarFormParams) {
|
|
1029
|
+
delete requestOptions.headers['Content-Type'];
|
|
1030
|
+
if (localVarFormParams instanceof FormData) {
|
|
1031
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1032
|
+
requestOptions.body = localVarFormParams;
|
|
1009
1033
|
}
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1019
|
-
reject(new Error(body.error || errString));
|
|
1020
|
-
}
|
|
1021
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1022
|
-
resolve(body);
|
|
1023
|
-
}
|
|
1024
|
-
else {
|
|
1025
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1026
|
-
reject(errString);
|
|
1027
|
-
}
|
|
1028
|
-
}
|
|
1029
|
-
});
|
|
1030
|
-
});
|
|
1031
|
-
});
|
|
1034
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1035
|
+
// URL-encoded form
|
|
1036
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1037
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1038
|
+
}
|
|
1039
|
+
}
|
|
1040
|
+
const response = await fetch(url, requestOptions);
|
|
1041
|
+
return this.handleResponse(response, 'GetImpulseBlocksResponse');
|
|
1032
1042
|
}
|
|
1033
1043
|
/**
|
|
1034
1044
|
* Returns an unused block ID. Use this function to determine new block IDs when you construct an impulse; so you won\'t accidentally re-use block IDs.
|
|
@@ -1039,9 +1049,11 @@ class ImpulseApi {
|
|
|
1039
1049
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/get-new-block-id'
|
|
1040
1050
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1041
1051
|
let localVarQueryParameters = {};
|
|
1042
|
-
let localVarHeaderParams =
|
|
1043
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1044
|
-
|
|
1052
|
+
let localVarHeaderParams = {
|
|
1053
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1054
|
+
'Content-Type': 'application/json',
|
|
1055
|
+
...this.defaultHeaders,
|
|
1056
|
+
};
|
|
1045
1057
|
const produces = ['application/json'];
|
|
1046
1058
|
// give precedence to 'application/json'
|
|
1047
1059
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1050,60 +1062,56 @@ class ImpulseApi {
|
|
|
1050
1062
|
else {
|
|
1051
1063
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1052
1064
|
}
|
|
1053
|
-
let localVarFormParams
|
|
1065
|
+
let localVarFormParams;
|
|
1054
1066
|
// verify required parameter 'projectId' is not null or undefined
|
|
1055
1067
|
if (projectId === null || projectId === undefined) {
|
|
1056
1068
|
throw new Error('Required parameter projectId was null or undefined when calling getNewBlockId.');
|
|
1057
1069
|
}
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1070
|
+
localVarHeaderParams = {
|
|
1071
|
+
...localVarHeaderParams,
|
|
1072
|
+
...options.headers,
|
|
1073
|
+
...this.opts.extraHeaders,
|
|
1074
|
+
};
|
|
1075
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1076
|
+
.filter(([, value]) => value !== undefined)
|
|
1077
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1078
|
+
.join('&');
|
|
1079
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1061
1080
|
let localVarRequestOptions = {
|
|
1062
1081
|
method: 'POST',
|
|
1063
|
-
|
|
1064
|
-
headers: localVarHeaderParams,
|
|
1065
|
-
uri: localVarPath,
|
|
1066
|
-
useQuerystring: this._useQuerystring,
|
|
1067
|
-
agentOptions: { keepAlive: false },
|
|
1068
|
-
json: true,
|
|
1082
|
+
headers: { ...localVarHeaderParams },
|
|
1069
1083
|
};
|
|
1070
|
-
let
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
+
let requestOptions = localVarRequestOptions;
|
|
1085
|
+
let url = localVarUrl;
|
|
1086
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1087
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1088
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1089
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1090
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1091
|
+
url = auth_JWTAuthentication.url;
|
|
1092
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1093
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1094
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1095
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1096
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1097
|
+
url = auth_OAuth2.url;
|
|
1098
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1099
|
+
requestOptions = authDefault.requestOptions;
|
|
1100
|
+
url = authDefault.url;
|
|
1101
|
+
if (localVarFormParams) {
|
|
1102
|
+
delete requestOptions.headers['Content-Type'];
|
|
1103
|
+
if (localVarFormParams instanceof FormData) {
|
|
1104
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1105
|
+
requestOptions.body = localVarFormParams;
|
|
1084
1106
|
}
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1094
|
-
reject(new Error(body.error || errString));
|
|
1095
|
-
}
|
|
1096
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1097
|
-
resolve(body);
|
|
1098
|
-
}
|
|
1099
|
-
else {
|
|
1100
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1101
|
-
reject(errString);
|
|
1102
|
-
}
|
|
1103
|
-
}
|
|
1104
|
-
});
|
|
1105
|
-
});
|
|
1106
|
-
});
|
|
1107
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1108
|
+
// URL-encoded form
|
|
1109
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1110
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1111
|
+
}
|
|
1112
|
+
}
|
|
1113
|
+
const response = await fetch(url, requestOptions);
|
|
1114
|
+
return this.handleResponse(response, 'GetNewBlockIdResponse');
|
|
1107
1115
|
}
|
|
1108
1116
|
/**
|
|
1109
1117
|
* Regenerate model testing results (without re-running feature generation). Use this if thresholds changed (e.g. via setImpulseThresholds), but no job was kicked off automatically.
|
|
@@ -1116,9 +1124,11 @@ class ImpulseApi {
|
|
|
1116
1124
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1117
1125
|
.replace('{' + 'impulseId' + '}', encodeURIComponent(String(impulseId)));
|
|
1118
1126
|
let localVarQueryParameters = {};
|
|
1119
|
-
let localVarHeaderParams =
|
|
1120
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1121
|
-
|
|
1127
|
+
let localVarHeaderParams = {
|
|
1128
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1129
|
+
'Content-Type': 'application/json',
|
|
1130
|
+
...this.defaultHeaders,
|
|
1131
|
+
};
|
|
1122
1132
|
const produces = ['application/json'];
|
|
1123
1133
|
// give precedence to 'application/json'
|
|
1124
1134
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1127,7 +1137,7 @@ class ImpulseApi {
|
|
|
1127
1137
|
else {
|
|
1128
1138
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1129
1139
|
}
|
|
1130
|
-
let localVarFormParams
|
|
1140
|
+
let localVarFormParams;
|
|
1131
1141
|
// verify required parameter 'projectId' is not null or undefined
|
|
1132
1142
|
if (projectId === null || projectId === undefined) {
|
|
1133
1143
|
throw new Error('Required parameter projectId was null or undefined when calling regenerateModelTestingSummary.');
|
|
@@ -1136,55 +1146,51 @@ class ImpulseApi {
|
|
|
1136
1146
|
if (impulseId === null || impulseId === undefined) {
|
|
1137
1147
|
throw new Error('Required parameter impulseId was null or undefined when calling regenerateModelTestingSummary.');
|
|
1138
1148
|
}
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1149
|
+
localVarHeaderParams = {
|
|
1150
|
+
...localVarHeaderParams,
|
|
1151
|
+
...options.headers,
|
|
1152
|
+
...this.opts.extraHeaders,
|
|
1153
|
+
};
|
|
1154
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1155
|
+
.filter(([, value]) => value !== undefined)
|
|
1156
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1157
|
+
.join('&');
|
|
1158
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1142
1159
|
let localVarRequestOptions = {
|
|
1143
1160
|
method: 'POST',
|
|
1144
|
-
|
|
1145
|
-
headers: localVarHeaderParams,
|
|
1146
|
-
uri: localVarPath,
|
|
1147
|
-
useQuerystring: this._useQuerystring,
|
|
1148
|
-
agentOptions: { keepAlive: false },
|
|
1149
|
-
json: true,
|
|
1161
|
+
headers: { ...localVarHeaderParams },
|
|
1150
1162
|
};
|
|
1151
|
-
let
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1163
|
+
let requestOptions = localVarRequestOptions;
|
|
1164
|
+
let url = localVarUrl;
|
|
1165
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1166
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1167
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1168
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1169
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1170
|
+
url = auth_JWTAuthentication.url;
|
|
1171
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1172
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1173
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1174
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1175
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1176
|
+
url = auth_OAuth2.url;
|
|
1177
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1178
|
+
requestOptions = authDefault.requestOptions;
|
|
1179
|
+
url = authDefault.url;
|
|
1180
|
+
if (localVarFormParams) {
|
|
1181
|
+
delete requestOptions.headers['Content-Type'];
|
|
1182
|
+
if (localVarFormParams instanceof FormData) {
|
|
1183
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1184
|
+
requestOptions.body = localVarFormParams;
|
|
1165
1185
|
}
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1175
|
-
reject(new Error(body.error || errString));
|
|
1176
|
-
}
|
|
1177
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1178
|
-
resolve(body);
|
|
1179
|
-
}
|
|
1180
|
-
else {
|
|
1181
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1182
|
-
reject(errString);
|
|
1183
|
-
}
|
|
1184
|
-
}
|
|
1185
|
-
});
|
|
1186
|
-
});
|
|
1187
|
-
});
|
|
1186
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1187
|
+
// URL-encoded form
|
|
1188
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1189
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1190
|
+
}
|
|
1191
|
+
}
|
|
1192
|
+
const response = await fetch(url, requestOptions);
|
|
1193
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
1188
1194
|
}
|
|
1189
1195
|
/**
|
|
1190
1196
|
* Set thresholds (e.g. min. confidence rating, or min. anomaly score) for an impulse.
|
|
@@ -1198,9 +1204,11 @@ class ImpulseApi {
|
|
|
1198
1204
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1199
1205
|
.replace('{' + 'impulseId' + '}', encodeURIComponent(String(impulseId)));
|
|
1200
1206
|
let localVarQueryParameters = {};
|
|
1201
|
-
let localVarHeaderParams =
|
|
1202
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1203
|
-
|
|
1207
|
+
let localVarHeaderParams = {
|
|
1208
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1209
|
+
'Content-Type': 'application/json',
|
|
1210
|
+
...this.defaultHeaders,
|
|
1211
|
+
};
|
|
1204
1212
|
const produces = ['application/json'];
|
|
1205
1213
|
// give precedence to 'application/json'
|
|
1206
1214
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1209,7 +1217,7 @@ class ImpulseApi {
|
|
|
1209
1217
|
else {
|
|
1210
1218
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1211
1219
|
}
|
|
1212
|
-
let localVarFormParams
|
|
1220
|
+
let localVarFormParams;
|
|
1213
1221
|
// verify required parameter 'projectId' is not null or undefined
|
|
1214
1222
|
if (projectId === null || projectId === undefined) {
|
|
1215
1223
|
throw new Error('Required parameter projectId was null or undefined when calling setImpulseThresholds.');
|
|
@@ -1222,56 +1230,52 @@ class ImpulseApi {
|
|
|
1222
1230
|
if (setImpulseThresholdsRequest === null || setImpulseThresholdsRequest === undefined) {
|
|
1223
1231
|
throw new Error('Required parameter setImpulseThresholdsRequest was null or undefined when calling setImpulseThresholds.');
|
|
1224
1232
|
}
|
|
1225
|
-
|
|
1226
|
-
|
|
1227
|
-
|
|
1233
|
+
localVarHeaderParams = {
|
|
1234
|
+
...localVarHeaderParams,
|
|
1235
|
+
...options.headers,
|
|
1236
|
+
...this.opts.extraHeaders,
|
|
1237
|
+
};
|
|
1238
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1239
|
+
.filter(([, value]) => value !== undefined)
|
|
1240
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1241
|
+
.join('&');
|
|
1242
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1228
1243
|
let localVarRequestOptions = {
|
|
1229
1244
|
method: 'POST',
|
|
1230
|
-
|
|
1231
|
-
headers: localVarHeaderParams,
|
|
1232
|
-
uri: localVarPath,
|
|
1233
|
-
useQuerystring: this._useQuerystring,
|
|
1234
|
-
agentOptions: { keepAlive: false },
|
|
1235
|
-
json: true,
|
|
1236
|
-
body: models_1.ObjectSerializer.serialize(setImpulseThresholdsRequest, "SetImpulseThresholdsRequest")
|
|
1245
|
+
headers: { ...localVarHeaderParams },
|
|
1237
1246
|
};
|
|
1238
|
-
|
|
1239
|
-
|
|
1240
|
-
|
|
1241
|
-
|
|
1242
|
-
|
|
1243
|
-
|
|
1244
|
-
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1247
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(setImpulseThresholdsRequest, "SetImpulseThresholdsRequest"));
|
|
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;
|
|
1252
1270
|
}
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1258
|
-
|
|
1259
|
-
|
|
1260
|
-
|
|
1261
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1262
|
-
reject(new Error(body.error || errString));
|
|
1263
|
-
}
|
|
1264
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1265
|
-
resolve(body);
|
|
1266
|
-
}
|
|
1267
|
-
else {
|
|
1268
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1269
|
-
reject(errString);
|
|
1270
|
-
}
|
|
1271
|
-
}
|
|
1272
|
-
});
|
|
1273
|
-
});
|
|
1274
|
-
});
|
|
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, 'SetImpulseThresholdsResponse');
|
|
1275
1279
|
}
|
|
1276
1280
|
/**
|
|
1277
1281
|
* Set the complete impulse state for a project, writing impulses in the old (pre-impulse experiments) format. This completely clears out all files on FSx for this project. This is an internal API.
|
|
@@ -1285,9 +1289,11 @@ class ImpulseApi {
|
|
|
1285
1289
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/legacy-set-impulse'
|
|
1286
1290
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1287
1291
|
let localVarQueryParameters = {};
|
|
1288
|
-
let localVarHeaderParams =
|
|
1289
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1290
|
-
|
|
1292
|
+
let localVarHeaderParams = {
|
|
1293
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1294
|
+
'Content-Type': 'application/json',
|
|
1295
|
+
...this.defaultHeaders,
|
|
1296
|
+
};
|
|
1291
1297
|
const produces = ['application/json'];
|
|
1292
1298
|
// give precedence to 'application/json'
|
|
1293
1299
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1296,7 +1302,7 @@ class ImpulseApi {
|
|
|
1296
1302
|
else {
|
|
1297
1303
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1298
1304
|
}
|
|
1299
|
-
let localVarFormParams
|
|
1305
|
+
let localVarFormParams;
|
|
1300
1306
|
// verify required parameter 'projectId' is not null or undefined
|
|
1301
1307
|
if (projectId === null || projectId === undefined) {
|
|
1302
1308
|
throw new Error('Required parameter projectId was null or undefined when calling setLegacyImpulseStateInternal.');
|
|
@@ -1313,67 +1319,105 @@ class ImpulseApi {
|
|
|
1313
1319
|
if (params.config === null || params.config === undefined) {
|
|
1314
1320
|
throw new Error('Required parameter params.config was null or undefined when calling setLegacyImpulseStateInternal.');
|
|
1315
1321
|
}
|
|
1316
|
-
|
|
1317
|
-
|
|
1318
|
-
|
|
1322
|
+
localVarHeaderParams = {
|
|
1323
|
+
...localVarHeaderParams,
|
|
1324
|
+
...options.headers,
|
|
1325
|
+
...this.opts.extraHeaders,
|
|
1326
|
+
};
|
|
1319
1327
|
if (params.zip !== undefined) {
|
|
1320
|
-
localVarFormParams
|
|
1328
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
1329
|
+
const existingParams = localVarFormParams;
|
|
1330
|
+
localVarFormParams = new FormData();
|
|
1331
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
1332
|
+
Object.keys(existingParams).forEach(key => {
|
|
1333
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
1334
|
+
});
|
|
1335
|
+
}
|
|
1336
|
+
}
|
|
1337
|
+
const zipFiles = Array.isArray(params.zip) ? params.zip : [params.zip];
|
|
1338
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
1339
|
+
zipFiles.forEach((f) => {
|
|
1340
|
+
localVarFormParams.append('zip', new Blob([f.value], {
|
|
1341
|
+
type: f.options.contentType
|
|
1342
|
+
}), f.options.filename);
|
|
1343
|
+
});
|
|
1321
1344
|
}
|
|
1322
|
-
localVarUseFormData = true;
|
|
1323
1345
|
if (params.impulse !== undefined) {
|
|
1324
|
-
localVarFormParams
|
|
1346
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
1347
|
+
const existingParams = localVarFormParams;
|
|
1348
|
+
localVarFormParams = new FormData();
|
|
1349
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
1350
|
+
Object.keys(existingParams).forEach(key => {
|
|
1351
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
1352
|
+
});
|
|
1353
|
+
}
|
|
1354
|
+
}
|
|
1355
|
+
const impulseFiles = Array.isArray(params.impulse) ? params.impulse : [params.impulse];
|
|
1356
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
1357
|
+
impulseFiles.forEach((f) => {
|
|
1358
|
+
localVarFormParams.append('impulse', new Blob([f.value], {
|
|
1359
|
+
type: f.options.contentType
|
|
1360
|
+
}), f.options.filename);
|
|
1361
|
+
});
|
|
1325
1362
|
}
|
|
1326
|
-
localVarUseFormData = true;
|
|
1327
1363
|
if (params.config !== undefined) {
|
|
1328
|
-
localVarFormParams
|
|
1364
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
1365
|
+
const existingParams = localVarFormParams;
|
|
1366
|
+
localVarFormParams = new FormData();
|
|
1367
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
1368
|
+
Object.keys(existingParams).forEach(key => {
|
|
1369
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
1370
|
+
});
|
|
1371
|
+
}
|
|
1372
|
+
}
|
|
1373
|
+
const configFiles = Array.isArray(params.config) ? params.config : [params.config];
|
|
1374
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
1375
|
+
configFiles.forEach((f) => {
|
|
1376
|
+
localVarFormParams.append('config', new Blob([f.value], {
|
|
1377
|
+
type: f.options.contentType
|
|
1378
|
+
}), f.options.filename);
|
|
1379
|
+
});
|
|
1329
1380
|
}
|
|
1330
|
-
|
|
1381
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1382
|
+
.filter(([, value]) => value !== undefined)
|
|
1383
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1384
|
+
.join('&');
|
|
1385
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1331
1386
|
let localVarRequestOptions = {
|
|
1332
1387
|
method: 'POST',
|
|
1333
|
-
|
|
1334
|
-
headers: localVarHeaderParams,
|
|
1335
|
-
uri: localVarPath,
|
|
1336
|
-
useQuerystring: this._useQuerystring,
|
|
1337
|
-
agentOptions: { keepAlive: false },
|
|
1338
|
-
json: true,
|
|
1388
|
+
headers: { ...localVarHeaderParams },
|
|
1339
1389
|
};
|
|
1340
|
-
let
|
|
1341
|
-
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
|
|
1345
|
-
|
|
1346
|
-
|
|
1347
|
-
|
|
1348
|
-
|
|
1349
|
-
|
|
1350
|
-
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1390
|
+
let requestOptions = localVarRequestOptions;
|
|
1391
|
+
let url = localVarUrl;
|
|
1392
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1393
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1394
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1395
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1396
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1397
|
+
url = auth_JWTAuthentication.url;
|
|
1398
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1399
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1400
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1401
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1402
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1403
|
+
url = auth_OAuth2.url;
|
|
1404
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1405
|
+
requestOptions = authDefault.requestOptions;
|
|
1406
|
+
url = authDefault.url;
|
|
1407
|
+
if (localVarFormParams) {
|
|
1408
|
+
delete requestOptions.headers['Content-Type'];
|
|
1409
|
+
if (localVarFormParams instanceof FormData) {
|
|
1410
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1411
|
+
requestOptions.body = localVarFormParams;
|
|
1354
1412
|
}
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1363
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1364
|
-
reject(new Error(body.error || errString));
|
|
1365
|
-
}
|
|
1366
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1367
|
-
resolve(body);
|
|
1368
|
-
}
|
|
1369
|
-
else {
|
|
1370
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1371
|
-
reject(errString);
|
|
1372
|
-
}
|
|
1373
|
-
}
|
|
1374
|
-
});
|
|
1375
|
-
});
|
|
1376
|
-
});
|
|
1413
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1414
|
+
// URL-encoded form
|
|
1415
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1416
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
const response = await fetch(url, requestOptions);
|
|
1420
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1377
1421
|
}
|
|
1378
1422
|
/**
|
|
1379
1423
|
* Update the impulse for this project. If you specify `impulseId` then that impulse is created/updated, otherwise the default impulse is created/updated.
|
|
@@ -1386,9 +1430,11 @@ class ImpulseApi {
|
|
|
1386
1430
|
const localVarPath = this.basePath + '/api/{projectId}/impulse/update'
|
|
1387
1431
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1388
1432
|
let localVarQueryParameters = {};
|
|
1389
|
-
let localVarHeaderParams =
|
|
1390
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1391
|
-
|
|
1433
|
+
let localVarHeaderParams = {
|
|
1434
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1435
|
+
'Content-Type': 'application/json',
|
|
1436
|
+
...this.defaultHeaders,
|
|
1437
|
+
};
|
|
1392
1438
|
const produces = ['application/json'];
|
|
1393
1439
|
// give precedence to 'application/json'
|
|
1394
1440
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1397,7 +1443,7 @@ class ImpulseApi {
|
|
|
1397
1443
|
else {
|
|
1398
1444
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1399
1445
|
}
|
|
1400
|
-
let localVarFormParams
|
|
1446
|
+
let localVarFormParams;
|
|
1401
1447
|
// verify required parameter 'projectId' is not null or undefined
|
|
1402
1448
|
if (projectId === null || projectId === undefined) {
|
|
1403
1449
|
throw new Error('Required parameter projectId was null or undefined when calling updateImpulse.');
|
|
@@ -1409,56 +1455,52 @@ class ImpulseApi {
|
|
|
1409
1455
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.impulseId) !== undefined) {
|
|
1410
1456
|
localVarQueryParameters['impulseId'] = models_1.ObjectSerializer.serialize(queryParams.impulseId, "number");
|
|
1411
1457
|
}
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1458
|
+
localVarHeaderParams = {
|
|
1459
|
+
...localVarHeaderParams,
|
|
1460
|
+
...options.headers,
|
|
1461
|
+
...this.opts.extraHeaders,
|
|
1462
|
+
};
|
|
1463
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1464
|
+
.filter(([, value]) => value !== undefined)
|
|
1465
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1466
|
+
.join('&');
|
|
1467
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1415
1468
|
let localVarRequestOptions = {
|
|
1416
1469
|
method: 'POST',
|
|
1417
|
-
|
|
1418
|
-
headers: localVarHeaderParams,
|
|
1419
|
-
uri: localVarPath,
|
|
1420
|
-
useQuerystring: this._useQuerystring,
|
|
1421
|
-
agentOptions: { keepAlive: false },
|
|
1422
|
-
json: true,
|
|
1423
|
-
body: models_1.ObjectSerializer.serialize(updateImpulseRequest, "UpdateImpulseRequest")
|
|
1470
|
+
headers: { ...localVarHeaderParams },
|
|
1424
1471
|
};
|
|
1425
|
-
|
|
1426
|
-
|
|
1427
|
-
|
|
1428
|
-
|
|
1429
|
-
|
|
1430
|
-
|
|
1431
|
-
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
|
|
1435
|
-
|
|
1436
|
-
|
|
1437
|
-
|
|
1438
|
-
|
|
1472
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateImpulseRequest, "UpdateImpulseRequest"));
|
|
1473
|
+
let requestOptions = localVarRequestOptions;
|
|
1474
|
+
let url = localVarUrl;
|
|
1475
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1476
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1477
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1478
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1479
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1480
|
+
url = auth_JWTAuthentication.url;
|
|
1481
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1482
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1483
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1484
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1485
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1486
|
+
url = auth_OAuth2.url;
|
|
1487
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1488
|
+
requestOptions = authDefault.requestOptions;
|
|
1489
|
+
url = authDefault.url;
|
|
1490
|
+
if (localVarFormParams) {
|
|
1491
|
+
delete requestOptions.headers['Content-Type'];
|
|
1492
|
+
if (localVarFormParams instanceof FormData) {
|
|
1493
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1494
|
+
requestOptions.body = localVarFormParams;
|
|
1439
1495
|
}
|
|
1440
|
-
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1449
|
-
reject(new Error(body.error || errString));
|
|
1450
|
-
}
|
|
1451
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1452
|
-
resolve(body);
|
|
1453
|
-
}
|
|
1454
|
-
else {
|
|
1455
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1456
|
-
reject(errString);
|
|
1457
|
-
}
|
|
1458
|
-
}
|
|
1459
|
-
});
|
|
1460
|
-
});
|
|
1461
|
-
});
|
|
1496
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1497
|
+
// URL-encoded form
|
|
1498
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1499
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1500
|
+
}
|
|
1501
|
+
}
|
|
1502
|
+
const response = await fetch(url, requestOptions);
|
|
1503
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1462
1504
|
}
|
|
1463
1505
|
/**
|
|
1464
1506
|
* Verify the validity of a custom DSP block
|
|
@@ -1470,9 +1512,11 @@ class ImpulseApi {
|
|
|
1470
1512
|
const localVarPath = this.basePath + '/api/{projectId}/verify-dsp-block/url'
|
|
1471
1513
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
1472
1514
|
let localVarQueryParameters = {};
|
|
1473
|
-
let localVarHeaderParams =
|
|
1474
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1475
|
-
|
|
1515
|
+
let localVarHeaderParams = {
|
|
1516
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1517
|
+
'Content-Type': 'application/json',
|
|
1518
|
+
...this.defaultHeaders,
|
|
1519
|
+
};
|
|
1476
1520
|
const produces = ['application/json'];
|
|
1477
1521
|
// give precedence to 'application/json'
|
|
1478
1522
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1481,7 +1525,7 @@ class ImpulseApi {
|
|
|
1481
1525
|
else {
|
|
1482
1526
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1483
1527
|
}
|
|
1484
|
-
let localVarFormParams
|
|
1528
|
+
let localVarFormParams;
|
|
1485
1529
|
// verify required parameter 'projectId' is not null or undefined
|
|
1486
1530
|
if (projectId === null || projectId === undefined) {
|
|
1487
1531
|
throw new Error('Required parameter projectId was null or undefined when calling verifyDspBlockUrl.');
|
|
@@ -1490,56 +1534,52 @@ class ImpulseApi {
|
|
|
1490
1534
|
if (verifyDspBlockUrlRequest === null || verifyDspBlockUrlRequest === undefined) {
|
|
1491
1535
|
throw new Error('Required parameter verifyDspBlockUrlRequest was null or undefined when calling verifyDspBlockUrl.');
|
|
1492
1536
|
}
|
|
1493
|
-
|
|
1494
|
-
|
|
1495
|
-
|
|
1537
|
+
localVarHeaderParams = {
|
|
1538
|
+
...localVarHeaderParams,
|
|
1539
|
+
...options.headers,
|
|
1540
|
+
...this.opts.extraHeaders,
|
|
1541
|
+
};
|
|
1542
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1543
|
+
.filter(([, value]) => value !== undefined)
|
|
1544
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1545
|
+
.join('&');
|
|
1546
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1496
1547
|
let localVarRequestOptions = {
|
|
1497
1548
|
method: 'POST',
|
|
1498
|
-
|
|
1499
|
-
headers: localVarHeaderParams,
|
|
1500
|
-
uri: localVarPath,
|
|
1501
|
-
useQuerystring: this._useQuerystring,
|
|
1502
|
-
agentOptions: { keepAlive: false },
|
|
1503
|
-
json: true,
|
|
1504
|
-
body: models_1.ObjectSerializer.serialize(verifyDspBlockUrlRequest, "VerifyDspBlockUrlRequest")
|
|
1549
|
+
headers: { ...localVarHeaderParams },
|
|
1505
1550
|
};
|
|
1506
|
-
|
|
1507
|
-
|
|
1508
|
-
|
|
1509
|
-
|
|
1510
|
-
|
|
1511
|
-
|
|
1512
|
-
|
|
1513
|
-
|
|
1514
|
-
|
|
1515
|
-
|
|
1516
|
-
|
|
1517
|
-
|
|
1518
|
-
|
|
1519
|
-
|
|
1551
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(verifyDspBlockUrlRequest, "VerifyDspBlockUrlRequest"));
|
|
1552
|
+
let requestOptions = localVarRequestOptions;
|
|
1553
|
+
let url = localVarUrl;
|
|
1554
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1555
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1556
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1557
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1558
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1559
|
+
url = auth_JWTAuthentication.url;
|
|
1560
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1561
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1562
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1563
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1564
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1565
|
+
url = auth_OAuth2.url;
|
|
1566
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1567
|
+
requestOptions = authDefault.requestOptions;
|
|
1568
|
+
url = authDefault.url;
|
|
1569
|
+
if (localVarFormParams) {
|
|
1570
|
+
delete requestOptions.headers['Content-Type'];
|
|
1571
|
+
if (localVarFormParams instanceof FormData) {
|
|
1572
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1573
|
+
requestOptions.body = localVarFormParams;
|
|
1520
1574
|
}
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1529
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1530
|
-
reject(new Error(body.error || errString));
|
|
1531
|
-
}
|
|
1532
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1533
|
-
resolve(body);
|
|
1534
|
-
}
|
|
1535
|
-
else {
|
|
1536
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1537
|
-
reject(errString);
|
|
1538
|
-
}
|
|
1539
|
-
}
|
|
1540
|
-
});
|
|
1541
|
-
});
|
|
1542
|
-
});
|
|
1575
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1576
|
+
// URL-encoded form
|
|
1577
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1578
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1579
|
+
}
|
|
1580
|
+
}
|
|
1581
|
+
const response = await fetch(url, requestOptions);
|
|
1582
|
+
return this.handleResponse(response, 'VerifyDspBlockUrlResponse');
|
|
1543
1583
|
}
|
|
1544
1584
|
}
|
|
1545
1585
|
exports.ImpulseApi = ImpulseApi;
|