shiftacle-desktop-agent 0.1.1 → 0.1.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 (2) hide show
  1. package/package.json +1 -1
  2. package/src/auth.mjs +18 -16
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "shiftacle-desktop-agent",
3
- "version": "0.1.1",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "description": "Desktop agent that auto-fills your EMR with clinical notes from Shiftacle",
6
6
  "bin": {
package/src/auth.mjs CHANGED
@@ -35,23 +35,25 @@ async function promptCredentials() {
35
35
  if (stdin.setRawMode) stdin.setRawMode(true);
36
36
  let pw = '';
37
37
  const onData = (ch) => {
38
- const c = ch.toString();
39
- if (c === '\n' || c === '\r') {
40
- if (stdin.setRawMode) stdin.setRawMode(wasRaw ?? false);
41
- stdin.removeListener('data', onData);
42
- process.stdout.write('\n');
43
- resolve(pw);
44
- } else if (c === '\u007f' || c === '\b') {
45
- if (pw.length > 0) {
46
- pw = pw.slice(0, -1);
47
- process.stdout.write('\b \b');
38
+ const str = ch.toString();
39
+ for (const c of str) {
40
+ if (c === '\n' || c === '\r') {
41
+ if (stdin.setRawMode) stdin.setRawMode(wasRaw ?? false);
42
+ stdin.removeListener('data', onData);
43
+ process.stdout.write('\n');
44
+ resolve(pw);
45
+ return;
46
+ } else if (c === '\u007f' || c === '\b') {
47
+ if (pw.length > 0) {
48
+ pw = pw.slice(0, -1);
49
+ process.stdout.write('\b \b');
50
+ }
51
+ } else if (c === '\u0003') {
52
+ process.exit(1);
53
+ } else {
54
+ pw += c;
55
+ process.stdout.write('*');
48
56
  }
49
- } else if (c === '\u0003') {
50
- // Ctrl+C
51
- process.exit(1);
52
- } else {
53
- pw += c;
54
- process.stdout.write('*');
55
57
  }
56
58
  };
57
59
  stdin.on('data', onData);