@inweb/client 25.6.4 → 25.6.6
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 +49 -20
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +21 -2
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Client.d.ts +5 -5
- package/lib/Api/File.d.ts +1 -1
- package/lib/Api/Job.d.ts +1 -1
- package/lib/Api/User.d.ts +27 -10
- package/package.json +2 -2
- package/src/Api/Client.ts +5 -5
- package/src/Api/File.ts +1 -1
- package/src/Api/Job.ts +1 -1
- package/src/Api/User.ts +46 -11
package/lib/Api/Client.d.ts
CHANGED
|
@@ -127,7 +127,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
127
127
|
/**
|
|
128
128
|
* Change server settings.
|
|
129
129
|
*
|
|
130
|
-
* Only administrators can change server settings
|
|
130
|
+
* Only administrators can change server settings. If the current logged in user is not an
|
|
131
131
|
* administrator, an exception will be thrown.
|
|
132
132
|
*
|
|
133
133
|
* @async
|
|
@@ -136,7 +136,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
136
136
|
/**
|
|
137
137
|
* Returns a list of server users.
|
|
138
138
|
*
|
|
139
|
-
* Only administrators can get a list of users
|
|
139
|
+
* Only administrators can get a list of users. If the current logged in user is not an
|
|
140
140
|
* administrator, an exception will be thrown.
|
|
141
141
|
*
|
|
142
142
|
* @async
|
|
@@ -145,7 +145,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
145
145
|
/**
|
|
146
146
|
* Returns the user information.
|
|
147
147
|
*
|
|
148
|
-
* Only administrators can get other users
|
|
148
|
+
* Only administrators can get other users. If the current logged in user is not an
|
|
149
149
|
* administrator, they can only get themselves, otherwise an exception will be thrown.
|
|
150
150
|
*
|
|
151
151
|
* @async
|
|
@@ -155,7 +155,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
155
155
|
/**
|
|
156
156
|
* Create a new user.
|
|
157
157
|
*
|
|
158
|
-
* Only administrators can create users
|
|
158
|
+
* Only administrators can create users. If the current logged in user is not an
|
|
159
159
|
* administrator, an exception will be thrown.
|
|
160
160
|
*
|
|
161
161
|
* @async
|
|
@@ -184,7 +184,7 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
184
184
|
/**
|
|
185
185
|
* Delete a user from the server.
|
|
186
186
|
*
|
|
187
|
-
* Only administrators can delete users
|
|
187
|
+
* Only administrators can delete users. If the current logged in user is not an
|
|
188
188
|
* administrator, an exception will be thrown.
|
|
189
189
|
*
|
|
190
190
|
* Administrators can delete themselves or other administrators. An administrator can only
|
package/lib/Api/File.d.ts
CHANGED
|
@@ -585,7 +585,7 @@ export declare class File {
|
|
|
585
585
|
* - waitForDone()
|
|
586
586
|
* - Viewer.open()
|
|
587
587
|
*
|
|
588
|
-
* Other clients will still continue to use the
|
|
588
|
+
* Other clients will still continue to use the current active version of the file. Use
|
|
589
589
|
* `undefined` to revert back to the active version.
|
|
590
590
|
*
|
|
591
591
|
* Note. You need to update the file data using [File.checkout()]{@link File#checkout} to
|
package/lib/Api/Job.d.ts
CHANGED
|
@@ -106,7 +106,7 @@ export declare class Job {
|
|
|
106
106
|
/**
|
|
107
107
|
* Update job data on the server.
|
|
108
108
|
*
|
|
109
|
-
* Only administrators can update job data
|
|
109
|
+
* Only administrators can update job data. If the current logged in user is not an
|
|
110
110
|
* administrator, an exception will be thrown.
|
|
111
111
|
*
|
|
112
112
|
* @async
|
package/lib/Api/User.d.ts
CHANGED
|
@@ -20,9 +20,10 @@ export declare class User {
|
|
|
20
20
|
/**
|
|
21
21
|
* `true` if user is allowed to create a project.
|
|
22
22
|
*
|
|
23
|
-
*
|
|
23
|
+
* Only administrators can change create project permission.
|
|
24
24
|
*/
|
|
25
25
|
get canCreateProject(): boolean;
|
|
26
|
+
set canCreateProject(value: boolean);
|
|
26
27
|
/**
|
|
27
28
|
* Account registration time (UTC) in the format specified in
|
|
28
29
|
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
|
@@ -44,10 +45,9 @@ export declare class User {
|
|
|
44
45
|
private set data(value);
|
|
45
46
|
/**
|
|
46
47
|
* User email.
|
|
47
|
-
*
|
|
48
|
-
* @readonly
|
|
49
48
|
*/
|
|
50
49
|
get email(): string;
|
|
50
|
+
set email(value: string);
|
|
51
51
|
/**
|
|
52
52
|
* The user's email confirmation code, or an empty string if the email has already been confirmed.
|
|
53
53
|
*
|
|
@@ -62,6 +62,8 @@ export declare class User {
|
|
|
62
62
|
/**
|
|
63
63
|
* Full name. Returns the user's first and last name. If first name and last names are empty,
|
|
64
64
|
* returns the user name.
|
|
65
|
+
*
|
|
66
|
+
* @readonly
|
|
65
67
|
*/
|
|
66
68
|
get fullName(): string;
|
|
67
69
|
/**
|
|
@@ -73,12 +75,17 @@ export declare class User {
|
|
|
73
75
|
/**
|
|
74
76
|
* User initials. Returns a first letters of the user's first and last names. If first name
|
|
75
77
|
* and last names are empty, returns the first letter of the user name.
|
|
78
|
+
*
|
|
79
|
+
* @readonly
|
|
76
80
|
*/
|
|
77
81
|
get initials(): string;
|
|
78
82
|
/**
|
|
79
83
|
* `true` if user is an administrator.
|
|
84
|
+
*
|
|
85
|
+
* Only administrators can change user type.
|
|
80
86
|
*/
|
|
81
87
|
get isAdmin(): boolean;
|
|
88
|
+
set isAdmin(value: boolean);
|
|
82
89
|
/**
|
|
83
90
|
* `false` if the user has not yet confirmed his email address.
|
|
84
91
|
*
|
|
@@ -103,13 +110,23 @@ export declare class User {
|
|
|
103
110
|
/**
|
|
104
111
|
* The maximum number of projects that a user can create.
|
|
105
112
|
*
|
|
106
|
-
*
|
|
113
|
+
* Only administrators can change projects limit.
|
|
107
114
|
*/
|
|
108
115
|
get projectsLimit(): number;
|
|
116
|
+
set projectsLimit(value: number);
|
|
109
117
|
/**
|
|
110
118
|
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty.
|
|
119
|
+
*
|
|
120
|
+
* @readonly
|
|
111
121
|
*/
|
|
112
122
|
get providerType(): string;
|
|
123
|
+
/**
|
|
124
|
+
* User storage size on the server for uploading files.
|
|
125
|
+
*
|
|
126
|
+
* Only administrators can change storage size.
|
|
127
|
+
*/
|
|
128
|
+
get storageLimit(): number;
|
|
129
|
+
set storageLimit(value: number);
|
|
113
130
|
/**
|
|
114
131
|
* The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
|
|
115
132
|
*
|
|
@@ -124,14 +141,14 @@ export declare class User {
|
|
|
124
141
|
/**
|
|
125
142
|
* Refresh user data.
|
|
126
143
|
*
|
|
127
|
-
* Only administrators can checkout other users
|
|
144
|
+
* Only administrators can checkout other users. If the current logged in user is not an
|
|
128
145
|
* administrator, they can only checkout themselves, otherwise an exception will be thrown.
|
|
129
146
|
*/
|
|
130
147
|
checkout(): Promise<this>;
|
|
131
148
|
/**
|
|
132
149
|
* Update user data on the server.
|
|
133
150
|
*
|
|
134
|
-
* Only administrators can update other users
|
|
151
|
+
* Only administrators can update other users. If the current logged in user is not an
|
|
135
152
|
* administrator, they can only update themself, otherwise an exception will be thrown.
|
|
136
153
|
*
|
|
137
154
|
* @async
|
|
@@ -141,7 +158,7 @@ export declare class User {
|
|
|
141
158
|
/**
|
|
142
159
|
* Delete a user from the server.
|
|
143
160
|
*
|
|
144
|
-
* Only administrators can delete users
|
|
161
|
+
* Only administrators can delete users. If the current logged in user is not an
|
|
145
162
|
* administrator, an exception will be thrown.
|
|
146
163
|
*
|
|
147
164
|
* Administrators can delete themselves or other administrators. An administrator can only
|
|
@@ -163,7 +180,7 @@ export declare class User {
|
|
|
163
180
|
/**
|
|
164
181
|
* Set or remove the user avatar.
|
|
165
182
|
*
|
|
166
|
-
* Only administrators can set the avatar of other users
|
|
183
|
+
* Only administrators can set the avatar of other users. If the current logged in user is
|
|
167
184
|
* not an administrator, they can only set their avatar, otherwise an exception will be thrown.
|
|
168
185
|
*
|
|
169
186
|
* @async
|
|
@@ -179,7 +196,7 @@ export declare class User {
|
|
|
179
196
|
/**
|
|
180
197
|
* Remove the user avatar.
|
|
181
198
|
*
|
|
182
|
-
* Only administrators can remove the avatar of other users
|
|
199
|
+
* Only administrators can remove the avatar of other users. If the current logged in user is
|
|
183
200
|
* not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
|
|
184
201
|
*
|
|
185
202
|
* @async
|
|
@@ -188,7 +205,7 @@ export declare class User {
|
|
|
188
205
|
/**
|
|
189
206
|
* Change the user password.
|
|
190
207
|
*
|
|
191
|
-
* Only administrators can change the passwords of other users
|
|
208
|
+
* Only administrators can change the passwords of other users. If the current logged in user
|
|
192
209
|
* is not an administrator, they can only change their password, otherwise an exception will
|
|
193
210
|
* be thrown.
|
|
194
211
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.6.
|
|
3
|
+
"version": "25.6.6",
|
|
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.6.
|
|
29
|
+
"@inweb/eventemitter2": "~25.6.6"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Api/Client.ts
CHANGED
|
@@ -271,7 +271,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
271
271
|
/**
|
|
272
272
|
* Change server settings.
|
|
273
273
|
*
|
|
274
|
-
* Only administrators can change server settings
|
|
274
|
+
* Only administrators can change server settings. If the current logged in user is not an
|
|
275
275
|
* administrator, an exception will be thrown.
|
|
276
276
|
*
|
|
277
277
|
* @async
|
|
@@ -283,7 +283,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
283
283
|
/**
|
|
284
284
|
* Returns a list of server users.
|
|
285
285
|
*
|
|
286
|
-
* Only administrators can get a list of users
|
|
286
|
+
* Only administrators can get a list of users. If the current logged in user is not an
|
|
287
287
|
* administrator, an exception will be thrown.
|
|
288
288
|
*
|
|
289
289
|
* @async
|
|
@@ -299,7 +299,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
299
299
|
/**
|
|
300
300
|
* Returns the user information.
|
|
301
301
|
*
|
|
302
|
-
* Only administrators can get other users
|
|
302
|
+
* Only administrators can get other users. If the current logged in user is not an
|
|
303
303
|
* administrator, they can only get themselves, otherwise an exception will be thrown.
|
|
304
304
|
*
|
|
305
305
|
* @async
|
|
@@ -326,7 +326,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
326
326
|
/**
|
|
327
327
|
* Create a new user.
|
|
328
328
|
*
|
|
329
|
-
* Only administrators can create users
|
|
329
|
+
* Only administrators can create users. If the current logged in user is not an
|
|
330
330
|
* administrator, an exception will be thrown.
|
|
331
331
|
*
|
|
332
332
|
* @async
|
|
@@ -375,7 +375,7 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
375
375
|
/**
|
|
376
376
|
* Delete a user from the server.
|
|
377
377
|
*
|
|
378
|
-
* Only administrators can delete users
|
|
378
|
+
* Only administrators can delete users. If the current logged in user is not an
|
|
379
379
|
* administrator, an exception will be thrown.
|
|
380
380
|
*
|
|
381
381
|
* Administrators can delete themselves or other administrators. An administrator can only
|
package/src/Api/File.ts
CHANGED
|
@@ -969,7 +969,7 @@ export class File {
|
|
|
969
969
|
* - waitForDone()
|
|
970
970
|
* - Viewer.open()
|
|
971
971
|
*
|
|
972
|
-
* Other clients will still continue to use the
|
|
972
|
+
* Other clients will still continue to use the current active version of the file. Use
|
|
973
973
|
* `undefined` to revert back to the active version.
|
|
974
974
|
*
|
|
975
975
|
* Note. You need to update the file data using [File.checkout()]{@link File#checkout} to
|
package/src/Api/Job.ts
CHANGED
|
@@ -192,7 +192,7 @@ export class Job {
|
|
|
192
192
|
/**
|
|
193
193
|
* Update job data on the server.
|
|
194
194
|
*
|
|
195
|
-
* Only administrators can update job data
|
|
195
|
+
* Only administrators can update job data. If the current logged in user is not an
|
|
196
196
|
* administrator, an exception will be thrown.
|
|
197
197
|
*
|
|
198
198
|
* @async
|
package/src/Api/User.ts
CHANGED
|
@@ -54,12 +54,16 @@ export class User {
|
|
|
54
54
|
/**
|
|
55
55
|
* `true` if user is allowed to create a project.
|
|
56
56
|
*
|
|
57
|
-
*
|
|
57
|
+
* Only administrators can change create project permission.
|
|
58
58
|
*/
|
|
59
59
|
get canCreateProject(): boolean {
|
|
60
60
|
return this.data.canCreateProject;
|
|
61
61
|
}
|
|
62
62
|
|
|
63
|
+
set canCreateProject(value: boolean) {
|
|
64
|
+
this._data.canCreateProject = value;
|
|
65
|
+
}
|
|
66
|
+
|
|
63
67
|
/**
|
|
64
68
|
* Account registration time (UTC) in the format specified in
|
|
65
69
|
* {@link https://www.wikipedia.org/wiki/ISO_8601 | ISO 8601}.
|
|
@@ -102,13 +106,15 @@ export class User {
|
|
|
102
106
|
|
|
103
107
|
/**
|
|
104
108
|
* User email.
|
|
105
|
-
*
|
|
106
|
-
* @readonly
|
|
107
109
|
*/
|
|
108
110
|
get email(): string {
|
|
109
111
|
return this.data.email;
|
|
110
112
|
}
|
|
111
113
|
|
|
114
|
+
set email(value: string) {
|
|
115
|
+
this._data.email = value;
|
|
116
|
+
}
|
|
117
|
+
|
|
112
118
|
/**
|
|
113
119
|
* The user's email confirmation code, or an empty string if the email has already been confirmed.
|
|
114
120
|
*
|
|
@@ -132,6 +138,8 @@ export class User {
|
|
|
132
138
|
/**
|
|
133
139
|
* Full name. Returns the user's first and last name. If first name and last names are empty,
|
|
134
140
|
* returns the user name.
|
|
141
|
+
*
|
|
142
|
+
* @readonly
|
|
135
143
|
*/
|
|
136
144
|
get fullName(): string {
|
|
137
145
|
return this.data.fullName;
|
|
@@ -149,6 +157,8 @@ export class User {
|
|
|
149
157
|
/**
|
|
150
158
|
* User initials. Returns a first letters of the user's first and last names. If first name
|
|
151
159
|
* and last names are empty, returns the first letter of the user name.
|
|
160
|
+
*
|
|
161
|
+
* @readonly
|
|
152
162
|
*/
|
|
153
163
|
get initials(): string {
|
|
154
164
|
return this.data.initials;
|
|
@@ -156,11 +166,17 @@ export class User {
|
|
|
156
166
|
|
|
157
167
|
/**
|
|
158
168
|
* `true` if user is an administrator.
|
|
169
|
+
*
|
|
170
|
+
* Only administrators can change user type.
|
|
159
171
|
*/
|
|
160
172
|
get isAdmin(): boolean {
|
|
161
173
|
return this.data.isAdmin;
|
|
162
174
|
}
|
|
163
175
|
|
|
176
|
+
set isAdmin(value: boolean) {
|
|
177
|
+
this._data.isAdmin = value;
|
|
178
|
+
}
|
|
179
|
+
|
|
164
180
|
/**
|
|
165
181
|
* `false` if the user has not yet confirmed his email address.
|
|
166
182
|
*
|
|
@@ -200,19 +216,38 @@ export class User {
|
|
|
200
216
|
/**
|
|
201
217
|
* The maximum number of projects that a user can create.
|
|
202
218
|
*
|
|
203
|
-
*
|
|
219
|
+
* Only administrators can change projects limit.
|
|
204
220
|
*/
|
|
205
221
|
get projectsLimit(): number {
|
|
206
222
|
return this.data.projectsLimit;
|
|
207
223
|
}
|
|
208
224
|
|
|
225
|
+
set projectsLimit(value: number) {
|
|
226
|
+
this._data.projectsLimit = value;
|
|
227
|
+
}
|
|
228
|
+
|
|
209
229
|
/**
|
|
210
230
|
* The identity provider used to create the account. Can be `ldap`, `oauth`, `saml` or empty.
|
|
231
|
+
*
|
|
232
|
+
* @readonly
|
|
211
233
|
*/
|
|
212
234
|
get providerType(): string {
|
|
213
235
|
return this.data.providerType;
|
|
214
236
|
}
|
|
215
237
|
|
|
238
|
+
/**
|
|
239
|
+
* User storage size on the server for uploading files.
|
|
240
|
+
*
|
|
241
|
+
* Only administrators can change storage size.
|
|
242
|
+
*/
|
|
243
|
+
get storageLimit(): number {
|
|
244
|
+
return this.data.storageLimit;
|
|
245
|
+
}
|
|
246
|
+
|
|
247
|
+
set storageLimit(value: number) {
|
|
248
|
+
this._data.storageLimit = value;
|
|
249
|
+
}
|
|
250
|
+
|
|
216
251
|
/**
|
|
217
252
|
* The user's access token (API key). Use {@link Client.signInWithToken()} to log in using token.
|
|
218
253
|
*
|
|
@@ -236,7 +271,7 @@ export class User {
|
|
|
236
271
|
/**
|
|
237
272
|
* Refresh user data.
|
|
238
273
|
*
|
|
239
|
-
* Only administrators can checkout other users
|
|
274
|
+
* Only administrators can checkout other users. If the current logged in user is not an
|
|
240
275
|
* administrator, they can only checkout themselves, otherwise an exception will be thrown.
|
|
241
276
|
*/
|
|
242
277
|
async checkout(): Promise<this> {
|
|
@@ -257,7 +292,7 @@ export class User {
|
|
|
257
292
|
/**
|
|
258
293
|
* Update user data on the server.
|
|
259
294
|
*
|
|
260
|
-
* Only administrators can update other users
|
|
295
|
+
* Only administrators can update other users. If the current logged in user is not an
|
|
261
296
|
* administrator, they can only update themself, otherwise an exception will be thrown.
|
|
262
297
|
*
|
|
263
298
|
* @async
|
|
@@ -265,7 +300,7 @@ export class User {
|
|
|
265
300
|
*/
|
|
266
301
|
async update(data: any): Promise<this> {
|
|
267
302
|
if (this.httpClient.signInUserIsAdmin) {
|
|
268
|
-
const response = await this.httpClient.put(`/users/${this.id}`, { userBrief: data });
|
|
303
|
+
const response = await this.httpClient.put(`/users/${this.id}`, { isAdmin: data.isAdmin, userBrief: data });
|
|
269
304
|
const newData = await response.json();
|
|
270
305
|
this.data = { id: newData.id, ...newData.userBrief };
|
|
271
306
|
} else if (this.id === this.httpClient.signInUserId) {
|
|
@@ -281,7 +316,7 @@ export class User {
|
|
|
281
316
|
/**
|
|
282
317
|
* Delete a user from the server.
|
|
283
318
|
*
|
|
284
|
-
* Only administrators can delete users
|
|
319
|
+
* Only administrators can delete users. If the current logged in user is not an
|
|
285
320
|
* administrator, an exception will be thrown.
|
|
286
321
|
*
|
|
287
322
|
* Administrators can delete themselves or other administrators. An administrator can only
|
|
@@ -323,7 +358,7 @@ export class User {
|
|
|
323
358
|
/**
|
|
324
359
|
* Set or remove the user avatar.
|
|
325
360
|
*
|
|
326
|
-
* Only administrators can set the avatar of other users
|
|
361
|
+
* Only administrators can set the avatar of other users. If the current logged in user is
|
|
327
362
|
* not an administrator, they can only set their avatar, otherwise an exception will be thrown.
|
|
328
363
|
*
|
|
329
364
|
* @async
|
|
@@ -355,7 +390,7 @@ export class User {
|
|
|
355
390
|
/**
|
|
356
391
|
* Remove the user avatar.
|
|
357
392
|
*
|
|
358
|
-
* Only administrators can remove the avatar of other users
|
|
393
|
+
* Only administrators can remove the avatar of other users. If the current logged in user is
|
|
359
394
|
* not an administrator, they can only remove their avatar, otherwise an exception will be thrown.
|
|
360
395
|
*
|
|
361
396
|
* @async
|
|
@@ -378,7 +413,7 @@ export class User {
|
|
|
378
413
|
/**
|
|
379
414
|
* Change the user password.
|
|
380
415
|
*
|
|
381
|
-
* Only administrators can change the passwords of other users
|
|
416
|
+
* Only administrators can change the passwords of other users. If the current logged in user
|
|
382
417
|
* is not an administrator, they can only change their password, otherwise an exception will
|
|
383
418
|
* be thrown.
|
|
384
419
|
*
|