@fre4x/grok 1.0.53 → 1.0.54
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/index.js +6 -5
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -16767,7 +16767,7 @@ var require_form_data = __commonJS({
|
|
|
16767
16767
|
var parseUrl = __require("url").parse;
|
|
16768
16768
|
var fs3 = __require("fs");
|
|
16769
16769
|
var Stream = __require("stream").Stream;
|
|
16770
|
-
var
|
|
16770
|
+
var crypto3 = __require("crypto");
|
|
16771
16771
|
var mime = require_mime_types();
|
|
16772
16772
|
var asynckit = require_asynckit();
|
|
16773
16773
|
var setToStringTag = require_es_set_tostringtag();
|
|
@@ -16973,7 +16973,7 @@ var require_form_data = __commonJS({
|
|
|
16973
16973
|
return Buffer.concat([dataBuffer, Buffer.from(this._lastBoundary())]);
|
|
16974
16974
|
};
|
|
16975
16975
|
FormData3.prototype._generateBoundary = function() {
|
|
16976
|
-
this._boundary = "--------------------------" +
|
|
16976
|
+
this._boundary = "--------------------------" + crypto3.randomBytes(12).toString("hex");
|
|
16977
16977
|
};
|
|
16978
16978
|
FormData3.prototype.getLengthSync = function() {
|
|
16979
16979
|
var knownLength = this._overheadLength + this._valueLength;
|
|
@@ -32551,6 +32551,7 @@ var paginationSchema = z2.object({
|
|
|
32551
32551
|
import * as fs from "node:fs/promises";
|
|
32552
32552
|
import * as path from "node:path";
|
|
32553
32553
|
import * as os from "node:os";
|
|
32554
|
+
import * as crypto from "node:crypto";
|
|
32554
32555
|
var PersistentCache = class {
|
|
32555
32556
|
cacheDir;
|
|
32556
32557
|
memoryCache = /* @__PURE__ */ new Map();
|
|
@@ -32562,7 +32563,7 @@ var PersistentCache = class {
|
|
|
32562
32563
|
await fs.mkdir(this.cacheDir, { recursive: true });
|
|
32563
32564
|
}
|
|
32564
32565
|
getFilePath(key) {
|
|
32565
|
-
const safeKey =
|
|
32566
|
+
const safeKey = crypto.createHash("sha256").update(key).digest("hex");
|
|
32566
32567
|
return path.join(this.cacheDir, `${safeKey}.json`);
|
|
32567
32568
|
}
|
|
32568
32569
|
async get(key) {
|
|
@@ -42917,7 +42918,7 @@ var transitional_default = {
|
|
|
42917
42918
|
};
|
|
42918
42919
|
|
|
42919
42920
|
// ../node_modules/axios/lib/platform/node/index.js
|
|
42920
|
-
import
|
|
42921
|
+
import crypto2 from "crypto";
|
|
42921
42922
|
|
|
42922
42923
|
// ../node_modules/axios/lib/platform/node/classes/URLSearchParams.js
|
|
42923
42924
|
import url2 from "url";
|
|
@@ -42935,7 +42936,7 @@ var generateString = (size = 16, alphabet = ALPHABET.ALPHA_DIGIT) => {
|
|
|
42935
42936
|
let str = "";
|
|
42936
42937
|
const { length } = alphabet;
|
|
42937
42938
|
const randomValues = new Uint32Array(size);
|
|
42938
|
-
|
|
42939
|
+
crypto2.randomFillSync(randomValues);
|
|
42939
42940
|
for (let i = 0; i < size; i++) {
|
|
42940
42941
|
str += alphabet[randomValues[i] % length];
|
|
42941
42942
|
}
|