@fedify/cli 2.1.5 → 2.1.6
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/deno.js +1 -1
- package/dist/lookup.js +24 -4
- package/package.json +9 -9
package/dist/deno.js
CHANGED
package/dist/lookup.js
CHANGED
|
@@ -39,7 +39,12 @@ const suppressErrorsOption = bindConfig(flag("-S", "--suppress-errors", { descri
|
|
|
39
39
|
key: (config) => config.lookup?.suppressErrors ?? false,
|
|
40
40
|
default: false
|
|
41
41
|
});
|
|
42
|
-
const allowPrivateAddressOption = bindConfig(flag("-p", "--allow-private-address", { description: message`Allow private IP addresses for
|
|
42
|
+
const allowPrivateAddressOption = bindConfig(flag("-p", "--allow-private-address", { description: message`Allow private IP addresses for URLs discovered \
|
|
43
|
+
during traversal. This option only has an effect when used together \
|
|
44
|
+
with ${optionNames(["-t", "--traverse"])}, since URLs explicitly \
|
|
45
|
+
provided on the command line always allow private addresses and \
|
|
46
|
+
recursive fetches via ${optionNames(["--recurse"])} always disallow \
|
|
47
|
+
them.` }), {
|
|
43
48
|
context: configContext,
|
|
44
49
|
key: (config) => config.lookup?.allowPrivateAddress ?? false,
|
|
45
50
|
default: false
|
|
@@ -379,6 +384,10 @@ async function runLookup(command, deps = {}) {
|
|
|
379
384
|
discardStdin: false
|
|
380
385
|
}).start();
|
|
381
386
|
let server = void 0;
|
|
387
|
+
const initialDocumentLoader = wrapDocumentLoaderWithTimeout(await getDocumentLoader$1({
|
|
388
|
+
userAgent: command.userAgent,
|
|
389
|
+
allowPrivateAddress: true
|
|
390
|
+
}), command.timeout);
|
|
382
391
|
const documentLoader = wrapDocumentLoaderWithTimeout(await getDocumentLoader$1({
|
|
383
392
|
userAgent: command.userAgent,
|
|
384
393
|
allowPrivateAddress: command.allowPrivateAddress
|
|
@@ -388,6 +397,7 @@ async function runLookup(command, deps = {}) {
|
|
|
388
397
|
allowPrivateAddress: command.allowPrivateAddress
|
|
389
398
|
}), command.timeout);
|
|
390
399
|
let authLoader = void 0;
|
|
400
|
+
let initialAuthLoader = void 0;
|
|
391
401
|
let authIdentity = void 0;
|
|
392
402
|
let outputStream;
|
|
393
403
|
let outputStreamError;
|
|
@@ -463,6 +473,16 @@ async function runLookup(command, deps = {}) {
|
|
|
463
473
|
rememberSpec() {}
|
|
464
474
|
}
|
|
465
475
|
}), command.timeout);
|
|
476
|
+
initialAuthLoader = wrapDocumentLoaderWithTimeout(getAuthenticatedDocumentLoader(authIdentity, {
|
|
477
|
+
allowPrivateAddress: true,
|
|
478
|
+
userAgent: command.userAgent,
|
|
479
|
+
specDeterminer: {
|
|
480
|
+
determineSpec() {
|
|
481
|
+
return command.firstKnock;
|
|
482
|
+
},
|
|
483
|
+
rememberSpec() {}
|
|
484
|
+
}
|
|
485
|
+
}), command.timeout);
|
|
466
486
|
}
|
|
467
487
|
spinner.text = `Looking up the ${command.recurse != null ? "object chain" : command.traverse ? "collection" : command.urls.length > 1 ? "objects" : "object"}...`;
|
|
468
488
|
if (command.recurse != null) {
|
|
@@ -484,7 +504,7 @@ async function runLookup(command, deps = {}) {
|
|
|
484
504
|
rememberSpec() {}
|
|
485
505
|
}
|
|
486
506
|
}), command.timeout) : void 0;
|
|
487
|
-
const initialLookupDocumentLoader =
|
|
507
|
+
const initialLookupDocumentLoader = initialAuthLoader ?? initialDocumentLoader;
|
|
488
508
|
const recursiveLookupDocumentLoader = recursiveAuthLoader ?? recursiveDocumentLoader;
|
|
489
509
|
let totalObjects = 0;
|
|
490
510
|
const recurseDepth = command.recurseDepth;
|
|
@@ -614,7 +634,7 @@ async function runLookup(command, deps = {}) {
|
|
|
614
634
|
let collection = null;
|
|
615
635
|
try {
|
|
616
636
|
collection = await effectiveDeps.lookupObject(url, {
|
|
617
|
-
documentLoader:
|
|
637
|
+
documentLoader: initialAuthLoader ?? initialDocumentLoader,
|
|
618
638
|
contextLoader,
|
|
619
639
|
userAgent: command.userAgent
|
|
620
640
|
});
|
|
@@ -704,7 +724,7 @@ async function runLookup(command, deps = {}) {
|
|
|
704
724
|
}
|
|
705
725
|
const promises = [];
|
|
706
726
|
for (const url of command.urls) promises.push(effectiveDeps.lookupObject(url, {
|
|
707
|
-
documentLoader:
|
|
727
|
+
documentLoader: initialAuthLoader ?? initialDocumentLoader,
|
|
708
728
|
contextLoader,
|
|
709
729
|
userAgent: command.userAgent
|
|
710
730
|
}).catch((error) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fedify/cli",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.6",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"README.md",
|
|
@@ -86,14 +86,14 @@
|
|
|
86
86
|
"smol-toml": "^1.6.0",
|
|
87
87
|
"srvx": "^0.8.7",
|
|
88
88
|
"valibot": "^1.2.0",
|
|
89
|
-
"@fedify/
|
|
90
|
-
"@fedify/
|
|
91
|
-
"@fedify/
|
|
92
|
-
"@fedify/
|
|
93
|
-
"@fedify/
|
|
94
|
-
"@fedify/webfinger": "2.1.
|
|
95
|
-
"@fedify/
|
|
96
|
-
"@fedify/vocab-tools": "2.1.
|
|
89
|
+
"@fedify/fedify": "2.1.6",
|
|
90
|
+
"@fedify/sqlite": "2.1.6",
|
|
91
|
+
"@fedify/vocab": "2.1.6",
|
|
92
|
+
"@fedify/vocab-runtime": "2.1.6",
|
|
93
|
+
"@fedify/init": "2.1.6",
|
|
94
|
+
"@fedify/webfinger": "2.1.6",
|
|
95
|
+
"@fedify/relay": "2.1.6",
|
|
96
|
+
"@fedify/vocab-tools": "2.1.6"
|
|
97
97
|
},
|
|
98
98
|
"devDependencies": {
|
|
99
99
|
"@types/bun": "^1.2.23",
|