@midwayjs/tags 3.19.2 → 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.
- package/dist/configuration.js +2 -2
- package/dist/dialect/mysql.js +2 -3
- package/dist/error.js +1 -1
- package/dist/interface.js +1 -1
- package/dist/manager.js +2 -2
- package/dist/service.js +1 -2
- package/package.json +10 -11
package/dist/configuration.js
CHANGED
|
@@ -14,7 +14,8 @@ let TagsConfiguration = class TagsConfiguration {
|
|
|
14
14
|
await container.getAsync(manager_1.TagServiceFactory);
|
|
15
15
|
}
|
|
16
16
|
};
|
|
17
|
-
TagsConfiguration =
|
|
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
|
package/dist/dialect/mysql.js
CHANGED
|
@@ -8,7 +8,7 @@ var MysqlTableName;
|
|
|
8
8
|
(function (MysqlTableName) {
|
|
9
9
|
MysqlTableName["Tag"] = "tag";
|
|
10
10
|
MysqlTableName["Relationship"] = "relationship";
|
|
11
|
-
})(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 (
|
|
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
|
|
10
|
+
})(TAG_ERROR || (exports.TAG_ERROR = TAG_ERROR = {}));
|
|
11
11
|
//# sourceMappingURL=error.js.map
|
package/dist/interface.js
CHANGED
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
|
-
|
|
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
|
+
"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
|
|
10
|
-
"cov": "node
|
|
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": "^
|
|
26
|
-
"@midwayjs/express": "^
|
|
27
|
-
"@midwayjs/faas": "^
|
|
28
|
-
"@midwayjs/koa": "^
|
|
29
|
-
"@midwayjs/mock": "^
|
|
30
|
-
"@midwayjs/
|
|
31
|
-
"@midwayjs/web": "^3.19.2",
|
|
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": "
|
|
33
|
+
"gitHead": "14bb4da91805a1cf52f190c0d37a74b395dd6372"
|
|
35
34
|
}
|