@qingfu/core-env 0.1.17 → 0.1.18

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.
Files changed (3) hide show
  1. package/aa.js +3 -0
  2. package/lib/broker.js +5 -3
  3. package/package.json +4 -4
package/aa.js ADDED
@@ -0,0 +1,3 @@
1
+ const { Errors } = require( 'moleculer' );
2
+
3
+ console.log( new Errors.MoleculerError( 'NONCE_CONFLICT', 409 ))
package/lib/broker.js CHANGED
@@ -1,6 +1,6 @@
1
1
  if ( process.env.BROKER_URI ) {
2
2
 
3
- const { ServiceBroker, Errors } = require( 'moleculer' );
3
+ const { ServiceBroker, Errors: { MoleculerError }} = require( 'moleculer' );
4
4
  const defaultTCP = { maxPacketSize: 20 * 1024 * 1024 };
5
5
  const namespaces = process.env.BROKER_NS.split( /,?\s+/ ).filter( Boolean );
6
6
  const transporters = process.env.BROKER_URI.split( /,?\s+/ ).filter( Boolean );
@@ -38,8 +38,10 @@ if ( process.env.BROKER_URI ) {
38
38
  nonce: ctx.meta.nonce,
39
39
  timestamp: ctx.meta.timestamp
40
40
  });
41
- if ( !nonce ) throw new Errors.MoleculerError(
42
- 'nonce or timestamp conflict', 409 );
41
+ if ( !nonce ) throw Object.assign(
42
+ new MoleculerError( 'NONCE_CONFLICT', 409 ),
43
+ { expose: true }
44
+ );
43
45
  }
44
46
  return await next( ctx );
45
47
  };
package/package.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@qingfu/core-env",
3
- "version": "0.1.17",
3
+ "version": "0.1.18",
4
4
  "readmeFilename": "README.md",
5
5
  "dependencies": {
6
6
  "@koa/cors": "3.1.0",
7
7
  "@koa/router": "10.1.1",
8
- "bull": "4.5.4",
8
+ "bull": "4.6.2",
9
9
  "busboy": "0.3.1",
10
10
  "cookie": "0.4.2",
11
11
  "dotenv-extended": "2.9.0",
@@ -21,7 +21,7 @@
21
21
  "koa-qs": "3.0.0",
22
22
  "lodash": "4.17.21",
23
23
  "moleculer": "0.14.19",
24
- "mongoose": "6.2.1",
24
+ "mongoose": "6.2.4",
25
25
  "mongoose-cast-aggregation": "0.2.1",
26
26
  "mongoose-geojson-schema": "2.1.7",
27
27
  "mongoose-lean-defaults": "2.1.0",
@@ -29,7 +29,7 @@
29
29
  "mongoose-lean-virtuals": "0.9.0",
30
30
  "ms": "2.1.3",
31
31
  "notepack.io": "2.3.0",
32
- "pinyin": "2.10.2",
32
+ "pinyin": "2.11.0",
33
33
  "primus": "8.0.5",
34
34
  "primus-rooms": "3.4.1",
35
35
  "qr-image": "3.2.0",