@x12i/catalox 2.4.0 → 2.6.0
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/README.md +43 -4
- package/dist/src/catalox/backup-data.d.ts +2 -4
- package/dist/src/catalox/backup-data.d.ts.map +1 -1
- package/dist/src/catalox/backup-data.js +206 -1
- package/dist/src/catalox/backup-data.js.map +1 -1
- package/dist/src/catalox/catalox.d.ts +17 -0
- package/dist/src/catalox/catalox.d.ts.map +1 -1
- package/dist/src/catalox/catalox.js +64 -6
- package/dist/src/catalox/catalox.js.map +1 -1
- package/dist/src/catalox/firestore-gcs-compare.d.ts +15 -0
- package/dist/src/catalox/firestore-gcs-compare.d.ts.map +1 -0
- package/dist/src/catalox/firestore-gcs-compare.js +221 -0
- package/dist/src/catalox/firestore-gcs-compare.js.map +1 -0
- package/dist/src/catalox/firestore-gcs-transfer.d.ts +24 -0
- package/dist/src/catalox/firestore-gcs-transfer.d.ts.map +1 -0
- package/dist/src/catalox/firestore-gcs-transfer.js +329 -0
- package/dist/src/catalox/firestore-gcs-transfer.js.map +1 -0
- package/dist/src/catalox/index.d.ts +3 -1
- package/dist/src/catalox/index.d.ts.map +1 -1
- package/dist/src/catalox/index.js +3 -1
- package/dist/src/catalox/index.js.map +1 -1
- package/dist/src/cli/index.js +188 -4
- package/dist/src/cli/index.js.map +1 -1
- package/dist/src/contracts/backup.d.ts +11 -1
- package/dist/src/contracts/backup.d.ts.map +1 -1
- package/dist/src/contracts/catalogs.d.ts +6 -0
- package/dist/src/contracts/catalogs.d.ts.map +1 -1
- package/dist/src/contracts/catalogs.js +18 -1
- package/dist/src/contracts/catalogs.js.map +1 -1
- package/dist/src/contracts/gcs-firestore-compare.d.ts +64 -0
- package/dist/src/contracts/gcs-firestore-compare.d.ts.map +1 -0
- package/dist/src/contracts/gcs-firestore-compare.js +2 -0
- package/dist/src/contracts/gcs-firestore-compare.js.map +1 -0
- package/dist/src/contracts/gcs-firestore-transfer.d.ts +94 -0
- package/dist/src/contracts/gcs-firestore-transfer.d.ts.map +1 -0
- package/dist/src/contracts/gcs-firestore-transfer.js +2 -0
- package/dist/src/contracts/gcs-firestore-transfer.js.map +1 -0
- package/dist/src/contracts/index.d.ts +3 -0
- package/dist/src/contracts/index.d.ts.map +1 -1
- package/dist/src/contracts/index.js +1 -0
- package/dist/src/contracts/index.js.map +1 -1
- package/dist/src/firebase/firestore-collection-path.d.ts +7 -0
- package/dist/src/firebase/firestore-collection-path.d.ts.map +1 -0
- package/dist/src/firebase/firestore-collection-path.js +24 -0
- package/dist/src/firebase/firestore-collection-path.js.map +1 -0
- package/dist/src/firebase/native-item-store.d.ts +6 -0
- package/dist/src/firebase/native-item-store.d.ts.map +1 -1
- package/dist/src/firebase/native-item-store.js +18 -1
- package/dist/src/firebase/native-item-store.js.map +1 -1
- package/dist/test/unit/compact-catalog-filter.test.d.ts +2 -0
- package/dist/test/unit/compact-catalog-filter.test.d.ts.map +1 -0
- package/dist/test/unit/compact-catalog-filter.test.js +18 -0
- package/dist/test/unit/compact-catalog-filter.test.js.map +1 -0
- package/dist/test/unit/gcs-backup-run-folder.test.d.ts +2 -0
- package/dist/test/unit/gcs-backup-run-folder.test.d.ts.map +1 -0
- package/dist/test/unit/gcs-backup-run-folder.test.js +10 -0
- package/dist/test/unit/gcs-backup-run-folder.test.js.map +1 -0
- package/dist/test/unit/gcs-firestore-compare.test.d.ts +2 -0
- package/dist/test/unit/gcs-firestore-compare.test.d.ts.map +1 -0
- package/dist/test/unit/gcs-firestore-compare.test.js +14 -0
- package/dist/test/unit/gcs-firestore-compare.test.js.map +1 -0
- package/dist/test/unit/gcs-firestore-paths.test.d.ts +2 -0
- package/dist/test/unit/gcs-firestore-paths.test.d.ts.map +1 -0
- package/dist/test/unit/gcs-firestore-paths.test.js +16 -0
- package/dist/test/unit/gcs-firestore-paths.test.js.map +1 -0
- package/package.json +5 -3
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { Timestamp } from "firebase-admin/firestore";
|
|
4
|
+
import { dataFingerprint, normalizeForCompare } from "../../src/catalox/firestore-gcs-compare.js";
|
|
5
|
+
test("normalizeForCompare maps Timestamp and JSON seconds shape consistently", () => {
|
|
6
|
+
const ts = new Timestamp(1700000000, 123000000);
|
|
7
|
+
const fromJson = { _seconds: 1700000000, _nanoseconds: 123000000 };
|
|
8
|
+
assert.equal(JSON.stringify(normalizeForCompare(ts)), JSON.stringify(normalizeForCompare(fromJson)));
|
|
9
|
+
assert.equal(dataFingerprint(ts), dataFingerprint(fromJson));
|
|
10
|
+
});
|
|
11
|
+
test("dataFingerprint differs when data differs", () => {
|
|
12
|
+
assert.notEqual(dataFingerprint({ a: 1 }), dataFingerprint({ a: 2 }));
|
|
13
|
+
});
|
|
14
|
+
//# sourceMappingURL=gcs-firestore-compare.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcs-firestore-compare.test.js","sourceRoot":"","sources":["../../../test/unit/gcs-firestore-compare.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AACxC,OAAO,EAAE,SAAS,EAAE,MAAM,0BAA0B,CAAC;AAErD,OAAO,EAAE,eAAe,EAAE,mBAAmB,EAAE,MAAM,4CAA4C,CAAC;AAElG,IAAI,CAAC,wEAAwE,EAAE,GAAG,EAAE;IAClF,MAAM,EAAE,GAAG,IAAI,SAAS,CAAC,UAAU,EAAE,SAAS,CAAC,CAAC;IAChD,MAAM,QAAQ,GAAG,EAAE,QAAQ,EAAE,UAAU,EAAE,YAAY,EAAE,SAAS,EAAE,CAAC;IACnE,MAAM,CAAC,KAAK,CACV,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,EAAE,CAAC,CAAC,EACvC,IAAI,CAAC,SAAS,CAAC,mBAAmB,CAAC,QAAQ,CAAC,CAAC,CAC9C,CAAC;IACF,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,QAAQ,CAAC,CAAC,CAAC;AAC/D,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACrD,MAAM,CAAC,QAAQ,CAAC,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,eAAe,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;AACxE,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcs-firestore-paths.test.d.ts","sourceRoot":"","sources":["../../../test/unit/gcs-firestore-paths.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import test from "node:test";
|
|
2
|
+
import assert from "node:assert/strict";
|
|
3
|
+
import { firestoreCollectionPathToObjectBase, ndjsonObjectPath, normalizeGcsPrefix, } from "../../src/catalox/firestore-gcs-transfer.js";
|
|
4
|
+
test("normalizeGcsPrefix trims and adds trailing slash", () => {
|
|
5
|
+
assert.equal(normalizeGcsPrefix(""), "");
|
|
6
|
+
assert.equal(normalizeGcsPrefix(" a/b "), "a/b/");
|
|
7
|
+
});
|
|
8
|
+
test("firestoreCollectionPathToObjectBase flattens slashes", () => {
|
|
9
|
+
assert.equal(firestoreCollectionPathToObjectBase("apps"), "apps");
|
|
10
|
+
assert.equal(firestoreCollectionPathToObjectBase("catalogData/narratives/items"), "catalogData__narratives__items");
|
|
11
|
+
});
|
|
12
|
+
test("ndjsonObjectPath applies optional postfix", () => {
|
|
13
|
+
assert.equal(ndjsonObjectPath({ gcsPrefix: "p/", collectionPath: "apps" }), "p/apps.ndjson");
|
|
14
|
+
assert.equal(ndjsonObjectPath({ gcsPrefix: "", collectionPath: "apps", objectNamePostfix: "_v1" }), "apps_v1.ndjson");
|
|
15
|
+
});
|
|
16
|
+
//# sourceMappingURL=gcs-firestore-paths.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gcs-firestore-paths.test.js","sourceRoot":"","sources":["../../../test/unit/gcs-firestore-paths.test.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,WAAW,CAAC;AAC7B,OAAO,MAAM,MAAM,oBAAoB,CAAC;AAExC,OAAO,EACL,mCAAmC,EACnC,gBAAgB,EAChB,kBAAkB,GACnB,MAAM,6CAA6C,CAAC;AAErD,IAAI,CAAC,kDAAkD,EAAE,GAAG,EAAE;IAC5D,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC;IACzC,MAAM,CAAC,KAAK,CAAC,kBAAkB,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC,CAAC;AACtD,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;IAChE,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,MAAM,CAAC,EAAE,MAAM,CAAC,CAAC;IAClE,MAAM,CAAC,KAAK,CAAC,mCAAmC,CAAC,8BAA8B,CAAC,EAAE,gCAAgC,CAAC,CAAC;AACtH,CAAC,CAAC,CAAC;AAEH,IAAI,CAAC,2CAA2C,EAAE,GAAG,EAAE;IACrD,MAAM,CAAC,KAAK,CACV,gBAAgB,CAAC,EAAE,SAAS,EAAE,IAAI,EAAE,cAAc,EAAE,MAAM,EAAE,CAAC,EAC7D,eAAe,CAChB,CAAC;IACF,MAAM,CAAC,KAAK,CACV,gBAAgB,CAAC,EAAE,SAAS,EAAE,EAAE,EAAE,cAAc,EAAE,MAAM,EAAE,iBAAiB,EAAE,KAAK,EAAE,CAAC,EACrF,gBAAgB,CACjB,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@x12i/catalox",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.6.0",
|
|
4
4
|
"description": "Catalox: Firebase-native catalog metadata + unification package.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"private": false,
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
"mapping",
|
|
17
17
|
"mongo",
|
|
18
18
|
"adapter",
|
|
19
|
+
"gcs",
|
|
20
|
+
"google-cloud-storage",
|
|
19
21
|
"x12i"
|
|
20
22
|
],
|
|
21
23
|
"exports": {
|
|
@@ -44,11 +46,11 @@
|
|
|
44
46
|
"lint": "node -e \"console.log('no lint configured')\""
|
|
45
47
|
},
|
|
46
48
|
"dependencies": {
|
|
47
|
-
"@
|
|
49
|
+
"@google-cloud/storage": "^7.19.0",
|
|
50
|
+
"@x12i/helpers": "^1.4.0",
|
|
48
51
|
"ajv": "^8.18.0",
|
|
49
52
|
"ajv-formats": "^3.0.1",
|
|
50
53
|
"commander": "^14.0.0",
|
|
51
|
-
"dotenv": "^17.0.0",
|
|
52
54
|
"esbuild": "^0.25.0",
|
|
53
55
|
"firebase-admin": "^13.0.0",
|
|
54
56
|
"mongodb": "^6.0.0"
|