@indigoai-us/hq-cloud 6.18.2-alpha.0 → 6.18.2
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-watch-loop.d.ts +6 -7
- package/dist/bin/sync-runner-watch-loop.d.ts.map +1 -1
- package/dist/bin/sync-runner-watch-loop.js +11 -10
- package/dist/bin/sync-runner-watch-loop.js.map +1 -1
- package/dist/bin/sync-runner-watch-loop.test.js +63 -5
- package/dist/bin/sync-runner-watch-loop.test.js.map +1 -1
- package/dist/bin/sync-runner.d.ts.map +1 -1
- package/dist/bin/sync-runner.js +7 -0
- package/dist/bin/sync-runner.js.map +1 -1
- package/dist/bin/sync-runner.test.js +2 -0
- package/dist/bin/sync-runner.test.js.map +1 -1
- package/dist/cli/reindex.d.ts +6 -0
- package/dist/cli/reindex.d.ts.map +1 -1
- package/dist/cli/reindex.js +3 -3
- package/dist/cli/reindex.js.map +1 -1
- package/dist/cli/share.d.ts +2 -8
- package/dist/cli/share.d.ts.map +1 -1
- package/dist/cli/share.js +13 -83
- package/dist/cli/share.js.map +1 -1
- package/dist/cli/share.test.js +0 -189
- package/dist/cli/share.test.js.map +1 -1
- package/dist/object-io.d.ts +5 -0
- package/dist/object-io.d.ts.map +1 -1
- package/dist/object-io.js +29 -2
- package/dist/object-io.js.map +1 -1
- package/dist/object-io.test.js +117 -0
- package/dist/object-io.test.js.map +1 -1
- package/dist/session-log-capture.d.ts +15 -1
- package/dist/session-log-capture.d.ts.map +1 -1
- package/dist/session-log-capture.js +46 -2
- package/dist/session-log-capture.js.map +1 -1
- package/dist/session-log-capture.test.js +59 -0
- package/dist/session-log-capture.test.js.map +1 -1
- package/dist/sync/event-sync.d.ts.map +1 -1
- package/dist/sync/event-sync.js +24 -0
- package/dist/sync/event-sync.js.map +1 -1
- package/dist/sync/event-sync.test.js +158 -3
- package/dist/sync/event-sync.test.js.map +1 -1
- package/dist/sync/push-receiver.d.ts +6 -0
- package/dist/sync/push-receiver.d.ts.map +1 -1
- package/dist/sync/push-receiver.js +59 -5
- package/dist/sync/push-receiver.js.map +1 -1
- package/dist/sync/push-receiver.test.js +308 -0
- package/dist/sync/push-receiver.test.js.map +1 -1
- package/package.json +1 -1
- package/dist/lib/ontology-entity-push.d.ts +0 -51
- package/dist/lib/ontology-entity-push.d.ts.map +0 -1
- package/dist/lib/ontology-entity-push.js +0 -125
- package/dist/lib/ontology-entity-push.js.map +0 -1
- package/dist/lib/ontology-entity-push.test.d.ts +0 -2
- package/dist/lib/ontology-entity-push.test.d.ts.map +0 -1
- package/dist/lib/ontology-entity-push.test.js +0 -149
- package/dist/lib/ontology-entity-push.test.js.map +0 -1
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Push access for checkpoint-written ontology entity files.
|
|
3
|
-
*
|
|
4
|
-
* `ontology/` is cloud-authoritative (see ./cloud-authoritative.ts): the push
|
|
5
|
-
* leg refuses it and the pull leg overwrites it. `hq core checkpoint` in
|
|
6
|
-
* hq-cli now writes entity files under `ontology/entities/<type>/<slug>.md`
|
|
7
|
-
* in place of the retired cloud gardener, and those files have to reach the
|
|
8
|
-
* vault. This module decides, per company, whether they may be pushed.
|
|
9
|
-
*
|
|
10
|
-
* The decision is the hq-flags flag `checkpoint.ontology`, the same flag that
|
|
11
|
-
* turns the checkpoint ontology step on, evaluated for the vault's company.
|
|
12
|
-
* `HQ_FLAG_CHECKPOINT_ONTOLOGY` is the local override. Any failure (no
|
|
13
|
-
* endpoint, no token, network error, missing flag row) resolves to false, so
|
|
14
|
-
* the path stays refused exactly as before.
|
|
15
|
-
*
|
|
16
|
-
* Only entity files are opened. `.last-run`, `merge-proposals.json`, facts,
|
|
17
|
-
* and everything else under `ontology/` stay server-owned.
|
|
18
|
-
*
|
|
19
|
-
* Conflict rule (enforced in share.ts): the cloud copy wins. A pushed entity
|
|
20
|
-
* is written only with an S3 precondition (`If-Match` on the etag this
|
|
21
|
-
* machine last synced, or `If-None-Match: *` for a new key). If the remote
|
|
22
|
-
* moved, or the key was deleted server-side, the local body is set aside and
|
|
23
|
-
* the cloud body adopted. The pull leg keeps treating the path as
|
|
24
|
-
* cloud-authoritative. The next checkpoint re-applies its changes on top of
|
|
25
|
-
* the cloud version.
|
|
26
|
-
*/
|
|
27
|
-
import { type FlagClient, type FlagClientOptions } from "@indigoai-us/hq-flags-client";
|
|
28
|
-
/** Flag that gates both the checkpoint ontology step and this push path. */
|
|
29
|
-
export declare const ONTOLOGY_ENTITY_PUSH_FLAG = "checkpoint.ontology";
|
|
30
|
-
/**
|
|
31
|
-
* True iff `relPath` is an ontology entity file. Accepts an hqRoot-relative
|
|
32
|
-
* (`companies/<slug>/…`) or vault-relative path, like `isCloudAuthoritative`.
|
|
33
|
-
*/
|
|
34
|
-
export declare function isOntologyEntityKey(relPath: string): boolean;
|
|
35
|
-
export interface OntologyEntityPushInput {
|
|
36
|
-
/** Company vault uid (`cmp_*`). Personal vaults never push entities. */
|
|
37
|
-
companyUid: string;
|
|
38
|
-
companySlug?: string;
|
|
39
|
-
/** hq-pro base URL; `HQ_FLAGS_API_URL` wins when set. */
|
|
40
|
-
endpoint?: string;
|
|
41
|
-
getToken?: () => string | Promise<string>;
|
|
42
|
-
env?: Readonly<Record<string, string | undefined>>;
|
|
43
|
-
createClient?: (options: FlagClientOptions) => Pick<FlagClient, "ready" | "explain" | "close">;
|
|
44
|
-
now?: () => number;
|
|
45
|
-
/** Told about each failed read. Defaults to one line on stderr. */
|
|
46
|
-
onError?: (error: unknown) => void;
|
|
47
|
-
}
|
|
48
|
-
/** Resolve `checkpoint.ontology` for one company vault. Never throws. */
|
|
49
|
-
export declare function resolveOntologyEntityPush(input: OntologyEntityPushInput): Promise<boolean>;
|
|
50
|
-
export declare function _resetOntologyEntityPushCacheForTests(): void;
|
|
51
|
-
//# sourceMappingURL=ontology-entity-push.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology-entity-push.d.ts","sourceRoot":"","sources":["../../src/lib/ontology-entity-push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAGH,OAAO,EAAuC,KAAK,UAAU,EAAE,KAAK,iBAAiB,EAAE,MAAM,8BAA8B,CAAC;AAE5H,4EAA4E;AAC5E,eAAO,MAAM,yBAAyB,wBAAwB,CAAC;AAQ/D;;;GAGG;AACH,wBAAgB,mBAAmB,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAO5D;AAED,MAAM,WAAW,uBAAuB;IACtC,wEAAwE;IACxE,UAAU,EAAE,MAAM,CAAC;IACnB,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,yDAAyD;IACzD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IAC1C,GAAG,CAAC,EAAE,QAAQ,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC,CAAC,CAAC;IACnD,YAAY,CAAC,EAAE,CAAC,OAAO,EAAE,iBAAiB,KAAK,IAAI,CAAC,UAAU,EAAE,OAAO,GAAG,SAAS,GAAG,OAAO,CAAC,CAAC;IAC/F,GAAG,CAAC,EAAE,MAAM,MAAM,CAAC;IACnB,mEAAmE;IACnE,OAAO,CAAC,EAAE,CAAC,KAAK,EAAE,OAAO,KAAK,IAAI,CAAC;CACpC;AAID,yEAAyE;AACzE,wBAAsB,yBAAyB,CAAC,KAAK,EAAE,uBAAuB,GAAG,OAAO,CAAC,OAAO,CAAC,CAiEhG;AAED,wBAAgB,qCAAqC,IAAI,IAAI,CAE5D"}
|
|
@@ -1,125 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Push access for checkpoint-written ontology entity files.
|
|
3
|
-
*
|
|
4
|
-
* `ontology/` is cloud-authoritative (see ./cloud-authoritative.ts): the push
|
|
5
|
-
* leg refuses it and the pull leg overwrites it. `hq core checkpoint` in
|
|
6
|
-
* hq-cli now writes entity files under `ontology/entities/<type>/<slug>.md`
|
|
7
|
-
* in place of the retired cloud gardener, and those files have to reach the
|
|
8
|
-
* vault. This module decides, per company, whether they may be pushed.
|
|
9
|
-
*
|
|
10
|
-
* The decision is the hq-flags flag `checkpoint.ontology`, the same flag that
|
|
11
|
-
* turns the checkpoint ontology step on, evaluated for the vault's company.
|
|
12
|
-
* `HQ_FLAG_CHECKPOINT_ONTOLOGY` is the local override. Any failure (no
|
|
13
|
-
* endpoint, no token, network error, missing flag row) resolves to false, so
|
|
14
|
-
* the path stays refused exactly as before.
|
|
15
|
-
*
|
|
16
|
-
* Only entity files are opened. `.last-run`, `merge-proposals.json`, facts,
|
|
17
|
-
* and everything else under `ontology/` stay server-owned.
|
|
18
|
-
*
|
|
19
|
-
* Conflict rule (enforced in share.ts): the cloud copy wins. A pushed entity
|
|
20
|
-
* is written only with an S3 precondition (`If-Match` on the etag this
|
|
21
|
-
* machine last synced, or `If-None-Match: *` for a new key). If the remote
|
|
22
|
-
* moved, or the key was deleted server-side, the local body is set aside and
|
|
23
|
-
* the cloud body adopted. The pull leg keeps treating the path as
|
|
24
|
-
* cloud-authoritative. The next checkpoint re-applies its changes on top of
|
|
25
|
-
* the cloud version.
|
|
26
|
-
*/
|
|
27
|
-
import { createHash } from "node:crypto";
|
|
28
|
-
import { createFlagClient, readLocalOverride } from "@indigoai-us/hq-flags-client";
|
|
29
|
-
/** Flag that gates both the checkpoint ontology step and this push path. */
|
|
30
|
-
export const ONTOLOGY_ENTITY_PUSH_FLAG = "checkpoint.ontology";
|
|
31
|
-
const FLAG_READ_TIMEOUT_MS = 5_000;
|
|
32
|
-
const FLAG_CACHE_TTL_MS = 5 * 60_000;
|
|
33
|
-
/** Vault-relative entity files the checkpoint writes. */
|
|
34
|
-
const ONTOLOGY_ENTITY_KEY = /^ontology\/entities\/[a-z][a-z0-9-]*\/[^/]+\.md$/;
|
|
35
|
-
/**
|
|
36
|
-
* True iff `relPath` is an ontology entity file. Accepts an hqRoot-relative
|
|
37
|
-
* (`companies/<slug>/…`) or vault-relative path, like `isCloudAuthoritative`.
|
|
38
|
-
*/
|
|
39
|
-
export function isOntologyEntityKey(relPath) {
|
|
40
|
-
const vaultRel = relPath
|
|
41
|
-
.split("\\")
|
|
42
|
-
.join("/")
|
|
43
|
-
.replace(/^\.?\//, "")
|
|
44
|
-
.replace(/^companies\/[^/]+\//, "");
|
|
45
|
-
return ONTOLOGY_ENTITY_KEY.test(vaultRel);
|
|
46
|
-
}
|
|
47
|
-
const cache = new Map();
|
|
48
|
-
/** Resolve `checkpoint.ontology` for one company vault. Never throws. */
|
|
49
|
-
export async function resolveOntologyEntityPush(input) {
|
|
50
|
-
if (!input.companyUid.startsWith("cmp_"))
|
|
51
|
-
return false;
|
|
52
|
-
const env = input.env ?? process.env;
|
|
53
|
-
const local = readLocalOverride(ONTOLOGY_ENTITY_PUSH_FLAG, env);
|
|
54
|
-
if (local !== null)
|
|
55
|
-
return local;
|
|
56
|
-
const endpoint = (env.HQ_FLAGS_API_URL ?? "").trim() || (input.endpoint ?? "").trim();
|
|
57
|
-
if (!endpoint || !input.getToken)
|
|
58
|
-
return false;
|
|
59
|
-
const reportError = input.onError ?? ((error) => {
|
|
60
|
-
const detail = error instanceof Error ? error.message : String(error);
|
|
61
|
-
process.stderr.write(`hq-cloud: could not read ${ONTOLOGY_ENTITY_PUSH_FLAG}; ontology entities stay pull-only this pass (${detail.slice(0, 200)})\n`);
|
|
62
|
-
});
|
|
63
|
-
let failed = false;
|
|
64
|
-
let reported = false;
|
|
65
|
-
const fail = (error) => {
|
|
66
|
-
failed = true;
|
|
67
|
-
if (reported)
|
|
68
|
-
return;
|
|
69
|
-
reported = true;
|
|
70
|
-
reportError(error);
|
|
71
|
-
};
|
|
72
|
-
// The flag can target a person, so a cached answer belongs to the caller as
|
|
73
|
-
// well as the company. The cache key holds a hash of the token, never the
|
|
74
|
-
// token itself.
|
|
75
|
-
let token;
|
|
76
|
-
try {
|
|
77
|
-
token = await input.getToken();
|
|
78
|
-
}
|
|
79
|
-
catch (error) {
|
|
80
|
-
fail(error);
|
|
81
|
-
return false;
|
|
82
|
-
}
|
|
83
|
-
const now = input.now ?? Date.now;
|
|
84
|
-
const caller = createHash("sha256").update(token).digest("hex").slice(0, 32);
|
|
85
|
-
const cacheKey = `${endpoint}\n${input.companyUid}\n${caller}`;
|
|
86
|
-
const hit = cache.get(cacheKey);
|
|
87
|
-
if (hit && hit.expiresAt > now())
|
|
88
|
-
return hit.value;
|
|
89
|
-
let value = false;
|
|
90
|
-
let client;
|
|
91
|
-
try {
|
|
92
|
-
client = (input.createClient ?? createFlagClient)({
|
|
93
|
-
endpoint,
|
|
94
|
-
getToken: () => token,
|
|
95
|
-
env: {},
|
|
96
|
-
refreshIntervalMs: 0,
|
|
97
|
-
requestTimeoutMs: FLAG_READ_TIMEOUT_MS,
|
|
98
|
-
companyUid: input.companyUid,
|
|
99
|
-
...(input.companySlug ? { companyIdentifiers: [input.companySlug] } : {}),
|
|
100
|
-
onError: fail,
|
|
101
|
-
});
|
|
102
|
-
await client.ready();
|
|
103
|
-
const resolution = client.explain(ONTOLOGY_ENTITY_PUSH_FLAG, { fallback: false });
|
|
104
|
-
value = !failed && resolution.source === "snapshot" && resolution.value === true;
|
|
105
|
-
}
|
|
106
|
-
catch (error) {
|
|
107
|
-
fail(error);
|
|
108
|
-
}
|
|
109
|
-
finally {
|
|
110
|
-
try {
|
|
111
|
-
client?.close();
|
|
112
|
-
}
|
|
113
|
-
catch (error) {
|
|
114
|
-
fail(error);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
// A failed read is not cached: the next pass asks again.
|
|
118
|
-
if (!failed)
|
|
119
|
-
cache.set(cacheKey, { value, expiresAt: now() + FLAG_CACHE_TTL_MS });
|
|
120
|
-
return failed ? false : value;
|
|
121
|
-
}
|
|
122
|
-
export function _resetOntologyEntityPushCacheForTests() {
|
|
123
|
-
cache.clear();
|
|
124
|
-
}
|
|
125
|
-
//# sourceMappingURL=ontology-entity-push.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology-entity-push.js","sourceRoot":"","sources":["../../src/lib/ontology-entity-push.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,aAAa,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAA2C,MAAM,8BAA8B,CAAC;AAE5H,4EAA4E;AAC5E,MAAM,CAAC,MAAM,yBAAyB,GAAG,qBAAqB,CAAC;AAE/D,MAAM,oBAAoB,GAAG,KAAK,CAAC;AACnC,MAAM,iBAAiB,GAAG,CAAC,GAAG,MAAM,CAAC;AAErC,yDAAyD;AACzD,MAAM,mBAAmB,GAAG,kDAAkD,CAAC;AAE/E;;;GAGG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAe;IACjD,MAAM,QAAQ,GAAG,OAAO;SACrB,KAAK,CAAC,IAAI,CAAC;SACX,IAAI,CAAC,GAAG,CAAC;SACT,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC;SACrB,OAAO,CAAC,qBAAqB,EAAE,EAAE,CAAC,CAAC;IACtC,OAAO,mBAAmB,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;AAC5C,CAAC;AAgBD,MAAM,KAAK,GAAG,IAAI,GAAG,EAAiD,CAAC;AAEvE,yEAAyE;AACzE,MAAM,CAAC,KAAK,UAAU,yBAAyB,CAAC,KAA8B;IAC5E,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,UAAU,CAAC,MAAM,CAAC;QAAE,OAAO,KAAK,CAAC;IACvD,MAAM,GAAG,GAAG,KAAK,CAAC,GAAG,IAAI,OAAO,CAAC,GAAG,CAAC;IACrC,MAAM,KAAK,GAAG,iBAAiB,CAAC,yBAAyB,EAAE,GAAG,CAAC,CAAC;IAChE,IAAI,KAAK,KAAK,IAAI;QAAE,OA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AC;YAAS,CAAC;QACT,IAAI,CAAC;YACH,MAAM,EAAE,KAAK,EAAE,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,IAAI,CAAC,KAAK,CAAC,CAAC;QACd,CAAC;IACH,CAAC;IACD,yDAAyD;IACzD,IAAI,CAAC,MAAM;QAAE,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,EAAE,KAAK,EAAE,SAAS,EAAE,GAAG,EAAE,GAAG,iBAAiB,EAAE,CAAC,CAAC;IAClF,OAAO,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,qCAAqC;IACnD,KAAK,CAAC,KAAK,EAAE,CAAC;AAChB,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology-entity-push.test.d.ts","sourceRoot":"","sources":["../../src/lib/ontology-entity-push.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,149 +0,0 @@
|
|
|
1
|
-
import { afterEach, describe, expect, it, vi } from "vitest";
|
|
2
|
-
import { _resetOntologyEntityPushCacheForTests, isOntologyEntityKey, resolveOntologyEntityPush, } from "./ontology-entity-push.js";
|
|
3
|
-
function fakeClient(explained, opts = {}) {
|
|
4
|
-
const created = [];
|
|
5
|
-
const close = vi.fn();
|
|
6
|
-
const createClient = vi.fn((options) => {
|
|
7
|
-
created.push(options);
|
|
8
|
-
return {
|
|
9
|
-
ready: async () => {
|
|
10
|
-
if (opts.reportError)
|
|
11
|
-
options.onError?.(opts.reportError);
|
|
12
|
-
if (opts.readyError)
|
|
13
|
-
throw opts.readyError;
|
|
14
|
-
},
|
|
15
|
-
explain: () => explained,
|
|
16
|
-
close,
|
|
17
|
-
};
|
|
18
|
-
});
|
|
19
|
-
return { createClient, created, close };
|
|
20
|
-
}
|
|
21
|
-
function input(overrides = {}) {
|
|
22
|
-
return {
|
|
23
|
-
companyUid: "cmp_01TEST",
|
|
24
|
-
companySlug: "acme",
|
|
25
|
-
endpoint: "https://flags.test",
|
|
26
|
-
getToken: () => "jwt",
|
|
27
|
-
env: {},
|
|
28
|
-
onError: () => undefined,
|
|
29
|
-
...overrides,
|
|
30
|
-
};
|
|
31
|
-
}
|
|
32
|
-
afterEach(() => {
|
|
33
|
-
_resetOntologyEntityPushCacheForTests();
|
|
34
|
-
});
|
|
35
|
-
describe("isOntologyEntityKey", () => {
|
|
36
|
-
it("matches entity markdown files, vault- or hqRoot-relative", () => {
|
|
37
|
-
const companyPrefix = ["companies", "acme"].join("/");
|
|
38
|
-
expect(isOntologyEntityKey("ontology/entities/person/jane-doe.md")).toBe(true);
|
|
39
|
-
expect(isOntologyEntityKey(`${companyPrefix}/ontology/entities/project/hq.md`)).toBe(true);
|
|
40
|
-
});
|
|
41
|
-
it("rejects the rest of ontology/ and other server-owned paths", () => {
|
|
42
|
-
for (const key of [
|
|
43
|
-
"ontology/.last-run",
|
|
44
|
-
"ontology/merge-proposals.json",
|
|
45
|
-
"ontology/facts/f1.md",
|
|
46
|
-
"ontology/entities/person/nested/x.md",
|
|
47
|
-
"ontology/entities/person/x.json",
|
|
48
|
-
"ontology/entities/Person/x.md",
|
|
49
|
-
"signals/s1.md",
|
|
50
|
-
"company-brief.md",
|
|
51
|
-
]) {
|
|
52
|
-
expect(isOntologyEntityKey(key), key).toBe(false);
|
|
53
|
-
}
|
|
54
|
-
});
|
|
55
|
-
});
|
|
56
|
-
describe("resolveOntologyEntityPush", () => {
|
|
57
|
-
it("is false for a non-company vault without asking the flag service", async () => {
|
|
58
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
59
|
-
expect(await resolveOntologyEntityPush(input({ companyUid: "prs_01X", createClient: fake.createClient }))).toBe(false);
|
|
60
|
-
expect(fake.createClient).not.toHaveBeenCalled();
|
|
61
|
-
});
|
|
62
|
-
it("lets the local override win in both directions", async () => {
|
|
63
|
-
const on = fakeClient({ source: "snapshot", value: false });
|
|
64
|
-
expect(await resolveOntologyEntityPush(input({ env: { HQ_FLAG_CHECKPOINT_ONTOLOGY: "true" }, createClient: on.createClient }))).toBe(true);
|
|
65
|
-
const off = fakeClient({ source: "snapshot", value: true });
|
|
66
|
-
expect(await resolveOntologyEntityPush(input({ env: { HQ_FLAG_CHECKPOINT_ONTOLOGY: "false" }, createClient: off.createClient }))).toBe(false);
|
|
67
|
-
expect(on.createClient).not.toHaveBeenCalled();
|
|
68
|
-
expect(off.createClient).not.toHaveBeenCalled();
|
|
69
|
-
});
|
|
70
|
-
it("is true only for a snapshot value of true, scoped to the company", async () => {
|
|
71
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
72
|
-
expect(await resolveOntologyEntityPush(input({ createClient: fake.createClient }))).toBe(true);
|
|
73
|
-
expect(fake.created[0]).toMatchObject({
|
|
74
|
-
endpoint: "https://flags.test",
|
|
75
|
-
companyUid: "cmp_01TEST",
|
|
76
|
-
companyIdentifiers: ["acme"],
|
|
77
|
-
refreshIntervalMs: 0,
|
|
78
|
-
env: {},
|
|
79
|
-
});
|
|
80
|
-
expect(fake.close).toHaveBeenCalledTimes(1);
|
|
81
|
-
});
|
|
82
|
-
it("is false for a fallback or non-true value", async () => {
|
|
83
|
-
const fallback = fakeClient({ source: "fallback", value: true });
|
|
84
|
-
expect(await resolveOntologyEntityPush(input({ createClient: fallback.createClient }))).toBe(false);
|
|
85
|
-
_resetOntologyEntityPushCacheForTests();
|
|
86
|
-
const off = fakeClient({ source: "snapshot", value: "true" });
|
|
87
|
-
expect(await resolveOntologyEntityPush(input({ createClient: off.createClient }))).toBe(false);
|
|
88
|
-
});
|
|
89
|
-
it("is false with no endpoint or no token", async () => {
|
|
90
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
91
|
-
expect(await resolveOntologyEntityPush(input({ endpoint: undefined, createClient: fake.createClient }))).toBe(false);
|
|
92
|
-
expect(await resolveOntologyEntityPush(input({ getToken: undefined, createClient: fake.createClient }))).toBe(false);
|
|
93
|
-
expect(fake.createClient).not.toHaveBeenCalled();
|
|
94
|
-
});
|
|
95
|
-
it("prefers HQ_FLAGS_API_URL over the vault endpoint", async () => {
|
|
96
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
97
|
-
await resolveOntologyEntityPush(input({ env: { HQ_FLAGS_API_URL: "https://override.test" }, createClient: fake.createClient }));
|
|
98
|
-
expect(fake.created[0].endpoint).toBe("https://override.test");
|
|
99
|
-
});
|
|
100
|
-
it("reports a failed read once, returns false, and does not cache it", async () => {
|
|
101
|
-
const onError = vi.fn();
|
|
102
|
-
const failing = fakeClient({ source: "snapshot", value: true }, {
|
|
103
|
-
reportError: new Error("403"),
|
|
104
|
-
readyError: new Error("boom"),
|
|
105
|
-
});
|
|
106
|
-
expect(await resolveOntologyEntityPush(input({ onError, createClient: failing.createClient }))).toBe(false);
|
|
107
|
-
expect(onError).toHaveBeenCalledTimes(1);
|
|
108
|
-
const ok = fakeClient({ source: "snapshot", value: true });
|
|
109
|
-
expect(await resolveOntologyEntityPush(input({ createClient: ok.createClient }))).toBe(true);
|
|
110
|
-
expect(ok.createClient).toHaveBeenCalledTimes(1);
|
|
111
|
-
});
|
|
112
|
-
it("treats an onError report as a failure even when ready() resolves", async () => {
|
|
113
|
-
const onError = vi.fn();
|
|
114
|
-
const fake = fakeClient({ source: "snapshot", value: true }, { reportError: new Error("timeout") });
|
|
115
|
-
expect(await resolveOntologyEntityPush(input({ onError, createClient: fake.createClient }))).toBe(false);
|
|
116
|
-
expect(onError).toHaveBeenCalledTimes(1);
|
|
117
|
-
});
|
|
118
|
-
it("does not share a cached answer between callers of the same company", async () => {
|
|
119
|
-
const owner = fakeClient({ source: "snapshot", value: true });
|
|
120
|
-
expect(await resolveOntologyEntityPush(input({ getToken: () => "owner-jwt", createClient: owner.createClient }))).toBe(true);
|
|
121
|
-
const member = fakeClient({ source: "snapshot", value: false });
|
|
122
|
-
expect(await resolveOntologyEntityPush(input({ getToken: () => "member-jwt", createClient: member.createClient }))).toBe(false);
|
|
123
|
-
expect(member.createClient).toHaveBeenCalledTimes(1);
|
|
124
|
-
});
|
|
125
|
-
it("reports a token failure and returns false", async () => {
|
|
126
|
-
const onError = vi.fn();
|
|
127
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
128
|
-
const getToken = () => {
|
|
129
|
-
throw new Error("signed out");
|
|
130
|
-
};
|
|
131
|
-
expect(await resolveOntologyEntityPush(input({ onError, getToken, createClient: fake.createClient }))).toBe(false);
|
|
132
|
-
expect(onError).toHaveBeenCalledTimes(1);
|
|
133
|
-
expect(fake.createClient).not.toHaveBeenCalled();
|
|
134
|
-
});
|
|
135
|
-
it("caches a successful read per endpoint and company until the TTL", async () => {
|
|
136
|
-
let t = 1_000;
|
|
137
|
-
const now = () => t;
|
|
138
|
-
const fake = fakeClient({ source: "snapshot", value: true });
|
|
139
|
-
await resolveOntologyEntityPush(input({ now, createClient: fake.createClient }));
|
|
140
|
-
await resolveOntologyEntityPush(input({ now, createClient: fake.createClient }));
|
|
141
|
-
expect(fake.createClient).toHaveBeenCalledTimes(1);
|
|
142
|
-
await resolveOntologyEntityPush(input({ now, companyUid: "cmp_OTHER", createClient: fake.createClient }));
|
|
143
|
-
expect(fake.createClient).toHaveBeenCalledTimes(2);
|
|
144
|
-
t += 5 * 60_000 + 1;
|
|
145
|
-
await resolveOntologyEntityPush(input({ now, createClient: fake.createClient }));
|
|
146
|
-
expect(fake.createClient).toHaveBeenCalledTimes(3);
|
|
147
|
-
});
|
|
148
|
-
});
|
|
149
|
-
//# sourceMappingURL=ontology-entity-push.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"ontology-entity-push.test.js","sourceRoot":"","sources":["../../src/lib/ontology-entity-push.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,QAAQ,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AAE7D,OAAO,EACL,qCAAqC,EACrC,mBAAmB,EACnB,yBA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