ddm-plugin-dubbo-support 0.1.3 → 0.1.4
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/index.js +27 -27
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -661,7 +661,7 @@ class AppProxy {
|
|
|
661
661
|
/***/ ((module) => {
|
|
662
662
|
|
|
663
663
|
"use strict";
|
|
664
|
-
module.exports = /*#__PURE__*/JSON.parse('{"name":"ddm-plugin-dubbo-support","version":"0.1.
|
|
664
|
+
module.exports = /*#__PURE__*/JSON.parse('{"name":"ddm-plugin-dubbo-support","version":"0.1.4","description":"Dubbo-Desktop-Manager插件-支持Dubbo框架","main":"dist/index.js","rendererMain":"dist/renderer.js","i18nMain":"dist/i18n.js","files":["README.md","logo.png","public/**","dist/**","docs/**","java-invoke/**"],"scripts":{"dev":"webpack","gen:keywords":"node ./scripts/gen-keywords.js","prepublishOnly":"npm run gen:keywords","publish":"webpack && npm publish"},"keywords":["Dubbo-Desktop-Manager","ddm-plugin","ddm","dubbo","dubbo service invoke","dubbo manager","dubbo console","dubbo admin","-","-s","-su","-sup","-supp","-suppo","-suppor","-support","b","bb","bbo","bbo-","bbo-s","bbo-su","bbo-sup","bbo-supp","bbo-suppo","bbo-suppor","bbo-support","bo","bo-","bo-s","bo-su","bo-sup","bo-supp","bo-suppo","bo-suppor","bo-support","d","du","dub","dubb","dubbo-","dubbo-s","dubbo-su","dubbo-sup","dubbo-supp","dubbo-suppo","dubbo-suppor","dubbo-support","o","o-","o-s","o-su","o-sup","o-supp","o-suppo","o-suppor","o-support","or","ort","p","po","por","port","pp","ppo","ppor","pport","r","rt","s","su","sup","supp","suppo","suppor","support","t","u","ub","ubb","ubbo","ubbo-","ubbo-s","ubbo-su","ubbo-sup","ubbo-supp","ubbo-suppo","ubbo-suppor","ubbo-support","up","upp","uppo","uppor","upport"],"homepage":"https://github.com/ddm-plugin/ddm-plugin-dubbo-support","author":"qiaolin","license":"Apache 2.0","devDependencies":{"@babel/core":"^7.24.7","babel-cli":"^6.26.0","babel-loader":"^8.2.5","css-loader":"^6.11.0","js-yaml":"^4.1.0","json-bigint":"^1.0.0","moment":"^2.29.1","node-zookeeper-client":"^1.1.1","qs":"^6.11.0","style-loader":"^3.3.4","telnet-stream":"^1.0.5","urijs":"^1.19.11","vue":"^2.6.11","vue-loader":"15.11.1","vue-style-loader":"^4.1.3","vue-template-compiler":"^2.6.11","webpack":"^5.92.1","webpack-cli":"^5.1.4"},"engines":{"ddm":">=1.1.0 <3.0.0"}}');
|
|
665
665
|
|
|
666
666
|
/***/ }),
|
|
667
667
|
/* 16 */
|
|
@@ -48692,11 +48692,11 @@ class ParamGeneratorDubbo3 {
|
|
|
48692
48692
|
|
|
48693
48693
|
// 未找到方法
|
|
48694
48694
|
if (!method) {
|
|
48695
|
-
return
|
|
48695
|
+
return [];
|
|
48696
48696
|
}
|
|
48697
48697
|
const typeMap = this.typeListToTypeMap(mateData.types);
|
|
48698
48698
|
return method.parameterTypes.map(parameterType => {
|
|
48699
|
-
return this.generateObject(typeMap, typeMap[parameterType]);
|
|
48699
|
+
return this.generateObject(typeMap, [], typeMap[parameterType]);
|
|
48700
48700
|
});
|
|
48701
48701
|
}
|
|
48702
48702
|
typeListToTypeMap(types) {
|
|
@@ -48709,57 +48709,53 @@ class ParamGeneratorDubbo3 {
|
|
|
48709
48709
|
});
|
|
48710
48710
|
return typeMap;
|
|
48711
48711
|
}
|
|
48712
|
-
generateObject(typeMap, typeInfo) {
|
|
48712
|
+
generateObject(typeMap, parentTypes, typeInfo) {
|
|
48713
48713
|
// Map 类型
|
|
48714
48714
|
if (this.isMap(typeMap, typeInfo)) {
|
|
48715
|
-
return this.generateMapType(typeMap, typeInfo);
|
|
48715
|
+
return this.generateMapType(typeMap, parentTypes, typeInfo);
|
|
48716
48716
|
}
|
|
48717
48717
|
|
|
48718
48718
|
// 数组
|
|
48719
48719
|
if (this.isArray(typeMap, typeInfo)) {
|
|
48720
|
-
return this.generateArrayType(typeMap, typeInfo);
|
|
48720
|
+
return this.generateArrayType(typeMap, parentTypes, typeInfo);
|
|
48721
48721
|
}
|
|
48722
48722
|
|
|
48723
48723
|
// 集合
|
|
48724
48724
|
if (this.isCollection(typeMap, typeInfo)) {
|
|
48725
|
-
return this.generateCollectionType(typeMap, typeInfo);
|
|
48725
|
+
return this.generateCollectionType(typeMap, parentTypes, typeInfo);
|
|
48726
48726
|
}
|
|
48727
48727
|
|
|
48728
48728
|
// 对象类型
|
|
48729
48729
|
if (this.isComplexType(typeMap, typeInfo)) {
|
|
48730
|
-
return this.generateComplexType(typeMap, typeInfo);
|
|
48730
|
+
return this.generateComplexType(typeMap, parentTypes, typeInfo);
|
|
48731
48731
|
}
|
|
48732
48732
|
|
|
48733
48733
|
// 基本类型
|
|
48734
48734
|
return _ValueGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"].generate("", typeInfo.type);
|
|
48735
48735
|
}
|
|
48736
|
-
generateMapType(typeMap, typeInfo) {
|
|
48736
|
+
generateMapType(typeMap, parentTypes, typeInfo) {
|
|
48737
48737
|
const {
|
|
48738
48738
|
type
|
|
48739
48739
|
} = typeInfo;
|
|
48740
48740
|
let keyStartOffset = type.indexOf("<");
|
|
48741
|
-
let
|
|
48741
|
+
let commaOffset = type.indexOf(",");
|
|
48742
|
+
let valueEndOffset = type.lastIndexOf(">");
|
|
48742
48743
|
|
|
48743
48744
|
// 没有泛型
|
|
48744
|
-
if (keyStartOffset < 0 ||
|
|
48745
|
-
return {};
|
|
48746
|
-
}
|
|
48747
|
-
let valueStartOffset = type.indexOf(",");
|
|
48748
|
-
let valueEndOffset = type.indexOf(">");
|
|
48749
|
-
if (valueStartOffset < 0 || valueEndOffset < 0) {
|
|
48745
|
+
if (keyStartOffset < 0 || commaOffset < 0 || valueEndOffset < 0) {
|
|
48750
48746
|
return {};
|
|
48751
48747
|
}
|
|
48752
48748
|
|
|
48753
48749
|
// 解析key与value
|
|
48754
|
-
let keyType = type.substring(keyStartOffset + 1,
|
|
48755
|
-
let valueType = type.substring(
|
|
48750
|
+
let keyType = type.substring(keyStartOffset + 1, commaOffset);
|
|
48751
|
+
let valueType = type.substring(commaOffset + 1, valueEndOffset);
|
|
48756
48752
|
|
|
48757
48753
|
// 可能会有Map的key里面放对象,但这也没有办法了...
|
|
48758
48754
|
let data = {};
|
|
48759
|
-
data[keyType] = this.generateObject(typeMap, typeMap[valueType]);
|
|
48755
|
+
data[keyType] = this.generateObject(typeMap, parentTypes, typeMap[valueType]);
|
|
48760
48756
|
return data;
|
|
48761
48757
|
}
|
|
48762
|
-
generateCollectionType(typeMap, typeInfo) {
|
|
48758
|
+
generateCollectionType(typeMap, parentTypes, typeInfo) {
|
|
48763
48759
|
const {
|
|
48764
48760
|
type
|
|
48765
48761
|
} = typeInfo;
|
|
@@ -48771,30 +48767,34 @@ class ParamGeneratorDubbo3 {
|
|
|
48771
48767
|
}
|
|
48772
48768
|
|
|
48773
48769
|
// 子类型
|
|
48774
|
-
const subTypeInfo = typeMap[type.substring(startOffset + 1, type.
|
|
48770
|
+
const subTypeInfo = typeMap[type.substring(startOffset + 1, type.lastIndexOf(">"))];
|
|
48775
48771
|
|
|
48776
48772
|
// 子类型有可能不存在
|
|
48777
48773
|
if (!subTypeInfo) {
|
|
48778
48774
|
return [];
|
|
48779
48775
|
}
|
|
48780
|
-
return [this.generateObject(typeMap, subTypeInfo)];
|
|
48776
|
+
return [this.generateObject(typeMap, parentTypes, subTypeInfo)];
|
|
48781
48777
|
}
|
|
48782
|
-
generateArrayType(typeMap, typeInfo) {
|
|
48778
|
+
generateArrayType(typeMap, parentTypes, typeInfo) {
|
|
48783
48779
|
const {
|
|
48784
48780
|
type
|
|
48785
48781
|
} = typeInfo;
|
|
48786
48782
|
let offset = type.indexOf("[]");
|
|
48787
48783
|
let realType = type.substring(0, offset);
|
|
48788
|
-
return [this.generateObject(typeMap, typeMap[realType])];
|
|
48784
|
+
return [this.generateObject(typeMap, parentTypes, typeMap[realType])];
|
|
48789
48785
|
}
|
|
48790
|
-
generateComplexType(typeMap, typeInfo) {
|
|
48791
|
-
|
|
48786
|
+
generateComplexType(typeMap, parentTypes, typeInfo) {
|
|
48787
|
+
// 以下情况直接返回空对象
|
|
48788
|
+
// 1. 没有属性了
|
|
48789
|
+
// 2. 出现循环引用了
|
|
48790
|
+
if (typeInfo.properties == null || typeInfo.properties.length == 0 || parentTypes.includes(typeInfo.type)) {
|
|
48792
48791
|
return {};
|
|
48793
48792
|
}
|
|
48793
|
+
parentTypes = [...parentTypes, typeInfo.type];
|
|
48794
48794
|
let data = {};
|
|
48795
48795
|
for (let property in typeInfo.properties) {
|
|
48796
48796
|
const type = typeInfo.properties[property];
|
|
48797
|
-
data[property] = this.generateObject(typeMap, typeMap[type]);
|
|
48797
|
+
data[property] = this.generateObject(typeMap, parentTypes, typeMap[type]);
|
|
48798
48798
|
}
|
|
48799
48799
|
return data;
|
|
48800
48800
|
}
|