@medicus.ai/medicus-report-pdf-generator 1.0.231 → 1.0.233

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.
@@ -34,16 +34,14 @@ body {
34
34
 
35
35
  .participant-analytics-section.single-section.page {
36
36
  background-color: #fff;
37
- margin-top: -20px;
37
+ margin-top: -65px;
38
38
  }
39
39
 
40
40
  .bottom-section {
41
41
  display: block;
42
42
  width: 100%;
43
- page-break-inside: avoid;
43
+
44
44
  float: left;
45
- margin-top:3%;
46
- page-break-before: avoid;
47
45
  }
48
46
 
49
47
  .page .relations-section-container {
@@ -228,7 +226,9 @@ td.bar-title span {
228
226
  color: rgb(51, 51, 51);
229
227
  text-align: right;
230
228
  direction: ltr;
229
+ text-transform: capitalize
231
230
  }
231
+
232
232
  /*
233
233
  .participant-analytics-section .container .side-chart-container:nth-child(odd) .bar-title span {
234
234
  text-align: left;
@@ -390,23 +390,19 @@ td {
390
390
  }
391
391
 
392
392
  .relations-section .single-relation {
393
- width: 48.5%;
393
+ width: 30%;
394
394
  float: left;
395
395
  padding: 1% 1% 0% 1%;
396
396
  box-sizing: border-box;
397
397
  color: rgb(0, 0, 153);
398
398
  margin-right: 3%;
399
- margin-bottom: 3%;
400
- }
401
- .relations-section .single-relation:nth-child(even){
402
- margin-right: 0
403
399
  }
404
- /*
400
+
405
401
  .relations-section .single-relation:nth-child(4n) {
406
402
  margin-right: 5%;
407
403
  width: 30%;
408
404
  }
409
- */
405
+
410
406
  .relation-title {
411
407
  font-weight: 600;
412
408
  font-size: 83%;
@@ -449,14 +445,12 @@ table.data-by-gender {
449
445
  margin-top: 3%;
450
446
  float: left;
451
447
  text-align: left;
452
- font-size: 85%;
448
+ font-size: 91%;
453
449
  border-spacing: 0;
454
450
  margin-bottom: 6%;
455
451
  page-break-inside: avoid;
456
452
  }
457
- table.data-by-gender tr th{
458
- font-size: 12px;
459
- }
453
+
460
454
  table.data-by-gender tr th:first-child {
461
455
  width: 20%;
462
456
  }
@@ -465,9 +459,6 @@ table.data-by-gender tr td {
465
459
  color: rgb(51, 51, 51);
466
460
  font-size: 80%;
467
461
  }
468
- table.data-by-gender tr:first-child td{
469
- border-bottom: 1px solid #5F9CC8;
470
- }
471
462
 
472
463
  table.data-by-gender th {
473
464
  color: rgb(139, 139, 167);
@@ -479,33 +470,19 @@ table.data-by-gender th {
479
470
  table.data-by-gender tbody tr:first-child td {
480
471
  color: rgb(139, 139, 167);
481
472
  font-weight: 600;
482
- font-size: 8px;
483
- }
484
- table.data-by-gender tbody tr:first-child td:first-child{
485
- color: rgba(51, 51, 51, 1) !important;
486
- font-weight: 600;
487
- font-size: 10px;
473
+ font-size: 9px;
488
474
  }
475
+
489
476
  table.data-by-gender td, table.data-by-gender th {
490
477
  padding: 4px;
491
478
  }
492
- table.data-by-gender th:nth-child(2),
493
- table.data-by-gender th:nth-child(3){
494
- text-align: center;
495
- }
496
- table.data-by-gender th:nth-child(2),
497
- table.data-by-gender th:nth-child(3),
498
- table.data-by-gender tbody tr td:nth-child(6),
499
- table.data-by-gender tbody tr td:nth-child(11){
500
- border-right: 1px solid rgba(98, 142, 171, 1)
479
+
480
+ table.data-by-gender tbody tr:nth-child(even) {
481
+ background-color: rgb(237, 237, 248);
501
482
  }
502
483
 
503
484
  table.data-by-gender tr td:last-child {
504
485
  text-align: center;
505
- color:rgba(98, 142, 171, 1)
506
- }
507
- table.data-by-gender tr td:not(:first-child) {
508
- text-align: center;
509
486
  }
510
487
 
511
488
  .recommends-section {
@@ -519,7 +496,6 @@ table.data-by-gender tr td:not(:first-child) {
519
496
  transform: skewY(3deg);
520
497
  border-top-right-radius: 20px;
521
498
  border-bottom-right-radius: 20px;
522
- page-break-inside: avoid;
523
499
  }
524
500
 
525
501
  .recommends-section-content {
@@ -18,10 +18,6 @@ body {
18
18
  padding-left: 50px;
19
19
  }
20
20
 
21
- .side-chart-container {
22
- float: right;
23
- }
24
-
25
21
  td.bar-title {
26
22
  width: 35.7%;
27
23
  border-right: 1px solid;
package/index.js CHANGED
@@ -94,9 +94,7 @@ module.exports = {
94
94
  let encryptionKey=reportData.encryptionKey
95
95
  let sentData=reportData.data
96
96
  let ecbDecrypted = encryptDecrypt.ecbDecrypt(sentData, encryptionKey)
97
-
98
97
  let xorDecrypted = encryptDecrypt.XORDecrypt(ecbDecrypted.toString(), encryptionKey)
99
- console.log("xorDecrypted",xorDecrypted)
100
98
  let LOGS = '';
101
99
  let LOGS_FILE_PATH = __dirname + '/output/LOGS.txt';
102
100
  let PDF_FILE_PATH = __dirname + '/output/nasco-sample.pdf';
@@ -170,6 +168,7 @@ module.exports = {
170
168
  else{
171
169
  let xorEncrypted = encryptDecrypt.XOREncrypt(base64data, encryptionKey)
172
170
  let ecbEncrypted = encryptDecrypt.ecbEncrypt(xorEncrypted.toString(), encryptionKey)
171
+ console.log("ecbEncrypted",ecbEncrypted)
173
172
  return ecbEncrypted;
174
173
  }
175
174
 
@@ -1,5 +1,5 @@
1
1
  const CryptoJS = require('crypto-js');
2
- var atob = require('atob');
2
+ let atob = require('atob');
3
3
 
4
4
  function ecbEncrypt(data, key) {
5
5
  let encJson = CryptoJS.AES.encrypt(JSON.stringify(data), key).toString();
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@medicus.ai/medicus-report-pdf-generator",
3
- "version": "1.0.231",
4
- "description": "Nasco corporate report - latest update in 2/11/2022 - Fix sanusx coprorate report issues",
3
+ "version": "1.0.233",
4
+ "description": "Nasco corporate report - latest update in 17/11/2023 - Decrypt/Encrypt Nasco report",
5
5
  "main": "index.js",
6
6
  "scripts": {
7
7
  "start": "node index.js"
@@ -16,7 +16,6 @@
16
16
  "canvas": "^2.6.1",
17
17
  "canvas-constructor": "^3.2.0",
18
18
  "chart.js": "^2.7.3",
19
- "crypto-js": "^4.1.1",
20
19
  "express": "^4.16.4",
21
20
  "get-canvas-context": "^1.0.2",
22
21
  "hummus": "1.0.111",
@@ -12,6 +12,7 @@
12
12
  <div class="relations-section relations-section-content"></div>
13
13
  </div>
14
14
  <table class="data-by-gender">
15
+
15
16
  </table>
16
17
  <div class="bottom-section">
17
18
  <div class="recommends-section">
@@ -1,217 +0,0 @@
1
- /*
2
- This Javascript will en/decrypt a string using the HTML XOR algorithim
3
- XORCRYPT Version 1.2
4
-
5
- This version is much faster because it does not use Base64 encoding.
6
- It is also more difficult to crack, because the key is as long as the
7
- password, and the only way to hack it is to try every possible password.
8
-
9
- The latest version has some small bugs cleaned up, reorganized decrypt
10
- sequence and is now crossplatform, crossbrowser compatible, with the
11
- exception of Netscape 2.X. It would be possible to make it compatible
12
- with Netscape 2.X, but I see no point.
13
-
14
- For more information on this very simple algorithim email me.
15
-
16
- This script was written by:
17
- Evan Jones, 1997
18
- jonesev@home.com
19
- You may use this script any way you wish as long as you email me and let me know.
20
- */
21
-
22
- /* Create the encrypt table */
23
- // The last char in the table is always the escape code
24
- // The table is not quite 128 chars, it is 95 (minus the escape char)
25
- // Values 93-127 must be escaped
26
-
27
- var cryptTable=new String(" ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789 !@#$%^&*()`'-=[];,./?_+{}|:<>~");
28
- var cryptLength=new Number(cryptTable.length-1) //93 Chars
29
- var escapeChar=cryptTable.charAt(cryptLength); // The escape code is ~
30
-
31
- var lineFeed="\n"; //The linefeed char - escaped to double escapeChar
32
- var doubleQuote='"'; //Double quotes are escaped to ~'
33
- var clearMessage=new Number(5000); //The number of ms to wait to clear the status bar message
34
-
35
- /* This function uses the key and encrypts a string with the password */
36
- // Encryption strips all linefeeds - but they are replaced upon decrypt
37
- function encrypt(input, password)
38
- {
39
- var inChar, inValue, outValue;
40
-
41
- var output="";
42
- var arNumberPw = new Array();
43
-
44
- var pwLength=password.length;
45
- var inLength=input.length;
46
-
47
- var stopStatus=Math.round(inLength/10);
48
- var statusBar=0;
49
-
50
- for (var pwIndex=0; pwIndex<pwLength; pwIndex++)
51
- {
52
- arNumberPw[pwIndex]=cryptTable.indexOf(password.charAt(pwIndex));
53
- }
54
-
55
- /* XOR all the chars */
56
- for (var inIndex=0, pwIndex=0; inIndex<inLength; inIndex++, pwIndex++)
57
- {
58
- if (pwIndex==pwLength) //Make sure the password index is in range
59
- {
60
- pwIndex=0;
61
- }
62
-
63
- /* Get the input */
64
-
65
- inChar=input.charAt(inIndex)
66
- inValue=cryptTable.indexOf(inChar);
67
-
68
- /* Conversion/Escaping Sequence */
69
- // If the outValue is in the character map, encode it
70
- // If the encoded value is outside the character map, escape it
71
- // Else convert it to a char
72
- // If the input char is a linefeed, escape it
73
- // If the input char is a double quote, escape it
74
- // If the input char wasn't found, pass it through
75
-
76
- if (inValue!=-1)
77
- {
78
- outValue=arNumberPw[pwIndex] ^ inValue;
79
- if (outValue>=cryptLength)
80
- {
81
- outValue=escapeChar+cryptTable.charAt(outValue-cryptLength);
82
- }
83
- else outValue=cryptTable.charAt(outValue);
84
- }
85
- else if (inChar=="\r")
86
- {
87
- outValue=escapeChar+escapeChar;
88
- if (input.charAt(inIndex+1)=="\n") inIndex++; //If it is a 2 char linefeed skip next one
89
- }
90
- else if (inChar=="\n")
91
- {
92
- outValue=escapeChar+escapeChar;
93
- }
94
- else if (inChar==doubleQuote)
95
- {
96
- outValue=escapeChar+"'";
97
- }
98
- else
99
- {
100
- outValue=inChar;
101
- }
102
-
103
- output+=outValue; //Output the char
104
-
105
- /* Status bar progress indicator */
106
-
107
- if (inIndex>=statusBar)
108
- {
109
- window.status=inIndex+"/"+inLength+" characters decrypted ("+Math.round(inIndex/inLength*100)+"%)";
110
- statusBar+=stopStatus;
111
- }
112
- }
113
-
114
- window.status=inLength+"/"+inLength+" characters encrypted (100%)";
115
- setTimeout("window.status=''", clearMessage);
116
-
117
- return output;
118
- }
119
-
120
-
121
- /* This function uses the key and encrypts a string with the password */
122
-
123
- function decrypt(input, password)
124
- {
125
- var inChar, inValue, outValue, escape=false;
126
-
127
- var output="";
128
- var arNumberPw = new Array();
129
-
130
- var pwLength=password.length;
131
- var inLength=input.length;
132
-
133
- var stopStatus=Math.round(inLength/10);
134
- var statusBar=0;
135
-
136
- for (var pwIndex=0; pwIndex<pwLength; pwIndex++)
137
- {
138
- arNumberPw[pwIndex]=cryptTable.indexOf(password.charAt(pwIndex));
139
- }
140
-
141
- /* XOR all the chars */
142
- for (var inIndex=0, pwIndex=0; inIndex<inLength; inIndex++, pwIndex++)
143
- {
144
- if (pwIndex>=pwLength) //Make sure the password index is in range
145
- {
146
- pwIndex=0;
147
- }
148
-
149
- /* Get the input */
150
- inChar=input.charAt(inIndex);
151
- inValue=cryptTable.indexOf(inChar);
152
-
153
- /* Decrypting/Unescaping Sequence */
154
- // If the input char wasn't found, pass it through (error checking)
155
- // If the last char was an escapeChar
156
- //And the input is an escapeChar, output a linefeed
157
- //Or the input is a single quote, output a double quote
158
- //Otherwise just add the cryptLength to the inValue
159
- //Turn escape off
160
- // If the inValue hasn't been coverted to an outValue yet
161
- // If the inChar is an escapeChar, turn escape on
162
- // Otherwise decrypt the encrypted character
163
-
164
- if (inValue==-1)
165
- {
166
- outValue=inChar;
167
- }
168
-
169
- else if (escape)
170
- {
171
- if (inValue==cryptLength)
172
- {
173
- outValue=lineFeed;
174
- inValue=-1;
175
- }
176
- else if (inChar=="'")
177
- {
178
- outValue=doubleQuote;
179
- inValue=-1;
180
- }
181
- else
182
- {
183
- inValue+=cryptLength;
184
- }
185
- escape=false;
186
- }
187
- else if (inValue==cryptLength)
188
- {
189
- escape=true;
190
- pwIndex--; //Stop the password from incrementing
191
- outValue="";
192
- inValue=-1;
193
- }
194
-
195
- if (inValue!=-1)
196
- {
197
- outValue=cryptTable.charAt(arNumberPw[pwIndex] ^ inValue);
198
- }
199
-
200
- /* Output */
201
-
202
- output+=outValue;
203
-
204
- /* Status bar progress indicator */
205
-
206
- if (inIndex>=statusBar)
207
- {
208
- window.status=inIndex+"/"+inLength+" characters decrypted ("+Math.round(inIndex/inLength*100)+"%)";
209
- statusBar+=stopStatus;
210
- }
211
- }
212
-
213
- window.status=inLength+"/"+inLength+" characters decrypted (100%)";
214
- setTimeout("window.status=''", clearMessage);
215
-
216
- return output;
217
- }