@midwayjs/tags 3.19.0 → 4.0.0-alpha.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.
@@ -14,7 +14,8 @@ let TagsConfiguration = class TagsConfiguration {
14
14
  await container.getAsync(manager_1.TagServiceFactory);
15
15
  }
16
16
  };
17
- TagsConfiguration = __decorate([
17
+ exports.TagsConfiguration = TagsConfiguration;
18
+ exports.TagsConfiguration = TagsConfiguration = __decorate([
18
19
  (0, core_1.Configuration)({
19
20
  namespace: 'tags',
20
21
  importConfigs: [
@@ -30,5 +31,4 @@ TagsConfiguration = __decorate([
30
31
  ],
31
32
  })
32
33
  ], TagsConfiguration);
33
- exports.TagsConfiguration = TagsConfiguration;
34
34
  //# sourceMappingURL=configuration.js.map
@@ -8,7 +8,7 @@ var MysqlTableName;
8
8
  (function (MysqlTableName) {
9
9
  MysqlTableName["Tag"] = "tag";
10
10
  MysqlTableName["Relationship"] = "relationship";
11
- })(MysqlTableName = exports.MysqlTableName || (exports.MysqlTableName = {}));
11
+ })(MysqlTableName || (exports.MysqlTableName = MysqlTableName = {}));
12
12
  class MysqlDialect {
13
13
  constructor(dialect) {
14
14
  this.name = 'tags';
@@ -210,9 +210,8 @@ class MysqlDialectInstance {
210
210
  return (0, utils_1.success)();
211
211
  }
212
212
  async unbind(unbindOptions) {
213
- var _a;
214
213
  let removeRelationshipSql = `delete from ${this.buildTableName(MysqlTableName.Relationship)} where oid = ${unbindOptions.objectId}`;
215
- if ((_a = unbindOptions.tags) === null || _a === void 0 ? void 0 : _a.length) {
214
+ if (unbindOptions.tags?.length) {
216
215
  const { ids } = await this.getTags(unbindOptions.tags);
217
216
  removeRelationshipSql += ` and tid in (${ids.join(',')})`;
218
217
  }
package/dist/error.js CHANGED
@@ -7,5 +7,5 @@ var TAG_ERROR;
7
7
  TAG_ERROR["NOT_EXISTS"] = "tag does not exist";
8
8
  TAG_ERROR["MISSING_PARAMETERS"] = "missing parameters";
9
9
  TAG_ERROR["OPER_ERROR"] = "operation error";
10
- })(TAG_ERROR = exports.TAG_ERROR || (exports.TAG_ERROR = {}));
10
+ })(TAG_ERROR || (exports.TAG_ERROR = TAG_ERROR = {}));
11
11
  //# sourceMappingURL=error.js.map
package/dist/interface.js CHANGED
@@ -13,5 +13,5 @@ var MATCH_TYPE;
13
13
  MATCH_TYPE["And"] = "and";
14
14
  // 并集
15
15
  MATCH_TYPE["Or"] = "or";
16
- })(MATCH_TYPE = exports.MATCH_TYPE || (exports.MATCH_TYPE = {}));
16
+ })(MATCH_TYPE || (exports.MATCH_TYPE = MATCH_TYPE = {}));
17
17
  //# sourceMappingURL=interface.js.map
package/dist/manager.js CHANGED
@@ -35,6 +35,7 @@ let TagServiceFactory = class TagServiceFactory extends core_1.ServiceFactory {
35
35
  return 'tags';
36
36
  }
37
37
  };
38
+ exports.TagServiceFactory = TagServiceFactory;
38
39
  __decorate([
39
40
  (0, core_1.Config)('tags'),
40
41
  __metadata("design:type", Object)
@@ -45,8 +46,7 @@ __decorate([
45
46
  __metadata("design:paramtypes", []),
46
47
  __metadata("design:returntype", Promise)
47
48
  ], TagServiceFactory.prototype, "init", null);
48
- TagServiceFactory = __decorate([
49
+ exports.TagServiceFactory = TagServiceFactory = __decorate([
49
50
  (0, core_1.Singleton)()
50
51
  ], TagServiceFactory);
51
- exports.TagServiceFactory = TagServiceFactory;
52
52
  //# sourceMappingURL=manager.js.map
package/dist/service.js CHANGED
@@ -40,8 +40,7 @@ class TagClient {
40
40
  });
41
41
  }
42
42
  async bind(bindOptions) {
43
- var _a;
44
- if (!((_a = bindOptions.tags) === null || _a === void 0 ? void 0 : _a.length)) {
43
+ if (!bindOptions.tags?.length) {
45
44
  return (0, utils_1.error)(error_1.TAG_ERROR.MISSING_PARAMETERS, { need: 'tags' });
46
45
  }
47
46
  return this.dialect.bind(bindOptions);
package/package.json CHANGED
@@ -1,13 +1,13 @@
1
1
  {
2
2
  "name": "@midwayjs/tags",
3
- "version": "3.19.0",
3
+ "version": "4.0.0-alpha.1",
4
4
  "description": "Midway Tag System",
5
5
  "main": "dist/index.js",
6
6
  "typings": "index.d.ts",
7
7
  "scripts": {
8
8
  "build": "tsc",
9
- "test": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand",
10
- "cov": "node --require=ts-node/register ../../node_modules/.bin/jest --runInBand --coverage --forceExit",
9
+ "test": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand",
10
+ "cov": "node -r ts-node/register ../../node_modules/jest/bin/jest.js --runInBand --coverage --forceExit",
11
11
  "ci": "npm run test"
12
12
  },
13
13
  "keywords": [],
@@ -22,14 +22,13 @@
22
22
  },
23
23
  "license": "MIT",
24
24
  "devDependencies": {
25
- "@midwayjs/core": "^3.19.0",
26
- "@midwayjs/express": "^3.19.0",
27
- "@midwayjs/faas": "^3.19.0",
28
- "@midwayjs/koa": "^3.19.0",
29
- "@midwayjs/mock": "^3.19.0",
30
- "@midwayjs/serverless-app": "^3.19.0",
31
- "@midwayjs/web": "^3.19.0",
25
+ "@midwayjs/core": "^4.0.0-alpha.1",
26
+ "@midwayjs/express": "^4.0.0-alpha.1",
27
+ "@midwayjs/faas": "^4.0.0-alpha.1",
28
+ "@midwayjs/koa": "^4.0.0-alpha.1",
29
+ "@midwayjs/mock": "^4.0.0-alpha.1",
30
+ "@midwayjs/web": "^4.0.0-alpha.1",
32
31
  "mysql2": "^3.0.0"
33
32
  },
34
- "gitHead": "437e92d9375b0e375f83aa363f3e6a60187c7109"
33
+ "gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
35
34
  }