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.
Files changed (45) hide show
  1. package/LICENSE +15 -0
  2. package/README.md +23 -140
  3. package/dist/VVRestApi.cjs +2552 -0
  4. package/dist/VVRestApi.cjs.map +1 -0
  5. package/dist/VVRestApi.d.cts +386 -0
  6. package/dist/VVRestApi.d.ts +386 -0
  7. package/dist/VVRestApi.js +2522 -0
  8. package/dist/VVRestApi.js.map +1 -0
  9. package/{lib/VVRestApi/VVRestApiNodeJs → dist}/config.yml +3 -3
  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 +2572 -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 +2541 -0
  21. package/dist/index.js.map +1 -0
  22. package/package.json +46 -70
  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/ObjectsApi.js +0 -138
  27. package/lib/VVRestApi/VVRestApiNodeJs/StudioApi.js +0 -156
  28. package/lib/VVRestApi/VVRestApiNodeJs/VVRestApi.js +0 -1974
  29. package/lib/VVRestApi/VVRestApiNodeJs/app.js +0 -128
  30. package/lib/VVRestApi/VVRestApiNodeJs/common.js +0 -1598
  31. package/lib/VVRestApi/VVRestApiNodeJs/dts/express.d.ts +0 -125
  32. package/lib/VVRestApi/VVRestApiNodeJs/dts/node.d.ts +0 -1090
  33. package/lib/VVRestApi/VVRestApiNodeJs/files/237de37cf014ee1199a400d49e26e066.js +0 -51
  34. package/lib/VVRestApi/VVRestApiNodeJs/files/437833dc404aed118b0e644bf02b9c8a.js +0 -1
  35. package/lib/VVRestApi/VVRestApiNodeJs/log.js +0 -20
  36. package/lib/VVRestApi/VVRestApiNodeJs/public/favicon.ico +0 -0
  37. package/lib/VVRestApi/VVRestApiNodeJs/routes/scheduledscripts.js +0 -203
  38. package/lib/VVRestApi/VVRestApiNodeJs/routes/scripts.js +0 -215
  39. package/lib/VVRestApi/VVRestApiNodeJs/routes/testScheduledScripts.js +0 -131
  40. package/lib/VVRestApi/VVRestApiNodeJs/samples/SampleScheduledScript.js +0 -90
  41. package/lib/VVRestApi/VVRestApiNodeJs/samples/SendEmailScript.js +0 -51
  42. package/lib/VVRestApi/VVRestApiNodeJs/samples/fileTest.js +0 -60
  43. package/lib/VVRestApi/VVRestApiNodeJs/samples/sampleFormValidationScript.js +0 -126
  44. package/lib/VVRestApi/VVRestApiNodeJs/views/error.ejs +0 -8
  45. package/lib/VVRestApi/VVRestApiNodeJs/views/index.ejs +0 -8
@@ -1,128 +0,0 @@
1
-
2
- var logger = require('./log');
3
-
4
- var message = "Web site starting";
5
- logger.info(message);
6
-
7
- //If using a Virtual Directory name, set routeAlias
8
- //For example, https://myserver:3000/vvnodeserver
9
- //If virtual directory is not present in the URL it will be ignored
10
- var routeAlias = 'vvnodeserver';
11
-
12
- var express = require('express'),
13
- scriptController = require('./routes/scripts'),
14
- scheduleController = require('./routes/scheduledscripts'),
15
- testScheduledScriptsController = require('./routes/testScheduledScripts'),
16
- http = require('http'),
17
- https = require('https'),
18
- fs = require('fs'),
19
- path = require('path'),
20
- bodyParser = require('body-parser'),
21
- multer = require('multer'),
22
- favicon = require('serve-favicon'),
23
- expressErrorHandler = require('express-error-handler');
24
-
25
- var app = express();
26
-
27
- var upload=multer();
28
-
29
-
30
- app.set('port', process.env.PORT || 3000);
31
- app.set('httpsPort', process.env.PORT || 3001);
32
- app.set('views', __dirname + '/views');
33
- app.set('view engine', 'ejs');
34
- app.use(allowCors);
35
- app.use(favicon(path.join(__dirname, 'public', 'favicon.ico')));
36
- //app.use(bodyParser.json());
37
- app.use(bodyParser.json({limit: '5mb'}));
38
- app.use(express.static(path.join(__dirname, 'public')));
39
- app.use(errorHandler);
40
-
41
-
42
- //express error handler
43
- function errorHandler(err, req, res, next) {
44
-
45
- //if http headers sent do not attempt to send a response
46
- //next(err) will pass the error to default express error handler
47
- if (res.headersSent) {
48
- return next(err);
49
- }
50
-
51
- logger.error(err.stack);
52
- res.status(500);
53
- res.render('error', { error: err });
54
- }
55
-
56
- // Add CORS headers
57
- function allowCors(req, res, next) {
58
-
59
- // Website you wish to allow to connect
60
- res.setHeader('Access-Control-Allow-Origin', '*');
61
-
62
- // Request methods you wish to allow
63
- res.setHeader('Access-Control-Allow-Methods', 'GET, POST, OPTIONS, PUT, PATCH, DELETE');
64
-
65
- // Request headers you wish to allow
66
- res.setHeader('Access-Control-Allow-Headers', 'X-Requested-With,content-type');
67
-
68
- // Set to true if you need the website to include cookies in the requests sent
69
- // to the API (e.g. in case you use sessions)
70
- res.setHeader('Access-Control-Allow-Credentials', true);
71
-
72
- if (req.method === "OPTIONS") {
73
- res.header('Access-Control-Allow-Origin', req.headers.origin);
74
- console.log("OPTIONS Requested");
75
- } else {
76
- res.header('Access-Control-Allow-Origin', '*');
77
- }
78
-
79
- // Pass to next layer of middleware
80
- next();
81
- }
82
-
83
-
84
- //HTTP GET: /
85
- app.get('/' + routeAlias, scriptController.testsite);
86
- app.get('/node/' + routeAlias, scriptController.testsite);
87
- app.get('/', scriptController.testsite);
88
- app.get('/node/', scriptController.testsite);
89
-
90
- //HTTP GET: /app.js
91
- app.get('/' + routeAlias + '/app.js', scriptController.testsite);
92
- app.get('/node/' + routeAlias + '/app.js', scriptController.testsite);
93
- app.get('/app.js', scriptController.testsite);
94
- app.get('/node/app.js', scriptController.testsite);
95
-
96
- //HTTP POST: /scripts
97
- //HTTP POST: /node/scripts
98
- app.post('/' + routeAlias + '/scripts', scriptController.scripts);
99
- app.post('/node/' + routeAlias + '/scripts', scriptController.scripts);
100
- app.post('/scripts', scriptController.scripts);
101
- app.post('/node/scripts', scriptController.scripts);
102
-
103
- //HTTP GET: /scripts
104
- //HTTP GET: /node/scripts
105
- app.get('/' + routeAlias + '/scripts', scriptController.scripts);
106
- app.get('/node/' + routeAlias + '/scripts', scriptController.scripts);
107
- app.get('/scripts', scriptController.scripts);
108
- app.get('/node/scripts', scriptController.scripts);
109
-
110
- //HTTP POST: /scheduledscripts
111
- //HTTP POST: /node/scheduledscripts
112
- app.post('/' + routeAlias + '/scheduledscripts',upload.array(),scheduleController.processRequest);
113
- app.post('/node/' + routeAlias + '/scheduledscripts',upload.array(),scheduleController.processRequest);
114
- app.post('/scheduledscripts',upload.array(),scheduleController.processRequest);
115
- app.post('/node/scheduledscripts',upload.array(),scheduleController.processRequest);
116
-
117
- //HTTP GET: /testscripts/scheduled/:name
118
- //HTTP GET: /node/testscripts/scheduled/:name
119
- app.get('/' + routeAlias + '/testscripts/scheduled/:name', testScheduledScriptsController.processRequest);
120
- app.get('/node/' + routeAlias + '/testscripts/scheduled/:name', testScheduledScriptsController.processRequest);
121
- app.get('/testscripts/scheduled/:name', testScheduledScriptsController.processRequest);
122
- app.get('/node/testscripts/scheduled/:name', testScheduledScriptsController.processRequest);
123
-
124
- //Start listening on configured port
125
- http.createServer(app).listen(app.get('port'), function () {
126
- logger.info("Express server listening on port " + app.get('port'));
127
- console.log("Express server listening on port " + app.get('port'));
128
- });