edge-impulse-api 1.82.6 → 1.82.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/library/sdk/api/adminApi.d.ts +4 -6
- package/build/library/sdk/api/adminApi.js +4782 -4928
- package/build/library/sdk/api/adminApi.js.map +1 -1
- package/build/library/sdk/api/authApi.d.ts +4 -6
- package/build/library/sdk/api/authApi.js +88 -56
- package/build/library/sdk/api/authApi.js.map +1 -1
- package/build/library/sdk/api/cDNApi.d.ts +4 -6
- package/build/library/sdk/api/cDNApi.js +76 -53
- package/build/library/sdk/api/cDNApi.js.map +1 -1
- package/build/library/sdk/api/canaryApi.d.ts +4 -6
- package/build/library/sdk/api/canaryApi.js +79 -53
- package/build/library/sdk/api/canaryApi.js.map +1 -1
- package/build/library/sdk/api/classifyApi.d.ts +4 -6
- package/build/library/sdk/api/classifyApi.js +527 -499
- package/build/library/sdk/api/classifyApi.js.map +1 -1
- package/build/library/sdk/api/dSPApi.d.ts +4 -6
- package/build/library/sdk/api/dSPApi.js +938 -942
- package/build/library/sdk/api/dSPApi.js.map +1 -1
- package/build/library/sdk/api/deploymentApi.d.ts +4 -6
- package/build/library/sdk/api/deploymentApi.js +680 -603
- package/build/library/sdk/api/deploymentApi.js.map +1 -1
- package/build/library/sdk/api/devicesApi.d.ts +4 -6
- package/build/library/sdk/api/devicesApi.js +802 -800
- package/build/library/sdk/api/devicesApi.js.map +1 -1
- package/build/library/sdk/api/emailVerificationApi.d.ts +4 -6
- package/build/library/sdk/api/emailVerificationApi.js +184 -190
- package/build/library/sdk/api/emailVerificationApi.js.map +1 -1
- package/build/library/sdk/api/exportApi.d.ts +4 -6
- package/build/library/sdk/api/exportApi.js +88 -56
- package/build/library/sdk/api/exportApi.js.map +1 -1
- package/build/library/sdk/api/featureFlagsApi.d.ts +4 -6
- package/build/library/sdk/api/featureFlagsApi.js +76 -52
- package/build/library/sdk/api/featureFlagsApi.js.map +1 -1
- package/build/library/sdk/api/healthApi.d.ts +4 -6
- package/build/library/sdk/api/healthApi.js +111 -97
- package/build/library/sdk/api/healthApi.js.map +1 -1
- package/build/library/sdk/api/impulseApi.d.ts +4 -6
- package/build/library/sdk/api/impulseApi.js +942 -902
- package/build/library/sdk/api/impulseApi.js.map +1 -1
- package/build/library/sdk/api/integrationsApi.d.ts +4 -6
- package/build/library/sdk/api/integrationsApi.js +136 -106
- package/build/library/sdk/api/integrationsApi.js.map +1 -1
- package/build/library/sdk/api/jobsApi.d.ts +4 -6
- package/build/library/sdk/api/jobsApi.js +2270 -2326
- package/build/library/sdk/api/jobsApi.js.map +1 -1
- package/build/library/sdk/api/learnApi.d.ts +22 -6
- package/build/library/sdk/api/learnApi.js +1597 -1424
- package/build/library/sdk/api/learnApi.js.map +1 -1
- package/build/library/sdk/api/loginApi.d.ts +4 -6
- package/build/library/sdk/api/loginApi.js +112 -98
- package/build/library/sdk/api/loginApi.js.map +1 -1
- package/build/library/sdk/api/metricsApi.d.ts +4 -6
- package/build/library/sdk/api/metricsApi.js +148 -144
- package/build/library/sdk/api/metricsApi.js.map +1 -1
- package/build/library/sdk/api/optimizationApi.d.ts +4 -6
- package/build/library/sdk/api/optimizationApi.js +844 -844
- package/build/library/sdk/api/optimizationApi.js.map +1 -1
- package/build/library/sdk/api/organizationBlocksApi.d.ts +4 -6
- package/build/library/sdk/api/organizationBlocksApi.js +1968 -1550
- package/build/library/sdk/api/organizationBlocksApi.js.map +1 -1
- package/build/library/sdk/api/organizationCreateProjectApi.d.ts +4 -6
- package/build/library/sdk/api/organizationCreateProjectApi.js +700 -652
- package/build/library/sdk/api/organizationCreateProjectApi.js.map +1 -1
- package/build/library/sdk/api/organizationDataApi.d.ts +4 -6
- package/build/library/sdk/api/organizationDataApi.js +2074 -1985
- package/build/library/sdk/api/organizationDataApi.js.map +1 -1
- package/build/library/sdk/api/organizationDataCampaignsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationDataCampaignsApi.js +626 -602
- package/build/library/sdk/api/organizationDataCampaignsApi.js.map +1 -1
- package/build/library/sdk/api/organizationJobsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationJobsApi.js +417 -399
- package/build/library/sdk/api/organizationJobsApi.js.map +1 -1
- package/build/library/sdk/api/organizationPipelinesApi.d.ts +4 -6
- package/build/library/sdk/api/organizationPipelinesApi.js +419 -401
- package/build/library/sdk/api/organizationPipelinesApi.js.map +1 -1
- package/build/library/sdk/api/organizationPortalsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationPortalsApi.js +372 -352
- package/build/library/sdk/api/organizationPortalsApi.js.map +1 -1
- package/build/library/sdk/api/organizationsApi.d.ts +4 -6
- package/build/library/sdk/api/organizationsApi.js +4024 -4050
- package/build/library/sdk/api/organizationsApi.js.map +1 -1
- package/build/library/sdk/api/performanceCalibrationApi.d.ts +4 -6
- package/build/library/sdk/api/performanceCalibrationApi.js +586 -560
- package/build/library/sdk/api/performanceCalibrationApi.js.map +1 -1
- package/build/library/sdk/api/postProcessingApi.d.ts +4 -6
- package/build/library/sdk/api/postProcessingApi.js +279 -255
- package/build/library/sdk/api/postProcessingApi.js.map +1 -1
- package/build/library/sdk/api/projectsApi.d.ts +4 -6
- package/build/library/sdk/api/projectsApi.js +2758 -2818
- package/build/library/sdk/api/projectsApi.js.map +1 -1
- package/build/library/sdk/api/rawDataApi.d.ts +4 -6
- package/build/library/sdk/api/rawDataApi.js +3055 -3131
- package/build/library/sdk/api/rawDataApi.js.map +1 -1
- package/build/library/sdk/api/testApi.d.ts +4 -6
- package/build/library/sdk/api/testApi.js +152 -108
- package/build/library/sdk/api/testApi.js.map +1 -1
- package/build/library/sdk/api/themesApi.d.ts +4 -6
- package/build/library/sdk/api/themesApi.js +341 -305
- package/build/library/sdk/api/themesApi.js.map +1 -1
- package/build/library/sdk/api/thirdPartyAuthApi.d.ts +4 -6
- package/build/library/sdk/api/thirdPartyAuthApi.js +387 -353
- package/build/library/sdk/api/thirdPartyAuthApi.js.map +1 -1
- package/build/library/sdk/api/uploadPortalApi.d.ts +4 -6
- package/build/library/sdk/api/uploadPortalApi.js +375 -355
- package/build/library/sdk/api/uploadPortalApi.js.map +1 -1
- package/build/library/sdk/api/userApi.d.ts +4 -6
- package/build/library/sdk/api/userApi.js +2345 -2452
- package/build/library/sdk/api/userApi.js.map +1 -1
- package/build/library/sdk/api/vlmApi.d.ts +4 -6
- package/build/library/sdk/api/vlmApi.js +277 -253
- package/build/library/sdk/api/vlmApi.js.map +1 -1
- package/build/library/sdk/api/whitelabelsApi.d.ts +4 -6
- package/build/library/sdk/api/whitelabelsApi.js +408 -398
- package/build/library/sdk/api/whitelabelsApi.js.map +1 -1
- package/build/library/sdk/model/deployPretrainedModelRequest.d.ts +4 -0
- package/build/library/sdk/model/deployPretrainedModelRequest.js +5 -0
- package/build/library/sdk/model/deployPretrainedModelRequest.js.map +1 -1
- package/build/library/sdk/model/models.d.ts +47 -7
- package/build/library/sdk/model/models.js +33 -22
- package/build/library/sdk/model/models.js.map +1 -1
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.d.ts +47 -0
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.js +55 -0
- package/build/library/sdk/model/uploadPretrainedModelByUrlRequest.js.map +1 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.d.ts +4 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.js +5 -0
- package/build/library/sdk/model/uploadPretrainedModelRequest.js.map +1 -1
- package/package.json +3 -2
|
@@ -12,14 +12,31 @@
|
|
|
12
12
|
*/
|
|
13
13
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
14
14
|
exports.VlmApi = exports.VlmApiApiKeys = void 0;
|
|
15
|
-
// tslint:disable-next-line: variable-name, no-var-requires
|
|
16
15
|
const PATH = require('path');
|
|
17
|
-
// tslint:disable-next-line: no-unsafe-any
|
|
18
16
|
module.paths.push(PATH.join(process.cwd(), 'node_modules'));
|
|
19
|
-
|
|
17
|
+
let fetch;
|
|
18
|
+
let FormData;
|
|
19
|
+
if (globalThis.fetch && globalThis.FormData) {
|
|
20
|
+
fetch = globalThis.fetch;
|
|
21
|
+
FormData = globalThis.FormData;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
const undici = require('undici');
|
|
25
|
+
fetch = undici.fetch;
|
|
26
|
+
FormData = undici.FormData;
|
|
27
|
+
}
|
|
20
28
|
const models_1 = require("../model/models");
|
|
21
29
|
const models_2 = require("../model/models");
|
|
22
30
|
let defaultBasePath = 'https://studio.edgeimpulse.com/v1';
|
|
31
|
+
async function parseResponse(res) {
|
|
32
|
+
const ct = (res.headers.get('content-type') || '').toLowerCase();
|
|
33
|
+
if (ct.includes('application/json'))
|
|
34
|
+
return res.json();
|
|
35
|
+
if (/^(image|video|audio)\/|application\/(octet-stream|zip|x-tar|cbor)/.test(ct)) {
|
|
36
|
+
return Buffer.from(await res.arrayBuffer());
|
|
37
|
+
}
|
|
38
|
+
return res.text();
|
|
39
|
+
}
|
|
23
40
|
// ===============================================
|
|
24
41
|
// This file is autogenerated - Please do not edit
|
|
25
42
|
// ===============================================
|
|
@@ -30,10 +47,30 @@ var VlmApiApiKeys;
|
|
|
30
47
|
VlmApiApiKeys[VlmApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(VlmApiApiKeys = exports.VlmApiApiKeys || (exports.VlmApiApiKeys = {}));
|
|
32
49
|
class VlmApi {
|
|
50
|
+
async handleResponse(response, returnType) {
|
|
51
|
+
let body = await parseResponse(response);
|
|
52
|
+
if (!response.ok) {
|
|
53
|
+
let errorMsg;
|
|
54
|
+
if (typeof body === 'object' && body !== null && 'error' in body) {
|
|
55
|
+
errorMsg = body.error;
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
errorMsg = `Failed to call "${response.url}", returned ${response.status}: ` + (typeof body === 'string' ? body : JSON.stringify(body));
|
|
59
|
+
}
|
|
60
|
+
throw new Error(errorMsg);
|
|
61
|
+
}
|
|
62
|
+
if (returnType) {
|
|
63
|
+
body = models_1.ObjectSerializer.deserialize(body, returnType);
|
|
64
|
+
}
|
|
65
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
66
|
+
const errString = `Failed to call "${response.url}", returned ${response.status}: ` + body.error;
|
|
67
|
+
throw new Error(body.error || errString);
|
|
68
|
+
}
|
|
69
|
+
return body;
|
|
70
|
+
}
|
|
33
71
|
constructor(basePathOrUsername, opts, password, basePath) {
|
|
34
72
|
this._basePath = defaultBasePath;
|
|
35
73
|
this.defaultHeaders = {};
|
|
36
|
-
this._useQuerystring = false;
|
|
37
74
|
this._opts = {};
|
|
38
75
|
this.authentications = {
|
|
39
76
|
'default': new models_1.VoidAuth(),
|
|
@@ -54,9 +91,6 @@ class VlmApi {
|
|
|
54
91
|
}
|
|
55
92
|
this.opts = opts !== null && opts !== void 0 ? opts : {};
|
|
56
93
|
}
|
|
57
|
-
set useQuerystring(value) {
|
|
58
|
-
this._useQuerystring = value;
|
|
59
|
-
}
|
|
60
94
|
set basePath(basePath) {
|
|
61
95
|
this._basePath = basePath;
|
|
62
96
|
}
|
|
@@ -87,9 +121,11 @@ class VlmApi {
|
|
|
87
121
|
const localVarPath = this.basePath + '/api/{projectId}/training/vlm/models'
|
|
88
122
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)));
|
|
89
123
|
let localVarQueryParameters = {};
|
|
90
|
-
let localVarHeaderParams =
|
|
91
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
92
|
-
|
|
124
|
+
let localVarHeaderParams = {
|
|
125
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
126
|
+
'Content-Type': 'application/json',
|
|
127
|
+
...this.defaultHeaders,
|
|
128
|
+
};
|
|
93
129
|
const produces = ['application/json'];
|
|
94
130
|
// give precedence to 'application/json'
|
|
95
131
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -98,60 +134,56 @@ class VlmApi {
|
|
|
98
134
|
else {
|
|
99
135
|
localVarHeaderParams.Accept = produces.join(',');
|
|
100
136
|
}
|
|
101
|
-
let localVarFormParams
|
|
137
|
+
let localVarFormParams;
|
|
102
138
|
// verify required parameter 'projectId' is not null or undefined
|
|
103
139
|
if (projectId === null || projectId === undefined) {
|
|
104
140
|
throw new Error('Required parameter projectId was null or undefined when calling getAllModels.');
|
|
105
141
|
}
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
142
|
+
localVarHeaderParams = {
|
|
143
|
+
...localVarHeaderParams,
|
|
144
|
+
...options.headers,
|
|
145
|
+
...this.opts.extraHeaders,
|
|
146
|
+
};
|
|
147
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
148
|
+
.filter(([, value]) => value !== undefined)
|
|
149
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
150
|
+
.join('&');
|
|
151
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
109
152
|
let localVarRequestOptions = {
|
|
110
153
|
method: 'GET',
|
|
111
|
-
|
|
112
|
-
headers: localVarHeaderParams,
|
|
113
|
-
uri: localVarPath,
|
|
114
|
-
useQuerystring: this._useQuerystring,
|
|
115
|
-
agentOptions: { keepAlive: false },
|
|
116
|
-
json: true,
|
|
154
|
+
headers: { ...localVarHeaderParams },
|
|
117
155
|
};
|
|
118
|
-
let
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
156
|
+
let requestOptions = localVarRequestOptions;
|
|
157
|
+
let url = localVarUrl;
|
|
158
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
159
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
160
|
+
url = auth_ApiKeyAuthentication.url;
|
|
161
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
162
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
163
|
+
url = auth_JWTAuthentication.url;
|
|
164
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
165
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
166
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
167
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
168
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
169
|
+
url = auth_OAuth2.url;
|
|
170
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
171
|
+
requestOptions = authDefault.requestOptions;
|
|
172
|
+
url = authDefault.url;
|
|
173
|
+
if (localVarFormParams) {
|
|
174
|
+
delete requestOptions.headers['Content-Type'];
|
|
175
|
+
if (localVarFormParams instanceof FormData) {
|
|
176
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
177
|
+
requestOptions.body = localVarFormParams;
|
|
178
|
+
}
|
|
179
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
180
|
+
// URL-encoded form
|
|
181
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
182
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
132
183
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
reject(error);
|
|
137
|
-
}
|
|
138
|
-
else {
|
|
139
|
-
body = models_1.ObjectSerializer.deserialize(body, "VlmGetAllModelsResponse");
|
|
140
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
141
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
142
|
-
reject(new Error(body.error || errString));
|
|
143
|
-
}
|
|
144
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
145
|
-
resolve(body);
|
|
146
|
-
}
|
|
147
|
-
else {
|
|
148
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
149
|
-
reject(errString);
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
});
|
|
153
|
-
});
|
|
154
|
-
});
|
|
184
|
+
}
|
|
185
|
+
const response = await fetch(url, requestOptions);
|
|
186
|
+
return this.handleResponse(response, 'VlmGetAllModelsResponse');
|
|
155
187
|
}
|
|
156
188
|
/**
|
|
157
189
|
* Returns details of a Vision Language Model (VLM) supported for the project.
|
|
@@ -164,9 +196,11 @@ class VlmApi {
|
|
|
164
196
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
165
197
|
.replace('{' + 'modelId' + '}', encodeURIComponent(String(modelId)));
|
|
166
198
|
let localVarQueryParameters = {};
|
|
167
|
-
let localVarHeaderParams =
|
|
168
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
169
|
-
|
|
199
|
+
let localVarHeaderParams = {
|
|
200
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
201
|
+
'Content-Type': 'application/json',
|
|
202
|
+
...this.defaultHeaders,
|
|
203
|
+
};
|
|
170
204
|
const produces = ['application/json'];
|
|
171
205
|
// give precedence to 'application/json'
|
|
172
206
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -175,7 +209,7 @@ class VlmApi {
|
|
|
175
209
|
else {
|
|
176
210
|
localVarHeaderParams.Accept = produces.join(',');
|
|
177
211
|
}
|
|
178
|
-
let localVarFormParams
|
|
212
|
+
let localVarFormParams;
|
|
179
213
|
// verify required parameter 'projectId' is not null or undefined
|
|
180
214
|
if (projectId === null || projectId === undefined) {
|
|
181
215
|
throw new Error('Required parameter projectId was null or undefined when calling getModelById.');
|
|
@@ -184,55 +218,51 @@ class VlmApi {
|
|
|
184
218
|
if (modelId === null || modelId === undefined) {
|
|
185
219
|
throw new Error('Required parameter modelId was null or undefined when calling getModelById.');
|
|
186
220
|
}
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
221
|
+
localVarHeaderParams = {
|
|
222
|
+
...localVarHeaderParams,
|
|
223
|
+
...options.headers,
|
|
224
|
+
...this.opts.extraHeaders,
|
|
225
|
+
};
|
|
226
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
227
|
+
.filter(([, value]) => value !== undefined)
|
|
228
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
229
|
+
.join('&');
|
|
230
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
190
231
|
let localVarRequestOptions = {
|
|
191
232
|
method: 'GET',
|
|
192
|
-
|
|
193
|
-
headers: localVarHeaderParams,
|
|
194
|
-
uri: localVarPath,
|
|
195
|
-
useQuerystring: this._useQuerystring,
|
|
196
|
-
agentOptions: { keepAlive: false },
|
|
197
|
-
json: true,
|
|
233
|
+
headers: { ...localVarHeaderParams },
|
|
198
234
|
};
|
|
199
|
-
let
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
235
|
+
let requestOptions = localVarRequestOptions;
|
|
236
|
+
let url = localVarUrl;
|
|
237
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
238
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
239
|
+
url = auth_ApiKeyAuthentication.url;
|
|
240
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
241
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
242
|
+
url = auth_JWTAuthentication.url;
|
|
243
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
244
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
245
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
246
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
247
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
248
|
+
url = auth_OAuth2.url;
|
|
249
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
250
|
+
requestOptions = authDefault.requestOptions;
|
|
251
|
+
url = authDefault.url;
|
|
252
|
+
if (localVarFormParams) {
|
|
253
|
+
delete requestOptions.headers['Content-Type'];
|
|
254
|
+
if (localVarFormParams instanceof FormData) {
|
|
255
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
256
|
+
requestOptions.body = localVarFormParams;
|
|
257
|
+
}
|
|
258
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
259
|
+
// URL-encoded form
|
|
260
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
261
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
213
262
|
}
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
reject(error);
|
|
218
|
-
}
|
|
219
|
-
else {
|
|
220
|
-
body = models_1.ObjectSerializer.deserialize(body, "VlmGetModelResponse");
|
|
221
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
222
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
223
|
-
reject(new Error(body.error || errString));
|
|
224
|
-
}
|
|
225
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
226
|
-
resolve(body);
|
|
227
|
-
}
|
|
228
|
-
else {
|
|
229
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
230
|
-
reject(errString);
|
|
231
|
-
}
|
|
232
|
-
}
|
|
233
|
-
});
|
|
234
|
-
});
|
|
235
|
-
});
|
|
263
|
+
}
|
|
264
|
+
const response = await fetch(url, requestOptions);
|
|
265
|
+
return this.handleResponse(response, 'VlmGetModelResponse');
|
|
236
266
|
}
|
|
237
267
|
/**
|
|
238
268
|
* Get results of a previous inferencing job for a given VLM learn block. Pass a config ID to get results for a past config version, or leave undefined to get the latest set of results.
|
|
@@ -246,9 +276,11 @@ class VlmApi {
|
|
|
246
276
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
247
277
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
248
278
|
let localVarQueryParameters = {};
|
|
249
|
-
let localVarHeaderParams =
|
|
250
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
251
|
-
|
|
279
|
+
let localVarHeaderParams = {
|
|
280
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
281
|
+
'Content-Type': 'application/json',
|
|
282
|
+
...this.defaultHeaders,
|
|
283
|
+
};
|
|
252
284
|
const produces = ['application/json'];
|
|
253
285
|
// give precedence to 'application/json'
|
|
254
286
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -257,7 +289,7 @@ class VlmApi {
|
|
|
257
289
|
else {
|
|
258
290
|
localVarHeaderParams.Accept = produces.join(',');
|
|
259
291
|
}
|
|
260
|
-
let localVarFormParams
|
|
292
|
+
let localVarFormParams;
|
|
261
293
|
// verify required parameter 'projectId' is not null or undefined
|
|
262
294
|
if (projectId === null || projectId === undefined) {
|
|
263
295
|
throw new Error('Required parameter projectId was null or undefined when calling getVlmInference.');
|
|
@@ -269,55 +301,51 @@ class VlmApi {
|
|
|
269
301
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.configId) !== undefined) {
|
|
270
302
|
localVarQueryParameters['configId'] = models_1.ObjectSerializer.serialize(queryParams.configId, "number");
|
|
271
303
|
}
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
304
|
+
localVarHeaderParams = {
|
|
305
|
+
...localVarHeaderParams,
|
|
306
|
+
...options.headers,
|
|
307
|
+
...this.opts.extraHeaders,
|
|
308
|
+
};
|
|
309
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
310
|
+
.filter(([, value]) => value !== undefined)
|
|
311
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
312
|
+
.join('&');
|
|
313
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
275
314
|
let localVarRequestOptions = {
|
|
276
315
|
method: 'GET',
|
|
277
|
-
|
|
278
|
-
headers: localVarHeaderParams,
|
|
279
|
-
uri: localVarPath,
|
|
280
|
-
useQuerystring: this._useQuerystring,
|
|
281
|
-
agentOptions: { keepAlive: false },
|
|
282
|
-
json: true,
|
|
316
|
+
headers: { ...localVarHeaderParams },
|
|
283
317
|
};
|
|
284
|
-
let
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
318
|
+
let requestOptions = localVarRequestOptions;
|
|
319
|
+
let url = localVarUrl;
|
|
320
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
321
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
322
|
+
url = auth_ApiKeyAuthentication.url;
|
|
323
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
324
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
325
|
+
url = auth_JWTAuthentication.url;
|
|
326
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
327
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
328
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
329
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
330
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
331
|
+
url = auth_OAuth2.url;
|
|
332
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
333
|
+
requestOptions = authDefault.requestOptions;
|
|
334
|
+
url = authDefault.url;
|
|
335
|
+
if (localVarFormParams) {
|
|
336
|
+
delete requestOptions.headers['Content-Type'];
|
|
337
|
+
if (localVarFormParams instanceof FormData) {
|
|
338
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
339
|
+
requestOptions.body = localVarFormParams;
|
|
340
|
+
}
|
|
341
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
342
|
+
// URL-encoded form
|
|
343
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
344
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
298
345
|
}
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
reject(error);
|
|
303
|
-
}
|
|
304
|
-
else {
|
|
305
|
-
body = models_1.ObjectSerializer.deserialize(body, "VlmGetInferenceResultsResponse");
|
|
306
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
307
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
308
|
-
reject(new Error(body.error || errString));
|
|
309
|
-
}
|
|
310
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
311
|
-
resolve(body);
|
|
312
|
-
}
|
|
313
|
-
else {
|
|
314
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
315
|
-
reject(errString);
|
|
316
|
-
}
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
});
|
|
320
|
-
});
|
|
346
|
+
}
|
|
347
|
+
const response = await fetch(url, requestOptions);
|
|
348
|
+
return this.handleResponse(response, 'VlmGetInferenceResultsResponse');
|
|
321
349
|
}
|
|
322
350
|
/**
|
|
323
351
|
* Test a VLM learn block by running inference against samples. If model config is passed, this will also update the config for the given learn block, allowing for quick iteration.
|
|
@@ -331,9 +359,11 @@ class VlmApi {
|
|
|
331
359
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
332
360
|
.replace('{' + 'learnId' + '}', encodeURIComponent(String(learnId)));
|
|
333
361
|
let localVarQueryParameters = {};
|
|
334
|
-
let localVarHeaderParams =
|
|
335
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
336
|
-
|
|
362
|
+
let localVarHeaderParams = {
|
|
363
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
364
|
+
'Content-Type': 'application/json',
|
|
365
|
+
...this.defaultHeaders,
|
|
366
|
+
};
|
|
337
367
|
const produces = ['application/json'];
|
|
338
368
|
// give precedence to 'application/json'
|
|
339
369
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -342,7 +372,7 @@ class VlmApi {
|
|
|
342
372
|
else {
|
|
343
373
|
localVarHeaderParams.Accept = produces.join(',');
|
|
344
374
|
}
|
|
345
|
-
let localVarFormParams
|
|
375
|
+
let localVarFormParams;
|
|
346
376
|
// verify required parameter 'projectId' is not null or undefined
|
|
347
377
|
if (projectId === null || projectId === undefined) {
|
|
348
378
|
throw new Error('Required parameter projectId was null or undefined when calling runVlmInference.');
|
|
@@ -355,56 +385,52 @@ class VlmApi {
|
|
|
355
385
|
if (vlmInferenceRequest === null || vlmInferenceRequest === undefined) {
|
|
356
386
|
throw new Error('Required parameter vlmInferenceRequest was null or undefined when calling runVlmInference.');
|
|
357
387
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
388
|
+
localVarHeaderParams = {
|
|
389
|
+
...localVarHeaderParams,
|
|
390
|
+
...options.headers,
|
|
391
|
+
...this.opts.extraHeaders,
|
|
392
|
+
};
|
|
393
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
394
|
+
.filter(([, value]) => value !== undefined)
|
|
395
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
396
|
+
.join('&');
|
|
397
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
361
398
|
let localVarRequestOptions = {
|
|
362
399
|
method: 'POST',
|
|
363
|
-
|
|
364
|
-
headers: localVarHeaderParams,
|
|
365
|
-
uri: localVarPath,
|
|
366
|
-
useQuerystring: this._useQuerystring,
|
|
367
|
-
agentOptions: { keepAlive: false },
|
|
368
|
-
json: true,
|
|
369
|
-
body: models_1.ObjectSerializer.serialize(vlmInferenceRequest, "VlmInferenceRequest")
|
|
400
|
+
headers: { ...localVarHeaderParams },
|
|
370
401
|
};
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
402
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(vlmInferenceRequest, "VlmInferenceRequest"));
|
|
403
|
+
let requestOptions = localVarRequestOptions;
|
|
404
|
+
let url = localVarUrl;
|
|
405
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
406
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
407
|
+
url = auth_ApiKeyAuthentication.url;
|
|
408
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
409
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
410
|
+
url = auth_JWTAuthentication.url;
|
|
411
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
412
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
413
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
414
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
415
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
416
|
+
url = auth_OAuth2.url;
|
|
417
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
418
|
+
requestOptions = authDefault.requestOptions;
|
|
419
|
+
url = authDefault.url;
|
|
420
|
+
if (localVarFormParams) {
|
|
421
|
+
delete requestOptions.headers['Content-Type'];
|
|
422
|
+
if (localVarFormParams instanceof FormData) {
|
|
423
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
424
|
+
requestOptions.body = localVarFormParams;
|
|
425
|
+
}
|
|
426
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
427
|
+
// URL-encoded form
|
|
428
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
429
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
385
430
|
}
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
reject(error);
|
|
390
|
-
}
|
|
391
|
-
else {
|
|
392
|
-
body = models_1.ObjectSerializer.deserialize(body, "StartJobResponse");
|
|
393
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
394
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
395
|
-
reject(new Error(body.error || errString));
|
|
396
|
-
}
|
|
397
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
398
|
-
resolve(body);
|
|
399
|
-
}
|
|
400
|
-
else {
|
|
401
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
402
|
-
reject(errString);
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
});
|
|
406
|
-
});
|
|
407
|
-
});
|
|
431
|
+
}
|
|
432
|
+
const response = await fetch(url, requestOptions);
|
|
433
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
408
434
|
}
|
|
409
435
|
/**
|
|
410
436
|
* Initializes the inference worker, speeding it up for subsequent requests.
|
|
@@ -417,9 +443,11 @@ class VlmApi {
|
|
|
417
443
|
.replace('{' + 'projectId' + '}', encodeURIComponent(String(projectId)))
|
|
418
444
|
.replace('{' + 'modelId' + '}', encodeURIComponent(String(modelId)));
|
|
419
445
|
let localVarQueryParameters = {};
|
|
420
|
-
let localVarHeaderParams =
|
|
421
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
422
|
-
|
|
446
|
+
let localVarHeaderParams = {
|
|
447
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
448
|
+
'Content-Type': 'application/json',
|
|
449
|
+
...this.defaultHeaders,
|
|
450
|
+
};
|
|
423
451
|
const produces = ['application/json'];
|
|
424
452
|
// give precedence to 'application/json'
|
|
425
453
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -428,7 +456,7 @@ class VlmApi {
|
|
|
428
456
|
else {
|
|
429
457
|
localVarHeaderParams.Accept = produces.join(',');
|
|
430
458
|
}
|
|
431
|
-
let localVarFormParams
|
|
459
|
+
let localVarFormParams;
|
|
432
460
|
// verify required parameter 'projectId' is not null or undefined
|
|
433
461
|
if (projectId === null || projectId === undefined) {
|
|
434
462
|
throw new Error('Required parameter projectId was null or undefined when calling warmUpVlmModel.');
|
|
@@ -437,55 +465,51 @@ class VlmApi {
|
|
|
437
465
|
if (modelId === null || modelId === undefined) {
|
|
438
466
|
throw new Error('Required parameter modelId was null or undefined when calling warmUpVlmModel.');
|
|
439
467
|
}
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
468
|
+
localVarHeaderParams = {
|
|
469
|
+
...localVarHeaderParams,
|
|
470
|
+
...options.headers,
|
|
471
|
+
...this.opts.extraHeaders,
|
|
472
|
+
};
|
|
473
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
474
|
+
.filter(([, value]) => value !== undefined)
|
|
475
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
476
|
+
.join('&');
|
|
477
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
443
478
|
let localVarRequestOptions = {
|
|
444
479
|
method: 'POST',
|
|
445
|
-
|
|
446
|
-
headers: localVarHeaderParams,
|
|
447
|
-
uri: localVarPath,
|
|
448
|
-
useQuerystring: this._useQuerystring,
|
|
449
|
-
agentOptions: { keepAlive: false },
|
|
450
|
-
json: true,
|
|
480
|
+
headers: { ...localVarHeaderParams },
|
|
451
481
|
};
|
|
452
|
-
let
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
482
|
+
let requestOptions = localVarRequestOptions;
|
|
483
|
+
let url = localVarUrl;
|
|
484
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
485
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
486
|
+
url = auth_ApiKeyAuthentication.url;
|
|
487
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
488
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
489
|
+
url = auth_JWTAuthentication.url;
|
|
490
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
491
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
492
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
493
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
494
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
495
|
+
url = auth_OAuth2.url;
|
|
496
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
497
|
+
requestOptions = authDefault.requestOptions;
|
|
498
|
+
url = authDefault.url;
|
|
499
|
+
if (localVarFormParams) {
|
|
500
|
+
delete requestOptions.headers['Content-Type'];
|
|
501
|
+
if (localVarFormParams instanceof FormData) {
|
|
502
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
503
|
+
requestOptions.body = localVarFormParams;
|
|
504
|
+
}
|
|
505
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
506
|
+
// URL-encoded form
|
|
507
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
508
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
466
509
|
}
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
reject(error);
|
|
471
|
-
}
|
|
472
|
-
else {
|
|
473
|
-
body = models_1.ObjectSerializer.deserialize(body, "GenericApiResponse");
|
|
474
|
-
if (typeof body.success === 'boolean' && !body.success) {
|
|
475
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
476
|
-
reject(new Error(body.error || errString));
|
|
477
|
-
}
|
|
478
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
479
|
-
resolve(body);
|
|
480
|
-
}
|
|
481
|
-
else {
|
|
482
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
483
|
-
reject(errString);
|
|
484
|
-
}
|
|
485
|
-
}
|
|
486
|
-
});
|
|
487
|
-
});
|
|
488
|
-
});
|
|
510
|
+
}
|
|
511
|
+
const response = await fetch(url, requestOptions);
|
|
512
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
489
513
|
}
|
|
490
514
|
}
|
|
491
515
|
exports.VlmApi = VlmApi;
|