@digitalaidseattle/firebase 1.0.4 → 1.0.6

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.
@@ -3,11 +3,11 @@ declare class FirestoreService<T extends Entity> implements EntityService<T> {
3
3
  collectionName: string;
4
4
  db: import("@firebase/firestore").Firestore;
5
5
  constructor(collectionName: string);
6
- getAll(count?: number, select?: string): Promise<T[]>;
7
- getById(id: string, select?: string): Promise<T>;
8
- batchInsert(entities: T[], select?: string, user?: User): Promise<T[]>;
9
- insert(entity: T, select?: string, user?: User): Promise<T>;
10
- update(entityId: Identifier, updatedFields: T, select?: string, user?: User): Promise<T>;
6
+ getAll(count?: number, select?: string, mapper?: (json: any) => T): Promise<T[]>;
7
+ getById(id: string, select?: string, mapper?: (json: any) => T): Promise<T>;
8
+ batchInsert(entities: T[], select?: string, mapper?: (json: any) => T, user?: User): Promise<T[]>;
9
+ insert(entity: T, select?: string, mapper?: (json: any) => T, user?: User): Promise<T>;
10
+ update(entityId: Identifier, updatedFields: T, select?: string, mapper?: (json: any) => T, user?: User): Promise<T>;
11
11
  delete(entityId: Identifier): Promise<void>;
12
12
  }
13
13
  export { FirestoreService };
@@ -171,7 +171,7 @@ var FirestoreService = /*#__PURE__*/function () {
171
171
  return _createClass(FirestoreService, [{
172
172
  key: "getAll",
173
173
  value: function () {
174
- var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(count, select) {
174
+ var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(count, select, mapper) {
175
175
  var querySnapshot;
176
176
  return _regeneratorRuntime__default["default"].wrap(function (_context) {
177
177
  while (1) switch (_context.prev = _context.next) {
@@ -191,7 +191,7 @@ var FirestoreService = /*#__PURE__*/function () {
191
191
  }
192
192
  }, _callee, this);
193
193
  }));
194
- function getAll(_x, _x2) {
194
+ function getAll(_x, _x2, _x3) {
195
195
  return _getAll.apply(this, arguments);
196
196
  }
197
197
  return getAll;
@@ -199,7 +199,7 @@ var FirestoreService = /*#__PURE__*/function () {
199
199
  }, {
200
200
  key: "getById",
201
201
  value: function () {
202
- var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(id, select) {
202
+ var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(id, select, mapper) {
203
203
  var docRef, _t;
204
204
  return _regeneratorRuntime__default["default"].wrap(function (_context2) {
205
205
  while (1) switch (_context2.prev = _context2.next) {
@@ -232,7 +232,7 @@ var FirestoreService = /*#__PURE__*/function () {
232
232
  }
233
233
  }, _callee2, this, [[0, 4]]);
234
234
  }));
235
- function getById(_x3, _x4) {
235
+ function getById(_x4, _x5, _x6) {
236
236
  return _getById.apply(this, arguments);
237
237
  }
238
238
  return getById;
@@ -240,7 +240,7 @@ var FirestoreService = /*#__PURE__*/function () {
240
240
  }, {
241
241
  key: "batchInsert",
242
242
  value: function () {
243
- var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(entities, select, user) {
243
+ var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(entities, select, mapper, user) {
244
244
  var _t2;
245
245
  return _regeneratorRuntime__default["default"].wrap(function (_context3) {
246
246
  while (1) switch (_context3.prev = _context3.next) {
@@ -262,7 +262,7 @@ var FirestoreService = /*#__PURE__*/function () {
262
262
  }
263
263
  }, _callee3, this, [[0, 2]]);
264
264
  }));
265
- function batchInsert(_x5, _x6, _x7) {
265
+ function batchInsert(_x7, _x8, _x9, _x0) {
266
266
  return _batchInsert.apply(this, arguments);
267
267
  }
268
268
  return batchInsert;
@@ -270,7 +270,7 @@ var FirestoreService = /*#__PURE__*/function () {
270
270
  }, {
271
271
  key: "insert",
272
272
  value: function () {
273
- var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(entity, select, user) {
273
+ var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(entity, select, mapper, user) {
274
274
  var docRef, _t3;
275
275
  return _regeneratorRuntime__default["default"].wrap(function (_context4) {
276
276
  while (1) switch (_context4.prev = _context4.next) {
@@ -294,7 +294,7 @@ var FirestoreService = /*#__PURE__*/function () {
294
294
  }
295
295
  }, _callee4, this, [[0, 2]]);
296
296
  }));
297
- function insert(_x8, _x9, _x0) {
297
+ function insert(_x1, _x10, _x11, _x12) {
298
298
  return _insert.apply(this, arguments);
299
299
  }
300
300
  return insert;
@@ -302,7 +302,7 @@ var FirestoreService = /*#__PURE__*/function () {
302
302
  }, {
303
303
  key: "update",
304
304
  value: function () {
305
- var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(entityId, updatedFields, select, user) {
305
+ var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(entityId, updatedFields, select, mapper, user) {
306
306
  var docRef, _t4;
307
307
  return _regeneratorRuntime__default["default"].wrap(function (_context5) {
308
308
  while (1) switch (_context5.prev = _context5.next) {
@@ -322,7 +322,7 @@ var FirestoreService = /*#__PURE__*/function () {
322
322
  }
323
323
  }, _callee5, this, [[0, 1]]);
324
324
  }));
325
- function update(_x1, _x10, _x11, _x12) {
325
+ function update(_x13, _x14, _x15, _x16, _x17) {
326
326
  return _update.apply(this, arguments);
327
327
  }
328
328
  return update;
@@ -342,7 +342,7 @@ var FirestoreService = /*#__PURE__*/function () {
342
342
  }
343
343
  }, _callee6, this);
344
344
  }));
345
- function _delete(_x13) {
345
+ function _delete(_x18) {
346
346
  return _delete2.apply(this, arguments);
347
347
  }
348
348
  return _delete;
@@ -171,7 +171,7 @@ var FirestoreService = /*#__PURE__*/function () {
171
171
  return _createClass(FirestoreService, [{
172
172
  key: "getAll",
173
173
  value: function () {
174
- var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(count, select) {
174
+ var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee(count, select, mapper) {
175
175
  var querySnapshot;
176
176
  return _regeneratorRuntime__default["default"].wrap(function (_context) {
177
177
  while (1) switch (_context.prev = _context.next) {
@@ -191,7 +191,7 @@ var FirestoreService = /*#__PURE__*/function () {
191
191
  }
192
192
  }, _callee, this);
193
193
  }));
194
- function getAll(_x, _x2) {
194
+ function getAll(_x, _x2, _x3) {
195
195
  return _getAll.apply(this, arguments);
196
196
  }
197
197
  return getAll;
@@ -199,7 +199,7 @@ var FirestoreService = /*#__PURE__*/function () {
199
199
  }, {
200
200
  key: "getById",
201
201
  value: function () {
202
- var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(id, select) {
202
+ var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee2(id, select, mapper) {
203
203
  var docRef, _t;
204
204
  return _regeneratorRuntime__default["default"].wrap(function (_context2) {
205
205
  while (1) switch (_context2.prev = _context2.next) {
@@ -232,7 +232,7 @@ var FirestoreService = /*#__PURE__*/function () {
232
232
  }
233
233
  }, _callee2, this, [[0, 4]]);
234
234
  }));
235
- function getById(_x3, _x4) {
235
+ function getById(_x4, _x5, _x6) {
236
236
  return _getById.apply(this, arguments);
237
237
  }
238
238
  return getById;
@@ -240,7 +240,7 @@ var FirestoreService = /*#__PURE__*/function () {
240
240
  }, {
241
241
  key: "batchInsert",
242
242
  value: function () {
243
- var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(entities, select, user) {
243
+ var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee3(entities, select, mapper, user) {
244
244
  var _t2;
245
245
  return _regeneratorRuntime__default["default"].wrap(function (_context3) {
246
246
  while (1) switch (_context3.prev = _context3.next) {
@@ -262,7 +262,7 @@ var FirestoreService = /*#__PURE__*/function () {
262
262
  }
263
263
  }, _callee3, this, [[0, 2]]);
264
264
  }));
265
- function batchInsert(_x5, _x6, _x7) {
265
+ function batchInsert(_x7, _x8, _x9, _x0) {
266
266
  return _batchInsert.apply(this, arguments);
267
267
  }
268
268
  return batchInsert;
@@ -270,7 +270,7 @@ var FirestoreService = /*#__PURE__*/function () {
270
270
  }, {
271
271
  key: "insert",
272
272
  value: function () {
273
- var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(entity, select, user) {
273
+ var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee4(entity, select, mapper, user) {
274
274
  var docRef, _t3;
275
275
  return _regeneratorRuntime__default["default"].wrap(function (_context4) {
276
276
  while (1) switch (_context4.prev = _context4.next) {
@@ -294,7 +294,7 @@ var FirestoreService = /*#__PURE__*/function () {
294
294
  }
295
295
  }, _callee4, this, [[0, 2]]);
296
296
  }));
297
- function insert(_x8, _x9, _x0) {
297
+ function insert(_x1, _x10, _x11, _x12) {
298
298
  return _insert.apply(this, arguments);
299
299
  }
300
300
  return insert;
@@ -302,7 +302,7 @@ var FirestoreService = /*#__PURE__*/function () {
302
302
  }, {
303
303
  key: "update",
304
304
  value: function () {
305
- var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(entityId, updatedFields, select, user) {
305
+ var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime__default["default"].mark(function _callee5(entityId, updatedFields, select, mapper, user) {
306
306
  var docRef, _t4;
307
307
  return _regeneratorRuntime__default["default"].wrap(function (_context5) {
308
308
  while (1) switch (_context5.prev = _context5.next) {
@@ -322,7 +322,7 @@ var FirestoreService = /*#__PURE__*/function () {
322
322
  }
323
323
  }, _callee5, this, [[0, 1]]);
324
324
  }));
325
- function update(_x1, _x10, _x11, _x12) {
325
+ function update(_x13, _x14, _x15, _x16, _x17) {
326
326
  return _update.apply(this, arguments);
327
327
  }
328
328
  return update;
@@ -342,7 +342,7 @@ var FirestoreService = /*#__PURE__*/function () {
342
342
  }
343
343
  }, _callee6, this);
344
344
  }));
345
- function _delete(_x13) {
345
+ function _delete(_x18) {
346
346
  return _delete2.apply(this, arguments);
347
347
  }
348
348
  return _delete;
@@ -163,7 +163,7 @@ var FirestoreService = /*#__PURE__*/function () {
163
163
  return _createClass(FirestoreService, [{
164
164
  key: "getAll",
165
165
  value: function () {
166
- var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(count, select) {
166
+ var _getAll = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(count, select, mapper) {
167
167
  var querySnapshot;
168
168
  return _regeneratorRuntime.wrap(function (_context) {
169
169
  while (1) switch (_context.prev = _context.next) {
@@ -183,7 +183,7 @@ var FirestoreService = /*#__PURE__*/function () {
183
183
  }
184
184
  }, _callee, this);
185
185
  }));
186
- function getAll(_x, _x2) {
186
+ function getAll(_x, _x2, _x3) {
187
187
  return _getAll.apply(this, arguments);
188
188
  }
189
189
  return getAll;
@@ -191,7 +191,7 @@ var FirestoreService = /*#__PURE__*/function () {
191
191
  }, {
192
192
  key: "getById",
193
193
  value: function () {
194
- var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, select) {
194
+ var _getById = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(id, select, mapper) {
195
195
  var docRef, _t;
196
196
  return _regeneratorRuntime.wrap(function (_context2) {
197
197
  while (1) switch (_context2.prev = _context2.next) {
@@ -224,7 +224,7 @@ var FirestoreService = /*#__PURE__*/function () {
224
224
  }
225
225
  }, _callee2, this, [[0, 4]]);
226
226
  }));
227
- function getById(_x3, _x4) {
227
+ function getById(_x4, _x5, _x6) {
228
228
  return _getById.apply(this, arguments);
229
229
  }
230
230
  return getById;
@@ -232,7 +232,7 @@ var FirestoreService = /*#__PURE__*/function () {
232
232
  }, {
233
233
  key: "batchInsert",
234
234
  value: function () {
235
- var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(entities, select, user) {
235
+ var _batchInsert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(entities, select, mapper, user) {
236
236
  var _t2;
237
237
  return _regeneratorRuntime.wrap(function (_context3) {
238
238
  while (1) switch (_context3.prev = _context3.next) {
@@ -254,7 +254,7 @@ var FirestoreService = /*#__PURE__*/function () {
254
254
  }
255
255
  }, _callee3, this, [[0, 2]]);
256
256
  }));
257
- function batchInsert(_x5, _x6, _x7) {
257
+ function batchInsert(_x7, _x8, _x9, _x0) {
258
258
  return _batchInsert.apply(this, arguments);
259
259
  }
260
260
  return batchInsert;
@@ -262,7 +262,7 @@ var FirestoreService = /*#__PURE__*/function () {
262
262
  }, {
263
263
  key: "insert",
264
264
  value: function () {
265
- var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(entity, select, user) {
265
+ var _insert = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee4(entity, select, mapper, user) {
266
266
  var docRef, _t3;
267
267
  return _regeneratorRuntime.wrap(function (_context4) {
268
268
  while (1) switch (_context4.prev = _context4.next) {
@@ -286,7 +286,7 @@ var FirestoreService = /*#__PURE__*/function () {
286
286
  }
287
287
  }, _callee4, this, [[0, 2]]);
288
288
  }));
289
- function insert(_x8, _x9, _x0) {
289
+ function insert(_x1, _x10, _x11, _x12) {
290
290
  return _insert.apply(this, arguments);
291
291
  }
292
292
  return insert;
@@ -294,7 +294,7 @@ var FirestoreService = /*#__PURE__*/function () {
294
294
  }, {
295
295
  key: "update",
296
296
  value: function () {
297
- var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(entityId, updatedFields, select, user) {
297
+ var _update = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee5(entityId, updatedFields, select, mapper, user) {
298
298
  var docRef, _t4;
299
299
  return _regeneratorRuntime.wrap(function (_context5) {
300
300
  while (1) switch (_context5.prev = _context5.next) {
@@ -314,7 +314,7 @@ var FirestoreService = /*#__PURE__*/function () {
314
314
  }
315
315
  }, _callee5, this, [[0, 1]]);
316
316
  }));
317
- function update(_x1, _x10, _x11, _x12) {
317
+ function update(_x13, _x14, _x15, _x16, _x17) {
318
318
  return _update.apply(this, arguments);
319
319
  }
320
320
  return update;
@@ -334,7 +334,7 @@ var FirestoreService = /*#__PURE__*/function () {
334
334
  }
335
335
  }, _callee6, this);
336
336
  }));
337
- function _delete(_x13) {
337
+ function _delete(_x18) {
338
338
  return _delete2.apply(this, arguments);
339
339
  }
340
340
  return _delete;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@digitalaidseattle/firebase",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Wrapper for firebase that works with DAS Component library",
5
5
  "repository": "null//github.com/null/github.com/tree/master/packages/firebase",
6
6
  "main": "dist/digitalaidseattle-firebase.cjs.js",
@@ -8,7 +8,7 @@
8
8
  "types": "dist/declarations/src/index.d.ts",
9
9
  "dependencies": {
10
10
  "@babel/runtime": "^7.25.0",
11
- "@digitalaidseattle/core": "1.0.8",
11
+ "@digitalaidseattle/core": "1.0.10",
12
12
  "firebase": "^11.2.0",
13
13
  "react": "^18.3.1",
14
14
  "uuid": "^11.0.5"