@kaspernj/api-maker 1.0.270 → 1.0.272

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
@@ -16,7 +16,7 @@
16
16
  ]
17
17
  },
18
18
  "name": "@kaspernj/api-maker",
19
- "version": "1.0.270",
19
+ "version": "1.0.272",
20
20
  "type": "module",
21
21
  "description": "",
22
22
  "main": "index.js",
@@ -727,6 +727,14 @@ export default class BaseModel {
727
727
  this.relationships[BaseModel.snakeCase(relationshipName)] = model
728
728
  }
729
729
 
730
+ markForDestruction() {
731
+ this._markedForDestruction = true
732
+ }
733
+
734
+ markedForDestruction() {
735
+ return this._markedForDestruction
736
+ }
737
+
730
738
  uniqueKey () {
731
739
  if (!this.uniqueKeyValue) {
732
740
  const min = 5000000000000000
@@ -45,17 +45,22 @@ export default class CacheKeyGenerator {
45
45
  const md5 = new SparkMD5()
46
46
 
47
47
  for (const model of this.allModels) {
48
- md5.append("-model-")
48
+ md5.append("--model--")
49
49
  md5.append(model.modelClassData().name)
50
- md5.append("-unique-key-")
50
+ md5.append("--unique-key--")
51
51
  md5.append(model.id() || model.uniqueKey())
52
+
53
+ if (model.markedForDestruction()) {
54
+ md5.append("--marked-for-destruction--")
55
+ }
56
+
52
57
  md5.append("-attributes-")
53
58
 
54
59
  const attributes = model.attributes()
55
60
 
56
61
  for (const attributeName in attributes) {
57
62
  md5.append(attributeName)
58
- md5.append("-attribute-")
63
+ md5.append("--attribute--")
59
64
  md5.append(`${model.readAttributeUnderscore(attributeName)}`)
60
65
  }
61
66
  }