@inweb/client 25.4.3 → 25.4.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 +53 -19
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +10 -12
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +33 -1
- package/lib/Api/Client.d.ts +2 -0
- package/lib/Api/File.d.ts +2 -3
- package/lib/Api/Model.d.ts +2 -3
- package/lib/Api/User.d.ts +4 -30
- package/package.json +2 -2
- package/src/Api/Assembly.ts +40 -13
- package/src/Api/Client.ts +2 -0
- package/src/Api/File.ts +2 -3
- package/src/Api/Model.ts +2 -3
- package/src/Api/User.ts +7 -37
package/lib/Api/Assembly.d.ts
CHANGED
|
@@ -211,10 +211,42 @@ export declare class Assembly {
|
|
|
211
211
|
* @async
|
|
212
212
|
*/
|
|
213
213
|
getCdaTree(): Promise<any[]>;
|
|
214
|
-
|
|
214
|
+
/**
|
|
215
|
+
* Returns a list of assembly viewpoints.
|
|
216
|
+
*
|
|
217
|
+
* @async
|
|
218
|
+
*/
|
|
219
|
+
getViewpoints(): Promise<any[]>;
|
|
220
|
+
/**
|
|
221
|
+
* Add new assembly viewpoint. To create a new viewpoint use {@link Viewer.createViewpoint()}.
|
|
222
|
+
*
|
|
223
|
+
* @async
|
|
224
|
+
* @param viewpoint - Viewpoint.
|
|
225
|
+
*/
|
|
215
226
|
saveViewpoint(viewpoint: any): Promise<any>;
|
|
227
|
+
/**
|
|
228
|
+
* Delete assembly viewpoint.
|
|
229
|
+
*
|
|
230
|
+
* @async
|
|
231
|
+
* @param guid - Viewpoint GUID.
|
|
232
|
+
* @returns Returns the raw data of a deleted viewpoint.
|
|
233
|
+
*/
|
|
216
234
|
deleteViewpoint(guid: any): Promise<any>;
|
|
235
|
+
/**
|
|
236
|
+
* Returns viewpoint preview image as
|
|
237
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
238
|
+
*
|
|
239
|
+
* @async
|
|
240
|
+
* @param guid - Viewpoint GUID.
|
|
241
|
+
*/
|
|
217
242
|
getSnapshot(guid: any): Promise<any>;
|
|
243
|
+
/**
|
|
244
|
+
* Returns viewpoint preview data.
|
|
245
|
+
*
|
|
246
|
+
* @async
|
|
247
|
+
* @param guid - Viewpoint GUID.
|
|
248
|
+
* @param bitmapGuid - Bitmap GUID.
|
|
249
|
+
*/
|
|
218
250
|
getSnapshotData(guid: any, bitmapGuid: any): Promise<string>;
|
|
219
251
|
/**
|
|
220
252
|
* Download assembly resource file. Resource files are files that contain model scene
|
package/lib/Api/Client.d.ts
CHANGED
|
@@ -107,6 +107,8 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
107
107
|
* - Open the `provider.url` link using `window.open()`.
|
|
108
108
|
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
109
109
|
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
110
|
+
*
|
|
111
|
+
* @async
|
|
110
112
|
*/
|
|
111
113
|
getIdentityProviders(): Promise<any>;
|
|
112
114
|
private setCurrentUser;
|
package/lib/Api/File.d.ts
CHANGED
|
@@ -304,9 +304,8 @@ export declare class File {
|
|
|
304
304
|
*/
|
|
305
305
|
deleteViewpoint(guid: string): Promise<any>;
|
|
306
306
|
/**
|
|
307
|
-
* Returns viewpoint preview image as
|
|
308
|
-
*
|
|
309
|
-
* target="_blank">Data URL</a>.
|
|
307
|
+
* Returns viewpoint preview image as
|
|
308
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
310
309
|
*
|
|
311
310
|
* @async
|
|
312
311
|
* @param guid - Viewpoint GUID.
|
package/lib/Api/Model.d.ts
CHANGED
|
@@ -128,9 +128,8 @@ export declare class Model {
|
|
|
128
128
|
*/
|
|
129
129
|
deleteViewpoint(guid: string): Promise<any>;
|
|
130
130
|
/**
|
|
131
|
-
* Returns viewpoint preview image as
|
|
132
|
-
*
|
|
133
|
-
* target="_blank">Data URL</a>.
|
|
131
|
+
* Returns viewpoint preview image as
|
|
132
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
134
133
|
*
|
|
135
134
|
* @async
|
|
136
135
|
* @param guid - Viewpoint GIID.
|
package/lib/Api/User.d.ts
CHANGED
|
@@ -1,34 +1,4 @@
|
|
|
1
1
|
import { IHttpClient } from "./IHttpClient";
|
|
2
|
-
export interface UserParams {
|
|
3
|
-
/**
|
|
4
|
-
* `true` if user is an administrator
|
|
5
|
-
*/
|
|
6
|
-
isAdmin?: boolean;
|
|
7
|
-
/**
|
|
8
|
-
* User name
|
|
9
|
-
*/
|
|
10
|
-
userName?: string;
|
|
11
|
-
/**
|
|
12
|
-
* First name
|
|
13
|
-
*/
|
|
14
|
-
firstName?: string;
|
|
15
|
-
/**
|
|
16
|
-
* Last name
|
|
17
|
-
*/
|
|
18
|
-
lastName?: string;
|
|
19
|
-
/**
|
|
20
|
-
* `true` if user is allowed to create a project
|
|
21
|
-
*/
|
|
22
|
-
canCreateProject?: boolean;
|
|
23
|
-
/**
|
|
24
|
-
* The maximum number of projects that the user can create
|
|
25
|
-
*/
|
|
26
|
-
projectsLimit?: number;
|
|
27
|
-
/**
|
|
28
|
-
* The size of the file storage available to the user
|
|
29
|
-
*/
|
|
30
|
-
storageLimit?: number;
|
|
31
|
-
}
|
|
32
2
|
/**
|
|
33
3
|
* The class representing a `user` entity.
|
|
34
4
|
*/
|
|
@@ -104,6 +74,10 @@ export declare class User {
|
|
|
104
74
|
* and last names are empty, returns the first letter of the user name.
|
|
105
75
|
*/
|
|
106
76
|
get initials(): string;
|
|
77
|
+
/**
|
|
78
|
+
* `true` if user is has an administrator rights.
|
|
79
|
+
*/
|
|
80
|
+
get isAdmin(): boolean;
|
|
107
81
|
/**
|
|
108
82
|
* `false` if the user has not yet confirmed his email address.
|
|
109
83
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.4.
|
|
3
|
+
"version": "25.4.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.4.
|
|
29
|
+
"@inweb/eventemitter2": "~25.4.6"
|
|
30
30
|
}
|
|
31
31
|
}
|
package/src/Api/Assembly.ts
CHANGED
|
@@ -378,31 +378,58 @@ export class Assembly {
|
|
|
378
378
|
return this.internalGet(`/properties/tree`).then((response) => response.json());
|
|
379
379
|
}
|
|
380
380
|
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
381
|
+
/**
|
|
382
|
+
* Returns a list of assembly viewpoints.
|
|
383
|
+
*
|
|
384
|
+
* @async
|
|
385
|
+
*/
|
|
386
|
+
getViewpoints(): Promise<any[]> {
|
|
387
|
+
return this.internalGet("/viewpoints")
|
|
388
|
+
.then((response) => response.json())
|
|
389
|
+
.then((viewpoints) => viewpoints.result);
|
|
386
390
|
}
|
|
387
391
|
|
|
392
|
+
/**
|
|
393
|
+
* Add new assembly viewpoint. To create a new viewpoint use {@link Viewer.createViewpoint()}.
|
|
394
|
+
*
|
|
395
|
+
* @async
|
|
396
|
+
* @param viewpoint - Viewpoint.
|
|
397
|
+
*/
|
|
388
398
|
saveViewpoint(viewpoint: any): Promise<any> {
|
|
389
|
-
|
|
390
|
-
return Promise.resolve({});
|
|
399
|
+
return this.internalPost("/viewpoints", viewpoint).then((response) => response.json());
|
|
391
400
|
}
|
|
392
401
|
|
|
402
|
+
/**
|
|
403
|
+
* Delete assembly viewpoint.
|
|
404
|
+
*
|
|
405
|
+
* @async
|
|
406
|
+
* @param guid - Viewpoint GUID.
|
|
407
|
+
* @returns Returns the raw data of a deleted viewpoint.
|
|
408
|
+
*/
|
|
393
409
|
deleteViewpoint(guid: any): Promise<any> {
|
|
394
|
-
|
|
395
|
-
return Promise.resolve({});
|
|
410
|
+
return this.internalDelete(`/viewpoints/${guid}`).then((response) => response.json());
|
|
396
411
|
}
|
|
397
412
|
|
|
413
|
+
/**
|
|
414
|
+
* Returns viewpoint preview image as
|
|
415
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
416
|
+
*
|
|
417
|
+
* @async
|
|
418
|
+
* @param guid - Viewpoint GUID.
|
|
419
|
+
*/
|
|
398
420
|
getSnapshot(guid: any): Promise<any> {
|
|
399
|
-
|
|
400
|
-
return Promise.resolve({});
|
|
421
|
+
return this.internalGet(`/viewpoints/${guid}/snapshot`).then((response) => response.text());
|
|
401
422
|
}
|
|
402
423
|
|
|
424
|
+
/**
|
|
425
|
+
* Returns viewpoint preview data.
|
|
426
|
+
*
|
|
427
|
+
* @async
|
|
428
|
+
* @param guid - Viewpoint GUID.
|
|
429
|
+
* @param bitmapGuid - Bitmap GUID.
|
|
430
|
+
*/
|
|
403
431
|
getSnapshotData(guid: any, bitmapGuid: any): Promise<string> {
|
|
404
|
-
|
|
405
|
-
return Promise.resolve("");
|
|
432
|
+
return this.internalGet(`/viewpoints/${guid}/bitmaps/${bitmapGuid}`).then((response) => response.text());
|
|
406
433
|
}
|
|
407
434
|
|
|
408
435
|
/**
|
package/src/Api/Client.ts
CHANGED
|
@@ -225,6 +225,8 @@ export class Client extends EventEmitter2<ClientEventMap> {
|
|
|
225
225
|
* - Open the `provider.url` link using `window.open()`.
|
|
226
226
|
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
227
227
|
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
228
|
+
*
|
|
229
|
+
* @async
|
|
228
230
|
*/
|
|
229
231
|
getIdentityProviders(): Promise<any> {
|
|
230
232
|
return this.httpClient.get("/identity").then((response) => response.json());
|
package/src/Api/File.ts
CHANGED
|
@@ -506,9 +506,8 @@ export class File {
|
|
|
506
506
|
}
|
|
507
507
|
|
|
508
508
|
/**
|
|
509
|
-
* Returns viewpoint preview image as
|
|
510
|
-
*
|
|
511
|
-
* target="_blank">Data URL</a>.
|
|
509
|
+
* Returns viewpoint preview image as
|
|
510
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
512
511
|
*
|
|
513
512
|
* @async
|
|
514
513
|
* @param guid - Viewpoint GUID.
|
package/src/Api/Model.ts
CHANGED
|
@@ -223,9 +223,8 @@ export class Model {
|
|
|
223
223
|
}
|
|
224
224
|
|
|
225
225
|
/**
|
|
226
|
-
* Returns viewpoint preview image as
|
|
227
|
-
*
|
|
228
|
-
* target="_blank">Data URL</a>.
|
|
226
|
+
* Returns viewpoint preview image as
|
|
227
|
+
* {@link https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs | Data URL}.
|
|
229
228
|
*
|
|
230
229
|
* @async
|
|
231
230
|
* @param guid - Viewpoint GIID.
|
package/src/Api/User.ts
CHANGED
|
@@ -24,43 +24,6 @@
|
|
|
24
24
|
import { IHttpClient } from "./IHttpClient";
|
|
25
25
|
import { userFullName, userInitials } from "./Utils";
|
|
26
26
|
|
|
27
|
-
export interface UserParams {
|
|
28
|
-
/**
|
|
29
|
-
* `true` if user is an administrator
|
|
30
|
-
*/
|
|
31
|
-
isAdmin?: boolean;
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* User name
|
|
35
|
-
*/
|
|
36
|
-
userName?: string;
|
|
37
|
-
|
|
38
|
-
/**
|
|
39
|
-
* First name
|
|
40
|
-
*/
|
|
41
|
-
firstName?: string;
|
|
42
|
-
|
|
43
|
-
/**
|
|
44
|
-
* Last name
|
|
45
|
-
*/
|
|
46
|
-
lastName?: string;
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* `true` if user is allowed to create a project
|
|
50
|
-
*/
|
|
51
|
-
canCreateProject?: boolean;
|
|
52
|
-
|
|
53
|
-
/**
|
|
54
|
-
* The maximum number of projects that the user can create
|
|
55
|
-
*/
|
|
56
|
-
projectsLimit?: number;
|
|
57
|
-
|
|
58
|
-
/**
|
|
59
|
-
* The size of the file storage available to the user
|
|
60
|
-
*/
|
|
61
|
-
storageLimit?: number;
|
|
62
|
-
}
|
|
63
|
-
|
|
64
27
|
/**
|
|
65
28
|
* The class representing a `user` entity.
|
|
66
29
|
*/
|
|
@@ -187,6 +150,13 @@ export class User {
|
|
|
187
150
|
return this.data.initials;
|
|
188
151
|
}
|
|
189
152
|
|
|
153
|
+
/**
|
|
154
|
+
* `true` if user is has an administrator rights.
|
|
155
|
+
*/
|
|
156
|
+
get isAdmin(): boolean {
|
|
157
|
+
return this.data.isAdmin;
|
|
158
|
+
}
|
|
159
|
+
|
|
190
160
|
/**
|
|
191
161
|
* `false` if the user has not yet confirmed his email address.
|
|
192
162
|
*
|