@inweb/client 25.8.15 → 25.8.19
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/README.md +33 -12
- package/dist/client.js +378 -337
- package/dist/client.js.map +1 -1
- package/dist/client.min.js +1 -1
- package/dist/client.module.js +13 -5
- package/dist/client.module.js.map +1 -1
- package/lib/Api/Assembly.d.ts +63 -61
- package/lib/Api/ClashTest.d.ts +29 -27
- package/lib/Api/Client.d.ts +85 -76
- package/lib/Api/ClientEvents.d.ts +1 -1
- package/lib/Api/File.d.ts +95 -73
- package/lib/Api/IAssembly.d.ts +26 -0
- package/lib/Api/Job.d.ts +7 -8
- package/lib/Api/Member.d.ts +9 -8
- package/lib/Api/Model.d.ts +19 -15
- package/lib/Api/Permission.d.ts +15 -15
- package/lib/Api/Project.d.ts +31 -23
- package/lib/Api/Role.d.ts +9 -8
- package/lib/Api/User.d.ts +21 -20
- package/lib/index.d.ts +1 -0
- package/package.json +2 -2
- package/src/Api/Assembly.ts +63 -62
- package/src/Api/ClashTest.ts +40 -29
- package/src/Api/Client.ts +89 -77
- package/src/Api/ClientEvents.ts +1 -1
- package/src/Api/File.ts +94 -72
- package/src/Api/IAssembly.ts +27 -0
- package/src/Api/Job.ts +9 -13
- package/src/Api/Member.ts +9 -8
- package/src/Api/Model.ts +19 -15
- package/src/Api/Permission.ts +15 -15
- package/src/Api/Project.ts +31 -23
- package/src/Api/Role.ts +9 -8
- package/src/Api/User.ts +21 -20
- package/src/index.ts +1 -0
package/README.md
CHANGED
|
@@ -2,7 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
`Client.js` is a JavaScript library implementing the REST API client for [Open Cloud Server](https://cloud.opendesign.com/docs/index.html#/opencloud_server).
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
With `Client.js` you can:
|
|
6
|
+
|
|
7
|
+
- Register on the server as a new user.
|
|
8
|
+
- Create new and manage existing user accounts.
|
|
9
|
+
- Upload and download files from the server.
|
|
10
|
+
- Manage existing files, upload new version of files.
|
|
11
|
+
- Convert files from one format to another.
|
|
12
|
+
- Run validation, clash detection, and custom jobs on the server.
|
|
13
|
+
- Create and manage assemblies.
|
|
14
|
+
- Create projects, manage project models and members.
|
|
15
|
+
- Change server settings.
|
|
16
|
+
|
|
17
|
+
This library is a part of [CDE SDK](https://www.opendesign.com/products/cde) by [Open Design Alliance](https://opendesign.com).
|
|
6
18
|
|
|
7
19
|
## Installation
|
|
8
20
|
|
|
@@ -16,6 +28,12 @@ For CDN, you can use [unpkg](https://unpkg.com/) or [jsDelivr](https://www.jsdel
|
|
|
16
28
|
|
|
17
29
|
The global namespace for `Client.js` is `ODA.Api`.
|
|
18
30
|
|
|
31
|
+
```html
|
|
32
|
+
<script>
|
|
33
|
+
const client = new ODA.Api.Client({ serverUrl: "https://cloud.opendesign.com/api" });
|
|
34
|
+
</script>
|
|
35
|
+
```
|
|
36
|
+
|
|
19
37
|
### Install via [npm](https://npmjs.org)
|
|
20
38
|
|
|
21
39
|
Open a terminal in your project folder and run:
|
|
@@ -28,6 +46,7 @@ The `Client.js` package will be downloaded and installed. Then you're ready to i
|
|
|
28
46
|
|
|
29
47
|
```javascript
|
|
30
48
|
import { Client } from "@inweb/client";
|
|
49
|
+
const client = new Client({ serverUrl: "https://cloud.opendesign.com/api" });
|
|
31
50
|
```
|
|
32
51
|
|
|
33
52
|
## Example
|
|
@@ -35,17 +54,19 @@ import { Client } from "@inweb/client";
|
|
|
35
54
|
Login to the `Open Cloud Server` and get the file list from the server:
|
|
36
55
|
|
|
37
56
|
```html
|
|
38
|
-
<
|
|
39
|
-
|
|
40
|
-
<script>
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
</script>
|
|
57
|
+
<html>
|
|
58
|
+
<body>
|
|
59
|
+
<script src="https://unpkg.com/@inweb/client@25.3/dist/client.js"></script>
|
|
60
|
+
<script>
|
|
61
|
+
const client = new ODA.Api.Client({ serverUrl: "https://cloud.opendesign.com/api" });
|
|
62
|
+
client
|
|
63
|
+
.signInWithEmail("email", "password")
|
|
64
|
+
.then(() => client.getFiles())
|
|
65
|
+
.then((files) => files.result.map((file) => file.name))
|
|
66
|
+
.then((names) => console.log(names));
|
|
67
|
+
</script>
|
|
68
|
+
</body>
|
|
69
|
+
</html>
|
|
49
70
|
```
|
|
50
71
|
|
|
51
72
|
To learn more, see [First application guide](https://cloud.opendesign.com/docs/index.html#/guide).
|