edge-impulse-api 1.60.4 → 1.60.6
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/rawDataApi.d.ts +112 -0
- package/build/library/sdk/api/rawDataApi.js +387 -0
- package/build/library/sdk/api/rawDataApi.js.map +1 -1
- package/build/library/sdk/model/batchAddMetadataRequest.d.ts +26 -0
- package/build/library/sdk/model/batchAddMetadataRequest.js +34 -0
- package/build/library/sdk/model/batchAddMetadataRequest.js.map +1 -0
- package/build/library/sdk/model/batchClearMetadataByKeyRequest.d.ts +25 -0
- package/build/library/sdk/model/batchClearMetadataByKeyRequest.js +29 -0
- package/build/library/sdk/model/batchClearMetadataByKeyRequest.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +2 -0
- package/build/library/sdk/model/models.js +6 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/package.json +1 -1
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
/// <reference types="node" />
|
|
13
|
+
import { BatchAddMetadataRequest } from '../model/batchAddMetadataRequest';
|
|
14
|
+
import { BatchClearMetadataByKeyRequest } from '../model/batchClearMetadataByKeyRequest';
|
|
13
15
|
import { CountSamplesResponse } from '../model/countSamplesResponse';
|
|
14
16
|
import { CropSampleRequest } from '../model/cropSampleRequest';
|
|
15
17
|
import { CropSampleResponse } from '../model/cropSampleResponse';
|
|
@@ -57,6 +59,48 @@ export declare enum RawDataApiApiKeys {
|
|
|
57
59
|
JWTAuthentication = 1,
|
|
58
60
|
JWTHttpHeaderAuthentication = 2
|
|
59
61
|
}
|
|
62
|
+
type batchAddMetadataQueryParams = {
|
|
63
|
+
category: 'training' | 'testing' | 'anomaly';
|
|
64
|
+
labels?: string;
|
|
65
|
+
filename?: string;
|
|
66
|
+
maxLength?: number;
|
|
67
|
+
minLength?: number;
|
|
68
|
+
minFrequency?: number;
|
|
69
|
+
maxFrequency?: number;
|
|
70
|
+
signatureValidity?: 'both' | 'valid' | 'invalid';
|
|
71
|
+
includeDisabled?: 'both' | 'enabled' | 'disabled';
|
|
72
|
+
ids?: string;
|
|
73
|
+
excludeIds?: string;
|
|
74
|
+
search?: string;
|
|
75
|
+
};
|
|
76
|
+
type batchClearMetadataQueryParams = {
|
|
77
|
+
category: 'training' | 'testing' | 'anomaly';
|
|
78
|
+
labels?: string;
|
|
79
|
+
filename?: string;
|
|
80
|
+
maxLength?: number;
|
|
81
|
+
minLength?: number;
|
|
82
|
+
minFrequency?: number;
|
|
83
|
+
maxFrequency?: number;
|
|
84
|
+
signatureValidity?: 'both' | 'valid' | 'invalid';
|
|
85
|
+
includeDisabled?: 'both' | 'enabled' | 'disabled';
|
|
86
|
+
ids?: string;
|
|
87
|
+
excludeIds?: string;
|
|
88
|
+
search?: string;
|
|
89
|
+
};
|
|
90
|
+
type batchClearMetadataByKeyQueryParams = {
|
|
91
|
+
category: 'training' | 'testing' | 'anomaly';
|
|
92
|
+
labels?: string;
|
|
93
|
+
filename?: string;
|
|
94
|
+
maxLength?: number;
|
|
95
|
+
minLength?: number;
|
|
96
|
+
minFrequency?: number;
|
|
97
|
+
maxFrequency?: number;
|
|
98
|
+
signatureValidity?: 'both' | 'valid' | 'invalid';
|
|
99
|
+
includeDisabled?: 'both' | 'enabled' | 'disabled';
|
|
100
|
+
ids?: string;
|
|
101
|
+
excludeIds?: string;
|
|
102
|
+
search?: string;
|
|
103
|
+
};
|
|
60
104
|
type batchDeleteQueryParams = {
|
|
61
105
|
category: 'training' | 'testing' | 'anomaly';
|
|
62
106
|
labels?: string;
|
|
@@ -223,6 +267,74 @@ export declare class RawDataApi {
|
|
|
223
267
|
get opts(): RawDataApiOpts;
|
|
224
268
|
setDefaultAuthentication(auth: Authentication): void;
|
|
225
269
|
setApiKey(key: RawDataApiApiKeys, value: string | undefined): void;
|
|
270
|
+
/**
|
|
271
|
+
* Add specific metadata for multiple samples.
|
|
272
|
+
* @summary Add metadata (multiple samples)
|
|
273
|
+
* @param projectId Project ID
|
|
274
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
275
|
+
* @param batchAddMetadataRequest
|
|
276
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
277
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
278
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
279
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
280
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
281
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
282
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
283
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
284
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
285
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
286
|
+
* @param search Search query
|
|
287
|
+
*/
|
|
288
|
+
batchAddMetadata(projectId: number, batchAddMetadataRequest: BatchAddMetadataRequest, queryParams: batchAddMetadataQueryParams, options?: {
|
|
289
|
+
headers: {
|
|
290
|
+
[name: string]: string;
|
|
291
|
+
};
|
|
292
|
+
}): Promise<StartJobResponse>;
|
|
293
|
+
/**
|
|
294
|
+
* Clears all metadata for multiple samples.
|
|
295
|
+
* @summary Clear all metadata (multiple samples)
|
|
296
|
+
* @param projectId Project ID
|
|
297
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
298
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
299
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
300
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
301
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
302
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
303
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
304
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
305
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
306
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
307
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
308
|
+
* @param search Search query
|
|
309
|
+
*/
|
|
310
|
+
batchClearMetadata(projectId: number, queryParams: batchClearMetadataQueryParams, options?: {
|
|
311
|
+
headers: {
|
|
312
|
+
[name: string]: string;
|
|
313
|
+
};
|
|
314
|
+
}): Promise<GenericApiResponse>;
|
|
315
|
+
/**
|
|
316
|
+
* Clears a specific metadata field (by key) for multiple samples.
|
|
317
|
+
* @summary Clear metadata by key (multiple samples)
|
|
318
|
+
* @param projectId Project ID
|
|
319
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
320
|
+
* @param batchClearMetadataByKeyRequest
|
|
321
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
322
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
323
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
324
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
325
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
326
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
327
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
328
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
329
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
330
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
331
|
+
* @param search Search query
|
|
332
|
+
*/
|
|
333
|
+
batchClearMetadataByKey(projectId: number, batchClearMetadataByKeyRequest: BatchClearMetadataByKeyRequest, queryParams: batchClearMetadataByKeyQueryParams, options?: {
|
|
334
|
+
headers: {
|
|
335
|
+
[name: string]: string;
|
|
336
|
+
};
|
|
337
|
+
}): Promise<StartJobResponse>;
|
|
226
338
|
/**
|
|
227
339
|
* Deletes samples. Note that this does not delete the data from cold storage.
|
|
228
340
|
* @summary Remove multiple samples
|
|
@@ -74,6 +74,393 @@ class RawDataApi {
|
|
|
74
74
|
setApiKey(key, value) {
|
|
75
75
|
this.authentications[RawDataApiApiKeys[key]].apiKey = value;
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Add specific metadata for multiple samples.
|
|
79
|
+
* @summary Add metadata (multiple samples)
|
|
80
|
+
* @param projectId Project ID
|
|
81
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
82
|
+
* @param batchAddMetadataRequest
|
|
83
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
84
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
85
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
86
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
87
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
88
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
89
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
90
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
91
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
92
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
93
|
+
* @param search Search query
|
|
94
|
+
*/
|
|
95
|
+
async batchAddMetadata(projectId, batchAddMetadataRequest, queryParams, options = { headers: {} }) {
|
|
96
|
+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/batch/add-metadata'
|
|
97
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
98
|
+
let localVarQueryParameters = {};
|
|
99
|
+
let localVarHeaderParams = Object.assign({
|
|
100
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
101
|
+
}, this.defaultHeaders);
|
|
102
|
+
const produces = ['application/json'];
|
|
103
|
+
// give precedence to 'application/json'
|
|
104
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
105
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
106
|
+
}
|
|
107
|
+
else {
|
|
108
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
109
|
+
}
|
|
110
|
+
let localVarFormParams = {};
|
|
111
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
112
|
+
if (projectId === null || projectId === undefined) {
|
|
113
|
+
throw new Error('Required parameter projectId was null or undefined when calling batchAddMetadata.');
|
|
114
|
+
}
|
|
115
|
+
// verify required parameter 'category' is not null or undefined
|
|
116
|
+
if (queryParams.category === null || queryParams.category === undefined) {
|
|
117
|
+
throw new Error('Required parameter queryParams.category was null or undefined when calling batchAddMetadata.');
|
|
118
|
+
}
|
|
119
|
+
// verify required parameter 'batchAddMetadataRequest' is not null or undefined
|
|
120
|
+
if (batchAddMetadataRequest === null || batchAddMetadataRequest === undefined) {
|
|
121
|
+
throw new Error('Required parameter batchAddMetadataRequest was null or undefined when calling batchAddMetadata.');
|
|
122
|
+
}
|
|
123
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
124
|
+
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'anomaly'");
|
|
125
|
+
}
|
|
126
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.labels) !== undefined) {
|
|
127
|
+
localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
|
|
128
|
+
}
|
|
129
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.filename) !== undefined) {
|
|
130
|
+
localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
|
|
131
|
+
}
|
|
132
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLength) !== undefined) {
|
|
133
|
+
localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
|
|
134
|
+
}
|
|
135
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLength) !== undefined) {
|
|
136
|
+
localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
|
|
137
|
+
}
|
|
138
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minFrequency) !== undefined) {
|
|
139
|
+
localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
|
|
140
|
+
}
|
|
141
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxFrequency) !== undefined) {
|
|
142
|
+
localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
|
|
143
|
+
}
|
|
144
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.signatureValidity) !== undefined) {
|
|
145
|
+
localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
|
|
146
|
+
}
|
|
147
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includeDisabled) !== undefined) {
|
|
148
|
+
localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
|
|
149
|
+
}
|
|
150
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.ids) !== undefined) {
|
|
151
|
+
localVarQueryParameters['ids'] = models_1.ObjectSerializer.serialize(queryParams.ids, "string");
|
|
152
|
+
}
|
|
153
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeIds) !== undefined) {
|
|
154
|
+
localVarQueryParameters['excludeIds'] = models_1.ObjectSerializer.serialize(queryParams.excludeIds, "string");
|
|
155
|
+
}
|
|
156
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.search) !== undefined) {
|
|
157
|
+
localVarQueryParameters['search'] = models_1.ObjectSerializer.serialize(queryParams.search, "string");
|
|
158
|
+
}
|
|
159
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
160
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
161
|
+
let localVarUseFormData = false;
|
|
162
|
+
let localVarRequestOptions = {
|
|
163
|
+
method: 'POST',
|
|
164
|
+
qs: localVarQueryParameters,
|
|
165
|
+
headers: localVarHeaderParams,
|
|
166
|
+
uri: localVarPath,
|
|
167
|
+
useQuerystring: this._useQuerystring,
|
|
168
|
+
agentOptions: { keepAlive: false },
|
|
169
|
+
json: true,
|
|
170
|
+
body: models_1.ObjectSerializer.serialize(batchAddMetadataRequest, "BatchAddMetadataRequest")
|
|
171
|
+
};
|
|
172
|
+
let authenticationPromise = Promise.resolve();
|
|
173
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
174
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
175
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
176
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
177
|
+
return authenticationPromise.then(() => {
|
|
178
|
+
if (Object.keys(localVarFormParams).length) {
|
|
179
|
+
if (localVarUseFormData) {
|
|
180
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
181
|
+
}
|
|
182
|
+
else {
|
|
183
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
return new Promise((resolve, reject) => {
|
|
187
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
188
|
+
if (error) {
|
|
189
|
+
reject(error);
|
|
190
|
+
}
|
|
191
|
+
else {
|
|
192
|
+
body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
|
|
193
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
194
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
195
|
+
reject(new Error(body.error || errString));
|
|
196
|
+
}
|
|
197
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
198
|
+
resolve(body);
|
|
199
|
+
}
|
|
200
|
+
else {
|
|
201
|
+
reject(errString);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
});
|
|
205
|
+
});
|
|
206
|
+
});
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Clears all metadata for multiple samples.
|
|
210
|
+
* @summary Clear all metadata (multiple samples)
|
|
211
|
+
* @param projectId Project ID
|
|
212
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
213
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
214
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
215
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
216
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
217
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
218
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
219
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
220
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
221
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
222
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
223
|
+
* @param search Search query
|
|
224
|
+
*/
|
|
225
|
+
async batchClearMetadata(projectId, queryParams, options = { headers: {} }) {
|
|
226
|
+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/batch/clear-metadata'
|
|
227
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
228
|
+
let localVarQueryParameters = {};
|
|
229
|
+
let localVarHeaderParams = Object.assign({
|
|
230
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
231
|
+
}, this.defaultHeaders);
|
|
232
|
+
const produces = ['application/json'];
|
|
233
|
+
// give precedence to 'application/json'
|
|
234
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
235
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
236
|
+
}
|
|
237
|
+
else {
|
|
238
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
239
|
+
}
|
|
240
|
+
let localVarFormParams = {};
|
|
241
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
242
|
+
if (projectId === null || projectId === undefined) {
|
|
243
|
+
throw new Error('Required parameter projectId was null or undefined when calling batchClearMetadata.');
|
|
244
|
+
}
|
|
245
|
+
// verify required parameter 'category' is not null or undefined
|
|
246
|
+
if (queryParams.category === null || queryParams.category === undefined) {
|
|
247
|
+
throw new Error('Required parameter queryParams.category was null or undefined when calling batchClearMetadata.');
|
|
248
|
+
}
|
|
249
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
250
|
+
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'anomaly'");
|
|
251
|
+
}
|
|
252
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.labels) !== undefined) {
|
|
253
|
+
localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
|
|
254
|
+
}
|
|
255
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.filename) !== undefined) {
|
|
256
|
+
localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
|
|
257
|
+
}
|
|
258
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLength) !== undefined) {
|
|
259
|
+
localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
|
|
260
|
+
}
|
|
261
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLength) !== undefined) {
|
|
262
|
+
localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
|
|
263
|
+
}
|
|
264
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minFrequency) !== undefined) {
|
|
265
|
+
localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
|
|
266
|
+
}
|
|
267
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxFrequency) !== undefined) {
|
|
268
|
+
localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
|
|
269
|
+
}
|
|
270
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.signatureValidity) !== undefined) {
|
|
271
|
+
localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
|
|
272
|
+
}
|
|
273
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includeDisabled) !== undefined) {
|
|
274
|
+
localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
|
|
275
|
+
}
|
|
276
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.ids) !== undefined) {
|
|
277
|
+
localVarQueryParameters['ids'] = models_1.ObjectSerializer.serialize(queryParams.ids, "string");
|
|
278
|
+
}
|
|
279
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeIds) !== undefined) {
|
|
280
|
+
localVarQueryParameters['excludeIds'] = models_1.ObjectSerializer.serialize(queryParams.excludeIds, "string");
|
|
281
|
+
}
|
|
282
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.search) !== undefined) {
|
|
283
|
+
localVarQueryParameters['search'] = models_1.ObjectSerializer.serialize(queryParams.search, "string");
|
|
284
|
+
}
|
|
285
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
286
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
287
|
+
let localVarUseFormData = false;
|
|
288
|
+
let localVarRequestOptions = {
|
|
289
|
+
method: 'POST',
|
|
290
|
+
qs: localVarQueryParameters,
|
|
291
|
+
headers: localVarHeaderParams,
|
|
292
|
+
uri: localVarPath,
|
|
293
|
+
useQuerystring: this._useQuerystring,
|
|
294
|
+
agentOptions: { keepAlive: false },
|
|
295
|
+
json: true,
|
|
296
|
+
};
|
|
297
|
+
let authenticationPromise = Promise.resolve();
|
|
298
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
299
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
300
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
301
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
302
|
+
return authenticationPromise.then(() => {
|
|
303
|
+
if (Object.keys(localVarFormParams).length) {
|
|
304
|
+
if (localVarUseFormData) {
|
|
305
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
306
|
+
}
|
|
307
|
+
else {
|
|
308
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
309
|
+
}
|
|
310
|
+
}
|
|
311
|
+
return new Promise((resolve, reject) => {
|
|
312
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
313
|
+
if (error) {
|
|
314
|
+
reject(error);
|
|
315
|
+
}
|
|
316
|
+
else {
|
|
317
|
+
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
318
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
319
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
320
|
+
reject(new Error(body.error || errString));
|
|
321
|
+
}
|
|
322
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
323
|
+
resolve(body);
|
|
324
|
+
}
|
|
325
|
+
else {
|
|
326
|
+
reject(errString);
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
});
|
|
330
|
+
});
|
|
331
|
+
});
|
|
332
|
+
}
|
|
333
|
+
/**
|
|
334
|
+
* Clears a specific metadata field (by key) for multiple samples.
|
|
335
|
+
* @summary Clear metadata by key (multiple samples)
|
|
336
|
+
* @param projectId Project ID
|
|
337
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
338
|
+
* @param batchClearMetadataByKeyRequest
|
|
339
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
340
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
341
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
342
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
343
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
344
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
345
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
346
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
347
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
348
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
349
|
+
* @param search Search query
|
|
350
|
+
*/
|
|
351
|
+
async batchClearMetadataByKey(projectId, batchClearMetadataByKeyRequest, queryParams, options = { headers: {} }) {
|
|
352
|
+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/batch/clear-metadata-by-key'
|
|
353
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
354
|
+
let localVarQueryParameters = {};
|
|
355
|
+
let localVarHeaderParams = Object.assign({
|
|
356
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
357
|
+
}, this.defaultHeaders);
|
|
358
|
+
const produces = ['application/json'];
|
|
359
|
+
// give precedence to 'application/json'
|
|
360
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
361
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
362
|
+
}
|
|
363
|
+
else {
|
|
364
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
365
|
+
}
|
|
366
|
+
let localVarFormParams = {};
|
|
367
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
368
|
+
if (projectId === null || projectId === undefined) {
|
|
369
|
+
throw new Error('Required parameter projectId was null or undefined when calling batchClearMetadataByKey.');
|
|
370
|
+
}
|
|
371
|
+
// verify required parameter 'category' is not null or undefined
|
|
372
|
+
if (queryParams.category === null || queryParams.category === undefined) {
|
|
373
|
+
throw new Error('Required parameter queryParams.category was null or undefined when calling batchClearMetadataByKey.');
|
|
374
|
+
}
|
|
375
|
+
// verify required parameter 'batchClearMetadataByKeyRequest' is not null or undefined
|
|
376
|
+
if (batchClearMetadataByKeyRequest === null || batchClearMetadataByKeyRequest === undefined) {
|
|
377
|
+
throw new Error('Required parameter batchClearMetadataByKeyRequest was null or undefined when calling batchClearMetadataByKey.');
|
|
378
|
+
}
|
|
379
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
380
|
+
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "'training' | 'testing' | 'anomaly'");
|
|
381
|
+
}
|
|
382
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.labels) !== undefined) {
|
|
383
|
+
localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
|
|
384
|
+
}
|
|
385
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.filename) !== undefined) {
|
|
386
|
+
localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
|
|
387
|
+
}
|
|
388
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLength) !== undefined) {
|
|
389
|
+
localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
|
|
390
|
+
}
|
|
391
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLength) !== undefined) {
|
|
392
|
+
localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
|
|
393
|
+
}
|
|
394
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minFrequency) !== undefined) {
|
|
395
|
+
localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
|
|
396
|
+
}
|
|
397
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxFrequency) !== undefined) {
|
|
398
|
+
localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
|
|
399
|
+
}
|
|
400
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.signatureValidity) !== undefined) {
|
|
401
|
+
localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
|
|
402
|
+
}
|
|
403
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includeDisabled) !== undefined) {
|
|
404
|
+
localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
|
|
405
|
+
}
|
|
406
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.ids) !== undefined) {
|
|
407
|
+
localVarQueryParameters['ids'] = models_1.ObjectSerializer.serialize(queryParams.ids, "string");
|
|
408
|
+
}
|
|
409
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeIds) !== undefined) {
|
|
410
|
+
localVarQueryParameters['excludeIds'] = models_1.ObjectSerializer.serialize(queryParams.excludeIds, "string");
|
|
411
|
+
}
|
|
412
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.search) !== undefined) {
|
|
413
|
+
localVarQueryParameters['search'] = models_1.ObjectSerializer.serialize(queryParams.search, "string");
|
|
414
|
+
}
|
|
415
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
416
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
417
|
+
let localVarUseFormData = false;
|
|
418
|
+
let localVarRequestOptions = {
|
|
419
|
+
method: 'POST',
|
|
420
|
+
qs: localVarQueryParameters,
|
|
421
|
+
headers: localVarHeaderParams,
|
|
422
|
+
uri: localVarPath,
|
|
423
|
+
useQuerystring: this._useQuerystring,
|
|
424
|
+
agentOptions: { keepAlive: false },
|
|
425
|
+
json: true,
|
|
426
|
+
body: models_1.ObjectSerializer.serialize(batchClearMetadataByKeyRequest, "BatchClearMetadataByKeyRequest")
|
|
427
|
+
};
|
|
428
|
+
let authenticationPromise = Promise.resolve();
|
|
429
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
430
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
431
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
432
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
433
|
+
return authenticationPromise.then(() => {
|
|
434
|
+
if (Object.keys(localVarFormParams).length) {
|
|
435
|
+
if (localVarUseFormData) {
|
|
436
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
437
|
+
}
|
|
438
|
+
else {
|
|
439
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
440
|
+
}
|
|
441
|
+
}
|
|
442
|
+
return new Promise((resolve, reject) => {
|
|
443
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
444
|
+
if (error) {
|
|
445
|
+
reject(error);
|
|
446
|
+
}
|
|
447
|
+
else {
|
|
448
|
+
body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
|
|
449
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
450
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
451
|
+
reject(new Error(body.error || errString));
|
|
452
|
+
}
|
|
453
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
454
|
+
resolve(body);
|
|
455
|
+
}
|
|
456
|
+
else {
|
|
457
|
+
reject(errString);
|
|
458
|
+
}
|
|
459
|
+
}
|
|
460
|
+
});
|
|
461
|
+
});
|
|
462
|
+
});
|
|
463
|
+
}
|
|
77
464
|
/**
|
|
78
465
|
* Deletes samples. Note that this does not delete the data from cold storage.
|
|
79
466
|
* @summary Remove multiple samples
|