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
@@ -1,66 +0,0 @@
1
- //DocApi
2
- var common = require('./common');
3
-
4
- module.exports = class DocApi {
5
- constructor(sessionToken, docApiConfig) {
6
- if (!sessionToken['tokenType'] && sessionToken['tokenType'] != 'jwt') {
7
- return;
8
- }
9
-
10
- var yaml = require('js-yaml');
11
- var fs = require('fs');
12
- var yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/config.yml', 'utf8'));
13
- this._httpHelper = new common.httpHelper(sessionToken, yamlConfig);
14
-
15
- this.isEnabled = docApiConfig['isEnabled'] || false;
16
- this.baseUrl = docApiConfig['apiUrl'] || null;
17
- this.roleSecurity = docApiConfig['roleSecurity'] || false;
18
-
19
- }
20
-
21
- async GetRevision(documentRevisionId) {
22
- let resourceUri = this._httpHelper._config.ResourceUri.DocApi.GetRevision;
23
- resourceUri = resourceUri.replace('{id}', documentRevisionId);
24
- const url = this._httpHelper.getUrl(resourceUri);
25
- const opts = { method: 'GET' };
26
-
27
- return this._httpHelper.doVvClientRequest(url, opts, null, null);
28
- }
29
-
30
- async getDocumentOcrStatus(documentRevisionId) {
31
- let resourceUri = this._httpHelper._config.ResourceUri.DocApi.OcrStatus;
32
- resourceUri = resourceUri.replace('{id}', documentRevisionId);
33
- const url = this._httpHelper.getUrl(resourceUri);
34
-
35
- const opts = { method: 'GET' };
36
- return this._httpHelper.doVvClientRequest(url, opts, null, null);
37
- }
38
-
39
- async updateDocumentOcrStatus(documentRevisionId, data) {
40
- let resourceUri = this._httpHelper._config.ResourceUri.DocApi.OcrStatus;
41
- resourceUri = resourceUri.replace('{id}', documentRevisionId);
42
- const url = this._httpHelper.getUrl(resourceUri);
43
-
44
- const opts = { method: 'PUT' };
45
- return this._httpHelper.doVvClientRequest(url, opts, null, data);
46
- }
47
-
48
- async search(criteriaList, searchFolders, excludeFolders, sortBy, sortDirection = 'desc', page = 0, take = 15, archiveType = 0, roleSecurity = false) {
49
- const url = this._httpHelper.getUrl(this._httpHelper._config.ResourceUri.DocApi.AdvancedSearch);
50
-
51
- var data = {
52
- criteriaList,
53
- searchFolders,
54
- excludeFolders,
55
- sortBy,
56
- sortDirection,
57
- page,
58
- take,
59
- archiveType,
60
- roleSecurity
61
- };
62
-
63
- const options = { method: 'POST'};
64
- return this._httpHelper.doVvClientRequest(url, options, null, data);
65
- }
66
- }
@@ -1,51 +0,0 @@
1
- //forms api
2
- var common = require('./common');
3
-
4
- module.exports = class FormsApi {
5
- constructor(sessionToken, formsApiConfig){
6
- if(!sessionToken['tokenType'] && sessionToken['tokenType'] != 'jwt'){
7
- return;
8
- }
9
-
10
- var yaml = require('js-yaml');
11
- var fs = require('fs');
12
- var yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/config.yml', 'utf8'));
13
- this._httpHelper = new common.httpHelper(sessionToken, yamlConfig);
14
-
15
- this.isEnabled = formsApiConfig['isEnabled'] || false;
16
- this.baseUrl = formsApiConfig['formsApiUrl'] || null;
17
-
18
- if(this.isEnabled){
19
- this.formInstances = new FormInstanceManager(this._httpHelper);
20
- }
21
- }
22
- }
23
-
24
- class FormInstanceManager{
25
- constructor(httpHelper){
26
- this._httpHelper = httpHelper;
27
- }
28
-
29
- async postForm(params, data, formTemplateRevisionId) {
30
- var resourceUri = this._httpHelper._config.ResourceUri.FormsApi.FormInstance;
31
- var url = this._httpHelper.getUrl(resourceUri);
32
- var opts = { method: 'POST' };
33
-
34
- data['formTemplateId'] = formTemplateRevisionId || data['formTemplateId'];
35
-
36
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
37
- }
38
-
39
- async postFormRevision(params, data, formTemplateRevisionId, formId){
40
- var resourceUri = this._httpHelper._config.ResourceUri.FormsApi.FormInstance;
41
- var url = this._httpHelper.getUrl(resourceUri);
42
- var opts = { method: 'PUT' };
43
-
44
- // only add these if provided. params could already have the value
45
- data['formTemplateId'] = formTemplateRevisionId || data['formTemplateId'];
46
- data['formId'] = formId || data['formId'];
47
-
48
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
49
- }
50
- }
51
-
@@ -1,39 +0,0 @@
1
- // Notifications API
2
- var common = require('./common');
3
-
4
- module.exports = class NotificationsApi {
5
- constructor(sessionToken, notificationsApiConfig) {
6
- if(!sessionToken['tokenType'] && sessionToken['tokenType'] != 'jwt'){
7
- return;
8
- }
9
-
10
- var yaml = require('js-yaml');
11
- var fs = require('fs');
12
- var yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/config.yml', 'utf8'));
13
- console.log("Before")
14
- this._httpHelper = new common.httpHelper(sessionToken, yamlConfig);
15
- console.log('After');
16
-
17
- this.isEnabled = notificationsApiConfig['isEnabled'] || false;
18
- this.baseUrl = notificationsApiConfig['apiUrl'] || null;
19
-
20
- if (this.isEnabled) {
21
- this.users = new UserNotificationsManager(this._httpHelper);
22
- }
23
- }
24
- }
25
-
26
- class UserNotificationsManager {
27
- constructor (httpHelper) {
28
- this._httpHelper = httpHelper;
29
- }
30
-
31
- async forceUIRefresh(userGuid) {
32
- var resourceUri = this._httpHelper._config.ResourceUri.NotificationsApi.ForceUIRefresh.replace('{id}', userGuid);
33
- var url = this._httpHelper.getUrl(resourceUri);
34
- var opts = { method: 'POST' };
35
- var params = {};
36
- var data = {};
37
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
38
- }
39
- }
@@ -1,136 +0,0 @@
1
- //studio api
2
- var common = require('./common');
3
-
4
- module.exports = class StudioApi {
5
- constructor(sessionToken, studioApiConfig){
6
- if(!sessionToken['tokenType'] && sessionToken['tokenType'] != 'jwt'){
7
- return;
8
- }
9
-
10
- var yaml = require('js-yaml');
11
- var fs = require('fs');
12
- var yamlConfig = yaml.safeLoad(fs.readFileSync(__dirname + '/config.yml', 'utf8'));
13
- this._httpHelper = new common.httpHelper(sessionToken, yamlConfig);
14
-
15
- this.isEnabled = studioApiConfig['isEnabled'] || false;
16
- this.baseUrl = studioApiConfig['studioApiUrl'] || null;
17
- this.apiUrl = '';
18
-
19
- if(this.isEnabled){
20
- this.workflow = new WorkflowManager(this._httpHelper);
21
- }
22
- }
23
- }
24
-
25
- /** Manage Workflows */
26
- class WorkflowManager{
27
- constructor(httpHelper){
28
- this._httpHelper = httpHelper;
29
- }
30
-
31
- /** Gets the latest published workflow by Id*/
32
- async getWorkflow(workflowId){
33
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowLatestPublishedId.replace('{id}', workflowId);
34
- var url = this._httpHelper.getUrl(resourceUri);
35
- var opts = { method: 'GET' };
36
- var data = {};
37
- var params = {};
38
-
39
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
40
- }
41
-
42
- /** Gets the latest published workflow by Name */
43
- async getWorkflowByName(workflowName){
44
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowLatestPublished;
45
- var url = this._httpHelper.getUrl(resourceUri);
46
- var opts = { method: 'GET' };
47
- var data = {};
48
- var params = { name: workflowName };
49
-
50
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
51
- }
52
-
53
- /** Gets workflow variables assigned to the workflow */
54
- async getWorkflowVariables(params, workflowId){
55
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowVariables.replace('{id}', workflowId);
56
- var url = this._httpHelper.getUrl(resourceUri);
57
- var opts = { method: 'GET' };
58
- var data = {};
59
- params = params || {};
60
-
61
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
62
- }
63
-
64
- /**
65
- * Triggers workflow
66
- * @param {string} workflowId
67
- * @param {number} workflowRevision
68
- * @param {string} objectId
69
- * @param {object[]} workflowVariables - workflow values to be submitted to the workflow
70
- * * @param {string} workflowVariables[].name = name of variable
71
- * * @param {*} workflowVariables[].value - value to be passed
72
- * * @param {number} workflowVariables[].dataType - Text: 1, Number: 2, Date: 3, Boolean: 4
73
- */
74
- async triggerWorkflow(workflowId, workflowRevision, objectId, workflowVariables){
75
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowRun.replace('{id}', workflowId).replace('{revision}', workflowRevision);
76
- var url = this._httpHelper.getUrl(resourceUri);
77
- var opts = { method: 'POST' };
78
- var data ={
79
- objectId: objectId,
80
- reference: 'API',
81
- data: {
82
- workflowVariables: workflowVariables,
83
- dataSetVariables: []
84
- }
85
- };
86
- var params = {};
87
-
88
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
89
- }
90
-
91
- /**
92
- * Terminates the workflow instance
93
- * @param {string} workflowId
94
- * @param {string} instanceId
95
- * @returns
96
- */
97
- async terminateWorkflow(workflowId, instanceId){
98
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowTerminate.replace('{workflowId}', workflowId).replace('{instanceId}', instanceId);
99
- var url = this._httpHelper.getUrl(resourceUri);
100
- var opts = { method: 'POST' };
101
- var data ={}
102
- var params = {};
103
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
104
- }
105
-
106
- /**
107
- * Returns workflow history for an object under the provided workflow
108
- * @param {string} workflowId
109
- * @param {string} objectId
110
- * @returns
111
- */
112
- async GetWorkflowHistoryForObject(objectId, workflowId){
113
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowHistoryObject.replace('{workflowId}', workflowId).replace('{objectId}', objectId);
114
- var url = this._httpHelper.getUrl(resourceUri);
115
- var opts = { method: 'GET' };
116
- var data ={}
117
- var params = {};
118
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
119
- }
120
-
121
- /**
122
- * Returns the running workflow, if any, for an object under the provided workflow
123
- * @param {string} workflowId
124
- * @param {string} objectId
125
- * @returns
126
- */
127
- async GetRunningWorkflowForObject(objectId, workflowId){
128
- var resourceUri = this._httpHelper._config.ResourceUri.StudioApi.WorkflowHistoryRunningObject.replace('{workflowId}', workflowId).replace('{objectId}', objectId);
129
- var url = this._httpHelper.getUrl(resourceUri);
130
- var opts = { method: 'GET' };
131
- var data ={}
132
- var params = {};
133
- return this._httpHelper.doVvClientRequest(url, opts, params, data);
134
- }
135
- }
136
-