pinme 1.1.6-alpha.1 → 1.1.6-alpha.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.
- package/dist/index.js +19 -17
- 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.2";
|
|
1527
1527
|
|
|
1528
1528
|
// bin/upload.ts
|
|
1529
1529
|
var import_path6 = __toESM(require("path"));
|
|
@@ -5106,7 +5106,7 @@ function getAuthConfig() {
|
|
|
5106
5106
|
function getAuthHeaders() {
|
|
5107
5107
|
const conf = getAuthConfig();
|
|
5108
5108
|
if (!conf) {
|
|
5109
|
-
throw new Error("Auth not set. Run: pinme set-
|
|
5109
|
+
throw new Error("Auth not set. Run: pinme set-appkey <AppKey>");
|
|
5110
5110
|
}
|
|
5111
5111
|
return {
|
|
5112
5112
|
"token-address": conf.address,
|
|
@@ -5534,28 +5534,28 @@ var remove_default = async (options) => {
|
|
|
5534
5534
|
}
|
|
5535
5535
|
};
|
|
5536
5536
|
|
|
5537
|
-
// bin/set-
|
|
5537
|
+
// bin/set-appkey.ts
|
|
5538
5538
|
var import_chalk7 = __toESM(require("chalk"));
|
|
5539
5539
|
var import_inquirer3 = __toESM(require("inquirer"));
|
|
5540
|
-
async function
|
|
5540
|
+
async function setAppKeyCmd() {
|
|
5541
5541
|
try {
|
|
5542
|
-
const
|
|
5543
|
-
let
|
|
5544
|
-
if (!
|
|
5542
|
+
const argAppKey = process.argv[3];
|
|
5543
|
+
let appKey = argAppKey;
|
|
5544
|
+
if (!appKey) {
|
|
5545
5545
|
const ans = await import_inquirer3.default.prompt([
|
|
5546
5546
|
{
|
|
5547
5547
|
type: "input",
|
|
5548
|
-
name: "
|
|
5549
|
-
message: "Enter
|
|
5548
|
+
name: "appKey",
|
|
5549
|
+
message: "Enter AppKey: "
|
|
5550
5550
|
}
|
|
5551
5551
|
]);
|
|
5552
|
-
|
|
5552
|
+
appKey = ans.appKey;
|
|
5553
5553
|
}
|
|
5554
|
-
if (!
|
|
5555
|
-
console.log(import_chalk7.default.red("
|
|
5554
|
+
if (!appKey) {
|
|
5555
|
+
console.log(import_chalk7.default.red("AppKey not provided."));
|
|
5556
5556
|
return;
|
|
5557
5557
|
}
|
|
5558
|
-
const saved = setAuthToken(
|
|
5558
|
+
const saved = setAuthToken(appKey);
|
|
5559
5559
|
console.log(import_chalk7.default.green(`Auth set for address: ${saved.address}`));
|
|
5560
5560
|
const deviceId = getDeviceId();
|
|
5561
5561
|
const ok = await bindAnonymousDevice(deviceId);
|
|
@@ -5565,7 +5565,7 @@ async function setTokenCmd() {
|
|
|
5565
5565
|
console.log(import_chalk7.default.yellow("Anonymous history merge not confirmed. You may retry later."));
|
|
5566
5566
|
}
|
|
5567
5567
|
} catch (e) {
|
|
5568
|
-
console.log(import_chalk7.default.red(`Failed to set
|
|
5568
|
+
console.log(import_chalk7.default.red(`Failed to set AppKey: ${(e == null ? void 0 : e.message) || e}`));
|
|
5569
5569
|
}
|
|
5570
5570
|
}
|
|
5571
5571
|
|
|
@@ -5613,8 +5613,9 @@ var program = new import_commander.Command();
|
|
|
5613
5613
|
program.name("pinme").version(version).option("-v, --version", "output the current version");
|
|
5614
5614
|
program.command("upload").description("upload a file or directory to IPFS. Supports --domain to bind after upload").option("-d, --domain <name>", "Pinme subdomain").action(() => upload_default());
|
|
5615
5615
|
program.command("rm").description("remove a file from IPFS network").action(() => remove_default());
|
|
5616
|
-
program.command("set-
|
|
5617
|
-
program.command("my-domains").description("List domains owned by current account").action(() => myDomainsCmd());
|
|
5616
|
+
program.command("set-appkey").description("Set AppKey for authentication, and auto-merge anonymous history").action(() => setAppKeyCmd());
|
|
5617
|
+
program.command("my-domains").alias("domain").description("List domains owned by current account").action(() => myDomainsCmd());
|
|
5618
|
+
program.command("domain").description("Alias for 'my-domains' command").action(() => myDomainsCmd());
|
|
5618
5619
|
program.command("list").description("show upload history").option("-l, --limit <number>", "limit the number of records to show", parseInt).option("-c, --clear", "clear all upload history").action((options) => {
|
|
5619
5620
|
if (options.clear) {
|
|
5620
5621
|
clearUploadHistory();
|
|
@@ -5639,8 +5640,9 @@ program.on("--help", () => {
|
|
|
5639
5640
|
console.log(" $ pinme upload");
|
|
5640
5641
|
console.log(" $ pinme upload <path> --domain <name>");
|
|
5641
5642
|
console.log(" $ pinme rm <hash>");
|
|
5642
|
-
console.log(" $ pinme set-
|
|
5643
|
+
console.log(" $ pinme set-appkey <AppKey>");
|
|
5643
5644
|
console.log(" $ pinme my-domains");
|
|
5645
|
+
console.log(" $ pinme domain");
|
|
5644
5646
|
console.log(" $ pinme list -l 5");
|
|
5645
5647
|
console.log(" $ pinme ls");
|
|
5646
5648
|
console.log(" $ pinme help");
|