monastery 2.2.2 → 3.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 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.2",
5
+ "version": "3.0.0",
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",
@@ -33,8 +36,7 @@
33
36
  "@aws-sdk/s3-request-presigner": "3.549.0",
34
37
  "debug": "4.3.4",
35
38
  "file-type": "^16.5.4",
36
- "monk": "7.3.4",
37
- "mongodb": "^3.2.3",
39
+ "mongodb": "^5.9.2",
38
40
  "nanoid": "3.2.0",
39
41
  "validator": "13.7.0"
40
42
  },
@@ -49,8 +51,7 @@
49
51
  "supertest": "4.0.2"
50
52
  },
51
53
  "engines": {
52
- "node": ">=14",
53
- "npm": ">=6"
54
+ "node": ">=14"
54
55
  },
55
56
  "standard-version": {
56
57
  "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,
@@ -193,7 +193,7 @@ let plugin = module.exports = {
193
193
  return model._update(
194
194
  idquery,
195
195
  { '$set': prunedData },
196
- { 'multi': options.multi || options.create },
196
+ { 'multi': options.multi || options.create }
197
197
  )
198
198
 
199
199
  // If errors, remove inserted documents to prevent double ups when the user resaves.
@@ -361,7 +361,7 @@ let plugin = module.exports = {
361
361
  { Key: pre.image.path },
362
362
  { Key: `small/${key}.jpg` },
363
363
  { Key: `medium/${key}.jpg` },
364
- { Key: `large/${key}.jpg` },
364
+ { Key: `large/${key}.jpg` }
365
365
  )
366
366
  plugin.manager.info(
367
367
  `Removing '${pre.image.filename}' from '${pre.image.bucket}/${pre.image.path}'`
@@ -374,7 +374,7 @@ let plugin = module.exports = {
374
374
  await new Promise((resolve, reject) => {
375
375
  plugin.getS3Client().deleteObjects({
376
376
  Bucket: plugin.awsBucket,
377
- Delete: { Objects: unused }
377
+ Delete: { Objects: unused },
378
378
  }, (err, data) => {
379
379
  if (err) reject(err)
380
380
  resolve()
@@ -448,19 +448,19 @@ let plugin = module.exports = {
448
448
 
449
449
  if (file.truncated) reject({
450
450
  title: filesArr.inputPath + (i? `.${i}` : ''),
451
- detail: `The file size for '${file.nameClipped}' is too big.`
451
+ detail: `The file size for '${file.nameClipped}' is too big.`,
452
452
  })
453
453
  else if (filesize && filesize < file.size) reject({ // file.size == bytes
454
454
  title: filesArr.inputPath + (i? `.${i}` : ''),
455
- detail: `The file size for '${file.nameClipped}' is bigger than ${(filesize/1000/1000).toFixed(1)}MB.`
455
+ detail: `The file size for '${file.nameClipped}' is bigger than ${(filesize/1000/1000).toFixed(1)}MB.`,
456
456
  })
457
457
  else if (file.ext == 'unknown') reject({
458
458
  title: filesArr.inputPath + (i? `.${i}` : ''),
459
- detail: `Please add a file extension to your file '${file.nameClipped}'`
459
+ detail: `Please add a file extension to your file '${file.nameClipped}'`,
460
460
  })
461
461
  else if (!allowAny && !util.inArray(formats, file.ext)) reject({
462
462
  title: filesArr.inputPath + (i? `.${i}` : ''),
463
- detail: `The file format '${file.ext}' for '${file.nameClipped}' is not supported`
463
+ detail: `The file format '${file.ext}' for '${file.nameClipped}' is not supported`,
464
464
  })
465
465
  else resolve()
466
466
  })