clefbase 1.1.6 → 1.2.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 +169 -103
- package/bin/clefbase.js +15 -0
- package/dist/app.d.ts +16 -32
- package/dist/app.d.ts.map +1 -1
- package/dist/app.js +29 -44
- package/dist/app.js.map +1 -1
- package/dist/auth/index.d.ts +16 -44
- package/dist/auth/index.d.ts.map +1 -1
- package/dist/auth/index.js +40 -95
- package/dist/auth/index.js.map +1 -1
- package/dist/cli-src/cli/api.js +170 -0
- package/dist/cli-src/cli/commands/deploy.js +285 -0
- package/dist/cli-src/cli/commands/info.js +67 -0
- package/dist/cli-src/cli/commands/init.js +226 -0
- package/dist/cli-src/cli/config.js +82 -0
- package/dist/cli-src/cli/index.js +110 -0
- package/dist/cli-src/types.js +17 -0
- package/dist/cli.js +34375 -0
- package/dist/db/index.d.ts +26 -62
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +34 -70
- package/dist/db/index.js.map +1 -1
- package/dist/hosting/index.d.ts +123 -0
- package/dist/hosting/index.d.ts.map +1 -0
- package/dist/hosting/index.js +202 -0
- package/dist/hosting/index.js.map +1 -0
- package/dist/http.d.ts +2 -4
- package/dist/http.d.ts.map +1 -1
- package/dist/http.js +8 -22
- package/dist/http.js.map +1 -1
- package/dist/index.d.ts +11 -7
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +13 -6
- package/dist/index.js.map +1 -1
- package/dist/storage/index.d.ts +8 -50
- package/dist/storage/index.d.ts.map +1 -1
- package/dist/storage/index.js +9 -59
- package/dist/storage/index.js.map +1 -1
- package/dist/types.d.ts +10 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +0 -1
- package/dist/types.js.map +1 -1
- package/package.json +21 -5
package/dist/db/index.d.ts
CHANGED
|
@@ -6,51 +6,38 @@ export type { WhereClause, WhereValue } from "../types";
|
|
|
6
6
|
*
|
|
7
7
|
* @example
|
|
8
8
|
* const ref = db.collection("users").doc("abc123");
|
|
9
|
-
* const user = await ref.get();
|
|
10
|
-
* await ref.update({ name: "Alice" });
|
|
11
|
-
* await ref.set({ name: "Alice", age: 30 });
|
|
9
|
+
* const user = await ref.get(); // T | null
|
|
10
|
+
* await ref.update({ name: "Alice" }); // merge patch
|
|
11
|
+
* await ref.set({ name: "Alice", age: 30 }); // full overwrite
|
|
12
12
|
* await ref.delete();
|
|
13
|
-
*
|
|
14
|
-
* // Subcollection
|
|
15
|
-
* const comments = ref.subcollection("comments");
|
|
16
13
|
*/
|
|
17
14
|
export declare class DocumentReference<T extends ClefbaseDocument = ClefbaseDocument> {
|
|
18
15
|
private readonly http;
|
|
19
|
-
/** Full collection path, e.g. "users" or "users/uid/posts" */
|
|
20
16
|
readonly collectionPath: string;
|
|
21
17
|
readonly id: string;
|
|
22
|
-
constructor(http: HttpClient,
|
|
23
|
-
/** Full collection path, e.g. "users" or "users/uid/posts" */
|
|
24
|
-
collectionPath: string, id: string);
|
|
18
|
+
constructor(http: HttpClient, collectionPath: string, id: string);
|
|
25
19
|
/** Fetch this document. Returns null when it does not exist. */
|
|
26
20
|
get(): Promise<T | null>;
|
|
27
21
|
/**
|
|
28
|
-
* Patch this document.
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
* @example
|
|
32
|
-
* await ref.update({ score: 42 });
|
|
33
|
-
* await ref.update({ score: 42 }, { merge: false }); // replaces whole doc
|
|
22
|
+
* Patch this document (merge by default).
|
|
23
|
+
* Pass `{ merge: false }` to fully replace the document.
|
|
34
24
|
*/
|
|
35
25
|
update(data: Partial<Omit<T, "_id" | "_createdAt" | "_updatedAt">>, opts?: {
|
|
36
26
|
merge?: boolean;
|
|
37
27
|
}): Promise<T>;
|
|
38
|
-
/**
|
|
39
|
-
* Overwrite this document entirely (no merge).
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* await ref.set({ name: "Bob", age: 25 });
|
|
43
|
-
*/
|
|
28
|
+
/** Overwrite this document entirely (no merge). */
|
|
44
29
|
set(data: Omit<T, "_id" | "_createdAt" | "_updatedAt">): Promise<T>;
|
|
45
|
-
/** Delete this document
|
|
30
|
+
/** Delete this document. */
|
|
46
31
|
delete(): Promise<void>;
|
|
47
32
|
/**
|
|
48
33
|
* Access a subcollection nested under this document.
|
|
49
34
|
*
|
|
50
35
|
* @example
|
|
51
|
-
* const comments = db.collection("posts").doc("p1").
|
|
36
|
+
* const comments = db.collection("posts").doc("p1").collection("comments");
|
|
52
37
|
* await comments.add({ text: "Great!" });
|
|
53
38
|
*/
|
|
39
|
+
collection<S extends ClefbaseDocument = ClefbaseDocument>(name: string): CollectionReference<S>;
|
|
40
|
+
/** @deprecated Use .collection() — kept for backwards compat */
|
|
54
41
|
subcollection<S extends ClefbaseDocument = ClefbaseDocument>(name: string): CollectionReference<S>;
|
|
55
42
|
}
|
|
56
43
|
/**
|
|
@@ -76,23 +63,24 @@ export declare class Query<T extends ClefbaseDocument = ClefbaseDocument> {
|
|
|
76
63
|
protected _offset: number;
|
|
77
64
|
constructor(http: HttpClient, path: string);
|
|
78
65
|
/**
|
|
79
|
-
* Filter
|
|
80
|
-
* Multiple calls are merged
|
|
81
|
-
*
|
|
82
|
-
* @example
|
|
83
|
-
* .where({ published: true })
|
|
84
|
-
* .where({ views: { $gte: 100 } })
|
|
66
|
+
* Filter by field values or operators.
|
|
67
|
+
* Multiple calls are AND-merged.
|
|
85
68
|
*/
|
|
86
69
|
where(clauses: WhereClause): this;
|
|
87
|
-
/** Sort by a field.
|
|
70
|
+
/** Sort by a field. */
|
|
88
71
|
orderBy(field: string, dir?: "asc" | "desc"): this;
|
|
89
|
-
/** Cap results
|
|
72
|
+
/** Cap results (server max: 500). */
|
|
90
73
|
limit(n: number): this;
|
|
91
|
-
/** Skip the first n results (
|
|
74
|
+
/** Skip the first n results (pagination). */
|
|
92
75
|
offset(n: number): this;
|
|
93
|
-
/** Execute
|
|
76
|
+
/** Execute — returns full paginated result object. */
|
|
94
77
|
query(): Promise<QueryResult<T>>;
|
|
95
|
-
/**
|
|
78
|
+
/**
|
|
79
|
+
* Execute — returns just the document array.
|
|
80
|
+
* @alias getDocs
|
|
81
|
+
*/
|
|
82
|
+
get(): Promise<T[]>;
|
|
83
|
+
/** @alias get() */
|
|
96
84
|
getDocs(): Promise<T[]>;
|
|
97
85
|
}
|
|
98
86
|
/**
|
|
@@ -100,14 +88,8 @@ export declare class Query<T extends ClefbaseDocument = ClefbaseDocument> {
|
|
|
100
88
|
*
|
|
101
89
|
* @example
|
|
102
90
|
* const col = db.collection("users");
|
|
103
|
-
*
|
|
104
|
-
* // Add
|
|
105
91
|
* const user = await col.add({ name: "Alice", age: 30 });
|
|
106
|
-
*
|
|
107
|
-
* // List (no filter)
|
|
108
92
|
* const { data, total } = await col.list({ limit: 20 });
|
|
109
|
-
*
|
|
110
|
-
* // Query (with filter / sort)
|
|
111
93
|
* const adults = await col.where({ age: { $gte: 18 } }).orderBy("name").getDocs();
|
|
112
94
|
*/
|
|
113
95
|
export declare class CollectionReference<T extends ClefbaseDocument = ClefbaseDocument> extends Query<T> {
|
|
@@ -117,11 +99,8 @@ export declare class CollectionReference<T extends ClefbaseDocument = ClefbaseDo
|
|
|
117
99
|
/** Add a new document with a server-generated ID. */
|
|
118
100
|
add(data: Omit<T, "_id" | "_createdAt" | "_updatedAt">): Promise<T>;
|
|
119
101
|
/**
|
|
120
|
-
*
|
|
121
|
-
* For filtering/sorting use the inherited `.where()` / `.orderBy()` chain.
|
|
122
|
-
*
|
|
123
|
-
* @example
|
|
124
|
-
* const { data, total } = await col.list({ limit: 10, offset: 20 });
|
|
102
|
+
* List documents without a filter — useful for simple pagination.
|
|
103
|
+
* For filtering/sorting, use the inherited `.where()` / `.orderBy()` chain.
|
|
125
104
|
*/
|
|
126
105
|
list(opts?: {
|
|
127
106
|
limit?: number;
|
|
@@ -129,37 +108,22 @@ export declare class CollectionReference<T extends ClefbaseDocument = ClefbaseDo
|
|
|
129
108
|
}): Promise<QueryResult<T>>;
|
|
130
109
|
}
|
|
131
110
|
/**
|
|
132
|
-
* Top-level database service.
|
|
133
|
-
* Obtain via `getDatabase(app)`.
|
|
111
|
+
* Top-level database service. Obtain via `getDatabase(app)`.
|
|
134
112
|
*
|
|
135
113
|
* @example
|
|
136
|
-
* import { initClefbase, getDatabase } from "clefbase";
|
|
137
|
-
* const app = initClefbase({ serverUrl, projectId, apiKey });
|
|
138
114
|
* const db = getDatabase(app);
|
|
139
|
-
*
|
|
140
|
-
* // Reference-based API
|
|
141
115
|
* const post = await db.collection("posts").doc("p1").get();
|
|
142
|
-
*
|
|
143
|
-
* // Convenience helpers
|
|
144
116
|
* const user = await db.getDoc("users", "uid-123");
|
|
145
|
-
* const newDoc = await db.addDoc("logs", { action: "login" });
|
|
146
|
-
* await db.updateDoc("users", "uid-123", { lastSeen: new Date().toISOString() });
|
|
147
|
-
* await db.deleteDoc("users", "uid-123");
|
|
148
117
|
*/
|
|
149
118
|
export declare class Database {
|
|
150
119
|
private readonly http;
|
|
151
120
|
constructor(http: HttpClient);
|
|
152
|
-
/** Return a CollectionReference for a top-level collection. */
|
|
153
121
|
collection<T extends ClefbaseDocument = ClefbaseDocument>(name: string): CollectionReference<T>;
|
|
154
|
-
/** Fetch a single document by collection name and ID. Returns null if not found. */
|
|
155
122
|
getDoc<T extends ClefbaseDocument = ClefbaseDocument>(collectionName: string, id: string): Promise<T | null>;
|
|
156
|
-
/** Add a document to a collection and return it with server-set fields. */
|
|
157
123
|
addDoc<T extends ClefbaseDocument = ClefbaseDocument>(collectionName: string, data: Omit<T, "_id" | "_createdAt" | "_updatedAt">): Promise<T>;
|
|
158
|
-
/** Patch a document. Merges by default; pass `{ merge: false }` to overwrite. */
|
|
159
124
|
updateDoc<T extends ClefbaseDocument = ClefbaseDocument>(collectionName: string, id: string, data: Partial<Omit<T, "_id" | "_createdAt" | "_updatedAt">>, opts?: {
|
|
160
125
|
merge?: boolean;
|
|
161
126
|
}): Promise<T>;
|
|
162
|
-
/** Delete a document. */
|
|
163
127
|
deleteDoc(collectionName: string, id: string): Promise<void>;
|
|
164
128
|
}
|
|
165
129
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/db/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,WAAW,EACZ,MAAM,UAAU,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,KAAK,EACV,gBAAgB,EAEhB,WAAW,EACX,WAAW,EACZ,MAAM,UAAU,CAAC;AAElB,YAAY,EAAE,WAAW,EAAE,UAAU,EAAE,MAAM,UAAU,CAAC;AAIxD;;;;;;;;;GASG;AACH,qBAAa,iBAAiB,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB;IAExE,OAAO,CAAC,QAAQ,CAAC,IAAI;aACL,cAAc,EAAE,MAAM;aACtB,EAAE,EAAE,MAAM;gBAFT,IAAI,EAAE,UAAU,EACjB,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM;IAG5B,gEAAgE;IAC1D,GAAG,IAAI,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;IAS9B;;;OAGG;IACG,MAAM,CACV,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,YAAY,CAAC,CAAC,EAC3D,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACzB,OAAO,CAAC,CAAC,CAAC;IAQb,mDAAmD;IAC7C,GAAG,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,YAA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,SAAS,CAAC,CAAC,SAAS,gBAAgB,GAAG,gBAAgB,EAC3D,cAAc,EAAE,MAAM,EACtB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,OAAO,CAAC,IAAI,CAAC,CAAC,EAAE,KAAK,GAAG,YAAY,GAAG,YAAY,CAAC,CAAC,EAC3D,IAAI,CAAC,EAAE;QAAE,KAAK,CAAC,EAAE,OAAO,CAAA;KAAE,GACzB,OAAO,CAAC,CAAC,CAAC;IAIP,SAAS,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC;CAGnE"}
|
package/dist/db/index.js
CHANGED
|
@@ -7,18 +7,13 @@ exports.Database = exports.CollectionReference = exports.Query = exports.Documen
|
|
|
7
7
|
*
|
|
8
8
|
* @example
|
|
9
9
|
* const ref = db.collection("users").doc("abc123");
|
|
10
|
-
* const user = await ref.get();
|
|
11
|
-
* await ref.update({ name: "Alice" });
|
|
12
|
-
* await ref.set({ name: "Alice", age: 30 });
|
|
10
|
+
* const user = await ref.get(); // T | null
|
|
11
|
+
* await ref.update({ name: "Alice" }); // merge patch
|
|
12
|
+
* await ref.set({ name: "Alice", age: 30 }); // full overwrite
|
|
13
13
|
* await ref.delete();
|
|
14
|
-
*
|
|
15
|
-
* // Subcollection
|
|
16
|
-
* const comments = ref.subcollection("comments");
|
|
17
14
|
*/
|
|
18
15
|
class DocumentReference {
|
|
19
|
-
constructor(http,
|
|
20
|
-
/** Full collection path, e.g. "users" or "users/uid/posts" */
|
|
21
|
-
collectionPath, id) {
|
|
16
|
+
constructor(http, collectionPath, id) {
|
|
22
17
|
this.http = http;
|
|
23
18
|
this.collectionPath = collectionPath;
|
|
24
19
|
this.id = id;
|
|
@@ -29,34 +24,24 @@ class DocumentReference {
|
|
|
29
24
|
return await this.http.get(`/${this.collectionPath}/${this.id}`);
|
|
30
25
|
}
|
|
31
26
|
catch (err) {
|
|
32
|
-
|
|
33
|
-
if (status === 404)
|
|
27
|
+
if (err.status === 404)
|
|
34
28
|
return null;
|
|
35
29
|
throw err;
|
|
36
30
|
}
|
|
37
31
|
}
|
|
38
32
|
/**
|
|
39
|
-
* Patch this document.
|
|
40
|
-
*
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* await ref.update({ score: 42 });
|
|
44
|
-
* await ref.update({ score: 42 }, { merge: false }); // replaces whole doc
|
|
33
|
+
* Patch this document (merge by default).
|
|
34
|
+
* Pass `{ merge: false }` to fully replace the document.
|
|
45
35
|
*/
|
|
46
36
|
async update(data, opts) {
|
|
47
37
|
const merge = opts?.merge ?? true;
|
|
48
38
|
return this.http.put(`/${this.collectionPath}/${this.id}?merge=${String(merge)}`, data);
|
|
49
39
|
}
|
|
50
|
-
/**
|
|
51
|
-
* Overwrite this document entirely (no merge).
|
|
52
|
-
*
|
|
53
|
-
* @example
|
|
54
|
-
* await ref.set({ name: "Bob", age: 25 });
|
|
55
|
-
*/
|
|
40
|
+
/** Overwrite this document entirely (no merge). */
|
|
56
41
|
async set(data) {
|
|
57
42
|
return this.http.put(`/${this.collectionPath}/${this.id}?merge=false`, data);
|
|
58
43
|
}
|
|
59
|
-
/** Delete this document
|
|
44
|
+
/** Delete this document. */
|
|
60
45
|
async delete() {
|
|
61
46
|
await this.http.delete(`/${this.collectionPath}/${this.id}`);
|
|
62
47
|
}
|
|
@@ -64,12 +49,16 @@ class DocumentReference {
|
|
|
64
49
|
* Access a subcollection nested under this document.
|
|
65
50
|
*
|
|
66
51
|
* @example
|
|
67
|
-
* const comments = db.collection("posts").doc("p1").
|
|
52
|
+
* const comments = db.collection("posts").doc("p1").collection("comments");
|
|
68
53
|
* await comments.add({ text: "Great!" });
|
|
69
54
|
*/
|
|
70
|
-
|
|
55
|
+
collection(name) {
|
|
71
56
|
return new CollectionReference(this.http, `${this.collectionPath}/${this.id}/${name}`);
|
|
72
57
|
}
|
|
58
|
+
/** @deprecated Use .collection() — kept for backwards compat */
|
|
59
|
+
subcollection(name) {
|
|
60
|
+
return this.collection(name);
|
|
61
|
+
}
|
|
73
62
|
}
|
|
74
63
|
exports.DocumentReference = DocumentReference;
|
|
75
64
|
// ─── Query ────────────────────────────────────────────────────────────────────
|
|
@@ -93,33 +82,29 @@ class Query {
|
|
|
93
82
|
this._offset = 0;
|
|
94
83
|
}
|
|
95
84
|
/**
|
|
96
|
-
* Filter
|
|
97
|
-
* Multiple calls are merged
|
|
98
|
-
*
|
|
99
|
-
* @example
|
|
100
|
-
* .where({ published: true })
|
|
101
|
-
* .where({ views: { $gte: 100 } })
|
|
85
|
+
* Filter by field values or operators.
|
|
86
|
+
* Multiple calls are AND-merged.
|
|
102
87
|
*/
|
|
103
88
|
where(clauses) {
|
|
104
89
|
this._filter = { ...this._filter, ...clauses };
|
|
105
90
|
return this;
|
|
106
91
|
}
|
|
107
|
-
/** Sort by a field.
|
|
92
|
+
/** Sort by a field. */
|
|
108
93
|
orderBy(field, dir = "asc") {
|
|
109
94
|
this._sort = { field, dir };
|
|
110
95
|
return this;
|
|
111
96
|
}
|
|
112
|
-
/** Cap results
|
|
97
|
+
/** Cap results (server max: 500). */
|
|
113
98
|
limit(n) {
|
|
114
99
|
this._limit = Math.min(n, 500);
|
|
115
100
|
return this;
|
|
116
101
|
}
|
|
117
|
-
/** Skip the first n results (
|
|
102
|
+
/** Skip the first n results (pagination). */
|
|
118
103
|
offset(n) {
|
|
119
104
|
this._offset = n;
|
|
120
105
|
return this;
|
|
121
106
|
}
|
|
122
|
-
/** Execute
|
|
107
|
+
/** Execute — returns full paginated result object. */
|
|
123
108
|
async query() {
|
|
124
109
|
const body = {
|
|
125
110
|
filter: Object.keys(this._filter).length > 0 ? this._filter : undefined,
|
|
@@ -129,10 +114,16 @@ class Query {
|
|
|
129
114
|
};
|
|
130
115
|
return this.http.post(`/${this.path}/query`, body);
|
|
131
116
|
}
|
|
132
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Execute — returns just the document array.
|
|
119
|
+
* @alias getDocs
|
|
120
|
+
*/
|
|
121
|
+
async get() {
|
|
122
|
+
return (await this.query()).data;
|
|
123
|
+
}
|
|
124
|
+
/** @alias get() */
|
|
133
125
|
async getDocs() {
|
|
134
|
-
|
|
135
|
-
return result.data;
|
|
126
|
+
return this.get();
|
|
136
127
|
}
|
|
137
128
|
}
|
|
138
129
|
exports.Query = Query;
|
|
@@ -142,14 +133,8 @@ exports.Query = Query;
|
|
|
142
133
|
*
|
|
143
134
|
* @example
|
|
144
135
|
* const col = db.collection("users");
|
|
145
|
-
*
|
|
146
|
-
* // Add
|
|
147
136
|
* const user = await col.add({ name: "Alice", age: 30 });
|
|
148
|
-
*
|
|
149
|
-
* // List (no filter)
|
|
150
137
|
* const { data, total } = await col.list({ limit: 20 });
|
|
151
|
-
*
|
|
152
|
-
* // Query (with filter / sort)
|
|
153
138
|
* const adults = await col.where({ age: { $gte: 18 } }).orderBy("name").getDocs();
|
|
154
139
|
*/
|
|
155
140
|
class CollectionReference extends Query {
|
|
@@ -165,63 +150,42 @@ class CollectionReference extends Query {
|
|
|
165
150
|
return this.http.post(`/${this.path}`, data);
|
|
166
151
|
}
|
|
167
152
|
/**
|
|
168
|
-
*
|
|
169
|
-
* For filtering/sorting use the inherited `.where()` / `.orderBy()` chain.
|
|
170
|
-
*
|
|
171
|
-
* @example
|
|
172
|
-
* const { data, total } = await col.list({ limit: 10, offset: 20 });
|
|
153
|
+
* List documents without a filter — useful for simple pagination.
|
|
154
|
+
* For filtering/sorting, use the inherited `.where()` / `.orderBy()` chain.
|
|
173
155
|
*/
|
|
174
156
|
async list(opts) {
|
|
175
157
|
const limit = Math.min(opts?.limit ?? 50, 500);
|
|
176
158
|
const offset = opts?.offset ?? 0;
|
|
177
|
-
const qs = new URLSearchParams({
|
|
178
|
-
limit: String(limit),
|
|
179
|
-
offset: String(offset),
|
|
180
|
-
});
|
|
159
|
+
const qs = new URLSearchParams({ limit: String(limit), offset: String(offset) });
|
|
181
160
|
return this.http.get(`/${this.path}?${qs}`);
|
|
182
161
|
}
|
|
183
162
|
}
|
|
184
163
|
exports.CollectionReference = CollectionReference;
|
|
185
164
|
// ─── Database ─────────────────────────────────────────────────────────────────
|
|
186
165
|
/**
|
|
187
|
-
* Top-level database service.
|
|
188
|
-
* Obtain via `getDatabase(app)`.
|
|
166
|
+
* Top-level database service. Obtain via `getDatabase(app)`.
|
|
189
167
|
*
|
|
190
168
|
* @example
|
|
191
|
-
* import { initClefbase, getDatabase } from "clefbase";
|
|
192
|
-
* const app = initClefbase({ serverUrl, projectId, apiKey });
|
|
193
169
|
* const db = getDatabase(app);
|
|
194
|
-
*
|
|
195
|
-
* // Reference-based API
|
|
196
170
|
* const post = await db.collection("posts").doc("p1").get();
|
|
197
|
-
*
|
|
198
|
-
* // Convenience helpers
|
|
199
171
|
* const user = await db.getDoc("users", "uid-123");
|
|
200
|
-
* const newDoc = await db.addDoc("logs", { action: "login" });
|
|
201
|
-
* await db.updateDoc("users", "uid-123", { lastSeen: new Date().toISOString() });
|
|
202
|
-
* await db.deleteDoc("users", "uid-123");
|
|
203
172
|
*/
|
|
204
173
|
class Database {
|
|
205
174
|
constructor(http) {
|
|
206
175
|
this.http = http;
|
|
207
176
|
}
|
|
208
|
-
/** Return a CollectionReference for a top-level collection. */
|
|
209
177
|
collection(name) {
|
|
210
178
|
return new CollectionReference(this.http, name);
|
|
211
179
|
}
|
|
212
|
-
/** Fetch a single document by collection name and ID. Returns null if not found. */
|
|
213
180
|
async getDoc(collectionName, id) {
|
|
214
181
|
return this.collection(collectionName).doc(id).get();
|
|
215
182
|
}
|
|
216
|
-
/** Add a document to a collection and return it with server-set fields. */
|
|
217
183
|
async addDoc(collectionName, data) {
|
|
218
184
|
return this.collection(collectionName).add(data);
|
|
219
185
|
}
|
|
220
|
-
/** Patch a document. Merges by default; pass `{ merge: false }` to overwrite. */
|
|
221
186
|
async updateDoc(collectionName, id, data, opts) {
|
|
222
187
|
return this.collection(collectionName).doc(id).update(data, opts);
|
|
223
188
|
}
|
|
224
|
-
/** Delete a document. */
|
|
225
189
|
async deleteDoc(collectionName, id) {
|
|
226
190
|
return this.collection(collectionName).doc(id).delete();
|
|
227
191
|
}
|
package/dist/db/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/db/index.ts"],"names":[],"mappings":";;;AAUA,iFAAiF;AAEjF;;;;;;;;;GASG;AACH,MAAa,iBAAiB;IAC5B,YACmB,IAAgB,EACjB,cAAsB,EACtB,EAAU;QAFT,SAAI,GAAJ,IAAI,CAAY;QACjB,mBAAc,GAAd,cAAc,CAAQ;QACtB,OAAE,GAAF,EAAE,CAAQ;IACzB,CAAC;IAEJ,gEAAgE;IAChE,KAAK,CAAC,GAAG;QACP,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,IAAI,CAAC,GAAG,CAAI,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE,EAAE,CAAC,CAAC;QACtE,CAAC;QAAC,OAAO,GAAY,EAAE,CAAC;YACtB,IAAK,GAA2B,CAAC,MAAM,KAAK,GAAG;gBAAE,OAAO,IAAI,CAAC;YAC7D,MAAM,GAAG,CAAC;QACZ,CAAC;IACH,CAAC;IAED;;;OAGG;IACH,KAAK,CAAC,MAAM,CACV,IAA2D,EAC3D,IAA0B;QAE1B,MAAM,KAAK,GAAG,IAAI,EAAE,KAAK,IAAI,IAAI,CAAC;QAClC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,IAAI,IAAI,CAAC,cAAc,IAAI,IAAI,CAAC,EAAE,UAAU,MAAM,CAAC,KAAK,CAAC,EAAE,EAC3D,IAAI,CACL,CAAC;IACJ,CAAC;IAED,mDAAmD;IACnD,KAAK,CAAC,GAAG,CAAC,IAAkD;QAC1D,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,CAClB,IAAI,IA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CAAI,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IACvE,CAAC;IAED,KAAK,CAAC,SAAS,CAAC,cAAsB,EAAE,EAAU;QAChD,OAAO,IAAI,CAAC,UAAU,CAAC,cAAc,CAAC,CAAC,GAAG,CAAC,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC;IAC1D,CAAC;CACF;AAnCD,4BAmCC"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { HttpClient } from "../http";
|
|
2
|
+
export type HostingStatus = "enabled" | "disabled";
|
|
3
|
+
export type DeployStatus = "pending" | "building" | "live" | "failed";
|
|
4
|
+
export interface HostingSite {
|
|
5
|
+
id: string;
|
|
6
|
+
dbId: string;
|
|
7
|
+
name: string;
|
|
8
|
+
description?: string;
|
|
9
|
+
status: HostingStatus;
|
|
10
|
+
customDomain?: string;
|
|
11
|
+
createdAt: string;
|
|
12
|
+
updatedAt: string;
|
|
13
|
+
}
|
|
14
|
+
export interface HostingDeploy {
|
|
15
|
+
id: string;
|
|
16
|
+
siteId: string;
|
|
17
|
+
dbId: string;
|
|
18
|
+
status: DeployStatus;
|
|
19
|
+
message?: string;
|
|
20
|
+
deployedBy?: string;
|
|
21
|
+
fileCount: number;
|
|
22
|
+
totalBytes: number;
|
|
23
|
+
entrypoint: string;
|
|
24
|
+
createdAt: string;
|
|
25
|
+
finishedAt?: string;
|
|
26
|
+
}
|
|
27
|
+
export interface HostingFile {
|
|
28
|
+
id: string;
|
|
29
|
+
deployId: string;
|
|
30
|
+
siteId: string;
|
|
31
|
+
dbId: string;
|
|
32
|
+
filePath: string;
|
|
33
|
+
mimeType: string;
|
|
34
|
+
sizeBytes: number;
|
|
35
|
+
md5: string;
|
|
36
|
+
uploadedAt: string;
|
|
37
|
+
}
|
|
38
|
+
export interface DeployResult {
|
|
39
|
+
deploy: HostingDeploy;
|
|
40
|
+
filesUploaded: number;
|
|
41
|
+
errors: string[];
|
|
42
|
+
url: string;
|
|
43
|
+
}
|
|
44
|
+
export interface DeployOptions {
|
|
45
|
+
entrypoint?: string;
|
|
46
|
+
deployedBy?: string;
|
|
47
|
+
message?: string;
|
|
48
|
+
/** Batch size for parallel uploads. Default: 20. */
|
|
49
|
+
batchSize?: number;
|
|
50
|
+
/** Called after each batch with progress info. */
|
|
51
|
+
onProgress?: (uploaded: number, total: number) => void;
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* A reference to a hosted site.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* const site = hosting.site("my-site-id");
|
|
58
|
+
* const result = await site.deployFiles({ "index.html": htmlBuffer, "app.js": jsBuffer });
|
|
59
|
+
* console.log(`Live at ${result.url}`);
|
|
60
|
+
*/
|
|
61
|
+
export declare class SiteReference {
|
|
62
|
+
private readonly hosting;
|
|
63
|
+
readonly siteId: string;
|
|
64
|
+
constructor(hosting: ClefbaseHosting, siteId: string);
|
|
65
|
+
/** Get site metadata. */
|
|
66
|
+
get(): Promise<HostingSite | null>;
|
|
67
|
+
/** Get the currently live deploy, or null if none. */
|
|
68
|
+
getActiveDeploy(): Promise<HostingDeploy | null>;
|
|
69
|
+
/** List all deploys for this site (newest first). */
|
|
70
|
+
listDeploys(): Promise<HostingDeploy[]>;
|
|
71
|
+
/**
|
|
72
|
+
* Deploy a map of { "filePath": Buffer } to this site.
|
|
73
|
+
* Creates a deploy, uploads all files in batches, then goes live.
|
|
74
|
+
*
|
|
75
|
+
* @example
|
|
76
|
+
* import fs from "fs";
|
|
77
|
+
* import path from "path";
|
|
78
|
+
*
|
|
79
|
+
* const files = {};
|
|
80
|
+
* // Build your file map however you like, e.g.:
|
|
81
|
+
* files["index.html"] = fs.readFileSync("dist/index.html");
|
|
82
|
+
* files["app.js"] = fs.readFileSync("dist/app.js");
|
|
83
|
+
*
|
|
84
|
+
* const result = await site.deployFiles(files, {
|
|
85
|
+
* message: "v1.2.0",
|
|
86
|
+
* onProgress: (done, total) => console.log(`${done}/${total}`),
|
|
87
|
+
* });
|
|
88
|
+
*/
|
|
89
|
+
deployFiles(files: Record<string, Buffer>, opts?: DeployOptions): Promise<DeployResult>;
|
|
90
|
+
/** The public URL for this site. */
|
|
91
|
+
get url(): string;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Hosting service. Obtain via `getHosting(app)`.
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* const hosting = getHosting(app);
|
|
98
|
+
* const site = await hosting.createSite("my-app");
|
|
99
|
+
* const result = await hosting.site(site.id).deployFiles(files);
|
|
100
|
+
* console.log(result.url);
|
|
101
|
+
*/
|
|
102
|
+
export declare class ClefbaseHosting {
|
|
103
|
+
private readonly http;
|
|
104
|
+
private readonly dbId;
|
|
105
|
+
private readonly serverUrl;
|
|
106
|
+
constructor(http: HttpClient, dbId: string, serverUrl: string);
|
|
107
|
+
/** List all sites for this project. */
|
|
108
|
+
listSites(): Promise<HostingSite[]>;
|
|
109
|
+
/** Create a new hosted site. */
|
|
110
|
+
createSite(name: string, description?: string): Promise<HostingSite>;
|
|
111
|
+
/** Update site metadata. */
|
|
112
|
+
updateSite(siteId: string, patch: Partial<Pick<HostingSite, "name" | "description" | "status" | "customDomain">>): Promise<HostingSite>;
|
|
113
|
+
/** Delete a site and all its deploys permanently. */
|
|
114
|
+
deleteSite(siteId: string): Promise<void>;
|
|
115
|
+
/** Return a SiteReference for a specific site ID. */
|
|
116
|
+
site(siteId: string): SiteReference;
|
|
117
|
+
_siteUrl(siteId: string): string;
|
|
118
|
+
_getSite(siteId: string): Promise<HostingSite | null>;
|
|
119
|
+
_getActiveDeploy(siteId: string): Promise<HostingDeploy | null>;
|
|
120
|
+
_listDeploys(siteId: string): Promise<HostingDeploy[]>;
|
|
121
|
+
_deployFiles(siteId: string, files: Record<string, Buffer>, opts?: DeployOptions): Promise<DeployResult>;
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=index.d.ts.map
|
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