clefbase 1.3.7 → 1.3.8

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/index.js CHANGED
@@ -3,7 +3,7 @@
3
3
  * clefbase — Firebase-style SDK for Clefbase / Cleforyx
4
4
  *
5
5
  * @example
6
- * import { initClefbase, getDatabase, getAuth, getStorage, getHosting } from "clefbase";
6
+ * import { initClefbase, getDatabase, getAuth, getStorage, getHosting, FieldValue } from "clefbase";
7
7
  *
8
8
  * const app = initClefbase({
9
9
  * serverUrl: "https://api.cleforyx.com",
@@ -12,13 +12,35 @@
12
12
  * adminSecret: "...", // only needed for hosting
13
13
  * });
14
14
  *
15
- * const db = getDatabase(app);
16
- * const auth = getAuth(app);
17
- * const storage = getStorage(app);
18
- * const hosting = getHosting(app);
15
+ * const db = getDatabase(app);
16
+ *
17
+ * // FieldValue sentinels
18
+ * await db.collection("posts").doc("p1").update({
19
+ * views: FieldValue.increment(1),
20
+ * score: FieldValue.decrement(0.5),
21
+ * publishedAt: FieldValue.serverTimestamp(),
22
+ * draft: FieldValue.deleteField(),
23
+ * tags: FieldValue.arrayUnion("featured"),
24
+ * oldTags: FieldValue.arrayRemove("wip"),
25
+ * });
26
+ *
27
+ * // Batch writes
28
+ * const batch = db.batch();
29
+ * batch.update(db.collection("counters").doc("hits"), { n: FieldValue.increment(1) });
30
+ * batch.delete(db.collection("sessions").doc("expired"));
31
+ * await batch.commit();
32
+ *
33
+ * // Transactions
34
+ * await db.runTransaction(async (tx) => {
35
+ * const wallet = await tx.get(db.collection("wallets").doc(uid));
36
+ * tx.update(db.collection("wallets").doc(uid), { balance: (wallet?.balance as number ?? 0) + 10 });
37
+ * });
38
+ *
39
+ * // Collection-group queries
40
+ * const allComments = await db.collectionGroup("comments").where({ approved: true }).getDocs();
19
41
  */
20
42
  Object.defineProperty(exports, "__esModule", { value: true });
21
- exports.ClefbaseError = exports.SiteReference = exports.ClefbaseHosting = exports.BucketReference = exports.StorageReference = exports.ClefbaseStorage = exports.Auth = exports.Query = exports.DocumentReference = exports.CollectionReference = exports.Database = exports.getHosting = exports.getStorage = exports.getAuth = exports.getDatabase = exports.getApp = exports.initClefbase = exports.ClefbaseApp = void 0;
43
+ exports.ClefbaseError = exports.FieldValueSentinel = exports.FieldValue = exports.SiteReference = exports.ClefbaseHosting = exports.BucketReference = exports.StorageReference = exports.ClefbaseStorage = exports.Auth = exports.runTransaction = exports.Transaction = exports.WriteBatch = exports.Query = exports.DocumentReference = exports.CollectionGroup = exports.CollectionReference = exports.Database = exports.getHosting = exports.getStorage = exports.getAuth = exports.getDatabase = exports.getApp = exports.initClefbase = exports.ClefbaseApp = void 0;
22
44
  // ─── App ──────────────────────────────────────────────────────────────────────
23
45
  var app_1 = require("./app");
24
46
  Object.defineProperty(exports, "ClefbaseApp", { enumerable: true, get: function () { return app_1.ClefbaseApp; } });
@@ -32,8 +54,12 @@ Object.defineProperty(exports, "getHosting", { enumerable: true, get: function (
32
54
  var db_1 = require("./db");
33
55
  Object.defineProperty(exports, "Database", { enumerable: true, get: function () { return db_1.Database; } });
34
56
  Object.defineProperty(exports, "CollectionReference", { enumerable: true, get: function () { return db_1.CollectionReference; } });
57
+ Object.defineProperty(exports, "CollectionGroup", { enumerable: true, get: function () { return db_1.CollectionGroup; } });
35
58
  Object.defineProperty(exports, "DocumentReference", { enumerable: true, get: function () { return db_1.DocumentReference; } });
36
59
  Object.defineProperty(exports, "Query", { enumerable: true, get: function () { return db_1.Query; } });
60
+ Object.defineProperty(exports, "WriteBatch", { enumerable: true, get: function () { return db_1.WriteBatch; } });
61
+ Object.defineProperty(exports, "Transaction", { enumerable: true, get: function () { return db_1.Transaction; } });
62
+ Object.defineProperty(exports, "runTransaction", { enumerable: true, get: function () { return db_1.runTransaction; } });
37
63
  // ─── Auth ─────────────────────────────────────────────────────────────────────
38
64
  var auth_1 = require("./auth");
39
65
  Object.defineProperty(exports, "Auth", { enumerable: true, get: function () { return auth_1.Auth; } });
@@ -46,6 +72,10 @@ Object.defineProperty(exports, "BucketReference", { enumerable: true, get: funct
46
72
  var hosting_1 = require("./hosting");
47
73
  Object.defineProperty(exports, "ClefbaseHosting", { enumerable: true, get: function () { return hosting_1.ClefbaseHosting; } });
48
74
  Object.defineProperty(exports, "SiteReference", { enumerable: true, get: function () { return hosting_1.SiteReference; } });
75
+ // ─── FieldValue ───────────────────────────────────────────────────────────────
76
+ var field_value_1 = require("./field_value");
77
+ Object.defineProperty(exports, "FieldValue", { enumerable: true, get: function () { return field_value_1.FieldValue; } });
78
+ Object.defineProperty(exports, "FieldValueSentinel", { enumerable: true, get: function () { return field_value_1.FieldValueSentinel; } });
49
79
  var types_1 = require("./types");
50
80
  Object.defineProperty(exports, "ClefbaseError", { enumerable: true, get: function () { return types_1.ClefbaseError; } });
51
81
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAEH,iFAAiF;AACjF,6BAQe;AAPb,kGAAA,WAAW,OAAA;AACX,mGAAA,YAAY,OAAA;AACZ,6FAAA,MAAM,OAAA;AACN,kGAAA,WAAW,OAAA;AACX,8FAAA,OAAO,OAAA;AACP,iGAAA,UAAU,OAAA;AACV,iGAAA,UAAU,OAAA;AAGZ,iFAAiF;AACjF,2BAA+E;AAAtE,8FAAA,QAAQ,OAAA;AAAE,yGAAA,mBAAmB,OAAA;AAAE,uGAAA,iBAAiB,OAAA;AAAE,2FAAA,KAAK,OAAA;AAEhE,iFAAiF;AACjF,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAGb,iFAAiF;AACjF,qCAA+E;AAAtE,0GAAA,eAAe,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,0GAAA,eAAe,OAAA;AAW3D,iFAAiF;AACjF,qCAA2D;AAAlD,0GAAA,eAAe,OAAA;AAAE,wGAAA,aAAa,OAAA;AAyBvC,iCAAwC;AAA/B,sGAAA,aAAa,OAAA"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;;;AAEH,iFAAiF;AACjF,6BAQe;AAPb,kGAAA,WAAW,OAAA;AACX,mGAAA,YAAY,OAAA;AACZ,6FAAA,MAAM,OAAA;AACN,kGAAA,WAAW,OAAA;AACX,8FAAA,OAAO,OAAA;AACP,iGAAA,UAAU,OAAA;AACV,iGAAA,UAAU,OAAA;AAGZ,iFAAiF;AACjF,2BASc;AARZ,8FAAA,QAAQ,OAAA;AACR,yGAAA,mBAAmB,OAAA;AACnB,qGAAA,eAAe,OAAA;AACf,uGAAA,iBAAiB,OAAA;AACjB,2FAAA,KAAK,OAAA;AACL,gGAAA,UAAU,OAAA;AACV,iGAAA,WAAW,OAAA;AACX,oGAAA,cAAc,OAAA;AAGhB,iFAAiF;AACjF,+BAA8B;AAArB,4FAAA,IAAI,OAAA;AAGb,iFAAiF;AACjF,qCAA+E;AAAtE,0GAAA,eAAe,OAAA;AAAE,2GAAA,gBAAgB,OAAA;AAAE,0GAAA,eAAe,OAAA;AAW3D,iFAAiF;AACjF,qCAA2D;AAAlD,0GAAA,eAAe,OAAA;AAAE,wGAAA,aAAa,OAAA;AAWvC,iFAAiF;AACjF,6CAA+D;AAAtD,yGAAA,UAAU,OAAA;AAAE,iHAAA,kBAAkB,OAAA;AAiBvC,iCAAwC;AAA/B,sGAAA,aAAa,OAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "clefbase",
3
- "version": "1.3.7",
3
+ "version": "1.3.8",
4
4
  "description": "Firebase-style SDK and CLI for Clefbase — database, auth, storage, and hosting",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",