@algolia/wizard 0.68.0 → 0.69.0
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 +17 -14
- package/package.json +1 -1
package/dist/main.js
CHANGED
|
@@ -1969,7 +1969,7 @@ function identify(traits) {
|
|
|
1969
1969
|
// package.json
|
|
1970
1970
|
var package_default = {
|
|
1971
1971
|
name: "@algolia/wizard",
|
|
1972
|
-
version: "0.
|
|
1972
|
+
version: "0.69.0",
|
|
1973
1973
|
description: "Magically implement Algolia functionality in your codebase",
|
|
1974
1974
|
type: "module",
|
|
1975
1975
|
engines: {
|
|
@@ -2810,10 +2810,11 @@ import { relative as relative3 } from "node:path";
|
|
|
2810
2810
|
import { z as z12 } from "zod";
|
|
2811
2811
|
|
|
2812
2812
|
// src/lib/keychain.ts
|
|
2813
|
+
import { createHash } from "node:crypto";
|
|
2813
2814
|
import { deletePassword, getPassword, setPassword } from "cross-keychain";
|
|
2814
2815
|
import { z as z11 } from "zod";
|
|
2815
2816
|
var SERVICE = "algolia-wizard";
|
|
2816
|
-
var account = (userId) => `api-keys
|
|
2817
|
+
var account = (userId) => `api-keys-${createHash("sha256").update(userId).digest("hex")}`;
|
|
2817
2818
|
var storedKeysSchema = z11.record(z11.string(), z11.string());
|
|
2818
2819
|
function entryId(kind, index, appId) {
|
|
2819
2820
|
return `${kind}:${appId}:${index}`;
|
|
@@ -2875,15 +2876,17 @@ function storeKey(kind, userId, index, appId, value) {
|
|
|
2875
2876
|
}
|
|
2876
2877
|
function deleteStoredKeys(userId) {
|
|
2877
2878
|
return serialized(async () => {
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2882
|
-
|
|
2883
|
-
|
|
2884
|
-
|
|
2885
|
-
|
|
2886
|
-
|
|
2879
|
+
for (const keychainAccount of [account(userId), "api-keys"]) {
|
|
2880
|
+
try {
|
|
2881
|
+
await deletePassword(SERVICE, keychainAccount);
|
|
2882
|
+
} catch (err) {
|
|
2883
|
+
const message = err.message;
|
|
2884
|
+
if (/not found/i.test(message)) continue;
|
|
2885
|
+
logger.warn(
|
|
2886
|
+
{ err: message, userId },
|
|
2887
|
+
"could not delete the API keys from the keychain"
|
|
2888
|
+
);
|
|
2889
|
+
}
|
|
2887
2890
|
}
|
|
2888
2891
|
});
|
|
2889
2892
|
}
|
|
@@ -3303,7 +3306,7 @@ import { relative as relative5 } from "node:path";
|
|
|
3303
3306
|
// src/lib/tools/reviewScript.ts
|
|
3304
3307
|
import { tool as tool8 } from "ai";
|
|
3305
3308
|
import z15 from "zod";
|
|
3306
|
-
import { createHash } from "node:crypto";
|
|
3309
|
+
import { createHash as createHash2 } from "node:crypto";
|
|
3307
3310
|
import { readFile as readFile7, stat as stat2 } from "node:fs/promises";
|
|
3308
3311
|
import { relative as relative4 } from "node:path";
|
|
3309
3312
|
|
|
@@ -3320,7 +3323,7 @@ function serializePrompt(work) {
|
|
|
3320
3323
|
var reviewedCommandApprovals = /* @__PURE__ */ new WeakMap();
|
|
3321
3324
|
async function fileDigest(filePath) {
|
|
3322
3325
|
const content = await readFile7(filePath);
|
|
3323
|
-
return
|
|
3326
|
+
return createHash2("sha256").update(content).digest("hex");
|
|
3324
3327
|
}
|
|
3325
3328
|
function grantReviewedCommandApproval(ctx, approval) {
|
|
3326
3329
|
reviewedCommandApprovals.set(ctx, approval);
|
|
@@ -7499,7 +7502,7 @@ function delay(ms) {
|
|
|
7499
7502
|
// package.json with { type: 'json' }
|
|
7500
7503
|
var package_default2 = {
|
|
7501
7504
|
name: "@algolia/wizard",
|
|
7502
|
-
version: "0.
|
|
7505
|
+
version: "0.69.0",
|
|
7503
7506
|
description: "Magically implement Algolia functionality in your codebase",
|
|
7504
7507
|
type: "module",
|
|
7505
7508
|
engines: {
|