@inweb/client 25.4.10 → 25.4.11
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/dist/client.js +51 -86
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +5 -15
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Client.d.ts +15 -37
- package/lib/Api/Job.d.ts +2 -5
- package/lib/Api/Model.d.ts +8 -2
- package/lib/Api/User.d.ts +17 -26
- package/package.json +2 -2
- package/src/Api/Client.ts +25 -53
- package/src/Api/FetchError.ts +0 -1
- package/src/Api/Job.ts +2 -5
- package/src/Api/Model.ts +8 -2
- package/src/Api/User.ts +17 -29
package/lib/Api/Client.d.ts
CHANGED
|
@@ -99,13 +99,6 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
99
99
|
* @param token - An access token for authentication request. See {@link User.token} for more details.
|
|
100
100
|
*/
|
|
101
101
|
signInWithToken(token: string): Promise<User>;
|
|
102
|
-
private setCurrentUser;
|
|
103
|
-
private clearCurrentUser;
|
|
104
|
-
/**
|
|
105
|
-
* Returns the current logged in user information. Returns `null` if the user is not logged
|
|
106
|
-
* in or the logged in user has deleted himself.
|
|
107
|
-
*/
|
|
108
|
-
getCurrentUser(): User | null;
|
|
109
102
|
/**
|
|
110
103
|
* Get the list of server indentity providers.
|
|
111
104
|
*
|
|
@@ -118,45 +111,32 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
118
111
|
* @async
|
|
119
112
|
*/
|
|
120
113
|
getIdentityProviders(): Promise<any>;
|
|
114
|
+
private setCurrentUser;
|
|
115
|
+
private clearCurrentUser;
|
|
121
116
|
/**
|
|
122
|
-
* Returns the current
|
|
123
|
-
*
|
|
124
|
-
* @async
|
|
125
|
-
*/
|
|
126
|
-
getServerSettings(): Promise<any>;
|
|
127
|
-
/**
|
|
128
|
-
* Change server settings.
|
|
129
|
-
*
|
|
130
|
-
* Only admins can change server settings, if the current logged in user does not have
|
|
131
|
-
* administrator rights, an exception will be thrown.
|
|
132
|
-
*
|
|
133
|
-
* @async
|
|
117
|
+
* Returns the current logged in user information. Returns `null` if the user is not logged
|
|
118
|
+
* in or the logged in user has deleted himself.
|
|
134
119
|
*/
|
|
135
|
-
|
|
120
|
+
getCurrentUser(): User | null;
|
|
136
121
|
/**
|
|
137
|
-
* Returns a list of server users.
|
|
138
|
-
*
|
|
139
|
-
* Only admins can get a list of users, if the current logged in user does not have
|
|
140
|
-
* administrator rights, an exception will be thrown.
|
|
122
|
+
* Returns a list of server users. Only admins can get a list of users, if the current logged
|
|
123
|
+
* in user does not have administrator rights, an exception will be thrown.
|
|
141
124
|
*
|
|
142
125
|
* @async
|
|
143
126
|
*/
|
|
144
127
|
getUsers(): Promise<User[]>;
|
|
145
128
|
/**
|
|
146
|
-
* Returns the user information.
|
|
147
|
-
*
|
|
148
|
-
*
|
|
149
|
-
* rights, hi can only get himself, otherwise an exception will be thrown.
|
|
129
|
+
* Returns the user information. Only admins can get other users, if the current logged in
|
|
130
|
+
* user does not have administrator rights, hi can only get himself, otherwise an exception
|
|
131
|
+
* will be thrown.
|
|
150
132
|
*
|
|
151
133
|
* @async
|
|
152
134
|
* @param userId - User ID.
|
|
153
135
|
*/
|
|
154
136
|
getUser(userId: string): Promise<User>;
|
|
155
137
|
/**
|
|
156
|
-
* Create a new user.
|
|
157
|
-
*
|
|
158
|
-
* Only admins can create users, if the current logged in user does not have administrator
|
|
159
|
-
* rights, an exception will be thrown.
|
|
138
|
+
* Create a new user. Only admins can create users, if the current logged in user does not
|
|
139
|
+
* have administrator rights, an exception will be thrown.
|
|
160
140
|
*
|
|
161
141
|
* @async
|
|
162
142
|
* @param email - User email. Cannot be empty.
|
|
@@ -170,7 +150,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
170
150
|
* @param params.lastName - Last name.
|
|
171
151
|
* @param params.canCreateProject - `true` if user is allowed to create a project.
|
|
172
152
|
* @param params.projectsLimit - The maximum number of projects that the user can create.
|
|
173
|
-
* @param params.storageLimit - The size of the file storage available to the user
|
|
153
|
+
* @param params.storageLimit - The size of the file storage available to the user.
|
|
174
154
|
*/
|
|
175
155
|
createUser(email: string, password: string, params?: {
|
|
176
156
|
isAdmin?: boolean;
|
|
@@ -182,10 +162,8 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
182
162
|
storageLimit?: number;
|
|
183
163
|
}): Promise<User>;
|
|
184
164
|
/**
|
|
185
|
-
* Delete a user from the server.
|
|
186
|
-
*
|
|
187
|
-
* Only admins can delete users, if the current logged in user does not have administrator
|
|
188
|
-
* rights, an exception will be thrown.
|
|
165
|
+
* Delete a user from the server. Only admins can delete users, if the current logged in user
|
|
166
|
+
* does not have administrator rights, an exception will be thrown.
|
|
189
167
|
*
|
|
190
168
|
* Admins can delete themselves or other admins. An admin can only delete himself if he is
|
|
191
169
|
* not the last administrator.
|
package/lib/Api/Job.d.ts
CHANGED
|
@@ -67,7 +67,7 @@ export declare class Job {
|
|
|
67
67
|
get lastUpdate(): string;
|
|
68
68
|
/**
|
|
69
69
|
* Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,
|
|
70
|
-
* `obj`, `gltf`, `glb`, `vsf`, `pdf
|
|
70
|
+
* `obj`, `gltf`, `glb`, `vsf`, `pdf` or `3dpdf`.
|
|
71
71
|
*
|
|
72
72
|
* @readonly
|
|
73
73
|
*/
|
|
@@ -104,10 +104,7 @@ export declare class Job {
|
|
|
104
104
|
*/
|
|
105
105
|
checkout(): Promise<this>;
|
|
106
106
|
/**
|
|
107
|
-
* Update job data on the server.
|
|
108
|
-
*
|
|
109
|
-
* Only admins can update job data, if the current logged in user does not have administrator
|
|
110
|
-
* rights, an exception will be thrown.
|
|
107
|
+
* Update job data on the server. Only admins can update job data.
|
|
111
108
|
*
|
|
112
109
|
* @async
|
|
113
110
|
* @param data - Raw job data.
|
package/lib/Api/Model.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
import
|
|
3
|
-
import
|
|
2
|
+
import { File } from "./File";
|
|
3
|
+
import { Assembly } from "./Assembly";
|
|
4
4
|
/**
|
|
5
5
|
* The class representing the is a description of view of the file or assembly. For example,
|
|
6
6
|
* for `dwg` it is a `Model` space or layout, and for `rvt` files it is a `3D` view.
|
|
@@ -103,12 +103,16 @@ export declare class Model {
|
|
|
103
103
|
/**
|
|
104
104
|
* Returns model viewpoint list.
|
|
105
105
|
*
|
|
106
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
107
|
+
*
|
|
106
108
|
* @async
|
|
107
109
|
*/
|
|
108
110
|
getViewpoints(): Promise<any[]>;
|
|
109
111
|
/**
|
|
110
112
|
* Add new model viewpoint. To create a new viewpoint use `Viewer.createViewpoint()`.
|
|
111
113
|
*
|
|
114
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
115
|
+
*
|
|
112
116
|
* @async
|
|
113
117
|
* @param viewpoint - Viewpoint.
|
|
114
118
|
*/
|
|
@@ -116,6 +120,8 @@ export declare class Model {
|
|
|
116
120
|
/**
|
|
117
121
|
* Delete model viewpoint.
|
|
118
122
|
*
|
|
123
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
124
|
+
*
|
|
119
125
|
* @async
|
|
120
126
|
* @param guid - Viewpoint GUID.
|
|
121
127
|
* @returns Returns the raw data of a deleted viewpoint.
|
package/lib/Api/User.d.ts
CHANGED
|
@@ -23,8 +23,8 @@ export declare class User {
|
|
|
23
23
|
*/
|
|
24
24
|
get canCreateProject(): boolean;
|
|
25
25
|
/**
|
|
26
|
-
*
|
|
27
|
-
*
|
|
26
|
+
* User account registration time (UTC) in the format specified in <a
|
|
27
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
28
28
|
*
|
|
29
29
|
* @readonly
|
|
30
30
|
*/
|
|
@@ -85,8 +85,8 @@ export declare class User {
|
|
|
85
85
|
*/
|
|
86
86
|
get isEmailConfirmed(): boolean;
|
|
87
87
|
/**
|
|
88
|
-
* User last update time (UTC) in the format specified in
|
|
89
|
-
*
|
|
88
|
+
* User last update time (UTC) in the format specified in <a
|
|
89
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
90
90
|
*/
|
|
91
91
|
get lastModified(): string;
|
|
92
92
|
/**
|
|
@@ -95,8 +95,8 @@ export declare class User {
|
|
|
95
95
|
get lastName(): string;
|
|
96
96
|
set lastName(value: string);
|
|
97
97
|
/**
|
|
98
|
-
* User last sign in time (UTC) in the format specified in
|
|
99
|
-
*
|
|
98
|
+
* User last sign in time (UTC) in the format specified in <a
|
|
99
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
100
100
|
*/
|
|
101
101
|
get lastSignIn(): string;
|
|
102
102
|
/**
|
|
@@ -105,10 +105,6 @@ export declare class User {
|
|
|
105
105
|
* @readonly
|
|
106
106
|
*/
|
|
107
107
|
get projectsLimit(): number;
|
|
108
|
-
/**
|
|
109
|
-
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty.
|
|
110
|
-
*/
|
|
111
|
-
get providerType(): string;
|
|
112
108
|
/**
|
|
113
109
|
* The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
|
|
114
110
|
*
|
|
@@ -121,27 +117,23 @@ export declare class User {
|
|
|
121
117
|
get userName(): string;
|
|
122
118
|
set userName(value: string);
|
|
123
119
|
/**
|
|
124
|
-
* Refresh user data.
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* administrator rights, hi can only checkout himself, otherwise an exception will be thrown.
|
|
120
|
+
* Refresh user data. Only admins can checkout other users, if the current logged in user
|
|
121
|
+
* does not have administrator rights, hi can only checkout himself, otherwise an exception
|
|
122
|
+
* will be thrown.
|
|
128
123
|
*/
|
|
129
124
|
checkout(): Promise<this>;
|
|
130
125
|
/**
|
|
131
|
-
* Update user data on the server.
|
|
132
|
-
*
|
|
133
|
-
*
|
|
134
|
-
* administrator rights, hi can only update himself, otherwise an exception will be thrown.
|
|
126
|
+
* Update user data on the server. Only admins can update other users, if the current logged
|
|
127
|
+
* in user does not have administrator rights, hi can only update himself, otherwise an
|
|
128
|
+
* exception will be thrown.
|
|
135
129
|
*
|
|
136
130
|
* @async
|
|
137
131
|
* @param data - Raw user data.
|
|
138
132
|
*/
|
|
139
133
|
update(data: any): Promise<this>;
|
|
140
134
|
/**
|
|
141
|
-
* Delete a user from the server.
|
|
142
|
-
*
|
|
143
|
-
* Only admins can delete users, if the current logged in user does not have administrator
|
|
144
|
-
* rights, an exception will be thrown.
|
|
135
|
+
* Delete a user from the server. Only admins can delete users, if the current logged in user
|
|
136
|
+
* does not have administrator rights, an exception will be thrown.
|
|
145
137
|
*
|
|
146
138
|
* Admins can delete themselves or other admins. An admin can only delete himself if he is
|
|
147
139
|
* not the last administrator.
|
|
@@ -160,10 +152,9 @@ export declare class User {
|
|
|
160
152
|
*/
|
|
161
153
|
save(): Promise<this>;
|
|
162
154
|
/**
|
|
163
|
-
* Set or remove the user avatar.
|
|
164
|
-
*
|
|
165
|
-
*
|
|
166
|
-
* administrator rights, he can only set his own avatar, otherwise an exception will be thrown.
|
|
155
|
+
* Set or remove the user avatar. Only admins can set the avatar of other users, if the
|
|
156
|
+
* current logged in user does not have administrator rights, he can only set his own avatar,
|
|
157
|
+
* otherwise an exception will be thrown.
|
|
167
158
|
*
|
|
168
159
|
* @async
|
|
169
160
|
* @param image - Avatar image. Can be a <a
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.4.
|
|
3
|
+
"version": "25.4.11",
|
|
4
4
|
"description": "JavaScript REST API client for the Open Cloud Server",
|
|
5
5
|
"homepage": "https://cloud.opendesign.com/docs/index.html",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE",
|
|
@@ -26,6 +26,6 @@
|
|
|
26
26
|
"ts-docs": "typedoc"
|
|
27
27
|
},
|
|
28
28
|
"dependencies": {
|
|
29
|
-
"@inweb/eventemitter2": "~25.4.
|
|
29
|
+
"@inweb/eventemitter2": "~25.4.7"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Api/Client.ts
CHANGED
|
@@ -217,6 +217,21 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
217
217
|
return this.setCurrentUser(data);
|
|
218
218
|
}
|
|
219
219
|
|
|
220
|
+
/**
|
|
221
|
+
* Get the list of server indentity providers.
|
|
222
|
+
*
|
|
223
|
+
* To sign in with the provider in your web application:
|
|
224
|
+
*
|
|
225
|
+
* - Open the `provider.url` link using `window.open()`.
|
|
226
|
+
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
227
|
+
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
228
|
+
*
|
|
229
|
+
* @async
|
|
230
|
+
*/
|
|
231
|
+
getIdentityProviders(): Promise<any> {
|
|
232
|
+
return this.httpClient.get("/identity").then((response) => response.json());
|
|
233
|
+
}
|
|
234
|
+
|
|
220
235
|
// Save the current logged in user information for internal use.
|
|
221
236
|
|
|
222
237
|
private setCurrentUser(data: any): User {
|
|
@@ -242,46 +257,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
242
257
|
}
|
|
243
258
|
|
|
244
259
|
/**
|
|
245
|
-
*
|
|
246
|
-
*
|
|
247
|
-
* To sign in with the provider in your web application:
|
|
248
|
-
*
|
|
249
|
-
* - Open the `provider.url` link using `window.open()`.
|
|
250
|
-
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
251
|
-
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
252
|
-
*
|
|
253
|
-
* @async
|
|
254
|
-
*/
|
|
255
|
-
getIdentityProviders(): Promise<any> {
|
|
256
|
-
return this.httpClient.get("/identity").then((response) => response.json());
|
|
257
|
-
}
|
|
258
|
-
|
|
259
|
-
/**
|
|
260
|
-
* Returns the current server settings.
|
|
261
|
-
*
|
|
262
|
-
* @async
|
|
263
|
-
*/
|
|
264
|
-
getServerSettings(): Promise<any> {
|
|
265
|
-
return this.httpClient.get("/settings").then((response) => response.json());
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
/**
|
|
269
|
-
* Change server settings.
|
|
270
|
-
*
|
|
271
|
-
* Only admins can change server settings, if the current logged in user does not have
|
|
272
|
-
* administrator rights, an exception will be thrown.
|
|
273
|
-
*
|
|
274
|
-
* @async
|
|
275
|
-
*/
|
|
276
|
-
updateServerSettings(settings: any): Promise<any> {
|
|
277
|
-
return this.httpClient.put("/settings", settings).then((response) => response.json());
|
|
278
|
-
}
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Returns a list of server users.
|
|
282
|
-
*
|
|
283
|
-
* Only admins can get a list of users, if the current logged in user does not have
|
|
284
|
-
* administrator rights, an exception will be thrown.
|
|
260
|
+
* Returns a list of server users. Only admins can get a list of users, if the current logged
|
|
261
|
+
* in user does not have administrator rights, an exception will be thrown.
|
|
285
262
|
*
|
|
286
263
|
* @async
|
|
287
264
|
*/
|
|
@@ -294,10 +271,9 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
294
271
|
}
|
|
295
272
|
|
|
296
273
|
/**
|
|
297
|
-
* Returns the user information.
|
|
298
|
-
*
|
|
299
|
-
*
|
|
300
|
-
* rights, hi can only get himself, otherwise an exception will be thrown.
|
|
274
|
+
* Returns the user information. Only admins can get other users, if the current logged in
|
|
275
|
+
* user does not have administrator rights, hi can only get himself, otherwise an exception
|
|
276
|
+
* will be thrown.
|
|
301
277
|
*
|
|
302
278
|
* @async
|
|
303
279
|
* @param userId - User ID.
|
|
@@ -319,10 +295,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
319
295
|
}
|
|
320
296
|
|
|
321
297
|
/**
|
|
322
|
-
* Create a new user.
|
|
323
|
-
*
|
|
324
|
-
* Only admins can create users, if the current logged in user does not have administrator
|
|
325
|
-
* rights, an exception will be thrown.
|
|
298
|
+
* Create a new user. Only admins can create users, if the current logged in user does not
|
|
299
|
+
* have administrator rights, an exception will be thrown.
|
|
326
300
|
*
|
|
327
301
|
* @async
|
|
328
302
|
* @param email - User email. Cannot be empty.
|
|
@@ -336,7 +310,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
336
310
|
* @param params.lastName - Last name.
|
|
337
311
|
* @param params.canCreateProject - `true` if user is allowed to create a project.
|
|
338
312
|
* @param params.projectsLimit - The maximum number of projects that the user can create.
|
|
339
|
-
* @param params.storageLimit - The size of the file storage available to the user
|
|
313
|
+
* @param params.storageLimit - The size of the file storage available to the user.
|
|
340
314
|
*/
|
|
341
315
|
createUser(
|
|
342
316
|
email: string,
|
|
@@ -368,10 +342,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
368
342
|
}
|
|
369
343
|
|
|
370
344
|
/**
|
|
371
|
-
* Delete a user from the server.
|
|
372
|
-
*
|
|
373
|
-
* Only admins can delete users, if the current logged in user does not have administrator
|
|
374
|
-
* rights, an exception will be thrown.
|
|
345
|
+
* Delete a user from the server. Only admins can delete users, if the current logged in user
|
|
346
|
+
* does not have administrator rights, an exception will be thrown.
|
|
375
347
|
*
|
|
376
348
|
* Admins can delete themselves or other admins. An admin can only delete himself if he is
|
|
377
349
|
* not the last administrator.
|
package/src/Api/FetchError.ts
CHANGED
package/src/Api/Job.ts
CHANGED
|
@@ -133,7 +133,7 @@ export class Job {
|
|
|
133
133
|
|
|
134
134
|
/**
|
|
135
135
|
* Job type. Can be `properties`, `geomerty`, `geomertyGltf`, `validation`, `clash`, `dwg`,
|
|
136
|
-
* `obj`, `gltf`, `glb`, `vsf`, `pdf
|
|
136
|
+
* `obj`, `gltf`, `glb`, `vsf`, `pdf` or `3dpdf`.
|
|
137
137
|
*
|
|
138
138
|
* @readonly
|
|
139
139
|
*/
|
|
@@ -190,10 +190,7 @@ export class Job {
|
|
|
190
190
|
}
|
|
191
191
|
|
|
192
192
|
/**
|
|
193
|
-
* Update job data on the server.
|
|
194
|
-
*
|
|
195
|
-
* Only admins can update job data, if the current logged in user does not have administrator
|
|
196
|
-
* rights, an exception will be thrown.
|
|
193
|
+
* Update job data on the server. Only admins can update job data.
|
|
197
194
|
*
|
|
198
195
|
* @async
|
|
199
196
|
* @param data - Raw job data.
|
package/src/Api/Model.ts
CHANGED
|
@@ -22,8 +22,8 @@
|
|
|
22
22
|
///////////////////////////////////////////////////////////////////////////////
|
|
23
23
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
|
-
import
|
|
26
|
-
import
|
|
25
|
+
import { File } from "./File";
|
|
26
|
+
import { Assembly } from "./Assembly";
|
|
27
27
|
|
|
28
28
|
/**
|
|
29
29
|
* The class representing the is a description of view of the file or assembly. For example,
|
|
@@ -180,6 +180,8 @@ export class Model {
|
|
|
180
180
|
/**
|
|
181
181
|
* Returns model viewpoint list.
|
|
182
182
|
*
|
|
183
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
184
|
+
*
|
|
183
185
|
* @async
|
|
184
186
|
*/
|
|
185
187
|
getViewpoints(): Promise<any[]> {
|
|
@@ -195,6 +197,8 @@ export class Model {
|
|
|
195
197
|
/**
|
|
196
198
|
* Add new model viewpoint. To create a new viewpoint use `Viewer.createViewpoint()`.
|
|
197
199
|
*
|
|
200
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
201
|
+
*
|
|
198
202
|
* @async
|
|
199
203
|
* @param viewpoint - Viewpoint.
|
|
200
204
|
*/
|
|
@@ -208,6 +212,8 @@ export class Model {
|
|
|
208
212
|
/**
|
|
209
213
|
* Delete model viewpoint.
|
|
210
214
|
*
|
|
215
|
+
* _**Note**: Assemblу models do not support viewpoints_.
|
|
216
|
+
*
|
|
211
217
|
* @async
|
|
212
218
|
* @param guid - Viewpoint GUID.
|
|
213
219
|
* @returns Returns the raw data of a deleted viewpoint.
|
package/src/Api/User.ts
CHANGED
|
@@ -59,8 +59,8 @@ export class User {
|
|
|
59
59
|
}
|
|
60
60
|
|
|
61
61
|
/**
|
|
62
|
-
*
|
|
63
|
-
*
|
|
62
|
+
* User account registration time (UTC) in the format specified in <a
|
|
63
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
64
64
|
*
|
|
65
65
|
* @readonly
|
|
66
66
|
*/
|
|
@@ -167,8 +167,8 @@ export class User {
|
|
|
167
167
|
}
|
|
168
168
|
|
|
169
169
|
/**
|
|
170
|
-
* User last update time (UTC) in the format specified in
|
|
171
|
-
*
|
|
170
|
+
* User last update time (UTC) in the format specified in <a
|
|
171
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
172
172
|
*/
|
|
173
173
|
get lastModified(): string {
|
|
174
174
|
return this.data.lastModified;
|
|
@@ -186,8 +186,8 @@ export class User {
|
|
|
186
186
|
}
|
|
187
187
|
|
|
188
188
|
/**
|
|
189
|
-
* User last sign in time (UTC) in the format specified in
|
|
190
|
-
*
|
|
189
|
+
* User last sign in time (UTC) in the format specified in <a
|
|
190
|
+
* href="https://www.wikipedia.org/wiki/ISO_8601" target="_blank">ISO 8601</a>.
|
|
191
191
|
*/
|
|
192
192
|
get lastSignIn(): string {
|
|
193
193
|
return this.data.lastSignIn;
|
|
@@ -202,13 +202,6 @@ export class User {
|
|
|
202
202
|
return this.data.projectsLimit;
|
|
203
203
|
}
|
|
204
204
|
|
|
205
|
-
/**
|
|
206
|
-
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty.
|
|
207
|
-
*/
|
|
208
|
-
get providerType(): string {
|
|
209
|
-
return this.data.providerType;
|
|
210
|
-
}
|
|
211
|
-
|
|
212
205
|
/**
|
|
213
206
|
* The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
|
|
214
207
|
*
|
|
@@ -230,10 +223,9 @@ export class User {
|
|
|
230
223
|
}
|
|
231
224
|
|
|
232
225
|
/**
|
|
233
|
-
* Refresh user data.
|
|
234
|
-
*
|
|
235
|
-
*
|
|
236
|
-
* administrator rights, hi can only checkout himself, otherwise an exception will be thrown.
|
|
226
|
+
* Refresh user data. Only admins can checkout other users, if the current logged in user
|
|
227
|
+
* does not have administrator rights, hi can only checkout himself, otherwise an exception
|
|
228
|
+
* will be thrown.
|
|
237
229
|
*/
|
|
238
230
|
async checkout(): Promise<this> {
|
|
239
231
|
if (this.id === this.httpClient.signInUserId) {
|
|
@@ -249,10 +241,9 @@ export class User {
|
|
|
249
241
|
}
|
|
250
242
|
|
|
251
243
|
/**
|
|
252
|
-
* Update user data on the server.
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
* administrator rights, hi can only update himself, otherwise an exception will be thrown.
|
|
244
|
+
* Update user data on the server. Only admins can update other users, if the current logged
|
|
245
|
+
* in user does not have administrator rights, hi can only update himself, otherwise an
|
|
246
|
+
* exception will be thrown.
|
|
256
247
|
*
|
|
257
248
|
* @async
|
|
258
249
|
* @param data - Raw user data.
|
|
@@ -271,10 +262,8 @@ export class User {
|
|
|
271
262
|
}
|
|
272
263
|
|
|
273
264
|
/**
|
|
274
|
-
* Delete a user from the server.
|
|
275
|
-
*
|
|
276
|
-
* Only admins can delete users, if the current logged in user does not have administrator
|
|
277
|
-
* rights, an exception will be thrown.
|
|
265
|
+
* Delete a user from the server. Only admins can delete users, if the current logged in user
|
|
266
|
+
* does not have administrator rights, an exception will be thrown.
|
|
278
267
|
*
|
|
279
268
|
* Admins can delete themselves or other admins. An admin can only delete himself if he is
|
|
280
269
|
* not the last administrator.
|
|
@@ -308,10 +297,9 @@ export class User {
|
|
|
308
297
|
}
|
|
309
298
|
|
|
310
299
|
/**
|
|
311
|
-
* Set or remove the user avatar.
|
|
312
|
-
*
|
|
313
|
-
*
|
|
314
|
-
* administrator rights, he can only set his own avatar, otherwise an exception will be thrown.
|
|
300
|
+
* Set or remove the user avatar. Only admins can set the avatar of other users, if the
|
|
301
|
+
* current logged in user does not have administrator rights, he can only set his own avatar,
|
|
302
|
+
* otherwise an exception will be thrown.
|
|
315
303
|
*
|
|
316
304
|
* @async
|
|
317
305
|
* @param image - Avatar image. Can be a <a
|