Skip to content

Commit 5833f08

Browse files
committed
fix(): Run build
1 parent d9ec3e1 commit 5833f08

File tree

8 files changed

+41
-11
lines changed

8 files changed

+41
-11
lines changed

dist/cjs/services/database.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export default class DatabaseService {
5252
key?: string;
5353
conditional?: WhereFilterOp;
5454
value?: any;
55-
}[], orderBy?: string, limit?: number): Promise<QueryDocumentSnapshot<import("@firebase/firestore").DocumentData>[]>;
55+
}[], orderBy?: string, limit?: number): Promise<{
56+
id: string;
57+
}[]>;
5658
getApp(): Promise<FirebaseApp>;
5759
getService(): Promise<Firestore>;
5860
}

dist/cjs/services/database.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,10 @@ class DatabaseService {
150150
});
151151
}
152152
list(collectionName, where, orderBy, limit) {
153+
var _a;
153154
return __awaiter(this, void 0, void 0, function* () {
154155
const query = yield this.query(collectionName, where, orderBy, limit);
155-
return (query === null || query === void 0 ? void 0 : query.docs) || null;
156+
return (((_a = query === null || query === void 0 ? void 0 : query.docs) === null || _a === void 0 ? void 0 : _a.map((queryDoc) => (Object.assign({ id: queryDoc.id }, ((queryDoc === null || queryDoc === void 0 ? void 0 : queryDoc.exists()) ? queryDoc.data() : {}))))) || null);
156157
});
157158
}
158159
getApp() {

dist/index.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -676,7 +676,10 @@ class DatabaseService {
676676
}
677677
async list(collectionName, where, orderBy, limit) {
678678
const query = await this.query(collectionName, where, orderBy, limit);
679-
return query?.docs || null;
679+
return (query?.docs?.map((queryDoc) => ({
680+
id: queryDoc.id,
681+
...(queryDoc?.exists() ? queryDoc.data() : {}),
682+
})) || null);
680683
}
681684
async getApp() {
682685
return this.app;

dist/mjs/services/database.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export default class DatabaseService {
5252
key?: string;
5353
conditional?: WhereFilterOp;
5454
value?: any;
55-
}[], orderBy?: string, limit?: number): Promise<QueryDocumentSnapshot<import("@firebase/firestore").DocumentData>[]>;
55+
}[], orderBy?: string, limit?: number): Promise<{
56+
id: string;
57+
}[]>;
5658
getApp(): Promise<FirebaseApp>;
5759
getService(): Promise<Firestore>;
5860
}

dist/mjs/services/database.js

+4-1
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,10 @@ export default class DatabaseService {
131131
}
132132
async list(collectionName, where, orderBy, limit) {
133133
const query = await this.query(collectionName, where, orderBy, limit);
134-
return query?.docs || null;
134+
return (query?.docs?.map((queryDoc) => ({
135+
id: queryDoc.id,
136+
...(queryDoc?.exists() ? queryDoc.data() : {}),
137+
})) || null);
135138
}
136139
async getApp() {
137140
return this.app;

dist/services/database.d.ts

+3-1
Original file line numberDiff line numberDiff line change
@@ -52,7 +52,9 @@ export default class DatabaseService {
5252
key?: string;
5353
conditional?: WhereFilterOp;
5454
value?: any;
55-
}[], orderBy?: string, limit?: number): Promise<QueryDocumentSnapshot<import("@firebase/firestore").DocumentData>[]>;
55+
}[], orderBy?: string, limit?: number): Promise<{
56+
id: string;
57+
}[]>;
5658
getApp(): Promise<FirebaseApp>;
5759
getService(): Promise<Firestore>;
5860
}

dist/services/database.js

+16-4
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,15 @@
11
"use strict";
2+
var __assign = (this && this.__assign) || function () {
3+
__assign = Object.assign || function(t) {
4+
for (var s, i = 1, n = arguments.length; i < n; i++) {
5+
s = arguments[i];
6+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7+
t[p] = s[p];
8+
}
9+
return t;
10+
};
11+
return __assign.apply(this, arguments);
12+
};
213
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
314
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
415
return new (P || (P = Promise))(function (resolve, reject) {
@@ -235,14 +246,15 @@ var DatabaseService = /** @class */ (function () {
235246
});
236247
};
237248
DatabaseService.prototype.list = function (collectionName, where, orderBy, limit) {
249+
var _a;
238250
return __awaiter(this, void 0, void 0, function () {
239251
var query;
240-
return __generator(this, function (_a) {
241-
switch (_a.label) {
252+
return __generator(this, function (_b) {
253+
switch (_b.label) {
242254
case 0: return [4 /*yield*/, this.query(collectionName, where, orderBy, limit)];
243255
case 1:
244-
query = _a.sent();
245-
return [2 /*return*/, (query === null || query === void 0 ? void 0 : query.docs) || null];
256+
query = _b.sent();
257+
return [2 /*return*/, (((_a = query === null || query === void 0 ? void 0 : query.docs) === null || _a === void 0 ? void 0 : _a.map(function (queryDoc) { return (__assign({ id: queryDoc.id }, ((queryDoc === null || queryDoc === void 0 ? void 0 : queryDoc.exists()) ? queryDoc.data() : {}))); })) || null)];
246258
}
247259
});
248260
});

src/services/database.ts

+6-1
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,12 @@ export default class DatabaseService {
219219
) {
220220
const query = await this.query(collectionName, where, orderBy, limit);
221221

222-
return query?.docs || null;
222+
return (
223+
query?.docs?.map((queryDoc) => ({
224+
id: queryDoc.id,
225+
...(queryDoc?.exists() ? queryDoc.data() : {}),
226+
})) || null
227+
);
223228
}
224229

225230
async getApp() {

0 commit comments

Comments
 (0)