mosquito-transport 1.5.0 → 1.5.2

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.
@@ -7,8 +7,15 @@ import { queryDocument, readDocument, writeDocument } from "../database";
7
7
  import { addTokenSelfDestruct, destroyToken, signJWT, signRefreshToken, validateRefreshToken, verifyJWT } from "./tokenizer";
8
8
  import { simplifyError } from 'simplify-error';
9
9
 
10
- export const signupCustom = async (email = '', password = '', signupMethod = AUTH_PROVIDER_ID.PASSWORD, profile = {}, projectName, customExtras = {}) => {
11
-
10
+ export const signupCustom = async (
11
+ email = '',
12
+ password = '',
13
+ signupMethod = AUTH_PROVIDER_ID.PASSWORD,
14
+ profile = {},
15
+ projectName,
16
+ customExtras = {}
17
+ ) => {
18
+ // TODO: fine grained error
12
19
  try {
13
20
  email = email.trim().toLowerCase();
14
21
  if (Scoped.pendingSignups[`${projectName}${email}`])
@@ -226,9 +226,10 @@ const dbRoute = [
226
226
  _documentCount
227
227
  ];
228
228
 
229
- const FilterFootPrint = t => { };
230
- const UpdateValueFootPrint = {};
231
- const InsertValueFootPrint = {};
229
+ // TODO: provide valid footprint
230
+ const FilterFootPrint = t => true;
231
+ const UpdateValueFootPrint = () => true;
232
+ const InsertValueFootPrint = () => true;
232
233
 
233
234
  const ReturnAndExcludeFootprint = t => t === undefined ||
234
235
  !(Array.isArray(t) ? t : [t]).filter(v => !Validator.TRIMMED_NON_EMPTY_STRING(v)).length;
@@ -236,16 +237,18 @@ const ReturnAndExcludeFootprint = t => t === undefined ||
236
237
  const ConfigFootPrint = t => t === undefined ||
237
238
  guardObject({
238
239
  extraction: t => t === undefined ||
239
- guardObject({
240
- collection: GuardSignal.TRIMMED_NON_EMPTY_STRING,
241
- sort: (t, p) => t === undefined || (Validator.TRIMMED_NON_EMPTY_STRING(t) && p.find),
242
- direction: (t, p) => t === undefined || (p.sort && p.find && DirectionList.includes(t)),
243
- limit: (t, p) => t === undefined || (Validator.POSITIVE_INTEGER(t) && p.find),
244
- find: (t, p) => (t === undefined && p.findOne) || (!p.findOne && FilterFootPrint(t)),
245
- findOne: (t, p) => (t === undefined && p.find) || (!p.find && FilterFootPrint(t)),
246
- returnOnly: ReturnAndExcludeFootprint,
247
- excludeFields: ReturnAndExcludeFootprint
248
- }).validate(t),
240
+ (Array.isArray(t) ? t : [t]).filter(m =>
241
+ guardObject({
242
+ collection: GuardSignal.TRIMMED_NON_EMPTY_STRING,
243
+ sort: (t, p) => t === undefined || (Validator.TRIMMED_NON_EMPTY_STRING(t) && p.find),
244
+ direction: (t, p) => t === undefined || (p.sort && p.find && DirectionList.includes(t)),
245
+ limit: (t, p) => t === undefined || (Validator.POSITIVE_INTEGER(t) && p.find),
246
+ find: (t, p) => (t === undefined && p.findOne) || (!p.findOne && FilterFootPrint(t)),
247
+ findOne: (t, p) => (t === undefined && p.find) || (!p.find && FilterFootPrint(t)),
248
+ returnOnly: ReturnAndExcludeFootprint,
249
+ excludeFields: ReturnAndExcludeFootprint
250
+ }).validate(m)
251
+ ).length,
249
252
  returnOnly: ReturnAndExcludeFootprint,
250
253
  excludeFields: ReturnAndExcludeFootprint
251
254
  }).validate(t);
@@ -290,6 +293,7 @@ const CommandFootprint = {
290
293
  [_listenCollection]: CommonQueryFootPrint,
291
294
  [_writeDocument]: CommonWriteFootPrint,
292
295
  [_startDisconnectWriteTask]: CommonWriteFootPrint,
296
+ [_cancelDisconnectWriteTask]: CommonWriteFootPrint,
293
297
  [_documentCount]: {
294
298
  path: GuardSignal.TRIMMED_NON_EMPTY_STRING,
295
299
  find: FilterFootPrint
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "mosquito-transport",
3
- "version": "1.5.0",
3
+ "version": "1.5.2",
4
4
  "description": "MosquitoTransport is a powerful tool that helps persist and synchronize data between your MongoDB database and frontend applications",
5
5
  "main": "lib/index.js",
6
6
  "type": "module",
@@ -43,7 +43,7 @@
43
43
  "express": "^4.18.2",
44
44
  "fast-json-stable-stringify": "^2.1.0",
45
45
  "google-auth-library": "^8.8.0",
46
- "guard-object": "^1.0.6",
46
+ "guard-object": "^1.0.7",
47
47
  "json-buffer": "^3.0.1",
48
48
  "jsonwebtoken": "^9.0.0",
49
49
  "lodash.get": "^4.4.2",