edge-impulse-api 1.93.1 → 1.93.3
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 +15 -0
- package/build/library/sdk/api/adminApi.js +77 -0
- package/build/library/sdk/api/adminApi.js.map +1 -1
- package/build/library/sdk/api/apis.d.ts +3 -1
- package/build/library/sdk/api/apis.js +3 -1
- package/build/library/sdk/api/apis.js.map +1 -1
- package/build/library/sdk/api/dSPApi.d.ts +3 -3
- package/build/library/sdk/api/dSPApi.js +3 -3
- package/build/library/sdk/api/dSPApi.js.map +1 -1
- package/build/library/sdk/api/datasetVersionsApi.d.ts +204 -0
- package/build/library/sdk/api/datasetVersionsApi.js +873 -0
- package/build/library/sdk/api/datasetVersionsApi.js.map +1 -0
- package/build/library/sdk/api/projectsApi.d.ts +10 -0
- package/build/library/sdk/api/projectsApi.js +73 -0
- package/build/library/sdk/api/projectsApi.js.map +1 -1
- package/build/library/sdk/model/actorOAuthClient.d.ts +33 -0
- package/build/library/sdk/model/actorOAuthClient.js +55 -0
- package/build/library/sdk/model/actorOAuthClient.js.map +1 -0
- package/build/library/sdk/model/actorProjectApiKey.d.ts +43 -0
- package/build/library/sdk/model/actorProjectApiKey.js +76 -0
- package/build/library/sdk/model/actorProjectApiKey.js.map +1 -0
- package/build/library/sdk/model/actorProjectApiKeyAllOf.d.ts +27 -0
- package/build/library/sdk/model/actorProjectApiKeyAllOf.js +30 -0
- package/build/library/sdk/model/actorProjectApiKeyAllOf.js.map +1 -0
- package/build/library/sdk/model/actorUser.d.ts +31 -0
- package/build/library/sdk/model/actorUser.js +50 -0
- package/build/library/sdk/model/actorUser.js.map +1 -0
- package/build/library/sdk/model/actorUserAllOf.d.ts +27 -0
- package/build/library/sdk/model/actorUserAllOf.js +30 -0
- package/build/library/sdk/model/actorUserAllOf.js.map +1 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponse.d.ts +40 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponse.js +44 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponse.js.map +1 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponseAllOf.d.ts +32 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponseAllOf.js +34 -0
- package/build/library/sdk/model/adminProjectKillSwitchResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/dBAction.d.ts +13 -0
- package/build/library/sdk/model/dBAction.js +16 -0
- package/build/library/sdk/model/dBAction.js.map +1 -0
- package/build/library/sdk/model/datasetVersion.d.ts +67 -0
- package/build/library/sdk/model/datasetVersion.js +79 -0
- package/build/library/sdk/model/datasetVersion.js.map +1 -0
- package/build/library/sdk/model/datasetVersionChangeItem.d.ts +35 -0
- package/build/library/sdk/model/datasetVersionChangeItem.js +44 -0
- package/build/library/sdk/model/datasetVersionChangeItem.js.map +1 -0
- package/build/library/sdk/model/datasetVersionPendingWindow.d.ts +36 -0
- package/build/library/sdk/model/datasetVersionPendingWindow.js +39 -0
- package/build/library/sdk/model/datasetVersionPendingWindow.js.map +1 -0
- package/build/library/sdk/model/datasetVersionSummary.d.ts +34 -0
- package/build/library/sdk/model/datasetVersionSummary.js +39 -0
- package/build/library/sdk/model/datasetVersionSummary.js.map +1 -0
- package/build/library/sdk/model/datasetVersionSummaryActionCounts.d.ts +39 -0
- package/build/library/sdk/model/datasetVersionSummaryActionCounts.js +42 -0
- package/build/library/sdk/model/datasetVersionSummaryActionCounts.js.map +1 -0
- package/build/library/sdk/model/datasetVersionType.d.ts +13 -0
- package/build/library/sdk/model/datasetVersionType.js +16 -0
- package/build/library/sdk/model/datasetVersionType.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionRawDataResponse.d.ts +35 -0
- package/build/library/sdk/model/getDatasetVersionRawDataResponse.js +44 -0
- package/build/library/sdk/model/getDatasetVersionRawDataResponse.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponse.d.ts +34 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponse.js +39 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponse.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponseAllOf.js +29 -0
- package/build/library/sdk/model/getDatasetVersionRawDataSampleResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionResponse.d.ts +34 -0
- package/build/library/sdk/model/getDatasetVersionResponse.js +39 -0
- package/build/library/sdk/model/getDatasetVersionResponse.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/getDatasetVersionResponseAllOf.js +29 -0
- package/build/library/sdk/model/getDatasetVersionResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponse.d.ts +34 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponse.js +39 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponse.js.map +1 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponseAllOf.js +29 -0
- package/build/library/sdk/model/getDatasetVersionSampleChangeDetailsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/lastUpdatedByDatasetVersionRestore.d.ts +45 -0
- package/build/library/sdk/model/lastUpdatedByDatasetVersionRestore.js +48 -0
- package/build/library/sdk/model/lastUpdatedByDatasetVersionRestore.js.map +1 -0
- package/build/library/sdk/model/lastUpdatedByOAuthClient.d.ts +38 -0
- package/build/library/sdk/model/lastUpdatedByOAuthClient.js +43 -0
- package/build/library/sdk/model/lastUpdatedByOAuthClient.js.map +1 -0
- package/build/library/sdk/model/lastUpdatedByProjectApiKey.d.ts +34 -0
- package/build/library/sdk/model/lastUpdatedByProjectApiKey.js +38 -0
- package/build/library/sdk/model/lastUpdatedByProjectApiKey.js.map +1 -0
- package/build/library/sdk/model/lastUpdatedByUser.d.ts +34 -0
- package/build/library/sdk/model/lastUpdatedByUser.js +38 -0
- package/build/library/sdk/model/lastUpdatedByUser.js.map +1 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponse.d.ts +35 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponse.js +44 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponse.js.map +1 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponseAllOf.d.ts +27 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponseAllOf.js +34 -0
- package/build/library/sdk/model/listDatasetVersionChangesResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/listDatasetVersionsResponse.d.ts +37 -0
- package/build/library/sdk/model/listDatasetVersionsResponse.js +49 -0
- package/build/library/sdk/model/listDatasetVersionsResponse.js.map +1 -0
- package/build/library/sdk/model/listDatasetVersionsResponseAllOf.d.ts +29 -0
- package/build/library/sdk/model/listDatasetVersionsResponseAllOf.js +39 -0
- package/build/library/sdk/model/listDatasetVersionsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +30 -0
- package/build/library/sdk/model/models.js +98 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/sample.d.ts +8 -0
- package/build/library/sdk/model/sample.js +5 -0
- package/build/library/sdk/model/sample.js.map +1 -1
- package/build/library/sdk/model/updateDatasetVersionRequest.d.ts +25 -0
- package/build/library/sdk/model/updateDatasetVersionRequest.js +29 -0
- package/build/library/sdk/model/updateDatasetVersionRequest.js.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,873 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Edge Impulse API
|
|
4
|
+
* No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)
|
|
5
|
+
*
|
|
6
|
+
* The version of the OpenAPI document: 1.0.0
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
|
|
10
|
+
* https://openapi-generator.tech
|
|
11
|
+
* Do not edit the class manually.
|
|
12
|
+
*/
|
|
13
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
|
+
exports.DatasetVersionsApi = exports.DatasetVersionsApiApiKeys = void 0;
|
|
15
|
+
const PATH = require('path');
|
|
16
|
+
module.paths.push(PATH.join(process.cwd(), 'node_modules'));
|
|
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
|
+
}
|
|
28
|
+
const models_1 = require("../model/models");
|
|
29
|
+
const models_2 = require("../model/models");
|
|
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
|
+
}
|
|
40
|
+
// ===============================================
|
|
41
|
+
// This file is autogenerated - Please do not edit
|
|
42
|
+
// ===============================================
|
|
43
|
+
var DatasetVersionsApiApiKeys;
|
|
44
|
+
(function (DatasetVersionsApiApiKeys) {
|
|
45
|
+
DatasetVersionsApiApiKeys[DatasetVersionsApiApiKeys["ApiKeyAuthentication"] = 0] = "ApiKeyAuthentication";
|
|
46
|
+
DatasetVersionsApiApiKeys[DatasetVersionsApiApiKeys["JWTAuthentication"] = 1] = "JWTAuthentication";
|
|
47
|
+
DatasetVersionsApiApiKeys[DatasetVersionsApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
48
|
+
})(DatasetVersionsApiApiKeys = exports.DatasetVersionsApiApiKeys || (exports.DatasetVersionsApiApiKeys = {}));
|
|
49
|
+
class DatasetVersionsApi {
|
|
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
|
+
}
|
|
71
|
+
constructor(basePathOrUsername, opts, password, basePath) {
|
|
72
|
+
this._basePath = defaultBasePath;
|
|
73
|
+
this.defaultHeaders = {};
|
|
74
|
+
this._opts = {};
|
|
75
|
+
this.authentications = {
|
|
76
|
+
'default': new models_1.VoidAuth(),
|
|
77
|
+
'ApiKeyAuthentication': new models_2.ApiKeyAuth('header', 'x-api-key'),
|
|
78
|
+
'OAuth2': new models_2.OAuth(),
|
|
79
|
+
'JWTAuthentication': new models_2.ApiKeyAuth('cookie', 'jwt'),
|
|
80
|
+
'JWTHttpHeaderAuthentication': new models_2.ApiKeyAuth('header', 'x-jwt-token'),
|
|
81
|
+
};
|
|
82
|
+
if (password) {
|
|
83
|
+
if (basePath) {
|
|
84
|
+
this.basePath = basePath;
|
|
85
|
+
}
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
if (basePathOrUsername) {
|
|
89
|
+
this.basePath = basePathOrUsername;
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
this.opts = opts !== null && opts !== void 0 ? opts : {};
|
|
93
|
+
}
|
|
94
|
+
set basePath(basePath) {
|
|
95
|
+
this._basePath = basePath;
|
|
96
|
+
}
|
|
97
|
+
get basePath() {
|
|
98
|
+
return this._basePath;
|
|
99
|
+
}
|
|
100
|
+
set opts(opts) {
|
|
101
|
+
this._opts = opts;
|
|
102
|
+
}
|
|
103
|
+
get opts() {
|
|
104
|
+
return this._opts;
|
|
105
|
+
}
|
|
106
|
+
setDefaultAuthentication(auth) {
|
|
107
|
+
this.authentications.default = auth;
|
|
108
|
+
}
|
|
109
|
+
setApiKey(key, value) {
|
|
110
|
+
this.authentications[DatasetVersionsApiApiKeys[key]].apiKey = value;
|
|
111
|
+
}
|
|
112
|
+
set accessToken(token) {
|
|
113
|
+
this.authentications.OAuth2.accessToken = token;
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get details of a specific dataset version for this project.
|
|
117
|
+
* @summary Get dataset version
|
|
118
|
+
* @param projectId Project ID
|
|
119
|
+
* @param datasetVersionId Dataset version ID
|
|
120
|
+
*/
|
|
121
|
+
async getDatasetVersion(projectId, datasetVersionId, options = { headers: {} }) {
|
|
122
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}'
|
|
123
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
124
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)));
|
|
125
|
+
let localVarQueryParameters = {};
|
|
126
|
+
let localVarHeaderParams = {
|
|
127
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
...this.defaultHeaders,
|
|
130
|
+
};
|
|
131
|
+
const produces = ['application/json'];
|
|
132
|
+
// give precedence to 'application/json'
|
|
133
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
134
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
135
|
+
}
|
|
136
|
+
else {
|
|
137
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
138
|
+
}
|
|
139
|
+
let localVarFormParams;
|
|
140
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
141
|
+
if (projectId === null || projectId === undefined) {
|
|
142
|
+
throw new Error('Required parameter projectId was null or undefined when calling getDatasetVersion.');
|
|
143
|
+
}
|
|
144
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
145
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
146
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling getDatasetVersion.');
|
|
147
|
+
}
|
|
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}` : '');
|
|
158
|
+
let localVarRequestOptions = {
|
|
159
|
+
method: 'GET',
|
|
160
|
+
headers: { ...localVarHeaderParams },
|
|
161
|
+
};
|
|
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';
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
const response = await fetch(url, requestOptions);
|
|
192
|
+
return this.handleResponse(response, 'GetDatasetVersionResponse');
|
|
193
|
+
}
|
|
194
|
+
/**
|
|
195
|
+
* Get the full snapshot raw data contents of a specific dataset for this project.
|
|
196
|
+
* @summary Get dataset version raw-data contents
|
|
197
|
+
* @param projectId Project ID
|
|
198
|
+
* @param datasetVersionId Dataset version ID
|
|
199
|
+
* @param category Which of the three acquisition categories to retrieve data from
|
|
200
|
+
* @param limit Maximum number of results
|
|
201
|
+
* @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
|
|
202
|
+
* @param excludeSensors Whether to exclude sensors in the response (as these can slow down requests when you have large pages).
|
|
203
|
+
* @param labels Only include samples with a label within the given list of labels, given as a JSON string
|
|
204
|
+
* @param filename Only include samples whose filename includes the given filename
|
|
205
|
+
* @param maxLength Only include samples shorter than the given length, in milliseconds
|
|
206
|
+
* @param minLength Only include samples longer than the given length, in milliseconds
|
|
207
|
+
* @param minFrequency Only include samples with higher frequency than given frequency, in hertz
|
|
208
|
+
* @param maxFrequency Only include samples with lower frequency than given frequency, in hertz
|
|
209
|
+
* @param signatureValidity Include samples with either valid or invalid signatures
|
|
210
|
+
* @param includeDisabled Include only enabled or disabled samples (or both)
|
|
211
|
+
* @param minLabel Only include samples with a label >= this value
|
|
212
|
+
* @param maxLabel Only include samples with a label < this value
|
|
213
|
+
* @param search Search query
|
|
214
|
+
* @param truncateStructuredLabels If true, only a slice of labels will be returned for samples with multiple labels.
|
|
215
|
+
* @param sortBy If not specified, \"id-desc\" is used.
|
|
216
|
+
* @param dataType Include only samples with a particular data type
|
|
217
|
+
* @param minId Include only samples with an ID >= this value
|
|
218
|
+
* @param maxId Include only samples with an ID < this value
|
|
219
|
+
* @param metadata Filter samples by metadata key-value pairs, provided as a JSON string. Each item in the filter list is an object with the following properties: - \"key\": Metadata key to filter on. - \"op\": Operator (\"eq\" for positive match, \"neq\" for negative match). - \"values\": (optional) Array of values to match/exclude. If omitted or empty, matches/excludes all values for the key. In addition to filter objects, the following option objects can be specified: - { \"no_metadata\": boolean } - If true, include samples without any metadata - { \"filters_combinator\": (\"and\" | \"or\") } - Specifies the combinator and matching mode: - \"and\": All filter items must match (logical AND). - \"or\": Any filter item may match (logical OR); samples with metadata keys not present in the filters are included.
|
|
220
|
+
* @param minDate Only include samples that where added after the date given
|
|
221
|
+
* @param maxDate Only include samples that were added before the date given
|
|
222
|
+
*/
|
|
223
|
+
async getDatasetVersionRawData(projectId, datasetVersionId, queryParams, options = { headers: {} }) {
|
|
224
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}/raw-data'
|
|
225
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
226
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)));
|
|
227
|
+
let localVarQueryParameters = {};
|
|
228
|
+
let localVarHeaderParams = {
|
|
229
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
230
|
+
'Content-Type': 'application/json',
|
|
231
|
+
...this.defaultHeaders,
|
|
232
|
+
};
|
|
233
|
+
const produces = ['application/json'];
|
|
234
|
+
// give precedence to 'application/json'
|
|
235
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
236
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
237
|
+
}
|
|
238
|
+
else {
|
|
239
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
240
|
+
}
|
|
241
|
+
let localVarFormParams;
|
|
242
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
243
|
+
if (projectId === null || projectId === undefined) {
|
|
244
|
+
throw new Error('Required parameter projectId was null or undefined when calling getDatasetVersionRawData.');
|
|
245
|
+
}
|
|
246
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
247
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
248
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling getDatasetVersionRawData.');
|
|
249
|
+
}
|
|
250
|
+
// verify required parameter 'category' is not null or undefined
|
|
251
|
+
if (queryParams.category === null || queryParams.category === undefined) {
|
|
252
|
+
throw new Error('Required parameter queryParams.category was null or undefined when calling getDatasetVersionRawData.');
|
|
253
|
+
}
|
|
254
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.category) !== undefined) {
|
|
255
|
+
localVarQueryParameters['category'] = models_1.ObjectSerializer.serialize(queryParams.category, "RawDataFilterCategory");
|
|
256
|
+
}
|
|
257
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.limit) !== undefined) {
|
|
258
|
+
localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
|
|
259
|
+
}
|
|
260
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.offset) !== undefined) {
|
|
261
|
+
localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
|
|
262
|
+
}
|
|
263
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeSensors) !== undefined) {
|
|
264
|
+
localVarQueryParameters['excludeSensors'] = models_1.ObjectSerializer.serialize(queryParams.excludeSensors, "boolean");
|
|
265
|
+
}
|
|
266
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.labels) !== undefined) {
|
|
267
|
+
localVarQueryParameters['labels'] = models_1.ObjectSerializer.serialize(queryParams.labels, "string");
|
|
268
|
+
}
|
|
269
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.filename) !== undefined) {
|
|
270
|
+
localVarQueryParameters['filename'] = models_1.ObjectSerializer.serialize(queryParams.filename, "string");
|
|
271
|
+
}
|
|
272
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLength) !== undefined) {
|
|
273
|
+
localVarQueryParameters['maxLength'] = models_1.ObjectSerializer.serialize(queryParams.maxLength, "number");
|
|
274
|
+
}
|
|
275
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLength) !== undefined) {
|
|
276
|
+
localVarQueryParameters['minLength'] = models_1.ObjectSerializer.serialize(queryParams.minLength, "number");
|
|
277
|
+
}
|
|
278
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minFrequency) !== undefined) {
|
|
279
|
+
localVarQueryParameters['minFrequency'] = models_1.ObjectSerializer.serialize(queryParams.minFrequency, "number");
|
|
280
|
+
}
|
|
281
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxFrequency) !== undefined) {
|
|
282
|
+
localVarQueryParameters['maxFrequency'] = models_1.ObjectSerializer.serialize(queryParams.maxFrequency, "number");
|
|
283
|
+
}
|
|
284
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.signatureValidity) !== undefined) {
|
|
285
|
+
localVarQueryParameters['signatureValidity'] = models_1.ObjectSerializer.serialize(queryParams.signatureValidity, "'both' | 'valid' | 'invalid'");
|
|
286
|
+
}
|
|
287
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includeDisabled) !== undefined) {
|
|
288
|
+
localVarQueryParameters['includeDisabled'] = models_1.ObjectSerializer.serialize(queryParams.includeDisabled, "'both' | 'enabled' | 'disabled'");
|
|
289
|
+
}
|
|
290
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minLabel) !== undefined) {
|
|
291
|
+
localVarQueryParameters['minLabel'] = models_1.ObjectSerializer.serialize(queryParams.minLabel, "number");
|
|
292
|
+
}
|
|
293
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxLabel) !== undefined) {
|
|
294
|
+
localVarQueryParameters['maxLabel'] = models_1.ObjectSerializer.serialize(queryParams.maxLabel, "number");
|
|
295
|
+
}
|
|
296
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.search) !== undefined) {
|
|
297
|
+
localVarQueryParameters['search'] = models_1.ObjectSerializer.serialize(queryParams.search, "string");
|
|
298
|
+
}
|
|
299
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.truncateStructuredLabels) !== undefined) {
|
|
300
|
+
localVarQueryParameters['truncateStructuredLabels'] = models_1.ObjectSerializer.serialize(queryParams.truncateStructuredLabels, "boolean");
|
|
301
|
+
}
|
|
302
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.sortBy) !== undefined) {
|
|
303
|
+
localVarQueryParameters['sortBy'] = models_1.ObjectSerializer.serialize(queryParams.sortBy, "'id-desc' | 'random'");
|
|
304
|
+
}
|
|
305
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.dataType) !== undefined) {
|
|
306
|
+
localVarQueryParameters['dataType'] = models_1.ObjectSerializer.serialize(queryParams.dataType, "'audio' | 'image'");
|
|
307
|
+
}
|
|
308
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minId) !== undefined) {
|
|
309
|
+
localVarQueryParameters['minId'] = models_1.ObjectSerializer.serialize(queryParams.minId, "number");
|
|
310
|
+
}
|
|
311
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxId) !== undefined) {
|
|
312
|
+
localVarQueryParameters['maxId'] = models_1.ObjectSerializer.serialize(queryParams.maxId, "number");
|
|
313
|
+
}
|
|
314
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.metadata) !== undefined) {
|
|
315
|
+
localVarQueryParameters['metadata'] = models_1.ObjectSerializer.serialize(queryParams.metadata, "string");
|
|
316
|
+
}
|
|
317
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.minDate) !== undefined) {
|
|
318
|
+
localVarQueryParameters['minDate'] = models_1.ObjectSerializer.serialize(queryParams.minDate, "Date");
|
|
319
|
+
}
|
|
320
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.maxDate) !== undefined) {
|
|
321
|
+
localVarQueryParameters['maxDate'] = models_1.ObjectSerializer.serialize(queryParams.maxDate, "Date");
|
|
322
|
+
}
|
|
323
|
+
localVarHeaderParams = {
|
|
324
|
+
...localVarHeaderParams,
|
|
325
|
+
...options.headers,
|
|
326
|
+
...this.opts.extraHeaders,
|
|
327
|
+
};
|
|
328
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
329
|
+
.filter(([, value]) => value !== undefined)
|
|
330
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
331
|
+
.join('&');
|
|
332
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
333
|
+
let localVarRequestOptions = {
|
|
334
|
+
method: 'GET',
|
|
335
|
+
headers: { ...localVarHeaderParams },
|
|
336
|
+
};
|
|
337
|
+
let requestOptions = localVarRequestOptions;
|
|
338
|
+
let url = localVarUrl;
|
|
339
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
340
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
341
|
+
url = auth_ApiKeyAuthentication.url;
|
|
342
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
343
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
344
|
+
url = auth_JWTAuthentication.url;
|
|
345
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
346
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
347
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
348
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
349
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
350
|
+
url = auth_OAuth2.url;
|
|
351
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
352
|
+
requestOptions = authDefault.requestOptions;
|
|
353
|
+
url = authDefault.url;
|
|
354
|
+
if (localVarFormParams) {
|
|
355
|
+
delete requestOptions.headers['Content-Type'];
|
|
356
|
+
if (localVarFormParams instanceof FormData) {
|
|
357
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
358
|
+
requestOptions.body = localVarFormParams;
|
|
359
|
+
}
|
|
360
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
361
|
+
// URL-encoded form
|
|
362
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
363
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
const response = await fetch(url, requestOptions);
|
|
367
|
+
return this.handleResponse(response, 'GetDatasetVersionRawDataResponse');
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Get a raw sample from a specific dataset version.
|
|
371
|
+
* @summary Get dataset version raw sample
|
|
372
|
+
* @param projectId Project ID
|
|
373
|
+
* @param datasetVersionId Dataset version ID
|
|
374
|
+
* @param sampleId Sample ID
|
|
375
|
+
*/
|
|
376
|
+
async getDatasetVersionRawSample(projectId, datasetVersionId, sampleId, options = { headers: {} }) {
|
|
377
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}/raw-data/{sampleId}'
|
|
378
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
379
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)))
|
|
380
|
+
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
381
|
+
let localVarQueryParameters = {};
|
|
382
|
+
let localVarHeaderParams = {
|
|
383
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
384
|
+
'Content-Type': 'application/json',
|
|
385
|
+
...this.defaultHeaders,
|
|
386
|
+
};
|
|
387
|
+
const produces = ['application/json'];
|
|
388
|
+
// give precedence to 'application/json'
|
|
389
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
390
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
391
|
+
}
|
|
392
|
+
else {
|
|
393
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
394
|
+
}
|
|
395
|
+
let localVarFormParams;
|
|
396
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
397
|
+
if (projectId === null || projectId === undefined) {
|
|
398
|
+
throw new Error('Required parameter projectId was null or undefined when calling getDatasetVersionRawSample.');
|
|
399
|
+
}
|
|
400
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
401
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
402
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling getDatasetVersionRawSample.');
|
|
403
|
+
}
|
|
404
|
+
// verify required parameter 'sampleId' is not null or undefined
|
|
405
|
+
if (sampleId === null || sampleId === undefined) {
|
|
406
|
+
throw new Error('Required parameter sampleId was null or undefined when calling getDatasetVersionRawSample.');
|
|
407
|
+
}
|
|
408
|
+
localVarHeaderParams = {
|
|
409
|
+
...localVarHeaderParams,
|
|
410
|
+
...options.headers,
|
|
411
|
+
...this.opts.extraHeaders,
|
|
412
|
+
};
|
|
413
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
414
|
+
.filter(([, value]) => value !== undefined)
|
|
415
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
416
|
+
.join('&');
|
|
417
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
418
|
+
let localVarRequestOptions = {
|
|
419
|
+
method: 'GET',
|
|
420
|
+
headers: { ...localVarHeaderParams },
|
|
421
|
+
};
|
|
422
|
+
let requestOptions = localVarRequestOptions;
|
|
423
|
+
let url = localVarUrl;
|
|
424
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
425
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
426
|
+
url = auth_ApiKeyAuthentication.url;
|
|
427
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
428
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
429
|
+
url = auth_JWTAuthentication.url;
|
|
430
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
431
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
432
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
433
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
434
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
435
|
+
url = auth_OAuth2.url;
|
|
436
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
437
|
+
requestOptions = authDefault.requestOptions;
|
|
438
|
+
url = authDefault.url;
|
|
439
|
+
if (localVarFormParams) {
|
|
440
|
+
delete requestOptions.headers['Content-Type'];
|
|
441
|
+
if (localVarFormParams instanceof FormData) {
|
|
442
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
443
|
+
requestOptions.body = localVarFormParams;
|
|
444
|
+
}
|
|
445
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
446
|
+
// URL-encoded form
|
|
447
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
448
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
const response = await fetch(url, requestOptions);
|
|
452
|
+
return this.handleResponse(response, 'GetDatasetVersionRawDataSampleResponse');
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Get a sample\'s changes in a specific dataset version for this project.
|
|
456
|
+
* @summary Get dataset version sample change details
|
|
457
|
+
* @param projectId Project ID
|
|
458
|
+
* @param datasetVersionId Dataset version ID
|
|
459
|
+
* @param sampleId Sample ID
|
|
460
|
+
*/
|
|
461
|
+
async getDatasetVersionSampleChangeDetails(projectId, datasetVersionId, sampleId, options = { headers: {} }) {
|
|
462
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}/changes/{sampleId}'
|
|
463
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
464
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)))
|
|
465
|
+
.replace('{' + 'sampleId' + '}', encodeURIComponent(String(sampleId)));
|
|
466
|
+
let localVarQueryParameters = {};
|
|
467
|
+
let localVarHeaderParams = {
|
|
468
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
469
|
+
'Content-Type': 'application/json',
|
|
470
|
+
...this.defaultHeaders,
|
|
471
|
+
};
|
|
472
|
+
const produces = ['application/json'];
|
|
473
|
+
// give precedence to 'application/json'
|
|
474
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
475
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
476
|
+
}
|
|
477
|
+
else {
|
|
478
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
479
|
+
}
|
|
480
|
+
let localVarFormParams;
|
|
481
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
482
|
+
if (projectId === null || projectId === undefined) {
|
|
483
|
+
throw new Error('Required parameter projectId was null or undefined when calling getDatasetVersionSampleChangeDetails.');
|
|
484
|
+
}
|
|
485
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
486
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
487
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling getDatasetVersionSampleChangeDetails.');
|
|
488
|
+
}
|
|
489
|
+
// verify required parameter 'sampleId' is not null or undefined
|
|
490
|
+
if (sampleId === null || sampleId === undefined) {
|
|
491
|
+
throw new Error('Required parameter sampleId was null or undefined when calling getDatasetVersionSampleChangeDetails.');
|
|
492
|
+
}
|
|
493
|
+
localVarHeaderParams = {
|
|
494
|
+
...localVarHeaderParams,
|
|
495
|
+
...options.headers,
|
|
496
|
+
...this.opts.extraHeaders,
|
|
497
|
+
};
|
|
498
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
499
|
+
.filter(([, value]) => value !== undefined)
|
|
500
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
501
|
+
.join('&');
|
|
502
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
503
|
+
let localVarRequestOptions = {
|
|
504
|
+
method: 'GET',
|
|
505
|
+
headers: { ...localVarHeaderParams },
|
|
506
|
+
};
|
|
507
|
+
let requestOptions = localVarRequestOptions;
|
|
508
|
+
let url = localVarUrl;
|
|
509
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
510
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
511
|
+
url = auth_ApiKeyAuthentication.url;
|
|
512
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
513
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
514
|
+
url = auth_JWTAuthentication.url;
|
|
515
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
516
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
517
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
518
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
519
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
520
|
+
url = auth_OAuth2.url;
|
|
521
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
522
|
+
requestOptions = authDefault.requestOptions;
|
|
523
|
+
url = authDefault.url;
|
|
524
|
+
if (localVarFormParams) {
|
|
525
|
+
delete requestOptions.headers['Content-Type'];
|
|
526
|
+
if (localVarFormParams instanceof FormData) {
|
|
527
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
528
|
+
requestOptions.body = localVarFormParams;
|
|
529
|
+
}
|
|
530
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
531
|
+
// URL-encoded form
|
|
532
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
533
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
534
|
+
}
|
|
535
|
+
}
|
|
536
|
+
const response = await fetch(url, requestOptions);
|
|
537
|
+
return this.handleResponse(response, 'GetDatasetVersionSampleChangeDetailsResponse');
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* List details of the changes in a specific dataset version for this project.
|
|
541
|
+
* @summary List dataset version changes
|
|
542
|
+
* @param projectId Project ID
|
|
543
|
+
* @param datasetVersionId Dataset version ID
|
|
544
|
+
* @param limit Maximum number of results
|
|
545
|
+
* @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
|
|
546
|
+
*/
|
|
547
|
+
async listDatasetVersionChanges(projectId, datasetVersionId, queryParams, options = { headers: {} }) {
|
|
548
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}/changes'
|
|
549
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
550
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)));
|
|
551
|
+
let localVarQueryParameters = {};
|
|
552
|
+
let localVarHeaderParams = {
|
|
553
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
554
|
+
'Content-Type': 'application/json',
|
|
555
|
+
...this.defaultHeaders,
|
|
556
|
+
};
|
|
557
|
+
const produces = ['application/json'];
|
|
558
|
+
// give precedence to 'application/json'
|
|
559
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
560
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
561
|
+
}
|
|
562
|
+
else {
|
|
563
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
564
|
+
}
|
|
565
|
+
let localVarFormParams;
|
|
566
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
567
|
+
if (projectId === null || projectId === undefined) {
|
|
568
|
+
throw new Error('Required parameter projectId was null or undefined when calling listDatasetVersionChanges.');
|
|
569
|
+
}
|
|
570
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
571
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
572
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling listDatasetVersionChanges.');
|
|
573
|
+
}
|
|
574
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.limit) !== undefined) {
|
|
575
|
+
localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
|
|
576
|
+
}
|
|
577
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.offset) !== undefined) {
|
|
578
|
+
localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
|
|
579
|
+
}
|
|
580
|
+
localVarHeaderParams = {
|
|
581
|
+
...localVarHeaderParams,
|
|
582
|
+
...options.headers,
|
|
583
|
+
...this.opts.extraHeaders,
|
|
584
|
+
};
|
|
585
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
586
|
+
.filter(([, value]) => value !== undefined)
|
|
587
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
588
|
+
.join('&');
|
|
589
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
590
|
+
let localVarRequestOptions = {
|
|
591
|
+
method: 'GET',
|
|
592
|
+
headers: { ...localVarHeaderParams },
|
|
593
|
+
};
|
|
594
|
+
let requestOptions = localVarRequestOptions;
|
|
595
|
+
let url = localVarUrl;
|
|
596
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
597
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
598
|
+
url = auth_ApiKeyAuthentication.url;
|
|
599
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
600
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
601
|
+
url = auth_JWTAuthentication.url;
|
|
602
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
603
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
604
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
605
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
606
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
607
|
+
url = auth_OAuth2.url;
|
|
608
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
609
|
+
requestOptions = authDefault.requestOptions;
|
|
610
|
+
url = authDefault.url;
|
|
611
|
+
if (localVarFormParams) {
|
|
612
|
+
delete requestOptions.headers['Content-Type'];
|
|
613
|
+
if (localVarFormParams instanceof FormData) {
|
|
614
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
615
|
+
requestOptions.body = localVarFormParams;
|
|
616
|
+
}
|
|
617
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
618
|
+
// URL-encoded form
|
|
619
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
620
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
621
|
+
}
|
|
622
|
+
}
|
|
623
|
+
const response = await fetch(url, requestOptions);
|
|
624
|
+
return this.handleResponse(response, 'ListDatasetVersionChangesResponse');
|
|
625
|
+
}
|
|
626
|
+
/**
|
|
627
|
+
* Get a list of all dataset versions for this project.
|
|
628
|
+
* @summary List dataset versions
|
|
629
|
+
* @param projectId Project ID
|
|
630
|
+
* @param limit Maximum number of results
|
|
631
|
+
* @param offset Offset in results, can be used in conjunction with LimitResultsParameter to implement paging.
|
|
632
|
+
*/
|
|
633
|
+
async listDatasetVersions(projectId, queryParams, options = { headers: {} }) {
|
|
634
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions'
|
|
635
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
636
|
+
let localVarQueryParameters = {};
|
|
637
|
+
let localVarHeaderParams = {
|
|
638
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
639
|
+
'Content-Type': 'application/json',
|
|
640
|
+
...this.defaultHeaders,
|
|
641
|
+
};
|
|
642
|
+
const produces = ['application/json'];
|
|
643
|
+
// give precedence to 'application/json'
|
|
644
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
645
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
646
|
+
}
|
|
647
|
+
else {
|
|
648
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
649
|
+
}
|
|
650
|
+
let localVarFormParams;
|
|
651
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
652
|
+
if (projectId === null || projectId === undefined) {
|
|
653
|
+
throw new Error('Required parameter projectId was null or undefined when calling listDatasetVersions.');
|
|
654
|
+
}
|
|
655
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.limit) !== undefined) {
|
|
656
|
+
localVarQueryParameters['limit'] = models_1.ObjectSerializer.serialize(queryParams.limit, "number");
|
|
657
|
+
}
|
|
658
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.offset) !== undefined) {
|
|
659
|
+
localVarQueryParameters['offset'] = models_1.ObjectSerializer.serialize(queryParams.offset, "number");
|
|
660
|
+
}
|
|
661
|
+
localVarHeaderParams = {
|
|
662
|
+
...localVarHeaderParams,
|
|
663
|
+
...options.headers,
|
|
664
|
+
...this.opts.extraHeaders,
|
|
665
|
+
};
|
|
666
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
667
|
+
.filter(([, value]) => value !== undefined)
|
|
668
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
669
|
+
.join('&');
|
|
670
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
671
|
+
let localVarRequestOptions = {
|
|
672
|
+
method: 'GET',
|
|
673
|
+
headers: { ...localVarHeaderParams },
|
|
674
|
+
};
|
|
675
|
+
let requestOptions = localVarRequestOptions;
|
|
676
|
+
let url = localVarUrl;
|
|
677
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
678
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
679
|
+
url = auth_ApiKeyAuthentication.url;
|
|
680
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
681
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
682
|
+
url = auth_JWTAuthentication.url;
|
|
683
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
684
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
685
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
686
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
687
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
688
|
+
url = auth_OAuth2.url;
|
|
689
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
690
|
+
requestOptions = authDefault.requestOptions;
|
|
691
|
+
url = authDefault.url;
|
|
692
|
+
if (localVarFormParams) {
|
|
693
|
+
delete requestOptions.headers['Content-Type'];
|
|
694
|
+
if (localVarFormParams instanceof FormData) {
|
|
695
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
696
|
+
requestOptions.body = localVarFormParams;
|
|
697
|
+
}
|
|
698
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
699
|
+
// URL-encoded form
|
|
700
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
701
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
702
|
+
}
|
|
703
|
+
}
|
|
704
|
+
const response = await fetch(url, requestOptions);
|
|
705
|
+
return this.handleResponse(response, 'ListDatasetVersionsResponse');
|
|
706
|
+
}
|
|
707
|
+
/**
|
|
708
|
+
* Restore the project\'s active dataset to a specific version.
|
|
709
|
+
* @summary Restore dataset version
|
|
710
|
+
* @param projectId Project ID
|
|
711
|
+
* @param datasetVersionId Dataset version ID
|
|
712
|
+
*/
|
|
713
|
+
async restoreDatasetVersion(projectId, datasetVersionId, options = { headers: {} }) {
|
|
714
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}/restore'
|
|
715
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
716
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)));
|
|
717
|
+
let localVarQueryParameters = {};
|
|
718
|
+
let localVarHeaderParams = {
|
|
719
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
720
|
+
'Content-Type': 'application/json',
|
|
721
|
+
...this.defaultHeaders,
|
|
722
|
+
};
|
|
723
|
+
const produces = ['application/json'];
|
|
724
|
+
// give precedence to 'application/json'
|
|
725
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
726
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
727
|
+
}
|
|
728
|
+
else {
|
|
729
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
730
|
+
}
|
|
731
|
+
let localVarFormParams;
|
|
732
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
733
|
+
if (projectId === null || projectId === undefined) {
|
|
734
|
+
throw new Error('Required parameter projectId was null or undefined when calling restoreDatasetVersion.');
|
|
735
|
+
}
|
|
736
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
737
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
738
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling restoreDatasetVersion.');
|
|
739
|
+
}
|
|
740
|
+
localVarHeaderParams = {
|
|
741
|
+
...localVarHeaderParams,
|
|
742
|
+
...options.headers,
|
|
743
|
+
...this.opts.extraHeaders,
|
|
744
|
+
};
|
|
745
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
746
|
+
.filter(([, value]) => value !== undefined)
|
|
747
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
748
|
+
.join('&');
|
|
749
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
750
|
+
let localVarRequestOptions = {
|
|
751
|
+
method: 'POST',
|
|
752
|
+
headers: { ...localVarHeaderParams },
|
|
753
|
+
};
|
|
754
|
+
let requestOptions = localVarRequestOptions;
|
|
755
|
+
let url = localVarUrl;
|
|
756
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
757
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
758
|
+
url = auth_ApiKeyAuthentication.url;
|
|
759
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
760
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
761
|
+
url = auth_JWTAuthentication.url;
|
|
762
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
763
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
764
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
765
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
766
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
767
|
+
url = auth_OAuth2.url;
|
|
768
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
769
|
+
requestOptions = authDefault.requestOptions;
|
|
770
|
+
url = authDefault.url;
|
|
771
|
+
if (localVarFormParams) {
|
|
772
|
+
delete requestOptions.headers['Content-Type'];
|
|
773
|
+
if (localVarFormParams instanceof FormData) {
|
|
774
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
775
|
+
requestOptions.body = localVarFormParams;
|
|
776
|
+
}
|
|
777
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
778
|
+
// URL-encoded form
|
|
779
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
780
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
781
|
+
}
|
|
782
|
+
}
|
|
783
|
+
const response = await fetch(url, requestOptions);
|
|
784
|
+
return this.handleResponse(response, 'GenericApiResponse | StartJobResponse');
|
|
785
|
+
}
|
|
786
|
+
/**
|
|
787
|
+
* Update a dataset version
|
|
788
|
+
* @summary Update dataset version
|
|
789
|
+
* @param projectId Project ID
|
|
790
|
+
* @param datasetVersionId Dataset version ID
|
|
791
|
+
* @param updateDatasetVersionRequest
|
|
792
|
+
*/
|
|
793
|
+
async updateDatasetVersion(projectId, datasetVersionId, updateDatasetVersionRequest, options = { headers: {} }) {
|
|
794
|
+
const localVarPath = this.basePath + '/api/{projectId}/dataset-versions/{datasetVersionId}'
|
|
795
|
+
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
796
|
+
.replace('{' + 'datasetVersionId' + '}', encodeURIComponent(String(datasetVersionId)));
|
|
797
|
+
let localVarQueryParameters = {};
|
|
798
|
+
let localVarHeaderParams = {
|
|
799
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
800
|
+
'Content-Type': 'application/json',
|
|
801
|
+
...this.defaultHeaders,
|
|
802
|
+
};
|
|
803
|
+
const produces = ['application/json'];
|
|
804
|
+
// give precedence to 'application/json'
|
|
805
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
806
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
807
|
+
}
|
|
808
|
+
else {
|
|
809
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
810
|
+
}
|
|
811
|
+
let localVarFormParams;
|
|
812
|
+
// verify required parameter 'projectId' is not null or undefined
|
|
813
|
+
if (projectId === null || projectId === undefined) {
|
|
814
|
+
throw new Error('Required parameter projectId was null or undefined when calling updateDatasetVersion.');
|
|
815
|
+
}
|
|
816
|
+
// verify required parameter 'datasetVersionId' is not null or undefined
|
|
817
|
+
if (datasetVersionId === null || datasetVersionId === undefined) {
|
|
818
|
+
throw new Error('Required parameter datasetVersionId was null or undefined when calling updateDatasetVersion.');
|
|
819
|
+
}
|
|
820
|
+
// verify required parameter 'updateDatasetVersionRequest' is not null or undefined
|
|
821
|
+
if (updateDatasetVersionRequest === null || updateDatasetVersionRequest === undefined) {
|
|
822
|
+
throw new Error('Required parameter updateDatasetVersionRequest was null or undefined when calling updateDatasetVersion.');
|
|
823
|
+
}
|
|
824
|
+
localVarHeaderParams = {
|
|
825
|
+
...localVarHeaderParams,
|
|
826
|
+
...options.headers,
|
|
827
|
+
...this.opts.extraHeaders,
|
|
828
|
+
};
|
|
829
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
830
|
+
.filter(([, value]) => value !== undefined)
|
|
831
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
832
|
+
.join('&');
|
|
833
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
834
|
+
let localVarRequestOptions = {
|
|
835
|
+
method: 'POST',
|
|
836
|
+
headers: { ...localVarHeaderParams },
|
|
837
|
+
};
|
|
838
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateDatasetVersionRequest, "UpdateDatasetVersionRequest"));
|
|
839
|
+
let requestOptions = localVarRequestOptions;
|
|
840
|
+
let url = localVarUrl;
|
|
841
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
842
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
843
|
+
url = auth_ApiKeyAuthentication.url;
|
|
844
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
845
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
846
|
+
url = auth_JWTAuthentication.url;
|
|
847
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
848
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
849
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
850
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
851
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
852
|
+
url = auth_OAuth2.url;
|
|
853
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
854
|
+
requestOptions = authDefault.requestOptions;
|
|
855
|
+
url = authDefault.url;
|
|
856
|
+
if (localVarFormParams) {
|
|
857
|
+
delete requestOptions.headers['Content-Type'];
|
|
858
|
+
if (localVarFormParams instanceof FormData) {
|
|
859
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
860
|
+
requestOptions.body = localVarFormParams;
|
|
861
|
+
}
|
|
862
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
863
|
+
// URL-encoded form
|
|
864
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
865
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
866
|
+
}
|
|
867
|
+
}
|
|
868
|
+
const response = await fetch(url, requestOptions);
|
|
869
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
870
|
+
}
|
|
871
|
+
}
|
|
872
|
+
exports.DatasetVersionsApi = DatasetVersionsApi;
|
|
873
|
+
//# sourceMappingURL=datasetVersionsApi.js.map
|