visualvault-api 2.0.0-beta.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 +12 -18
- package/README.md +148 -148
- package/dist/VVRestApi.cjs +62 -84
- package/dist/VVRestApi.cjs.map +1 -1
- package/dist/VVRestApi.d.cts +22 -11
- package/dist/VVRestApi.d.ts +22 -11
- package/dist/VVRestApi.js +62 -84
- package/dist/VVRestApi.js.map +1 -1
- package/dist/config.yml +3 -0
- package/dist/index.cjs +62 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +62 -84
- package/dist/index.js.map +1 -1
- package/package.json +74 -74
package/LICENSE
CHANGED
|
@@ -1,21 +1,15 @@
|
|
|
1
|
-
|
|
1
|
+
ISC License
|
|
2
2
|
|
|
3
|
-
Copyright (c) 2025 VisualVault
|
|
3
|
+
Copyright (c) 2025, VisualVault
|
|
4
4
|
|
|
5
|
-
Permission
|
|
6
|
-
|
|
7
|
-
|
|
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:
|
|
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.
|
|
11
8
|
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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.
|
|
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,148 +1,148 @@
|
|
|
1
|
-
# visualvault-api
|
|
2
|
-
|
|
3
|
-

|
|
4
|
-
|
|
5
|
-
A Node.js client library that provides convenient access to the VisualVault REST API for server-side applications.
|
|
6
|
-
|
|
7
|
-
## Installation
|
|
8
|
-
|
|
9
|
-
```bash
|
|
10
|
-
npm install visualvault-api
|
|
11
|
-
```
|
|
12
|
-
|
|
13
|
-
## Requirements
|
|
14
|
-
|
|
15
|
-
- Node.js 20.0.0 or higher
|
|
16
|
-
|
|
17
|
-
## Quick Start
|
|
18
|
-
|
|
19
|
-
### Basic Authentication and Setup
|
|
20
|
-
|
|
21
|
-
```javascript
|
|
22
|
-
// ES Modules (recommended)
|
|
23
|
-
import vvRestApi from 'visualvault-api';
|
|
24
|
-
|
|
25
|
-
// CommonJS
|
|
26
|
-
const vvRestApi = require('visualvault-api');
|
|
27
|
-
|
|
28
|
-
// Initialize authentication
|
|
29
|
-
const auth = new vvRestApi.authorize();
|
|
30
|
-
|
|
31
|
-
// Get authenticated client
|
|
32
|
-
auth.getVaultApi(
|
|
33
|
-
'your-client-id',
|
|
34
|
-
'your-client-secret',
|
|
35
|
-
'username',
|
|
36
|
-
'password',
|
|
37
|
-
'your-audience',
|
|
38
|
-
'https://your-vault-url.com',
|
|
39
|
-
'customer-alias',
|
|
40
|
-
'database-alias'
|
|
41
|
-
).then(client => {
|
|
42
|
-
console.log('Successfully authenticated!');
|
|
43
|
-
// Use the client for API calls
|
|
44
|
-
}).catch(error => {
|
|
45
|
-
console.error('Authentication failed:', error);
|
|
46
|
-
});
|
|
47
|
-
```
|
|
48
|
-
|
|
49
|
-
### JWT Authentication
|
|
50
|
-
|
|
51
|
-
If you already have a JWT token:
|
|
52
|
-
|
|
53
|
-
```javascript
|
|
54
|
-
const auth = new vvRestApi.authorize();
|
|
55
|
-
|
|
56
|
-
auth.getVaultApiFromJwt(
|
|
57
|
-
'your-jwt-token',
|
|
58
|
-
'https://your-vault-url.com',
|
|
59
|
-
'customer-alias',
|
|
60
|
-
'database-alias',
|
|
61
|
-
new Date('2024-12-31') // expiration date
|
|
62
|
-
).then(client => {
|
|
63
|
-
console.log('JWT authentication successful!');
|
|
64
|
-
}).catch(error => {
|
|
65
|
-
console.error('JWT authentication failed:', error);
|
|
66
|
-
});
|
|
67
|
-
```
|
|
68
|
-
|
|
69
|
-
## API Usage
|
|
70
|
-
|
|
71
|
-
Once authenticated, the client provides access to various API modules. All methods return Promises.
|
|
72
|
-
|
|
73
|
-
```javascript
|
|
74
|
-
// Example: Get forms by template name
|
|
75
|
-
client.forms.getForms(params, 'Your Form Template Name')
|
|
76
|
-
.then(response => {
|
|
77
|
-
const forms = JSON.parse(response);
|
|
78
|
-
console.log('Forms:', forms.data);
|
|
79
|
-
});
|
|
80
|
-
|
|
81
|
-
// Example: Execute a web service
|
|
82
|
-
client.scripts.runWebService('YourWebServiceName', { param1: 'value1' })
|
|
83
|
-
.then(response => {
|
|
84
|
-
console.log('Web service result:', response);
|
|
85
|
-
});
|
|
86
|
-
```
|
|
87
|
-
|
|
88
|
-
## API Modules
|
|
89
|
-
|
|
90
|
-
The client provides access to the following VisualVault API modules:
|
|
91
|
-
|
|
92
|
-
- **documents** - Document management operations
|
|
93
|
-
- **forms** - Form template and instance operations
|
|
94
|
-
- **library** - Folder and library management
|
|
95
|
-
- **users** - User management operations
|
|
96
|
-
- **groups** - Group management operations
|
|
97
|
-
- **sites** - Site management operations
|
|
98
|
-
- **files** - File upload/download operations
|
|
99
|
-
- **scripts** - Web service execution
|
|
100
|
-
- **customQuery** - Custom query execution
|
|
101
|
-
- **email** - Email operations
|
|
102
|
-
- **constants** - API constants and enums
|
|
103
|
-
- **scheduledProcess** - Scheduled process management
|
|
104
|
-
- **customer** - Customer management operations
|
|
105
|
-
- **projects** - Project management operations
|
|
106
|
-
- **indexFields** - Document Index field operations
|
|
107
|
-
- **outsideProcesses** - Outside process management
|
|
108
|
-
- **securityMembers** - Security member management
|
|
109
|
-
- **reports** - Report generation
|
|
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
|
|
120
|
-
|
|
121
|
-
## Error Handling
|
|
122
|
-
|
|
123
|
-
```javascript
|
|
124
|
-
client.documents.getDocuments(params, folderId)
|
|
125
|
-
.then(response => {
|
|
126
|
-
const result = JSON.parse(response);
|
|
127
|
-
if (result.meta && result.meta.statusCode === 200) {
|
|
128
|
-
console.log('Success:', result.data);
|
|
129
|
-
} else {
|
|
130
|
-
console.error('API Error:', result);
|
|
131
|
-
}
|
|
132
|
-
})
|
|
133
|
-
.catch(error => {
|
|
134
|
-
console.error('Request failed:', error);
|
|
135
|
-
});
|
|
136
|
-
```
|
|
137
|
-
|
|
138
|
-
## Support
|
|
139
|
-
|
|
140
|
-
For more information about the VisualVault API, visit the [VisualVault documentation](https://docs.visualvault.com/).
|
|
141
|
-
|
|
142
|
-
## License
|
|
143
|
-
|
|
144
|
-
This project is licensed under the [
|
|
145
|
-
|
|
146
|
-
## Contributing
|
|
147
|
-
|
|
148
|
-
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
|
1
|
+
# visualvault-api
|
|
2
|
+
|
|
3
|
+

|
|
4
|
+
|
|
5
|
+
A Node.js client library that provides convenient access to the VisualVault REST API for server-side applications.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
```bash
|
|
10
|
+
npm install visualvault-api
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Requirements
|
|
14
|
+
|
|
15
|
+
- Node.js 20.0.0 or higher
|
|
16
|
+
|
|
17
|
+
## Quick Start
|
|
18
|
+
|
|
19
|
+
### Basic Authentication and Setup
|
|
20
|
+
|
|
21
|
+
```javascript
|
|
22
|
+
// ES Modules (recommended)
|
|
23
|
+
import vvRestApi from 'visualvault-api';
|
|
24
|
+
|
|
25
|
+
// CommonJS
|
|
26
|
+
const vvRestApi = require('visualvault-api');
|
|
27
|
+
|
|
28
|
+
// Initialize authentication
|
|
29
|
+
const auth = new vvRestApi.authorize();
|
|
30
|
+
|
|
31
|
+
// Get authenticated client
|
|
32
|
+
auth.getVaultApi(
|
|
33
|
+
'your-client-id',
|
|
34
|
+
'your-client-secret',
|
|
35
|
+
'username',
|
|
36
|
+
'password',
|
|
37
|
+
'your-audience',
|
|
38
|
+
'https://your-vault-url.com',
|
|
39
|
+
'customer-alias',
|
|
40
|
+
'database-alias'
|
|
41
|
+
).then(client => {
|
|
42
|
+
console.log('Successfully authenticated!');
|
|
43
|
+
// Use the client for API calls
|
|
44
|
+
}).catch(error => {
|
|
45
|
+
console.error('Authentication failed:', error);
|
|
46
|
+
});
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
### JWT Authentication
|
|
50
|
+
|
|
51
|
+
If you already have a JWT token:
|
|
52
|
+
|
|
53
|
+
```javascript
|
|
54
|
+
const auth = new vvRestApi.authorize();
|
|
55
|
+
|
|
56
|
+
auth.getVaultApiFromJwt(
|
|
57
|
+
'your-jwt-token',
|
|
58
|
+
'https://your-vault-url.com',
|
|
59
|
+
'customer-alias',
|
|
60
|
+
'database-alias',
|
|
61
|
+
new Date('2024-12-31') // expiration date
|
|
62
|
+
).then(client => {
|
|
63
|
+
console.log('JWT authentication successful!');
|
|
64
|
+
}).catch(error => {
|
|
65
|
+
console.error('JWT authentication failed:', error);
|
|
66
|
+
});
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
## API Usage
|
|
70
|
+
|
|
71
|
+
Once authenticated, the client provides access to various API modules. All methods return Promises.
|
|
72
|
+
|
|
73
|
+
```javascript
|
|
74
|
+
// Example: Get forms by template name
|
|
75
|
+
client.forms.getForms(params, 'Your Form Template Name')
|
|
76
|
+
.then(response => {
|
|
77
|
+
const forms = JSON.parse(response);
|
|
78
|
+
console.log('Forms:', forms.data);
|
|
79
|
+
});
|
|
80
|
+
|
|
81
|
+
// Example: Execute a web service
|
|
82
|
+
client.scripts.runWebService('YourWebServiceName', { param1: 'value1' })
|
|
83
|
+
.then(response => {
|
|
84
|
+
console.log('Web service result:', response);
|
|
85
|
+
});
|
|
86
|
+
```
|
|
87
|
+
|
|
88
|
+
## API Modules
|
|
89
|
+
|
|
90
|
+
The client provides access to the following VisualVault API modules:
|
|
91
|
+
|
|
92
|
+
- **documents** - Document management operations
|
|
93
|
+
- **forms** - Form template and instance operations
|
|
94
|
+
- **library** - Folder and library management
|
|
95
|
+
- **users** - User management operations
|
|
96
|
+
- **groups** - Group management operations
|
|
97
|
+
- **sites** - Site management operations
|
|
98
|
+
- **files** - File upload/download operations
|
|
99
|
+
- **scripts** - Web service execution
|
|
100
|
+
- **customQuery** - Custom query execution
|
|
101
|
+
- **email** - Email operations
|
|
102
|
+
- **constants** - API constants and enums
|
|
103
|
+
- **scheduledProcess** - Scheduled process management
|
|
104
|
+
- **customer** - Customer management operations
|
|
105
|
+
- **projects** - Project management operations
|
|
106
|
+
- **indexFields** - Document Index field operations
|
|
107
|
+
- **outsideProcesses** - Outside process management
|
|
108
|
+
- **securityMembers** - Security member management
|
|
109
|
+
- **reports** - Report generation
|
|
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
|
|
120
|
+
|
|
121
|
+
## Error Handling
|
|
122
|
+
|
|
123
|
+
```javascript
|
|
124
|
+
client.documents.getDocuments(params, folderId)
|
|
125
|
+
.then(response => {
|
|
126
|
+
const result = JSON.parse(response);
|
|
127
|
+
if (result.meta && result.meta.statusCode === 200) {
|
|
128
|
+
console.log('Success:', result.data);
|
|
129
|
+
} else {
|
|
130
|
+
console.error('API Error:', result);
|
|
131
|
+
}
|
|
132
|
+
})
|
|
133
|
+
.catch(error => {
|
|
134
|
+
console.error('Request failed:', error);
|
|
135
|
+
});
|
|
136
|
+
```
|
|
137
|
+
|
|
138
|
+
## Support
|
|
139
|
+
|
|
140
|
+
For more information about the VisualVault API, visit the [VisualVault documentation](https://docs.visualvault.com/).
|
|
141
|
+
|
|
142
|
+
## License
|
|
143
|
+
|
|
144
|
+
This project is licensed under the [ISC License](LICENSE).
|
|
145
|
+
|
|
146
|
+
## Contributing
|
|
147
|
+
|
|
148
|
+
See [CONTRIBUTING.md](CONTRIBUTING.md) for development setup and guidelines.
|
package/dist/VVRestApi.cjs
CHANGED
|
@@ -604,9 +604,9 @@ var common_default = {
|
|
|
604
604
|
authorize: Authorize
|
|
605
605
|
};
|
|
606
606
|
|
|
607
|
-
// lib/docApi/
|
|
607
|
+
// lib/docApi/documentManager.js
|
|
608
608
|
init_cjs_shims();
|
|
609
|
-
var
|
|
609
|
+
var DocumentManager = class {
|
|
610
610
|
constructor(httpHelper) {
|
|
611
611
|
this._httpHelper = httpHelper;
|
|
612
612
|
}
|
|
@@ -667,7 +667,7 @@ var DocApi = class {
|
|
|
667
667
|
this.baseUrl = docApiConfig["apiUrl"] || null;
|
|
668
668
|
this.roleSecurity = docApiConfig["roleSecurity"] || false;
|
|
669
669
|
if (this.isEnabled) {
|
|
670
|
-
this.
|
|
670
|
+
this.documents = new DocumentManager(this._httpHelper);
|
|
671
671
|
}
|
|
672
672
|
}
|
|
673
673
|
};
|
|
@@ -726,9 +726,9 @@ var FormsApi_default = FormsApi;
|
|
|
726
726
|
// lib/ObjectsApi.js
|
|
727
727
|
init_cjs_shims();
|
|
728
728
|
|
|
729
|
-
// lib/objectsApi/
|
|
729
|
+
// lib/objectsApi/modelManager.js
|
|
730
730
|
init_cjs_shims();
|
|
731
|
-
var
|
|
731
|
+
var ModelManager = class {
|
|
732
732
|
constructor(httpHelper) {
|
|
733
733
|
this._httpHelper = httpHelper;
|
|
734
734
|
}
|
|
@@ -757,11 +757,11 @@ var ModelsManager = class {
|
|
|
757
757
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
758
758
|
}
|
|
759
759
|
};
|
|
760
|
-
var
|
|
760
|
+
var modelManager_default = ModelManager;
|
|
761
761
|
|
|
762
|
-
// lib/objectsApi/
|
|
762
|
+
// lib/objectsApi/objectManager.js
|
|
763
763
|
init_cjs_shims();
|
|
764
|
-
var
|
|
764
|
+
var ObjectManager = class {
|
|
765
765
|
constructor(httpHelper) {
|
|
766
766
|
this._httpHelper = httpHelper;
|
|
767
767
|
}
|
|
@@ -839,7 +839,7 @@ var ObjectsManager = class {
|
|
|
839
839
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
840
840
|
}
|
|
841
841
|
};
|
|
842
|
-
var
|
|
842
|
+
var objectManager_default = ObjectManager;
|
|
843
843
|
|
|
844
844
|
// lib/ObjectsApi.js
|
|
845
845
|
var import_js_yaml4 = __toESM(require("js-yaml"), 1);
|
|
@@ -858,8 +858,8 @@ var ObjectsApi = class {
|
|
|
858
858
|
this.isEnabled = objectsApiConfig["isEnabled"] || false;
|
|
859
859
|
this.baseUrl = objectsApiConfig["apiUrl"] || null;
|
|
860
860
|
if (this.isEnabled) {
|
|
861
|
-
this.models = new
|
|
862
|
-
this.objects = new
|
|
861
|
+
this.models = new modelManager_default(this._httpHelper);
|
|
862
|
+
this.objects = new objectManager_default(this._httpHelper);
|
|
863
863
|
}
|
|
864
864
|
}
|
|
865
865
|
};
|
|
@@ -968,6 +968,27 @@ var WorkflowManager = class {
|
|
|
968
968
|
};
|
|
969
969
|
var workflowManager_default = WorkflowManager;
|
|
970
970
|
|
|
971
|
+
// lib/studioApi/rolesAndPermissionsManager.js
|
|
972
|
+
init_cjs_shims();
|
|
973
|
+
var RolesAndPermissionsManager = class {
|
|
974
|
+
constructor(httpHelper) {
|
|
975
|
+
this._httpHelper = httpHelper;
|
|
976
|
+
}
|
|
977
|
+
/**
|
|
978
|
+
* Retrieves available features for the requesting user
|
|
979
|
+
* @param {object} params - Optional URL parameters to include in the request
|
|
980
|
+
*/
|
|
981
|
+
async getUserFeatures(params) {
|
|
982
|
+
var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.ResourceUserFeatures;
|
|
983
|
+
var url = this._httpHelper.getUrl(resourceUri);
|
|
984
|
+
var opts = { method: "GET" };
|
|
985
|
+
var data = {};
|
|
986
|
+
params = params || {};
|
|
987
|
+
return this._httpHelper.doVvClientRequest(url, opts, params, data);
|
|
988
|
+
}
|
|
989
|
+
};
|
|
990
|
+
var rolesAndPermissionsManager_default = RolesAndPermissionsManager;
|
|
991
|
+
|
|
971
992
|
// lib/StudioApi.js
|
|
972
993
|
var import_js_yaml5 = __toESM(require("js-yaml"), 1);
|
|
973
994
|
var import_fs5 = __toESM(require("fs"), 1);
|
|
@@ -986,6 +1007,7 @@ var StudioApi = class {
|
|
|
986
1007
|
this.baseUrl = studioApiConfig["studioApiUrl"] || null;
|
|
987
1008
|
if (this.isEnabled) {
|
|
988
1009
|
this.workflow = new workflowManager_default(this._httpHelper);
|
|
1010
|
+
this.permissions = new rolesAndPermissionsManager_default(this._httpHelper);
|
|
989
1011
|
}
|
|
990
1012
|
}
|
|
991
1013
|
};
|
|
@@ -1773,9 +1795,8 @@ var UsersManager = class {
|
|
|
1773
1795
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
1774
1796
|
}
|
|
1775
1797
|
getCurrentUser() {
|
|
1776
|
-
const resourceUri = this._httpHelper._config.ResourceUri.
|
|
1777
|
-
const
|
|
1778
|
-
const url = baseUrl + "/api/v1" + resourceUri;
|
|
1798
|
+
const resourceUri = this._httpHelper._config.ResourceUri.UsersMe;
|
|
1799
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
1779
1800
|
const opts = { method: "GET" };
|
|
1780
1801
|
const params = [];
|
|
1781
1802
|
return this._httpHelper.doVvClientRequest(url, opts, params, null);
|
|
@@ -2071,6 +2092,18 @@ var DocumentsManager = class {
|
|
|
2071
2092
|
};
|
|
2072
2093
|
return this._httpHelper.doVvClientRequest(url, opts, null, data);
|
|
2073
2094
|
}
|
|
2095
|
+
getDocumentWebDavUrl(documentId) {
|
|
2096
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWebDavUrl.replace("{id}", documentId);
|
|
2097
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2098
|
+
const opts = { method: "GET" };
|
|
2099
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2100
|
+
}
|
|
2101
|
+
getDocumentWopiUrl(documentId) {
|
|
2102
|
+
const resourceUri = this._httpHelper._config.ResourceUri.DocumentsWopiUrl.replace("{id}", documentId);
|
|
2103
|
+
const url = this._httpHelper.getUrl(resourceUri);
|
|
2104
|
+
const opts = { method: "GET" };
|
|
2105
|
+
return this._httpHelper.doVvClientRequest(url, opts, null, null);
|
|
2106
|
+
}
|
|
2074
2107
|
};
|
|
2075
2108
|
|
|
2076
2109
|
// lib/vvRestApi/projectsManager.js
|
|
@@ -2280,66 +2313,11 @@ var VVClient = class {
|
|
|
2280
2313
|
this.securityMembers = new SecurityMembersManager(this._httpHelper);
|
|
2281
2314
|
this.layouts = new LayoutsManager(this._httpHelper);
|
|
2282
2315
|
this.reports = new ReportsManager(this._httpHelper);
|
|
2283
|
-
this.
|
|
2284
|
-
|
|
2285
|
-
|
|
2286
|
-
|
|
2287
|
-
|
|
2288
|
-
return this._docApi;
|
|
2289
|
-
} else {
|
|
2290
|
-
throw new ReferenceError("Document Api not enabled");
|
|
2291
|
-
}
|
|
2292
|
-
}
|
|
2293
|
-
}
|
|
2294
|
-
});
|
|
2295
|
-
this._formsApi = null;
|
|
2296
|
-
Object.defineProperties(this, {
|
|
2297
|
-
formsApi: {
|
|
2298
|
-
get: function() {
|
|
2299
|
-
if (this._formsApi != null && this._formsApi.isEnabled && this._formsApi.baseUrl) {
|
|
2300
|
-
return this._formsApi;
|
|
2301
|
-
} else {
|
|
2302
|
-
throw new ReferenceError("Forms Api not enabled");
|
|
2303
|
-
}
|
|
2304
|
-
}
|
|
2305
|
-
}
|
|
2306
|
-
});
|
|
2307
|
-
this._objectsApi = null;
|
|
2308
|
-
Object.defineProperties(this, {
|
|
2309
|
-
objectsApi: {
|
|
2310
|
-
get: function() {
|
|
2311
|
-
if (this._objectsApi != null && this._objectsApi.isEnabled && this._objectsApi.baseUrl) {
|
|
2312
|
-
return this._objectsApi;
|
|
2313
|
-
} else {
|
|
2314
|
-
throw new ReferenceError("Objects Api not enabled");
|
|
2315
|
-
}
|
|
2316
|
-
}
|
|
2317
|
-
}
|
|
2318
|
-
});
|
|
2319
|
-
this._studioApi = null;
|
|
2320
|
-
Object.defineProperties(this, {
|
|
2321
|
-
studioApi: {
|
|
2322
|
-
get: function() {
|
|
2323
|
-
if (this._studioApi != null && this._studioApi.isEnabled && this._studioApi.baseUrl) {
|
|
2324
|
-
return this._studioApi;
|
|
2325
|
-
} else {
|
|
2326
|
-
throw new ReferenceError("Studio Api not enabled");
|
|
2327
|
-
}
|
|
2328
|
-
}
|
|
2329
|
-
}
|
|
2330
|
-
});
|
|
2331
|
-
this._notificationsApi = null;
|
|
2332
|
-
Object.defineProperties(this, {
|
|
2333
|
-
notificationsApi: {
|
|
2334
|
-
get: function() {
|
|
2335
|
-
if (this._notificationsApi != null && this._notificationsApi.isEnabled && this._notificationsApi.baseUrl) {
|
|
2336
|
-
return this._notificationsApi;
|
|
2337
|
-
} else {
|
|
2338
|
-
throw new ReferenceError("Notifications Api not enabled");
|
|
2339
|
-
}
|
|
2340
|
-
}
|
|
2341
|
-
}
|
|
2342
|
-
});
|
|
2316
|
+
this.docApi = null;
|
|
2317
|
+
this.formsApi = null;
|
|
2318
|
+
this.objectsApi = null;
|
|
2319
|
+
this.studioApi = null;
|
|
2320
|
+
this.notificationsApi = null;
|
|
2343
2321
|
}
|
|
2344
2322
|
async createDocApi(sessionToken) {
|
|
2345
2323
|
const docApiConfigResponse = JSON.parse(await this.configuration.getDocApiConfig());
|
|
@@ -2348,12 +2326,12 @@ var VVClient = class {
|
|
|
2348
2326
|
docApiSession.baseUrl = docApiConfigResponse.data["apiUrl"];
|
|
2349
2327
|
docApiSession.apiUrl = this.yamlConfig.DocApiUri;
|
|
2350
2328
|
if (docApiSession["tokenType"] == "jwt") {
|
|
2351
|
-
this.
|
|
2329
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2352
2330
|
} else if (this.users) {
|
|
2353
2331
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(docApiSession.audience));
|
|
2354
2332
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2355
2333
|
docApiSession.convertToJwt(jwtResponse["data"]);
|
|
2356
|
-
this.
|
|
2334
|
+
this.docApi = new DocApi_default(docApiSession, docApiConfigResponse.data);
|
|
2357
2335
|
}
|
|
2358
2336
|
}
|
|
2359
2337
|
}
|
|
@@ -2365,12 +2343,12 @@ var VVClient = class {
|
|
|
2365
2343
|
formsApiSession.baseUrl = formsApiConfigResponse.data["formsApiUrl"];
|
|
2366
2344
|
formsApiSession.apiUrl = this.yamlConfig.FormsApiUri;
|
|
2367
2345
|
if (formsApiSession["tokenType"] == "jwt") {
|
|
2368
|
-
this.
|
|
2346
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2369
2347
|
} else if (this.users) {
|
|
2370
2348
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(formsApiSession.audience));
|
|
2371
2349
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2372
2350
|
formsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2373
|
-
this.
|
|
2351
|
+
this.formsApi = new FormsApi_default(formsApiSession, formsApiConfigResponse.data);
|
|
2374
2352
|
}
|
|
2375
2353
|
}
|
|
2376
2354
|
}
|
|
@@ -2382,12 +2360,12 @@ var VVClient = class {
|
|
|
2382
2360
|
objectsApiSession.baseUrl = objectsApiConfigResponse.data["apiUrl"];
|
|
2383
2361
|
objectsApiSession.apiUrl = "";
|
|
2384
2362
|
if (objectsApiSession["tokenType"] == "jwt") {
|
|
2385
|
-
this.
|
|
2363
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2386
2364
|
} else if (this.users) {
|
|
2387
2365
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(objectsApiSession.audience));
|
|
2388
2366
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2389
2367
|
objectsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2390
|
-
this.
|
|
2368
|
+
this.objectsApi = new ObjectsApi_default(objectsApiSession, objectsApiConfigResponse.data);
|
|
2391
2369
|
}
|
|
2392
2370
|
}
|
|
2393
2371
|
}
|
|
@@ -2399,12 +2377,12 @@ var VVClient = class {
|
|
|
2399
2377
|
studioApiSession.baseUrl = studioApiConfigResponse.data["studioApiUrl"];
|
|
2400
2378
|
studioApiSession.apiUrl = "";
|
|
2401
2379
|
if (studioApiSession["tokenType"] == "jwt") {
|
|
2402
|
-
this.
|
|
2380
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2403
2381
|
} else if (this.users) {
|
|
2404
2382
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(studioApiSession.audience));
|
|
2405
2383
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2406
2384
|
studioApiSession.convertToJwt(jwtResponse["data"]);
|
|
2407
|
-
this.
|
|
2385
|
+
this.studioApi = new StudioApi_default(studioApiSession, studioApiConfigResponse.data);
|
|
2408
2386
|
}
|
|
2409
2387
|
}
|
|
2410
2388
|
}
|
|
@@ -2416,12 +2394,12 @@ var VVClient = class {
|
|
|
2416
2394
|
notificationsApiSession.baseUrl = notificationsApiConfigResponse.data["apiUrl"];
|
|
2417
2395
|
notificationsApiSession.apiUrl = this.yamlConfig.NotificationsApiUri;
|
|
2418
2396
|
if (notificationsApiSession["tokenType"] == "jwt") {
|
|
2419
|
-
this.
|
|
2397
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2420
2398
|
} else if (this.users) {
|
|
2421
2399
|
const jwtResponse = JSON.parse(await this.users.getUserJwt(notificationsApiSession.audience));
|
|
2422
2400
|
if (jwtResponse["data"] && jwtResponse["data"]["token"]) {
|
|
2423
2401
|
notificationsApiSession.convertToJwt(jwtResponse["data"]);
|
|
2424
|
-
this.
|
|
2402
|
+
this.notificationsApi = new NotificationsApi_default(notificationsApiSession, notificationsApiConfigResponse.data);
|
|
2425
2403
|
}
|
|
2426
2404
|
}
|
|
2427
2405
|
}
|