edge-impulse-api 1.82.6 → 1.82.8
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.DSPApi = exports.DSPApiApiKeys = 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 DSPApiApiKeys;
|
|
|
30
47
|
DSPApiApiKeys[DSPApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(DSPApiApiKeys = exports.DSPApiApiKeys || (exports.DSPApiApiKeys = {}));
|
|
32
49
|
class DSPApi {
|
|
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 DSPApi {
|
|
|
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
|
}
|
|
@@ -89,9 +123,11 @@ class DSPApi {
|
|
|
89
123
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
90
124
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
91
125
|
let localVarQueryParameters = {};
|
|
92
|
-
let localVarHeaderParams =
|
|
93
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
94
|
-
|
|
126
|
+
let localVarHeaderParams = {
|
|
127
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
...this.defaultHeaders,
|
|
130
|
+
};
|
|
95
131
|
const produces = ['application/json'];
|
|
96
132
|
// give precedence to 'application/json'
|
|
97
133
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -100,7 +136,7 @@ class DSPApi {
|
|
|
100
136
|
else {
|
|
101
137
|
localVarHeaderParams.Accept = produces.join(',');
|
|
102
138
|
}
|
|
103
|
-
let localVarFormParams
|
|
139
|
+
let localVarFormParams;
|
|
104
140
|
// verify required parameter 'projectId' is not null or undefined
|
|
105
141
|
if (projectId === null || projectId === undefined) {
|
|
106
142
|
throw new Error('Required parameter projectId was null or undefined when calling clearDspBlock.');
|
|
@@ -109,55 +145,51 @@ class DSPApi {
|
|
|
109
145
|
if (dspId === null || dspId === undefined) {
|
|
110
146
|
throw new Error('Required parameter dspId was null or undefined when calling clearDspBlock.');
|
|
111
147
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
localVarHeaderParams = {
|
|
149
|
+
...localVarHeaderParams,
|
|
150
|
+
...options.headers,
|
|
151
|
+
...this.opts.extraHeaders,
|
|
152
|
+
};
|
|
153
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
154
|
+
.filter(([, value]) => value !== undefined)
|
|
155
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
156
|
+
.join('&');
|
|
157
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
115
158
|
let localVarRequestOptions = {
|
|
116
159
|
method: 'POST',
|
|
117
|
-
|
|
118
|
-
headers: localVarHeaderParams,
|
|
119
|
-
uri: localVarPath,
|
|
120
|
-
useQuerystring: this._useQuerystring,
|
|
121
|
-
agentOptions: { keepAlive: false },
|
|
122
|
-
json: true,
|
|
160
|
+
headers: { ...localVarHeaderParams },
|
|
123
161
|
};
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
let requestOptions = localVarRequestOptions;
|
|
163
|
+
let url = localVarUrl;
|
|
164
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
165
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
166
|
+
url = auth_ApiKeyAuthentication.url;
|
|
167
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
168
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
169
|
+
url = auth_JWTAuthentication.url;
|
|
170
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
171
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
172
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
173
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
174
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
175
|
+
url = auth_OAuth2.url;
|
|
176
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
177
|
+
requestOptions = authDefault.requestOptions;
|
|
178
|
+
url = authDefault.url;
|
|
179
|
+
if (localVarFormParams) {
|
|
180
|
+
delete requestOptions.headers['Content-Type'];
|
|
181
|
+
if (localVarFormParams instanceof FormData) {
|
|
182
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
183
|
+
requestOptions.body = localVarFormParams;
|
|
184
|
+
}
|
|
185
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
186
|
+
// URL-encoded form
|
|
187
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
188
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
138
189
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
reject(error);
|
|
143
|
-
}
|
|
144
|
-
else {
|
|
145
|
-
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
146
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
147
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
148
|
-
reject(new Error(body.error || errString));
|
|
149
|
-
}
|
|
150
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
151
|
-
resolve(body);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
155
|
-
reject(errString);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
});
|
|
190
|
+
}
|
|
191
|
+
const response = await fetch(url, requestOptions);
|
|
192
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
161
193
|
}
|
|
162
194
|
/**
|
|
163
195
|
* Download an artifact from a DSP block for debugging. This is an internal API.
|
|
@@ -172,9 +204,11 @@ class DSPApi {
|
|
|
172
204
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
173
205
|
.replace('{' + 'key' + '}', encodeURIComponent(String(key)));
|
|
174
206
|
let localVarQueryParameters = {};
|
|
175
|
-
let localVarHeaderParams =
|
|
176
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
177
|
-
|
|
207
|
+
let localVarHeaderParams = {
|
|
208
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
209
|
+
'Content-Type': 'application/json',
|
|
210
|
+
...this.defaultHeaders,
|
|
211
|
+
};
|
|
178
212
|
const produces = ['application/octet-stream'];
|
|
179
213
|
// give precedence to 'application/json'
|
|
180
214
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -183,7 +217,7 @@ class DSPApi {
|
|
|
183
217
|
else {
|
|
184
218
|
localVarHeaderParams.Accept = produces.join(',');
|
|
185
219
|
}
|
|
186
|
-
let localVarFormParams
|
|
220
|
+
let localVarFormParams;
|
|
187
221
|
// verify required parameter 'projectId' is not null or undefined
|
|
188
222
|
if (projectId === null || projectId === undefined) {
|
|
189
223
|
throw new Error('Required parameter projectId was null or undefined when calling downloadDspArtifact.');
|
|
@@ -196,55 +230,51 @@ class DSPApi {
|
|
|
196
230
|
if (key === null || key === undefined) {
|
|
197
231
|
throw new Error('Required parameter key was null or undefined when calling downloadDspArtifact.');
|
|
198
232
|
}
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
233
|
+
localVarHeaderParams = {
|
|
234
|
+
...localVarHeaderParams,
|
|
235
|
+
...options.headers,
|
|
236
|
+
...this.opts.extraHeaders,
|
|
237
|
+
};
|
|
238
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
239
|
+
.filter(([, value]) => value !== undefined)
|
|
240
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
241
|
+
.join('&');
|
|
242
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
202
243
|
let localVarRequestOptions = {
|
|
203
244
|
method: 'GET',
|
|
204
|
-
|
|
205
|
-
headers: localVarHeaderParams,
|
|
206
|
-
uri: localVarPath,
|
|
207
|
-
useQuerystring: this._useQuerystring,
|
|
208
|
-
agentOptions: { keepAlive: false },
|
|
209
|
-
encoding: null,
|
|
245
|
+
headers: { ...localVarHeaderParams },
|
|
210
246
|
};
|
|
211
|
-
let
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
247
|
+
let requestOptions = localVarRequestOptions;
|
|
248
|
+
let url = localVarUrl;
|
|
249
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
250
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
251
|
+
url = auth_ApiKeyAuthentication.url;
|
|
252
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
253
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
254
|
+
url = auth_JWTAuthentication.url;
|
|
255
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
256
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
257
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
258
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
259
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
260
|
+
url = auth_OAuth2.url;
|
|
261
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
262
|
+
requestOptions = authDefault.requestOptions;
|
|
263
|
+
url = authDefault.url;
|
|
264
|
+
if (localVarFormParams) {
|
|
265
|
+
delete requestOptions.headers['Content-Type'];
|
|
266
|
+
if (localVarFormParams instanceof FormData) {
|
|
267
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
268
|
+
requestOptions.body = localVarFormParams;
|
|
225
269
|
}
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
235
|
-
reject(new Error(body.error || errString));
|
|
236
|
-
}
|
|
237
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
238
|
-
resolve(body);
|
|
239
|
-
}
|
|
240
|
-
else {
|
|
241
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
242
|
-
reject(errString);
|
|
243
|
-
}
|
|
244
|
-
}
|
|
245
|
-
});
|
|
246
|
-
});
|
|
247
|
-
});
|
|
270
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
271
|
+
// URL-encoded form
|
|
272
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
273
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
274
|
+
}
|
|
275
|
+
}
|
|
276
|
+
const response = await fetch(url, requestOptions);
|
|
277
|
+
return this.handleResponse(response, 'Buffer');
|
|
248
278
|
}
|
|
249
279
|
/**
|
|
250
280
|
* Download output from a DSP block over all data in the training set, already sliced in windows. In Numpy binary format.
|
|
@@ -260,9 +290,11 @@ class DSPApi {
|
|
|
260
290
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
261
291
|
.replace('{' + 'category' + '}', encodeURIComponent(String(category)));
|
|
262
292
|
let localVarQueryParameters = {};
|
|
263
|
-
let localVarHeaderParams =
|
|
264
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
265
|
-
|
|
293
|
+
let localVarHeaderParams = {
|
|
294
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
295
|
+
'Content-Type': 'application/json',
|
|
296
|
+
...this.defaultHeaders,
|
|
297
|
+
};
|
|
266
298
|
const produces = ['application/octet-stream'];
|
|
267
299
|
// give precedence to 'application/json'
|
|
268
300
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -271,7 +303,7 @@ class DSPApi {
|
|
|
271
303
|
else {
|
|
272
304
|
localVarHeaderParams.Accept = produces.join(',');
|
|
273
305
|
}
|
|
274
|
-
let localVarFormParams
|
|
306
|
+
let localVarFormParams;
|
|
275
307
|
// verify required parameter 'projectId' is not null or undefined
|
|
276
308
|
if (projectId === null || projectId === undefined) {
|
|
277
309
|
throw new Error('Required parameter projectId was null or undefined when calling downloadDspData.');
|
|
@@ -287,55 +319,51 @@ class DSPApi {
|
|
|
287
319
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.raw) !== undefined) {
|
|
288
320
|
localVarQueryParameters['raw'] = models_1.ObjectSerializer.serialize(queryParams.raw, "boolean");
|
|
289
321
|
}
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
322
|
+
localVarHeaderParams = {
|
|
323
|
+
...localVarHeaderParams,
|
|
324
|
+
...options.headers,
|
|
325
|
+
...this.opts.extraHeaders,
|
|
326
|
+
};
|
|
327
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
328
|
+
.filter(([, value]) => value !== undefined)
|
|
329
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
330
|
+
.join('&');
|
|
331
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
293
332
|
let localVarRequestOptions = {
|
|
294
333
|
method: 'GET',
|
|
295
|
-
|
|
296
|
-
headers: localVarHeaderParams,
|
|
297
|
-
uri: localVarPath,
|
|
298
|
-
useQuerystring: this._useQuerystring,
|
|
299
|
-
agentOptions: { keepAlive: false },
|
|
300
|
-
encoding: null,
|
|
334
|
+
headers: { ...localVarHeaderParams },
|
|
301
335
|
};
|
|
302
|
-
let
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
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;
|
|
358
|
+
}
|
|
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';
|
|
316
363
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
reject(error);
|
|
321
|
-
}
|
|
322
|
-
else {
|
|
323
|
-
body = models_1.ObjectSerializer.deserialize(body, "Buffer");
|
|
324
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
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
|
-
});
|
|
364
|
+
}
|
|
365
|
+
const response = await fetch(url, requestOptions);
|
|
366
|
+
return this.handleResponse(response, 'Buffer');
|
|
339
367
|
}
|
|
340
368
|
/**
|
|
341
369
|
* Download labels for a DSP block over all data in the training set, already sliced in windows.
|
|
@@ -350,9 +378,11 @@ class DSPApi {
|
|
|
350
378
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
351
379
|
.replace('{' + 'category' + '}', encodeURIComponent(String(category)));
|
|
352
380
|
let localVarQueryParameters = {};
|
|
353
|
-
let localVarHeaderParams =
|
|
354
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
355
|
-
|
|
381
|
+
let localVarHeaderParams = {
|
|
382
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
383
|
+
'Content-Type': 'application/json',
|
|
384
|
+
...this.defaultHeaders,
|
|
385
|
+
};
|
|
356
386
|
const produces = ['application/octet-stream'];
|
|
357
387
|
// give precedence to 'application/json'
|
|
358
388
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -361,7 +391,7 @@ class DSPApi {
|
|
|
361
391
|
else {
|
|
362
392
|
localVarHeaderParams.Accept = produces.join(',');
|
|
363
393
|
}
|
|
364
|
-
let localVarFormParams
|
|
394
|
+
let localVarFormParams;
|
|
365
395
|
// verify required parameter 'projectId' is not null or undefined
|
|
366
396
|
if (projectId === null || projectId === undefined) {
|
|
367
397
|
throw new Error('Required parameter projectId was null or undefined when calling downloadDspLabels.');
|
|
@@ -374,55 +404,51 @@ class DSPApi {
|
|
|
374
404
|
if (category === null || category === undefined) {
|
|
375
405
|
throw new Error('Required parameter category was null or undefined when calling downloadDspLabels.');
|
|
376
406
|
}
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
407
|
+
localVarHeaderParams = {
|
|
408
|
+
...localVarHeaderParams,
|
|
409
|
+
...options.headers,
|
|
410
|
+
...this.opts.extraHeaders,
|
|
411
|
+
};
|
|
412
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
413
|
+
.filter(([, value]) => value !== undefined)
|
|
414
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
415
|
+
.join('&');
|
|
416
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
380
417
|
let localVarRequestOptions = {
|
|
381
418
|
method: 'GET',
|
|
382
|
-
|
|
383
|
-
headers: localVarHeaderParams,
|
|
384
|
-
uri: localVarPath,
|
|
385
|
-
useQuerystring: this._useQuerystring,
|
|
386
|
-
agentOptions: { keepAlive: false },
|
|
387
|
-
encoding: null,
|
|
419
|
+
headers: { ...localVarHeaderParams },
|
|
388
420
|
};
|
|
389
|
-
let
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
421
|
+
let requestOptions = localVarRequestOptions;
|
|
422
|
+
let url = localVarUrl;
|
|
423
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
424
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
425
|
+
url = auth_ApiKeyAuthentication.url;
|
|
426
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
427
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
428
|
+
url = auth_JWTAuthentication.url;
|
|
429
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
430
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
431
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
432
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
433
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
434
|
+
url = auth_OAuth2.url;
|
|
435
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
436
|
+
requestOptions = authDefault.requestOptions;
|
|
437
|
+
url = authDefault.url;
|
|
438
|
+
if (localVarFormParams) {
|
|
439
|
+
delete requestOptions.headers['Content-Type'];
|
|
440
|
+
if (localVarFormParams instanceof FormData) {
|
|
441
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
442
|
+
requestOptions.body = localVarFormParams;
|
|
403
443
|
}
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
413
|
-
reject(new Error(body.error || errString));
|
|
414
|
-
}
|
|
415
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
416
|
-
resolve(body);
|
|
417
|
-
}
|
|
418
|
-
else {
|
|
419
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
420
|
-
reject(errString);
|
|
421
|
-
}
|
|
422
|
-
}
|
|
423
|
-
});
|
|
424
|
-
});
|
|
425
|
-
});
|
|
444
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
445
|
+
// URL-encoded form
|
|
446
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
447
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
const response = await fetch(url, requestOptions);
|
|
451
|
+
return this.handleResponse(response, 'Buffer');
|
|
426
452
|
}
|
|
427
453
|
/**
|
|
428
454
|
* Runs the DSP block against a sample. This will move the sliding window (dependent on the sliding window length and the sliding window increase parameters in the impulse) over the complete file, and run the DSP function for every window that is extracted.
|
|
@@ -437,9 +463,11 @@ class DSPApi {
|
|
|
437
463
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
438
464
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
439
465
|
let localVarQueryParameters = {};
|
|
440
|
-
let localVarHeaderParams =
|
|
441
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
442
|
-
|
|
466
|
+
let localVarHeaderParams = {
|
|
467
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
468
|
+
'Content-Type': 'application/json',
|
|
469
|
+
...this.defaultHeaders,
|
|
470
|
+
};
|
|
443
471
|
const produces = ['application/json'];
|
|
444
472
|
// give precedence to 'application/json'
|
|
445
473
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -448,7 +476,7 @@ class DSPApi {
|
|
|
448
476
|
else {
|
|
449
477
|
localVarHeaderParams.Accept = produces.join(',');
|
|
450
478
|
}
|
|
451
|
-
let localVarFormParams
|
|
479
|
+
let localVarFormParams;
|
|
452
480
|
// verify required parameter 'projectId' is not null or undefined
|
|
453
481
|
if (projectId === null || projectId === undefined) {
|
|
454
482
|
throw new Error('Required parameter projectId was null or undefined when calling dspGetFeaturesForSample.');
|
|
@@ -461,55 +489,51 @@ class DSPApi {
|
|
|
461
489
|
if (sampleId === null || sampleId === undefined) {
|
|
462
490
|
throw new Error('Required parameter sampleId was null or undefined when calling dspGetFeaturesForSample.');
|
|
463
491
|
}
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
492
|
+
localVarHeaderParams = {
|
|
493
|
+
...localVarHeaderParams,
|
|
494
|
+
...options.headers,
|
|
495
|
+
...this.opts.extraHeaders,
|
|
496
|
+
};
|
|
497
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
498
|
+
.filter(([, value]) => value !== undefined)
|
|
499
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
500
|
+
.join('&');
|
|
501
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
467
502
|
let localVarRequestOptions = {
|
|
468
503
|
method: 'GET',
|
|
469
|
-
|
|
470
|
-
headers: localVarHeaderParams,
|
|
471
|
-
uri: localVarPath,
|
|
472
|
-
useQuerystring: this._useQuerystring,
|
|
473
|
-
agentOptions: { keepAlive: false },
|
|
474
|
-
json: true,
|
|
504
|
+
headers: { ...localVarHeaderParams },
|
|
475
505
|
};
|
|
476
|
-
let
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
506
|
+
let requestOptions = localVarRequestOptions;
|
|
507
|
+
let url = localVarUrl;
|
|
508
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
509
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
510
|
+
url = auth_ApiKeyAuthentication.url;
|
|
511
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
512
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
513
|
+
url = auth_JWTAuthentication.url;
|
|
514
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
515
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
516
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
517
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
518
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
519
|
+
url = auth_OAuth2.url;
|
|
520
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
521
|
+
requestOptions = authDefault.requestOptions;
|
|
522
|
+
url = authDefault.url;
|
|
523
|
+
if (localVarFormParams) {
|
|
524
|
+
delete requestOptions.headers['Content-Type'];
|
|
525
|
+
if (localVarFormParams instanceof FormData) {
|
|
526
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
527
|
+
requestOptions.body = localVarFormParams;
|
|
528
|
+
}
|
|
529
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
530
|
+
// URL-encoded form
|
|
531
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
532
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
490
533
|
}
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
reject(error);
|
|
495
|
-
}
|
|
496
|
-
else {
|
|
497
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspSampleFeaturesResponse");
|
|
498
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
499
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
500
|
-
reject(new Error(body.error || errString));
|
|
501
|
-
}
|
|
502
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
503
|
-
resolve(body);
|
|
504
|
-
}
|
|
505
|
-
else {
|
|
506
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
507
|
-
reject(errString);
|
|
508
|
-
}
|
|
509
|
-
}
|
|
510
|
-
});
|
|
511
|
-
});
|
|
512
|
-
});
|
|
534
|
+
}
|
|
535
|
+
const response = await fetch(url, requestOptions);
|
|
536
|
+
return this.handleResponse(response, 'DspSampleFeaturesResponse');
|
|
513
537
|
}
|
|
514
538
|
/**
|
|
515
539
|
* Get a sample of trained features, this extracts a number of samples and their labels. Used to visualize the current training set.
|
|
@@ -527,9 +551,11 @@ class DSPApi {
|
|
|
527
551
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
528
552
|
.replace('{' + 'category' + '}', encodeURIComponent(String(category)));
|
|
529
553
|
let localVarQueryParameters = {};
|
|
530
|
-
let localVarHeaderParams =
|
|
531
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
532
|
-
|
|
554
|
+
let localVarHeaderParams = {
|
|
555
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
556
|
+
'Content-Type': 'application/json',
|
|
557
|
+
...this.defaultHeaders,
|
|
558
|
+
};
|
|
533
559
|
const produces = ['application/json'];
|
|
534
560
|
// give precedence to 'application/json'
|
|
535
561
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -538,7 +564,7 @@ class DSPApi {
|
|
|
538
564
|
else {
|
|
539
565
|
localVarHeaderParams.Accept = produces.join(',');
|
|
540
566
|
}
|
|
541
|
-
let localVarFormParams
|
|
567
|
+
let localVarFormParams;
|
|
542
568
|
// verify required parameter 'projectId' is not null or undefined
|
|
543
569
|
if (projectId === null || projectId === undefined) {
|
|
544
570
|
throw new Error('Required parameter projectId was null or undefined when calling dspSampleTrainedFeatures.');
|
|
@@ -572,55 +598,51 @@ class DSPApi {
|
|
|
572
598
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.featureAx3) !== undefined) {
|
|
573
599
|
localVarQueryParameters['featureAx3'] = models_1.ObjectSerializer.serialize(queryParams.featureAx3, "number");
|
|
574
600
|
}
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
601
|
+
localVarHeaderParams = {
|
|
602
|
+
...localVarHeaderParams,
|
|
603
|
+
...options.headers,
|
|
604
|
+
...this.opts.extraHeaders,
|
|
605
|
+
};
|
|
606
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
607
|
+
.filter(([, value]) => value !== undefined)
|
|
608
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
609
|
+
.join('&');
|
|
610
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
578
611
|
let localVarRequestOptions = {
|
|
579
612
|
method: 'GET',
|
|
580
|
-
|
|
581
|
-
headers: localVarHeaderParams,
|
|
582
|
-
uri: localVarPath,
|
|
583
|
-
useQuerystring: this._useQuerystring,
|
|
584
|
-
agentOptions: { keepAlive: false },
|
|
585
|
-
json: true,
|
|
613
|
+
headers: { ...localVarHeaderParams },
|
|
586
614
|
};
|
|
587
|
-
let
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
615
|
+
let requestOptions = localVarRequestOptions;
|
|
616
|
+
let url = localVarUrl;
|
|
617
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
618
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
619
|
+
url = auth_ApiKeyAuthentication.url;
|
|
620
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
621
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
622
|
+
url = auth_JWTAuthentication.url;
|
|
623
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
624
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
625
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
626
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
627
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
628
|
+
url = auth_OAuth2.url;
|
|
629
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
630
|
+
requestOptions = authDefault.requestOptions;
|
|
631
|
+
url = authDefault.url;
|
|
632
|
+
if (localVarFormParams) {
|
|
633
|
+
delete requestOptions.headers['Content-Type'];
|
|
634
|
+
if (localVarFormParams instanceof FormData) {
|
|
635
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
636
|
+
requestOptions.body = localVarFormParams;
|
|
601
637
|
}
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
611
|
-
reject(new Error(body.error || errString));
|
|
612
|
-
}
|
|
613
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
614
|
-
resolve(body);
|
|
615
|
-
}
|
|
616
|
-
else {
|
|
617
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
618
|
-
reject(errString);
|
|
619
|
-
}
|
|
620
|
-
}
|
|
621
|
-
});
|
|
622
|
-
});
|
|
623
|
-
});
|
|
638
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
639
|
+
// URL-encoded form
|
|
640
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
641
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
642
|
+
}
|
|
643
|
+
}
|
|
644
|
+
const response = await fetch(url, requestOptions);
|
|
645
|
+
return this.handleResponse(response, 'DspTrainedFeaturesResponse');
|
|
624
646
|
}
|
|
625
647
|
/**
|
|
626
648
|
* Get a set of parameters, found as a result of running the DSP autotuner.
|
|
@@ -633,9 +655,11 @@ class DSPApi {
|
|
|
633
655
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
634
656
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
635
657
|
let localVarQueryParameters = {};
|
|
636
|
-
let localVarHeaderParams =
|
|
637
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
638
|
-
|
|
658
|
+
let localVarHeaderParams = {
|
|
659
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
660
|
+
'Content-Type': 'application/json',
|
|
661
|
+
...this.defaultHeaders,
|
|
662
|
+
};
|
|
639
663
|
const produces = ['application/json'];
|
|
640
664
|
// give precedence to 'application/json'
|
|
641
665
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -644,7 +668,7 @@ class DSPApi {
|
|
|
644
668
|
else {
|
|
645
669
|
localVarHeaderParams.Accept = produces.join(',');
|
|
646
670
|
}
|
|
647
|
-
let localVarFormParams
|
|
671
|
+
let localVarFormParams;
|
|
648
672
|
// verify required parameter 'projectId' is not null or undefined
|
|
649
673
|
if (projectId === null || projectId === undefined) {
|
|
650
674
|
throw new Error('Required parameter projectId was null or undefined when calling getAutotunerResults.');
|
|
@@ -653,55 +677,51 @@ class DSPApi {
|
|
|
653
677
|
if (dspId === null || dspId === undefined) {
|
|
654
678
|
throw new Error('Required parameter dspId was null or undefined when calling getAutotunerResults.');
|
|
655
679
|
}
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
680
|
+
localVarHeaderParams = {
|
|
681
|
+
...localVarHeaderParams,
|
|
682
|
+
...options.headers,
|
|
683
|
+
...this.opts.extraHeaders,
|
|
684
|
+
};
|
|
685
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
686
|
+
.filter(([, value]) => value !== undefined)
|
|
687
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
688
|
+
.join('&');
|
|
689
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
659
690
|
let localVarRequestOptions = {
|
|
660
691
|
method: 'GET',
|
|
661
|
-
|
|
662
|
-
headers: localVarHeaderParams,
|
|
663
|
-
uri: localVarPath,
|
|
664
|
-
useQuerystring: this._useQuerystring,
|
|
665
|
-
agentOptions: { keepAlive: false },
|
|
666
|
-
json: true,
|
|
692
|
+
headers: { ...localVarHeaderParams },
|
|
667
693
|
};
|
|
668
|
-
let
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
694
|
+
let requestOptions = localVarRequestOptions;
|
|
695
|
+
let url = localVarUrl;
|
|
696
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
697
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
698
|
+
url = auth_ApiKeyAuthentication.url;
|
|
699
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
700
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
701
|
+
url = auth_JWTAuthentication.url;
|
|
702
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
703
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
704
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
705
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
706
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
707
|
+
url = auth_OAuth2.url;
|
|
708
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
709
|
+
requestOptions = authDefault.requestOptions;
|
|
710
|
+
url = authDefault.url;
|
|
711
|
+
if (localVarFormParams) {
|
|
712
|
+
delete requestOptions.headers['Content-Type'];
|
|
713
|
+
if (localVarFormParams instanceof FormData) {
|
|
714
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
715
|
+
requestOptions.body = localVarFormParams;
|
|
716
|
+
}
|
|
717
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
718
|
+
// URL-encoded form
|
|
719
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
720
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
682
721
|
}
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
reject(error);
|
|
687
|
-
}
|
|
688
|
-
else {
|
|
689
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspAutotunerResults");
|
|
690
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
691
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
692
|
-
reject(new Error(body.error || errString));
|
|
693
|
-
}
|
|
694
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
695
|
-
resolve(body);
|
|
696
|
-
}
|
|
697
|
-
else {
|
|
698
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
699
|
-
reject(errString);
|
|
700
|
-
}
|
|
701
|
-
}
|
|
702
|
-
});
|
|
703
|
-
});
|
|
704
|
-
});
|
|
722
|
+
}
|
|
723
|
+
const response = await fetch(url, requestOptions);
|
|
724
|
+
return this.handleResponse(response, 'DspAutotunerResults');
|
|
705
725
|
}
|
|
706
726
|
/**
|
|
707
727
|
* Retrieve the configuration parameters for the DSP block. Use the impulse functions to retrieve all DSP blocks.
|
|
@@ -714,9 +734,11 @@ class DSPApi {
|
|
|
714
734
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
715
735
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
716
736
|
let localVarQueryParameters = {};
|
|
717
|
-
let localVarHeaderParams =
|
|
718
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
719
|
-
|
|
737
|
+
let localVarHeaderParams = {
|
|
738
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
739
|
+
'Content-Type': 'application/json',
|
|
740
|
+
...this.defaultHeaders,
|
|
741
|
+
};
|
|
720
742
|
const produces = ['application/json'];
|
|
721
743
|
// give precedence to 'application/json'
|
|
722
744
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -725,7 +747,7 @@ class DSPApi {
|
|
|
725
747
|
else {
|
|
726
748
|
localVarHeaderParams.Accept = produces.join(',');
|
|
727
749
|
}
|
|
728
|
-
let localVarFormParams
|
|
750
|
+
let localVarFormParams;
|
|
729
751
|
// verify required parameter 'projectId' is not null or undefined
|
|
730
752
|
if (projectId === null || projectId === undefined) {
|
|
731
753
|
throw new Error('Required parameter projectId was null or undefined when calling getDspConfig.');
|
|
@@ -734,55 +756,51 @@ class DSPApi {
|
|
|
734
756
|
if (dspId === null || dspId === undefined) {
|
|
735
757
|
throw new Error('Required parameter dspId was null or undefined when calling getDspConfig.');
|
|
736
758
|
}
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
759
|
+
localVarHeaderParams = {
|
|
760
|
+
...localVarHeaderParams,
|
|
761
|
+
...options.headers,
|
|
762
|
+
...this.opts.extraHeaders,
|
|
763
|
+
};
|
|
764
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
765
|
+
.filter(([, value]) => value !== undefined)
|
|
766
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
767
|
+
.join('&');
|
|
768
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
740
769
|
let localVarRequestOptions = {
|
|
741
770
|
method: 'GET',
|
|
742
|
-
|
|
743
|
-
headers: localVarHeaderParams,
|
|
744
|
-
uri: localVarPath,
|
|
745
|
-
useQuerystring: this._useQuerystring,
|
|
746
|
-
agentOptions: { keepAlive: false },
|
|
747
|
-
json: true,
|
|
771
|
+
headers: { ...localVarHeaderParams },
|
|
748
772
|
};
|
|
749
|
-
let
|
|
750
|
-
|
|
751
|
-
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
773
|
+
let requestOptions = localVarRequestOptions;
|
|
774
|
+
let url = localVarUrl;
|
|
775
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
776
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
777
|
+
url = auth_ApiKeyAuthentication.url;
|
|
778
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
779
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
780
|
+
url = auth_JWTAuthentication.url;
|
|
781
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
782
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
783
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
784
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
785
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
786
|
+
url = auth_OAuth2.url;
|
|
787
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
788
|
+
requestOptions = authDefault.requestOptions;
|
|
789
|
+
url = authDefault.url;
|
|
790
|
+
if (localVarFormParams) {
|
|
791
|
+
delete requestOptions.headers['Content-Type'];
|
|
792
|
+
if (localVarFormParams instanceof FormData) {
|
|
793
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
794
|
+
requestOptions.body = localVarFormParams;
|
|
795
|
+
}
|
|
796
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
797
|
+
// URL-encoded form
|
|
798
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
799
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
763
800
|
}
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
reject(error);
|
|
768
|
-
}
|
|
769
|
-
else {
|
|
770
|
-
body = models_1.ObjectSerializer.deserialize(body, "DSPConfigResponse");
|
|
771
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
772
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
773
|
-
reject(new Error(body.error || errString));
|
|
774
|
-
}
|
|
775
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
776
|
-
resolve(body);
|
|
777
|
-
}
|
|
778
|
-
else {
|
|
779
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
780
|
-
reject(errString);
|
|
781
|
-
}
|
|
782
|
-
}
|
|
783
|
-
});
|
|
784
|
-
});
|
|
785
|
-
});
|
|
801
|
+
}
|
|
802
|
+
const response = await fetch(url, requestOptions);
|
|
803
|
+
return this.handleResponse(response, 'DSPConfigResponse');
|
|
786
804
|
}
|
|
787
805
|
/**
|
|
788
806
|
* Retrieve the feature importance for a DSP block (only available for blocks where dimensionalityReduction is not enabled)
|
|
@@ -795,9 +813,11 @@ class DSPApi {
|
|
|
795
813
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
796
814
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
797
815
|
let localVarQueryParameters = {};
|
|
798
|
-
let localVarHeaderParams =
|
|
799
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
800
|
-
|
|
816
|
+
let localVarHeaderParams = {
|
|
817
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
818
|
+
'Content-Type': 'application/json',
|
|
819
|
+
...this.defaultHeaders,
|
|
820
|
+
};
|
|
801
821
|
const produces = ['application/json'];
|
|
802
822
|
// give precedence to 'application/json'
|
|
803
823
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -806,7 +826,7 @@ class DSPApi {
|
|
|
806
826
|
else {
|
|
807
827
|
localVarHeaderParams.Accept = produces.join(',');
|
|
808
828
|
}
|
|
809
|
-
let localVarFormParams
|
|
829
|
+
let localVarFormParams;
|
|
810
830
|
// verify required parameter 'projectId' is not null or undefined
|
|
811
831
|
if (projectId === null || projectId === undefined) {
|
|
812
832
|
throw new Error('Required parameter projectId was null or undefined when calling getDspFeatureImportance.');
|
|
@@ -815,55 +835,51 @@ class DSPApi {
|
|
|
815
835
|
if (dspId === null || dspId === undefined) {
|
|
816
836
|
throw new Error('Required parameter dspId was null or undefined when calling getDspFeatureImportance.');
|
|
817
837
|
}
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
838
|
+
localVarHeaderParams = {
|
|
839
|
+
...localVarHeaderParams,
|
|
840
|
+
...options.headers,
|
|
841
|
+
...this.opts.extraHeaders,
|
|
842
|
+
};
|
|
843
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
844
|
+
.filter(([, value]) => value !== undefined)
|
|
845
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
846
|
+
.join('&');
|
|
847
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
821
848
|
let localVarRequestOptions = {
|
|
822
849
|
method: 'GET',
|
|
823
|
-
|
|
824
|
-
headers: localVarHeaderParams,
|
|
825
|
-
uri: localVarPath,
|
|
826
|
-
useQuerystring: this._useQuerystring,
|
|
827
|
-
agentOptions: { keepAlive: false },
|
|
828
|
-
json: true,
|
|
850
|
+
headers: { ...localVarHeaderParams },
|
|
829
851
|
};
|
|
830
|
-
let
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
852
|
+
let requestOptions = localVarRequestOptions;
|
|
853
|
+
let url = localVarUrl;
|
|
854
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
855
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
856
|
+
url = auth_ApiKeyAuthentication.url;
|
|
857
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
858
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
859
|
+
url = auth_JWTAuthentication.url;
|
|
860
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
861
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
862
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
863
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
864
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
865
|
+
url = auth_OAuth2.url;
|
|
866
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
867
|
+
requestOptions = authDefault.requestOptions;
|
|
868
|
+
url = authDefault.url;
|
|
869
|
+
if (localVarFormParams) {
|
|
870
|
+
delete requestOptions.headers['Content-Type'];
|
|
871
|
+
if (localVarFormParams instanceof FormData) {
|
|
872
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
873
|
+
requestOptions.body = localVarFormParams;
|
|
874
|
+
}
|
|
875
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
876
|
+
// URL-encoded form
|
|
877
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
878
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
844
879
|
}
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
reject(error);
|
|
849
|
-
}
|
|
850
|
-
else {
|
|
851
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspFeatureImportanceResponse");
|
|
852
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
853
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
854
|
-
reject(new Error(body.error || errString));
|
|
855
|
-
}
|
|
856
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
857
|
-
resolve(body);
|
|
858
|
-
}
|
|
859
|
-
else {
|
|
860
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
861
|
-
reject(errString);
|
|
862
|
-
}
|
|
863
|
-
}
|
|
864
|
-
});
|
|
865
|
-
});
|
|
866
|
-
});
|
|
880
|
+
}
|
|
881
|
+
const response = await fetch(url, requestOptions);
|
|
882
|
+
return this.handleResponse(response, 'DspFeatureImportanceResponse');
|
|
867
883
|
}
|
|
868
884
|
/**
|
|
869
885
|
* Retrieve the names of the features the DSP block generates
|
|
@@ -876,9 +892,11 @@ class DSPApi {
|
|
|
876
892
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
877
893
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
878
894
|
let localVarQueryParameters = {};
|
|
879
|
-
let localVarHeaderParams =
|
|
880
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
881
|
-
|
|
895
|
+
let localVarHeaderParams = {
|
|
896
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
897
|
+
'Content-Type': 'application/json',
|
|
898
|
+
...this.defaultHeaders,
|
|
899
|
+
};
|
|
882
900
|
const produces = ['application/json'];
|
|
883
901
|
// give precedence to 'application/json'
|
|
884
902
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -887,7 +905,7 @@ class DSPApi {
|
|
|
887
905
|
else {
|
|
888
906
|
localVarHeaderParams.Accept = produces.join(',');
|
|
889
907
|
}
|
|
890
|
-
let localVarFormParams
|
|
908
|
+
let localVarFormParams;
|
|
891
909
|
// verify required parameter 'projectId' is not null or undefined
|
|
892
910
|
if (projectId === null || projectId === undefined) {
|
|
893
911
|
throw new Error('Required parameter projectId was null or undefined when calling getDspFeatureLabels.');
|
|
@@ -896,55 +914,51 @@ class DSPApi {
|
|
|
896
914
|
if (dspId === null || dspId === undefined) {
|
|
897
915
|
throw new Error('Required parameter dspId was null or undefined when calling getDspFeatureLabels.');
|
|
898
916
|
}
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
917
|
+
localVarHeaderParams = {
|
|
918
|
+
...localVarHeaderParams,
|
|
919
|
+
...options.headers,
|
|
920
|
+
...this.opts.extraHeaders,
|
|
921
|
+
};
|
|
922
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
923
|
+
.filter(([, value]) => value !== undefined)
|
|
924
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
925
|
+
.join('&');
|
|
926
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
902
927
|
let localVarRequestOptions = {
|
|
903
928
|
method: 'GET',
|
|
904
|
-
|
|
905
|
-
headers: localVarHeaderParams,
|
|
906
|
-
uri: localVarPath,
|
|
907
|
-
useQuerystring: this._useQuerystring,
|
|
908
|
-
agentOptions: { keepAlive: false },
|
|
909
|
-
json: true,
|
|
929
|
+
headers: { ...localVarHeaderParams },
|
|
910
930
|
};
|
|
911
|
-
let
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
931
|
+
let requestOptions = localVarRequestOptions;
|
|
932
|
+
let url = localVarUrl;
|
|
933
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
934
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
935
|
+
url = auth_ApiKeyAuthentication.url;
|
|
936
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
937
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
938
|
+
url = auth_JWTAuthentication.url;
|
|
939
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
940
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
941
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
942
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
943
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
944
|
+
url = auth_OAuth2.url;
|
|
945
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
946
|
+
requestOptions = authDefault.requestOptions;
|
|
947
|
+
url = authDefault.url;
|
|
948
|
+
if (localVarFormParams) {
|
|
949
|
+
delete requestOptions.headers['Content-Type'];
|
|
950
|
+
if (localVarFormParams instanceof FormData) {
|
|
951
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
952
|
+
requestOptions.body = localVarFormParams;
|
|
953
|
+
}
|
|
954
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
955
|
+
// URL-encoded form
|
|
956
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
957
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
925
958
|
}
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
reject(error);
|
|
930
|
-
}
|
|
931
|
-
else {
|
|
932
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspFeatureLabelsResponse");
|
|
933
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
934
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
935
|
-
reject(new Error(body.error || errString));
|
|
936
|
-
}
|
|
937
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
938
|
-
resolve(body);
|
|
939
|
-
}
|
|
940
|
-
else {
|
|
941
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
942
|
-
reject(errString);
|
|
943
|
-
}
|
|
944
|
-
}
|
|
945
|
-
});
|
|
946
|
-
});
|
|
947
|
-
});
|
|
959
|
+
}
|
|
960
|
+
const response = await fetch(url, requestOptions);
|
|
961
|
+
return this.handleResponse(response, 'DspFeatureLabelsResponse');
|
|
948
962
|
}
|
|
949
963
|
/**
|
|
950
964
|
* Retrieve the metadata from a generated DSP block.
|
|
@@ -959,9 +973,11 @@ class DSPApi {
|
|
|
959
973
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
960
974
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
961
975
|
let localVarQueryParameters = {};
|
|
962
|
-
let localVarHeaderParams =
|
|
963
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
964
|
-
|
|
976
|
+
let localVarHeaderParams = {
|
|
977
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
978
|
+
'Content-Type': 'application/json',
|
|
979
|
+
...this.defaultHeaders,
|
|
980
|
+
};
|
|
965
981
|
const produces = ['application/json'];
|
|
966
982
|
// give precedence to 'application/json'
|
|
967
983
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -970,7 +986,7 @@ class DSPApi {
|
|
|
970
986
|
else {
|
|
971
987
|
localVarHeaderParams.Accept = produces.join(',');
|
|
972
988
|
}
|
|
973
|
-
let localVarFormParams
|
|
989
|
+
let localVarFormParams;
|
|
974
990
|
// verify required parameter 'projectId' is not null or undefined
|
|
975
991
|
if (projectId === null || projectId === undefined) {
|
|
976
992
|
throw new Error('Required parameter projectId was null or undefined when calling getDspMetadata.');
|
|
@@ -985,55 +1001,51 @@ class DSPApi {
|
|
|
985
1001
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
986
1002
|
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'all'");
|
|
987
1003
|
}
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
1004
|
+
localVarHeaderParams = {
|
|
1005
|
+
...localVarHeaderParams,
|
|
1006
|
+
...options.headers,
|
|
1007
|
+
...this.opts.extraHeaders,
|
|
1008
|
+
};
|
|
1009
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1010
|
+
.filter(([, value]) => value !== undefined)
|
|
1011
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1012
|
+
.join('&');
|
|
1013
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
991
1014
|
let localVarRequestOptions = {
|
|
992
1015
|
method: 'GET',
|
|
993
|
-
|
|
994
|
-
headers: localVarHeaderParams,
|
|
995
|
-
uri: localVarPath,
|
|
996
|
-
useQuerystring: this._useQuerystring,
|
|
997
|
-
agentOptions: { keepAlive: false },
|
|
998
|
-
json: true,
|
|
1016
|
+
headers: { ...localVarHeaderParams },
|
|
999
1017
|
};
|
|
1000
|
-
let
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1018
|
+
let requestOptions = localVarRequestOptions;
|
|
1019
|
+
let url = localVarUrl;
|
|
1020
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1021
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1022
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1023
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1024
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1025
|
+
url = auth_JWTAuthentication.url;
|
|
1026
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1027
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1028
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1029
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1030
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1031
|
+
url = auth_OAuth2.url;
|
|
1032
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1033
|
+
requestOptions = authDefault.requestOptions;
|
|
1034
|
+
url = authDefault.url;
|
|
1035
|
+
if (localVarFormParams) {
|
|
1036
|
+
delete requestOptions.headers['Content-Type'];
|
|
1037
|
+
if (localVarFormParams instanceof FormData) {
|
|
1038
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1039
|
+
requestOptions.body = localVarFormParams;
|
|
1014
1040
|
}
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1024
|
-
reject(new Error(body.error || errString));
|
|
1025
|
-
}
|
|
1026
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1027
|
-
resolve(body);
|
|
1028
|
-
}
|
|
1029
|
-
else {
|
|
1030
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1031
|
-
reject(errString);
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
});
|
|
1035
|
-
});
|
|
1036
|
-
});
|
|
1041
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1042
|
+
// URL-encoded form
|
|
1043
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1044
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1045
|
+
}
|
|
1046
|
+
}
|
|
1047
|
+
const response = await fetch(url, requestOptions);
|
|
1048
|
+
return this.handleResponse(response, 'DSPMetadataResponse');
|
|
1037
1049
|
}
|
|
1038
1050
|
/**
|
|
1039
1051
|
* Get raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out. If you pass dspId = 0 this will return a raw graph without any processing.
|
|
@@ -1051,9 +1063,11 @@ class DSPApi {
|
|
|
1051
1063
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
1052
1064
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
1053
1065
|
let localVarQueryParameters = {};
|
|
1054
|
-
let localVarHeaderParams =
|
|
1055
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1056
|
-
|
|
1066
|
+
let localVarHeaderParams = {
|
|
1067
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1068
|
+
'Content-Type': 'application/json',
|
|
1069
|
+
...this.defaultHeaders,
|
|
1070
|
+
};
|
|
1057
1071
|
const produces = ['application/json'];
|
|
1058
1072
|
// give precedence to 'application/json'
|
|
1059
1073
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1062,7 +1076,7 @@ class DSPApi {
|
|
|
1062
1076
|
else {
|
|
1063
1077
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1064
1078
|
}
|
|
1065
|
-
let localVarFormParams
|
|
1079
|
+
let localVarFormParams;
|
|
1066
1080
|
// verify required parameter 'projectId' is not null or undefined
|
|
1067
1081
|
if (projectId === null || projectId === undefined) {
|
|
1068
1082
|
throw new Error('Required parameter projectId was null or undefined when calling getDspRawSample.');
|
|
@@ -1084,55 +1098,51 @@ class DSPApi {
|
|
|
1084
1098
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.useCachedUpsampledData) !== undefined) {
|
|
1085
1099
|
localVarQueryParameters['useCachedUpsampledData'] = models_1.ObjectSerializer.serialize(queryParams.useCachedUpsampledData, "boolean");
|
|
1086
1100
|
}
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1101
|
+
localVarHeaderParams = {
|
|
1102
|
+
...localVarHeaderParams,
|
|
1103
|
+
...options.headers,
|
|
1104
|
+
...this.opts.extraHeaders,
|
|
1105
|
+
};
|
|
1106
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1107
|
+
.filter(([, value]) => value !== undefined)
|
|
1108
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1109
|
+
.join('&');
|
|
1110
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1090
1111
|
let localVarRequestOptions = {
|
|
1091
1112
|
method: 'GET',
|
|
1092
|
-
|
|
1093
|
-
headers: localVarHeaderParams,
|
|
1094
|
-
uri: localVarPath,
|
|
1095
|
-
useQuerystring: this._useQuerystring,
|
|
1096
|
-
agentOptions: { keepAlive: false },
|
|
1097
|
-
json: true,
|
|
1113
|
+
headers: { ...localVarHeaderParams },
|
|
1098
1114
|
};
|
|
1099
|
-
let
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1115
|
+
let requestOptions = localVarRequestOptions;
|
|
1116
|
+
let url = localVarUrl;
|
|
1117
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1118
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1119
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1120
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1121
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1122
|
+
url = auth_JWTAuthentication.url;
|
|
1123
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1124
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1125
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1126
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1127
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1128
|
+
url = auth_OAuth2.url;
|
|
1129
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1130
|
+
requestOptions = authDefault.requestOptions;
|
|
1131
|
+
url = authDefault.url;
|
|
1132
|
+
if (localVarFormParams) {
|
|
1133
|
+
delete requestOptions.headers['Content-Type'];
|
|
1134
|
+
if (localVarFormParams instanceof FormData) {
|
|
1135
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1136
|
+
requestOptions.body = localVarFormParams;
|
|
1137
|
+
}
|
|
1138
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1139
|
+
// URL-encoded form
|
|
1140
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1141
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1113
1142
|
}
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
reject(error);
|
|
1118
|
-
}
|
|
1119
|
-
else {
|
|
1120
|
-
body = models_1.ObjectSerializer.deserialize(body, "GetSampleResponse");
|
|
1121
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1122
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1123
|
-
reject(new Error(body.error || errString));
|
|
1124
|
-
}
|
|
1125
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1126
|
-
resolve(body);
|
|
1127
|
-
}
|
|
1128
|
-
else {
|
|
1129
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1130
|
-
reject(errString);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
});
|
|
1134
|
-
});
|
|
1135
|
-
});
|
|
1143
|
+
}
|
|
1144
|
+
const response = await fetch(url, requestOptions);
|
|
1145
|
+
return this.handleResponse(response, 'GetSampleResponse');
|
|
1136
1146
|
}
|
|
1137
1147
|
/**
|
|
1138
1148
|
* Get slice of raw sample data, but with only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
|
|
@@ -1150,9 +1160,11 @@ class DSPApi {
|
|
|
1150
1160
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
1151
1161
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
1152
1162
|
let localVarQueryParameters = {};
|
|
1153
|
-
let localVarHeaderParams =
|
|
1154
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1155
|
-
|
|
1163
|
+
let localVarHeaderParams = {
|
|
1164
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1165
|
+
'Content-Type': 'application/json',
|
|
1166
|
+
...this.defaultHeaders,
|
|
1167
|
+
};
|
|
1156
1168
|
const produces = ['application/json'];
|
|
1157
1169
|
// give precedence to 'application/json'
|
|
1158
1170
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1161,7 +1173,7 @@ class DSPApi {
|
|
|
1161
1173
|
else {
|
|
1162
1174
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1163
1175
|
}
|
|
1164
|
-
let localVarFormParams
|
|
1176
|
+
let localVarFormParams;
|
|
1165
1177
|
// verify required parameter 'projectId' is not null or undefined
|
|
1166
1178
|
if (projectId === null || projectId === undefined) {
|
|
1167
1179
|
throw new Error('Required parameter projectId was null or undefined when calling getDspSampleSlice.');
|
|
@@ -1187,55 +1199,51 @@ class DSPApi {
|
|
|
1187
1199
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.truncateStructuredLabels) !== undefined) {
|
|
1188
1200
|
localVarQueryParameters['truncateStructuredLabels'] = models_1.ObjectSerializer.serialize(queryParams.truncateStructuredLabels, "boolean");
|
|
1189
1201
|
}
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1202
|
+
localVarHeaderParams = {
|
|
1203
|
+
...localVarHeaderParams,
|
|
1204
|
+
...options.headers,
|
|
1205
|
+
...this.opts.extraHeaders,
|
|
1206
|
+
};
|
|
1207
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1208
|
+
.filter(([, value]) => value !== undefined)
|
|
1209
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1210
|
+
.join('&');
|
|
1211
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1193
1212
|
let localVarRequestOptions = {
|
|
1194
1213
|
method: 'GET',
|
|
1195
|
-
|
|
1196
|
-
headers: localVarHeaderParams,
|
|
1197
|
-
uri: localVarPath,
|
|
1198
|
-
useQuerystring: this._useQuerystring,
|
|
1199
|
-
agentOptions: { keepAlive: false },
|
|
1200
|
-
json: true,
|
|
1214
|
+
headers: { ...localVarHeaderParams },
|
|
1201
1215
|
};
|
|
1202
|
-
let
|
|
1203
|
-
|
|
1204
|
-
|
|
1205
|
-
|
|
1206
|
-
|
|
1207
|
-
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
+
let requestOptions = localVarRequestOptions;
|
|
1217
|
+
let url = localVarUrl;
|
|
1218
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1219
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1220
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1221
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1222
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1223
|
+
url = auth_JWTAuthentication.url;
|
|
1224
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1225
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1226
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1227
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1228
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1229
|
+
url = auth_OAuth2.url;
|
|
1230
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1231
|
+
requestOptions = authDefault.requestOptions;
|
|
1232
|
+
url = authDefault.url;
|
|
1233
|
+
if (localVarFormParams) {
|
|
1234
|
+
delete requestOptions.headers['Content-Type'];
|
|
1235
|
+
if (localVarFormParams instanceof FormData) {
|
|
1236
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1237
|
+
requestOptions.body = localVarFormParams;
|
|
1216
1238
|
}
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1226
|
-
reject(new Error(body.error || errString));
|
|
1227
|
-
}
|
|
1228
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1229
|
-
resolve(body);
|
|
1230
|
-
}
|
|
1231
|
-
else {
|
|
1232
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1233
|
-
reject(errString);
|
|
1234
|
-
}
|
|
1235
|
-
}
|
|
1236
|
-
});
|
|
1237
|
-
});
|
|
1238
|
-
});
|
|
1239
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1240
|
+
// URL-encoded form
|
|
1241
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1242
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1243
|
+
}
|
|
1244
|
+
}
|
|
1245
|
+
const response = await fetch(url, requestOptions);
|
|
1246
|
+
return this.handleResponse(response, 'GetSampleResponse');
|
|
1239
1247
|
}
|
|
1240
1248
|
/**
|
|
1241
1249
|
* Get estimated performance (latency and RAM) for the DSP block, for all supported project latency devices.
|
|
@@ -1248,9 +1256,11 @@ class DSPApi {
|
|
|
1248
1256
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1249
1257
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
1250
1258
|
let localVarQueryParameters = {};
|
|
1251
|
-
let localVarHeaderParams =
|
|
1252
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1253
|
-
|
|
1259
|
+
let localVarHeaderParams = {
|
|
1260
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1261
|
+
'Content-Type': 'application/json',
|
|
1262
|
+
...this.defaultHeaders,
|
|
1263
|
+
};
|
|
1254
1264
|
const produces = ['application/json'];
|
|
1255
1265
|
// give precedence to 'application/json'
|
|
1256
1266
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1259,7 +1269,7 @@ class DSPApi {
|
|
|
1259
1269
|
else {
|
|
1260
1270
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1261
1271
|
}
|
|
1262
|
-
let localVarFormParams
|
|
1272
|
+
let localVarFormParams;
|
|
1263
1273
|
// verify required parameter 'projectId' is not null or undefined
|
|
1264
1274
|
if (projectId === null || projectId === undefined) {
|
|
1265
1275
|
throw new Error('Required parameter projectId was null or undefined when calling getPerformanceAllVariants.');
|
|
@@ -1268,55 +1278,51 @@ class DSPApi {
|
|
|
1268
1278
|
if (dspId === null || dspId === undefined) {
|
|
1269
1279
|
throw new Error('Required parameter dspId was null or undefined when calling getPerformanceAllVariants.');
|
|
1270
1280
|
}
|
|
1271
|
-
|
|
1272
|
-
|
|
1273
|
-
|
|
1281
|
+
localVarHeaderParams = {
|
|
1282
|
+
...localVarHeaderParams,
|
|
1283
|
+
...options.headers,
|
|
1284
|
+
...this.opts.extraHeaders,
|
|
1285
|
+
};
|
|
1286
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1287
|
+
.filter(([, value]) => value !== undefined)
|
|
1288
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1289
|
+
.join('&');
|
|
1290
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1274
1291
|
let localVarRequestOptions = {
|
|
1275
1292
|
method: 'GET',
|
|
1276
|
-
|
|
1277
|
-
headers: localVarHeaderParams,
|
|
1278
|
-
uri: localVarPath,
|
|
1279
|
-
useQuerystring: this._useQuerystring,
|
|
1280
|
-
agentOptions: { keepAlive: false },
|
|
1281
|
-
json: true,
|
|
1293
|
+
headers: { ...localVarHeaderParams },
|
|
1282
1294
|
};
|
|
1283
|
-
let
|
|
1284
|
-
|
|
1285
|
-
|
|
1286
|
-
|
|
1287
|
-
|
|
1288
|
-
|
|
1289
|
-
|
|
1290
|
-
|
|
1291
|
-
|
|
1292
|
-
|
|
1293
|
-
|
|
1294
|
-
|
|
1295
|
-
|
|
1296
|
-
|
|
1295
|
+
let requestOptions = localVarRequestOptions;
|
|
1296
|
+
let url = localVarUrl;
|
|
1297
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1298
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1299
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1300
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1301
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1302
|
+
url = auth_JWTAuthentication.url;
|
|
1303
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1304
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1305
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1306
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1307
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1308
|
+
url = auth_OAuth2.url;
|
|
1309
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1310
|
+
requestOptions = authDefault.requestOptions;
|
|
1311
|
+
url = authDefault.url;
|
|
1312
|
+
if (localVarFormParams) {
|
|
1313
|
+
delete requestOptions.headers['Content-Type'];
|
|
1314
|
+
if (localVarFormParams instanceof FormData) {
|
|
1315
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1316
|
+
requestOptions.body = localVarFormParams;
|
|
1317
|
+
}
|
|
1318
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1319
|
+
// URL-encoded form
|
|
1320
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1321
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1297
1322
|
}
|
|
1298
|
-
|
|
1299
|
-
|
|
1300
|
-
|
|
1301
|
-
reject(error);
|
|
1302
|
-
}
|
|
1303
|
-
else {
|
|
1304
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspPerformanceAllVariantsResponse");
|
|
1305
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1306
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1307
|
-
reject(new Error(body.error || errString));
|
|
1308
|
-
}
|
|
1309
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1310
|
-
resolve(body);
|
|
1311
|
-
}
|
|
1312
|
-
else {
|
|
1313
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1314
|
-
reject(errString);
|
|
1315
|
-
}
|
|
1316
|
-
}
|
|
1317
|
-
});
|
|
1318
|
-
});
|
|
1319
|
-
});
|
|
1323
|
+
}
|
|
1324
|
+
const response = await fetch(url, requestOptions);
|
|
1325
|
+
return this.handleResponse(response, 'DspPerformanceAllVariantsResponse');
|
|
1320
1326
|
}
|
|
1321
1327
|
/**
|
|
1322
1328
|
* Takes in a features array and runs it through the DSP block. This data should have the same frequency as set in the input block in your impulse.
|
|
@@ -1330,9 +1336,11 @@ class DSPApi {
|
|
|
1330
1336
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1331
1337
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
1332
1338
|
let localVarQueryParameters = {};
|
|
1333
|
-
let localVarHeaderParams =
|
|
1334
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1335
|
-
|
|
1339
|
+
let localVarHeaderParams = {
|
|
1340
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1341
|
+
'Content-Type': 'application/json',
|
|
1342
|
+
...this.defaultHeaders,
|
|
1343
|
+
};
|
|
1336
1344
|
const produces = ['application/json'];
|
|
1337
1345
|
// give precedence to 'application/json'
|
|
1338
1346
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1341,7 +1349,7 @@ class DSPApi {
|
|
|
1341
1349
|
else {
|
|
1342
1350
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1343
1351
|
}
|
|
1344
|
-
let localVarFormParams
|
|
1352
|
+
let localVarFormParams;
|
|
1345
1353
|
// verify required parameter 'projectId' is not null or undefined
|
|
1346
1354
|
if (projectId === null || projectId === undefined) {
|
|
1347
1355
|
throw new Error('Required parameter projectId was null or undefined when calling runDspOnFeaturesArray.');
|
|
@@ -1354,56 +1362,52 @@ class DSPApi {
|
|
|
1354
1362
|
if (dspRunRequestWithFeatures === null || dspRunRequestWithFeatures === undefined) {
|
|
1355
1363
|
throw new Error('Required parameter dspRunRequestWithFeatures was null or undefined when calling runDspOnFeaturesArray.');
|
|
1356
1364
|
}
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1365
|
+
localVarHeaderParams = {
|
|
1366
|
+
...localVarHeaderParams,
|
|
1367
|
+
...options.headers,
|
|
1368
|
+
...this.opts.extraHeaders,
|
|
1369
|
+
};
|
|
1370
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1371
|
+
.filter(([, value]) => value !== undefined)
|
|
1372
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1373
|
+
.join('&');
|
|
1374
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1360
1375
|
let localVarRequestOptions = {
|
|
1361
1376
|
method: 'POST',
|
|
1362
|
-
|
|
1363
|
-
headers: localVarHeaderParams,
|
|
1364
|
-
uri: localVarPath,
|
|
1365
|
-
useQuerystring: this._useQuerystring,
|
|
1366
|
-
agentOptions: { keepAlive: false },
|
|
1367
|
-
json: true,
|
|
1368
|
-
body: models_1.ObjectSerializer.serialize(dspRunRequestWithFeatures, "DspRunRequestWithFeatures")
|
|
1377
|
+
headers: { ...localVarHeaderParams },
|
|
1369
1378
|
};
|
|
1370
|
-
|
|
1371
|
-
|
|
1372
|
-
|
|
1373
|
-
|
|
1374
|
-
|
|
1375
|
-
|
|
1376
|
-
|
|
1377
|
-
|
|
1378
|
-
|
|
1379
|
-
|
|
1380
|
-
|
|
1381
|
-
|
|
1382
|
-
|
|
1383
|
-
|
|
1379
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(dspRunRequestWithFeatures, "DspRunRequestWithFeatures"));
|
|
1380
|
+
let requestOptions = localVarRequestOptions;
|
|
1381
|
+
let url = localVarUrl;
|
|
1382
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1383
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1384
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1385
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1386
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1387
|
+
url = auth_JWTAuthentication.url;
|
|
1388
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1389
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1390
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1391
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1392
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1393
|
+
url = auth_OAuth2.url;
|
|
1394
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1395
|
+
requestOptions = authDefault.requestOptions;
|
|
1396
|
+
url = authDefault.url;
|
|
1397
|
+
if (localVarFormParams) {
|
|
1398
|
+
delete requestOptions.headers['Content-Type'];
|
|
1399
|
+
if (localVarFormParams instanceof FormData) {
|
|
1400
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1401
|
+
requestOptions.body = localVarFormParams;
|
|
1384
1402
|
}
|
|
1385
|
-
|
|
1386
|
-
|
|
1387
|
-
|
|
1388
|
-
|
|
1389
|
-
|
|
1390
|
-
|
|
1391
|
-
|
|
1392
|
-
|
|
1393
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1394
|
-
reject(new Error(body.error || errString));
|
|
1395
|
-
}
|
|
1396
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1397
|
-
resolve(body);
|
|
1398
|
-
}
|
|
1399
|
-
else {
|
|
1400
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1401
|
-
reject(errString);
|
|
1402
|
-
}
|
|
1403
|
-
}
|
|
1404
|
-
});
|
|
1405
|
-
});
|
|
1406
|
-
});
|
|
1403
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1404
|
+
// URL-encoded form
|
|
1405
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1406
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1407
|
+
}
|
|
1408
|
+
}
|
|
1409
|
+
const response = await fetch(url, requestOptions);
|
|
1410
|
+
return this.handleResponse(response, 'DspRunResponse');
|
|
1407
1411
|
}
|
|
1408
1412
|
/**
|
|
1409
1413
|
* Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
|
|
@@ -1421,9 +1425,11 @@ class DSPApi {
|
|
|
1421
1425
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
1422
1426
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
1423
1427
|
let localVarQueryParameters = {};
|
|
1424
|
-
let localVarHeaderParams =
|
|
1425
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1426
|
-
|
|
1428
|
+
let localVarHeaderParams = {
|
|
1429
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1430
|
+
'Content-Type': 'application/json',
|
|
1431
|
+
...this.defaultHeaders,
|
|
1432
|
+
};
|
|
1427
1433
|
const produces = ['application/json'];
|
|
1428
1434
|
// give precedence to 'application/json'
|
|
1429
1435
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1432,7 +1438,7 @@ class DSPApi {
|
|
|
1432
1438
|
else {
|
|
1433
1439
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1434
1440
|
}
|
|
1435
|
-
let localVarFormParams
|
|
1441
|
+
let localVarFormParams;
|
|
1436
1442
|
// verify required parameter 'projectId' is not null or undefined
|
|
1437
1443
|
if (projectId === null || projectId === undefined) {
|
|
1438
1444
|
throw new Error('Required parameter projectId was null or undefined when calling runDspSampleSlice.');
|
|
@@ -1459,56 +1465,52 @@ class DSPApi {
|
|
|
1459
1465
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.sliceEnd) !== undefined) {
|
|
1460
1466
|
localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
|
|
1461
1467
|
}
|
|
1462
|
-
|
|
1463
|
-
|
|
1464
|
-
|
|
1468
|
+
localVarHeaderParams = {
|
|
1469
|
+
...localVarHeaderParams,
|
|
1470
|
+
...options.headers,
|
|
1471
|
+
...this.opts.extraHeaders,
|
|
1472
|
+
};
|
|
1473
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1474
|
+
.filter(([, value]) => value !== undefined)
|
|
1475
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1476
|
+
.join('&');
|
|
1477
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1465
1478
|
let localVarRequestOptions = {
|
|
1466
1479
|
method: 'POST',
|
|
1467
|
-
|
|
1468
|
-
headers: localVarHeaderParams,
|
|
1469
|
-
uri: localVarPath,
|
|
1470
|
-
useQuerystring: this._useQuerystring,
|
|
1471
|
-
agentOptions: { keepAlive: false },
|
|
1472
|
-
json: true,
|
|
1473
|
-
body: models_1.ObjectSerializer.serialize(dspRunRequestWithoutFeatures, "DspRunRequestWithoutFeatures")
|
|
1480
|
+
headers: { ...localVarHeaderParams },
|
|
1474
1481
|
};
|
|
1475
|
-
|
|
1476
|
-
|
|
1477
|
-
|
|
1478
|
-
|
|
1479
|
-
|
|
1480
|
-
|
|
1481
|
-
|
|
1482
|
-
|
|
1483
|
-
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1482
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(dspRunRequestWithoutFeatures, "DspRunRequestWithoutFeatures"));
|
|
1483
|
+
let requestOptions = localVarRequestOptions;
|
|
1484
|
+
let url = localVarUrl;
|
|
1485
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1486
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1487
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1488
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1489
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1490
|
+
url = auth_JWTAuthentication.url;
|
|
1491
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1492
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1493
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1494
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1495
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1496
|
+
url = auth_OAuth2.url;
|
|
1497
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1498
|
+
requestOptions = authDefault.requestOptions;
|
|
1499
|
+
url = authDefault.url;
|
|
1500
|
+
if (localVarFormParams) {
|
|
1501
|
+
delete requestOptions.headers['Content-Type'];
|
|
1502
|
+
if (localVarFormParams instanceof FormData) {
|
|
1503
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1504
|
+
requestOptions.body = localVarFormParams;
|
|
1505
|
+
}
|
|
1506
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1507
|
+
// URL-encoded form
|
|
1508
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1509
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1489
1510
|
}
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
reject(error);
|
|
1494
|
-
}
|
|
1495
|
-
else {
|
|
1496
|
-
body = models_1.ObjectSerializer.deserialize(body, "DspRunResponseWithSample");
|
|
1497
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1498
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1499
|
-
reject(new Error(body.error || errString));
|
|
1500
|
-
}
|
|
1501
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1502
|
-
resolve(body);
|
|
1503
|
-
}
|
|
1504
|
-
else {
|
|
1505
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1506
|
-
reject(errString);
|
|
1507
|
-
}
|
|
1508
|
-
}
|
|
1509
|
-
});
|
|
1510
|
-
});
|
|
1511
|
-
});
|
|
1511
|
+
}
|
|
1512
|
+
const response = await fetch(url, requestOptions);
|
|
1513
|
+
return this.handleResponse(response, 'DspRunResponseWithSample');
|
|
1512
1514
|
}
|
|
1513
1515
|
/**
|
|
1514
1516
|
* Get slice of sample data, and run it through the DSP block. This only the axes selected by the DSP block. E.g. if you have selected only accX and accY as inputs for the DSP block, but the raw sample also contains accZ, accZ is filtered out.
|
|
@@ -1525,9 +1527,11 @@ class DSPApi {
|
|
|
1525
1527
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)))
|
|
1526
1528
|
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
1527
1529
|
let localVarQueryParameters = {};
|
|
1528
|
-
let localVarHeaderParams =
|
|
1529
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1530
|
-
|
|
1530
|
+
let localVarHeaderParams = {
|
|
1531
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1532
|
+
'Content-Type': 'application/json',
|
|
1533
|
+
...this.defaultHeaders,
|
|
1534
|
+
};
|
|
1531
1535
|
const produces = ['application/json'];
|
|
1532
1536
|
// give precedence to 'application/json'
|
|
1533
1537
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1536,7 +1540,7 @@ class DSPApi {
|
|
|
1536
1540
|
else {
|
|
1537
1541
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1538
1542
|
}
|
|
1539
|
-
let localVarFormParams
|
|
1543
|
+
let localVarFormParams;
|
|
1540
1544
|
// verify required parameter 'projectId' is not null or undefined
|
|
1541
1545
|
if (projectId === null || projectId === undefined) {
|
|
1542
1546
|
throw new Error('Required parameter projectId was null or undefined when calling runDspSampleSliceReadOnly.');
|
|
@@ -1559,55 +1563,51 @@ class DSPApi {
|
|
|
1559
1563
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.sliceEnd) !== undefined) {
|
|
1560
1564
|
localVarQueryParameters['sliceEnd'] = models_1.ObjectSerializer.serialize(queryParams.sliceEnd, "number");
|
|
1561
1565
|
}
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1566
|
+
localVarHeaderParams = {
|
|
1567
|
+
...localVarHeaderParams,
|
|
1568
|
+
...options.headers,
|
|
1569
|
+
...this.opts.extraHeaders,
|
|
1570
|
+
};
|
|
1571
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1572
|
+
.filter(([, value]) => value !== undefined)
|
|
1573
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1574
|
+
.join('&');
|
|
1575
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1565
1576
|
let localVarRequestOptions = {
|
|
1566
1577
|
method: 'GET',
|
|
1567
|
-
|
|
1568
|
-
headers: localVarHeaderParams,
|
|
1569
|
-
uri: localVarPath,
|
|
1570
|
-
useQuerystring: this._useQuerystring,
|
|
1571
|
-
agentOptions: { keepAlive: false },
|
|
1572
|
-
json: true,
|
|
1578
|
+
headers: { ...localVarHeaderParams },
|
|
1573
1579
|
};
|
|
1574
|
-
let
|
|
1575
|
-
|
|
1576
|
-
|
|
1577
|
-
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1580
|
+
let requestOptions = localVarRequestOptions;
|
|
1581
|
+
let url = localVarUrl;
|
|
1582
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1583
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1584
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1585
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1586
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1587
|
+
url = auth_JWTAuthentication.url;
|
|
1588
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1589
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1590
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1591
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1592
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1593
|
+
url = auth_OAuth2.url;
|
|
1594
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1595
|
+
requestOptions = authDefault.requestOptions;
|
|
1596
|
+
url = authDefault.url;
|
|
1597
|
+
if (localVarFormParams) {
|
|
1598
|
+
delete requestOptions.headers['Content-Type'];
|
|
1599
|
+
if (localVarFormParams instanceof FormData) {
|
|
1600
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1601
|
+
requestOptions.body = localVarFormParams;
|
|
1588
1602
|
}
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1592
|
-
|
|
1593
|
-
|
|
1594
|
-
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1598
|
-
reject(new Error(body.error || errString));
|
|
1599
|
-
}
|
|
1600
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1601
|
-
resolve(body);
|
|
1602
|
-
}
|
|
1603
|
-
else {
|
|
1604
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1605
|
-
reject(errString);
|
|
1606
|
-
}
|
|
1607
|
-
}
|
|
1608
|
-
});
|
|
1609
|
-
});
|
|
1610
|
-
});
|
|
1603
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1604
|
+
// URL-encoded form
|
|
1605
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1606
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1607
|
+
}
|
|
1608
|
+
}
|
|
1609
|
+
const response = await fetch(url, requestOptions);
|
|
1610
|
+
return this.handleResponse(response, 'DspRunResponseWithSample');
|
|
1611
1611
|
}
|
|
1612
1612
|
/**
|
|
1613
1613
|
* Set configuration parameters for the DSP block. Only values set in the body will be overwritten.
|
|
@@ -1621,9 +1621,11 @@ class DSPApi {
|
|
|
1621
1621
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1622
1622
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
1623
1623
|
let localVarQueryParameters = {};
|
|
1624
|
-
let localVarHeaderParams =
|
|
1625
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1626
|
-
|
|
1624
|
+
let localVarHeaderParams = {
|
|
1625
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1626
|
+
'Content-Type': 'application/json',
|
|
1627
|
+
...this.defaultHeaders,
|
|
1628
|
+
};
|
|
1627
1629
|
const produces = ['application/json'];
|
|
1628
1630
|
// give precedence to 'application/json'
|
|
1629
1631
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1632,7 +1634,7 @@ class DSPApi {
|
|
|
1632
1634
|
else {
|
|
1633
1635
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1634
1636
|
}
|
|
1635
|
-
let localVarFormParams
|
|
1637
|
+
let localVarFormParams;
|
|
1636
1638
|
// verify required parameter 'projectId' is not null or undefined
|
|
1637
1639
|
if (projectId === null || projectId === undefined) {
|
|
1638
1640
|
throw new Error('Required parameter projectId was null or undefined when calling setDspConfig.');
|
|
@@ -1645,56 +1647,52 @@ class DSPApi {
|
|
|
1645
1647
|
if (dSPConfigRequest === null || dSPConfigRequest === undefined) {
|
|
1646
1648
|
throw new Error('Required parameter dSPConfigRequest was null or undefined when calling setDspConfig.');
|
|
1647
1649
|
}
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1650
|
+
localVarHeaderParams = {
|
|
1651
|
+
...localVarHeaderParams,
|
|
1652
|
+
...options.headers,
|
|
1653
|
+
...this.opts.extraHeaders,
|
|
1654
|
+
};
|
|
1655
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1656
|
+
.filter(([, value]) => value !== undefined)
|
|
1657
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1658
|
+
.join('&');
|
|
1659
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1651
1660
|
let localVarRequestOptions = {
|
|
1652
1661
|
method: 'POST',
|
|
1653
|
-
|
|
1654
|
-
headers: localVarHeaderParams,
|
|
1655
|
-
uri: localVarPath,
|
|
1656
|
-
useQuerystring: this._useQuerystring,
|
|
1657
|
-
agentOptions: { keepAlive: false },
|
|
1658
|
-
json: true,
|
|
1659
|
-
body: models_1.ObjectSerializer.serialize(dSPConfigRequest, "DSPConfigRequest")
|
|
1662
|
+
headers: { ...localVarHeaderParams },
|
|
1660
1663
|
};
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1670
|
-
|
|
1671
|
-
|
|
1672
|
-
|
|
1673
|
-
|
|
1674
|
-
|
|
1664
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(dSPConfigRequest, "DSPConfigRequest"));
|
|
1665
|
+
let requestOptions = localVarRequestOptions;
|
|
1666
|
+
let url = localVarUrl;
|
|
1667
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1668
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1669
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1670
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1671
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1672
|
+
url = auth_JWTAuthentication.url;
|
|
1673
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1674
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1675
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1676
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1677
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1678
|
+
url = auth_OAuth2.url;
|
|
1679
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1680
|
+
requestOptions = authDefault.requestOptions;
|
|
1681
|
+
url = authDefault.url;
|
|
1682
|
+
if (localVarFormParams) {
|
|
1683
|
+
delete requestOptions.headers['Content-Type'];
|
|
1684
|
+
if (localVarFormParams instanceof FormData) {
|
|
1685
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1686
|
+
requestOptions.body = localVarFormParams;
|
|
1687
|
+
}
|
|
1688
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1689
|
+
// URL-encoded form
|
|
1690
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1691
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1675
1692
|
}
|
|
1676
|
-
|
|
1677
|
-
|
|
1678
|
-
|
|
1679
|
-
reject(error);
|
|
1680
|
-
}
|
|
1681
|
-
else {
|
|
1682
|
-
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
1683
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
1684
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1685
|
-
reject(new Error(body.error || errString));
|
|
1686
|
-
}
|
|
1687
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1688
|
-
resolve(body);
|
|
1689
|
-
}
|
|
1690
|
-
else {
|
|
1691
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1692
|
-
reject(errString);
|
|
1693
|
-
}
|
|
1694
|
-
}
|
|
1695
|
-
});
|
|
1696
|
-
});
|
|
1697
|
-
});
|
|
1693
|
+
}
|
|
1694
|
+
const response = await fetch(url, requestOptions);
|
|
1695
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1698
1696
|
}
|
|
1699
1697
|
/**
|
|
1700
1698
|
* Returns performance characteristics for a custom DSP block (needs `hasTfliteImplementation`). Updates are streamed over the websocket API (or can be retrieved through the /stdout endpoint). Use getProfileTfliteJobResult to get the results when the job is completed.
|
|
@@ -1708,9 +1706,11 @@ class DSPApi {
|
|
|
1708
1706
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
1709
1707
|
.replace('{' + 'dspId' + '}', encodeURIComponent(String(dspId)));
|
|
1710
1708
|
let localVarQueryParameters = {};
|
|
1711
|
-
let localVarHeaderParams =
|
|
1712
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1713
|
-
|
|
1709
|
+
let localVarHeaderParams = {
|
|
1710
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1711
|
+
'Content-Type': 'application/json',
|
|
1712
|
+
...this.defaultHeaders,
|
|
1713
|
+
};
|
|
1714
1714
|
const produces = ['application/json'];
|
|
1715
1715
|
// give precedence to 'application/json'
|
|
1716
1716
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1719,7 +1719,7 @@ class DSPApi {
|
|
|
1719
1719
|
else {
|
|
1720
1720
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1721
1721
|
}
|
|
1722
|
-
let localVarFormParams
|
|
1722
|
+
let localVarFormParams;
|
|
1723
1723
|
// verify required parameter 'projectId' is not null or undefined
|
|
1724
1724
|
if (projectId === null || projectId === undefined) {
|
|
1725
1725
|
throw new Error('Required parameter projectId was null or undefined when calling startProfileCustomDspBlock.');
|
|
@@ -1732,56 +1732,52 @@ class DSPApi {
|
|
|
1732
1732
|
if (dspRunRequestWithoutFeaturesReadOnly === null || dspRunRequestWithoutFeaturesReadOnly === undefined) {
|
|
1733
1733
|
throw new Error('Required parameter dspRunRequestWithoutFeaturesReadOnly was null or undefined when calling startProfileCustomDspBlock.');
|
|
1734
1734
|
}
|
|
1735
|
-
|
|
1736
|
-
|
|
1737
|
-
|
|
1735
|
+
localVarHeaderParams = {
|
|
1736
|
+
...localVarHeaderParams,
|
|
1737
|
+
...options.headers,
|
|
1738
|
+
...this.opts.extraHeaders,
|
|
1739
|
+
};
|
|
1740
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1741
|
+
.filter(([, value]) => value !== undefined)
|
|
1742
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1743
|
+
.join('&');
|
|
1744
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1738
1745
|
let localVarRequestOptions = {
|
|
1739
1746
|
method: 'POST',
|
|
1740
|
-
|
|
1741
|
-
headers: localVarHeaderParams,
|
|
1742
|
-
uri: localVarPath,
|
|
1743
|
-
useQuerystring: this._useQuerystring,
|
|
1744
|
-
agentOptions: { keepAlive: false },
|
|
1745
|
-
json: true,
|
|
1746
|
-
body: models_1.ObjectSerializer.serialize(dspRunRequestWithoutFeaturesReadOnly, "DspRunRequestWithoutFeaturesReadOnly")
|
|
1747
|
+
headers: { ...localVarHeaderParams },
|
|
1747
1748
|
};
|
|
1748
|
-
|
|
1749
|
-
|
|
1750
|
-
|
|
1751
|
-
|
|
1752
|
-
|
|
1753
|
-
|
|
1754
|
-
|
|
1755
|
-
|
|
1756
|
-
|
|
1757
|
-
|
|
1758
|
-
|
|
1759
|
-
|
|
1760
|
-
|
|
1761
|
-
|
|
1749
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(dspRunRequestWithoutFeaturesReadOnly, "DspRunRequestWithoutFeaturesReadOnly"));
|
|
1750
|
+
let requestOptions = localVarRequestOptions;
|
|
1751
|
+
let url = localVarUrl;
|
|
1752
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1753
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1754
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1755
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1756
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1757
|
+
url = auth_JWTAuthentication.url;
|
|
1758
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1759
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1760
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1761
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1762
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1763
|
+
url = auth_OAuth2.url;
|
|
1764
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1765
|
+
requestOptions = authDefault.requestOptions;
|
|
1766
|
+
url = authDefault.url;
|
|
1767
|
+
if (localVarFormParams) {
|
|
1768
|
+
delete requestOptions.headers['Content-Type'];
|
|
1769
|
+
if (localVarFormParams instanceof FormData) {
|
|
1770
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1771
|
+
requestOptions.body = localVarFormParams;
|
|
1762
1772
|
}
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1772
|
-
reject(new Error(body.error || errString));
|
|
1773
|
-
}
|
|
1774
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1775
|
-
resolve(body);
|
|
1776
|
-
}
|
|
1777
|
-
else {
|
|
1778
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1779
|
-
reject(errString);
|
|
1780
|
-
}
|
|
1781
|
-
}
|
|
1782
|
-
});
|
|
1783
|
-
});
|
|
1784
|
-
});
|
|
1773
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1774
|
+
// URL-encoded form
|
|
1775
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1776
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1777
|
+
}
|
|
1778
|
+
}
|
|
1779
|
+
const response = await fetch(url, requestOptions);
|
|
1780
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
1785
1781
|
}
|
|
1786
1782
|
}
|
|
1787
1783
|
exports.DSPApi = DSPApi;
|