@inweb/client 25.4.2 → 25.4.4
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 +107 -77
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +62 -67
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +33 -1
- package/lib/Api/ClashTest.d.ts +2 -2
- package/lib/Api/Client.d.ts +4 -1
- package/lib/Api/File.d.ts +2 -3
- package/lib/Api/Job.d.ts +1 -1
- package/lib/Api/Member.d.ts +2 -2
- package/lib/Api/Model.d.ts +2 -3
- package/lib/Api/Permission.d.ts +2 -2
- package/lib/Api/Project.d.ts +1 -1
- package/lib/Api/Role.d.ts +2 -2
- package/lib/Api/User.d.ts +1 -1
- package/lib/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/Api/Assembly.ts +40 -13
- package/src/Api/ClashTest.ts +2 -2
- package/src/Api/Client.ts +59 -57
- package/src/Api/Fetch.ts +2 -2
- package/src/Api/File.ts +2 -3
- package/src/Api/HttpClient.ts +3 -3
- package/src/Api/Job.ts +1 -1
- package/src/Api/Member.ts +2 -2
- package/src/Api/Model.ts +2 -3
- package/src/Api/Permission.ts +2 -2
- package/src/Api/Project.ts +1 -1
- package/src/Api/Role.ts +2 -2
- package/src/Api/User.ts +1 -1
- package/src/index.ts +1 -0
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/ClashTest.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { IShortUserDescription } from "./IUser";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class ClashTest {
|
|
7
7
|
private _data;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
basePath: string;
|
|
9
|
+
httpClient: IHttpClient;
|
|
10
10
|
/**
|
|
11
11
|
* @param data - Raw test data.
|
|
12
12
|
* @param basePath - Clash tests API base path for the owner file/assembly.
|
package/lib/Api/Client.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { EventEmitter2 } from "@inweb/eventemitter2";
|
|
2
|
+
import { IHttpClient } from "./IHttpClient";
|
|
2
3
|
import { ClientEventMap } from "./ClientEvents";
|
|
3
4
|
import { Assembly } from "./Assembly";
|
|
4
5
|
import { File } from "./File";
|
|
@@ -12,7 +13,7 @@ import { User } from "./User";
|
|
|
12
13
|
*/
|
|
13
14
|
export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
14
15
|
private _serverUrl;
|
|
15
|
-
|
|
16
|
+
httpClient: IHttpClient;
|
|
16
17
|
private _user;
|
|
17
18
|
eventEmitter: EventEmitter2;
|
|
18
19
|
/**
|
|
@@ -106,6 +107,8 @@ export declare class Client extends EventEmitter2<ClientEventMap> {
|
|
|
106
107
|
* - Open the `provider.url` link using `window.open()`.
|
|
107
108
|
* - Add a `/oauth` path (server-defined) handler to the router. In this handler, show an error
|
|
108
109
|
* message if the `error` search parameter is present, or log in with the `token` search parameter.
|
|
110
|
+
*
|
|
111
|
+
* @async
|
|
109
112
|
*/
|
|
110
113
|
getIdentityProviders(): Promise<any>;
|
|
111
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/Job.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { IHttpClient } from "./IHttpClient";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Job {
|
|
7
7
|
private _data;
|
|
8
|
-
|
|
8
|
+
httpClient: IHttpClient;
|
|
9
9
|
/**
|
|
10
10
|
* @param data - An object that implements job data storage.
|
|
11
11
|
* @param httpClient - Http client.
|
package/lib/Api/Member.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { IShortUserDescription } from "./IUser";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Member {
|
|
7
7
|
private _data;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
projectId: string;
|
|
9
|
+
httpClient: IHttpClient;
|
|
10
10
|
/**
|
|
11
11
|
* @param data - An object that implements member data storage.
|
|
12
12
|
* @param projectId - Owner project ID.
|
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/Permission.d.ts
CHANGED
|
@@ -5,8 +5,8 @@ import { IHttpClient } from "./IHttpClient";
|
|
|
5
5
|
*/
|
|
6
6
|
export declare class Permission {
|
|
7
7
|
private _data;
|
|
8
|
-
|
|
9
|
-
|
|
8
|
+
fileId: string;
|
|
9
|
+
httpClient: IHttpClient;
|
|
10
10
|
/**
|
|
11
11
|
* @param data - An object that implements permission data storage.
|
|
12
12
|
* @param fileId - Owner file ID.
|
package/lib/Api/Project.d.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { Member } from "./Member";
|
|
|
7
7
|
*/
|
|
8
8
|
export declare class Project {
|
|
9
9
|
private _data;
|
|
10
|
-
|
|
10
|
+
httpClient: IHttpClient;
|
|
11
11
|
/**
|
|
12
12
|
* @param data - An object that implements project data storage.
|
|
13
13
|
* @param httpClient - Http client.
|
package/lib/Api/Role.d.ts
CHANGED
|
@@ -4,8 +4,8 @@ import { IHttpClient } from "./IHttpClient";
|
|
|
4
4
|
*/
|
|
5
5
|
export declare class Role {
|
|
6
6
|
private _data;
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
projectId: string;
|
|
8
|
+
httpClient: IHttpClient;
|
|
9
9
|
/**
|
|
10
10
|
* @param data - An object that implements role data storage.
|
|
11
11
|
* @param projectId - Owner project ID.
|
package/lib/Api/User.d.ts
CHANGED
package/lib/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export { Client } from "./Api/Client";
|
|
|
3
3
|
export { ClashTest } from "./Api/ClashTest";
|
|
4
4
|
export * from "./Api/ClientEvents";
|
|
5
5
|
export { File } from "./Api/File";
|
|
6
|
+
export { FetchError, statusText } from "./Api/FetchError";
|
|
6
7
|
export { Job } from "./Api/Job";
|
|
7
8
|
export { Member } from "./Api/Member";
|
|
8
9
|
export { Model } from "./Api/Model";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@inweb/client",
|
|
3
|
-
"version": "25.4.
|
|
3
|
+
"version": "25.4.4",
|
|
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.4"
|
|
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/ClashTest.ts
CHANGED
|
@@ -30,8 +30,8 @@ import { waitFor, userFullName, userInitials } from "./Utils";
|
|
|
30
30
|
*/
|
|
31
31
|
export class ClashTest {
|
|
32
32
|
private _data: any;
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
public basePath: string;
|
|
34
|
+
public httpClient: IHttpClient;
|
|
35
35
|
|
|
36
36
|
/**
|
|
37
37
|
* @param data - Raw test data.
|