comprodls-sdk 2.123.2-security → 2.123.4-oidc-poc.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 (36) hide show
  1. package/.eslintrc +28 -28
  2. package/.github/workflows/npm-publish.yml +76 -0
  3. package/README.md +235 -235
  4. package/dist/comprodls-sdk.js +13543 -13543
  5. package/docs/npm-oidc-publishing-runbook.md +229 -0
  6. package/lib/comprodls.js +132 -132
  7. package/lib/config/index.js +356 -356
  8. package/lib/helpers/index.js +31 -31
  9. package/lib/helpers/lib/api/converter.js +129 -129
  10. package/lib/helpers/lib/api/index.js +46 -46
  11. package/lib/helpers/lib/errors.js +122 -122
  12. package/lib/helpers/lib/requestLayer.js +154 -154
  13. package/lib/helpers/lib/validator.js +192 -192
  14. package/lib/open_access/index.js +116 -116
  15. package/lib/services/analytics/index.js +1365 -1365
  16. package/lib/services/attempts/index.js +389 -389
  17. package/lib/services/auth/index.js +3708 -3708
  18. package/lib/services/authextn/index.js +1032 -1032
  19. package/lib/services/datasyncmanager/index.js +275 -275
  20. package/lib/services/drive/index.js +270 -270
  21. package/lib/services/integrations/index.js +525 -525
  22. package/lib/services/invitations/index.js +282 -282
  23. package/lib/services/product/index.js +343 -343
  24. package/lib/services/pub/index.js +530 -530
  25. package/lib/services/pushX/index.js +251 -251
  26. package/lib/services/pushX/pubnubClientWrapper.js +438 -438
  27. package/lib/services/rules/index.js +416 -416
  28. package/lib/services/spaces/index.js +999 -999
  29. package/lib/services/spacesextn/index.js +131 -131
  30. package/lib/services/superuser/index.js +160 -160
  31. package/lib/services/taxonomy/index.js +405 -405
  32. package/lib/services/workflows/index.js +406 -406
  33. package/lib/services/xapi/index.js +114 -114
  34. package/lib/token/index.js +120 -120
  35. package/lib/token/validations.js +85 -85
  36. package/package.json +5 -1
@@ -1,154 +1,154 @@
1
- /*************************************************************************
2
- *
3
- * COMPRO CONFIDENTIAL
4
- * __________________
5
- *
6
- * [2015] - [2020] Compro Technologies Private Limited
7
- * All Rights Reserved.
8
- *
9
- * NOTICE: All information contained herein is, and remains
10
- * the property of Compro Technologies Private Limited. The
11
- * intellectual and technical concepts contained herein are
12
- * proprietary to Compro Technologies Private Limited and may
13
- * be covered by U.S. and Foreign Patents, patents in process,
14
- * and are protected by trade secret or copyright law.
15
- *
16
- * Dissemination of this information or reproduction of this material
17
- * is strictly forbidden unless prior written permission is obtained
18
- * from Compro Technologies Pvt. Ltd..
19
- ***************************************************************************/
20
-
21
- var Request = require('superagent');
22
- var Agent = require('agentkeepalive');
23
-
24
- var keepaliveAgent = new Agent({
25
- timeout: 60000,
26
- freeSocketTimeout: 30000
27
- });
28
-
29
- /**
30
- * Sends an HTTP GET request to the specified URL with query parameters and optional headers.
31
- *
32
- * @param {string} url - The endpoint to send the request to.
33
- * @param {Object} options.params - Query parameters to append to the URL.
34
- * @param {Object} options.headers - Optional headers including traceid and token.
35
- */
36
- function getRequest(url, options) {
37
- var params = options.params, headers = options.headers;
38
-
39
- return new Promise(function (resolve, reject) {
40
- // Setup request with URL and Params
41
- var requestAPI = Request.get(url)
42
- .set('Accept', 'application/json')
43
- .query(params);
44
-
45
- // Setting headers in the request.
46
- if (headers) {
47
- if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
48
- if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
49
- }
50
-
51
- requestAPI
52
- .agent(keepaliveAgent)
53
- .then(function (res) { resolve(res); })
54
- .catch(function (err) { reject(err); });
55
- });
56
- }
57
-
58
- /**
59
- * Sends an HTTP POST request to the specified URL with a JSON body and optional headers.
60
- *
61
- * @param {string} url - The endpoint to send the request to.
62
- * @param {Object} options.params - Payload to be sent in the request body.
63
- * @param {Object} options.headers - Optional headers including traceid and token.
64
- */
65
- function postRequest(url, options) {
66
- var params = options.params, headers = options.headers;
67
-
68
- return new Promise(function (resolve, reject) {
69
- //Setup request with URL and Params
70
- var requestAPI = Request.post(url)
71
- .set('Content-Type', 'application/json')
72
- .set('Accept', 'application/json')
73
- .send(params);
74
-
75
- // Setting headers in the request.
76
- if (headers) {
77
- if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
78
- if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
79
- }
80
-
81
- requestAPI
82
- .agent(keepaliveAgent)
83
- .then(function (res) { resolve(res); })
84
- .catch(function (err) { reject(err); });
85
- });
86
- }
87
-
88
- /**
89
- * Sends an HTTP PUT request to the specified URL with a JSON body and optional headers.
90
- *
91
- * @param {string} url - The endpoint to send the request to.
92
- * @param {Object} options.params - Payload to be sent in the request body.
93
- * @param {Object} options.headers - Optional headers including traceid and token.
94
- */
95
- function putRequest(url, options) {
96
- var params = options.params, headers = options.headers;
97
-
98
- return new Promise(function (resolve, reject) {
99
- //Setup request with URL and Params
100
- var requestAPI = Request.put(url)
101
- .set('Content-Type', 'application/json')
102
- .set('Accept', 'application/json')
103
- .send(params);
104
-
105
- // Setting headers in the request.
106
- if (headers) {
107
- if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
108
- if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
109
- }
110
-
111
- requestAPI
112
- .agent(keepaliveAgent)
113
- .then(function (res) { resolve(res); })
114
- .catch(function (err) { reject(err); });
115
- });
116
- }
117
-
118
- /**
119
- * Sends an HTTP DELETE request to the specified URL with optional payload and headers.
120
- *
121
- * @param {string} url - The endpoint to send the request to.
122
- * @param {Object} options.params - Payload to be sent in the request body (optional).
123
- * @param {Object} options.headers - Optional headers including traceid and token.
124
- */
125
- function deleteRequest(url, options) {
126
- var params = options.params, headers = options.headers;
127
-
128
- return new Promise(function (resolve, reject) {
129
- //Setup request with URL and Params
130
- var requestAPI = Request.delete(url)
131
- .set('Content-Type', 'application/json')
132
- .set('Accept', 'application/json')
133
- .send(params);
134
-
135
-
136
- // Setting headers in the request.
137
- if (headers) {
138
- if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
139
- if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
140
- }
141
-
142
- requestAPI
143
- .agent(keepaliveAgent)
144
- .then(function (res) { resolve(res); })
145
- .catch(function (err) { reject(err); });
146
- });
147
- }
148
-
149
- module.exports = {
150
- get: getRequest,
151
- post: postRequest,
152
- put: putRequest,
153
- delete: deleteRequest
154
- };
1
+ /*************************************************************************
2
+ *
3
+ * COMPRO CONFIDENTIAL
4
+ * __________________
5
+ *
6
+ * [2015] - [2020] Compro Technologies Private Limited
7
+ * All Rights Reserved.
8
+ *
9
+ * NOTICE: All information contained herein is, and remains
10
+ * the property of Compro Technologies Private Limited. The
11
+ * intellectual and technical concepts contained herein are
12
+ * proprietary to Compro Technologies Private Limited and may
13
+ * be covered by U.S. and Foreign Patents, patents in process,
14
+ * and are protected by trade secret or copyright law.
15
+ *
16
+ * Dissemination of this information or reproduction of this material
17
+ * is strictly forbidden unless prior written permission is obtained
18
+ * from Compro Technologies Pvt. Ltd..
19
+ ***************************************************************************/
20
+
21
+ var Request = require('superagent');
22
+ var Agent = require('agentkeepalive');
23
+
24
+ var keepaliveAgent = new Agent({
25
+ timeout: 60000,
26
+ freeSocketTimeout: 30000
27
+ });
28
+
29
+ /**
30
+ * Sends an HTTP GET request to the specified URL with query parameters and optional headers.
31
+ *
32
+ * @param {string} url - The endpoint to send the request to.
33
+ * @param {Object} options.params - Query parameters to append to the URL.
34
+ * @param {Object} options.headers - Optional headers including traceid and token.
35
+ */
36
+ function getRequest(url, options) {
37
+ var params = options.params, headers = options.headers;
38
+
39
+ return new Promise(function (resolve, reject) {
40
+ // Setup request with URL and Params
41
+ var requestAPI = Request.get(url)
42
+ .set('Accept', 'application/json')
43
+ .query(params);
44
+
45
+ // Setting headers in the request.
46
+ if (headers) {
47
+ if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
48
+ if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
49
+ }
50
+
51
+ requestAPI
52
+ .agent(keepaliveAgent)
53
+ .then(function (res) { resolve(res); })
54
+ .catch(function (err) { reject(err); });
55
+ });
56
+ }
57
+
58
+ /**
59
+ * Sends an HTTP POST request to the specified URL with a JSON body and optional headers.
60
+ *
61
+ * @param {string} url - The endpoint to send the request to.
62
+ * @param {Object} options.params - Payload to be sent in the request body.
63
+ * @param {Object} options.headers - Optional headers including traceid and token.
64
+ */
65
+ function postRequest(url, options) {
66
+ var params = options.params, headers = options.headers;
67
+
68
+ return new Promise(function (resolve, reject) {
69
+ //Setup request with URL and Params
70
+ var requestAPI = Request.post(url)
71
+ .set('Content-Type', 'application/json')
72
+ .set('Accept', 'application/json')
73
+ .send(params);
74
+
75
+ // Setting headers in the request.
76
+ if (headers) {
77
+ if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
78
+ if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
79
+ }
80
+
81
+ requestAPI
82
+ .agent(keepaliveAgent)
83
+ .then(function (res) { resolve(res); })
84
+ .catch(function (err) { reject(err); });
85
+ });
86
+ }
87
+
88
+ /**
89
+ * Sends an HTTP PUT request to the specified URL with a JSON body and optional headers.
90
+ *
91
+ * @param {string} url - The endpoint to send the request to.
92
+ * @param {Object} options.params - Payload to be sent in the request body.
93
+ * @param {Object} options.headers - Optional headers including traceid and token.
94
+ */
95
+ function putRequest(url, options) {
96
+ var params = options.params, headers = options.headers;
97
+
98
+ return new Promise(function (resolve, reject) {
99
+ //Setup request with URL and Params
100
+ var requestAPI = Request.put(url)
101
+ .set('Content-Type', 'application/json')
102
+ .set('Accept', 'application/json')
103
+ .send(params);
104
+
105
+ // Setting headers in the request.
106
+ if (headers) {
107
+ if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
108
+ if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
109
+ }
110
+
111
+ requestAPI
112
+ .agent(keepaliveAgent)
113
+ .then(function (res) { resolve(res); })
114
+ .catch(function (err) { reject(err); });
115
+ });
116
+ }
117
+
118
+ /**
119
+ * Sends an HTTP DELETE request to the specified URL with optional payload and headers.
120
+ *
121
+ * @param {string} url - The endpoint to send the request to.
122
+ * @param {Object} options.params - Payload to be sent in the request body (optional).
123
+ * @param {Object} options.headers - Optional headers including traceid and token.
124
+ */
125
+ function deleteRequest(url, options) {
126
+ var params = options.params, headers = options.headers;
127
+
128
+ return new Promise(function (resolve, reject) {
129
+ //Setup request with URL and Params
130
+ var requestAPI = Request.delete(url)
131
+ .set('Content-Type', 'application/json')
132
+ .set('Accept', 'application/json')
133
+ .send(params);
134
+
135
+
136
+ // Setting headers in the request.
137
+ if (headers) {
138
+ if (headers.traceid) { requestAPI.set('X-Amzn-Trace-Id', headers.traceid); }
139
+ if (headers.token) { requestAPI.set('Authorization', headers.token.access_token); }
140
+ }
141
+
142
+ requestAPI
143
+ .agent(keepaliveAgent)
144
+ .then(function (res) { resolve(res); })
145
+ .catch(function (err) { reject(err); });
146
+ });
147
+ }
148
+
149
+ module.exports = {
150
+ get: getRequest,
151
+ post: postRequest,
152
+ put: putRequest,
153
+ delete: deleteRequest
154
+ };