pinme 1.1.6-alpha.2 → 1.1.6-alpha.3
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 +7 -6
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -1523,7 +1523,7 @@ var import_chalk9 = __toESM(require("chalk"));
|
|
|
1523
1523
|
var import_figlet3 = __toESM(require("figlet"));
|
|
1524
1524
|
|
|
1525
1525
|
// package.json
|
|
1526
|
-
var version = "1.1.6-alpha.
|
|
1526
|
+
var version = "1.1.6-alpha.3";
|
|
1527
1527
|
|
|
1528
1528
|
// bin/upload.ts
|
|
1529
1529
|
var import_path6 = __toESM(require("path"));
|
|
@@ -5188,17 +5188,18 @@ async function getMyDomains() {
|
|
|
5188
5188
|
var URL2 = "https://pinme.eth.limo/#/preview/";
|
|
5189
5189
|
var secretKey = "pinme-secret-key";
|
|
5190
5190
|
checkNodeVersion();
|
|
5191
|
-
function encryptHash(
|
|
5191
|
+
function encryptHash(contentHash, key, uid) {
|
|
5192
5192
|
try {
|
|
5193
5193
|
if (!key) {
|
|
5194
5194
|
throw new Error("Secret key not found");
|
|
5195
5195
|
}
|
|
5196
|
-
const
|
|
5196
|
+
const combined = uid ? `${contentHash}-${uid}` : contentHash;
|
|
5197
|
+
const encrypted = import_crypto_js.default.RC4.encrypt(combined, key).toString();
|
|
5197
5198
|
const urlSafe = encrypted.replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
5198
5199
|
return urlSafe;
|
|
5199
5200
|
} catch (error) {
|
|
5200
5201
|
console.error(`Encryption error: ${error.message}`);
|
|
5201
|
-
return
|
|
5202
|
+
return contentHash;
|
|
5202
5203
|
}
|
|
5203
5204
|
}
|
|
5204
5205
|
function checkPathSync(inputPath) {
|
|
@@ -5252,7 +5253,7 @@ var upload_default = async (options) => {
|
|
|
5252
5253
|
try {
|
|
5253
5254
|
const result = await uploadToIpfsSplit_default(absolutePath);
|
|
5254
5255
|
if (result) {
|
|
5255
|
-
const encryptedCID = encryptHash(result.contentHash, secretKey);
|
|
5256
|
+
const encryptedCID = encryptHash(result.contentHash, secretKey, result.shortUrl);
|
|
5256
5257
|
console.log(
|
|
5257
5258
|
import_chalk4.default.cyan(
|
|
5258
5259
|
import_figlet.default.textSync("Successful", { horizontalLayout: "full" })
|
|
@@ -5302,7 +5303,7 @@ var upload_default = async (options) => {
|
|
|
5302
5303
|
try {
|
|
5303
5304
|
const result = await uploadToIpfsSplit_default(absolutePath);
|
|
5304
5305
|
if (result) {
|
|
5305
|
-
const encryptedCID = encryptHash(result.contentHash, secretKey);
|
|
5306
|
+
const encryptedCID = encryptHash(result.contentHash, secretKey, result.shortUrl);
|
|
5306
5307
|
console.log(
|
|
5307
5308
|
import_chalk4.default.cyan(
|
|
5308
5309
|
import_figlet.default.textSync("Successful", { horizontalLayout: "full" })
|