edge-impulse-api 1.74.11 → 1.74.12
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 +55 -1
- package/build/library/sdk/api/rawDataApi.js +166 -1
- package/build/library/sdk/api/rawDataApi.js.map +1 -1
- package/build/library/sdk/model/batchEditBoundingBoxesRequest.d.ts +32 -0
- package/build/library/sdk/model/batchEditBoundingBoxesRequest.js +34 -0
- package/build/library/sdk/model/batchEditBoundingBoxesRequest.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +1 -0
- package/build/library/sdk/model/models.js +3 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/package.json +1 -1
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
/// <reference types="node" />
|
|
14
14
|
import { BatchAddMetadataRequest } from '../model/batchAddMetadataRequest';
|
|
15
15
|
import { BatchClearMetadataByKeyRequest } from '../model/batchClearMetadataByKeyRequest';
|
|
16
|
+
import { BatchEditBoundingBoxesRequest } from '../model/batchEditBoundingBoxesRequest';
|
|
16
17
|
import { CountSamplesResponse } from '../model/countSamplesResponse';
|
|
17
18
|
import { CropSampleRequest } from '../model/cropSampleRequest';
|
|
18
19
|
import { CropSampleResponse } from '../model/cropSampleResponse';
|
|
@@ -171,6 +172,28 @@ type batchDisableQueryParams = {
|
|
|
171
172
|
minDate?: Date;
|
|
172
173
|
maxDate?: Date;
|
|
173
174
|
};
|
|
175
|
+
type batchEditBoundingBoxesQueryParams = {
|
|
176
|
+
category: RawDataCategory;
|
|
177
|
+
labels?: string;
|
|
178
|
+
filename?: string;
|
|
179
|
+
maxLength?: number;
|
|
180
|
+
minLength?: number;
|
|
181
|
+
minFrequency?: number;
|
|
182
|
+
maxFrequency?: number;
|
|
183
|
+
signatureValidity?: 'both' | 'valid' | 'invalid';
|
|
184
|
+
includeDisabled?: 'both' | 'enabled' | 'disabled';
|
|
185
|
+
ids?: string;
|
|
186
|
+
excludeIds?: string;
|
|
187
|
+
minLabel?: number;
|
|
188
|
+
maxLabel?: number;
|
|
189
|
+
search?: string;
|
|
190
|
+
dataType?: 'audio' | 'image';
|
|
191
|
+
minId?: number;
|
|
192
|
+
maxId?: number;
|
|
193
|
+
metadata?: string;
|
|
194
|
+
minDate?: Date;
|
|
195
|
+
maxDate?: Date;
|
|
196
|
+
};
|
|
174
197
|
type batchEditLabelsQueryParams = {
|
|
175
198
|
category: RawDataCategory;
|
|
176
199
|
labels?: string;
|
|
@@ -513,7 +536,38 @@ export declare class RawDataApi {
|
|
|
513
536
|
};
|
|
514
537
|
}): Promise<GenericApiResponse | StartJobResponse>;
|
|
515
538
|
/**
|
|
516
|
-
*
|
|
539
|
+
* Relabels (or removes) bounding boxes for multiple samples. Depending on the number of affected samples this will either execute immediately or return the ID of a job that will perform this action in batches.
|
|
540
|
+
* @summary Edit bounding boxes for multiple samples
|
|
541
|
+
* @param projectId Project ID
|
|
542
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
543
|
+
* @param batchEditBoundingBoxesRequest
|
|
544
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
545
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
546
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
547
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
548
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
549
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
550
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
551
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
552
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
553
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
554
|
+
* @param minLabel Only include samples with a label >= this value
|
|
555
|
+
* @param maxLabel Only include samples with a label < this value
|
|
556
|
+
* @param search Search query
|
|
557
|
+
* @param dataType Include only samples with a particular data type
|
|
558
|
+
* @param minId Include only samples with an ID >= this value
|
|
559
|
+
* @param maxId Include only samples with an ID < this value
|
|
560
|
+
* @param metadata Filter samples by metadata key-value pairs, provided as a JSON string. Each filter item in the list is combined using a logical OR. To include samples without any metadata, use: { \"no_metadata\": true }.
|
|
561
|
+
* @param minDate Only include samples that where added after the date given
|
|
562
|
+
* @param maxDate Only include samples that were added before the date given
|
|
563
|
+
*/
|
|
564
|
+
batchEditBoundingBoxes(projectId: number, batchEditBoundingBoxesRequest: BatchEditBoundingBoxesRequest, queryParams: batchEditBoundingBoxesQueryParams, options?: {
|
|
565
|
+
headers: {
|
|
566
|
+
[name: string]: string;
|
|
567
|
+
};
|
|
568
|
+
}): Promise<GenericApiResponse | StartJobResponse>;
|
|
569
|
+
/**
|
|
570
|
+
* Sets the label (also known as class) of multiple samples. If you want to relabel bounding boxes, use \"batchEditBoundingBoxes\" instead. Depending on the number of affected samples this will either execute immediately or return the ID of a job that will perform this action in batches.
|
|
517
571
|
* @summary Edit labels for multiple samples
|
|
518
572
|
* @param projectId Project ID
|
|
519
573
|
* @param category Which of the three acquisition categories to retrieve data from
|
|
@@ -886,7 +886,172 @@ class RawDataApi {
|
|
|
886
886
|
});
|
|
887
887
|
}
|
|
888
888
|
/**
|
|
889
|
-
*
|
|
889
|
+
* Relabels (or removes) bounding boxes for multiple samples. Depending on the number of affected samples this will either execute immediately or return the ID of a job that will perform this action in batches.
|
|
890
|
+
* @summary Edit bounding boxes for multiple samples
|
|
891
|
+
* @param projectId Project ID
|
|
892
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
893
|
+
* @param batchEditBoundingBoxesRequest
|
|
894
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
895
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
896
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
897
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
898
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
899
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
900
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
901
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
902
|
+
* @param ids Only include samples with an ID within the given list of IDs, given as a JSON string
|
|
903
|
+
* @param excludeIds Exclude samples with an ID within the given list of IDs, given as a JSON string
|
|
904
|
+
* @param minLabel Only include samples with a label >= this value
|
|
905
|
+
* @param maxLabel Only include samples with a label < this value
|
|
906
|
+
* @param search Search query
|
|
907
|
+
* @param dataType Include only samples with a particular data type
|
|
908
|
+
* @param minId Include only samples with an ID >= this value
|
|
909
|
+
* @param maxId Include only samples with an ID < this value
|
|
910
|
+
* @param metadata Filter samples by metadata key-value pairs, provided as a JSON string. Each filter item in the list is combined using a logical OR. To include samples without any metadata, use: { \"no_metadata\": true }.
|
|
911
|
+
* @param minDate Only include samples that where added after the date given
|
|
912
|
+
* @param maxDate Only include samples that were added before the date given
|
|
913
|
+
*/
|
|
914
|
+
async batchEditBoundingBoxes(projectId, batchEditBoundingBoxesRequest, queryParams, options = { headers: {} }) {
|
|
915
|
+
const localVarPath = this.basePath + '/api/{projectId}/raw-data/batch/edit-bounding-boxes'
|
|
916
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
917
|
+
let localVarQueryParameters = {};
|
|
918
|
+
let localVarHeaderParams = Object.assign({
|
|
919
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
920
|
+
}, this.defaultHeaders);
|
|
921
|
+
const produces = ['application/json'];
|
|
922
|
+
// give precedence to 'application/json'
|
|
923
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
924
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
925
|
+
}
|
|
926
|
+
else {
|
|
927
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
928
|
+
}
|
|
929
|
+
let localVarFormParams = {};
|
|
930
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
931
|
+
if (projectId === null || projectId === undefined) {
|
|
932
|
+
throw new Error('Required parameter projectId was null or undefined when calling batchEditBoundingBoxes.');
|
|
933
|
+
}
|
|
934
|
+
// verify required parameter 'category' is not null or undefined
|
|
935
|
+
if (queryParams.category === null || queryParams.category === undefined) {
|
|
936
|
+
throw new Error('Required parameter queryParams.category was null or undefined when calling batchEditBoundingBoxes.');
|
|
937
|
+
}
|
|
938
|
+
// verify required parameter 'batchEditBoundingBoxesRequest' is not null or undefined
|
|
939
|
+
if (batchEditBoundingBoxesRequest === null || batchEditBoundingBoxesRequest === undefined) {
|
|
940
|
+
throw new Error('Required parameter batchEditBoundingBoxesRequest was null or undefined when calling batchEditBoundingBoxes.');
|
|
941
|
+
}
|
|
942
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
943
|
+
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "RawDataCategory");
|
|
944
|
+
}
|
|
945
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.labels) !== undefined) {
|
|
946
|
+
localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
|
|
947
|
+
}
|
|
948
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.filename) !== undefined) {
|
|
949
|
+
localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
|
|
950
|
+
}
|
|
951
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLength) !== undefined) {
|
|
952
|
+
localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
|
|
953
|
+
}
|
|
954
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLength) !== undefined) {
|
|
955
|
+
localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
|
|
956
|
+
}
|
|
957
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minFrequency) !== undefined) {
|
|
958
|
+
localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
|
|
959
|
+
}
|
|
960
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxFrequency) !== undefined) {
|
|
961
|
+
localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
|
|
962
|
+
}
|
|
963
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.signatureValidity) !== undefined) {
|
|
964
|
+
localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
|
|
965
|
+
}
|
|
966
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includeDisabled) !== undefined) {
|
|
967
|
+
localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
|
|
968
|
+
}
|
|
969
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.ids) !== undefined) {
|
|
970
|
+
localVarQueryParameters['ids'] = models_1.ObjectSerializer.serialize(queryParams.ids, "string");
|
|
971
|
+
}
|
|
972
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeIds) !== undefined) {
|
|
973
|
+
localVarQueryParameters['excludeIds'] = models_1.ObjectSerializer.serialize(queryParams.excludeIds, "string");
|
|
974
|
+
}
|
|
975
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLabel) !== undefined) {
|
|
976
|
+
localVarQueryParameters['minLabel'] = models_1.ObjectSerializer.serialize(queryParams.minLabel, "number");
|
|
977
|
+
}
|
|
978
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLabel) !== undefined) {
|
|
979
|
+
localVarQueryParameters['maxLabel'] = models_1.ObjectSerializer.serialize(queryParams.maxLabel, "number");
|
|
980
|
+
}
|
|
981
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.search) !== undefined) {
|
|
982
|
+
localVarQueryParameters['search'] = models_1.ObjectSerializer.serialize(queryParams.search, "string");
|
|
983
|
+
}
|
|
984
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.dataType) !== undefined) {
|
|
985
|
+
localVarQueryParameters['dataType'] = models_1.ObjectSerializer.serialize(queryParams.dataType, "'audio' | 'image'");
|
|
986
|
+
}
|
|
987
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minId) !== undefined) {
|
|
988
|
+
localVarQueryParameters['minId'] = models_1.ObjectSerializer.serialize(queryParams.minId, "number");
|
|
989
|
+
}
|
|
990
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxId) !== undefined) {
|
|
991
|
+
localVarQueryParameters['maxId'] = models_1.ObjectSerializer.serialize(queryParams.maxId, "number");
|
|
992
|
+
}
|
|
993
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.metadata) !== undefined) {
|
|
994
|
+
localVarQueryParameters['metadata'] = models_1.ObjectSerializer.serialize(queryParams.metadata, "string");
|
|
995
|
+
}
|
|
996
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minDate) !== undefined) {
|
|
997
|
+
localVarQueryParameters['minDate'] = models_1.ObjectSerializer.serialize(queryParams.minDate, "Date");
|
|
998
|
+
}
|
|
999
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxDate) !== undefined) {
|
|
1000
|
+
localVarQueryParameters['maxDate'] = models_1.ObjectSerializer.serialize(queryParams.maxDate, "Date");
|
|
1001
|
+
}
|
|
1002
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
1003
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
1004
|
+
let localVarUseFormData = false;
|
|
1005
|
+
let localVarRequestOptions = {
|
|
1006
|
+
method: 'POST',
|
|
1007
|
+
qs: localVarQueryParameters,
|
|
1008
|
+
headers: localVarHeaderParams,
|
|
1009
|
+
uri: localVarPath,
|
|
1010
|
+
useQuerystring: this._useQuerystring,
|
|
1011
|
+
agentOptions: { keepAlive: false },
|
|
1012
|
+
json: true,
|
|
1013
|
+
body: models_1.ObjectSerializer.serialize(batchEditBoundingBoxesRequest, "BatchEditBoundingBoxesRequest")
|
|
1014
|
+
};
|
|
1015
|
+
let authenticationPromise = Promise.resolve();
|
|
1016
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
1017
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
1018
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
1019
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.OAuth2.applyToRequest(localVarRequestOptions));
|
|
1020
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1021
|
+
return authenticationPromise.then(() => {
|
|
1022
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1023
|
+
if (localVarUseFormData) {
|
|
1024
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
1025
|
+
}
|
|
1026
|
+
else {
|
|
1027
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1028
|
+
}
|
|
1029
|
+
}
|
|
1030
|
+
return new Promise((resolve, reject) => {
|
|
1031
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1032
|
+
if (error) {
|
|
1033
|
+
reject(error);
|
|
1034
|
+
}
|
|
1035
|
+
else {
|
|
1036
|
+
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse | StartJobResponse");
|
|
1037
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
1038
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1039
|
+
reject(new Error(body.error || errString));
|
|
1040
|
+
}
|
|
1041
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1042
|
+
resolve(body);
|
|
1043
|
+
}
|
|
1044
|
+
else {
|
|
1045
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1046
|
+
reject(errString);
|
|
1047
|
+
}
|
|
1048
|
+
}
|
|
1049
|
+
});
|
|
1050
|
+
});
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
/**
|
|
1054
|
+
* Sets the label (also known as class) of multiple samples. If you want to relabel bounding boxes, use \"batchEditBoundingBoxes\" instead. Depending on the number of affected samples this will either execute immediately or return the ID of a job that will perform this action in batches.
|
|
890
1055
|
* @summary Edit labels for multiple samples
|
|
891
1056
|
* @param projectId Project ID
|
|
892
1057
|
* @param category Which of the three acquisition categories to retrieve data from
|