@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.
@@ -26,11 +26,22 @@ export interface CompanyTombstone {
26
26
  deletedAt: string;
27
27
  }
28
28
  /**
29
- * Fetch the company's FILE_TOMBSTONE rows from hq-pro (GET /v1/files/tombstones)
30
- * and return them as a POSIX-keyed map the planners consult to avoid
31
- * resurrecting an intentionally-deleted object (delete-resync). The endpoint is
32
- * ACL-filtered server-side, so the map only ever contains keys this caller can
33
- * read — exactly the keys that can appear in the (STS-scoped) remote LIST.
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 fetchCompanyTombstones(vaultConfig: VaultServiceConfig, companyUid: string): Promise<Map<string, CompanyTombstone>>;
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;;;;;;;;;;;;;GAaG;AACH,wBAAsB,sBAAsB,CAC1C,WAAW,EAAE,kBAAkB,EAC/B,UAAU,EAAE,MAAM,GACjB,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC,CAwDxC"}
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"}
@@ -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 the company's FILE_TOMBSTONE rows from hq-pro (GET /v1/files/tombstones)
20
- * and return them as a POSIX-keyed map the planners consult to avoid
21
- * resurrecting an intentionally-deleted object (delete-resync). The endpoint is
22
- * ACL-filtered server-side, so the map only ever contains keys this caller can
23
- * read — exactly the keys that can appear in the (STS-scoped) remote LIST.
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 fetchCompanyTombstones(vaultConfig, companyUid) {
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 url = `${base}/v1/files/tombstones?company=${encodeURIComponent(companyUid)}`;
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,EA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AAE,CAAC,CAAC,SAAS,EAAE,CAAC,CAAC;gBACzD,CAAC;YACH,CAAC;QACH,CAAC;gBAAS,CAAC;YACT,YAAY,CAAC,KAAK,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,sEAAsE;QACtE,kEAAkE;QAClE,IAAI,CAAC;YACH,OAAO,CAAC,KAAK,CACX,8EACE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CACjD,EAAE,CACH,CAAC;QACJ,CAAC;QAAC,MAAM,CAAC;YACP,0CAA0C;QAC5C,CAAC;IACH,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@indigoai-us/hq-cloud",
3
- "version": "6.15.36",
3
+ "version": "6.15.37",
4
4
  "description": "HQ by Indigo cloud sync engine — bidirectional S3 sync for mobile access",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",