visualvault-api 1.2.0 → 2.0.0-beta.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 +15 -0
- package/README.md +23 -140
- package/dist/VVRestApi.cjs +2552 -0
- package/dist/VVRestApi.cjs.map +1 -0
- package/dist/VVRestApi.d.cts +386 -0
- package/dist/VVRestApi.d.ts +386 -0
- package/dist/VVRestApi.js +2522 -0
- package/dist/VVRestApi.js.map +1 -0
- package/{lib/VVRestApi/VVRestApiNodeJs → dist}/config.yml +3 -3
- package/dist/constants.cjs +45 -0
- package/dist/constants.cjs.map +1 -0
- package/dist/constants.d.cts +48 -0
- package/dist/constants.d.ts +48 -0
- package/dist/constants.js +20 -0
- package/dist/constants.js.map +1 -0
- package/dist/index.cjs +2572 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +2 -0
- package/dist/index.d.ts +2 -0
- package/dist/index.js +2541 -0
- package/dist/index.js.map +1 -0
- package/package.json +46 -70
- package/lib/VVRestApi/VVRestApiNodeJs/DocApi.js +0 -66
- package/lib/VVRestApi/VVRestApiNodeJs/FormsApi.js +0 -51
- package/lib/VVRestApi/VVRestApiNodeJs/NotificationsApi.js +0 -39
- package/lib/VVRestApi/VVRestApiNodeJs/ObjectsApi.js +0 -138
- package/lib/VVRestApi/VVRestApiNodeJs/StudioApi.js +0 -156
- package/lib/VVRestApi/VVRestApiNodeJs/VVRestApi.js +0 -1974
- package/lib/VVRestApi/VVRestApiNodeJs/app.js +0 -128
- package/lib/VVRestApi/VVRestApiNodeJs/common.js +0 -1598
- package/lib/VVRestApi/VVRestApiNodeJs/dts/express.d.ts +0 -125
- package/lib/VVRestApi/VVRestApiNodeJs/dts/node.d.ts +0 -1090
- package/lib/VVRestApi/VVRestApiNodeJs/files/237de37cf014ee1199a400d49e26e066.js +0 -51
- package/lib/VVRestApi/VVRestApiNodeJs/files/437833dc404aed118b0e644bf02b9c8a.js +0 -1
- package/lib/VVRestApi/VVRestApiNodeJs/log.js +0 -20
- package/lib/VVRestApi/VVRestApiNodeJs/public/favicon.ico +0 -0
- package/lib/VVRestApi/VVRestApiNodeJs/routes/scheduledscripts.js +0 -203
- package/lib/VVRestApi/VVRestApiNodeJs/routes/scripts.js +0 -215
- package/lib/VVRestApi/VVRestApiNodeJs/routes/testScheduledScripts.js +0 -131
- package/lib/VVRestApi/VVRestApiNodeJs/samples/SampleScheduledScript.js +0 -90
- package/lib/VVRestApi/VVRestApiNodeJs/samples/SendEmailScript.js +0 -51
- package/lib/VVRestApi/VVRestApiNodeJs/samples/fileTest.js +0 -60
- package/lib/VVRestApi/VVRestApiNodeJs/samples/sampleFormValidationScript.js +0 -126
- package/lib/VVRestApi/VVRestApiNodeJs/views/error.ejs +0 -8
- package/lib/VVRestApi/VVRestApiNodeJs/views/index.ejs +0 -8
package/LICENSE
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
ISC License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025, VisualVault
|
|
4
|
+
|
|
5
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
6
|
+
purpose with or without fee is hereby granted, provided that the above
|
|
7
|
+
copyright notice and this permission notice appear in all copies.
|
|
8
|
+
|
|
9
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
10
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
11
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
12
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
13
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
14
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
15
|
+
PERFORMANCE OF THIS SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
# visualvault-api
|
|
2
2
|
|
|
3
|
+

|
|
4
|
+
|
|
3
5
|
A Node.js client library that provides convenient access to the VisualVault REST API for server-side applications.
|
|
4
6
|
|
|
5
7
|
## Installation
|
|
@@ -17,6 +19,10 @@ npm install visualvault-api
|
|
|
17
19
|
### Basic Authentication and Setup
|
|
18
20
|
|
|
19
21
|
```javascript
|
|
22
|
+
// ES Modules (recommended)
|
|
23
|
+
import vvRestApi from 'visualvault-api';
|
|
24
|
+
|
|
25
|
+
// CommonJS
|
|
20
26
|
const vvRestApi = require('visualvault-api');
|
|
21
27
|
|
|
22
28
|
// Initialize authentication
|
|
@@ -60,150 +66,20 @@ auth.getVaultApiFromJwt(
|
|
|
60
66
|
});
|
|
61
67
|
```
|
|
62
68
|
|
|
63
|
-
## API Usage
|
|
64
|
-
|
|
65
|
-
### Working with Documents
|
|
66
|
-
|
|
67
|
-
```javascript
|
|
68
|
-
// Get documents from a folder
|
|
69
|
-
client.library.getDocuments(params, folderId)
|
|
70
|
-
.then(response => {
|
|
71
|
-
const documents = JSON.parse(response);
|
|
72
|
-
console.log('Documents:', documents.data);
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
// Upload a new document
|
|
76
|
-
const documentData = {
|
|
77
|
-
fileName: 'example.pdf',
|
|
78
|
-
description: 'Example document',
|
|
79
|
-
folderId: 'your-folder-id'
|
|
80
|
-
};
|
|
69
|
+
## API Usage
|
|
81
70
|
|
|
82
|
-
client.
|
|
83
|
-
.then(response => {
|
|
84
|
-
console.log('Document uploaded:', response);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
// Get document details
|
|
88
|
-
client.documents.getDocumentRevision(params, revisionId)
|
|
89
|
-
.then(response => {
|
|
90
|
-
const document = JSON.parse(response);
|
|
91
|
-
console.log('Document details:', document);
|
|
92
|
-
});
|
|
93
|
-
```
|
|
94
|
-
|
|
95
|
-
### Working with Forms
|
|
71
|
+
Once authenticated, the client provides access to various API modules. All methods return Promises.
|
|
96
72
|
|
|
97
73
|
```javascript
|
|
98
|
-
// Get forms by template name
|
|
74
|
+
// Example: Get forms by template name
|
|
99
75
|
client.forms.getForms(params, 'Your Form Template Name')
|
|
100
76
|
.then(response => {
|
|
101
77
|
const forms = JSON.parse(response);
|
|
102
78
|
console.log('Forms:', forms.data);
|
|
103
79
|
});
|
|
104
80
|
|
|
105
|
-
//
|
|
106
|
-
|
|
107
|
-
field1: 'value1',
|
|
108
|
-
field2: 'value2'
|
|
109
|
-
};
|
|
110
|
-
|
|
111
|
-
client.forms.postForms(params, formData, 'Your Form Template Name')
|
|
112
|
-
.then(response => {
|
|
113
|
-
console.log('Form created:', response);
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
// Get form instance by ID
|
|
117
|
-
client.forms.getFormInstanceById(templateId, instanceId)
|
|
118
|
-
.then(response => {
|
|
119
|
-
const form = JSON.parse(response);
|
|
120
|
-
console.log('Form instance:', form);
|
|
121
|
-
});
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
### Working with Folders
|
|
125
|
-
|
|
126
|
-
```javascript
|
|
127
|
-
// Get folders
|
|
128
|
-
client.library.getFolders(params)
|
|
129
|
-
.then(response => {
|
|
130
|
-
const folders = JSON.parse(response);
|
|
131
|
-
console.log('Folders:', folders.data);
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
// Create a new folder
|
|
135
|
-
const folderData = {
|
|
136
|
-
name: 'New Folder',
|
|
137
|
-
description: 'Folder description'
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
client.library.postFolderByPath(params, folderData, '/Parent Folder/New Folder')
|
|
141
|
-
.then(response => {
|
|
142
|
-
console.log('Folder created:', response);
|
|
143
|
-
});
|
|
144
|
-
```
|
|
145
|
-
|
|
146
|
-
### Working with Users
|
|
147
|
-
|
|
148
|
-
```javascript
|
|
149
|
-
// Get current user information
|
|
150
|
-
client.users.getUser(params)
|
|
151
|
-
.then(response => {
|
|
152
|
-
const user = JSON.parse(response);
|
|
153
|
-
console.log('Current user:', user);
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
// Get users in a site
|
|
157
|
-
client.users.getUsers(params, siteId)
|
|
158
|
-
.then(response => {
|
|
159
|
-
const users = JSON.parse(response);
|
|
160
|
-
console.log('Users:', users.data);
|
|
161
|
-
});
|
|
162
|
-
```
|
|
163
|
-
|
|
164
|
-
### Running Custom Queries
|
|
165
|
-
|
|
166
|
-
```javascript
|
|
167
|
-
// Execute a custom query by name
|
|
168
|
-
client.customQuery.getCustomQueryResultsByName('Your Query Name', params)
|
|
169
|
-
.then(response => {
|
|
170
|
-
const results = JSON.parse(response);
|
|
171
|
-
console.log('Query results:', results.data);
|
|
172
|
-
});
|
|
173
|
-
```
|
|
174
|
-
|
|
175
|
-
### Working with Files
|
|
176
|
-
|
|
177
|
-
```javascript
|
|
178
|
-
// Upload a file
|
|
179
|
-
const fileData = {
|
|
180
|
-
fileName: 'document.pdf',
|
|
181
|
-
description: 'My document'
|
|
182
|
-
};
|
|
183
|
-
|
|
184
|
-
client.files.postFile(fileData, fileBuffer)
|
|
185
|
-
.then(response => {
|
|
186
|
-
console.log('File uploaded:', response);
|
|
187
|
-
});
|
|
188
|
-
|
|
189
|
-
// Download a file
|
|
190
|
-
client.files.getFileBytesId(fileId)
|
|
191
|
-
.then(fileBuffer => {
|
|
192
|
-
// Process the file buffer
|
|
193
|
-
console.log('File downloaded, size:', fileBuffer.length);
|
|
194
|
-
});
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### Running Web Services
|
|
198
|
-
|
|
199
|
-
```javascript
|
|
200
|
-
// Execute a web service
|
|
201
|
-
const serviceData = {
|
|
202
|
-
param1: 'value1',
|
|
203
|
-
param2: 'value2'
|
|
204
|
-
};
|
|
205
|
-
|
|
206
|
-
client.scripts.runWebService('YourWebServiceName', serviceData)
|
|
81
|
+
// Example: Execute a web service
|
|
82
|
+
client.scripts.runWebService('YourWebServiceName', { param1: 'value1' })
|
|
207
83
|
.then(response => {
|
|
208
84
|
console.log('Web service result:', response);
|
|
209
85
|
});
|
|
@@ -232,6 +108,15 @@ The client provides access to the following VisualVault API modules:
|
|
|
232
108
|
- **securityMembers** - Security member management
|
|
233
109
|
- **reports** - Report generation
|
|
234
110
|
|
|
111
|
+
## Extended API Modules
|
|
112
|
+
|
|
113
|
+
When enabled, the following additional API modules are available:
|
|
114
|
+
|
|
115
|
+
- **docApi** - Enhanced document operations
|
|
116
|
+
- **formsApi** - Enhanced forms operations
|
|
117
|
+
- **objectsApi** - Object model operations
|
|
118
|
+
- **studioApi** - Workflow and studio operations
|
|
119
|
+
- **notificationsApi** - Real-time notifications
|
|
235
120
|
|
|
236
121
|
## Error Handling
|
|
237
122
|
|
|
@@ -254,12 +139,10 @@ client.documents.getDocuments(params, folderId)
|
|
|
254
139
|
|
|
255
140
|
For more information about the VisualVault API, visit the [VisualVault documentation](https://docs.visualvault.com/).
|
|
256
141
|
|
|
257
|
-
For VisualVault micro service debugging assistance see [Readme-microservices](https://github.com/VisualVault/nodeJs-rest-client-library/blob/master/Readme-microservices.md).
|
|
258
|
-
|
|
259
142
|
## License
|
|
260
143
|
|
|
261
|
-
|
|
144
|
+
This project is licensed under the [ISC License](LICENSE).
|
|
262
145
|
|
|
263
|
-
##
|
|
146
|
+
## Contributing
|
|
264
147
|
|
|
265
|
-
[
|
|
148
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|