ddm-plugin-dubbo-support 0.1.1 → 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 +30 -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 */
|
|
@@ -4796,6 +4796,7 @@ class ZookeeperDataSource {
|
|
|
4796
4796
|
providerInfo.methods.forEach(method => {
|
|
4797
4797
|
methodList.push({
|
|
4798
4798
|
name: method,
|
|
4799
|
+
methodName: method,
|
|
4799
4800
|
parameterTypes: [],
|
|
4800
4801
|
defaultParameter: "[]",
|
|
4801
4802
|
returnType: null
|
|
@@ -48691,11 +48692,11 @@ class ParamGeneratorDubbo3 {
|
|
|
48691
48692
|
|
|
48692
48693
|
// 未找到方法
|
|
48693
48694
|
if (!method) {
|
|
48694
|
-
return
|
|
48695
|
+
return [];
|
|
48695
48696
|
}
|
|
48696
48697
|
const typeMap = this.typeListToTypeMap(mateData.types);
|
|
48697
48698
|
return method.parameterTypes.map(parameterType => {
|
|
48698
|
-
return this.generateObject(typeMap, typeMap[parameterType]);
|
|
48699
|
+
return this.generateObject(typeMap, [], typeMap[parameterType]);
|
|
48699
48700
|
});
|
|
48700
48701
|
}
|
|
48701
48702
|
typeListToTypeMap(types) {
|
|
@@ -48708,57 +48709,53 @@ class ParamGeneratorDubbo3 {
|
|
|
48708
48709
|
});
|
|
48709
48710
|
return typeMap;
|
|
48710
48711
|
}
|
|
48711
|
-
generateObject(typeMap, typeInfo) {
|
|
48712
|
+
generateObject(typeMap, parentTypes, typeInfo) {
|
|
48712
48713
|
// Map 类型
|
|
48713
48714
|
if (this.isMap(typeMap, typeInfo)) {
|
|
48714
|
-
return this.generateMapType(typeMap, typeInfo);
|
|
48715
|
+
return this.generateMapType(typeMap, parentTypes, typeInfo);
|
|
48715
48716
|
}
|
|
48716
48717
|
|
|
48717
48718
|
// 数组
|
|
48718
48719
|
if (this.isArray(typeMap, typeInfo)) {
|
|
48719
|
-
return this.generateArrayType(typeMap, typeInfo);
|
|
48720
|
+
return this.generateArrayType(typeMap, parentTypes, typeInfo);
|
|
48720
48721
|
}
|
|
48721
48722
|
|
|
48722
48723
|
// 集合
|
|
48723
48724
|
if (this.isCollection(typeMap, typeInfo)) {
|
|
48724
|
-
return this.generateCollectionType(typeMap, typeInfo);
|
|
48725
|
+
return this.generateCollectionType(typeMap, parentTypes, typeInfo);
|
|
48725
48726
|
}
|
|
48726
48727
|
|
|
48727
48728
|
// 对象类型
|
|
48728
48729
|
if (this.isComplexType(typeMap, typeInfo)) {
|
|
48729
|
-
return this.generateComplexType(typeMap, typeInfo);
|
|
48730
|
+
return this.generateComplexType(typeMap, parentTypes, typeInfo);
|
|
48730
48731
|
}
|
|
48731
48732
|
|
|
48732
48733
|
// 基本类型
|
|
48733
48734
|
return _ValueGenerator_js__WEBPACK_IMPORTED_MODULE_0__["default"].generate("", typeInfo.type);
|
|
48734
48735
|
}
|
|
48735
|
-
generateMapType(typeMap, typeInfo) {
|
|
48736
|
+
generateMapType(typeMap, parentTypes, typeInfo) {
|
|
48736
48737
|
const {
|
|
48737
48738
|
type
|
|
48738
48739
|
} = typeInfo;
|
|
48739
48740
|
let keyStartOffset = type.indexOf("<");
|
|
48740
|
-
let
|
|
48741
|
+
let commaOffset = type.indexOf(",");
|
|
48742
|
+
let valueEndOffset = type.lastIndexOf(">");
|
|
48741
48743
|
|
|
48742
48744
|
// 没有泛型
|
|
48743
|
-
if (keyStartOffset < 0 ||
|
|
48744
|
-
return {};
|
|
48745
|
-
}
|
|
48746
|
-
let valueStartOffset = type.indexOf(",");
|
|
48747
|
-
let valueEndOffset = type.indexOf(">");
|
|
48748
|
-
if (valueStartOffset < 0 || valueEndOffset < 0) {
|
|
48745
|
+
if (keyStartOffset < 0 || commaOffset < 0 || valueEndOffset < 0) {
|
|
48749
48746
|
return {};
|
|
48750
48747
|
}
|
|
48751
48748
|
|
|
48752
48749
|
// 解析key与value
|
|
48753
|
-
let keyType = type.substring(keyStartOffset + 1,
|
|
48754
|
-
let valueType = type.substring(
|
|
48750
|
+
let keyType = type.substring(keyStartOffset + 1, commaOffset);
|
|
48751
|
+
let valueType = type.substring(commaOffset + 1, valueEndOffset);
|
|
48755
48752
|
|
|
48756
48753
|
// 可能会有Map的key里面放对象,但这也没有办法了...
|
|
48757
48754
|
let data = {};
|
|
48758
|
-
data[keyType] = this.generateObject(typeMap, typeMap[valueType]);
|
|
48755
|
+
data[keyType] = this.generateObject(typeMap, parentTypes, typeMap[valueType]);
|
|
48759
48756
|
return data;
|
|
48760
48757
|
}
|
|
48761
|
-
generateCollectionType(typeMap, typeInfo) {
|
|
48758
|
+
generateCollectionType(typeMap, parentTypes, typeInfo) {
|
|
48762
48759
|
const {
|
|
48763
48760
|
type
|
|
48764
48761
|
} = typeInfo;
|
|
@@ -48770,30 +48767,34 @@ class ParamGeneratorDubbo3 {
|
|
|
48770
48767
|
}
|
|
48771
48768
|
|
|
48772
48769
|
// 子类型
|
|
48773
|
-
const subTypeInfo = typeMap[type.substring(startOffset + 1, type.
|
|
48770
|
+
const subTypeInfo = typeMap[type.substring(startOffset + 1, type.lastIndexOf(">"))];
|
|
48774
48771
|
|
|
48775
48772
|
// 子类型有可能不存在
|
|
48776
48773
|
if (!subTypeInfo) {
|
|
48777
48774
|
return [];
|
|
48778
48775
|
}
|
|
48779
|
-
return [this.generateObject(typeMap, subTypeInfo)];
|
|
48776
|
+
return [this.generateObject(typeMap, parentTypes, subTypeInfo)];
|
|
48780
48777
|
}
|
|
48781
|
-
generateArrayType(typeMap, typeInfo) {
|
|
48778
|
+
generateArrayType(typeMap, parentTypes, typeInfo) {
|
|
48782
48779
|
const {
|
|
48783
48780
|
type
|
|
48784
48781
|
} = typeInfo;
|
|
48785
48782
|
let offset = type.indexOf("[]");
|
|
48786
48783
|
let realType = type.substring(0, offset);
|
|
48787
|
-
return [this.generateObject(typeMap, typeMap[realType])];
|
|
48784
|
+
return [this.generateObject(typeMap, parentTypes, typeMap[realType])];
|
|
48788
48785
|
}
|
|
48789
|
-
generateComplexType(typeMap, typeInfo) {
|
|
48790
|
-
|
|
48786
|
+
generateComplexType(typeMap, parentTypes, typeInfo) {
|
|
48787
|
+
// 以下情况直接返回空对象
|
|
48788
|
+
// 1. 没有属性了
|
|
48789
|
+
// 2. 出现循环引用了
|
|
48790
|
+
if (typeInfo.properties == null || typeInfo.properties.length == 0 || parentTypes.includes(typeInfo.type)) {
|
|
48791
48791
|
return {};
|
|
48792
48792
|
}
|
|
48793
|
+
parentTypes = [...parentTypes, typeInfo.type];
|
|
48793
48794
|
let data = {};
|
|
48794
48795
|
for (let property in typeInfo.properties) {
|
|
48795
48796
|
const type = typeInfo.properties[property];
|
|
48796
|
-
data[property] = this.generateObject(typeMap, typeMap[type]);
|
|
48797
|
+
data[property] = this.generateObject(typeMap, parentTypes, typeMap[type]);
|
|
48797
48798
|
}
|
|
48798
48799
|
return data;
|
|
48799
48800
|
}
|
|
@@ -48956,6 +48957,7 @@ class NacosDataSource {
|
|
|
48956
48957
|
providerInfo.methods.forEach(method => {
|
|
48957
48958
|
methodList.push({
|
|
48958
48959
|
name: method,
|
|
48960
|
+
methodName: method,
|
|
48959
48961
|
parameterTypes: null,
|
|
48960
48962
|
defaultParameter: "[]",
|
|
48961
48963
|
returnType: null
|
|
@@ -51773,6 +51775,7 @@ class DubboAdminDataSource {
|
|
|
51773
51775
|
providerInfo.methods.forEach(method => {
|
|
51774
51776
|
methodList.push({
|
|
51775
51777
|
name: method,
|
|
51778
|
+
methodName: method,
|
|
51776
51779
|
parameterTypes: null,
|
|
51777
51780
|
defaultParameter: "[]",
|
|
51778
51781
|
returnType: null
|