@ariobarin/glossa 0.1.0-beta.7 → 0.1.0-beta.8
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.
- package/dist/main.js +27 -5
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -63,7 +63,14 @@ var SecureStore = class {
|
|
|
63
63
|
} catch {
|
|
64
64
|
}
|
|
65
65
|
if (serialized != null) {
|
|
66
|
-
|
|
66
|
+
try {
|
|
67
|
+
return { value: this.#options.parse(serialized), backend: "keyring" };
|
|
68
|
+
} catch {
|
|
69
|
+
try {
|
|
70
|
+
await entry.deleteCredential();
|
|
71
|
+
} catch {
|
|
72
|
+
}
|
|
73
|
+
}
|
|
67
74
|
}
|
|
68
75
|
}
|
|
69
76
|
let value;
|
|
@@ -86,13 +93,23 @@ var SecureStore = class {
|
|
|
86
93
|
}
|
|
87
94
|
async delete() {
|
|
88
95
|
const entry = await this.#entry();
|
|
96
|
+
let keyringDeleteFailed = false;
|
|
89
97
|
if (entry) {
|
|
90
98
|
try {
|
|
91
|
-
await entry.deleteCredential();
|
|
99
|
+
const deleted = await entry.deleteCredential();
|
|
100
|
+
if (!deleted && await entry.getPassword() != null) {
|
|
101
|
+
keyringDeleteFailed = true;
|
|
102
|
+
}
|
|
92
103
|
} catch {
|
|
104
|
+
keyringDeleteFailed = true;
|
|
93
105
|
}
|
|
94
106
|
}
|
|
95
107
|
await rm(this.#options.file, { force: true });
|
|
108
|
+
if (keyringDeleteFailed) {
|
|
109
|
+
throw new Error(
|
|
110
|
+
"The operating-system credential store could not remove the Glossa credential."
|
|
111
|
+
);
|
|
112
|
+
}
|
|
96
113
|
}
|
|
97
114
|
async #entry() {
|
|
98
115
|
if (this.#options.entryProvider) {
|
|
@@ -13403,6 +13420,7 @@ async function deleteDeviceCredential() {
|
|
|
13403
13420
|
// src/worker/command-service.ts
|
|
13404
13421
|
import { spawn as spawn2 } from "node:child_process";
|
|
13405
13422
|
import { randomUUID } from "node:crypto";
|
|
13423
|
+
import { StringDecoder } from "node:string_decoder";
|
|
13406
13424
|
import { setTimeout as delay2 } from "node:timers/promises";
|
|
13407
13425
|
|
|
13408
13426
|
// src/worker/errors.ts
|
|
@@ -13430,6 +13448,10 @@ function capture(stream, chunk) {
|
|
|
13430
13448
|
function emptyCapture() {
|
|
13431
13449
|
return { chunks: [], bytes: 0, truncated: false };
|
|
13432
13450
|
}
|
|
13451
|
+
function decodeCapture(stream) {
|
|
13452
|
+
const content = Buffer.concat(stream.chunks);
|
|
13453
|
+
return stream.truncated ? new StringDecoder("utf8").write(content) : content.toString("utf8");
|
|
13454
|
+
}
|
|
13433
13455
|
function shellInvocation(command) {
|
|
13434
13456
|
if (process.platform === "win32") {
|
|
13435
13457
|
const file2 = process.env.GLOSSA_WINDOWS_SHELL ?? "powershell.exe";
|
|
@@ -13609,8 +13631,8 @@ var CommandService = class {
|
|
|
13609
13631
|
base.finishedAt = new Date(record2.finishedAt).toISOString();
|
|
13610
13632
|
base.exitCode = record2.exitCode ?? null;
|
|
13611
13633
|
base.signal = record2.signal ?? null;
|
|
13612
|
-
base.stdout =
|
|
13613
|
-
base.stderr =
|
|
13634
|
+
base.stdout = decodeCapture(record2.stdout);
|
|
13635
|
+
base.stderr = decodeCapture(record2.stderr);
|
|
13614
13636
|
base.stdoutTruncated = record2.stdout.truncated;
|
|
13615
13637
|
base.stderrTruncated = record2.stderr.truncated;
|
|
13616
13638
|
}
|
|
@@ -14202,7 +14224,7 @@ async function selectExposureRoot(explicitPath, allowBroadRoot = false, cwd = pr
|
|
|
14202
14224
|
}
|
|
14203
14225
|
|
|
14204
14226
|
// src/main.ts
|
|
14205
|
-
var VERSION = "0.1.0-beta.
|
|
14227
|
+
var VERSION = "0.1.0-beta.8";
|
|
14206
14228
|
var helpText = {
|
|
14207
14229
|
main: `Glossa ${VERSION}
|
|
14208
14230
|
|