querysub 0.660.0 → 0.661.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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "querysub",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.661.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"note1": "note on node-forge fork, see https://github.com/digitalbazaar/forge/issues/744 for details",
|
|
@@ -79,7 +79,7 @@
|
|
|
79
79
|
"node-forge": "https://github.com/sliftist/forge#e618181b469b07bdc70b968b0391beb8ef5fecd6",
|
|
80
80
|
"pako": "^2.1.0",
|
|
81
81
|
"peggy": "^5.0.6",
|
|
82
|
-
"sliftutils": "^1.7.
|
|
82
|
+
"sliftutils": "^1.7.132",
|
|
83
83
|
"socket-function": "^1.2.35",
|
|
84
84
|
"terser": "^5.31.0",
|
|
85
85
|
"typenode": "^6.6.1",
|
|
@@ -94,7 +94,7 @@ const archivesBuilderCache = cacheJSONArgsEqual((domain: string, overrides: Part
|
|
|
94
94
|
domain = domain.toLowerCase().replaceAll(/[^a-z0-9-]/g, "-");
|
|
95
95
|
return archiveBuilder(domain, overrides);
|
|
96
96
|
});
|
|
97
|
-
function nestBucket(folder: string, archives: ReturnType<typeof createArchives>) {
|
|
97
|
+
export function nestBucket(folder: string, archives: ReturnType<typeof createArchives>) {
|
|
98
98
|
if (!folder) return archives;
|
|
99
99
|
folder = folder.replaceAll("\\", "/");
|
|
100
100
|
if (!folder.endsWith("/")) {
|
|
@@ -136,7 +136,7 @@ function nestBucket(folder: string, archives: ReturnType<typeof createArchives>)
|
|
|
136
136
|
};
|
|
137
137
|
}
|
|
138
138
|
|
|
139
|
-
function getSafeDomain() {
|
|
139
|
+
export function getSafeDomain() {
|
|
140
140
|
return getDomain().toLowerCase().replaceAll(/[^a-z0-9-]/g, "-");
|
|
141
141
|
}
|
|
142
142
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { createArchives } from "sliftutils/storage/remoteStorage/createArchives";
|
|
2
|
+
import { cache } from "socket-function/src/caching";
|
|
3
|
+
import { getSafeDomain, nestBucket } from "./archives2";
|
|
4
|
+
|
|
5
|
+
// The absolute-minimum archives: one private accessor, one backblaze source, no striping, no storage servers. For the values that have to be readable when none of our infrastructure is up (ex, the repo trust config machine deploy needs to bootstrap a machine).
|
|
6
|
+
|
|
7
|
+
const lowLevelBase = cache((bucket: string) => createArchives({
|
|
8
|
+
version: 1,
|
|
9
|
+
sources: [{
|
|
10
|
+
type: "backblaze",
|
|
11
|
+
url: `https://f002.backblazeb2.com/file/${bucket}/storage/storagerouting.json`,
|
|
12
|
+
name: "backblaze",
|
|
13
|
+
validWindow: [0, Number.MAX_SAFE_INTEGER],
|
|
14
|
+
}],
|
|
15
|
+
}));
|
|
16
|
+
|
|
17
|
+
export function getArchivesLowLevel(folder: string) {
|
|
18
|
+
return nestBucket(folder, lowLevelBase(getSafeDomain() + "-low-level"));
|
|
19
|
+
}
|