@indigoai-us/hq-cloud 5.46.0 → 5.47.1
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/bin/sync-runner.d.ts +12 -0
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js +39 -0
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +27 -1
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +17 -2
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +2 -0
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync-scope.test.js +1 -0
- package/dist/cli/sync-scope.test.js.map +1 -1
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +11 -1
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +1 -0
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/object-io.d.ts +218 -0
- package/dist/object-io.d.ts.map +1 -0
- package/dist/object-io.js +588 -0
- package/dist/object-io.js.map +1 -0
- package/dist/object-io.test.d.ts +11 -0
- package/dist/object-io.test.d.ts.map +1 -0
- package/dist/object-io.test.js +568 -0
- package/dist/object-io.test.js.map +1 -0
- package/dist/s3.d.ts +37 -0
- package/dist/s3.d.ts.map +1 -1
- package/dist/s3.js +225 -201
- package/dist/s3.js.map +1 -1
- package/dist/s3.test.js +21 -0
- package/dist/s3.test.js.map +1 -1
- package/dist/vault-client.d.ts +68 -0
- package/dist/vault-client.d.ts.map +1 -1
- package/dist/vault-client.js +35 -0
- package/dist/vault-client.js.map +1 -1
- package/package.json +1 -1
- package/scripts/presign-transport-e2e.mjs +203 -0
- package/scripts/vault-rebaseline.sh +275 -0
- package/scripts/vault-rescue.sh +8 -0
- package/src/bin/sync-runner.test.ts +41 -0
- package/src/bin/sync-runner.ts +52 -0
- package/src/cli/share.test.ts +2 -0
- package/src/cli/share.ts +29 -2
- package/src/cli/sync-scope.test.ts +1 -0
- package/src/cli/sync.test.ts +1 -0
- package/src/cli/sync.ts +22 -1
- package/src/object-io.test.ts +663 -0
- package/src/object-io.ts +782 -0
- package/src/s3.test.ts +24 -0
- package/src/s3.ts +277 -237
- package/src/vault-client.ts +101 -0
package/src/cli/sync.test.ts
CHANGED
|
@@ -31,6 +31,7 @@ vi.mock("../s3.js", async () => {
|
|
|
31
31
|
listRemoteFiles: innerVi.fn().mockResolvedValue(remoteFiles),
|
|
32
32
|
deleteRemoteFile: innerVi.fn().mockResolvedValue(undefined),
|
|
33
33
|
headRemoteFile: innerVi.fn().mockResolvedValue(null),
|
|
34
|
+
primeObjectTransport: innerVi.fn().mockResolvedValue(undefined),
|
|
34
35
|
};
|
|
35
36
|
});
|
|
36
37
|
|
package/src/cli/sync.ts
CHANGED
|
@@ -10,7 +10,12 @@ import * as path from "path";
|
|
|
10
10
|
import type { VaultServiceConfig, SyncJournal } from "../types.js";
|
|
11
11
|
import type { SyncMode } from "../vault-client.js";
|
|
12
12
|
import { resolveEntityContext, isExpiringSoon, refreshEntityContext } from "../context.js";
|
|
13
|
-
import {
|
|
13
|
+
import {
|
|
14
|
+
downloadFile,
|
|
15
|
+
listRemoteFiles,
|
|
16
|
+
headRemoteFile,
|
|
17
|
+
primeObjectTransport,
|
|
18
|
+
} from "../s3.js";
|
|
14
19
|
import type { RemoteFile } from "../s3.js";
|
|
15
20
|
import {
|
|
16
21
|
readJournal,
|
|
@@ -834,6 +839,18 @@ export async function sync(options: SyncOptions): Promise<SyncResult> {
|
|
|
834
839
|
// (inside the wrapper), so cross-file interleave is expected and the
|
|
835
840
|
// menubar's stream parser already handles it.
|
|
836
841
|
if (downloadItems.length > 0) {
|
|
842
|
+
// Batch pre-mint GET URLs for every download in one shot (chunked server-
|
|
843
|
+
// side) so the pool below — and the new-files HEAD enrichment that follows,
|
|
844
|
+
// which re-reads the same keys — reuse them instead of presigning per file.
|
|
845
|
+
// On a large initial pull this is the difference between ~ceil(N/100)
|
|
846
|
+
// presign calls and N (which would 429 past the 100-req/hr limit). No-op
|
|
847
|
+
// on the S3 SDK transport; best-effort (failure falls back to per-file).
|
|
848
|
+
await primeObjectTransport(
|
|
849
|
+
ctx,
|
|
850
|
+
"get",
|
|
851
|
+
downloadItems.map((d) => d.remoteFile.key),
|
|
852
|
+
);
|
|
853
|
+
|
|
837
854
|
const queue = [...downloadItems];
|
|
838
855
|
const inFlight: Set<Promise<unknown>> = new Set();
|
|
839
856
|
|
|
@@ -1022,6 +1039,10 @@ export async function sync(options: SyncOptions): Promise<SyncResult> {
|
|
|
1022
1039
|
// - HEAD throws transient → defensive skip + emit error.
|
|
1023
1040
|
// Bounded concurrency mirrors the new-files attribution pass above.
|
|
1024
1041
|
if (plan.tombstones.length > 0) {
|
|
1042
|
+
// Pre-mint GET URLs for the tombstone HEAD-verify probes below (headRemote
|
|
1043
|
+
// File presigns a GET), so a large delete set doesn't add N presign calls.
|
|
1044
|
+
await primeObjectTransport(ctx, "get", plan.tombstones);
|
|
1045
|
+
|
|
1025
1046
|
const HEAD_VERIFY_CONCURRENCY = 5;
|
|
1026
1047
|
const verified: string[] = [];
|
|
1027
1048
|
for (let i = 0; i < plan.tombstones.length; i += HEAD_VERIFY_CONCURRENCY) {
|