edge-impulse-api 1.60.12 → 1.60.13
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/userApi.d.ts +16 -1
- package/build/library/sdk/api/userApi.js +72 -1
- package/build/library/sdk/api/userApi.js.map +1 -1
- package/build/library/sdk/model/getUserProjectsResponse.d.ts +34 -0
- package/build/library/sdk/model/getUserProjectsResponse.js +39 -0
- package/build/library/sdk/model/getUserProjectsResponse.js.map +1 -0
- package/build/library/sdk/model/getUserProjectsResponseAllOf.d.ts +26 -0
- package/build/library/sdk/model/getUserProjectsResponseAllOf.js +29 -0
- package/build/library/sdk/model/getUserProjectsResponseAllOf.js.map +1 -0
- package/build/library/sdk/model/getUserResponse.d.ts +9 -0
- package/build/library/sdk/model/getUserResponse.js +10 -0
- package/build/library/sdk/model/getUserResponse.js.map +1 -1
- package/build/library/sdk/model/getUserResponseAllOf.d.ts +9 -0
- package/build/library/sdk/model/getUserResponseAllOf.js +10 -0
- package/build/library/sdk/model/getUserResponseAllOf.js.map +1 -1
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjects.d.ts +30 -0
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjects.js +37 -0
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjects.js.map +1 -0
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjectsProjects.d.ts +28 -0
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjectsProjects.js +44 -0
- package/build/library/sdk/model/getUserResponseAllOfLastAccessedProjectsProjects.js.map +1 -0
- package/build/library/sdk/model/models.d.ts +4 -0
- package/build/library/sdk/model/models.js +12 -0
- package/build/library/sdk/model/models.js.map +1 -1
- package/package.json +1 -1
|
@@ -26,6 +26,7 @@ import { EnterpriseUpgradeOrTrialExtensionRequest } from '../model/enterpriseUpg
|
|
|
26
26
|
import { GenericApiResponse } from '../model/genericApiResponse';
|
|
27
27
|
import { GetJWTResponse } from '../model/getJWTResponse';
|
|
28
28
|
import { GetUserNeedToSetPasswordResponse } from '../model/getUserNeedToSetPasswordResponse';
|
|
29
|
+
import { GetUserProjectsResponse } from '../model/getUserProjectsResponse';
|
|
29
30
|
import { GetUserResponse } from '../model/getUserResponse';
|
|
30
31
|
import { ListEmailResponse } from '../model/listEmailResponse';
|
|
31
32
|
import { ListEnterpriseTrialsResponse } from '../model/listEnterpriseTrialsResponse';
|
|
@@ -55,6 +56,9 @@ export declare enum UserApiApiKeys {
|
|
|
55
56
|
JWTAuthentication = 1,
|
|
56
57
|
JWTHttpHeaderAuthentication = 2
|
|
57
58
|
}
|
|
59
|
+
type getCurrentUserQueryParams = {
|
|
60
|
+
excludeProjects?: boolean;
|
|
61
|
+
};
|
|
58
62
|
export type uploadPhotoCurrentUserFormParams = {
|
|
59
63
|
photo: RequestFile;
|
|
60
64
|
};
|
|
@@ -237,12 +241,22 @@ export declare class UserApi {
|
|
|
237
241
|
/**
|
|
238
242
|
* Get information about the current user. This function is only available through a JWT token.
|
|
239
243
|
* @summary Get current user
|
|
244
|
+
* @param excludeProjects If set to \"true\", the \"projects\" field is left empty (will be faster if you call this function a lot). Use `getCurrentUserProjects` to get the project list in a separate call.
|
|
240
245
|
*/
|
|
241
|
-
getCurrentUser(options?: {
|
|
246
|
+
getCurrentUser(queryParams?: getCurrentUserQueryParams, options?: {
|
|
242
247
|
headers: {
|
|
243
248
|
[name: string]: string;
|
|
244
249
|
};
|
|
245
250
|
}): Promise<GetUserResponse>;
|
|
251
|
+
/**
|
|
252
|
+
* Get projects for the current user. This returns all projects regardless of whitelabel. This function is only available through a JWT token.
|
|
253
|
+
* @summary Get current user projects
|
|
254
|
+
*/
|
|
255
|
+
getCurrentUserProjects(options?: {
|
|
256
|
+
headers: {
|
|
257
|
+
[name: string]: string;
|
|
258
|
+
};
|
|
259
|
+
}): Promise<GetUserProjectsResponse>;
|
|
246
260
|
/**
|
|
247
261
|
* Get information about a user. This function is only available through a JWT token.
|
|
248
262
|
* @summary Get user
|
|
@@ -552,3 +566,4 @@ export declare class UserApi {
|
|
|
552
566
|
};
|
|
553
567
|
}): Promise<GenericApiResponse>;
|
|
554
568
|
}
|
|
569
|
+
export {};
|
|
@@ -1154,8 +1154,9 @@ class UserApi {
|
|
|
1154
1154
|
/**
|
|
1155
1155
|
* Get information about the current user. This function is only available through a JWT token.
|
|
1156
1156
|
* @summary Get current user
|
|
1157
|
+
* @param excludeProjects If set to \"true\", the \"projects\" field is left empty (will be faster if you call this function a lot). Use `getCurrentUserProjects` to get the project list in a separate call.
|
|
1157
1158
|
*/
|
|
1158
|
-
async getCurrentUser(options = { headers: {} }) {
|
|
1159
|
+
async getCurrentUser(queryParams, options = { headers: {} }) {
|
|
1159
1160
|
const localVarPath = this.basePath + '/api/user';
|
|
1160
1161
|
let localVarQueryParameters = {};
|
|
1161
1162
|
let localVarHeaderParams = Object.assign({
|
|
@@ -1170,6 +1171,9 @@ class UserApi {
|
|
|
1170
1171
|
localVarHeaderParams.Accept = produces.join(',');
|
|
1171
1172
|
}
|
|
1172
1173
|
let localVarFormParams = {};
|
|
1174
|
+
if ((queryParams === null || queryParams === void 0 ? void 0 : queryParams.excludeProjects) !== undefined) {
|
|
1175
|
+
localVarQueryParameters['excludeProjects'] = models_1.ObjectSerializer.serialize(queryParams.excludeProjects, "boolean");
|
|
1176
|
+
}
|
|
1173
1177
|
Object.assign(localVarHeaderParams, options.headers);
|
|
1174
1178
|
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
1175
1179
|
let localVarUseFormData = false;
|
|
@@ -1218,6 +1222,73 @@ class UserApi {
|
|
|
1218
1222
|
});
|
|
1219
1223
|
});
|
|
1220
1224
|
}
|
|
1225
|
+
/**
|
|
1226
|
+
* Get projects for the current user. This returns all projects regardless of whitelabel. This function is only available through a JWT token.
|
|
1227
|
+
* @summary Get current user projects
|
|
1228
|
+
*/
|
|
1229
|
+
async getCurrentUserProjects(options = { headers: {} }) {
|
|
1230
|
+
const localVarPath = this.basePath + '/api/user/projects';
|
|
1231
|
+
let localVarQueryParameters = {};
|
|
1232
|
+
let localVarHeaderParams = Object.assign({
|
|
1233
|
+
'User-Agent': 'edgeimpulse-api nodejs'
|
|
1234
|
+
}, this.defaultHeaders);
|
|
1235
|
+
const produces = ['application/json'];
|
|
1236
|
+
// give precedence to 'application/json'
|
|
1237
|
+
if (produces.indexOf('application/json') >= 0) {
|
|
1238
|
+
localVarHeaderParams.Accept = 'application/json';
|
|
1239
|
+
}
|
|
1240
|
+
else {
|
|
1241
|
+
localVarHeaderParams.Accept = produces.join(',');
|
|
1242
|
+
}
|
|
1243
|
+
let localVarFormParams = {};
|
|
1244
|
+
Object.assign(localVarHeaderParams, options.headers);
|
|
1245
|
+
Object.assign(localVarHeaderParams, this.opts.extraHeaders);
|
|
1246
|
+
let localVarUseFormData = false;
|
|
1247
|
+
let localVarRequestOptions = {
|
|
1248
|
+
method: 'GET',
|
|
1249
|
+
qs: localVarQueryParameters,
|
|
1250
|
+
headers: localVarHeaderParams,
|
|
1251
|
+
uri: localVarPath,
|
|
1252
|
+
useQuerystring: this._useQuerystring,
|
|
1253
|
+
agentOptions: { keepAlive: false },
|
|
1254
|
+
json: true,
|
|
1255
|
+
};
|
|
1256
|
+
let authenticationPromise = Promise.resolve();
|
|
1257
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.ApiKeyAuthentication.applyToRequest(localVarRequestOptions));
|
|
1258
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTAuthentication.applyToRequest(localVarRequestOptions));
|
|
1259
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.JWTHttpHeaderAuthentication.applyToRequest(localVarRequestOptions));
|
|
1260
|
+
authenticationPromise = authenticationPromise.then(() => this.authentications.default.applyToRequest(localVarRequestOptions));
|
|
1261
|
+
return authenticationPromise.then(() => {
|
|
1262
|
+
if (Object.keys(localVarFormParams).length) {
|
|
1263
|
+
if (localVarUseFormData) {
|
|
1264
|
+
localVarRequestOptions.formData = localVarFormParams;
|
|
1265
|
+
}
|
|
1266
|
+
else {
|
|
1267
|
+
localVarRequestOptions.form = localVarFormParams;
|
|
1268
|
+
}
|
|
1269
|
+
}
|
|
1270
|
+
return new Promise((resolve, reject) => {
|
|
1271
|
+
localVarRequest(localVarRequestOptions, (error, response, body) => {
|
|
1272
|
+
if (error) {
|
|
1273
|
+
reject(error);
|
|
1274
|
+
}
|
|
1275
|
+
else {
|
|
1276
|
+
body = models_1.ObjectSerializer.deserialize(body, "GetUserProjectsResponse");
|
|
1277
|
+
const errString = `Failed to call "${localVarPath}", returned ${response.statusCode}: ` + response.body;
|
|
1278
|
+
if (typeof body.success === 'boolean' && !body.success) {
|
|
1279
|
+
reject(new Error(body.error || errString));
|
|
1280
|
+
}
|
|
1281
|
+
else if (response.statusCode && response.statusCode >= 200 && response.statusCode <= 299) {
|
|
1282
|
+
resolve(body);
|
|
1283
|
+
}
|
|
1284
|
+
else {
|
|
1285
|
+
reject(errString);
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
});
|
|
1289
|
+
});
|
|
1290
|
+
});
|
|
1291
|
+
}
|
|
1221
1292
|
/**
|
|
1222
1293
|
* Get information about a user. This function is only available through a JWT token.
|
|
1223
1294
|
* @summary Get user
|