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.ThemesApi = exports.ThemesApiApiKeys = 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 ThemesApiApiKeys;
|
|
|
30
47
|
ThemesApiApiKeys[ThemesApiApiKeys["JWTHttpHeaderAuthentication"] = 2] = "JWTHttpHeaderAuthentication";
|
|
31
48
|
})(ThemesApiApiKeys = exports.ThemesApiApiKeys || (exports.ThemesApiApiKeys = {}));
|
|
32
49
|
class ThemesApi {
|
|
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 ThemesApi {
|
|
|
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 ThemesApi {
|
|
|
87
121
|
const localVarPath = this.basePath + '/api/themes/{themeId}'
|
|
88
122
|
.replace('{' + 'themeId' + '}', encodeURIComponent(String(themeId)));
|
|
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 ThemesApi {
|
|
|
98
134
|
else {
|
|
99
135
|
localVarHeaderParams.Accept = produces.join(',');
|
|
100
136
|
}
|
|
101
|
-
let localVarFormParams
|
|
137
|
+
let localVarFormParams;
|
|
102
138
|
// verify required parameter 'themeId' is not null or undefined
|
|
103
139
|
if (themeId === null || themeId === undefined) {
|
|
104
140
|
throw new Error('Required parameter themeId was null or undefined when calling deleteTheme.');
|
|
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: 'DELETE',
|
|
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;
|
|
132
178
|
}
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
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
|
-
});
|
|
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';
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
const response = await fetch(url, requestOptions);
|
|
186
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
155
187
|
}
|
|
156
188
|
/**
|
|
157
189
|
* Get a theme given its unique identifier.
|
|
@@ -162,9 +194,11 @@ class ThemesApi {
|
|
|
162
194
|
const localVarPath = this.basePath + '/api/themes/{themeId}'
|
|
163
195
|
.replace('{' + 'themeId' + '}', encodeURIComponent(String(themeId)));
|
|
164
196
|
let localVarQueryParameters = {};
|
|
165
|
-
let localVarHeaderParams =
|
|
166
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
167
|
-
|
|
197
|
+
let localVarHeaderParams = {
|
|
198
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
199
|
+
'Content-Type': 'application/json',
|
|
200
|
+
...this.defaultHeaders,
|
|
201
|
+
};
|
|
168
202
|
const produces = ['application/json'];
|
|
169
203
|
// give precedence to 'application/json'
|
|
170
204
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -173,60 +207,56 @@ class ThemesApi {
|
|
|
173
207
|
else {
|
|
174
208
|
localVarHeaderParams.Accept = produces.join(',');
|
|
175
209
|
}
|
|
176
|
-
let localVarFormParams
|
|
210
|
+
let localVarFormParams;
|
|
177
211
|
// verify required parameter 'themeId' is not null or undefined
|
|
178
212
|
if (themeId === null || themeId === undefined) {
|
|
179
213
|
throw new Error('Required parameter themeId was null or undefined when calling getTheme.');
|
|
180
214
|
}
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
215
|
+
localVarHeaderParams = {
|
|
216
|
+
...localVarHeaderParams,
|
|
217
|
+
...options.headers,
|
|
218
|
+
...this.opts.extraHeaders,
|
|
219
|
+
};
|
|
220
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
221
|
+
.filter(([, value]) => value !== undefined)
|
|
222
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
223
|
+
.join('&');
|
|
224
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
184
225
|
let localVarRequestOptions = {
|
|
185
226
|
method: 'GET',
|
|
186
|
-
|
|
187
|
-
headers: localVarHeaderParams,
|
|
188
|
-
uri: localVarPath,
|
|
189
|
-
useQuerystring: this._useQuerystring,
|
|
190
|
-
agentOptions: { keepAlive: false },
|
|
191
|
-
json: true,
|
|
227
|
+
headers: { ...localVarHeaderParams },
|
|
192
228
|
};
|
|
193
|
-
let
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
229
|
+
let requestOptions = localVarRequestOptions;
|
|
230
|
+
let url = localVarUrl;
|
|
231
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
232
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
233
|
+
url = auth_ApiKeyAuthentication.url;
|
|
234
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
235
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
236
|
+
url = auth_JWTAuthentication.url;
|
|
237
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
238
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
239
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
240
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
241
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
242
|
+
url = auth_OAuth2.url;
|
|
243
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
244
|
+
requestOptions = authDefault.requestOptions;
|
|
245
|
+
url = authDefault.url;
|
|
246
|
+
if (localVarFormParams) {
|
|
247
|
+
delete requestOptions.headers['Content-Type'];
|
|
248
|
+
if (localVarFormParams instanceof FormData) {
|
|
249
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
250
|
+
requestOptions.body = localVarFormParams;
|
|
207
251
|
}
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
217
|
-
reject(new Error(body.error || errString));
|
|
218
|
-
}
|
|
219
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
220
|
-
resolve(body);
|
|
221
|
-
}
|
|
222
|
-
else {
|
|
223
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
224
|
-
reject(errString);
|
|
225
|
-
}
|
|
226
|
-
}
|
|
227
|
-
});
|
|
228
|
-
});
|
|
229
|
-
});
|
|
252
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
253
|
+
// URL-encoded form
|
|
254
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
255
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
256
|
+
}
|
|
257
|
+
}
|
|
258
|
+
const response = await fetch(url, requestOptions);
|
|
259
|
+
return this.handleResponse(response, 'GetThemeResponse');
|
|
230
260
|
}
|
|
231
261
|
/**
|
|
232
262
|
* Get all available Studio themes.
|
|
@@ -235,9 +265,11 @@ class ThemesApi {
|
|
|
235
265
|
async getThemes(options = { headers: {} }) {
|
|
236
266
|
const localVarPath = this.basePath + '/api/themes';
|
|
237
267
|
let localVarQueryParameters = {};
|
|
238
|
-
let localVarHeaderParams =
|
|
239
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
240
|
-
|
|
268
|
+
let localVarHeaderParams = {
|
|
269
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
270
|
+
'Content-Type': 'application/json',
|
|
271
|
+
...this.defaultHeaders,
|
|
272
|
+
};
|
|
241
273
|
const produces = ['application/json'];
|
|
242
274
|
// give precedence to 'application/json'
|
|
243
275
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -246,56 +278,52 @@ class ThemesApi {
|
|
|
246
278
|
else {
|
|
247
279
|
localVarHeaderParams.Accept = produces.join(',');
|
|
248
280
|
}
|
|
249
|
-
let localVarFormParams
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
281
|
+
let localVarFormParams;
|
|
282
|
+
localVarHeaderParams = {
|
|
283
|
+
...localVarHeaderParams,
|
|
284
|
+
...options.headers,
|
|
285
|
+
...this.opts.extraHeaders,
|
|
286
|
+
};
|
|
287
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
288
|
+
.filter(([, value]) => value !== undefined)
|
|
289
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
290
|
+
.join('&');
|
|
291
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
253
292
|
let localVarRequestOptions = {
|
|
254
293
|
method: 'GET',
|
|
255
|
-
|
|
256
|
-
headers: localVarHeaderParams,
|
|
257
|
-
uri: localVarPath,
|
|
258
|
-
useQuerystring: this._useQuerystring,
|
|
259
|
-
agentOptions: { keepAlive: false },
|
|
260
|
-
json: true,
|
|
294
|
+
headers: { ...localVarHeaderParams },
|
|
261
295
|
};
|
|
262
|
-
let
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
296
|
+
let requestOptions = localVarRequestOptions;
|
|
297
|
+
let url = localVarUrl;
|
|
298
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
299
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
300
|
+
url = auth_ApiKeyAuthentication.url;
|
|
301
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
302
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
303
|
+
url = auth_JWTAuthentication.url;
|
|
304
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
305
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
306
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
307
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
308
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
309
|
+
url = auth_OAuth2.url;
|
|
310
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
311
|
+
requestOptions = authDefault.requestOptions;
|
|
312
|
+
url = authDefault.url;
|
|
313
|
+
if (localVarFormParams) {
|
|
314
|
+
delete requestOptions.headers['Content-Type'];
|
|
315
|
+
if (localVarFormParams instanceof FormData) {
|
|
316
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
317
|
+
requestOptions.body = localVarFormParams;
|
|
276
318
|
}
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
286
|
-
reject(new Error(body.error || errString));
|
|
287
|
-
}
|
|
288
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
289
|
-
resolve(body);
|
|
290
|
-
}
|
|
291
|
-
else {
|
|
292
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
293
|
-
reject(errString);
|
|
294
|
-
}
|
|
295
|
-
}
|
|
296
|
-
});
|
|
297
|
-
});
|
|
298
|
-
});
|
|
319
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
320
|
+
// URL-encoded form
|
|
321
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
322
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
323
|
+
}
|
|
324
|
+
}
|
|
325
|
+
const response = await fetch(url, requestOptions);
|
|
326
|
+
return this.handleResponse(response, 'GetThemesResponse');
|
|
299
327
|
}
|
|
300
328
|
/**
|
|
301
329
|
* Update some or all theme colors.
|
|
@@ -307,9 +335,11 @@ class ThemesApi {
|
|
|
307
335
|
const localVarPath = this.basePath + '/api/themes/{themeId}/colors'
|
|
308
336
|
.replace('{' + 'themeId' + '}', encodeURIComponent(String(themeId)));
|
|
309
337
|
let localVarQueryParameters = {};
|
|
310
|
-
let localVarHeaderParams =
|
|
311
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
312
|
-
|
|
338
|
+
let localVarHeaderParams = {
|
|
339
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
340
|
+
'Content-Type': 'application/json',
|
|
341
|
+
...this.defaultHeaders,
|
|
342
|
+
};
|
|
313
343
|
const produces = ['application/json'];
|
|
314
344
|
// give precedence to 'application/json'
|
|
315
345
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -318,7 +348,7 @@ class ThemesApi {
|
|
|
318
348
|
else {
|
|
319
349
|
localVarHeaderParams.Accept = produces.join(',');
|
|
320
350
|
}
|
|
321
|
-
let localVarFormParams
|
|
351
|
+
let localVarFormParams;
|
|
322
352
|
// verify required parameter 'themeId' is not null or undefined
|
|
323
353
|
if (themeId === null || themeId === undefined) {
|
|
324
354
|
throw new Error('Required parameter themeId was null or undefined when calling updateThemeColors.');
|
|
@@ -327,56 +357,52 @@ class ThemesApi {
|
|
|
327
357
|
if (updateThemeColorsRequest === null || updateThemeColorsRequest === undefined) {
|
|
328
358
|
throw new Error('Required parameter updateThemeColorsRequest was null or undefined when calling updateThemeColors.');
|
|
329
359
|
}
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
360
|
+
localVarHeaderParams = {
|
|
361
|
+
...localVarHeaderParams,
|
|
362
|
+
...options.headers,
|
|
363
|
+
...this.opts.extraHeaders,
|
|
364
|
+
};
|
|
365
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
366
|
+
.filter(([, value]) => value !== undefined)
|
|
367
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
368
|
+
.join('&');
|
|
369
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
333
370
|
let localVarRequestOptions = {
|
|
334
371
|
method: 'POST',
|
|
335
|
-
|
|
336
|
-
headers: localVarHeaderParams,
|
|
337
|
-
uri: localVarPath,
|
|
338
|
-
useQuerystring: this._useQuerystring,
|
|
339
|
-
agentOptions: { keepAlive: false },
|
|
340
|
-
json: true,
|
|
341
|
-
body: models_1.ObjectSerializer.serialize(updateThemeColorsRequest, "UpdateThemeColorsRequest")
|
|
372
|
+
headers: { ...localVarHeaderParams },
|
|
342
373
|
};
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
374
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateThemeColorsRequest, "UpdateThemeColorsRequest"));
|
|
375
|
+
let requestOptions = localVarRequestOptions;
|
|
376
|
+
let url = localVarUrl;
|
|
377
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
378
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
379
|
+
url = auth_ApiKeyAuthentication.url;
|
|
380
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
381
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
382
|
+
url = auth_JWTAuthentication.url;
|
|
383
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
384
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
385
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
386
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
387
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
388
|
+
url = auth_OAuth2.url;
|
|
389
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
390
|
+
requestOptions = authDefault.requestOptions;
|
|
391
|
+
url = authDefault.url;
|
|
392
|
+
if (localVarFormParams) {
|
|
393
|
+
delete requestOptions.headers['Content-Type'];
|
|
394
|
+
if (localVarFormParams instanceof FormData) {
|
|
395
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
396
|
+
requestOptions.body = localVarFormParams;
|
|
357
397
|
}
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
367
|
-
reject(new Error(body.error || errString));
|
|
368
|
-
}
|
|
369
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
370
|
-
resolve(body);
|
|
371
|
-
}
|
|
372
|
-
else {
|
|
373
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
374
|
-
reject(errString);
|
|
375
|
-
}
|
|
376
|
-
}
|
|
377
|
-
});
|
|
378
|
-
});
|
|
379
|
-
});
|
|
398
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
399
|
+
// URL-encoded form
|
|
400
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
401
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
const response = await fetch(url, requestOptions);
|
|
405
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
380
406
|
}
|
|
381
407
|
/**
|
|
382
408
|
* Update the theme favicon
|
|
@@ -388,9 +414,11 @@ class ThemesApi {
|
|
|
388
414
|
const localVarPath = this.basePath + '/api/themes/{themeId}/favicon'
|
|
389
415
|
.replace('{' + 'themeId' + '}', encodeURIComponent(String(themeId)));
|
|
390
416
|
let localVarQueryParameters = {};
|
|
391
|
-
let localVarHeaderParams =
|
|
392
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
393
|
-
|
|
417
|
+
let localVarHeaderParams = {
|
|
418
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
419
|
+
'Content-Type': 'application/json',
|
|
420
|
+
...this.defaultHeaders,
|
|
421
|
+
};
|
|
394
422
|
const produces = ['application/json'];
|
|
395
423
|
// give precedence to 'application/json'
|
|
396
424
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -399,7 +427,7 @@ class ThemesApi {
|
|
|
399
427
|
else {
|
|
400
428
|
localVarHeaderParams.Accept = produces.join(',');
|
|
401
429
|
}
|
|
402
|
-
let localVarFormParams
|
|
430
|
+
let localVarFormParams;
|
|
403
431
|
// verify required parameter 'themeId' is not null or undefined
|
|
404
432
|
if (themeId === null || themeId === undefined) {
|
|
405
433
|
throw new Error('Required parameter themeId was null or undefined when calling updateThemeFavicon.');
|
|
@@ -408,59 +436,69 @@ class ThemesApi {
|
|
|
408
436
|
if (params.image === null || params.image === undefined) {
|
|
409
437
|
throw new Error('Required parameter params.image was null or undefined when calling updateThemeFavicon.');
|
|
410
438
|
}
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
439
|
+
localVarHeaderParams = {
|
|
440
|
+
...localVarHeaderParams,
|
|
441
|
+
...options.headers,
|
|
442
|
+
...this.opts.extraHeaders,
|
|
443
|
+
};
|
|
414
444
|
if (params.image !== undefined) {
|
|
415
|
-
localVarFormParams
|
|
445
|
+
if (!(localVarFormParams instanceof FormData)) {
|
|
446
|
+
const existingParams = localVarFormParams;
|
|
447
|
+
localVarFormParams = new FormData();
|
|
448
|
+
if (existingParams && typeof existingParams === 'object') {
|
|
449
|
+
Object.keys(existingParams).forEach(key => {
|
|
450
|
+
localVarFormParams.append(key, existingParams[key]);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
const imageFiles = Array.isArray(params.image) ? params.image : [params.image];
|
|
455
|
+
const Blob = globalThis.Blob || require('buffer').Blob;
|
|
456
|
+
imageFiles.forEach((f) => {
|
|
457
|
+
localVarFormParams.append('image', new Blob([f.value], {
|
|
458
|
+
type: f.options.contentType
|
|
459
|
+
}), f.options.filename);
|
|
460
|
+
});
|
|
416
461
|
}
|
|
417
|
-
|
|
462
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
463
|
+
.filter(([, value]) => value !== undefined)
|
|
464
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
465
|
+
.join('&');
|
|
466
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
418
467
|
let localVarRequestOptions = {
|
|
419
468
|
method: 'POST',
|
|
420
|
-
|
|
421
|
-
headers: localVarHeaderParams,
|
|
422
|
-
uri: localVarPath,
|
|
423
|
-
useQuerystring: this._useQuerystring,
|
|
424
|
-
agentOptions: { keepAlive: false },
|
|
425
|
-
json: true,
|
|
469
|
+
headers: { ...localVarHeaderParams },
|
|
426
470
|
};
|
|
427
|
-
let
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
471
|
+
let requestOptions = localVarRequestOptions;
|
|
472
|
+
let url = localVarUrl;
|
|
473
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
474
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
475
|
+
url = auth_ApiKeyAuthentication.url;
|
|
476
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
477
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
478
|
+
url = auth_JWTAuthentication.url;
|
|
479
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
480
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
481
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
482
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
483
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
484
|
+
url = auth_OAuth2.url;
|
|
485
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
486
|
+
requestOptions = authDefault.requestOptions;
|
|
487
|
+
url = authDefault.url;
|
|
488
|
+
if (localVarFormParams) {
|
|
489
|
+
delete requestOptions.headers['Content-Type'];
|
|
490
|
+
if (localVarFormParams instanceof FormData) {
|
|
491
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
492
|
+
requestOptions.body = localVarFormParams;
|
|
441
493
|
}
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
451
|
-
reject(new Error(body.error || errString));
|
|
452
|
-
}
|
|
453
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
454
|
-
resolve(body);
|
|
455
|
-
}
|
|
456
|
-
else {
|
|
457
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
458
|
-
reject(errString);
|
|
459
|
-
}
|
|
460
|
-
}
|
|
461
|
-
});
|
|
462
|
-
});
|
|
463
|
-
});
|
|
494
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
495
|
+
// URL-encoded form
|
|
496
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
497
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
498
|
+
}
|
|
499
|
+
}
|
|
500
|
+
const response = await fetch(url, requestOptions);
|
|
501
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
464
502
|
}
|
|
465
503
|
/**
|
|
466
504
|
* Update some or all theme logos.
|
|
@@ -472,9 +510,11 @@ class ThemesApi {
|
|
|
472
510
|
const localVarPath = this.basePath + '/api/themes/{themeId}/logos'
|
|
473
511
|
.replace('{' + 'themeId' + '}', encodeURIComponent(String(themeId)));
|
|
474
512
|
let localVarQueryParameters = {};
|
|
475
|
-
let localVarHeaderParams =
|
|
476
|
-
'User-Agent': 'edgeimpulse-api nodejs'
|
|
477
|
-
|
|
513
|
+
let localVarHeaderParams = {
|
|
514
|
+
'User-Agent': 'edgeimpulse-api nodejs',
|
|
515
|
+
'Content-Type': 'application/json',
|
|
516
|
+
...this.defaultHeaders,
|
|
517
|
+
};
|
|
478
518
|
const produces = ['application/json'];
|
|
479
519
|
// give precedence to 'application/json'
|
|
480
520
|
if (produces.indexOf('application/json') >= 0) {
|
|
@@ -483,7 +523,7 @@ class ThemesApi {
|
|
|
483
523
|
else {
|
|
484
524
|
localVarHeaderParams.Accept = produces.join(',');
|
|
485
525
|
}
|
|
486
|
-
let localVarFormParams
|
|
526
|
+
let localVarFormParams;
|
|
487
527
|
// verify required parameter 'themeId' is not null or undefined
|
|
488
528
|
if (themeId === null || themeId === undefined) {
|
|
489
529
|
throw new Error('Required parameter themeId was null or undefined when calling updateThemeLogos.');
|
|
@@ -492,56 +532,52 @@ class ThemesApi {
|
|
|
492
532
|
if (updateThemeLogosRequest === null || updateThemeLogosRequest === undefined) {
|
|
493
533
|
throw new Error('Required parameter updateThemeLogosRequest was null or undefined when calling updateThemeLogos.');
|
|
494
534
|
}
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
535
|
+
localVarHeaderParams = {
|
|
536
|
+
...localVarHeaderParams,
|
|
537
|
+
...options.headers,
|
|
538
|
+
...this.opts.extraHeaders,
|
|
539
|
+
};
|
|
540
|
+
const queryString = Object.entries(localVarQueryParameters)
|
|
541
|
+
.filter(([, value]) => value !== undefined)
|
|
542
|
+
.map(([key, value]) => `${key}=${encodeURIComponent(String(value))}`)
|
|
543
|
+
.join('&');
|
|
544
|
+
let localVarUrl = localVarPath + (queryString ? `?${queryString}` : '');
|
|
498
545
|
let localVarRequestOptions = {
|
|
499
546
|
method: 'POST',
|
|
500
|
-
|
|
501
|
-
headers: localVarHeaderParams,
|
|
502
|
-
uri: localVarPath,
|
|
503
|
-
useQuerystring: this._useQuerystring,
|
|
504
|
-
agentOptions: { keepAlive: false },
|
|
505
|
-
json: true,
|
|
506
|
-
body: models_1.ObjectSerializer.serialize(updateThemeLogosRequest, "UpdateThemeLogosRequest")
|
|
547
|
+
headers: { ...localVarHeaderParams },
|
|
507
548
|
};
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
|
|
521
|
-
|
|
549
|
+
localVarRequestOptions.body = JSON.stringify(models_1.ObjectSerializer.serialize(updateThemeLogosRequest, "UpdateThemeLogosRequest"));
|
|
550
|
+
let requestOptions = localVarRequestOptions;
|
|
551
|
+
let url = localVarUrl;
|
|
552
|
+
const auth_ApiKeyAuthentication = await this.authentications.ApiKeyAuthentication.applyToRequest(requestOptions, url);
|
|
553
|
+
requestOptions = auth_ApiKeyAuthentication.requestOptions;
|
|
554
|
+
url = auth_ApiKeyAuthentication.url;
|
|
555
|
+
const auth_JWTAuthentication = await this.authentications.JWTAuthentication.applyToRequest(requestOptions, url);
|
|
556
|
+
requestOptions = auth_JWTAuthentication.requestOptions;
|
|
557
|
+
url = auth_JWTAuthentication.url;
|
|
558
|
+
const auth_JWTHttpHeaderAuthentication = await this.authentications.JWTHttpHeaderAuthentication.applyToRequest(requestOptions, url);
|
|
559
|
+
requestOptions = auth_JWTHttpHeaderAuthentication.requestOptions;
|
|
560
|
+
url = auth_JWTHttpHeaderAuthentication.url;
|
|
561
|
+
const auth_OAuth2 = await this.authentications.OAuth2.applyToRequest(requestOptions, url);
|
|
562
|
+
requestOptions = auth_OAuth2.requestOptions;
|
|
563
|
+
url = auth_OAuth2.url;
|
|
564
|
+
const authDefault = await this.authentications.default.applyToRequest(requestOptions, url);
|
|
565
|
+
requestOptions = authDefault.requestOptions;
|
|
566
|
+
url = authDefault.url;
|
|
567
|
+
if (localVarFormParams) {
|
|
568
|
+
delete requestOptions.headers['Content-Type'];
|
|
569
|
+
if (localVarFormParams instanceof FormData) {
|
|
570
|
+
// FormData: fetch will handle Content-Type automatically.
|
|
571
|
+
requestOptions.body = localVarFormParams;
|
|
522
572
|
}
|
|
523
|
-
|
|
524
|
-
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
532
|
-
reject(new Error(body.error || errString));
|
|
533
|
-
}
|
|
534
|
-
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
535
|
-
resolve(body);
|
|
536
|
-
}
|
|
537
|
-
else {
|
|
538
|
-
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
539
|
-
reject(errString);
|
|
540
|
-
}
|
|
541
|
-
}
|
|
542
|
-
});
|
|
543
|
-
});
|
|
544
|
-
});
|
|
573
|
+
else if (Object.keys(localVarFormParams).length > 0) {
|
|
574
|
+
// URL-encoded form
|
|
575
|
+
requestOptions.body = new URLSearchParams(localVarFormParams).toString();
|
|
576
|
+
requestOptions.headers['Content-Type'] = 'application/x-www-form-urlencoded';
|
|
577
|
+
}
|
|
578
|
+
}
|
|
579
|
+
const response = await fetch(url, requestOptions);
|
|
580
|
+
return this.handleResponse(response, 'GenericApiResponse');
|
|
545
581
|
}
|
|
546
582
|
}
|
|
547
583
|
exports.ThemesApi = ThemesApi;
|