backend-manager 2.5.59 → 2.5.60
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "backend-manager",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.60",
|
|
4
4
|
"description": "Quick tools for developing Firebase functions",
|
|
5
5
|
"main": "src/manager/index.js",
|
|
6
6
|
"bin": {
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@google-cloud/storage": "^5.20.5",
|
|
32
32
|
"@sendgrid/mail": "^7.7.0",
|
|
33
33
|
"@sentry/node": "^6.19.7",
|
|
34
|
-
"backend-assistant": "^0.0
|
|
34
|
+
"backend-assistant": "^1.0.0",
|
|
35
35
|
"busboy": "^1.6.0",
|
|
36
36
|
"chalk": "^4.1.2",
|
|
37
37
|
"cors": "^2.8.5",
|
|
@@ -4,7 +4,6 @@ function Utilities(Manager) {
|
|
|
4
4
|
const self = this;
|
|
5
5
|
|
|
6
6
|
self.cache = null;
|
|
7
|
-
self._deleteThis = Math.random();
|
|
8
7
|
|
|
9
8
|
self.Manager = Manager;
|
|
10
9
|
}
|
|
@@ -157,50 +156,6 @@ Utilities.prototype.randomId = function (options) {
|
|
|
157
156
|
return nanoId();
|
|
158
157
|
};
|
|
159
158
|
|
|
160
|
-
// Utilities.prototype.get = function (doc, options) {
|
|
161
|
-
// const self = this;
|
|
162
|
-
|
|
163
|
-
// return new Promise(function(resolve, reject) {
|
|
164
|
-
|
|
165
|
-
// options = options || {};
|
|
166
|
-
// options.maxAge = options.maxAge || (1000 * 60 * 5); // 5 minutes
|
|
167
|
-
|
|
168
|
-
// self.cache = self.cache || self.Manager.storage({name: 'cache', temporary: true, clear: false});
|
|
169
|
-
|
|
170
|
-
// const item = self.cache.get(doc).value();
|
|
171
|
-
// const age = item ? Date.now() - item.time : null;
|
|
172
|
-
|
|
173
|
-
// console.log('+++++ 111', doc, age, item);
|
|
174
|
-
|
|
175
|
-
// if (item && age < options.maxAge) {
|
|
176
|
-
// console.log('---GOT FROM CACHE---');
|
|
177
|
-
|
|
178
|
-
// return resolve(self.cache.map.get(doc).data);
|
|
179
|
-
// } else {
|
|
180
|
-
// console.log('---GOT FROM FIRESTORE---');
|
|
181
|
-
|
|
182
|
-
// self.Manager.libraries.admin.firestore().doc(doc)
|
|
183
|
-
// .get()
|
|
184
|
-
// .then(async (doc) => {
|
|
185
|
-
// const data = doc.data();
|
|
186
|
-
|
|
187
|
-
// if (!data) {
|
|
188
|
-
// throw new Error(`Document with ID ${doc} not found`);
|
|
189
|
-
// }
|
|
190
|
-
|
|
191
|
-
// self.cache.set(doc, {
|
|
192
|
-
// data: data,
|
|
193
|
-
// time: Date.now(),
|
|
194
|
-
// })
|
|
195
|
-
// .write();
|
|
196
|
-
|
|
197
|
-
// return resolve(data);
|
|
198
|
-
// })
|
|
199
|
-
// }
|
|
200
|
-
// });
|
|
201
|
-
// };
|
|
202
|
-
|
|
203
|
-
|
|
204
159
|
Utilities.prototype.get = function (docPath, options) {
|
|
205
160
|
const self = this;
|
|
206
161
|
|