@did-space/core 1.0.32 → 1.0.33

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.
@@ -532,11 +532,6 @@ class ObjectSpace extends events_1.default {
532
532
  },
533
533
  };
534
534
  debug('deleteAsOwner.$whereForDeleteFolder', JSON.stringify(whereForDeleteFolder));
535
- yield this.options.objectCollectionRepository.sequelize.query(`INSERT OR REPLACE INTO ${this.options.objectCollectionRepository.tableName} (id, createdAt)
536
- SELECT distinct objectId, strftime('%Y-%m-%d %H:%M:%f +00:00',DATETIME('now'))
537
- FROM ${this.options.treeRepository.tableName} where spaceDid = '${this.options.spaceDid}' and type = ${model_1.TreeModelType.FILE} and key like '${key}%';`, {
538
- type: sequelize_1.QueryTypes.INSERT,
539
- });
540
535
  yield this.options.treeRepository.destroy({
541
536
  where: whereForDeleteFolder,
542
537
  });
@@ -554,8 +549,10 @@ class ObjectSpace extends events_1.default {
554
549
  if (!tree) {
555
550
  return;
556
551
  }
552
+ // @note: 此处使用硬删除
557
553
  yield this.options.treeRepository.destroy({
558
554
  where,
555
+ force: true,
559
556
  });
560
557
  yield this.globalSpace.mark(tree.objectId);
561
558
  }
@@ -1,5 +1,5 @@
1
1
  import Debug from 'debug';
2
- import { Op, QueryTypes } from 'sequelize';
2
+ import { Op } from 'sequelize';
3
3
  import jsYaml from 'js-yaml';
4
4
  import { basename, join } from 'path';
5
5
  import isEmpty from 'lodash/isEmpty';
@@ -491,11 +491,6 @@ export class ObjectSpace extends EventEmitter {
491
491
  },
492
492
  };
493
493
  debug('deleteAsOwner.$whereForDeleteFolder', JSON.stringify(whereForDeleteFolder));
494
- await this.options.objectCollectionRepository.sequelize.query(`INSERT OR REPLACE INTO ${this.options.objectCollectionRepository.tableName} (id, createdAt)
495
- SELECT distinct objectId, strftime('%Y-%m-%d %H:%M:%f +00:00',DATETIME('now'))
496
- FROM ${this.options.treeRepository.tableName} where spaceDid = '${this.options.spaceDid}' and type = ${TreeModelType.FILE} and key like '${key}%';`, {
497
- type: QueryTypes.INSERT,
498
- });
499
494
  await this.options.treeRepository.destroy({
500
495
  where: whereForDeleteFolder,
501
496
  });
@@ -513,8 +508,10 @@ export class ObjectSpace extends EventEmitter {
513
508
  if (!tree) {
514
509
  return;
515
510
  }
511
+ // @note: 此处使用硬删除
516
512
  await this.options.treeRepository.destroy({
517
513
  where,
514
+ force: true,
518
515
  });
519
516
  await this.globalSpace.mark(tree.objectId);
520
517
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@did-space/core",
3
- "version": "1.0.32",
3
+ "version": "1.0.33",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -148,5 +148,5 @@
148
148
  "vite": "^5.4.14",
149
149
  "vitest": "^3.0.8"
150
150
  },
151
- "gitHead": "70a727c4691ca2184fa81b1252bc76790bb4a97b"
151
+ "gitHead": "49e586cf7378def83202f979e2c889f549fbf12b"
152
152
  }