backend-manager 1.1.103 → 2.0.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/package.json +19 -20
- package/src/cli/cli.js +22 -7
- package/src/manager/functions/core/actions/api/admin/create-post.js +160 -0
- package/src/manager/functions/core/actions/api/admin/firestore-query.js +172 -0
- package/src/manager/functions/core/actions/api/admin/firestore-read.js +54 -0
- package/src/manager/functions/core/actions/api/admin/firestore-write.js +47 -0
- package/src/manager/functions/core/actions/api/admin/get-stats.js +206 -0
- package/src/manager/functions/core/actions/api/admin/payment-processor.js +56 -0
- package/src/manager/functions/core/actions/api/admin/send-notification.js +189 -0
- package/src/manager/functions/core/actions/api/general/generate-uuid.js +49 -0
- package/src/manager/functions/core/actions/api/handler/create-post.js +118 -0
- package/src/manager/functions/core/actions/api/template.js +34 -0
- package/src/manager/functions/core/actions/api/test/authenticate.js +31 -0
- package/src/manager/functions/core/actions/api/test/create-test-accounts.js +36 -0
- package/src/manager/functions/core/actions/api/test/webhook.js +35 -0
- package/src/manager/functions/core/actions/api/user/create-custom-token.js +63 -0
- package/src/manager/functions/core/actions/api/user/delete.js +73 -0
- package/src/manager/functions/core/actions/api/user/get-subscription-info.js +63 -0
- package/src/manager/functions/core/actions/api/user/sign-out-all-sessions.js +86 -0
- package/src/manager/functions/core/actions/api/user/sign-up.js +241 -0
- package/src/manager/functions/core/actions/api.js +117 -323
- package/src/manager/functions/core/actions/old/api-2.js +414 -0
- package/src/manager/functions/core/admin/create-post.js +1 -1
- package/src/manager/index.js +1 -18
|
@@ -0,0 +1,414 @@
|
|
|
1
|
+
let fetch;
|
|
2
|
+
const _ = require('lodash');
|
|
3
|
+
|
|
4
|
+
let Module = {
|
|
5
|
+
init: async function (Manager, data) {
|
|
6
|
+
this.Manager = Manager;
|
|
7
|
+
this.libraries = Manager.libraries;
|
|
8
|
+
this.assistant = Manager.Assistant({req: data.req, res: data.res})
|
|
9
|
+
this.req = data.req;
|
|
10
|
+
this.res = data.res;
|
|
11
|
+
|
|
12
|
+
return this;
|
|
13
|
+
},
|
|
14
|
+
main: async function() {
|
|
15
|
+
let self = this;
|
|
16
|
+
let libraries = self.libraries;
|
|
17
|
+
let assistant = self.assistant;
|
|
18
|
+
let req = self.req;
|
|
19
|
+
let res = self.res;
|
|
20
|
+
|
|
21
|
+
let response = {
|
|
22
|
+
status: 200,
|
|
23
|
+
data: {},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
return libraries.cors(req, res, async () => {
|
|
27
|
+
let user = await assistant.authenticate();
|
|
28
|
+
|
|
29
|
+
const command = assistant.request.data.command;
|
|
30
|
+
const payload = {
|
|
31
|
+
response: response,
|
|
32
|
+
data: assistant.request.data,
|
|
33
|
+
user: user,
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
self.assistant.log('Executing', command, {environment: 'production'})
|
|
37
|
+
|
|
38
|
+
function _errorLog(e) {
|
|
39
|
+
self.assistant.error(e, {environment: 'production'})
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// Actions
|
|
43
|
+
// General
|
|
44
|
+
if (command === 'general:payment-processor' || command === 'payment-processor') { // rename: general:payment-processor
|
|
45
|
+
await self.general_paymentProcessor(payload).catch(e => _errorLog);
|
|
46
|
+
// } else if (command === 'general:generate-uuid') {
|
|
47
|
+
// await self.general_generateUUID(payload).catch(e => _errorLog);
|
|
48
|
+
|
|
49
|
+
// User
|
|
50
|
+
} if (command === 'user:create-custom-token' || command === 'create-custom-token') { // rename: user:create-custom-token
|
|
51
|
+
await self.user_createCustomToken(payload).catch(e => _errorLog);
|
|
52
|
+
} else if (command === 'user:delete' || command === 'delete-user') { // rename: user:delete
|
|
53
|
+
await self.user_delete(payload).catch(e => _errorLog);
|
|
54
|
+
} else if (command === 'user:sign-out-all-sessions' || command === 'sign-out-all-sessions') { // rename: user:sign-out-all-sessions
|
|
55
|
+
await self.user_signOutAllSessions(payload).catch(e => _errorLog);
|
|
56
|
+
} else if (command === 'user:get-subscription-info' || command === 'get-user-subscription-info') { // rename: user:get-subscription-info
|
|
57
|
+
await self.user_getSubscriptionInfo(payload).catch(e => _errorLog);
|
|
58
|
+
// } else if (command === 'user:sign-up') {
|
|
59
|
+
// await self.user_signUp(payload).catch(e => _errorLog);
|
|
60
|
+
|
|
61
|
+
// Handler
|
|
62
|
+
} else if (command === 'handler:create-post') {
|
|
63
|
+
console.log('---------AAAAA');
|
|
64
|
+
await self.handler_createPost().init(payload).main().catch(e => _errorLog);
|
|
65
|
+
console.log('---------BBBBB');
|
|
66
|
+
await self.handler_createPost().init(payload).main().catch(e => _errorLog);
|
|
67
|
+
|
|
68
|
+
// Admin
|
|
69
|
+
// } else if (command === 'admin:create-post') {
|
|
70
|
+
// await self.admin_createPost(payload).catch(e => _errorLog);
|
|
71
|
+
// } else if (command === 'admin:get-stats') {
|
|
72
|
+
// await self.admin_getStats(payload).catch(e => _errorLog);
|
|
73
|
+
// } else if (command === 'admin:send-notification') {
|
|
74
|
+
// await self.admin_sendNotification(payload).catch(e => _errorLog);
|
|
75
|
+
} else if (command === 'admin:firestore-read' || command === 'firestore-read') {
|
|
76
|
+
await self.admin_firestoreRead(payload).catch(e => _errorLog);
|
|
77
|
+
} else if (command === 'admin:firestore-write' || command === 'firestore-write') {
|
|
78
|
+
await self.admin_firestoreWrite(payload).catch(e => _errorLog);
|
|
79
|
+
// } else if (command === 'admin:firestore-query') {
|
|
80
|
+
// await self.admin_query(payload).catch(e => _errorLog);
|
|
81
|
+
|
|
82
|
+
// End
|
|
83
|
+
} else {
|
|
84
|
+
response.status = 401;
|
|
85
|
+
response.error = new Error(`Improper command supplied: ${command}`);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
self.assistant.log('Api payload', {object: payload, string: JSON.stringify(payload)}, {environment: 'production'})
|
|
89
|
+
|
|
90
|
+
if (response.status === 200) {
|
|
91
|
+
return res.status(response.status).json(response.data);
|
|
92
|
+
} else {
|
|
93
|
+
return res.status(response.status).send(response.error.message);
|
|
94
|
+
}
|
|
95
|
+
});
|
|
96
|
+
},
|
|
97
|
+
|
|
98
|
+
// General
|
|
99
|
+
general_paymentProcessor: async function (payload) {
|
|
100
|
+
const self = this;
|
|
101
|
+
|
|
102
|
+
return new Promise(async function(resolve, reject) {
|
|
103
|
+
const productId = _.get(payload, 'data.payload.payload.details.productIdGlobal');
|
|
104
|
+
if (!productId) {
|
|
105
|
+
return reject(new Error('No productId'))
|
|
106
|
+
}
|
|
107
|
+
const processorPath = `${process.cwd()}/payment-processors/${productId}.js`
|
|
108
|
+
let processor;
|
|
109
|
+
// console.log('---processorPath', processorPath);
|
|
110
|
+
try {
|
|
111
|
+
processor = new (require(processorPath));
|
|
112
|
+
processor.Manager = self.Manager;
|
|
113
|
+
} catch (e) {
|
|
114
|
+
self.assistant.error('Error loading processor', processorPath, e, {environment: 'production'})
|
|
115
|
+
return resolve()
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
await processor.process(payload.data.payload)
|
|
119
|
+
.then(result => {
|
|
120
|
+
payload.response.data = result;
|
|
121
|
+
return resolve(result);
|
|
122
|
+
})
|
|
123
|
+
.catch(e => {
|
|
124
|
+
self.Manager.libraries.sentry.captureException(e);
|
|
125
|
+
console.error(`Payment processor @ "${processorPath}" failed`, e);
|
|
126
|
+
return reject(e);
|
|
127
|
+
})
|
|
128
|
+
});
|
|
129
|
+
},
|
|
130
|
+
general_generateUUID: async function (payload) {
|
|
131
|
+
const self = this;
|
|
132
|
+
|
|
133
|
+
return new Promise(async function(resolve, reject) {
|
|
134
|
+
|
|
135
|
+
});
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
// User
|
|
139
|
+
user_createCustomToken: async function (payload) {
|
|
140
|
+
const self = this;
|
|
141
|
+
|
|
142
|
+
return new Promise(async function(resolve, reject) {
|
|
143
|
+
if (payload.user.authenticated || payload.user.roles.admin) {
|
|
144
|
+
await self.libraries.admin.auth().createCustomToken(payload.user.auth.uid)
|
|
145
|
+
.then(token => {
|
|
146
|
+
payload.response.data.token = token;
|
|
147
|
+
return resolve(payload);
|
|
148
|
+
})
|
|
149
|
+
.catch(e => {
|
|
150
|
+
payload.response.status = 401;
|
|
151
|
+
payload.response.error = new Error(`Failed to create custom token: ${e}`);
|
|
152
|
+
return reject(payload.response.error);
|
|
153
|
+
})
|
|
154
|
+
} else {
|
|
155
|
+
payload.response.status = 401;
|
|
156
|
+
payload.response.error = new Error('User not authenticated.');
|
|
157
|
+
return reject(payload.response.error);
|
|
158
|
+
}
|
|
159
|
+
});
|
|
160
|
+
},
|
|
161
|
+
user_delete: async function (payload) {
|
|
162
|
+
const self = this;
|
|
163
|
+
|
|
164
|
+
return new Promise(async function(resolve, reject) {
|
|
165
|
+
if (payload.user.authenticated || payload.user.roles.admin) {
|
|
166
|
+
// const planExpireDate = new Date(_.get(payload.user, 'plan.expires.timestamp', 0));
|
|
167
|
+
// if (planExpireDate >= new Date()) {
|
|
168
|
+
// payload.response.status = 401;
|
|
169
|
+
// payload.response.error = new Error(`Failed to delete user: There is an active paid subscription on this account. Please cancel it first and then try deleting the account again.`);
|
|
170
|
+
// return reject(payload.response.error);
|
|
171
|
+
// }
|
|
172
|
+
const isPlanActive = _.get(payload.user, 'plan.payment.active', null);
|
|
173
|
+
if (isPlanActive === true) {
|
|
174
|
+
payload.response.status = 401;
|
|
175
|
+
payload.response.error = new Error(`Failed to delete user: There is an active paid subscription on this account. Please cancel it first and then try deleting the account again.`);
|
|
176
|
+
return reject(payload.response.error);
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
await self.libraries.admin.auth().deleteUser(payload.user.auth.uid)
|
|
180
|
+
.then(() => {
|
|
181
|
+
return resolve(payload);
|
|
182
|
+
})
|
|
183
|
+
.catch(e => {
|
|
184
|
+
payload.response.status = 401;
|
|
185
|
+
payload.response.error = new Error(`Failed to delete user: ${e}`);
|
|
186
|
+
return reject(payload.response.error);
|
|
187
|
+
})
|
|
188
|
+
} else {
|
|
189
|
+
payload.response.status = 401;
|
|
190
|
+
payload.response.error = new Error('User not authenticated.');
|
|
191
|
+
return reject(payload.response.error);
|
|
192
|
+
}
|
|
193
|
+
});
|
|
194
|
+
},
|
|
195
|
+
user_signOutAllSessions: async function (payload) {
|
|
196
|
+
const self = this;
|
|
197
|
+
const powertools = self.Manager.require('node-powertools')
|
|
198
|
+
return new Promise(async function(resolve, reject) {
|
|
199
|
+
const uid = _.get(payload.user, 'auth.uid', null);
|
|
200
|
+
|
|
201
|
+
if (payload.user.authenticated || payload.user.roles.admin && uid) {
|
|
202
|
+
await self.libraries.admin.database().ref(`gatherings/online`)
|
|
203
|
+
.orderByChild('uid')
|
|
204
|
+
.equalTo(uid)
|
|
205
|
+
.once('value')
|
|
206
|
+
.then(async snap => {
|
|
207
|
+
const data = snap.val();
|
|
208
|
+
const keys = Object.keys(data || {});
|
|
209
|
+
for (var i = 0; i < keys.length; i++) {
|
|
210
|
+
const key = keys[i];
|
|
211
|
+
self.assistant.log(`Signing out: ${key}`, {environment: 'production'});
|
|
212
|
+
await self.libraries.admin.database().ref(`gatherings/online/${key}/command`).set('signout').catch(e => self.assistant.error(`Failed to signout ${key}`, e))
|
|
213
|
+
await powertools.wait(3000);
|
|
214
|
+
await self.libraries.admin.database().ref(`gatherings/online/${key}`).remove().catch(e => self.assistant.error(`Failed to delete ${key}`, e))
|
|
215
|
+
}
|
|
216
|
+
})
|
|
217
|
+
.catch(e => {
|
|
218
|
+
console.error('Gathering query error', e);
|
|
219
|
+
})
|
|
220
|
+
|
|
221
|
+
await self.libraries.admin
|
|
222
|
+
.auth()
|
|
223
|
+
.revokeRefreshTokens(uid)
|
|
224
|
+
.then(() => {
|
|
225
|
+
self.assistant.log('Signed user out of all sessions', payload.user.auth.uid, {environment: 'production'})
|
|
226
|
+
payload.data = {message: `Successfully signed ${payload.user.auth.uid} out of all sessions`}
|
|
227
|
+
return resolve(payload.data);
|
|
228
|
+
})
|
|
229
|
+
.catch(e => {
|
|
230
|
+
payload.response.status = 500;
|
|
231
|
+
payload.response.error = e;
|
|
232
|
+
})
|
|
233
|
+
|
|
234
|
+
if (payload.response.status >= 200 && payload.response.status < 300) {
|
|
235
|
+
return resolve(payload.response.data);
|
|
236
|
+
} else {
|
|
237
|
+
return reject(payload.response.error);
|
|
238
|
+
}
|
|
239
|
+
} else {
|
|
240
|
+
payload.response.status = 401;
|
|
241
|
+
payload.response.error = new Error('User not authenticated.');
|
|
242
|
+
return reject(payload.response.error);
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
});
|
|
246
|
+
},
|
|
247
|
+
user_getSubscriptionInfo: async function (payload) {
|
|
248
|
+
const self = this;
|
|
249
|
+
const uid = _.get(payload, 'data.payload.uid', null)
|
|
250
|
+
|
|
251
|
+
return new Promise(async function(resolve, reject) {
|
|
252
|
+
// console.log('----payload.data', payload.data);
|
|
253
|
+
|
|
254
|
+
if (!uid) {
|
|
255
|
+
payload.response.status = 401;
|
|
256
|
+
payload.response.error = new Error(`Improper uid supplied: ${uid}`);
|
|
257
|
+
return reject(payload);
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
await self.libraries.admin.firestore().doc(`users/${uid}`)
|
|
261
|
+
.get()
|
|
262
|
+
.then(doc => {
|
|
263
|
+
const data = doc.data();
|
|
264
|
+
if (!data) {
|
|
265
|
+
payload.response.status = 401;
|
|
266
|
+
payload.response.error = new Error(`Cannot find user with uid: ${uid}`);
|
|
267
|
+
return reject(payload.response.data);
|
|
268
|
+
} else {
|
|
269
|
+
payload.response.data = {
|
|
270
|
+
plan: {
|
|
271
|
+
id: data.plan.id,
|
|
272
|
+
payment: {
|
|
273
|
+
active: data.plan.payment.active,
|
|
274
|
+
},
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
return resolve(payload.response.data);
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
})
|
|
281
|
+
.catch(e => {
|
|
282
|
+
payload.response.status = 500;
|
|
283
|
+
payload.response.error = e;
|
|
284
|
+
return reject(payload);
|
|
285
|
+
})
|
|
286
|
+
//
|
|
287
|
+
//
|
|
288
|
+
// const isPlanActive = _.get(payload.user, 'plan.payment.active', null);
|
|
289
|
+
// if (isPlanActive === true) {
|
|
290
|
+
// payload.response.status = 401;
|
|
291
|
+
// payload.response.error = new Error(`Failed to delete user: There is an active paid subscription on this account. Please cancel it first and then try deleting the account again.`);
|
|
292
|
+
// return reject(payload.response.error);
|
|
293
|
+
// }
|
|
294
|
+
//
|
|
295
|
+
// await self.libraries.admin.auth().deleteUser(payload.user.auth.uid)
|
|
296
|
+
// .then(() => {
|
|
297
|
+
// return resolve(payload);
|
|
298
|
+
// })
|
|
299
|
+
// .catch(e => {
|
|
300
|
+
// payload.response.status = 401;
|
|
301
|
+
// payload.response.error = new Error(`Failed to delete user: ${e}`);
|
|
302
|
+
// return reject(payload.response.error);
|
|
303
|
+
// })
|
|
304
|
+
});
|
|
305
|
+
},
|
|
306
|
+
user_signUp: async function (payload) {
|
|
307
|
+
const self = this;
|
|
308
|
+
|
|
309
|
+
return new Promise(async function(resolve, reject) {
|
|
310
|
+
|
|
311
|
+
});
|
|
312
|
+
},
|
|
313
|
+
|
|
314
|
+
// Handler
|
|
315
|
+
handler_createPost: require('./api/handler/create-post.js'),
|
|
316
|
+
|
|
317
|
+
// Admin
|
|
318
|
+
admin_createPost: require('./api/admin/create-post.js'),
|
|
319
|
+
admin_getStats: async function (payload) {
|
|
320
|
+
const self = this;
|
|
321
|
+
|
|
322
|
+
return new Promise(async function(resolve, reject) {
|
|
323
|
+
|
|
324
|
+
});
|
|
325
|
+
},
|
|
326
|
+
admin_sendNotification: async function (payload) {
|
|
327
|
+
const self = this;
|
|
328
|
+
|
|
329
|
+
return new Promise(async function(resolve, reject) {
|
|
330
|
+
|
|
331
|
+
});
|
|
332
|
+
},
|
|
333
|
+
admin_firestoreRead: async function (payload) {
|
|
334
|
+
const self = this;
|
|
335
|
+
|
|
336
|
+
return new Promise(async function(resolve, reject) {
|
|
337
|
+
if (payload.user.authenticated || payload.user.roles.admin) {
|
|
338
|
+
|
|
339
|
+
// console.log('---payload.data.payload', payload.data.payload);
|
|
340
|
+
|
|
341
|
+
payload.data.payload.path = `${payload.data.payload.path || ''}`;
|
|
342
|
+
payload.data.payload.document = payload.data.payload.document || {};
|
|
343
|
+
payload.data.payload.options = payload.data.payload.options || { merge: true };
|
|
344
|
+
|
|
345
|
+
|
|
346
|
+
if (!payload.data.payload.path) {
|
|
347
|
+
payload.response.status = 401;
|
|
348
|
+
payload.response.error = new Error('Path parameter required');
|
|
349
|
+
return reject(payload);
|
|
350
|
+
} else {
|
|
351
|
+
await self.libraries.admin.firestore().doc(payload.data.payload.path)
|
|
352
|
+
.get()
|
|
353
|
+
.then(doc => {
|
|
354
|
+
payload.response.data = doc.data();
|
|
355
|
+
return resolve(payload.response.data);
|
|
356
|
+
})
|
|
357
|
+
.catch(e => {
|
|
358
|
+
payload.response.status = 500;
|
|
359
|
+
payload.response.error = e;
|
|
360
|
+
return reject(payload);
|
|
361
|
+
})
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
} else {
|
|
365
|
+
payload.response.status = 401;
|
|
366
|
+
payload.response.error = new Error('User not authenticated.');
|
|
367
|
+
return reject(payload.response.error);
|
|
368
|
+
}
|
|
369
|
+
});
|
|
370
|
+
},
|
|
371
|
+
admin_firestoreWrite: async function (payload) {
|
|
372
|
+
const self = this;
|
|
373
|
+
|
|
374
|
+
return new Promise(async function(resolve, reject) {
|
|
375
|
+
if (payload.user.authenticated || payload.user.roles.admin) {
|
|
376
|
+
|
|
377
|
+
payload.data.payload.path = `${payload.data.payload.path || ''}`;
|
|
378
|
+
payload.data.payload.document = payload.data.payload.document || {};
|
|
379
|
+
payload.data.payload.options = payload.data.payload.options || { merge: true };
|
|
380
|
+
|
|
381
|
+
if (!payload.data.payload.path) {
|
|
382
|
+
payload.response.status = 401;
|
|
383
|
+
payload.response.error = new Error('Path parameter required');
|
|
384
|
+
return reject(payload);
|
|
385
|
+
} else {
|
|
386
|
+
await self.libraries.admin.firestore().doc(payload.data.payload.path)
|
|
387
|
+
.set(payload.data.payload.document, payload.data.payload.options)
|
|
388
|
+
.then(r => {
|
|
389
|
+
return resolve(payload);
|
|
390
|
+
})
|
|
391
|
+
.catch(e => {
|
|
392
|
+
payload.response.status = 500;
|
|
393
|
+
payload.response.error = e;
|
|
394
|
+
return reject(payload);
|
|
395
|
+
})
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
} else {
|
|
399
|
+
payload.response.status = 401;
|
|
400
|
+
payload.response.error = new Error('User not authenticated.');
|
|
401
|
+
return reject(payload.response.error);
|
|
402
|
+
}
|
|
403
|
+
});
|
|
404
|
+
},
|
|
405
|
+
admin_query: async function (payload) {
|
|
406
|
+
const self = this;
|
|
407
|
+
|
|
408
|
+
return new Promise(async function(resolve, reject) {
|
|
409
|
+
|
|
410
|
+
});
|
|
411
|
+
},
|
|
412
|
+
|
|
413
|
+
}
|
|
414
|
+
module.exports = Module;
|
package/src/manager/index.js
CHANGED
|
@@ -21,7 +21,6 @@ Manager.prototype.init = function (exporter, options) {
|
|
|
21
21
|
|
|
22
22
|
// Paths
|
|
23
23
|
const core = './functions/core';
|
|
24
|
-
const test = './functions/test';
|
|
25
24
|
const wrappers = './functions/wrappers';
|
|
26
25
|
|
|
27
26
|
// Set options defaults
|
|
@@ -118,8 +117,7 @@ Manager.prototype.init = function (exporter, options) {
|
|
|
118
117
|
self.libraries.functions
|
|
119
118
|
.runWith({memory: '256MB', timeoutSeconds: 60})
|
|
120
119
|
.https.onRequest(async (req, res) => {
|
|
121
|
-
const Module = require(`${core}/actions/api.js`);
|
|
122
|
-
Module.init(self, { req: req, res: res, });
|
|
120
|
+
const Module = (new (require(`${core}/actions/api.js`))()).init(self, { req: req, res: res, });
|
|
123
121
|
|
|
124
122
|
return self._preProcess(Module)
|
|
125
123
|
.then(r => Module.main())
|
|
@@ -129,21 +127,6 @@ Manager.prototype.init = function (exporter, options) {
|
|
|
129
127
|
});
|
|
130
128
|
});
|
|
131
129
|
|
|
132
|
-
// exporter.bm_deleteUser =
|
|
133
|
-
// self.libraries.functions
|
|
134
|
-
// .runWith({memory: '256MB', timeoutSeconds: 60})
|
|
135
|
-
// .https.onRequest(async (req, res) => {
|
|
136
|
-
// const Module = require(`${core}/actions/delete-user.js`);
|
|
137
|
-
// Module.init(self, { req: req, res: res, });
|
|
138
|
-
//
|
|
139
|
-
// return self._preProcess(Module)
|
|
140
|
-
// .then(r => Module.main())
|
|
141
|
-
// .catch(e => {
|
|
142
|
-
// self.assistant.error(e, {environment: 'production'});
|
|
143
|
-
// return res.status(500).send(e.message);
|
|
144
|
-
// });
|
|
145
|
-
// });
|
|
146
|
-
|
|
147
130
|
exporter.bm_signUpHandler =
|
|
148
131
|
self.libraries.functions
|
|
149
132
|
.runWith({memory: '256MB', timeoutSeconds: 60})
|