@did-space/core 1.0.36 → 1.0.38

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.
@@ -101,6 +101,7 @@ class GlobalSpace {
101
101
  });
102
102
  }
103
103
  delete(hash) {
104
+ var _a;
104
105
  return __awaiter(this, void 0, void 0, function* () {
105
106
  const { error } = global_space_1.HashSchema.validate(hash);
106
107
  if (error) {
@@ -121,9 +122,11 @@ class GlobalSpace {
121
122
  yield this.objectCollectionRepository.destroy({ where: { id: hash } });
122
123
  return;
123
124
  }
125
+ yield ((_a = this.objectCollectionRepository.sequelize) === null || _a === void 0 ? void 0 : _a.transaction((t) => __awaiter(this, void 0, void 0, function* () {
126
+ yield this.objectRepository.destroy({ where: { id: hash }, transaction: t });
127
+ yield this.objectCollectionRepository.destroy({ where: { id: hash }, transaction: t });
128
+ })));
124
129
  yield this.driver.deleteAsOwner((0, utils_1.getHashPath)(hash), { useGlobal: true });
125
- yield this.objectRepository.destroy({ where: { id: hash } });
126
- yield this.objectCollectionRepository.destroy({ where: { id: hash } });
127
130
  debug('delete.after', { hash });
128
131
  });
129
132
  }
@@ -110,9 +110,11 @@ export class GlobalSpace {
110
110
  await this.objectCollectionRepository.destroy({ where: { id: hash } });
111
111
  return;
112
112
  }
113
+ await this.objectCollectionRepository.sequelize?.transaction(async (t) => {
114
+ await this.objectRepository.destroy({ where: { id: hash }, transaction: t });
115
+ await this.objectCollectionRepository.destroy({ where: { id: hash }, transaction: t });
116
+ });
113
117
  await this.driver.deleteAsOwner(getHashPath(hash), { useGlobal: true });
114
- await this.objectRepository.destroy({ where: { id: hash } });
115
- await this.objectCollectionRepository.destroy({ where: { id: hash } });
116
118
  debug('delete.after', { hash });
117
119
  }
118
120
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "1.0.36",
3
+ "version": "1.0.38",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -128,8 +128,8 @@
128
128
  "mime-types": "^2.1.35",
129
129
  "multiformats": "9",
130
130
  "p-all": "3.0.0",
131
- "sequelize": "^6.37.6",
132
- "validator": "^13.12.0",
131
+ "sequelize": "^6.37.7",
132
+ "validator": "^13.15.0",
133
133
  "xbytes": "^1.9.1",
134
134
  "zod": "^3.24.2"
135
135
  },
@@ -145,8 +145,8 @@
145
145
  "lint-staged": "^13.3.0",
146
146
  "ts-jest": "^28.0.8",
147
147
  "typescript": "^4.9.5",
148
- "vite": "^5.4.14",
148
+ "vite": "^5.4.15",
149
149
  "vitest": "^3.0.9"
150
150
  },
151
- "gitHead": "11f2a05606c5b165a48602cd5b1ef7171e37304b"
151
+ "gitHead": "94f2e33bd1107871b6adc83e683d1bc944057b46"
152
152
  }