@inweb/client 25.2.2
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/LICENSE +20 -0
- package/README.md +70 -0
- package/dist/client.js +21126 -0
- package/dist/client.js.map +1 -0
- package/dist/client.min.js +1 -0
- package/dist/client.module.js +7151 -0
- package/dist/client.module.js.map +1 -0
- package/lib/Api/Assembly.d.ts +339 -0
- package/lib/Api/ClashTest.d.ts +176 -0
- package/lib/Api/Client.d.ts +452 -0
- package/lib/Api/ClientEvents.d.ts +29 -0
- package/lib/Api/File.d.ts +568 -0
- package/lib/Api/HttpClient.d.ts +13 -0
- package/lib/Api/IAssembly.d.ts +14 -0
- package/lib/Api/IFile.d.ts +46 -0
- package/lib/Api/IHttpClient.d.ts +11 -0
- package/lib/Api/IUser.d.ts +11 -0
- package/lib/Api/Job.d.ts +142 -0
- package/lib/Api/Member.d.ts +85 -0
- package/lib/Api/Model.d.ts +147 -0
- package/lib/Api/Permission.d.ts +93 -0
- package/lib/Api/Project.d.ts +247 -0
- package/lib/Api/Role.d.ts +82 -0
- package/lib/Api/User.d.ts +197 -0
- package/lib/Api/impl/FetchError.d.ts +18 -0
- package/lib/Api/impl/Utils.d.ts +33 -0
- package/lib/Api/impl/http.d.ts +67 -0
- package/lib/ConvetMath.d.ts +29 -0
- package/lib/Viewer/CanvasEvents.d.ts +2 -0
- package/lib/Viewer/Commands/ApplyModelTransform.d.ts +2 -0
- package/lib/Viewer/Commands/ClearMarkup.d.ts +2 -0
- package/lib/Viewer/Commands/ClearSlices.d.ts +2 -0
- package/lib/Viewer/Commands/CreatePreview.d.ts +2 -0
- package/lib/Viewer/Commands/Explode.d.ts +2 -0
- package/lib/Viewer/Commands/GetDefaultViewPositions.d.ts +2 -0
- package/lib/Viewer/Commands/GetModels.d.ts +2 -0
- package/lib/Viewer/Commands/GetSelected.d.ts +2 -0
- package/lib/Viewer/Commands/HideSelected.d.ts +2 -0
- package/lib/Viewer/Commands/IsolateSelected.d.ts +2 -0
- package/lib/Viewer/Commands/RegenerateAll.d.ts +2 -0
- package/lib/Viewer/Commands/ResetView.d.ts +2 -0
- package/lib/Viewer/Commands/SelectModel.d.ts +2 -0
- package/lib/Viewer/Commands/SetActiveDragger.d.ts +2 -0
- package/lib/Viewer/Commands/SetDefaultViewPosition.d.ts +2 -0
- package/lib/Viewer/Commands/SetMarkupColor.d.ts +2 -0
- package/lib/Viewer/Commands/SetSelected.d.ts +2 -0
- package/lib/Viewer/Commands/ShowAll.d.ts +2 -0
- package/lib/Viewer/Commands/Unselect.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToExtents.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToObjects.d.ts +2 -0
- package/lib/Viewer/Commands/ZoomToSelected.d.ts +2 -0
- package/lib/Viewer/Commands.d.ts +3 -0
- package/lib/Viewer/Draggers/Actions/OrbitAction.d.ts +22 -0
- package/lib/Viewer/Draggers/Actions/PanAction.d.ts +18 -0
- package/lib/Viewer/Draggers/Actions/ZoomAction.d.ts +8 -0
- package/lib/Viewer/Draggers/Common/Geometry.d.ts +115 -0
- package/lib/Viewer/Draggers/Common/GestureManager.d.ts +41 -0
- package/lib/Viewer/Draggers/Common/OdBaseDragger.d.ts +54 -0
- package/lib/Viewer/Draggers/Common/OdaGeAction.d.ts +30 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.d.ts +31 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/MeasureUtils.d.ts +20 -0
- package/lib/Viewer/Draggers/MeasureLineDragger/index.d.ts +24 -0
- package/lib/Viewer/Draggers/OdBaseCuttingPlaneDragger.d.ts +27 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneXAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneYAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdCuttingPlaneZAxisDragger.d.ts +8 -0
- package/lib/Viewer/Draggers/OdOrbitDragger.d.ts +15 -0
- package/lib/Viewer/Draggers/OdPanDragger.d.ts +12 -0
- package/lib/Viewer/Draggers/OdZoomDragger.d.ts +12 -0
- package/lib/Viewer/Draggers/OdZoomWheelDragger.d.ts +11 -0
- package/lib/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.d.ts +19 -0
- package/lib/Viewer/Draggers/OdZoomWindowDragger/index.d.ts +14 -0
- package/lib/Viewer/Draggers/OdaLineDragger.d.ts +15 -0
- package/lib/Viewer/Draggers/OdaTextDragger.d.ts +16 -0
- package/lib/Viewer/Draggers/OdaWalkDragger.d.ts +30 -0
- package/lib/Viewer/Draggers/OrbitAroundBuildingDragger.d.ts +19 -0
- package/lib/Viewer/EventEmitter2.d.ts +54 -0
- package/lib/Viewer/ICommands.d.ts +25 -0
- package/lib/Viewer/IEventEmitter2.d.ts +13 -0
- package/lib/Viewer/IViewer.d.ts +27 -0
- package/lib/Viewer/Loaders/BaseLoader.d.ts +11 -0
- package/lib/Viewer/Loaders/LoaderFactory.d.ts +10 -0
- package/lib/Viewer/Loaders/TCSLoader.d.ts +5 -0
- package/lib/Viewer/Loaders/UpdaterController.d.ts +15 -0
- package/lib/Viewer/Loaders/VsfXLoader.d.ts +5 -0
- package/lib/Viewer/Loaders/VsfXPartialLoader.d.ts +5 -0
- package/lib/Viewer/Markup/Api/IMarkupArrow.d.ts +12 -0
- package/lib/Viewer/Markup/Api/IMarkupColorable.d.ts +5 -0
- package/lib/Viewer/Markup/Api/IMarkupEllipse.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupImage.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupLine.d.ts +11 -0
- package/lib/Viewer/Markup/Api/IMarkupObject.d.ts +12 -0
- package/lib/Viewer/Markup/Api/IMarkupRectangle.d.ts +15 -0
- package/lib/Viewer/Markup/Api/IMarkupText.d.ts +13 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaArrow.d.ts +32 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.d.ts +40 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaImage.d.ts +36 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaLine.d.ts +32 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.d.ts +38 -0
- package/lib/Viewer/Markup/Api/Impl/Konva/KonvaText.d.ts +37 -0
- package/lib/Viewer/Markup/IMarkup.d.ts +38 -0
- package/lib/Viewer/Markup/Impl/Konva/KonvaMarkup.d.ts +63 -0
- package/lib/Viewer/Markup/Impl/Konva/MarkupColor.d.ts +19 -0
- package/lib/Viewer/Markup/Impl/Visualize/VisualizeMarkup.d.ts +33 -0
- package/lib/Viewer/Markup/MarkupFactory.d.ts +7 -0
- package/lib/Viewer/Options.d.ts +228 -0
- package/lib/Viewer/OptionsEvents.d.ts +26 -0
- package/lib/Viewer/Viewer.d.ts +353 -0
- package/lib/Viewer/ViewerCommands.d.ts +23 -0
- package/lib/Viewer/ViewerEvents.d.ts +601 -0
- package/lib/Viewer/utils.d.ts +4 -0
- package/lib/index.d.ts +24 -0
- package/package.json +32 -0
- package/src/Api/Assembly.ts +678 -0
- package/src/Api/ClashTest.ts +290 -0
- package/src/Api/Client.ts +816 -0
- package/src/Api/ClientEvents.ts +31 -0
- package/src/Api/File.ts +962 -0
- package/src/Api/HttpClient.ts +73 -0
- package/src/Api/IAssembly.ts +37 -0
- package/src/Api/IFile.ts +74 -0
- package/src/Api/IHttpClient.ts +50 -0
- package/src/Api/IUser.ts +33 -0
- package/src/Api/Job.ts +253 -0
- package/src/Api/Member.ts +161 -0
- package/src/Api/Model.ts +259 -0
- package/src/Api/Permission.ts +173 -0
- package/src/Api/Project.ts +479 -0
- package/src/Api/Role.ts +158 -0
- package/src/Api/User.ts +357 -0
- package/src/Api/impl/FetchError.ts +48 -0
- package/src/Api/impl/Utils.ts +367 -0
- package/src/Api/impl/http.ts +92 -0
- package/src/ConvetMath.ts +372 -0
- package/src/Viewer/CanvasEvents.ts +41 -0
- package/src/Viewer/Commands/ApplyModelTransform.ts +70 -0
- package/src/Viewer/Commands/ClearMarkup.ts +28 -0
- package/src/Viewer/Commands/ClearSlices.ts +27 -0
- package/src/Viewer/Commands/CreatePreview.ts +33 -0
- package/src/Viewer/Commands/Explode.ts +38 -0
- package/src/Viewer/Commands/GetDefaultViewPositions.ts +36 -0
- package/src/Viewer/Commands/GetModels.ts +43 -0
- package/src/Viewer/Commands/GetSelected.ts +58 -0
- package/src/Viewer/Commands/HideSelected.ts +37 -0
- package/src/Viewer/Commands/IsolateSelected.ts +37 -0
- package/src/Viewer/Commands/RegenerateAll.ts +37 -0
- package/src/Viewer/Commands/ResetView.ts +43 -0
- package/src/Viewer/Commands/SelectModel.ts +52 -0
- package/src/Viewer/Commands/SetActiveDragger.ts +29 -0
- package/src/Viewer/Commands/SetDefaultViewPosition.ts +50 -0
- package/src/Viewer/Commands/SetMarkupColor.ts +29 -0
- package/src/Viewer/Commands/SetSelected.ts +47 -0
- package/src/Viewer/Commands/ShowAll.ts +37 -0
- package/src/Viewer/Commands/Unselect.ts +37 -0
- package/src/Viewer/Commands/ZoomToExtents.ts +43 -0
- package/src/Viewer/Commands/ZoomToObjects.ts +47 -0
- package/src/Viewer/Commands/ZoomToSelected.ts +39 -0
- package/src/Viewer/Commands.ts +81 -0
- package/src/Viewer/Draggers/Actions/OrbitAction.ts +250 -0
- package/src/Viewer/Draggers/Actions/PanAction.ts +102 -0
- package/src/Viewer/Draggers/Actions/ZoomAction.ts +45 -0
- package/src/Viewer/Draggers/Common/Geometry.ts +152 -0
- package/src/Viewer/Draggers/Common/GestureManager.ts +263 -0
- package/src/Viewer/Draggers/Common/OdBaseDragger.ts +270 -0
- package/src/Viewer/Draggers/Common/OdaGeAction.ts +146 -0
- package/src/Viewer/Draggers/MeasureLineDragger/MeasureLineItem.ts +248 -0
- package/src/Viewer/Draggers/MeasureLineDragger/MeasureUtils.ts +182 -0
- package/src/Viewer/Draggers/MeasureLineDragger/index.ts +166 -0
- package/src/Viewer/Draggers/OdBaseCuttingPlaneDragger.ts +182 -0
- package/src/Viewer/Draggers/OdCuttingPlaneXAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdCuttingPlaneYAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdCuttingPlaneZAxisDragger.ts +53 -0
- package/src/Viewer/Draggers/OdOrbitDragger.ts +70 -0
- package/src/Viewer/Draggers/OdPanDragger.ts +62 -0
- package/src/Viewer/Draggers/OdZoomDragger.ts +59 -0
- package/src/Viewer/Draggers/OdZoomWheelDragger.ts +103 -0
- package/src/Viewer/Draggers/OdZoomWindowDragger/OdSelectionFrame.ts +123 -0
- package/src/Viewer/Draggers/OdZoomWindowDragger/index.ts +75 -0
- package/src/Viewer/Draggers/OdaLineDragger.ts +80 -0
- package/src/Viewer/Draggers/OdaTextDragger.ts +118 -0
- package/src/Viewer/Draggers/OdaWalkDragger.ts +278 -0
- package/src/Viewer/Draggers/OrbitAroundBuildingDragger.ts +184 -0
- package/src/Viewer/EventEmitter2.ts +116 -0
- package/src/Viewer/ICommands.ts +53 -0
- package/src/Viewer/IEventEmitter2.ts +36 -0
- package/src/Viewer/IViewer.ts +55 -0
- package/src/Viewer/Loaders/BaseLoader.ts +40 -0
- package/src/Viewer/Loaders/LoaderFactory.ts +44 -0
- package/src/Viewer/Loaders/TCSLoader.ts +82 -0
- package/src/Viewer/Loaders/UpdaterController.ts +36 -0
- package/src/Viewer/Loaders/VsfXLoader.ts +87 -0
- package/src/Viewer/Loaders/VsfXPartialLoader.ts +208 -0
- package/src/Viewer/Markup/Api/IMarkupArrow.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupColorable.ts +4 -0
- package/src/Viewer/Markup/Api/IMarkupEllipse.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupImage.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupLine.ts +10 -0
- package/src/Viewer/Markup/Api/IMarkupObject.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupRectangle.ts +15 -0
- package/src/Viewer/Markup/Api/IMarkupText.ts +12 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaArrow.ts +119 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaEllipse.ts +113 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaImage.ts +121 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaLine.ts +99 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaRectangle.ts +113 -0
- package/src/Viewer/Markup/Api/Impl/Konva/KonvaText.ts +104 -0
- package/src/Viewer/Markup/IMarkup.ts +39 -0
- package/src/Viewer/Markup/Impl/Konva/KonvaMarkup.ts +872 -0
- package/src/Viewer/Markup/Impl/Konva/MarkupColor.ts +39 -0
- package/src/Viewer/Markup/Impl/Visualize/VisualizeMarkup.ts +273 -0
- package/src/Viewer/Markup/MarkupFactory.ts +32 -0
- package/src/Viewer/Options.ts +502 -0
- package/src/Viewer/OptionsEvents.ts +28 -0
- package/src/Viewer/Viewer.ts +1109 -0
- package/src/Viewer/ViewerCommands.ts +45 -0
- package/src/Viewer/ViewerEvents.ts +700 -0
- package/src/Viewer/utils.ts +74 -0
- package/src/index.ts +48 -0
|
@@ -0,0 +1,452 @@
|
|
|
1
|
+
import { EventEmitter2 } from "../Viewer/EventEmitter2";
|
|
2
|
+
import { ClientEventMap } from "./ClientEvents";
|
|
3
|
+
import { Options } from "../Viewer/Options";
|
|
4
|
+
import { OptionsEventMap } from "../Viewer/OptionsEvents";
|
|
5
|
+
import { Assembly } from "./Assembly";
|
|
6
|
+
import { File } from "./File";
|
|
7
|
+
import { Job } from "./Job";
|
|
8
|
+
import { Project } from "./Project";
|
|
9
|
+
import { User } from "./User";
|
|
10
|
+
/**
|
|
11
|
+
* The `Client.js` library class that provides methods to access the [Open Cloud
|
|
12
|
+
* Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server) resources like
|
|
13
|
+
* Projects, Files, Issues etc.
|
|
14
|
+
*/
|
|
15
|
+
export declare class Client extends EventEmitter2<ClientEventMap & OptionsEventMap> {
|
|
16
|
+
private _options;
|
|
17
|
+
private _serverUrl;
|
|
18
|
+
private _httpClient;
|
|
19
|
+
private _user;
|
|
20
|
+
eventEmitter: EventEmitter2;
|
|
21
|
+
/**
|
|
22
|
+
* @param params - An object containing client configuration parameters.
|
|
23
|
+
* @param params.serverUrl - Open Cloud Server URL.
|
|
24
|
+
*/
|
|
25
|
+
constructor(params?: {
|
|
26
|
+
serverUrl?: string;
|
|
27
|
+
url?: string;
|
|
28
|
+
});
|
|
29
|
+
/**
|
|
30
|
+
* Open Cloud Server URL. Use {@link Client#configure | configure()} to change server URL.
|
|
31
|
+
*
|
|
32
|
+
* @readonly
|
|
33
|
+
*/
|
|
34
|
+
get serverUrl(): string;
|
|
35
|
+
/**
|
|
36
|
+
* `VisualizeJS` parameters. Changes to these parameters are automatically applied to
|
|
37
|
+
* `Viewer` instances associated with that client.
|
|
38
|
+
*/
|
|
39
|
+
get options(): Options;
|
|
40
|
+
/**
|
|
41
|
+
* Change the client configuration parameters.
|
|
42
|
+
*
|
|
43
|
+
* @param params - An object containing new configuration parameters.
|
|
44
|
+
* @param params.serverUrl - Open Cloud Server URL.
|
|
45
|
+
* @returns Returns a reference to the `Client`.
|
|
46
|
+
*/
|
|
47
|
+
configure(params: {
|
|
48
|
+
serverUrl?: string;
|
|
49
|
+
}): this;
|
|
50
|
+
/**
|
|
51
|
+
* The Object represents server version information.
|
|
52
|
+
*
|
|
53
|
+
* @typedef {any} VersionResult
|
|
54
|
+
* @property {string} version - The server version.
|
|
55
|
+
* @property {string} hash - Build hash.
|
|
56
|
+
*/
|
|
57
|
+
/**
|
|
58
|
+
* Returns server version.
|
|
59
|
+
*
|
|
60
|
+
* @async
|
|
61
|
+
*/
|
|
62
|
+
version(): Promise<any>;
|
|
63
|
+
/**
|
|
64
|
+
* Register a new user with the specified email and password.
|
|
65
|
+
*
|
|
66
|
+
* @async
|
|
67
|
+
* @param email - User email. Cannot be empty.
|
|
68
|
+
* @param password - User password. Cannot be empty. Password can only contain letters (a-z,
|
|
69
|
+
* A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]:;"'`<>,.?|/\ ).
|
|
70
|
+
* @param userName - User name. Cannot be empty or blank if defined. Leave undefined to use
|
|
71
|
+
* `username` from email.
|
|
72
|
+
*/
|
|
73
|
+
registerUser(email: string, password: string, userName?: string): Promise<any>;
|
|
74
|
+
/**
|
|
75
|
+
* Resend the Confirmation Email to new user. If the user's email is already confirmed, an
|
|
76
|
+
* exception will be thrown.
|
|
77
|
+
*
|
|
78
|
+
* @async
|
|
79
|
+
* @param email - User email.
|
|
80
|
+
* @param password - User password.
|
|
81
|
+
*/
|
|
82
|
+
resendConfirmationEmail(email: string, password: string): Promise<any>;
|
|
83
|
+
/**
|
|
84
|
+
* Confirm the user's email. If the user's email is already confirmed, an exception will be thrown.
|
|
85
|
+
*
|
|
86
|
+
* @async
|
|
87
|
+
* @param emailConfirmationId - Confirmation code from the Confirmation Email.
|
|
88
|
+
*/
|
|
89
|
+
confirmUserEmail(emailConfirmationId: string): Promise<any>;
|
|
90
|
+
/**
|
|
91
|
+
* Log in an existing user using email or user name.
|
|
92
|
+
*
|
|
93
|
+
* @async
|
|
94
|
+
* @param email - An email or user name for authentication request.
|
|
95
|
+
* @param password - Password for authentication request.
|
|
96
|
+
*/
|
|
97
|
+
signInWithEmail(email: string, password: string): Promise<User>;
|
|
98
|
+
/**
|
|
99
|
+
* Log in an existing user using API Key.
|
|
100
|
+
*
|
|
101
|
+
* @async
|
|
102
|
+
* @param token - An access token for authentication request. See
|
|
103
|
+
* {@link User#token | User.token} for more details.
|
|
104
|
+
*/
|
|
105
|
+
signInWithToken(token: string): Promise<User>;
|
|
106
|
+
private setCurrentUser;
|
|
107
|
+
private clearCurrentUser;
|
|
108
|
+
/**
|
|
109
|
+
* Returns the current logged in user information. Returns `null` if the user is not logged
|
|
110
|
+
* in or the logged in user has deleted himself.
|
|
111
|
+
*/
|
|
112
|
+
getCurrentUser(): User | null;
|
|
113
|
+
/**
|
|
114
|
+
* Returns a list of server users. Only admins can get a list of users, if the current logged
|
|
115
|
+
* in user does not have administrator rights, an exception will be thrown.
|
|
116
|
+
*
|
|
117
|
+
* @async
|
|
118
|
+
*/
|
|
119
|
+
getUsers(): Promise<User[]>;
|
|
120
|
+
/**
|
|
121
|
+
* Returns the user information. Only admins can get other users, if the current logged in
|
|
122
|
+
* user does not have administrator rights, hi can only get himself, otherwise an exception
|
|
123
|
+
* will be thrown.
|
|
124
|
+
*
|
|
125
|
+
* @async
|
|
126
|
+
* @param userId - User ID.
|
|
127
|
+
*/
|
|
128
|
+
getUser(userId: string): Promise<User>;
|
|
129
|
+
/**
|
|
130
|
+
* Create a new user. Only admins can create users, if the current logged in user does not
|
|
131
|
+
* have administrator rights, an exception will be thrown.
|
|
132
|
+
*
|
|
133
|
+
* @async
|
|
134
|
+
* @param email - User email. Cannot be empty.
|
|
135
|
+
* @param password - User password. Cannot be empty. Password can only contain latin letters
|
|
136
|
+
* (a-z, A-Z), numbers (0-9), and special characters (~!@#$%^&*()_-+={}[]:;"'`<>,.?|/\ ).
|
|
137
|
+
* @param params - Additional user data.
|
|
138
|
+
* @param params.isAdmin - `true` if user is an administrator.
|
|
139
|
+
* @param params.userName - User name. Cannot be empty or blank if defined. Leave undefined
|
|
140
|
+
* to use `username` from email.
|
|
141
|
+
* @param params.firstName - First name.
|
|
142
|
+
* @param params.lastName - Last name.
|
|
143
|
+
* @param params.canCreateProject - `true` if user is allowed to create a project.
|
|
144
|
+
* @param params.projectsLimit - The maximum number of projects that the user can create.
|
|
145
|
+
* @param params.storageLimit - The size of the file storage available to the user.
|
|
146
|
+
*/
|
|
147
|
+
createUser(email: string, password: string, params?: {
|
|
148
|
+
isAdmin?: boolean;
|
|
149
|
+
userName?: string;
|
|
150
|
+
firstName?: string;
|
|
151
|
+
lastName?: string;
|
|
152
|
+
canCreateProject?: boolean;
|
|
153
|
+
projectsLimit?: number;
|
|
154
|
+
storageLimit?: number;
|
|
155
|
+
}): Promise<User>;
|
|
156
|
+
/**
|
|
157
|
+
* Delete a user from the server. Only admins can delete users, if the current logged in user
|
|
158
|
+
* does not have administrator rights, an exception will be thrown.
|
|
159
|
+
*
|
|
160
|
+
* Admins can delete themselves or other admins. An admin can only delete himself if he is
|
|
161
|
+
* not the last administrator.
|
|
162
|
+
*
|
|
163
|
+
* You need to re-login to continue working after deleting the current logged in user.
|
|
164
|
+
*
|
|
165
|
+
* @async
|
|
166
|
+
* @param userId - User ID.
|
|
167
|
+
* @returns Returns the raw data of a deleted user.
|
|
168
|
+
*/
|
|
169
|
+
deleteUser(userId: string): Promise<any>;
|
|
170
|
+
/**
|
|
171
|
+
* Result for file list.
|
|
172
|
+
*
|
|
173
|
+
* @typedef {any} FilesResult
|
|
174
|
+
* @property {number} allSize - Total number of files the user has access to.
|
|
175
|
+
* @property {number} start - The starting index in the file list in the request.
|
|
176
|
+
* @property {number} limit - The maximum number of requested files.
|
|
177
|
+
* @property {File[]} result - Result file list.
|
|
178
|
+
* @property {number} size - The number of files in the result list.
|
|
179
|
+
*/
|
|
180
|
+
/**
|
|
181
|
+
* Returns a list of files the user has access to.
|
|
182
|
+
*
|
|
183
|
+
* @async
|
|
184
|
+
* @param start - The starting index in the file list. Used for paging.
|
|
185
|
+
* @param limit - The maximum number of files that should be returned per request. Used for paging.
|
|
186
|
+
* @param name - Filter the files by part of the name.
|
|
187
|
+
* @param ext - Filter the files by extension. Extension can be `dgn`, `dwf`, `dwg`, `dxf`,
|
|
188
|
+
* `ifc`, `ifczip`, `nwc`, `nwd`, `obj`, `rcs`, `rfa`, `rvt`, `step`, `stl`, `stp`, `vsf`,
|
|
189
|
+
* or any other drawing or reference file type extension. You can specify multiple
|
|
190
|
+
* extensions on one `string` by separating them with a "|".
|
|
191
|
+
* @param ids - List of file IDs to return. You can specify multiple IDs on one `string` by
|
|
192
|
+
* separating them with a "|".
|
|
193
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default,
|
|
194
|
+
* files are sorted by name in ascending order.
|
|
195
|
+
* @param {string} sortField - Allows to specify sort field.
|
|
196
|
+
*/
|
|
197
|
+
getFiles(start?: number, limit?: number, name?: string, ext?: string | string[], ids?: string | string[], sortByDesc?: boolean, sortField?: string): Promise<{
|
|
198
|
+
allSize: number;
|
|
199
|
+
start: number;
|
|
200
|
+
limit: number;
|
|
201
|
+
result: File[];
|
|
202
|
+
size: number;
|
|
203
|
+
}>;
|
|
204
|
+
/**
|
|
205
|
+
* Returns the file information.
|
|
206
|
+
*
|
|
207
|
+
* @async
|
|
208
|
+
* @param fileId - File ID.
|
|
209
|
+
*/
|
|
210
|
+
getFile(fileId: string): Promise<File>;
|
|
211
|
+
/**
|
|
212
|
+
* Upload a drawing or reference file to the server.
|
|
213
|
+
*
|
|
214
|
+
* Fires:
|
|
215
|
+
*
|
|
216
|
+
* - {@link UploadProgressEvent | uploadprogress}
|
|
217
|
+
*
|
|
218
|
+
* @async
|
|
219
|
+
* @param file - Web API <a href="https://developer.mozilla.org/docs/Web/API/File"
|
|
220
|
+
* target="_blank">File</a> object are generally retrieved from a <a
|
|
221
|
+
* href="https://developer.mozilla.org/docs/Web/API/FileList" target="_blank">FileList</a>
|
|
222
|
+
* object returned as a result of a user selecting files using the HTML `<input>` element.
|
|
223
|
+
* @param params - An object containing upload parameters.
|
|
224
|
+
* @param params.geometry=true - Create job to extract file geometry data. Can be:
|
|
225
|
+
*
|
|
226
|
+
* - `true` - Extract file geometry data into type, defined by [options]{@link Client#options}.
|
|
227
|
+
* - `vsfx` - Extract file geometry data into `VSFX` to open the file in `VisualizeJS` viewer.
|
|
228
|
+
* - `gltf` - Extract file geometry data into `glTF` to open the file in `Three.js` viewer.
|
|
229
|
+
*
|
|
230
|
+
* @param params.properties=false - Create job to extract file properties.
|
|
231
|
+
* @param params.waitForDone=false - Wait for geometry and properties jobs to complete.
|
|
232
|
+
* @param params.timeout - The time, in milliseconds that the function should wait jobs. If
|
|
233
|
+
* no one jobs are done during this time, the `TimeoutError` exception will be thrown.
|
|
234
|
+
* @param params.interval - The time, in milliseconds, the function should delay in between
|
|
235
|
+
* checking jobs status.
|
|
236
|
+
* @param params.signal - An <a
|
|
237
|
+
* href="https://developer.mozilla.org/docs/Web/API/AbortController">AbortController</a>
|
|
238
|
+
* signal object instance, which can be used to abort waiting as desired.
|
|
239
|
+
* @param params.onProgress - Upload progress callback.
|
|
240
|
+
*/
|
|
241
|
+
uploadFile(file: globalThis.File, params?: {
|
|
242
|
+
geometry?: boolean | string;
|
|
243
|
+
properties?: boolean;
|
|
244
|
+
waitForDone?: boolean;
|
|
245
|
+
timeout?: number;
|
|
246
|
+
interval?: number;
|
|
247
|
+
signal?: AbortSignal;
|
|
248
|
+
onProgress?: (progress: number, file: globalThis.File) => void;
|
|
249
|
+
}): Promise<File>;
|
|
250
|
+
/**
|
|
251
|
+
* Delete the drawing or reference file from the server.
|
|
252
|
+
*
|
|
253
|
+
* @async
|
|
254
|
+
* @param fileId - File ID.
|
|
255
|
+
* @returns Returns the raw data of a deleted file.
|
|
256
|
+
*/
|
|
257
|
+
deleteFile(fileId: string): Promise<any>;
|
|
258
|
+
/**
|
|
259
|
+
* Download the drawing or reference file.
|
|
260
|
+
*
|
|
261
|
+
* @async
|
|
262
|
+
* @param fileId - File ID.
|
|
263
|
+
* @param onProgress - Download progress callback.
|
|
264
|
+
* @param signal - An <a href="https://developer.mozilla.org/docs/Web/API/AbortSignal" target
|
|
265
|
+
* ="_blank">AbortSignal</a> object instance. Allows to communicate with a fetch request
|
|
266
|
+
* and abort it if desired.
|
|
267
|
+
*/
|
|
268
|
+
downloadFile(fileId: string, onProgress?: (progress: number) => void, signal?: AbortSignal): Promise<ArrayBuffer>;
|
|
269
|
+
/**
|
|
270
|
+
* Result for job list.
|
|
271
|
+
*
|
|
272
|
+
* @typedef {any} JobsResult
|
|
273
|
+
* @property {number} allSize - Total number of jobs created by the user.
|
|
274
|
+
* @property {number} start - The starting index in the job list in the request.
|
|
275
|
+
* @property {number} limit - The maximum number of requested jobs.
|
|
276
|
+
* @property {Job[]} result - Result job list.
|
|
277
|
+
* @property {number} size - The number of jobs in the result list.
|
|
278
|
+
*/
|
|
279
|
+
/**
|
|
280
|
+
* Returns a list of jobs created by current user.
|
|
281
|
+
*
|
|
282
|
+
* @async
|
|
283
|
+
* @param status - Filter the jobs by status. Status can be `waiting`, `inpogress`, `done` or
|
|
284
|
+
* `failed`. You can specify multiple statuses on one `string` by separating them with a "|".
|
|
285
|
+
* @param limit - The maximum number of jobs that should be returned per request. Used for paging.
|
|
286
|
+
* @param start - The starting index in the job list. Used for paging.
|
|
287
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default, jobs
|
|
288
|
+
* are sorted by creation time in ascending order.
|
|
289
|
+
* @param {boolean} sortField - Allows to specify sort field.
|
|
290
|
+
*/
|
|
291
|
+
getJobs(status?: string | string[], limit?: number, start?: number, sortByDesc?: boolean, sortField?: string): Promise<{
|
|
292
|
+
allSize: number;
|
|
293
|
+
start: number;
|
|
294
|
+
limit: number;
|
|
295
|
+
result: Job[];
|
|
296
|
+
size: number;
|
|
297
|
+
}>;
|
|
298
|
+
/**
|
|
299
|
+
* Returns the job information.
|
|
300
|
+
*
|
|
301
|
+
* @async
|
|
302
|
+
* @param jobId - Job ID.
|
|
303
|
+
*/
|
|
304
|
+
getJob(jobId: string): Promise<Job>;
|
|
305
|
+
/**
|
|
306
|
+
* Create a new job.
|
|
307
|
+
*
|
|
308
|
+
* @async
|
|
309
|
+
* @param fileId - File ID.
|
|
310
|
+
* @param outputFormat - The job type. Can be one of:
|
|
311
|
+
*
|
|
312
|
+
* - `geometry` - Extract file geometry data into `VSFX`.
|
|
313
|
+
* - `geometryGltf` - Extract file geometry data into `glTF`.
|
|
314
|
+
* - `properties` - Extract file properties.
|
|
315
|
+
* - `validation` - Validate the file. Only for `IFC`.
|
|
316
|
+
* - `dwg`, `obj`, `gltf`, `glb`, `vsf`, `pdf`, `3dpdf` - Export file to the one of the supported format.
|
|
317
|
+
* - Other custom job name. Custom job runner must be registered in the job templates table
|
|
318
|
+
* before creating a job.
|
|
319
|
+
*
|
|
320
|
+
* @param parameters - Parameters for the job runner. Can be given as command line arguments
|
|
321
|
+
* for the File Converter tool in form "--arg=value".
|
|
322
|
+
*/
|
|
323
|
+
createJob(fileId: string, outputFormat: string, parameters?: string | object): Promise<Job>;
|
|
324
|
+
/**
|
|
325
|
+
* Remove a job from the server job list. The method does not delete or stop jobs that are
|
|
326
|
+
* already being executed.
|
|
327
|
+
*
|
|
328
|
+
* @async
|
|
329
|
+
* @param jobId - Job ID.
|
|
330
|
+
* @returns Returns the raw data of a deleted job.
|
|
331
|
+
*/
|
|
332
|
+
deleteJob(jobId: string): Promise<any>;
|
|
333
|
+
/**
|
|
334
|
+
* Result for assembly list.
|
|
335
|
+
*
|
|
336
|
+
* @typedef {any} AssembliesResult
|
|
337
|
+
* @property {number} allSize - Total number of assemblies the user has access to.
|
|
338
|
+
* @property {number} start - The starting index in the assembly list in the request.
|
|
339
|
+
* @property {number} limit - The maximum number of requested assemblies.
|
|
340
|
+
* @property {Assembly[]} result - Result assembly list.
|
|
341
|
+
* @property {number} size - The number of assemblies in the result list.
|
|
342
|
+
*/
|
|
343
|
+
/**
|
|
344
|
+
* Returns a list of assemblies the user has access to.
|
|
345
|
+
*
|
|
346
|
+
* @async
|
|
347
|
+
* @param start - The starting index in the assembly list. Used for paging.
|
|
348
|
+
* @param limit - The maximum number of assemblies that should be returned per request. Used
|
|
349
|
+
* for paging.
|
|
350
|
+
* @param name - Filter the assemblies by part of the name.
|
|
351
|
+
* @param ids - List of assembly IDs to return. You can specify multiple IDs on one `string`
|
|
352
|
+
* by separating them with a "|".
|
|
353
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default
|
|
354
|
+
* assemblies are sorted by name in ascending order.
|
|
355
|
+
* @param sortField - Allows to specify sort field.
|
|
356
|
+
*/
|
|
357
|
+
getAssemblies(start?: number, limit?: number, name?: string, ids?: string | string[], sortByDesc?: boolean, sortField?: string): Promise<{
|
|
358
|
+
allSize: number;
|
|
359
|
+
start: number;
|
|
360
|
+
limit: number;
|
|
361
|
+
result: Assembly[];
|
|
362
|
+
size: number;
|
|
363
|
+
}>;
|
|
364
|
+
/**
|
|
365
|
+
* Get assembly information.
|
|
366
|
+
*
|
|
367
|
+
* @async
|
|
368
|
+
* @param assemblyId - Assembly ID.
|
|
369
|
+
*/
|
|
370
|
+
getAssembly(assemblyId: string): Promise<Assembly>;
|
|
371
|
+
/**
|
|
372
|
+
* Create a new assembly.
|
|
373
|
+
*
|
|
374
|
+
* @async
|
|
375
|
+
* @param files - List of file IDs.
|
|
376
|
+
* @param name - Assembly name.
|
|
377
|
+
* @param params - An object containing upload parameters.
|
|
378
|
+
* @param params.waitForDone=false - Wait for assembly to be created.
|
|
379
|
+
*/
|
|
380
|
+
createAssembly(files: string[], name: string, params?: {
|
|
381
|
+
waitForDone?: boolean;
|
|
382
|
+
timeout?: number;
|
|
383
|
+
interval?: number;
|
|
384
|
+
signal?: AbortSignal;
|
|
385
|
+
}): Promise<Assembly>;
|
|
386
|
+
/**
|
|
387
|
+
* Delete the assembly from the server.
|
|
388
|
+
*
|
|
389
|
+
* @async
|
|
390
|
+
* @param assemblyId - Assembly ID.
|
|
391
|
+
* @returns Returns the raw data of a deleted assembly.
|
|
392
|
+
*/
|
|
393
|
+
deleteAssembly(assemblyId: string): Promise<any>;
|
|
394
|
+
/**
|
|
395
|
+
* Result for project list.
|
|
396
|
+
*
|
|
397
|
+
* @typedef {any} ProjectsResult
|
|
398
|
+
* @property {number} allSize - Total number of projects the user has access to.
|
|
399
|
+
* @property {number} start - The starting index in the project list in the request.
|
|
400
|
+
* @property {number} limit - The maximum number of requested projects.
|
|
401
|
+
* @property {Project[]} result - Result project list.
|
|
402
|
+
* @property {number} size - The number of projects in the result list.
|
|
403
|
+
*/
|
|
404
|
+
/**
|
|
405
|
+
* Returns a list of projects the user has access to.
|
|
406
|
+
*
|
|
407
|
+
* @async
|
|
408
|
+
* @param start - The starting index in the project list. Used for paging.
|
|
409
|
+
* @param limit - The maximum number of projects that should be returned per request. Used for paging.
|
|
410
|
+
* @param name - Filter the projects by part of the name.
|
|
411
|
+
* @param ids - List of project IDs to return. You can specify multiple IDs on one `string`
|
|
412
|
+
* by separating them with a "|".
|
|
413
|
+
* @param sortByDesc - Allows to specify the descending order of the result. By default
|
|
414
|
+
* projects are sorted by name in ascending order.
|
|
415
|
+
*/
|
|
416
|
+
getProjects(start?: number, limit?: number, name?: string, ids?: string | string[], sortByDesc?: boolean): Promise<{
|
|
417
|
+
allSize: number;
|
|
418
|
+
start: number;
|
|
419
|
+
limit: number;
|
|
420
|
+
result: Project[];
|
|
421
|
+
size: number;
|
|
422
|
+
}>;
|
|
423
|
+
/**
|
|
424
|
+
* Returns the project information.
|
|
425
|
+
*
|
|
426
|
+
* @async
|
|
427
|
+
* @param projectId - Project ID.
|
|
428
|
+
*/
|
|
429
|
+
getProject(projectId: string): Promise<Project>;
|
|
430
|
+
/**
|
|
431
|
+
* Create a new project.
|
|
432
|
+
*
|
|
433
|
+
* @async
|
|
434
|
+
* @param name - Project name.
|
|
435
|
+
* @param description - Project description.
|
|
436
|
+
* @param startDate - Project start date.
|
|
437
|
+
* @param endDate - Project end date.
|
|
438
|
+
* @param avatarUrl - Project preview image URL. Can be <a
|
|
439
|
+
* href="https://developer.mozilla.org/docs/Web/HTTP/Basics_of_HTTP/Data_URIs"
|
|
440
|
+
* target="_blank">Data URL</a>.
|
|
441
|
+
*/
|
|
442
|
+
createProject(name: string, description?: string, startDate?: Date | string, endDate?: Date | string, avatarUrl?: string): Promise<Project>;
|
|
443
|
+
/**
|
|
444
|
+
* Delete the project from the server.
|
|
445
|
+
*
|
|
446
|
+
* @async
|
|
447
|
+
* @param projectId - Project ID.
|
|
448
|
+
* @returns Returns the raw data of a deleted project.
|
|
449
|
+
*/
|
|
450
|
+
deleteProject(projectId: string): Promise<any>;
|
|
451
|
+
}
|
|
452
|
+
//# sourceMappingURL=Client.d.ts.map
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A {@link Client | Client} event measuring progress of an file uploading process.
|
|
3
|
+
*
|
|
4
|
+
* @event
|
|
5
|
+
*/
|
|
6
|
+
export interface UploadProgressEvent {
|
|
7
|
+
/**
|
|
8
|
+
* Event type.
|
|
9
|
+
*/
|
|
10
|
+
type: "uploadprogress";
|
|
11
|
+
/**
|
|
12
|
+
* The non-rounded progress value from 0 to 1. To get a percentage (%), multiply the `data` by 100.
|
|
13
|
+
*/
|
|
14
|
+
data: number;
|
|
15
|
+
/**
|
|
16
|
+
* File object to upload.
|
|
17
|
+
*/
|
|
18
|
+
file: globalThis.File;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Client events.
|
|
22
|
+
*/
|
|
23
|
+
export interface ClientEventMap {
|
|
24
|
+
/**
|
|
25
|
+
* A {@link Client | Client} event measuring progress of an file uploading process.
|
|
26
|
+
*/
|
|
27
|
+
uploadprogress: UploadProgressEvent;
|
|
28
|
+
}
|
|
29
|
+
//# sourceMappingURL=ClientEvents.d.ts.map
|