@karibulab/wsdl2tsx 0.17.0 → 0.17.2
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/cli.js +183 -89
- package/package.json +2 -2
package/dist/cli.js
CHANGED
|
@@ -23769,7 +23769,8 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
|
|
|
23769
23769
|
let elementNamespace;
|
|
23770
23770
|
let elementTypeValue = null;
|
|
23771
23771
|
if (typeof element === "object" && element !== null) {
|
|
23772
|
-
|
|
23772
|
+
const originalElementNamespace = element.$namespace;
|
|
23773
|
+
elementNamespace = originalElementNamespace;
|
|
23773
23774
|
if ("type" in element && typeof element.type === "string") {
|
|
23774
23775
|
const referencedType = element.type;
|
|
23775
23776
|
debugContext("extractAllTagsForXmlBody", `Resolviendo tipo referenciado: "${referencedType}" para tag "${tagLocalName}"`);
|
|
@@ -23793,18 +23794,17 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
|
|
|
23793
23794
|
if (typeof referencedTypeObject === "object" && referencedTypeObject !== null) {
|
|
23794
23795
|
const refNamespace = referencedTypeObject[NAMESPACE_KEY];
|
|
23795
23796
|
if (refNamespace) {
|
|
23796
|
-
elementNamespace = refNamespace;
|
|
23797
23797
|
const refNamespacePrefix = extractNamespacePrefix(refNamespace);
|
|
23798
23798
|
if (!foundNamespaces.has(refNamespacePrefix)) {
|
|
23799
23799
|
foundNamespaces.set(refNamespacePrefix, refNamespace);
|
|
23800
|
-
debugContext("extractAllTagsForXmlBody", `Registrando namespace
|
|
23800
|
+
debugContext("extractAllTagsForXmlBody", `Registrando namespace del tipo referenciado: "${refNamespacePrefix}" -> "${refNamespace}"`);
|
|
23801
23801
|
}
|
|
23802
23802
|
}
|
|
23803
23803
|
if ("type" in referencedTypeObject && typeof referencedTypeObject.type === "object") {
|
|
23804
23804
|
elementTypeValue = referencedTypeObject.type;
|
|
23805
23805
|
}
|
|
23806
23806
|
}
|
|
23807
|
-
debugContext("extractAllTagsForXmlBody", `\u2713 Tipo referenciado resuelto para "${tagLocalName}"`);
|
|
23807
|
+
debugContext("extractAllTagsForXmlBody", `\u2713 Tipo referenciado resuelto para "${tagLocalName}" (elemento en namespace: "${elementNamespace || currentNamespace}", tipo en namespace: "${referencedTypeObject[NAMESPACE_KEY] || "N/A"}")`);
|
|
23808
23808
|
} else {
|
|
23809
23809
|
debugContext("extractAllTagsForXmlBody", `\u2717 Tipo referenciado no encontrado: "${referencedType}"`);
|
|
23810
23810
|
}
|
|
@@ -23818,12 +23818,14 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
|
|
|
23818
23818
|
foundNamespaces.set(namespacePrefix, namespace);
|
|
23819
23819
|
debugContext("extractAllTagsForXmlBody", `Registrando namespace del elemento: "${namespacePrefix}" -> "${namespace}"`);
|
|
23820
23820
|
}
|
|
23821
|
-
debugContext("extractAllTagsForXmlBody", `Agregando tag "${tagLocalName}" al namespace "${namespacePrefix}" (namespace: "${namespace}")`);
|
|
23821
|
+
debugContext("extractAllTagsForXmlBody", `Agregando tag "${tagLocalName}" al namespace "${namespacePrefix}" (namespace del elemento: "${namespace}")`);
|
|
23822
23822
|
result.push(tagLocalName);
|
|
23823
23823
|
if (!tagsByNamespace.has(namespace)) {
|
|
23824
23824
|
tagsByNamespace.set(namespace, []);
|
|
23825
23825
|
}
|
|
23826
|
-
tagsByNamespace.get(namespace).
|
|
23826
|
+
if (!tagsByNamespace.get(namespace).includes(tagLocalName)) {
|
|
23827
|
+
tagsByNamespace.get(namespace).push(tagLocalName);
|
|
23828
|
+
}
|
|
23827
23829
|
if (elementTypeValue && typeof elementTypeValue === "object" && elementTypeValue !== null) {
|
|
23828
23830
|
const nestedTypeObject = elementTypeValue;
|
|
23829
23831
|
const nestedNamespace = nestedTypeObject[NAMESPACE_KEY] || namespace;
|
|
@@ -23850,7 +23852,13 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
|
|
|
23850
23852
|
if (!tagsByNamespace.has(nsUri)) {
|
|
23851
23853
|
tagsByNamespace.set(nsUri, []);
|
|
23852
23854
|
}
|
|
23853
|
-
tagsByNamespace.get(nsUri)
|
|
23855
|
+
const existingTags = new Set(tagsByNamespace.get(nsUri));
|
|
23856
|
+
for (const tag of tags) {
|
|
23857
|
+
if (!existingTags.has(tag)) {
|
|
23858
|
+
tagsByNamespace.get(nsUri).push(tag);
|
|
23859
|
+
existingTags.add(tag);
|
|
23860
|
+
}
|
|
23861
|
+
}
|
|
23854
23862
|
}
|
|
23855
23863
|
}
|
|
23856
23864
|
}
|
|
@@ -23987,6 +23995,7 @@ function extractAllNamespaceMappings(baseTypeName, baseTypeObject, schemaObject,
|
|
|
23987
23995
|
tagsMapping[finalPrefix] = [];
|
|
23988
23996
|
}
|
|
23989
23997
|
}
|
|
23998
|
+
const allTagsAdded = /* @__PURE__ */ new Set();
|
|
23990
23999
|
for (const [nsUri, tags] of xmlBodyResult.tagsByNamespace) {
|
|
23991
24000
|
let finalPrefix;
|
|
23992
24001
|
for (const [p, u] of Object.entries(prefixesMapping)) {
|
|
@@ -24003,26 +24012,32 @@ function extractAllNamespaceMappings(baseTypeName, baseTypeObject, schemaObject,
|
|
|
24003
24012
|
tagsMapping[finalPrefix] = [];
|
|
24004
24013
|
}
|
|
24005
24014
|
const existingTags = new Set(tagsMapping[finalPrefix] || []);
|
|
24015
|
+
const tagsToAdd = [];
|
|
24006
24016
|
for (const tag of tags) {
|
|
24007
|
-
if (!existingTags.has(tag)) {
|
|
24008
|
-
|
|
24009
|
-
|
|
24017
|
+
if (!existingTags.has(tag) && !allTagsAdded.has(tag)) {
|
|
24018
|
+
tagsToAdd.push(tag);
|
|
24019
|
+
allTagsAdded.add(tag);
|
|
24010
24020
|
}
|
|
24011
24021
|
}
|
|
24012
|
-
|
|
24022
|
+
if (tagsToAdd.length > 0) {
|
|
24023
|
+
tagsMapping[finalPrefix].push(...tagsToAdd);
|
|
24024
|
+
debugContext("extractAllNamespaceMappings", `Agregando ${tagsToAdd.length} tag(s) al namespace "${finalPrefix}" (${nsUri}): ${tagsToAdd.join(", ")}`);
|
|
24025
|
+
}
|
|
24013
24026
|
}
|
|
24014
|
-
|
|
24027
|
+
const baseNamespaceTags = xmlBodyResult.tagsByNamespace.get(baseNamespace);
|
|
24028
|
+
if (baseNamespaceTags && baseNamespaceTags.length > 0) {
|
|
24015
24029
|
if (tagsMapping[baseNamespacePrefix] === void 0) {
|
|
24016
24030
|
tagsMapping[baseNamespacePrefix] = [];
|
|
24017
24031
|
prefixesMapping[baseNamespacePrefix] = baseNamespace;
|
|
24018
24032
|
}
|
|
24019
24033
|
const existingTags = new Set(tagsMapping[baseNamespacePrefix] || []);
|
|
24020
|
-
for (const tag of
|
|
24034
|
+
for (const tag of baseNamespaceTags) {
|
|
24021
24035
|
if (!existingTags.has(tag)) {
|
|
24022
24036
|
tagsMapping[baseNamespacePrefix].push(tag);
|
|
24023
24037
|
existingTags.add(tag);
|
|
24024
24038
|
}
|
|
24025
24039
|
}
|
|
24040
|
+
debugContext("extractAllNamespaceMappings", `Agregando ${baseNamespaceTags.length} tag(s) al namespace base "${baseNamespacePrefix}"`);
|
|
24026
24041
|
}
|
|
24027
24042
|
return {
|
|
24028
24043
|
tagsMapping,
|
|
@@ -24086,8 +24101,67 @@ function shouldHavePrefix(elementObject) {
|
|
|
24086
24101
|
return false;
|
|
24087
24102
|
}
|
|
24088
24103
|
|
|
24104
|
+
// src/codegen/xml-generator/type-resolution.ts
|
|
24105
|
+
function resolveReferencedType(typeValue, schemaObject, allComplexTypes) {
|
|
24106
|
+
let referencedElement = schemaObject?.[typeValue];
|
|
24107
|
+
if (!referencedElement && allComplexTypes) {
|
|
24108
|
+
referencedElement = allComplexTypes[typeValue];
|
|
24109
|
+
}
|
|
24110
|
+
if (!referencedElement && schemaObject) {
|
|
24111
|
+
const typeLocalName = typeValue.split(":").pop() || typeValue;
|
|
24112
|
+
const matchingKey = Object.keys(schemaObject).find((key) => {
|
|
24113
|
+
if (key === "$namespace" || key === "$qualified") return false;
|
|
24114
|
+
const keyLocalName = key.split(":").pop() || key;
|
|
24115
|
+
return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
|
|
24116
|
+
});
|
|
24117
|
+
if (matchingKey) {
|
|
24118
|
+
referencedElement = schemaObject[matchingKey];
|
|
24119
|
+
}
|
|
24120
|
+
}
|
|
24121
|
+
if (!referencedElement && allComplexTypes) {
|
|
24122
|
+
const typeLocalName = typeValue.split(":").pop() || typeValue;
|
|
24123
|
+
const matchingKey = Object.keys(allComplexTypes).find((key) => {
|
|
24124
|
+
const keyLocalName = key.split(":").pop() || key;
|
|
24125
|
+
return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
|
|
24126
|
+
});
|
|
24127
|
+
if (matchingKey) {
|
|
24128
|
+
referencedElement = allComplexTypes[matchingKey];
|
|
24129
|
+
}
|
|
24130
|
+
}
|
|
24131
|
+
return referencedElement;
|
|
24132
|
+
}
|
|
24133
|
+
function resolveNestedType(nestedTypeValue, schemaObject, allComplexTypes) {
|
|
24134
|
+
let nestedReferencedElement = schemaObject?.[nestedTypeValue];
|
|
24135
|
+
if (!nestedReferencedElement && allComplexTypes) {
|
|
24136
|
+
nestedReferencedElement = allComplexTypes[nestedTypeValue];
|
|
24137
|
+
}
|
|
24138
|
+
if (!nestedReferencedElement) {
|
|
24139
|
+
const nestedTypeLocalName = nestedTypeValue.split(":").pop() || nestedTypeValue;
|
|
24140
|
+
if (schemaObject) {
|
|
24141
|
+
const nestedMatchingKey = Object.keys(schemaObject).find((key) => {
|
|
24142
|
+
if (key === "$namespace" || key === "$qualified") return false;
|
|
24143
|
+
const keyLocalName = key.split(":").pop() || key;
|
|
24144
|
+
return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
|
|
24145
|
+
});
|
|
24146
|
+
if (nestedMatchingKey) {
|
|
24147
|
+
nestedReferencedElement = schemaObject[nestedMatchingKey];
|
|
24148
|
+
}
|
|
24149
|
+
}
|
|
24150
|
+
if (!nestedReferencedElement && allComplexTypes) {
|
|
24151
|
+
const nestedMatchingKey = Object.keys(allComplexTypes).find((key) => {
|
|
24152
|
+
const keyLocalName = key.split(":").pop() || key;
|
|
24153
|
+
return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
|
|
24154
|
+
});
|
|
24155
|
+
if (nestedMatchingKey) {
|
|
24156
|
+
nestedReferencedElement = allComplexTypes[nestedMatchingKey];
|
|
24157
|
+
}
|
|
24158
|
+
}
|
|
24159
|
+
}
|
|
24160
|
+
return nestedReferencedElement;
|
|
24161
|
+
}
|
|
24162
|
+
|
|
24089
24163
|
// src/codegen/xml-generator/xml-property.ts
|
|
24090
|
-
function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key, elementObject, parentKey = null, propertyPath = "", parentIsQualified = true, prefixesMapping) {
|
|
24164
|
+
function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key, elementObject, parentKey = null, propertyPath = "", parentIsQualified = true, prefixesMapping, schemaObject, allComplexTypes) {
|
|
24091
24165
|
const namespacePrefix = getNamespacePrefix(
|
|
24092
24166
|
namespacesTypeMapping,
|
|
24093
24167
|
baseNamespacePrefix,
|
|
@@ -24103,6 +24177,91 @@ function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key
|
|
|
24103
24177
|
const closeTag = isQualified ? `</${namespacePrefix}.${tagLocalName}>` : `</${tagLocalName}>`;
|
|
24104
24178
|
const isArray2 = typeof elementObject === "object" && elementObject !== null && "maxOccurs" in elementObject && elementObject.maxOccurs !== void 0 && elementObject.maxOccurs !== "1" && elementObject.maxOccurs !== DEFAULT_OCCURS;
|
|
24105
24179
|
const currentPropertyPath = propertyPath ? propertyPath.endsWith(`.${tagCamelCase}`) || propertyPath === tagCamelCase ? propertyPath : `${propertyPath}.${tagCamelCase}` : tagCamelCase;
|
|
24180
|
+
if (typeof elementObject === "object" && elementObject !== null && typeof elementObject.type === "string" && (schemaObject || allComplexTypes)) {
|
|
24181
|
+
const referencedType = elementObject.type;
|
|
24182
|
+
const referencedElement = resolveReferencedType(referencedType, schemaObject, allComplexTypes);
|
|
24183
|
+
if (referencedElement && typeof referencedElement === "object") {
|
|
24184
|
+
let finalReferencedElement = referencedElement;
|
|
24185
|
+
if ("type" in referencedElement && typeof referencedElement.type === "string") {
|
|
24186
|
+
const nestedReferencedElement = resolveNestedType(referencedElement.type, schemaObject, allComplexTypes);
|
|
24187
|
+
if (nestedReferencedElement && typeof nestedReferencedElement === "object") {
|
|
24188
|
+
finalReferencedElement = nestedReferencedElement;
|
|
24189
|
+
}
|
|
24190
|
+
}
|
|
24191
|
+
if ("type" in finalReferencedElement && typeof finalReferencedElement.type === "object" && finalReferencedElement.type !== null) {
|
|
24192
|
+
const keys = getFilteredKeys(finalReferencedElement.type);
|
|
24193
|
+
if (keys.length > 0) {
|
|
24194
|
+
let parentPropertyPath = "";
|
|
24195
|
+
if (propertyPath === tagCamelCase) {
|
|
24196
|
+
parentPropertyPath = "";
|
|
24197
|
+
} else if (propertyPath.endsWith(`.${tagCamelCase}`)) {
|
|
24198
|
+
parentPropertyPath = propertyPath.slice(0, -(tagCamelCase.length + 1));
|
|
24199
|
+
} else {
|
|
24200
|
+
parentPropertyPath = propertyPath;
|
|
24201
|
+
}
|
|
24202
|
+
const nestedProperties = keys.map((elementKey) => {
|
|
24203
|
+
const nestedElement = finalReferencedElement.type[elementKey];
|
|
24204
|
+
if (typeof nestedElement === "object" && nestedElement !== null) {
|
|
24205
|
+
const nestedKeyLocalName = extractLocalName(elementKey);
|
|
24206
|
+
const nestedKeyCamelCase = toCamelCase2(nestedKeyLocalName);
|
|
24207
|
+
const nestedPropertyPath = parentPropertyPath ? `${parentPropertyPath}.${nestedKeyCamelCase}` : nestedKeyCamelCase;
|
|
24208
|
+
return generateXmlPropertyCode(
|
|
24209
|
+
namespacesTypeMapping,
|
|
24210
|
+
baseNamespacePrefix,
|
|
24211
|
+
elementKey,
|
|
24212
|
+
nestedElement,
|
|
24213
|
+
key,
|
|
24214
|
+
nestedPropertyPath,
|
|
24215
|
+
isQualified,
|
|
24216
|
+
prefixesMapping,
|
|
24217
|
+
schemaObject,
|
|
24218
|
+
allComplexTypes
|
|
24219
|
+
);
|
|
24220
|
+
}
|
|
24221
|
+
return "";
|
|
24222
|
+
}).filter(Boolean).join("\n");
|
|
24223
|
+
return `${openTag}
|
|
24224
|
+
${nestedProperties}
|
|
24225
|
+
${closeTag}`;
|
|
24226
|
+
}
|
|
24227
|
+
}
|
|
24228
|
+
const referencedKeys = getFilteredKeys(finalReferencedElement);
|
|
24229
|
+
if (referencedKeys.length > 0) {
|
|
24230
|
+
let parentPropertyPath = "";
|
|
24231
|
+
if (propertyPath === tagCamelCase) {
|
|
24232
|
+
parentPropertyPath = "";
|
|
24233
|
+
} else if (propertyPath.endsWith(`.${tagCamelCase}`)) {
|
|
24234
|
+
parentPropertyPath = propertyPath.slice(0, -(tagCamelCase.length + 1));
|
|
24235
|
+
} else {
|
|
24236
|
+
parentPropertyPath = propertyPath;
|
|
24237
|
+
}
|
|
24238
|
+
const nestedProperties = referencedKeys.map((elementKey) => {
|
|
24239
|
+
const nestedElement = finalReferencedElement[elementKey];
|
|
24240
|
+
if (typeof nestedElement === "object" && nestedElement !== null) {
|
|
24241
|
+
const nestedKeyLocalName = extractLocalName(elementKey);
|
|
24242
|
+
const nestedKeyCamelCase = toCamelCase2(nestedKeyLocalName);
|
|
24243
|
+
const nestedPropertyPath = parentPropertyPath ? `${parentPropertyPath}.${nestedKeyCamelCase}` : nestedKeyCamelCase;
|
|
24244
|
+
return generateXmlPropertyCode(
|
|
24245
|
+
namespacesTypeMapping,
|
|
24246
|
+
baseNamespacePrefix,
|
|
24247
|
+
elementKey,
|
|
24248
|
+
nestedElement,
|
|
24249
|
+
key,
|
|
24250
|
+
nestedPropertyPath,
|
|
24251
|
+
isQualified,
|
|
24252
|
+
prefixesMapping,
|
|
24253
|
+
schemaObject,
|
|
24254
|
+
allComplexTypes
|
|
24255
|
+
);
|
|
24256
|
+
}
|
|
24257
|
+
return "";
|
|
24258
|
+
}).filter(Boolean).join("\n");
|
|
24259
|
+
return `${openTag}
|
|
24260
|
+
${nestedProperties}
|
|
24261
|
+
${closeTag}`;
|
|
24262
|
+
}
|
|
24263
|
+
}
|
|
24264
|
+
}
|
|
24106
24265
|
if (typeof elementObject === "object" && elementObject !== null && typeof elementObject.type === "object") {
|
|
24107
24266
|
const keys = getFilteredKeys(elementObject.type);
|
|
24108
24267
|
if (isArray2) {
|
|
@@ -24119,7 +24278,10 @@ function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key
|
|
|
24119
24278
|
key,
|
|
24120
24279
|
"item",
|
|
24121
24280
|
// Usar 'item' directamente en lugar de la ruta completa con índice
|
|
24122
|
-
isQualified
|
|
24281
|
+
isQualified,
|
|
24282
|
+
prefixesMapping,
|
|
24283
|
+
schemaObject,
|
|
24284
|
+
allComplexTypes
|
|
24123
24285
|
);
|
|
24124
24286
|
} else {
|
|
24125
24287
|
const nestedTagLocalName = extractLocalName(elementKey);
|
|
@@ -24161,7 +24323,9 @@ function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key
|
|
|
24161
24323
|
currentPropertyPath,
|
|
24162
24324
|
// Mantener el propertyPath completo (incluye propsInterfaceName si existe)
|
|
24163
24325
|
isQualified,
|
|
24164
|
-
prefixesMapping
|
|
24326
|
+
prefixesMapping,
|
|
24327
|
+
schemaObject,
|
|
24328
|
+
allComplexTypes
|
|
24165
24329
|
);
|
|
24166
24330
|
}
|
|
24167
24331
|
return "";
|
|
@@ -24174,65 +24338,6 @@ function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key
|
|
|
24174
24338
|
return `${openTag}{props.${currentPropertyPath}}${closeTag}`;
|
|
24175
24339
|
}
|
|
24176
24340
|
|
|
24177
|
-
// src/codegen/xml-generator/type-resolution.ts
|
|
24178
|
-
function resolveReferencedType(typeValue, schemaObject, allComplexTypes) {
|
|
24179
|
-
let referencedElement = schemaObject?.[typeValue];
|
|
24180
|
-
if (!referencedElement && allComplexTypes) {
|
|
24181
|
-
referencedElement = allComplexTypes[typeValue];
|
|
24182
|
-
}
|
|
24183
|
-
if (!referencedElement && schemaObject) {
|
|
24184
|
-
const typeLocalName = typeValue.split(":").pop() || typeValue;
|
|
24185
|
-
const matchingKey = Object.keys(schemaObject).find((key) => {
|
|
24186
|
-
if (key === "$namespace" || key === "$qualified") return false;
|
|
24187
|
-
const keyLocalName = key.split(":").pop() || key;
|
|
24188
|
-
return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
|
|
24189
|
-
});
|
|
24190
|
-
if (matchingKey) {
|
|
24191
|
-
referencedElement = schemaObject[matchingKey];
|
|
24192
|
-
}
|
|
24193
|
-
}
|
|
24194
|
-
if (!referencedElement && allComplexTypes) {
|
|
24195
|
-
const typeLocalName = typeValue.split(":").pop() || typeValue;
|
|
24196
|
-
const matchingKey = Object.keys(allComplexTypes).find((key) => {
|
|
24197
|
-
const keyLocalName = key.split(":").pop() || key;
|
|
24198
|
-
return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
|
|
24199
|
-
});
|
|
24200
|
-
if (matchingKey) {
|
|
24201
|
-
referencedElement = allComplexTypes[matchingKey];
|
|
24202
|
-
}
|
|
24203
|
-
}
|
|
24204
|
-
return referencedElement;
|
|
24205
|
-
}
|
|
24206
|
-
function resolveNestedType(nestedTypeValue, schemaObject, allComplexTypes) {
|
|
24207
|
-
let nestedReferencedElement = schemaObject?.[nestedTypeValue];
|
|
24208
|
-
if (!nestedReferencedElement && allComplexTypes) {
|
|
24209
|
-
nestedReferencedElement = allComplexTypes[nestedTypeValue];
|
|
24210
|
-
}
|
|
24211
|
-
if (!nestedReferencedElement) {
|
|
24212
|
-
const nestedTypeLocalName = nestedTypeValue.split(":").pop() || nestedTypeValue;
|
|
24213
|
-
if (schemaObject) {
|
|
24214
|
-
const nestedMatchingKey = Object.keys(schemaObject).find((key) => {
|
|
24215
|
-
if (key === "$namespace" || key === "$qualified") return false;
|
|
24216
|
-
const keyLocalName = key.split(":").pop() || key;
|
|
24217
|
-
return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
|
|
24218
|
-
});
|
|
24219
|
-
if (nestedMatchingKey) {
|
|
24220
|
-
nestedReferencedElement = schemaObject[nestedMatchingKey];
|
|
24221
|
-
}
|
|
24222
|
-
}
|
|
24223
|
-
if (!nestedReferencedElement && allComplexTypes) {
|
|
24224
|
-
const nestedMatchingKey = Object.keys(allComplexTypes).find((key) => {
|
|
24225
|
-
const keyLocalName = key.split(":").pop() || key;
|
|
24226
|
-
return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
|
|
24227
|
-
});
|
|
24228
|
-
if (nestedMatchingKey) {
|
|
24229
|
-
nestedReferencedElement = allComplexTypes[nestedMatchingKey];
|
|
24230
|
-
}
|
|
24231
|
-
}
|
|
24232
|
-
}
|
|
24233
|
-
return nestedReferencedElement;
|
|
24234
|
-
}
|
|
24235
|
-
|
|
24236
24341
|
// src/codegen/xml-generator/xml-body.ts
|
|
24237
24342
|
function generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, baseTypeObject, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping) {
|
|
24238
24343
|
const keys = getFilteredKeys(baseTypeObject);
|
|
@@ -24242,19 +24347,6 @@ function generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTyp
|
|
|
24242
24347
|
const element = baseTypeObject[singleKey];
|
|
24243
24348
|
if (typeof element === "object" && element !== null && "type" in element) {
|
|
24244
24349
|
const typeValue = element.type;
|
|
24245
|
-
if (typeof typeValue === "string" && (schemaObject || allComplexTypes)) {
|
|
24246
|
-
const referencedElement = resolveReferencedType(typeValue, schemaObject, allComplexTypes);
|
|
24247
|
-
if (referencedElement && typeof referencedElement === "object") {
|
|
24248
|
-
if ("type" in referencedElement && typeof referencedElement.type === "string") {
|
|
24249
|
-
const nestedTypeValue = referencedElement.type;
|
|
24250
|
-
const nestedReferencedElement = resolveNestedType(nestedTypeValue, schemaObject, allComplexTypes);
|
|
24251
|
-
if (nestedReferencedElement && typeof nestedReferencedElement === "object") {
|
|
24252
|
-
return generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, nestedReferencedElement, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping);
|
|
24253
|
-
}
|
|
24254
|
-
}
|
|
24255
|
-
return generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, referencedElement, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping);
|
|
24256
|
-
}
|
|
24257
|
-
}
|
|
24258
24350
|
if (typeof typeValue === "object" && typeValue !== null) {
|
|
24259
24351
|
const typeKeys = getFilteredKeys(typeValue);
|
|
24260
24352
|
if (typeKeys.length > 0) {
|
|
@@ -24278,7 +24370,9 @@ function generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTyp
|
|
|
24278
24370
|
propertyPath,
|
|
24279
24371
|
true,
|
|
24280
24372
|
// El padre (root element) siempre es qualified
|
|
24281
|
-
prefixesMapping
|
|
24373
|
+
prefixesMapping,
|
|
24374
|
+
schemaObject,
|
|
24375
|
+
allComplexTypes
|
|
24282
24376
|
);
|
|
24283
24377
|
}
|
|
24284
24378
|
return "";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@karibulab/wsdl2tsx",
|
|
3
|
-
"version": "0.17.
|
|
3
|
+
"version": "0.17.2",
|
|
4
4
|
"description": "Generador de código TSX desde archivos WSDL",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"bin": "./dist/cli.js",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"start": "node dist/cli.js"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@karibulab/wsdl2tsx-runtime": "0.17.
|
|
16
|
+
"@karibulab/wsdl2tsx-runtime": "0.17.2",
|
|
17
17
|
"axios": "^1.7.9",
|
|
18
18
|
"fast-xml-parser": "5.3.3",
|
|
19
19
|
"handlebars": "4.7.8"
|