visualvault-api 1.1.0 → 2.0.0-beta.0

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.
Files changed (42) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +23 -138
  3. package/dist/VVRestApi.cjs +2574 -0
  4. package/dist/VVRestApi.cjs.map +1 -0
  5. package/dist/VVRestApi.d.cts +375 -0
  6. package/dist/VVRestApi.d.ts +375 -0
  7. package/dist/VVRestApi.js +2544 -0
  8. package/dist/VVRestApi.js.map +1 -0
  9. package/{lib/VVRestApi/VVRestApiNodeJs → dist}/config.yml +106 -100
  10. package/dist/constants.cjs +45 -0
  11. package/dist/constants.cjs.map +1 -0
  12. package/dist/constants.d.cts +48 -0
  13. package/dist/constants.d.ts +48 -0
  14. package/dist/constants.js +20 -0
  15. package/dist/constants.js.map +1 -0
  16. package/dist/index.cjs +2594 -0
  17. package/dist/index.cjs.map +1 -0
  18. package/dist/index.d.cts +2 -0
  19. package/dist/index.d.ts +2 -0
  20. package/dist/index.js +2563 -0
  21. package/dist/index.js.map +1 -0
  22. package/package.json +47 -71
  23. package/lib/VVRestApi/VVRestApiNodeJs/DocApi.js +0 -66
  24. package/lib/VVRestApi/VVRestApiNodeJs/FormsApi.js +0 -51
  25. package/lib/VVRestApi/VVRestApiNodeJs/NotificationsApi.js +0 -39
  26. package/lib/VVRestApi/VVRestApiNodeJs/StudioApi.js +0 -136
  27. package/lib/VVRestApi/VVRestApiNodeJs/VVRestApi.js +0 -1889
  28. package/lib/VVRestApi/VVRestApiNodeJs/app.js +0 -128
  29. package/lib/VVRestApi/VVRestApiNodeJs/common.js +0 -1598
  30. package/lib/VVRestApi/VVRestApiNodeJs/dts/express.d.ts +0 -125
  31. package/lib/VVRestApi/VVRestApiNodeJs/dts/node.d.ts +0 -1090
  32. package/lib/VVRestApi/VVRestApiNodeJs/log.js +0 -20
  33. package/lib/VVRestApi/VVRestApiNodeJs/public/favicon.ico +0 -0
  34. package/lib/VVRestApi/VVRestApiNodeJs/routes/scheduledscripts.js +0 -203
  35. package/lib/VVRestApi/VVRestApiNodeJs/routes/scripts.js +0 -215
  36. package/lib/VVRestApi/VVRestApiNodeJs/routes/testScheduledScripts.js +0 -131
  37. package/lib/VVRestApi/VVRestApiNodeJs/samples/SampleScheduledScript.js +0 -90
  38. package/lib/VVRestApi/VVRestApiNodeJs/samples/SendEmailScript.js +0 -51
  39. package/lib/VVRestApi/VVRestApiNodeJs/samples/fileTest.js +0 -60
  40. package/lib/VVRestApi/VVRestApiNodeJs/samples/sampleFormValidationScript.js +0 -126
  41. package/lib/VVRestApi/VVRestApiNodeJs/views/error.ejs +0 -8
  42. package/lib/VVRestApi/VVRestApiNodeJs/views/index.ejs +0 -8
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 VisualVault
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
package/README.md CHANGED
@@ -1,5 +1,7 @@
1
1
  # visualvault-api
2
2
 
3
+ ![Stability: Beta](https://img.shields.io/badge/stability-beta-yellow.svg)
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 Examples
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.documents.postDocWithFile(documentData, fileBuffer)
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
- // Create a new form instance
106
- const formData = {
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
 
@@ -256,8 +141,8 @@ For more information about the VisualVault API, visit the [VisualVault documenta
256
141
 
257
142
  ## License
258
143
 
259
- Use of the VisualVault API requires a customer hosting contract which defines all license terms.
144
+ This project is licensed under the [MIT License](LICENSE).
260
145
 
261
- ## Repository
146
+ ## Contributing
262
147
 
263
- [GitHub Repository](https://github.com/VisualVault/nodeJs-rest-client-library)
148
+ See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.