@indigoai-us/hq-cloud 6.15.36 → 6.15.37
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-company.d.ts.map +1 -1
- package/dist/bin/sync-runner-company.js +28 -0
- package/dist/bin/sync-runner-company.js.map +1 -1
- package/dist/bin/sync-runner-company.test.js +75 -0
- package/dist/bin/sync-runner-company.test.js.map +1 -1
- package/dist/bin/sync-runner.d.ts +5 -0
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +25 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/share.d.ts +21 -3
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +57 -5
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +181 -3
- package/dist/cli/share.test.js.map +1 -1
- package/dist/cli/sync-scope.test.js +87 -13
- package/dist/cli/sync-scope.test.js.map +1 -1
- package/dist/cli/sync.d.ts +19 -0
- package/dist/cli/sync.d.ts.map +1 -1
- package/dist/cli/sync.js +32 -13
- package/dist/cli/sync.js.map +1 -1
- package/dist/cli/sync.test.js +28 -14
- package/dist/cli/sync.test.js.map +1 -1
- package/dist/cli/tombstones.d.ts +17 -6
- package/dist/cli/tombstones.d.ts.map +1 -1
- package/dist/cli/tombstones.js +11 -7
- package/dist/cli/tombstones.js.map +1 -1
- package/package.json +1 -1
package/dist/cli/tombstones.d.ts
CHANGED
|
@@ -26,11 +26,22 @@ export interface CompanyTombstone {
|
|
|
26
26
|
deletedAt: string;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
|
|
33
|
-
|
|
29
|
+
* Selects the vault whose tombstones should be returned. Personal scope is a
|
|
30
|
+
* server-resolved ownership selector: the client must never pass a `prs_*` UID
|
|
31
|
+
* through the company selector because that route requires company membership.
|
|
32
|
+
*/
|
|
33
|
+
export type TombstoneScope = {
|
|
34
|
+
companyUid: string;
|
|
35
|
+
} | {
|
|
36
|
+
personal: true;
|
|
37
|
+
};
|
|
38
|
+
/**
|
|
39
|
+
* Fetch one vault's FILE_TOMBSTONE rows from hq-pro
|
|
40
|
+
* (GET /v1/files/tombstones) and return them as a POSIX-keyed map the planners
|
|
41
|
+
* consult to avoid resurrecting an intentionally-deleted object
|
|
42
|
+
* (delete-resync). The endpoint is ACL-filtered server-side, so the map only
|
|
43
|
+
* ever contains keys this caller can read — exactly the keys that can appear in
|
|
44
|
+
* the (STS-scoped) remote LIST.
|
|
34
45
|
*
|
|
35
46
|
* Best-effort and bounded by a 5s timeout: a tombstone read that fails, times
|
|
36
47
|
* out, or returns non-2xx degrades to an EMPTY map — i.e. to the pre-fix
|
|
@@ -39,5 +50,5 @@ export interface CompanyTombstone {
|
|
|
39
50
|
* whereas a spurious tombstone would HIDE a file the user wants. The failure is
|
|
40
51
|
* logged (never silently swallowed) so a persistently-degraded read is visible.
|
|
41
52
|
*/
|
|
42
|
-
export declare function
|
|
53
|
+
export declare function fetchFileTombstones(vaultConfig: VaultServiceConfig, scope: TombstoneScope): Promise<Map<string, CompanyTombstone>>;
|
|
43
54
|
//# sourceMappingURL=tombstones.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tombstones.d.ts","sourceRoot":"","sources":["../../src/cli/tombstones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED
|
|
1
|
+
{"version":3,"file":"tombstones.d.ts","sourceRoot":"","sources":["../../src/cli/tombstones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAEH,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,aAAa,CAAC;AAGtD,mFAAmF;AACnF,eAAO,MAAM,2BAA2B,OAAO,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,WAAW,gBAAgB;IAC/B,SAAS,EAAE,MAAM,CAAC;CACnB;AAED;;;;GAIG;AACH,MAAM,MAAM,cAAc,GAAG;IAAE,UAAU,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,QAAQ,EAAE,IAAI,CAAA;CAAE,CAAC;AAEzE;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,WAAW,EAAE,kBAAkB,EAC/B,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAyDxC"}
|
package/dist/cli/tombstones.js
CHANGED
|
@@ -16,11 +16,12 @@ import { toPosixKey } from "../s3.js";
|
|
|
16
16
|
/** Timeout for the best-effort FILE_TOMBSTONE fetch (GET /v1/files/tombstones). */
|
|
17
17
|
export const FETCH_TOMBSTONES_TIMEOUT_MS = 5000;
|
|
18
18
|
/**
|
|
19
|
-
* Fetch
|
|
20
|
-
* and return them as a POSIX-keyed map the planners
|
|
21
|
-
* resurrecting an intentionally-deleted object
|
|
22
|
-
* ACL-filtered server-side, so the map only
|
|
23
|
-
* read — exactly the keys that can appear in
|
|
19
|
+
* Fetch one vault's FILE_TOMBSTONE rows from hq-pro
|
|
20
|
+
* (GET /v1/files/tombstones) and return them as a POSIX-keyed map the planners
|
|
21
|
+
* consult to avoid resurrecting an intentionally-deleted object
|
|
22
|
+
* (delete-resync). The endpoint is ACL-filtered server-side, so the map only
|
|
23
|
+
* ever contains keys this caller can read — exactly the keys that can appear in
|
|
24
|
+
* the (STS-scoped) remote LIST.
|
|
24
25
|
*
|
|
25
26
|
* Best-effort and bounded by a 5s timeout: a tombstone read that fails, times
|
|
26
27
|
* out, or returns non-2xx degrades to an EMPTY map — i.e. to the pre-fix
|
|
@@ -29,14 +30,17 @@ export const FETCH_TOMBSTONES_TIMEOUT_MS = 5000;
|
|
|
29
30
|
* whereas a spurious tombstone would HIDE a file the user wants. The failure is
|
|
30
31
|
* logged (never silently swallowed) so a persistently-degraded read is visible.
|
|
31
32
|
*/
|
|
32
|
-
export async function
|
|
33
|
+
export async function fetchFileTombstones(vaultConfig, scope) {
|
|
33
34
|
const out = new Map();
|
|
34
35
|
try {
|
|
35
36
|
const token = typeof vaultConfig.authToken === "function"
|
|
36
37
|
? await vaultConfig.authToken()
|
|
37
38
|
: vaultConfig.authToken;
|
|
38
39
|
const base = vaultConfig.apiUrl.replace(/\/+$/, "");
|
|
39
|
-
const
|
|
40
|
+
const selector = "personal" in scope
|
|
41
|
+
? "personal=1"
|
|
42
|
+
: `company=${encodeURIComponent(scope.companyUid)}`;
|
|
43
|
+
const url = `${base}/v1/files/tombstones?${selector}`;
|
|
40
44
|
const controller = new AbortController();
|
|
41
45
|
const timer = setTimeout(() => controller.abort(), FETCH_TOMBSTONES_TIMEOUT_MS);
|
|
42
46
|
try {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"tombstones.js","sourceRoot":"","sources":["../../src/cli/tombstones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"tombstones.js","sourceRoot":"","sources":["../../src/cli/tombstones.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;GAaG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAEtC,mFAAmF;AACnF,MAAM,CAAC,MAAM,2BAA2B,GAAG,IAAI,CAAC;AAoBhD;;;;;;;;;;;;;;GAcG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,WAA+B,EAC/B,KAA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