@x12i/catalox 3.0.0 → 3.1.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.
Files changed (125) hide show
  1. package/README.md +38 -5
  2. package/dist/src/catalox/authorization.js +1 -1
  3. package/dist/src/catalox/authorization.js.map +1 -1
  4. package/dist/src/catalox/catalog-lifecycle.d.ts +29 -0
  5. package/dist/src/catalox/catalog-lifecycle.d.ts.map +1 -0
  6. package/dist/src/catalox/catalog-lifecycle.js +480 -0
  7. package/dist/src/catalox/catalog-lifecycle.js.map +1 -0
  8. package/dist/src/catalox/catalox-bound.d.ts +20 -4
  9. package/dist/src/catalox/catalox-bound.d.ts.map +1 -1
  10. package/dist/src/catalox/catalox-bound.js +30 -6
  11. package/dist/src/catalox/catalox-bound.js.map +1 -1
  12. package/dist/src/catalox/catalox.d.ts +29 -4
  13. package/dist/src/catalox/catalox.d.ts.map +1 -1
  14. package/dist/src/catalox/catalox.js +483 -66
  15. package/dist/src/catalox/catalox.js.map +1 -1
  16. package/dist/src/catalox/context.js +2 -2
  17. package/dist/src/catalox/context.js.map +1 -1
  18. package/dist/src/catalox/create-catalox.d.ts +6 -0
  19. package/dist/src/catalox/create-catalox.d.ts.map +1 -1
  20. package/dist/src/catalox/create-catalox.js +25 -0
  21. package/dist/src/catalox/create-catalox.js.map +1 -1
  22. package/dist/src/catalox/index.d.ts +2 -0
  23. package/dist/src/catalox/index.d.ts.map +1 -1
  24. package/dist/src/catalox/index.js +2 -0
  25. package/dist/src/catalox/index.js.map +1 -1
  26. package/dist/src/catalox/native-catalog-merge.d.ts +12 -0
  27. package/dist/src/catalox/native-catalog-merge.d.ts.map +1 -0
  28. package/dist/src/catalox/native-catalog-merge.js +102 -0
  29. package/dist/src/catalox/native-catalog-merge.js.map +1 -0
  30. package/dist/src/catalox/native-scope.d.ts +28 -0
  31. package/dist/src/catalox/native-scope.d.ts.map +1 -0
  32. package/dist/src/catalox/native-scope.js +184 -0
  33. package/dist/src/catalox/native-scope.js.map +1 -0
  34. package/dist/src/catalox/record-history.d.ts +53 -0
  35. package/dist/src/catalox/record-history.d.ts.map +1 -0
  36. package/dist/src/catalox/record-history.js +158 -0
  37. package/dist/src/catalox/record-history.js.map +1 -0
  38. package/dist/src/cli/index.js +133 -1
  39. package/dist/src/cli/index.js.map +1 -1
  40. package/dist/src/contracts/apps.d.ts +2 -0
  41. package/dist/src/contracts/apps.d.ts.map +1 -1
  42. package/dist/src/contracts/catalog-lifecycle.d.ts +70 -0
  43. package/dist/src/contracts/catalog-lifecycle.d.ts.map +1 -0
  44. package/dist/src/contracts/catalog-lifecycle.js +2 -0
  45. package/dist/src/contracts/catalog-lifecycle.js.map +1 -0
  46. package/dist/src/contracts/catalogs.d.ts +37 -0
  47. package/dist/src/contracts/catalogs.d.ts.map +1 -1
  48. package/dist/src/contracts/catalogs.js.map +1 -1
  49. package/dist/src/contracts/context.d.ts +5 -1
  50. package/dist/src/contracts/context.d.ts.map +1 -1
  51. package/dist/src/contracts/descriptors.d.ts +6 -0
  52. package/dist/src/contracts/descriptors.d.ts.map +1 -1
  53. package/dist/src/contracts/index.d.ts +5 -2
  54. package/dist/src/contracts/index.d.ts.map +1 -1
  55. package/dist/src/contracts/index.js.map +1 -1
  56. package/dist/src/contracts/items.d.ts +19 -0
  57. package/dist/src/contracts/items.d.ts.map +1 -1
  58. package/dist/src/contracts/record-history.d.ts +66 -0
  59. package/dist/src/contracts/record-history.d.ts.map +1 -0
  60. package/dist/src/contracts/record-history.js +2 -0
  61. package/dist/src/contracts/record-history.js.map +1 -0
  62. package/dist/src/firebase/adapter-store.d.ts +1 -0
  63. package/dist/src/firebase/adapter-store.d.ts.map +1 -1
  64. package/dist/src/firebase/adapter-store.js +3 -0
  65. package/dist/src/firebase/adapter-store.js.map +1 -1
  66. package/dist/src/firebase/binding-store.d.ts +2 -0
  67. package/dist/src/firebase/binding-store.d.ts.map +1 -1
  68. package/dist/src/firebase/binding-store.js +10 -0
  69. package/dist/src/firebase/binding-store.js.map +1 -1
  70. package/dist/src/firebase/catalog-data-index-store.d.ts +1 -0
  71. package/dist/src/firebase/catalog-data-index-store.d.ts.map +1 -1
  72. package/dist/src/firebase/catalog-data-index-store.js +3 -0
  73. package/dist/src/firebase/catalog-data-index-store.js.map +1 -1
  74. package/dist/src/firebase/catalog-item-history-store.d.ts +21 -0
  75. package/dist/src/firebase/catalog-item-history-store.d.ts.map +1 -0
  76. package/dist/src/firebase/catalog-item-history-store.js +61 -0
  77. package/dist/src/firebase/catalog-item-history-store.js.map +1 -0
  78. package/dist/src/firebase/catalog-store.d.ts +1 -0
  79. package/dist/src/firebase/catalog-store.d.ts.map +1 -1
  80. package/dist/src/firebase/catalog-store.js +3 -0
  81. package/dist/src/firebase/catalog-store.js.map +1 -1
  82. package/dist/src/firebase/index.d.ts +1 -0
  83. package/dist/src/firebase/index.d.ts.map +1 -1
  84. package/dist/src/firebase/index.js +1 -0
  85. package/dist/src/firebase/index.js.map +1 -1
  86. package/dist/src/firebase/mapping-store.d.ts +1 -0
  87. package/dist/src/firebase/mapping-store.d.ts.map +1 -1
  88. package/dist/src/firebase/mapping-store.js +3 -0
  89. package/dist/src/firebase/mapping-store.js.map +1 -1
  90. package/dist/src/firebase/native-item-store.d.ts +8 -2
  91. package/dist/src/firebase/native-item-store.d.ts.map +1 -1
  92. package/dist/src/firebase/native-item-store.js +22 -6
  93. package/dist/src/firebase/native-item-store.js.map +1 -1
  94. package/dist/src/firebase/reference-store.d.ts +3 -0
  95. package/dist/src/firebase/reference-store.d.ts.map +1 -1
  96. package/dist/src/firebase/reference-store.js +16 -0
  97. package/dist/src/firebase/reference-store.js.map +1 -1
  98. package/dist/src/firebase/renderer-snippet-store.d.ts +3 -0
  99. package/dist/src/firebase/renderer-snippet-store.d.ts.map +1 -1
  100. package/dist/src/firebase/renderer-snippet-store.js +17 -0
  101. package/dist/src/firebase/renderer-snippet-store.js.map +1 -1
  102. package/dist/src/firebase/snapshot-store.d.ts +1 -0
  103. package/dist/src/firebase/snapshot-store.d.ts.map +1 -1
  104. package/dist/src/firebase/snapshot-store.js +8 -0
  105. package/dist/src/firebase/snapshot-store.js.map +1 -1
  106. package/dist/test/integration/firestore.emulator.test.js +7 -1
  107. package/dist/test/integration/firestore.emulator.test.js.map +1 -1
  108. package/dist/test/integration/record-history.live.test.d.ts +2 -0
  109. package/dist/test/integration/record-history.live.test.d.ts.map +1 -0
  110. package/dist/test/integration/record-history.live.test.js +126 -0
  111. package/dist/test/integration/record-history.live.test.js.map +1 -0
  112. package/dist/test/unit/native-catalog-merge.test.d.ts +2 -0
  113. package/dist/test/unit/native-catalog-merge.test.d.ts.map +1 -0
  114. package/dist/test/unit/native-catalog-merge.test.js +33 -0
  115. package/dist/test/unit/native-catalog-merge.test.js.map +1 -0
  116. package/dist/test/unit/native-scope.test.d.ts +2 -0
  117. package/dist/test/unit/native-scope.test.d.ts.map +1 -0
  118. package/dist/test/unit/native-scope.test.js +29 -0
  119. package/dist/test/unit/native-scope.test.js.map +1 -0
  120. package/dist/test/unit/record-history-path.test.d.ts +2 -0
  121. package/dist/test/unit/record-history-path.test.d.ts.map +1 -0
  122. package/dist/test/unit/record-history-path.test.js +24 -0
  123. package/dist/test/unit/record-history-path.test.js.map +1 -0
  124. package/firestore.indexes.json +39 -0
  125. package/package.json +3 -2
@@ -0,0 +1,126 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import path from "node:path";
4
+ import { loadDotenv } from "@x12i/env";
5
+ import { initializeApp, cert, deleteApp } from "firebase-admin/app";
6
+ import { getFirestore } from "firebase-admin/firestore";
7
+ import { createCatalox } from "../../src/catalox/create-catalox.js";
8
+ import { buildRecordHistoryGcsClient, normalizeRecordHistoryGcsPrefix } from "../../src/catalox/record-history.js";
9
+ import { AppStore } from "../../src/firebase/app-store.js";
10
+ import { CatalogItemHistoryStore } from "../../src/firebase/catalog-item-history-store.js";
11
+ import { DescriptorStore } from "../../src/firebase/descriptor-store.js";
12
+ import { FirestoreStore } from "../../src/firebase/firestore-store.js";
13
+ loadDotenv(path.resolve(process.cwd(), ".env"));
14
+ function requireEnv(name) {
15
+ const v = process.env[name];
16
+ if (!v)
17
+ throw new Error(`Missing required env: ${name}`);
18
+ return v;
19
+ }
20
+ test("record history live: upsert, update, list, get, restore + GCS when bucket env is set", async (t) => {
21
+ if (process.env.FIRESTORE_LIVE_TESTS !== "1") {
22
+ t.skip("FIRESTORE_LIVE_TESTS not enabled");
23
+ return;
24
+ }
25
+ const historyBucket = String(process.env.CATALOX_RECORD_HISTORY_BUCKET ?? "").trim();
26
+ if (!historyBucket) {
27
+ t.skip("CATALOX_RECORD_HISTORY_BUCKET not set");
28
+ return;
29
+ }
30
+ const serviceAccountPath = requireEnv("FIREBASE_SERVICE_ACCOUNT_PATH");
31
+ const projectId = requireEnv("FIREBASE_PROJECT_ID");
32
+ const appName = `catalox-rh-${Date.now()}`;
33
+ const app = initializeApp({ credential: cert(serviceAccountPath), projectId }, appName);
34
+ const firestore = getFirestore(app);
35
+ const store = new FirestoreStore({ firestore, app });
36
+ const apps = new AppStore(store);
37
+ const descriptors = new DescriptorStore(store);
38
+ const historyStore = new CatalogItemHistoryStore(store);
39
+ const rhPrefix = normalizeRecordHistoryGcsPrefix(process.env.CATALOX_RECORD_HISTORY_PREFIX);
40
+ const catalox = createCatalox({
41
+ firestore,
42
+ firebaseApp: app,
43
+ recordHistory: {
44
+ gcsBucket: historyBucket,
45
+ gcsPrefix: rhPrefix,
46
+ failClosed: String(process.env.CATALOX_RECORD_HISTORY_FAIL_CLOSED ?? "").trim() === "1",
47
+ },
48
+ });
49
+ const historyGcs = buildRecordHistoryGcsClient({
50
+ store: historyStore,
51
+ gcsBucket: historyBucket,
52
+ gcsBasePrefix: rhPrefix,
53
+ failClosed: false,
54
+ });
55
+ const runId = `${Date.now()}`;
56
+ const appId = `catalox_rh_${runId}`;
57
+ const catalogId = `rh_cat_${runId}`;
58
+ const ctx = { appId, superAdmin: true };
59
+ await apps.upsert({
60
+ appId,
61
+ name: "RH App",
62
+ status: "active",
63
+ createdAt: new Date().toISOString(),
64
+ updatedAt: new Date().toISOString(),
65
+ });
66
+ await catalox.createCatalog(ctx, {
67
+ catalogId,
68
+ name: "RH",
69
+ sourceMode: "native",
70
+ native: { type: "native" },
71
+ });
72
+ await catalox.bindCatalogToApp(ctx, {
73
+ appId,
74
+ catalogId,
75
+ access: { canRead: true, canWrite: true, canAdmin: true },
76
+ });
77
+ const descRec = await descriptors.get(catalogId);
78
+ assert.ok(descRec);
79
+ await descriptors.upsert({
80
+ ...descRec,
81
+ descriptor: {
82
+ ...descRec.descriptor,
83
+ identity: { itemIdStrategy: "natural", itemIdField: "id" },
84
+ queryableFields: [{ key: "id", label: "ID", type: "string", indexed: true, filterable: true }],
85
+ },
86
+ updatedAt: new Date().toISOString(),
87
+ });
88
+ await catalox.upsertNativeCatalogItem(ctx, catalogId, { id: "one", title: "A" });
89
+ await catalox.updateNativeCatalogItem(ctx, catalogId, "one", { title: "B" });
90
+ const hist = await catalox.listCatalogItemHistory(ctx, catalogId, {
91
+ itemId: "one",
92
+ limit: 20,
93
+ });
94
+ assert.ok(hist.events.length >= 2);
95
+ assert.equal(hist.events[0].catalogId, catalogId);
96
+ const latestEventId = hist.events[0].eventId;
97
+ const detail = await catalox.getCatalogItemHistoryEvent(ctx, latestEventId);
98
+ assert.ok(detail);
99
+ assert.equal(String(detail.payload.before?.data?.title ?? ""), "A");
100
+ assert.equal(String(detail.payload.after?.data?.title ?? ""), "B");
101
+ await catalox.restoreCatalogItemFromHistory(ctx, latestEventId, { mode: "before" });
102
+ const got = await catalox.getCatalogItem(ctx, catalogId, "one");
103
+ assert.equal(got.outcome, "found");
104
+ if (got.outcome === "found")
105
+ assert.equal(got.item.data.title, "A");
106
+ const histAfterRestore = await catalox.listCatalogItemHistory(ctx, catalogId, {
107
+ itemId: "one",
108
+ limit: 50,
109
+ });
110
+ await firestore.collection("apps").doc(appId).delete().catch(() => { });
111
+ await firestore.collection("catalogs").doc(catalogId).delete().catch(() => { });
112
+ await firestore.collection("catalogDefinitions").doc(catalogId).delete().catch(() => { });
113
+ await firestore.collection("catalogDescriptors").doc(catalogId).delete().catch(() => { });
114
+ await firestore.collection("catalogBindings").doc(`${appId}:${catalogId}`).delete().catch(() => { });
115
+ await firestore.collection("catalogData").doc(catalogId).delete().catch(() => { });
116
+ const flat = `catalogData-${catalogId}-items`;
117
+ const flatSnap = await firestore.collection(flat).get();
118
+ for (const d of flatSnap.docs)
119
+ await d.ref.delete();
120
+ for (const e of histAfterRestore.events) {
121
+ await firestore.collection("catalogItemHistory").doc(e.eventId).delete().catch(() => { });
122
+ await historyGcs.deleteObject(e.gcsRelativePath).catch(() => { });
123
+ }
124
+ await deleteApp(app);
125
+ });
126
+ //# sourceMappingURL=record-history.live.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-history.live.test.js","sourceRoot":"","sources":["../../../test/integration/record-history.live.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AACvC,OAAO,EAAE,aAAa,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,oBAAoB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AAExD,OAAO,EAAE,aAAa,EAAE,MAAM,qCAAqC,CAAC;AACpE,OAAO,EAAE,2BAA2B,EAAE,+BAA+B,EAAE,MAAM,qCAAqC,CAAC;AACnH,OAAO,EAAE,QAAQ,EAAE,MAAM,iCAAiC,CAAC;AAC3D,OAAO,EAAE,uBAAuB,EAAE,MAAM,kDAAkD,CAAC;AAC3F,OAAO,EAAE,eAAe,EAAE,MAAM,wCAAwC,CAAC;AACzE,OAAO,EAAE,cAAc,EAAE,MAAM,uCAAuC,CAAC;AAEvE,UAAU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AAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;QACzF,MAAM,UAAU,CAAC,YAAY,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,KAAK,CAAC,GAAG,EAAE,GAAE,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,MAAM,SAAS,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=native-catalog-merge.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-catalog-merge.test.d.ts","sourceRoot":"","sources":["../../../test/unit/native-catalog-merge.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,33 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { mergeNativePhysicalRows, pickWinningPhysicalRow } from "../../src/catalox/native-catalog-merge.js";
4
+ const compositeIdentity = {
5
+ itemIdStrategy: "composite",
6
+ compositeFields: ["categoryId", "code"],
7
+ };
8
+ function row(scope, data, itemId = "core:S1") {
9
+ return {
10
+ itemId,
11
+ catalogId: "c1",
12
+ data,
13
+ createdAt: "2020-01-01T00:00:00.000Z",
14
+ updatedAt: "2020-01-02T00:00:00.000Z",
15
+ ...(scope != null ? { scope } : {}),
16
+ indexed: { scopeLayer: "global" },
17
+ };
18
+ }
19
+ test("mergeNativePhysicalRows overlays user over global by composite identity", () => {
20
+ const g = row({ kind: "global" }, { categoryId: "core", code: "S1", title: "Global" });
21
+ const u = row({ kind: "user", accountId: "a1", userId: "u1" }, { categoryId: "core", code: "S1", title: "User" }, "core:S1");
22
+ u.indexed = { scopeLayer: "user", scopeAccountId: "a1", scopeUserId: "u1" };
23
+ const merged = mergeNativePhysicalRows([g, u], compositeIdentity, "app1", false);
24
+ assert.equal(merged.length, 1);
25
+ assert.equal(merged[0].data.title, "User");
26
+ });
27
+ test("pickWinningPhysicalRow prefers user scoped row", () => {
28
+ const g = row({ kind: "global" }, { x: 1 });
29
+ const u = row({ kind: "user", accountId: "a1", userId: "u1" }, { x: 2 });
30
+ const w = pickWinningPhysicalRow([g, u], { accountId: "a1", userId: "u1" });
31
+ assert.equal(w?.scope?.kind, "user");
32
+ });
33
+ //# sourceMappingURL=native-catalog-merge.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-catalog-merge.test.js","sourceRoot":"","sources":["../../../test/unit/native-catalog-merge.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,OAAO,EAAE,uBAAuB,EAAE,sBAAsB,EAAE,MAAM,2CAA2C,CAAC;AAI5G,MAAM,iBAAiB,GAA8B;IACnD,cAAc,EAAE,WAAW;IAC3B,eAAe,EAAE,CAAC,YAAY,EAAE,MAAM,CAAC;CACxC,CAAC;AAEF,SAAS,GAAG,CACV,KAAuC,EACvC,IAA6B,EAC7B,MAAM,GAAG,SAAS;IAElB,OAAO;QACL,MAAM;QACN,SAAS,EAAE,IAAI;QACf,IAAI;QACJ,SAAS,EAAE,0BAA0B;QACrC,SAAS,EAAE,0BAA0B;QACrC,GAAG,CAAC,KAAK,IAAI,IAAI,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,OAAO,EAAE,EAAE,UAAU,EAAE,QAAQ,EAAE;KAClC,CAAC;AACJ,CAAC;AAED,IAAI,CAAC,yEAAyE,EAAE,GAAG,EAAE;IACnF,MAAM,CAAC,GAAG,GAAG,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,EAAE,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;IACvF,MAAM,CAAC,GAAG,GAAG,CACX,EAAE,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,IAAI,EAAE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"version":3,"file":"native-scope.test.d.ts","sourceRoot":"","sources":["../../../test/unit/native-scope.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,29 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { assertSuperAdminForNonGlobalScope, decodeNativeItemStorageDocId, encodeNativeItemStorageDocId, physicalRowMatchesFetchScope, } from "../../src/catalox/native-scope.js";
4
+ import { CatalogAccessDeniedError } from "../../src/contracts/errors.js";
5
+ test("encode/decode roundtrip for account scope", () => {
6
+ const logical = "core:S1";
7
+ const scope = { kind: "account", accountId: "acc1" };
8
+ const id = encodeNativeItemStorageDocId(logical, scope);
9
+ const dec = decodeNativeItemStorageDocId(id);
10
+ assert.ok(dec);
11
+ assert.equal(dec.logicalItemId, logical);
12
+ assert.deepEqual(dec.scope, scope);
13
+ });
14
+ test("global scope uses logical id as storage doc id", () => {
15
+ const id = encodeNativeItemStorageDocId("x:y", { kind: "global" });
16
+ assert.equal(id, "x:y");
17
+ assert.deepEqual(decodeNativeItemStorageDocId("x:y"), { logicalItemId: "x:y", scope: { kind: "global" } });
18
+ });
19
+ test("physicalRowMatchesFetchScope for account audience", () => {
20
+ const row = { kind: "account", accountId: "a1", agentIds: ["ag1"] };
21
+ assert.equal(physicalRowMatchesFetchScope(row, { accountId: "a1", agentId: "ag1" }), true);
22
+ assert.equal(physicalRowMatchesFetchScope(row, { accountId: "a1" }), false);
23
+ });
24
+ test("assertSuperAdminForNonGlobalScope throws without superAdmin", () => {
25
+ assert.throws(() => assertSuperAdminForNonGlobalScope(false, { kind: "account", accountId: "x" }), (e) => e instanceof CatalogAccessDeniedError);
26
+ assert.doesNotThrow(() => assertSuperAdminForNonGlobalScope(true, { kind: "account", accountId: "x" }));
27
+ assert.doesNotThrow(() => assertSuperAdminForNonGlobalScope(false, { kind: "global" }));
28
+ });
29
+ //# sourceMappingURL=native-scope.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"native-scope.test.js","sourceRoot":"","sources":["../../../test/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AAE,SAAkB,EAAE,SAAS,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,CAAC;IAC7E,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,CAAC,CAAC;IAC3F,MAAM,CAAC,KAAK,CAAC,4BAA4B,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,EAAE,KAAK,CAAC,CAAC;AAC9E,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,6DAA6D,EAAE,GAAG,EAAE;IACvE,MAAM,CAAC,MAAM,CACX,GAAG,EAAE,CAAC,iCAAiC,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,EACnF,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,YAAY,wBAAwB,CAC7C,CAAC;IACF,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,SAAS,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IACxG,MAAM,CAAC,YAAY,CAAC,GAAG,EAAE,CAAC,iCAAiC,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC;AAC1F,CAAC,CAAC,CAAC"}
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=record-history-path.test.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-history-path.test.d.ts","sourceRoot":"","sources":["../../../test/unit/record-history-path.test.ts"],"names":[],"mappings":""}
@@ -0,0 +1,24 @@
1
+ import test from "node:test";
2
+ import assert from "node:assert/strict";
3
+ import { buildRecordHistoryGcsRelativePath, fingerprintNativeRecord } from "../../src/catalox/record-history.js";
4
+ test("buildRecordHistoryGcsRelativePath encodes date segments and op", () => {
5
+ const rel = buildRecordHistoryGcsRelativePath({
6
+ catalogId: "signals",
7
+ op: "update",
8
+ itemId: "a:b",
9
+ ts: "2026-04-19T12:00:00.000Z",
10
+ });
11
+ assert.match(rel, /^records\/signals\/2026\/04\/19\//);
12
+ assert.match(rel, /__update__[a-f0-9]{16}\.ndjson$/);
13
+ });
14
+ test("fingerprintNativeRecord is stable for same record", () => {
15
+ const rec = {
16
+ itemId: "x",
17
+ catalogId: "c",
18
+ data: { n: 1 },
19
+ createdAt: "t0",
20
+ updatedAt: "t1",
21
+ };
22
+ assert.equal(fingerprintNativeRecord(rec), fingerprintNativeRecord({ ...rec }));
23
+ });
24
+ //# sourceMappingURL=record-history-path.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"record-history-path.test.js","sourceRoot":"","sources":["../../../test/unit/record-history-path.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,OAAO,EAAE,iCAAiC,EAAE,uBAAuB,EAAE,MAAM,qCAAqC,CAAC;AAEjH,IAAI,CAAC,gEAAgE,EAAE,GAAG,EAAE;IAC1E,MAAM,GAAG,GAAG,iCAAiC,CAAC;QAC5C,SAAS,EAAE,SAAS;QACpB,EAAE,EAAE,QAAQ;QACZ,MAAM,EAAE,KAAK;QACb,EAAE,EAAE,0BAA0B;KAC/B,CAAC,CAAC;IACH,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,mCAAmC,CAAC,CAAC;IACvD,MAAM,CAAC,KAAK,CAAC,GAAG,EAAE,iCAAiC,CAAC,CAAC;AACvD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,mDAAmD,EAAE,GAAG,EAAE;IAC7D,MAAM,GAAG,GAAG;QACV,MAAM,EAAE,GAAG;QACX,SAAS,EAAE,GAAG;QACd,IAAI,EAAE,EAAE,CAAC,EAAE,CAAC,EAAE;QACd,SAAS,EAAE,IAAI;QACf,SAAS,EAAE,IAAI;KAChB,CAAC;IACF,MAAM,CAAC,KAAK,CAAC,uBAAuB,CAAC,GAAG,CAAC,EAAE,uBAAuB,CAAC,EAAE,GAAG,GAAG,EAAE,CAAC,CAAC,CAAC;AAClF,CAAC,CAAC,CAAC"}
@@ -0,0 +1,39 @@
1
+ {
2
+ "indexes": [
3
+ {
4
+ "collectionGroup": "catalogItemHistory",
5
+ "queryScope": "COLLECTION",
6
+ "fields": [
7
+ { "fieldPath": "catalogId", "order": "ASCENDING" },
8
+ { "fieldPath": "ts", "order": "DESCENDING" }
9
+ ]
10
+ },
11
+ {
12
+ "collectionGroup": "catalogItemHistory",
13
+ "queryScope": "COLLECTION",
14
+ "fields": [
15
+ { "fieldPath": "catalogId", "order": "ASCENDING" },
16
+ { "fieldPath": "itemId", "order": "ASCENDING" },
17
+ { "fieldPath": "ts", "order": "DESCENDING" }
18
+ ]
19
+ },
20
+ {
21
+ "collectionGroup": "catalogItemHistory",
22
+ "queryScope": "COLLECTION",
23
+ "fields": [
24
+ { "fieldPath": "catalogId", "order": "ASCENDING" },
25
+ { "fieldPath": "op", "order": "ASCENDING" },
26
+ { "fieldPath": "ts", "order": "DESCENDING" }
27
+ ]
28
+ },
29
+ {
30
+ "collectionGroup": "catalogItemHistory",
31
+ "queryScope": "COLLECTION",
32
+ "fields": [
33
+ { "fieldPath": "catalogId", "order": "ASCENDING" },
34
+ { "fieldPath": "ts", "order": "ASCENDING" }
35
+ ]
36
+ }
37
+ ],
38
+ "fieldOverrides": []
39
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@x12i/catalox",
3
- "version": "3.0.0",
3
+ "version": "3.1.1",
4
4
  "description": "Catalox: Firebase-native catalog metadata + unification package.",
5
5
  "license": "MIT",
6
6
  "private": false,
@@ -50,7 +50,8 @@
50
50
  "files": [
51
51
  "dist",
52
52
  "README.md",
53
- "LICENSE"
53
+ "LICENSE",
54
+ "firestore.indexes.json"
54
55
  ],
55
56
  "scripts": {
56
57
  "cli": "node dist/src/cli/index.js",