monastery 2.2.3 → 3.0.1

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,25 +1,28 @@
1
1
  {
2
2
  "name": "monastery",
3
- "description": "⛪ A straight forward MongoDB ODM built around Monk",
3
+ "description": "⛪ A simple, straightforward MongoDB ODM",
4
4
  "author": "Ricky Boyce",
5
- "version": "2.2.3",
5
+ "version": "3.0.1",
6
6
  "license": "MIT",
7
7
  "repository": "github:boycce/monastery",
8
8
  "homepage": "https://boycce.github.io/monastery/",
9
9
  "main": "lib/index.js",
10
10
  "keywords": [
11
+ "database",
12
+ "javascript",
11
13
  "monastery",
12
- "monk",
13
- "mongodb",
14
+ "mongo driver",
14
15
  "mongo",
15
- "driver",
16
- "monk odm",
17
- "mongo odm"
16
+ "mongodb",
17
+ "nodejs",
18
+ "odm",
19
+ "orm"
18
20
  ],
19
21
  "scripts": {
20
22
  "dev": "npm run lint & jest --watchAll --runInBand --verbose=false",
21
23
  "docs": "cd docs && bundle exec jekyll serve --livereload --livereload-port 4001",
22
24
  "lint": "eslint ./lib ./plugins ./test",
25
+ "mona": "nodemon resources/mona.js",
23
26
  "mong": "nodemon resources/mong.js",
24
27
  "major": "standard-version --release-as major && npm publish",
25
28
  "minor": "standard-version --release-as minor && npm publish",
@@ -34,8 +37,7 @@
34
37
  "@aws-sdk/s3-request-presigner": "3.549.0",
35
38
  "debug": "4.3.4",
36
39
  "file-type": "^16.5.4",
37
- "mongodb": "^3.2.3",
38
- "monk": "7.3.4",
40
+ "mongodb": "^5.9.2",
39
41
  "nanoid": "3.2.0",
40
42
  "validator": "13.7.0"
41
43
  },
@@ -50,8 +52,7 @@
50
52
  "supertest": "4.0.2"
51
53
  },
52
54
  "engines": {
53
- "node": ">=14",
54
- "npm": ">=6"
55
+ "node": ">=14"
55
56
  },
56
57
  "standard-version": {
57
58
  "infile": "changelog.md",
@@ -39,7 +39,7 @@ let plugin = module.exports = {
39
39
 
40
40
  if (!options.awsBucket || !options.awsAccessKeyId || !options.awsSecretAccessKey) {
41
41
  manager.error('Monastery imagePlugin: awsBucket, awsAccessKeyId, or awsSecretAccessKey is not defined')
42
- delete manager.imagePlugin
42
+ delete manager.opts.imagePlugin
43
43
  return
44
44
  }
45
45
 
@@ -54,8 +54,8 @@ let plugin = module.exports = {
54
54
  region: this.awsRegion,
55
55
  credentials: {
56
56
  accessKeyId: this.awsAccessKeyId,
57
- secretAccessKey: this.awsSecretAccessKey
58
- }
57
+ secretAccessKey: this.awsSecretAccessKey,
58
+ },
59
59
  }))
60
60
  }
61
61
 
@@ -150,7 +150,7 @@ let plugin = module.exports = {
150
150
  let path = filesArr.imageField.path || plugin.path
151
151
  let image = {
152
152
  bucket: filesArr.imageField.awsBucket || plugin.awsBucket,
153
- date: plugin.manager.useMilliseconds? Date.now() : Math.floor(Date.now() / 1000),
153
+ date: plugin.manager.opts.useMilliseconds? Date.now() : Math.floor(Date.now() / 1000),
154
154
  filename: file.name,
155
155
  filesize: file.size,
156
156
  metadata: filesArr.imageField.metadata || plugin.metadata,
@@ -204,7 +204,7 @@ let plugin = module.exports = {
204
204
  return model._update(
205
205
  idquery,
206
206
  { '$set': prunedData },
207
- { 'multi': options.multi || options.create },
207
+ { 'multi': options.multi || options.create }
208
208
  )
209
209
 
210
210
  // If errors, remove inserted documents to prevent double ups when the user resaves.
@@ -372,7 +372,7 @@ let plugin = module.exports = {
372
372
  { Key: pre.image.path },
373
373
  { Key: `small/${key}.jpg` },
374
374
  { Key: `medium/${key}.jpg` },
375
- { Key: `large/${key}.jpg` },
375
+ { Key: `large/${key}.jpg` }
376
376
  )
377
377
  plugin.manager.info(
378
378
  `Removing '${pre.image.filename}' from '${pre.image.bucket}/${pre.image.path}'`
@@ -385,7 +385,7 @@ let plugin = module.exports = {
385
385
  await new Promise((resolve, reject) => {
386
386
  plugin.getS3Client().deleteObjects({
387
387
  Bucket: plugin.awsBucket,
388
- Delete: { Objects: unused }
388
+ Delete: { Objects: unused },
389
389
  }, (err, data) => {
390
390
  if (err) reject(err)
391
391
  resolve()
@@ -459,19 +459,19 @@ let plugin = module.exports = {
459
459
 
460
460
  if (file.truncated) reject({
461
461
  title: filesArr.inputPath + (i? `.${i}` : ''),
462
- detail: `The file size for '${file.nameClipped}' is too big.`
462
+ detail: `The file size for '${file.nameClipped}' is too big.`,
463
463
  })
464
464
  else if (filesize && filesize < file.size) reject({ // file.size == bytes
465
465
  title: filesArr.inputPath + (i? `.${i}` : ''),
466
- detail: `The file size for '${file.nameClipped}' is bigger than ${(filesize/1000/1000).toFixed(1)}MB.`
466
+ detail: `The file size for '${file.nameClipped}' is bigger than ${(filesize/1000/1000).toFixed(1)}MB.`,
467
467
  })
468
468
  else if (file.ext == 'unknown') reject({
469
469
  title: filesArr.inputPath + (i? `.${i}` : ''),
470
- detail: `Please add a file extension to your file '${file.nameClipped}'`
470
+ detail: `Please add a file extension to your file '${file.nameClipped}'`,
471
471
  })
472
472
  else if (!allowAny && !util.inArray(formats, file.ext)) reject({
473
473
  title: filesArr.inputPath + (i? `.${i}` : ''),
474
- detail: `The file format '${file.ext}' for '${file.nameClipped}' is not supported`
474
+ detail: `The file format '${file.ext}' for '${file.nameClipped}' is not supported`,
475
475
  })
476
476
  else resolve()
477
477
  })