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.OrganizationCreateProjectApi = exports.OrganizationCreateProjectApiApiKeys = 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 OrganizationCreateProjectApiApiKeys;
|
|
|
30
47
|
OrganizationCreateProjectApiApiKeys[OrganizationCreateProjectApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(OrganizationCreateProjectApiApiKeys = exports.OrganizationCreateProjectApiApiKeys || (exports.OrganizationCreateProjectApiApiKeys = {}));
|
|
32
49
|
class OrganizationCreateProjectApi {
|
|
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 OrganizationCreateProjectApi {
|
|
|
54
91
|
}
|
|
55
92
|
this.opts = opts !== null && opts !== void 0 ? opts : {};
|
|
56
93
|
}
|
|
57
|
-
set useQuerystring(value) {
|
|
58
|
-
this._useQuerystring = value;
|
|
59
|
-
}
|
|
60
94
|
set basePath(basePath) {
|
|
61
95
|
this._basePath = basePath;
|
|
62
96
|
}
|
|
@@ -89,9 +123,11 @@ class OrganizationCreateProjectApi {
|
|
|
89
123
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
90
124
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
91
125
|
let localVarQueryParameters = {};
|
|
92
|
-
let localVarHeaderParams =
|
|
93
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
94
|
-
|
|
126
|
+
let localVarHeaderParams = {
|
|
127
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
128
|
+
'Content-Type': 'application/json',
|
|
129
|
+
...this.defaultHeaders,
|
|
130
|
+
};
|
|
95
131
|
const produces = ['application/json'];
|
|
96
132
|
// give precedence to 'application/json'
|
|
97
133
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -100,7 +136,7 @@ class OrganizationCreateProjectApi {
|
|
|
100
136
|
else {
|
|
101
137
|
localVarHeaderParams.Accept = produces.join(',');
|
|
102
138
|
}
|
|
103
|
-
let localVarFormParams
|
|
139
|
+
let localVarFormParams;
|
|
104
140
|
// verify required parameter 'organizationId' is not null or undefined
|
|
105
141
|
if (organizationId === null || organizationId === undefined) {
|
|
106
142
|
throw new Error('Required parameter organizationId was null or undefined when calling clearOrganizationTransform.');
|
|
@@ -109,55 +145,51 @@ class OrganizationCreateProjectApi {
|
|
|
109
145
|
if (createProjectId === null || createProjectId === undefined) {
|
|
110
146
|
throw new Error('Required parameter createProjectId was null or undefined when calling clearOrganizationTransform.');
|
|
111
147
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
148
|
+
localVarHeaderParams = {
|
|
149
|
+
...localVarHeaderParams,
|
|
150
|
+
...options.headers,
|
|
151
|
+
...this.opts.extraHeaders,
|
|
152
|
+
};
|
|
153
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
154
|
+
.filter(([, value]) => value !== undefined)
|
|
155
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
156
|
+
.join('&');
|
|
157
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
115
158
|
let localVarRequestOptions = {
|
|
116
159
|
method: 'POST',
|
|
117
|
-
|
|
118
|
-
headers: localVarHeaderParams,
|
|
119
|
-
uri: localVarPath,
|
|
120
|
-
useQuerystring: this._useQuerystring,
|
|
121
|
-
agentOptions: { keepAlive: false },
|
|
122
|
-
json: true,
|
|
160
|
+
headers: { ...localVarHeaderParams },
|
|
123
161
|
};
|
|
124
|
-
let
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
162
|
+
let requestOptions = localVarRequestOptions;
|
|
163
|
+
let url = localVarUrl;
|
|
164
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
165
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
166
|
+
url = auth_ApiKeyAuthentication.url;
|
|
167
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
168
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
169
|
+
url = auth_JWTAuthentication.url;
|
|
170
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
171
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
172
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
173
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
174
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
175
|
+
url = auth_OAuth2.url;
|
|
176
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
177
|
+
requestOptions = authDefault.requestOptions;
|
|
178
|
+
url = authDefault.url;
|
|
179
|
+
if (localVarFormParams) {
|
|
180
|
+
delete requestOptions.headers['Content-Type'];
|
|
181
|
+
if (localVarFormParams instanceof FormData) {
|
|
182
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
183
|
+
requestOptions.body = localVarFormParams;
|
|
138
184
|
}
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
148
|
-
reject(new Error(body.error || errString));
|
|
149
|
-
}
|
|
150
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
151
|
-
resolve(body);
|
|
152
|
-
}
|
|
153
|
-
else {
|
|
154
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
155
|
-
reject(errString);
|
|
156
|
-
}
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
});
|
|
160
|
-
});
|
|
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, 'GenericApiResponse');
|
|
161
193
|
}
|
|
162
194
|
/**
|
|
163
195
|
* Remove a transformation job. This will stop all running jobs.
|
|
@@ -170,9 +202,11 @@ class OrganizationCreateProjectApi {
|
|
|
170
202
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
171
203
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
172
204
|
let localVarQueryParameters = {};
|
|
173
|
-
let localVarHeaderParams =
|
|
174
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
175
|
-
|
|
205
|
+
let localVarHeaderParams = {
|
|
206
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
207
|
+
'Content-Type': 'application/json',
|
|
208
|
+
...this.defaultHeaders,
|
|
209
|
+
};
|
|
176
210
|
const produces = ['application/json'];
|
|
177
211
|
// give precedence to 'application/json'
|
|
178
212
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -181,7 +215,7 @@ class OrganizationCreateProjectApi {
|
|
|
181
215
|
else {
|
|
182
216
|
localVarHeaderParams.Accept = produces.join(',');
|
|
183
217
|
}
|
|
184
|
-
let localVarFormParams
|
|
218
|
+
let localVarFormParams;
|
|
185
219
|
// verify required parameter 'organizationId' is not null or undefined
|
|
186
220
|
if (organizationId === null || organizationId === undefined) {
|
|
187
221
|
throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganizationCreateProject.');
|
|
@@ -190,55 +224,51 @@ class OrganizationCreateProjectApi {
|
|
|
190
224
|
if (createProjectId === null || createProjectId === undefined) {
|
|
191
225
|
throw new Error('Required parameter createProjectId was null or undefined when calling deleteOrganizationCreateProject.');
|
|
192
226
|
}
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
227
|
+
localVarHeaderParams = {
|
|
228
|
+
...localVarHeaderParams,
|
|
229
|
+
...options.headers,
|
|
230
|
+
...this.opts.extraHeaders,
|
|
231
|
+
};
|
|
232
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
233
|
+
.filter(([, value]) => value !== undefined)
|
|
234
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
235
|
+
.join('&');
|
|
236
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
196
237
|
let localVarRequestOptions = {
|
|
197
238
|
method: 'DELETE',
|
|
198
|
-
|
|
199
|
-
headers: localVarHeaderParams,
|
|
200
|
-
uri: localVarPath,
|
|
201
|
-
useQuerystring: this._useQuerystring,
|
|
202
|
-
agentOptions: { keepAlive: false },
|
|
203
|
-
json: true,
|
|
239
|
+
headers: { ...localVarHeaderParams },
|
|
204
240
|
};
|
|
205
|
-
let
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
241
|
+
let requestOptions = localVarRequestOptions;
|
|
242
|
+
let url = localVarUrl;
|
|
243
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
244
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
245
|
+
url = auth_ApiKeyAuthentication.url;
|
|
246
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
247
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
248
|
+
url = auth_JWTAuthentication.url;
|
|
249
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
250
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
251
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
252
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
253
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
254
|
+
url = auth_OAuth2.url;
|
|
255
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
256
|
+
requestOptions = authDefault.requestOptions;
|
|
257
|
+
url = authDefault.url;
|
|
258
|
+
if (localVarFormParams) {
|
|
259
|
+
delete requestOptions.headers['Content-Type'];
|
|
260
|
+
if (localVarFormParams instanceof FormData) {
|
|
261
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
262
|
+
requestOptions.body = localVarFormParams;
|
|
219
263
|
}
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
229
|
-
reject(new Error(body.error || errString));
|
|
230
|
-
}
|
|
231
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
232
|
-
resolve(body);
|
|
233
|
-
}
|
|
234
|
-
else {
|
|
235
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
236
|
-
reject(errString);
|
|
237
|
-
}
|
|
238
|
-
}
|
|
239
|
-
});
|
|
240
|
-
});
|
|
241
|
-
});
|
|
264
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
265
|
+
// URL-encoded form
|
|
266
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
267
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
const response = await fetch(url, requestOptions);
|
|
271
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
242
272
|
}
|
|
243
273
|
/**
|
|
244
274
|
* Remove a file from a create project job. Only files for which no jobs are running can be deleted.
|
|
@@ -253,9 +283,11 @@ class OrganizationCreateProjectApi {
|
|
|
253
283
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)))
|
|
254
284
|
.replace('{' + 'createProjectFileId' + '}', encodeURIComponent(String(createProjectFileId)));
|
|
255
285
|
let localVarQueryParameters = {};
|
|
256
|
-
let localVarHeaderParams =
|
|
257
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
258
|
-
|
|
286
|
+
let localVarHeaderParams = {
|
|
287
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
288
|
+
'Content-Type': 'application/json',
|
|
289
|
+
...this.defaultHeaders,
|
|
290
|
+
};
|
|
259
291
|
const produces = ['application/json'];
|
|
260
292
|
// give precedence to 'application/json'
|
|
261
293
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -264,7 +296,7 @@ class OrganizationCreateProjectApi {
|
|
|
264
296
|
else {
|
|
265
297
|
localVarHeaderParams.Accept = produces.join(',');
|
|
266
298
|
}
|
|
267
|
-
let localVarFormParams
|
|
299
|
+
let localVarFormParams;
|
|
268
300
|
// verify required parameter 'organizationId' is not null or undefined
|
|
269
301
|
if (organizationId === null || organizationId === undefined) {
|
|
270
302
|
throw new Error('Required parameter organizationId was null or undefined when calling deleteOrganizationCreateProjectFile.');
|
|
@@ -277,55 +309,51 @@ class OrganizationCreateProjectApi {
|
|
|
277
309
|
if (createProjectFileId === null || createProjectFileId === undefined) {
|
|
278
310
|
throw new Error('Required parameter createProjectFileId was null or undefined when calling deleteOrganizationCreateProjectFile.');
|
|
279
311
|
}
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
312
|
+
localVarHeaderParams = {
|
|
313
|
+
...localVarHeaderParams,
|
|
314
|
+
...options.headers,
|
|
315
|
+
...this.opts.extraHeaders,
|
|
316
|
+
};
|
|
317
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
318
|
+
.filter(([, value]) => value !== undefined)
|
|
319
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
320
|
+
.join('&');
|
|
321
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
283
322
|
let localVarRequestOptions = {
|
|
284
323
|
method: 'DELETE',
|
|
285
|
-
|
|
286
|
-
headers: localVarHeaderParams,
|
|
287
|
-
uri: localVarPath,
|
|
288
|
-
useQuerystring: this._useQuerystring,
|
|
289
|
-
agentOptions: { keepAlive: false },
|
|
290
|
-
json: true,
|
|
324
|
+
headers: { ...localVarHeaderParams },
|
|
291
325
|
};
|
|
292
|
-
let
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
326
|
+
let requestOptions = localVarRequestOptions;
|
|
327
|
+
let url = localVarUrl;
|
|
328
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
329
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
330
|
+
url = auth_ApiKeyAuthentication.url;
|
|
331
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
332
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
333
|
+
url = auth_JWTAuthentication.url;
|
|
334
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
335
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
336
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
337
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
338
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
339
|
+
url = auth_OAuth2.url;
|
|
340
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
341
|
+
requestOptions = authDefault.requestOptions;
|
|
342
|
+
url = authDefault.url;
|
|
343
|
+
if (localVarFormParams) {
|
|
344
|
+
delete requestOptions.headers['Content-Type'];
|
|
345
|
+
if (localVarFormParams instanceof FormData) {
|
|
346
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
347
|
+
requestOptions.body = localVarFormParams;
|
|
306
348
|
}
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
316
|
-
reject(new Error(body.error || errString));
|
|
317
|
-
}
|
|
318
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
319
|
-
resolve(body);
|
|
320
|
-
}
|
|
321
|
-
else {
|
|
322
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
323
|
-
reject(errString);
|
|
324
|
-
}
|
|
325
|
-
}
|
|
326
|
-
});
|
|
327
|
-
});
|
|
328
|
-
});
|
|
349
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
350
|
+
// URL-encoded form
|
|
351
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
352
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
const response = await fetch(url, requestOptions);
|
|
356
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
329
357
|
}
|
|
330
358
|
/**
|
|
331
359
|
* Get the current status of a transformation job job.
|
|
@@ -341,9 +369,11 @@ class OrganizationCreateProjectApi {
|
|
|
341
369
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
342
370
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
343
371
|
let localVarQueryParameters = {};
|
|
344
|
-
let localVarHeaderParams =
|
|
345
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
346
|
-
|
|
372
|
+
let localVarHeaderParams = {
|
|
373
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
374
|
+
'Content-Type': 'application/json',
|
|
375
|
+
...this.defaultHeaders,
|
|
376
|
+
};
|
|
347
377
|
const produces = ['application/json'];
|
|
348
378
|
// give precedence to 'application/json'
|
|
349
379
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -352,7 +382,7 @@ class OrganizationCreateProjectApi {
|
|
|
352
382
|
else {
|
|
353
383
|
localVarHeaderParams.Accept = produces.join(',');
|
|
354
384
|
}
|
|
355
|
-
let localVarFormParams
|
|
385
|
+
let localVarFormParams;
|
|
356
386
|
// verify required parameter 'organizationId' is not null or undefined
|
|
357
387
|
if (organizationId === null || organizationId === undefined) {
|
|
358
388
|
throw new Error('Required parameter organizationId was null or undefined when calling getOrganizationCreateProjectStatus.');
|
|
@@ -378,55 +408,51 @@ class OrganizationCreateProjectApi {
|
|
|
378
408
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.selection) !== undefined) {
|
|
379
409
|
localVarQueryParameters['selection'] = models_1.ObjectSerializer.serialize(queryParams.selection, "string");
|
|
380
410
|
}
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
411
|
+
localVarHeaderParams = {
|
|
412
|
+
...localVarHeaderParams,
|
|
413
|
+
...options.headers,
|
|
414
|
+
...this.opts.extraHeaders,
|
|
415
|
+
};
|
|
416
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
417
|
+
.filter(([, value]) => value !== undefined)
|
|
418
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
419
|
+
.join('&');
|
|
420
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
384
421
|
let localVarRequestOptions = {
|
|
385
422
|
method: 'GET',
|
|
386
|
-
|
|
387
|
-
headers: localVarHeaderParams,
|
|
388
|
-
uri: localVarPath,
|
|
389
|
-
useQuerystring: this._useQuerystring,
|
|
390
|
-
agentOptions: { keepAlive: false },
|
|
391
|
-
json: true,
|
|
423
|
+
headers: { ...localVarHeaderParams },
|
|
392
424
|
};
|
|
393
|
-
let
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
425
|
+
let requestOptions = localVarRequestOptions;
|
|
426
|
+
let url = localVarUrl;
|
|
427
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
428
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
429
|
+
url = auth_ApiKeyAuthentication.url;
|
|
430
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
431
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
432
|
+
url = auth_JWTAuthentication.url;
|
|
433
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
434
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
435
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
436
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
437
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
438
|
+
url = auth_OAuth2.url;
|
|
439
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
440
|
+
requestOptions = authDefault.requestOptions;
|
|
441
|
+
url = authDefault.url;
|
|
442
|
+
if (localVarFormParams) {
|
|
443
|
+
delete requestOptions.headers['Content-Type'];
|
|
444
|
+
if (localVarFormParams instanceof FormData) {
|
|
445
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
446
|
+
requestOptions.body = localVarFormParams;
|
|
407
447
|
}
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
417
|
-
reject(new Error(body.error || errString));
|
|
418
|
-
}
|
|
419
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
420
|
-
resolve(body);
|
|
421
|
-
}
|
|
422
|
-
else {
|
|
423
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
424
|
-
reject(errString);
|
|
425
|
-
}
|
|
426
|
-
}
|
|
427
|
-
});
|
|
428
|
-
});
|
|
429
|
-
});
|
|
448
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
449
|
+
// URL-encoded form
|
|
450
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
451
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const response = await fetch(url, requestOptions);
|
|
455
|
+
return this.handleResponse(response, 'OrganizationCreateProjectStatusResponse');
|
|
430
456
|
}
|
|
431
457
|
/**
|
|
432
458
|
* Get list of transformation jobs.
|
|
@@ -440,9 +466,11 @@ class OrganizationCreateProjectApi {
|
|
|
440
466
|
const localVarPath = this.basePath + '/api/organizations/{organizationId}/create-project'
|
|
441
467
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
442
468
|
let localVarQueryParameters = {};
|
|
443
|
-
let localVarHeaderParams =
|
|
444
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
445
|
-
|
|
469
|
+
let localVarHeaderParams = {
|
|
470
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
471
|
+
'Content-Type': 'application/json',
|
|
472
|
+
...this.defaultHeaders,
|
|
473
|
+
};
|
|
446
474
|
const produces = ['application/json'];
|
|
447
475
|
// give precedence to 'application/json'
|
|
448
476
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -451,7 +479,7 @@ class OrganizationCreateProjectApi {
|
|
|
451
479
|
else {
|
|
452
480
|
localVarHeaderParams.Accept = produces.join(',');
|
|
453
481
|
}
|
|
454
|
-
let localVarFormParams
|
|
482
|
+
let localVarFormParams;
|
|
455
483
|
// verify required parameter 'organizationId' is not null or undefined
|
|
456
484
|
if (organizationId === null || organizationId === undefined) {
|
|
457
485
|
throw new Error('Required parameter organizationId was null or undefined when calling getOrganizationCreateProjects.');
|
|
@@ -465,55 +493,51 @@ class OrganizationCreateProjectApi {
|
|
|
465
493
|
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.includePipelineJobs) !== undefined) {
|
|
466
494
|
localVarQueryParameters['includePipelineJobs'] = models_1.ObjectSerializer.serialize(queryParams.includePipelineJobs, "boolean");
|
|
467
495
|
}
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
496
|
+
localVarHeaderParams = {
|
|
497
|
+
...localVarHeaderParams,
|
|
498
|
+
...options.headers,
|
|
499
|
+
...this.opts.extraHeaders,
|
|
500
|
+
};
|
|
501
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
502
|
+
.filter(([, value]) => value !== undefined)
|
|
503
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
504
|
+
.join('&');
|
|
505
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
471
506
|
let localVarRequestOptions = {
|
|
472
507
|
method: 'GET',
|
|
473
|
-
|
|
474
|
-
headers: localVarHeaderParams,
|
|
475
|
-
uri: localVarPath,
|
|
476
|
-
useQuerystring: this._useQuerystring,
|
|
477
|
-
agentOptions: { keepAlive: false },
|
|
478
|
-
json: true,
|
|
508
|
+
headers: { ...localVarHeaderParams },
|
|
479
509
|
};
|
|
480
|
-
let
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
510
|
+
let requestOptions = localVarRequestOptions;
|
|
511
|
+
let url = localVarUrl;
|
|
512
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
513
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
514
|
+
url = auth_ApiKeyAuthentication.url;
|
|
515
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
516
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
517
|
+
url = auth_JWTAuthentication.url;
|
|
518
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
519
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
520
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
521
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
522
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
523
|
+
url = auth_OAuth2.url;
|
|
524
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
525
|
+
requestOptions = authDefault.requestOptions;
|
|
526
|
+
url = authDefault.url;
|
|
527
|
+
if (localVarFormParams) {
|
|
528
|
+
delete requestOptions.headers['Content-Type'];
|
|
529
|
+
if (localVarFormParams instanceof FormData) {
|
|
530
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
531
|
+
requestOptions.body = localVarFormParams;
|
|
494
532
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
504
|
-
reject(new Error(body.error || errString));
|
|
505
|
-
}
|
|
506
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
507
|
-
resolve(body);
|
|
508
|
-
}
|
|
509
|
-
else {
|
|
510
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
511
|
-
reject(errString);
|
|
512
|
-
}
|
|
513
|
-
}
|
|
514
|
-
});
|
|
515
|
-
});
|
|
516
|
-
});
|
|
533
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
534
|
+
// URL-encoded form
|
|
535
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
536
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
const response = await fetch(url, requestOptions);
|
|
540
|
+
return this.handleResponse(response, 'OrganizationGetCreateProjectsResponse');
|
|
517
541
|
}
|
|
518
542
|
/**
|
|
519
543
|
* Add a new collaborator to a project owned by an organisation.
|
|
@@ -525,9 +549,11 @@ class OrganizationCreateProjectApi {
|
|
|
525
549
|
const localVarPath = this.basePath + '/api/organizations/{organizationId}/add-project-collaborator'
|
|
526
550
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
527
551
|
let localVarQueryParameters = {};
|
|
528
|
-
let localVarHeaderParams =
|
|
529
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
530
|
-
|
|
552
|
+
let localVarHeaderParams = {
|
|
553
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
554
|
+
'Content-Type': 'application/json',
|
|
555
|
+
...this.defaultHeaders,
|
|
556
|
+
};
|
|
531
557
|
const produces = ['application/json'];
|
|
532
558
|
// give precedence to 'application/json'
|
|
533
559
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -536,7 +562,7 @@ class OrganizationCreateProjectApi {
|
|
|
536
562
|
else {
|
|
537
563
|
localVarHeaderParams.Accept = produces.join(',');
|
|
538
564
|
}
|
|
539
|
-
let localVarFormParams
|
|
565
|
+
let localVarFormParams;
|
|
540
566
|
// verify required parameter 'organizationId' is not null or undefined
|
|
541
567
|
if (organizationId === null || organizationId === undefined) {
|
|
542
568
|
throw new Error('Required parameter organizationId was null or undefined when calling organizationAddCollaborator.');
|
|
@@ -545,56 +571,52 @@ class OrganizationCreateProjectApi {
|
|
|
545
571
|
if (updateOrganizationAddCollaboratorRequest === null || updateOrganizationAddCollaboratorRequest === undefined) {
|
|
546
572
|
throw new Error('Required parameter updateOrganizationAddCollaboratorRequest was null or undefined when calling organizationAddCollaborator.');
|
|
547
573
|
}
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
574
|
+
localVarHeaderParams = {
|
|
575
|
+
...localVarHeaderParams,
|
|
576
|
+
...options.headers,
|
|
577
|
+
...this.opts.extraHeaders,
|
|
578
|
+
};
|
|
579
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
580
|
+
.filter(([, value]) => value !== undefined)
|
|
581
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
582
|
+
.join('&');
|
|
583
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
551
584
|
let localVarRequestOptions = {
|
|
552
585
|
method: 'POST',
|
|
553
|
-
|
|
554
|
-
headers: localVarHeaderParams,
|
|
555
|
-
uri: localVarPath,
|
|
556
|
-
useQuerystring: this._useQuerystring,
|
|
557
|
-
agentOptions: { keepAlive: false },
|
|
558
|
-
json: true,
|
|
559
|
-
body: models_1.ObjectSerializer.serialize(updateOrganizationAddCollaboratorRequest, "UpdateOrganizationAddCollaboratorRequest")
|
|
586
|
+
headers: { ...localVarHeaderParams },
|
|
560
587
|
};
|
|
561
|
-
|
|
562
|
-
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
588
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateOrganizationAddCollaboratorRequest, "UpdateOrganizationAddCollaboratorRequest"));
|
|
589
|
+
let requestOptions = localVarRequestOptions;
|
|
590
|
+
let url = localVarUrl;
|
|
591
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
592
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
593
|
+
url = auth_ApiKeyAuthentication.url;
|
|
594
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
595
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
596
|
+
url = auth_JWTAuthentication.url;
|
|
597
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
598
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
599
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
600
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
601
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
602
|
+
url = auth_OAuth2.url;
|
|
603
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
604
|
+
requestOptions = authDefault.requestOptions;
|
|
605
|
+
url = authDefault.url;
|
|
606
|
+
if (localVarFormParams) {
|
|
607
|
+
delete requestOptions.headers['Content-Type'];
|
|
608
|
+
if (localVarFormParams instanceof FormData) {
|
|
609
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
610
|
+
requestOptions.body = localVarFormParams;
|
|
575
611
|
}
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
584
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
585
|
-
reject(new Error(body.error || errString));
|
|
586
|
-
}
|
|
587
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
588
|
-
resolve(body);
|
|
589
|
-
}
|
|
590
|
-
else {
|
|
591
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
592
|
-
reject(errString);
|
|
593
|
-
}
|
|
594
|
-
}
|
|
595
|
-
});
|
|
596
|
-
});
|
|
597
|
-
});
|
|
612
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
613
|
+
// URL-encoded form
|
|
614
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
615
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
616
|
+
}
|
|
617
|
+
}
|
|
618
|
+
const response = await fetch(url, requestOptions);
|
|
619
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
598
620
|
}
|
|
599
621
|
/**
|
|
600
622
|
* Create a new empty project within an organization.
|
|
@@ -606,9 +628,11 @@ class OrganizationCreateProjectApi {
|
|
|
606
628
|
const localVarPath = this.basePath + '/api/organizations/{organizationId}/new-project'
|
|
607
629
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
608
630
|
let localVarQueryParameters = {};
|
|
609
|
-
let localVarHeaderParams =
|
|
610
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
611
|
-
|
|
631
|
+
let localVarHeaderParams = {
|
|
632
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
633
|
+
'Content-Type': 'application/json',
|
|
634
|
+
...this.defaultHeaders,
|
|
635
|
+
};
|
|
612
636
|
const produces = ['application/json'];
|
|
613
637
|
// give precedence to 'application/json'
|
|
614
638
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -617,7 +641,7 @@ class OrganizationCreateProjectApi {
|
|
|
617
641
|
else {
|
|
618
642
|
localVarHeaderParams.Accept = produces.join(',');
|
|
619
643
|
}
|
|
620
|
-
let localVarFormParams
|
|
644
|
+
let localVarFormParams;
|
|
621
645
|
// verify required parameter 'organizationId' is not null or undefined
|
|
622
646
|
if (organizationId === null || organizationId === undefined) {
|
|
623
647
|
throw new Error('Required parameter organizationId was null or undefined when calling organizationCreateEmptyProject.');
|
|
@@ -626,56 +650,52 @@ class OrganizationCreateProjectApi {
|
|
|
626
650
|
if (updateOrganizationCreateEmptyProjectRequest === null || updateOrganizationCreateEmptyProjectRequest === undefined) {
|
|
627
651
|
throw new Error('Required parameter updateOrganizationCreateEmptyProjectRequest was null or undefined when calling organizationCreateEmptyProject.');
|
|
628
652
|
}
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
653
|
+
localVarHeaderParams = {
|
|
654
|
+
...localVarHeaderParams,
|
|
655
|
+
...options.headers,
|
|
656
|
+
...this.opts.extraHeaders,
|
|
657
|
+
};
|
|
658
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
659
|
+
.filter(([, value]) => value !== undefined)
|
|
660
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
661
|
+
.join('&');
|
|
662
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
632
663
|
let localVarRequestOptions = {
|
|
633
664
|
method: 'POST',
|
|
634
|
-
|
|
635
|
-
headers: localVarHeaderParams,
|
|
636
|
-
uri: localVarPath,
|
|
637
|
-
useQuerystring: this._useQuerystring,
|
|
638
|
-
agentOptions: { keepAlive: false },
|
|
639
|
-
json: true,
|
|
640
|
-
body: models_1.ObjectSerializer.serialize(updateOrganizationCreateEmptyProjectRequest, "UpdateOrganizationCreateEmptyProjectRequest")
|
|
665
|
+
headers: { ...localVarHeaderParams },
|
|
641
666
|
};
|
|
642
|
-
|
|
643
|
-
|
|
644
|
-
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
667
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateOrganizationCreateEmptyProjectRequest, "UpdateOrganizationCreateEmptyProjectRequest"));
|
|
668
|
+
let requestOptions = localVarRequestOptions;
|
|
669
|
+
let url = localVarUrl;
|
|
670
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
671
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
672
|
+
url = auth_ApiKeyAuthentication.url;
|
|
673
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
674
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
675
|
+
url = auth_JWTAuthentication.url;
|
|
676
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
677
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
678
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
679
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
680
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
681
|
+
url = auth_OAuth2.url;
|
|
682
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
683
|
+
requestOptions = authDefault.requestOptions;
|
|
684
|
+
url = authDefault.url;
|
|
685
|
+
if (localVarFormParams) {
|
|
686
|
+
delete requestOptions.headers['Content-Type'];
|
|
687
|
+
if (localVarFormParams instanceof FormData) {
|
|
688
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
689
|
+
requestOptions.body = localVarFormParams;
|
|
656
690
|
}
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
666
|
-
reject(new Error(body.error || errString));
|
|
667
|
-
}
|
|
668
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
669
|
-
resolve(body);
|
|
670
|
-
}
|
|
671
|
-
else {
|
|
672
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
673
|
-
reject(errString);
|
|
674
|
-
}
|
|
675
|
-
}
|
|
676
|
-
});
|
|
677
|
-
});
|
|
678
|
-
});
|
|
691
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
692
|
+
// URL-encoded form
|
|
693
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
694
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
695
|
+
}
|
|
696
|
+
}
|
|
697
|
+
const response = await fetch(url, requestOptions);
|
|
698
|
+
return this.handleResponse(response, 'CreateProjectResponse');
|
|
679
699
|
}
|
|
680
700
|
/**
|
|
681
701
|
* Start a transformation job to fetch data from the organization and put it in a project, or transform into new data.
|
|
@@ -687,9 +707,11 @@ class OrganizationCreateProjectApi {
|
|
|
687
707
|
const localVarPath = this.basePath + '/api/organizations/{organizationId}/create-project'
|
|
688
708
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
689
709
|
let localVarQueryParameters = {};
|
|
690
|
-
let localVarHeaderParams =
|
|
691
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
692
|
-
|
|
710
|
+
let localVarHeaderParams = {
|
|
711
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
712
|
+
'Content-Type': 'application/json',
|
|
713
|
+
...this.defaultHeaders,
|
|
714
|
+
};
|
|
693
715
|
const produces = ['application/json'];
|
|
694
716
|
// give precedence to 'application/json'
|
|
695
717
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -698,7 +720,7 @@ class OrganizationCreateProjectApi {
|
|
|
698
720
|
else {
|
|
699
721
|
localVarHeaderParams.Accept = produces.join(',');
|
|
700
722
|
}
|
|
701
|
-
let localVarFormParams
|
|
723
|
+
let localVarFormParams;
|
|
702
724
|
// verify required parameter 'organizationId' is not null or undefined
|
|
703
725
|
if (organizationId === null || organizationId === undefined) {
|
|
704
726
|
throw new Error('Required parameter organizationId was null or undefined when calling organizationCreateProject.');
|
|
@@ -707,56 +729,52 @@ class OrganizationCreateProjectApi {
|
|
|
707
729
|
if (organizationCreateProjectRequest === null || organizationCreateProjectRequest === undefined) {
|
|
708
730
|
throw new Error('Required parameter organizationCreateProjectRequest was null or undefined when calling organizationCreateProject.');
|
|
709
731
|
}
|
|
710
|
-
|
|
711
|
-
|
|
712
|
-
|
|
732
|
+
localVarHeaderParams = {
|
|
733
|
+
...localVarHeaderParams,
|
|
734
|
+
...options.headers,
|
|
735
|
+
...this.opts.extraHeaders,
|
|
736
|
+
};
|
|
737
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
738
|
+
.filter(([, value]) => value !== undefined)
|
|
739
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
740
|
+
.join('&');
|
|
741
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
713
742
|
let localVarRequestOptions = {
|
|
714
743
|
method: 'POST',
|
|
715
|
-
|
|
716
|
-
headers: localVarHeaderParams,
|
|
717
|
-
uri: localVarPath,
|
|
718
|
-
useQuerystring: this._useQuerystring,
|
|
719
|
-
agentOptions: { keepAlive: false },
|
|
720
|
-
json: true,
|
|
721
|
-
body: models_1.ObjectSerializer.serialize(organizationCreateProjectRequest, "OrganizationCreateProjectRequest")
|
|
744
|
+
headers: { ...localVarHeaderParams },
|
|
722
745
|
};
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
746
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(organizationCreateProjectRequest, "OrganizationCreateProjectRequest"));
|
|
747
|
+
let requestOptions = localVarRequestOptions;
|
|
748
|
+
let url = localVarUrl;
|
|
749
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
750
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
751
|
+
url = auth_ApiKeyAuthentication.url;
|
|
752
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
753
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
754
|
+
url = auth_JWTAuthentication.url;
|
|
755
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
756
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
757
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
758
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
759
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
760
|
+
url = auth_OAuth2.url;
|
|
761
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
762
|
+
requestOptions = authDefault.requestOptions;
|
|
763
|
+
url = authDefault.url;
|
|
764
|
+
if (localVarFormParams) {
|
|
765
|
+
delete requestOptions.headers['Content-Type'];
|
|
766
|
+
if (localVarFormParams instanceof FormData) {
|
|
767
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
768
|
+
requestOptions.body = localVarFormParams;
|
|
737
769
|
}
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
747
|
-
reject(new Error(body.error || errString));
|
|
748
|
-
}
|
|
749
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
750
|
-
resolve(body);
|
|
751
|
-
}
|
|
752
|
-
else {
|
|
753
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
754
|
-
reject(errString);
|
|
755
|
-
}
|
|
756
|
-
}
|
|
757
|
-
});
|
|
758
|
-
});
|
|
759
|
-
});
|
|
770
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
771
|
+
// URL-encoded form
|
|
772
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
773
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
774
|
+
}
|
|
775
|
+
}
|
|
776
|
+
const response = await fetch(url, requestOptions);
|
|
777
|
+
return this.handleResponse(response, 'OrganizationCreateProjectResponse');
|
|
760
778
|
}
|
|
761
779
|
/**
|
|
762
780
|
* Retry a transformation action on a file from a transformation job. Only files that have failed can be retried.
|
|
@@ -771,9 +789,11 @@ class OrganizationCreateProjectApi {
|
|
|
771
789
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)))
|
|
772
790
|
.replace('{' + 'createProjectFileId' + '}', encodeURIComponent(String(createProjectFileId)));
|
|
773
791
|
let localVarQueryParameters = {};
|
|
774
|
-
let localVarHeaderParams =
|
|
775
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
776
|
-
|
|
792
|
+
let localVarHeaderParams = {
|
|
793
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
794
|
+
'Content-Type': 'application/json',
|
|
795
|
+
...this.defaultHeaders,
|
|
796
|
+
};
|
|
777
797
|
const produces = ['application/json'];
|
|
778
798
|
// give precedence to 'application/json'
|
|
779
799
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -782,7 +802,7 @@ class OrganizationCreateProjectApi {
|
|
|
782
802
|
else {
|
|
783
803
|
localVarHeaderParams.Accept = produces.join(',');
|
|
784
804
|
}
|
|
785
|
-
let localVarFormParams
|
|
805
|
+
let localVarFormParams;
|
|
786
806
|
// verify required parameter 'organizationId' is not null or undefined
|
|
787
807
|
if (organizationId === null || organizationId === undefined) {
|
|
788
808
|
throw new Error('Required parameter organizationId was null or undefined when calling retryOrganizationCreateProjectFile.');
|
|
@@ -795,55 +815,51 @@ class OrganizationCreateProjectApi {
|
|
|
795
815
|
if (createProjectFileId === null || createProjectFileId === undefined) {
|
|
796
816
|
throw new Error('Required parameter createProjectFileId was null or undefined when calling retryOrganizationCreateProjectFile.');
|
|
797
817
|
}
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
818
|
+
localVarHeaderParams = {
|
|
819
|
+
...localVarHeaderParams,
|
|
820
|
+
...options.headers,
|
|
821
|
+
...this.opts.extraHeaders,
|
|
822
|
+
};
|
|
823
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
824
|
+
.filter(([, value]) => value !== undefined)
|
|
825
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
826
|
+
.join('&');
|
|
827
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
801
828
|
let localVarRequestOptions = {
|
|
802
829
|
method: 'POST',
|
|
803
|
-
|
|
804
|
-
headers: localVarHeaderParams,
|
|
805
|
-
uri: localVarPath,
|
|
806
|
-
useQuerystring: this._useQuerystring,
|
|
807
|
-
agentOptions: { keepAlive: false },
|
|
808
|
-
json: true,
|
|
830
|
+
headers: { ...localVarHeaderParams },
|
|
809
831
|
};
|
|
810
|
-
let
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
|
|
822
|
-
|
|
823
|
-
|
|
832
|
+
let requestOptions = localVarRequestOptions;
|
|
833
|
+
let url = localVarUrl;
|
|
834
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
835
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
836
|
+
url = auth_ApiKeyAuthentication.url;
|
|
837
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
838
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
839
|
+
url = auth_JWTAuthentication.url;
|
|
840
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
841
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
842
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
843
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
844
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
845
|
+
url = auth_OAuth2.url;
|
|
846
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
847
|
+
requestOptions = authDefault.requestOptions;
|
|
848
|
+
url = authDefault.url;
|
|
849
|
+
if (localVarFormParams) {
|
|
850
|
+
delete requestOptions.headers['Content-Type'];
|
|
851
|
+
if (localVarFormParams instanceof FormData) {
|
|
852
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
853
|
+
requestOptions.body = localVarFormParams;
|
|
824
854
|
}
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
834
|
-
reject(new Error(body.error || errString));
|
|
835
|
-
}
|
|
836
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
837
|
-
resolve(body);
|
|
838
|
-
}
|
|
839
|
-
else {
|
|
840
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
841
|
-
reject(errString);
|
|
842
|
-
}
|
|
843
|
-
}
|
|
844
|
-
});
|
|
845
|
-
});
|
|
846
|
-
});
|
|
855
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
856
|
+
// URL-encoded form
|
|
857
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
858
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
859
|
+
}
|
|
860
|
+
}
|
|
861
|
+
const response = await fetch(url, requestOptions);
|
|
862
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
847
863
|
}
|
|
848
864
|
/**
|
|
849
865
|
* Retry all failed transform job from a transformation job. Only jobs that have failed will be retried.
|
|
@@ -856,9 +872,11 @@ class OrganizationCreateProjectApi {
|
|
|
856
872
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
857
873
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
858
874
|
let localVarQueryParameters = {};
|
|
859
|
-
let localVarHeaderParams =
|
|
860
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
861
|
-
|
|
875
|
+
let localVarHeaderParams = {
|
|
876
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
877
|
+
'Content-Type': 'application/json',
|
|
878
|
+
...this.defaultHeaders,
|
|
879
|
+
};
|
|
862
880
|
const produces = ['application/json'];
|
|
863
881
|
// give precedence to 'application/json'
|
|
864
882
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -867,7 +885,7 @@ class OrganizationCreateProjectApi {
|
|
|
867
885
|
else {
|
|
868
886
|
localVarHeaderParams.Accept = produces.join(',');
|
|
869
887
|
}
|
|
870
|
-
let localVarFormParams
|
|
888
|
+
let localVarFormParams;
|
|
871
889
|
// verify required parameter 'organizationId' is not null or undefined
|
|
872
890
|
if (organizationId === null || organizationId === undefined) {
|
|
873
891
|
throw new Error('Required parameter organizationId was null or undefined when calling retryOrganizationTransform.');
|
|
@@ -876,55 +894,51 @@ class OrganizationCreateProjectApi {
|
|
|
876
894
|
if (createProjectId === null || createProjectId === undefined) {
|
|
877
895
|
throw new Error('Required parameter createProjectId was null or undefined when calling retryOrganizationTransform.');
|
|
878
896
|
}
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
897
|
+
localVarHeaderParams = {
|
|
898
|
+
...localVarHeaderParams,
|
|
899
|
+
...options.headers,
|
|
900
|
+
...this.opts.extraHeaders,
|
|
901
|
+
};
|
|
902
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
903
|
+
.filter(([, value]) => value !== undefined)
|
|
904
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
905
|
+
.join('&');
|
|
906
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
882
907
|
let localVarRequestOptions = {
|
|
883
908
|
method: 'POST',
|
|
884
|
-
|
|
885
|
-
headers: localVarHeaderParams,
|
|
886
|
-
uri: localVarPath,
|
|
887
|
-
useQuerystring: this._useQuerystring,
|
|
888
|
-
agentOptions: { keepAlive: false },
|
|
889
|
-
json: true,
|
|
909
|
+
headers: { ...localVarHeaderParams },
|
|
890
910
|
};
|
|
891
|
-
let
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
911
|
+
let requestOptions = localVarRequestOptions;
|
|
912
|
+
let url = localVarUrl;
|
|
913
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
914
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
915
|
+
url = auth_ApiKeyAuthentication.url;
|
|
916
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
917
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
918
|
+
url = auth_JWTAuthentication.url;
|
|
919
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
920
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
921
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
922
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
923
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
924
|
+
url = auth_OAuth2.url;
|
|
925
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
926
|
+
requestOptions = authDefault.requestOptions;
|
|
927
|
+
url = authDefault.url;
|
|
928
|
+
if (localVarFormParams) {
|
|
929
|
+
delete requestOptions.headers['Content-Type'];
|
|
930
|
+
if (localVarFormParams instanceof FormData) {
|
|
931
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
932
|
+
requestOptions.body = localVarFormParams;
|
|
905
933
|
}
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
915
|
-
reject(new Error(body.error || errString));
|
|
916
|
-
}
|
|
917
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
918
|
-
resolve(body);
|
|
919
|
-
}
|
|
920
|
-
else {
|
|
921
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
922
|
-
reject(errString);
|
|
923
|
-
}
|
|
924
|
-
}
|
|
925
|
-
});
|
|
926
|
-
});
|
|
927
|
-
});
|
|
934
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
935
|
+
// URL-encoded form
|
|
936
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
937
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
const response = await fetch(url, requestOptions);
|
|
941
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
928
942
|
}
|
|
929
943
|
/**
|
|
930
944
|
* Retry the upload job from a transformation job. Only jobs that have failed can be retried.
|
|
@@ -937,9 +951,11 @@ class OrganizationCreateProjectApi {
|
|
|
937
951
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
938
952
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
939
953
|
let localVarQueryParameters = {};
|
|
940
|
-
let localVarHeaderParams =
|
|
941
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
942
|
-
|
|
954
|
+
let localVarHeaderParams = {
|
|
955
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
956
|
+
'Content-Type': 'application/json',
|
|
957
|
+
...this.defaultHeaders,
|
|
958
|
+
};
|
|
943
959
|
const produces = ['application/json'];
|
|
944
960
|
// give precedence to 'application/json'
|
|
945
961
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -948,7 +964,7 @@ class OrganizationCreateProjectApi {
|
|
|
948
964
|
else {
|
|
949
965
|
localVarHeaderParams.Accept = produces.join(',');
|
|
950
966
|
}
|
|
951
|
-
let localVarFormParams
|
|
967
|
+
let localVarFormParams;
|
|
952
968
|
// verify required parameter 'organizationId' is not null or undefined
|
|
953
969
|
if (organizationId === null || organizationId === undefined) {
|
|
954
970
|
throw new Error('Required parameter organizationId was null or undefined when calling retryOrganizationUpload.');
|
|
@@ -957,55 +973,51 @@ class OrganizationCreateProjectApi {
|
|
|
957
973
|
if (createProjectId === null || createProjectId === undefined) {
|
|
958
974
|
throw new Error('Required parameter createProjectId was null or undefined when calling retryOrganizationUpload.');
|
|
959
975
|
}
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
976
|
+
localVarHeaderParams = {
|
|
977
|
+
...localVarHeaderParams,
|
|
978
|
+
...options.headers,
|
|
979
|
+
...this.opts.extraHeaders,
|
|
980
|
+
};
|
|
981
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
982
|
+
.filter(([, value]) => value !== undefined)
|
|
983
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
984
|
+
.join('&');
|
|
985
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
963
986
|
let localVarRequestOptions = {
|
|
964
987
|
method: 'POST',
|
|
965
|
-
|
|
966
|
-
headers: localVarHeaderParams,
|
|
967
|
-
uri: localVarPath,
|
|
968
|
-
useQuerystring: this._useQuerystring,
|
|
969
|
-
agentOptions: { keepAlive: false },
|
|
970
|
-
json: true,
|
|
988
|
+
headers: { ...localVarHeaderParams },
|
|
971
989
|
};
|
|
972
|
-
let
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
990
|
+
let requestOptions = localVarRequestOptions;
|
|
991
|
+
let url = localVarUrl;
|
|
992
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
993
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
994
|
+
url = auth_ApiKeyAuthentication.url;
|
|
995
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
996
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
997
|
+
url = auth_JWTAuthentication.url;
|
|
998
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
999
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1000
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1001
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1002
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1003
|
+
url = auth_OAuth2.url;
|
|
1004
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1005
|
+
requestOptions = authDefault.requestOptions;
|
|
1006
|
+
url = authDefault.url;
|
|
1007
|
+
if (localVarFormParams) {
|
|
1008
|
+
delete requestOptions.headers['Content-Type'];
|
|
1009
|
+
if (localVarFormParams instanceof FormData) {
|
|
1010
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1011
|
+
requestOptions.body = localVarFormParams;
|
|
986
1012
|
}
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
996
|
-
reject(new Error(body.error || errString));
|
|
997
|
-
}
|
|
998
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
999
|
-
resolve(body);
|
|
1000
|
-
}
|
|
1001
|
-
else {
|
|
1002
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1003
|
-
reject(errString);
|
|
1004
|
-
}
|
|
1005
|
-
}
|
|
1006
|
-
});
|
|
1007
|
-
});
|
|
1008
|
-
});
|
|
1013
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1014
|
+
// URL-encoded form
|
|
1015
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1016
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1017
|
+
}
|
|
1018
|
+
}
|
|
1019
|
+
const response = await fetch(url, requestOptions);
|
|
1020
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1009
1021
|
}
|
|
1010
1022
|
/**
|
|
1011
1023
|
* Update the properties of a transformation job.
|
|
@@ -1019,9 +1031,11 @@ class OrganizationCreateProjectApi {
|
|
|
1019
1031
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)))
|
|
1020
1032
|
.replace('{' + 'createProjectId' + '}', encodeURIComponent(String(createProjectId)));
|
|
1021
1033
|
let localVarQueryParameters = {};
|
|
1022
|
-
let localVarHeaderParams =
|
|
1023
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1024
|
-
|
|
1034
|
+
let localVarHeaderParams = {
|
|
1035
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1036
|
+
'Content-Type': 'application/json',
|
|
1037
|
+
...this.defaultHeaders,
|
|
1038
|
+
};
|
|
1025
1039
|
const produces = ['application/json'];
|
|
1026
1040
|
// give precedence to 'application/json'
|
|
1027
1041
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1030,7 +1044,7 @@ class OrganizationCreateProjectApi {
|
|
|
1030
1044
|
else {
|
|
1031
1045
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1032
1046
|
}
|
|
1033
|
-
let localVarFormParams
|
|
1047
|
+
let localVarFormParams;
|
|
1034
1048
|
// verify required parameter 'organizationId' is not null or undefined
|
|
1035
1049
|
if (organizationId === null || organizationId === undefined) {
|
|
1036
1050
|
throw new Error('Required parameter organizationId was null or undefined when calling updateOrganizationCreateProject.');
|
|
@@ -1043,56 +1057,52 @@ class OrganizationCreateProjectApi {
|
|
|
1043
1057
|
if (updateOrganizationCreateProjectRequest === null || updateOrganizationCreateProjectRequest === undefined) {
|
|
1044
1058
|
throw new Error('Required parameter updateOrganizationCreateProjectRequest was null or undefined when calling updateOrganizationCreateProject.');
|
|
1045
1059
|
}
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1060
|
+
localVarHeaderParams = {
|
|
1061
|
+
...localVarHeaderParams,
|
|
1062
|
+
...options.headers,
|
|
1063
|
+
...this.opts.extraHeaders,
|
|
1064
|
+
};
|
|
1065
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1066
|
+
.filter(([, value]) => value !== undefined)
|
|
1067
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1068
|
+
.join('&');
|
|
1069
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1049
1070
|
let localVarRequestOptions = {
|
|
1050
1071
|
method: 'POST',
|
|
1051
|
-
|
|
1052
|
-
headers: localVarHeaderParams,
|
|
1053
|
-
uri: localVarPath,
|
|
1054
|
-
useQuerystring: this._useQuerystring,
|
|
1055
|
-
agentOptions: { keepAlive: false },
|
|
1056
|
-
json: true,
|
|
1057
|
-
body: models_1.ObjectSerializer.serialize(updateOrganizationCreateProjectRequest, "UpdateOrganizationCreateProjectRequest")
|
|
1072
|
+
headers: { ...localVarHeaderParams },
|
|
1058
1073
|
};
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1074
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateOrganizationCreateProjectRequest, "UpdateOrganizationCreateProjectRequest"));
|
|
1075
|
+
let requestOptions = localVarRequestOptions;
|
|
1076
|
+
let url = localVarUrl;
|
|
1077
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1078
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1079
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1080
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1081
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1082
|
+
url = auth_JWTAuthentication.url;
|
|
1083
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1084
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1085
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1086
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1087
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1088
|
+
url = auth_OAuth2.url;
|
|
1089
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1090
|
+
requestOptions = authDefault.requestOptions;
|
|
1091
|
+
url = authDefault.url;
|
|
1092
|
+
if (localVarFormParams) {
|
|
1093
|
+
delete requestOptions.headers['Content-Type'];
|
|
1094
|
+
if (localVarFormParams instanceof FormData) {
|
|
1095
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1096
|
+
requestOptions.body = localVarFormParams;
|
|
1073
1097
|
}
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1083
|
-
reject(new Error(body.error || errString));
|
|
1084
|
-
}
|
|
1085
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1086
|
-
resolve(body);
|
|
1087
|
-
}
|
|
1088
|
-
else {
|
|
1089
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1090
|
-
reject(errString);
|
|
1091
|
-
}
|
|
1092
|
-
}
|
|
1093
|
-
});
|
|
1094
|
-
});
|
|
1095
|
-
});
|
|
1098
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1099
|
+
// URL-encoded form
|
|
1100
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1101
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
const response = await fetch(url, requestOptions);
|
|
1105
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
1096
1106
|
}
|
|
1097
1107
|
/**
|
|
1098
1108
|
* Upload a zip file containing a custom transformation or deployment block.
|
|
@@ -1106,9 +1116,11 @@ class OrganizationCreateProjectApi {
|
|
|
1106
1116
|
const localVarPath = this.basePath + '/api/organizations/{organizationId}/custom-block'
|
|
1107
1117
|
.replace('{' + 'organizationId' + '}', encodeURIComponent(String(organizationId)));
|
|
1108
1118
|
let localVarQueryParameters = {};
|
|
1109
|
-
let localVarHeaderParams =
|
|
1110
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1111
|
-
|
|
1119
|
+
let localVarHeaderParams = {
|
|
1120
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
1121
|
+
'Content-Type': 'application/json',
|
|
1122
|
+
...this.defaultHeaders,
|
|
1123
|
+
};
|
|
1112
1124
|
const produces = ['application/json'];
|
|
1113
1125
|
// give precedence to 'application/json'
|
|
1114
1126
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -1117,7 +1129,7 @@ class OrganizationCreateProjectApi {
|
|
|
1117
1129
|
else {
|
|
1118
1130
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1119
1131
|
}
|
|
1120
|
-
let localVarFormParams
|
|
1132
|
+
let localVarFormParams;
|
|
1121
1133
|
// verify required parameter 'organizationId' is not null or undefined
|
|
1122
1134
|
if (organizationId === null || organizationId === undefined) {
|
|
1123
1135
|
throw new Error('Required parameter organizationId was null or undefined when calling uploadCustomBlock.');
|
|
@@ -1134,65 +1146,101 @@ class OrganizationCreateProjectApi {
|
|
|
1134
1146
|
if (params.blockId === null || params.blockId === undefined) {
|
|
1135
1147
|
throw new Error('Required parameter params.blockId was null or undefined when calling uploadCustomBlock.');
|
|
1136
1148
|
}
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1149
|
+
localVarHeaderParams = {
|
|
1150
|
+
...localVarHeaderParams,
|
|
1151
|
+
...options.headers,
|
|
1152
|
+
...this.opts.extraHeaders,
|
|
1153
|
+
};
|
|
1140
1154
|
if (params.tar !== undefined) {
|
|
1141
|
-
localVarFormParams
|
|
1155
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
1156
|
+
const existingParams = localVarFormParams;
|
|
1157
|
+
localVarFormParams = new FormData();
|
|
1158
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
1159
|
+
Object.keys(existingParams).forEach(key => {
|
|
1160
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
1161
|
+
});
|
|
1162
|
+
}
|
|
1163
|
+
}
|
|
1164
|
+
const tarFiles = Array.isArray(params.tar) ? params.tar : [params.tar];
|
|
1165
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
1166
|
+
tarFiles.forEach((f) => {
|
|
1167
|
+
localVarFormParams.append('tar', new Blob([f.value], {
|
|
1168
|
+
type: f.options.contentType
|
|
1169
|
+
}), f.options.filename);
|
|
1170
|
+
});
|
|
1142
1171
|
}
|
|
1143
|
-
localVarUseFormData = true;
|
|
1144
1172
|
if (params.type !== undefined) {
|
|
1145
|
-
|
|
1173
|
+
const isParametersField = "type" === "parameters";
|
|
1174
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
1175
|
+
const typeSerialized = serializableParams
|
|
1176
|
+
? JSON.stringify(params.parameters)
|
|
1177
|
+
: models_1.ObjectSerializer.serializeFormData(params.type, "string");
|
|
1178
|
+
if (localVarFormParams instanceof FormData) {
|
|
1179
|
+
localVarFormParams.append('type', typeSerialized);
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
if (!localVarFormParams) {
|
|
1183
|
+
localVarFormParams = {};
|
|
1184
|
+
}
|
|
1185
|
+
localVarFormParams['type'] = typeSerialized;
|
|
1186
|
+
}
|
|
1146
1187
|
}
|
|
1147
1188
|
if (params.blockId !== undefined) {
|
|
1148
|
-
|
|
1189
|
+
const isParametersField = "blockId" === "parameters";
|
|
1190
|
+
const serializableParams = isParametersField && params && ("parameters" in params);
|
|
1191
|
+
const blockIdSerialized = serializableParams
|
|
1192
|
+
? JSON.stringify(params.parameters)
|
|
1193
|
+
: models_1.ObjectSerializer.serializeFormData(params.blockId, "number");
|
|
1194
|
+
if (localVarFormParams instanceof FormData) {
|
|
1195
|
+
localVarFormParams.append('blockId', blockIdSerialized);
|
|
1196
|
+
}
|
|
1197
|
+
else {
|
|
1198
|
+
if (!localVarFormParams) {
|
|
1199
|
+
localVarFormParams = {};
|
|
1200
|
+
}
|
|
1201
|
+
localVarFormParams['blockId'] = blockIdSerialized;
|
|
1202
|
+
}
|
|
1149
1203
|
}
|
|
1204
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
1205
|
+
.filter(([, value]) => value !== undefined)
|
|
1206
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
1207
|
+
.join('&');
|
|
1208
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
1150
1209
|
let localVarRequestOptions = {
|
|
1151
1210
|
method: 'POST',
|
|
1152
|
-
|
|
1153
|
-
headers: localVarHeaderParams,
|
|
1154
|
-
uri: localVarPath,
|
|
1155
|
-
useQuerystring: this._useQuerystring,
|
|
1156
|
-
agentOptions: { keepAlive: false },
|
|
1157
|
-
json: true,
|
|
1211
|
+
headers: { ...localVarHeaderParams },
|
|
1158
1212
|
};
|
|
1159
|
-
let
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
|
|
1166
|
-
|
|
1167
|
-
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1213
|
+
let requestOptions = localVarRequestOptions;
|
|
1214
|
+
let url = localVarUrl;
|
|
1215
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
1216
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
1217
|
+
url = auth_ApiKeyAuthentication.url;
|
|
1218
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
1219
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
1220
|
+
url = auth_JWTAuthentication.url;
|
|
1221
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
1222
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
1223
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
1224
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
1225
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
1226
|
+
url = auth_OAuth2.url;
|
|
1227
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
1228
|
+
requestOptions = authDefault.requestOptions;
|
|
1229
|
+
url = authDefault.url;
|
|
1230
|
+
if (localVarFormParams) {
|
|
1231
|
+
delete requestOptions.headers['Content-Type'];
|
|
1232
|
+
if (localVarFormParams instanceof FormData) {
|
|
1233
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
1234
|
+
requestOptions.body = localVarFormParams;
|
|
1173
1235
|
}
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1183
|
-
reject(new Error(body.error || errString));
|
|
1184
|
-
}
|
|
1185
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1186
|
-
resolve(body);
|
|
1187
|
-
}
|
|
1188
|
-
else {
|
|
1189
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1190
|
-
reject(errString);
|
|
1191
|
-
}
|
|
1192
|
-
}
|
|
1193
|
-
});
|
|
1194
|
-
});
|
|
1195
|
-
});
|
|
1236
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
1237
|
+
// URL-encoded form
|
|
1238
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
1239
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
1240
|
+
}
|
|
1241
|
+
}
|
|
1242
|
+
const response = await fetch(url, requestOptions);
|
|
1243
|
+
return this.handleResponse(response, 'StartJobResponse');
|
|
1196
1244
|
}
|
|
1197
1245
|
}
|
|
1198
1246
|
exports.OrganizationCreateProjectApi = OrganizationCreateProjectApi;
|