@karibulab/wsdl2tsx 0.17.0 → 0.20.0

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.
Files changed (2) hide show
  1. package/dist/cli.js +515 -251
  2. package/package.json +2 -2
package/dist/cli.js CHANGED
@@ -23589,13 +23589,34 @@ Schema [${i}] (targetNamespace: ${schemaNode.targetNamespace || "no definido"}):
23589
23589
  // src/generator/soap-namespace.ts
23590
23590
  var SOAP12_ENVELOPE_URI = "http://www.w3.org/2003/05/soap-envelope";
23591
23591
  var SOAP11_ENVELOPE_URI = "http://schemas.xmlsoap.org/soap/envelope/";
23592
+ var SOAP12_BINDING_URI = "http://schemas.xmlsoap.org/wsdl/soap12/";
23593
+ var SOAP11_BINDING_URI = "http://schemas.xmlsoap.org/wsdl/soap/";
23592
23594
  function getSoapNamespaceURI(definitionsNamespaces) {
23595
+ for (const uri2 of definitionsNamespaces.values()) {
23596
+ if (uri2 === SOAP12_ENVELOPE_URI) {
23597
+ return SOAP12_ENVELOPE_URI;
23598
+ }
23599
+ if (uri2 === SOAP11_ENVELOPE_URI) {
23600
+ return SOAP11_ENVELOPE_URI;
23601
+ }
23602
+ }
23603
+ for (const uri2 of definitionsNamespaces.values()) {
23604
+ if (uri2 === SOAP12_BINDING_URI || uri2.includes("wsdl/soap12") || uri2.endsWith("soap12/")) {
23605
+ return SOAP12_ENVELOPE_URI;
23606
+ }
23607
+ if (uri2 === SOAP11_BINDING_URI || uri2.includes("wsdl/soap") && !uri2.includes("soap12")) {
23608
+ return SOAP11_ENVELOPE_URI;
23609
+ }
23610
+ }
23593
23611
  const soapEntry = Array.from(definitionsNamespaces.entries()).find((entry) => entry[1].includes("soap"));
23594
23612
  if (!soapEntry) {
23595
23613
  return SOAP11_ENVELOPE_URI;
23596
23614
  }
23597
- const lastPart = soapEntry[1].split("/").slice(-1)[0];
23598
- return lastPart === "soap12" ? SOAP12_ENVELOPE_URI : SOAP11_ENVELOPE_URI;
23615
+ const uri = soapEntry[1];
23616
+ if (uri.includes("soap12") || uri.includes("2003/05/soap-envelope")) {
23617
+ return SOAP12_ENVELOPE_URI;
23618
+ }
23619
+ return SOAP11_ENVELOPE_URI;
23599
23620
  }
23600
23621
 
23601
23622
  // src/codegen/constants.ts
@@ -23769,23 +23790,28 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
23769
23790
  let elementNamespace;
23770
23791
  let elementTypeValue = null;
23771
23792
  if (typeof element === "object" && element !== null) {
23772
- elementNamespace = element.$namespace;
23793
+ const originalElementNamespace = element.$namespace;
23794
+ elementNamespace = originalElementNamespace;
23773
23795
  if ("type" in element && typeof element.type === "string") {
23774
23796
  const referencedType = element.type;
23775
23797
  debugContext("extractAllTagsForXmlBody", `Resolviendo tipo referenciado: "${referencedType}" para tag "${tagLocalName}"`);
23776
23798
  let referencedTypeObject = schemaObject?.[referencedType] || allComplexTypes?.[referencedType];
23777
- if (!referencedTypeObject) {
23799
+ let foundKey;
23800
+ if (referencedTypeObject) {
23801
+ foundKey = referencedType;
23802
+ } else {
23778
23803
  const referencedLocalName = referencedType.split(":").pop() || referencedType;
23779
- const matchingKey = Object.keys(schemaObject || {}).find((k) => {
23804
+ foundKey = Object.keys(schemaObject || {}).find((k) => {
23805
+ if (k === "$namespace" || k === "$qualified") return false;
23780
23806
  const kLocalName = k.split(":").pop();
23781
23807
  return kLocalName === referencedLocalName;
23782
23808
  }) || Object.keys(allComplexTypes || {}).find((k) => {
23783
23809
  const kLocalName = k.split(":").pop();
23784
23810
  return kLocalName === referencedLocalName;
23785
23811
  });
23786
- if (matchingKey) {
23787
- referencedTypeObject = schemaObject?.[matchingKey] || allComplexTypes?.[matchingKey];
23788
- debugContext("extractAllTagsForXmlBody", `Tipo referenciado encontrado por nombre local: "${matchingKey}"`);
23812
+ if (foundKey) {
23813
+ referencedTypeObject = schemaObject?.[foundKey] || allComplexTypes?.[foundKey];
23814
+ debugContext("extractAllTagsForXmlBody", `Tipo referenciado encontrado por nombre local: "${foundKey}"`);
23789
23815
  }
23790
23816
  }
23791
23817
  if (referencedTypeObject) {
@@ -23793,18 +23819,39 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
23793
23819
  if (typeof referencedTypeObject === "object" && referencedTypeObject !== null) {
23794
23820
  const refNamespace = referencedTypeObject[NAMESPACE_KEY];
23795
23821
  if (refNamespace) {
23796
- elementNamespace = refNamespace;
23797
23822
  const refNamespacePrefix = extractNamespacePrefix(refNamespace);
23798
23823
  if (!foundNamespaces.has(refNamespacePrefix)) {
23799
23824
  foundNamespaces.set(refNamespacePrefix, refNamespace);
23800
- debugContext("extractAllTagsForXmlBody", `Registrando namespace adicional: "${refNamespacePrefix}" -> "${refNamespace}"`);
23825
+ debugContext("extractAllTagsForXmlBody", `Registrando namespace del tipo referenciado: "${refNamespacePrefix}" -> "${refNamespace}"`);
23801
23826
  }
23802
23827
  }
23803
- if ("type" in referencedTypeObject && typeof referencedTypeObject.type === "object") {
23804
- elementTypeValue = referencedTypeObject.type;
23828
+ }
23829
+ let referencedElementNamespace;
23830
+ if (foundKey && foundKey.includes(":")) {
23831
+ const [nsPart] = foundKey.split(":");
23832
+ if (nsPart.startsWith("http://") || nsPart.startsWith("https://")) {
23833
+ referencedElementNamespace = nsPart;
23834
+ debugContext("extractAllTagsForXmlBody", `Namespace del elemento referenciado obtenido de la clave "${foundKey}": "${referencedElementNamespace}"`);
23835
+ }
23836
+ }
23837
+ if (!referencedElementNamespace && referencedTypeObject && typeof referencedTypeObject === "object") {
23838
+ const refNamespace = referencedTypeObject[NAMESPACE_KEY];
23839
+ if (refNamespace && typeof refNamespace === "string") {
23840
+ referencedElementNamespace = refNamespace;
23841
+ debugContext("extractAllTagsForXmlBody", `Namespace del elemento referenciado obtenido del $namespace del objeto: "${referencedElementNamespace}"`);
23805
23842
  }
23806
23843
  }
23807
- debugContext("extractAllTagsForXmlBody", `\u2713 Tipo referenciado resuelto para "${tagLocalName}"`);
23844
+ if (referencedTypeObject && typeof referencedTypeObject === "object" && "type" in referencedTypeObject && typeof referencedTypeObject.type === "object") {
23845
+ elementTypeValue = referencedTypeObject.type;
23846
+ if (referencedElementNamespace) {
23847
+ elementTypeValue._referencedElementNamespace = referencedElementNamespace;
23848
+ }
23849
+ }
23850
+ if (referencedElementNamespace) {
23851
+ referencedTypeObject._referencedElementNamespace = referencedElementNamespace;
23852
+ debugContext("extractAllTagsForXmlBody", `Namespace del elemento referenciado "${tagLocalName}" guardado: "${referencedElementNamespace}"`);
23853
+ }
23854
+ debugContext("extractAllTagsForXmlBody", `\u2713 Tipo referenciado resuelto para "${tagLocalName}" (elemento en namespace: "${elementNamespace || currentNamespace}", tipo en namespace: "${referencedTypeObject[NAMESPACE_KEY] || "N/A"}")`);
23808
23855
  } else {
23809
23856
  debugContext("extractAllTagsForXmlBody", `\u2717 Tipo referenciado no encontrado: "${referencedType}"`);
23810
23857
  }
@@ -23812,7 +23859,21 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
23812
23859
  elementTypeValue = element.type;
23813
23860
  }
23814
23861
  }
23815
- const namespace = elementNamespace || currentNamespace;
23862
+ let tagNamespace = elementNamespace || currentNamespace;
23863
+ if (elementTypeValue && typeof elementTypeValue === "object" && elementTypeValue !== null) {
23864
+ const referencedElementNamespace = elementTypeValue._referencedElementNamespace;
23865
+ if (referencedElementNamespace && typeof referencedElementNamespace === "string") {
23866
+ tagNamespace = referencedElementNamespace;
23867
+ debugContext("extractAllTagsForXmlBody", `Tag "${tagLocalName}" pertenece al namespace del elemento referenciado: "${tagNamespace}"`);
23868
+ } else {
23869
+ const referencedTypeNamespace = elementTypeValue[NAMESPACE_KEY];
23870
+ if (referencedTypeNamespace && typeof referencedTypeNamespace === "string") {
23871
+ tagNamespace = referencedTypeNamespace;
23872
+ debugContext("extractAllTagsForXmlBody", `Tag "${tagLocalName}" pertenece al namespace del tipo referenciado: "${tagNamespace}"`);
23873
+ }
23874
+ }
23875
+ }
23876
+ const namespace = tagNamespace;
23816
23877
  const namespacePrefix = extractNamespacePrefix(namespace);
23817
23878
  if (namespace !== currentNamespace && !foundNamespaces.has(namespacePrefix)) {
23818
23879
  foundNamespaces.set(namespacePrefix, namespace);
@@ -23823,7 +23884,9 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
23823
23884
  if (!tagsByNamespace.has(namespace)) {
23824
23885
  tagsByNamespace.set(namespace, []);
23825
23886
  }
23826
- tagsByNamespace.get(namespace).push(tagLocalName);
23887
+ if (!tagsByNamespace.get(namespace).includes(tagLocalName)) {
23888
+ tagsByNamespace.get(namespace).push(tagLocalName);
23889
+ }
23827
23890
  if (elementTypeValue && typeof elementTypeValue === "object" && elementTypeValue !== null) {
23828
23891
  const nestedTypeObject = elementTypeValue;
23829
23892
  const nestedNamespace = nestedTypeObject[NAMESPACE_KEY] || namespace;
@@ -23850,7 +23913,13 @@ function extractAllTagsForXmlBody(typeObject, namespacesTypeMapping, baseNamespa
23850
23913
  if (!tagsByNamespace.has(nsUri)) {
23851
23914
  tagsByNamespace.set(nsUri, []);
23852
23915
  }
23853
- tagsByNamespace.get(nsUri).push(...tags);
23916
+ const existingTags = new Set(tagsByNamespace.get(nsUri));
23917
+ for (const tag of tags) {
23918
+ if (!existingTags.has(tag)) {
23919
+ tagsByNamespace.get(nsUri).push(tag);
23920
+ existingTags.add(tag);
23921
+ }
23922
+ }
23854
23923
  }
23855
23924
  }
23856
23925
  }
@@ -23891,6 +23960,358 @@ function flattenKeysWithNamespace(typeObject, currentNamespace, currentNamespace
23891
23960
  return result;
23892
23961
  }
23893
23962
 
23963
+ // src/codegen/xml-generator/type-resolution.ts
23964
+ function resolveReferencedType(typeValue, schemaObject, allComplexTypes) {
23965
+ let referencedElement = schemaObject?.[typeValue];
23966
+ if (!referencedElement && allComplexTypes) {
23967
+ referencedElement = allComplexTypes[typeValue];
23968
+ }
23969
+ if (!referencedElement && schemaObject) {
23970
+ const typeLocalName = typeValue.split(":").pop() || typeValue;
23971
+ const matchingKey = Object.keys(schemaObject).find((key) => {
23972
+ if (key === "$namespace" || key === "$qualified") return false;
23973
+ const keyLocalName = key.split(":").pop() || key;
23974
+ return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
23975
+ });
23976
+ if (matchingKey) {
23977
+ referencedElement = schemaObject[matchingKey];
23978
+ }
23979
+ }
23980
+ if (!referencedElement && allComplexTypes) {
23981
+ const typeLocalName = typeValue.split(":").pop() || typeValue;
23982
+ const matchingKey = Object.keys(allComplexTypes).find((key) => {
23983
+ const keyLocalName = key.split(":").pop() || key;
23984
+ return keyLocalName === typeLocalName || key === typeValue || key.endsWith(`:${typeLocalName}`) || typeValue.endsWith(keyLocalName);
23985
+ });
23986
+ if (matchingKey) {
23987
+ referencedElement = allComplexTypes[matchingKey];
23988
+ }
23989
+ }
23990
+ return referencedElement;
23991
+ }
23992
+ function resolveNestedType(nestedTypeValue, schemaObject, allComplexTypes) {
23993
+ let nestedReferencedElement = schemaObject?.[nestedTypeValue];
23994
+ if (!nestedReferencedElement && allComplexTypes) {
23995
+ nestedReferencedElement = allComplexTypes[nestedTypeValue];
23996
+ }
23997
+ if (!nestedReferencedElement) {
23998
+ const nestedTypeLocalName = nestedTypeValue.split(":").pop() || nestedTypeValue;
23999
+ if (schemaObject) {
24000
+ const nestedMatchingKey = Object.keys(schemaObject).find((key) => {
24001
+ if (key === "$namespace" || key === "$qualified") return false;
24002
+ const keyLocalName = key.split(":").pop() || key;
24003
+ return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
24004
+ });
24005
+ if (nestedMatchingKey) {
24006
+ nestedReferencedElement = schemaObject[nestedMatchingKey];
24007
+ }
24008
+ }
24009
+ if (!nestedReferencedElement && allComplexTypes) {
24010
+ const nestedMatchingKey = Object.keys(allComplexTypes).find((key) => {
24011
+ const keyLocalName = key.split(":").pop() || key;
24012
+ return keyLocalName === nestedTypeLocalName || key === nestedTypeValue || key.endsWith(`:${nestedTypeLocalName}`) || nestedTypeValue.endsWith(keyLocalName);
24013
+ });
24014
+ if (nestedMatchingKey) {
24015
+ nestedReferencedElement = allComplexTypes[nestedMatchingKey];
24016
+ }
24017
+ }
24018
+ }
24019
+ return nestedReferencedElement;
24020
+ }
24021
+
24022
+ // src/codegen/xml-generator/xml-property.ts
24023
+ function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key, elementObject, parentKey = null, propertyPath = "", parentIsQualified = true, prefixesMapping, schemaObject, allComplexTypes, tagUsageCollector) {
24024
+ const namespacePrefix = getNamespacePrefix(
24025
+ namespacesTypeMapping,
24026
+ baseNamespacePrefix,
24027
+ key,
24028
+ parentKey,
24029
+ elementObject,
24030
+ prefixesMapping
24031
+ );
24032
+ const tagLocalName = extractLocalName(key);
24033
+ const tagCamelCase = toCamelCase2(tagLocalName);
24034
+ const isQualified = shouldHavePrefix(elementObject);
24035
+ const openTag = isQualified ? `<${namespacePrefix}.${tagLocalName}>` : `<${tagLocalName}>`;
24036
+ const closeTag = isQualified ? `</${namespacePrefix}.${tagLocalName}>` : `</${tagLocalName}>`;
24037
+ if (tagUsageCollector && isQualified) {
24038
+ tagUsageCollector.tagToPrefix.set(tagLocalName, namespacePrefix);
24039
+ if (prefixesMapping && prefixesMapping[namespacePrefix]) {
24040
+ tagUsageCollector.prefixToNamespace.set(namespacePrefix, prefixesMapping[namespacePrefix]);
24041
+ }
24042
+ }
24043
+ const isArray2 = typeof elementObject === "object" && elementObject !== null && "maxOccurs" in elementObject && elementObject.maxOccurs !== void 0 && elementObject.maxOccurs !== "1" && elementObject.maxOccurs !== DEFAULT_OCCURS;
24044
+ const currentPropertyPath = propertyPath ? propertyPath.endsWith(`.${tagCamelCase}`) || propertyPath === tagCamelCase ? propertyPath : `${propertyPath}.${tagCamelCase}` : tagCamelCase;
24045
+ if (typeof elementObject === "object" && elementObject !== null && typeof elementObject.type === "string" && (schemaObject || allComplexTypes)) {
24046
+ const referencedType = elementObject.type;
24047
+ const referencedElement = resolveReferencedType(referencedType, schemaObject, allComplexTypes);
24048
+ if (referencedElement && typeof referencedElement === "object") {
24049
+ let referencedElementNamespace = referencedElement.$namespace;
24050
+ if (typeof referencedElementNamespace !== "string") {
24051
+ const typeLocalName = referencedType.split(":").pop() || referencedType;
24052
+ let foundKey;
24053
+ if (schemaObject) {
24054
+ foundKey = Object.keys(schemaObject).find((k) => {
24055
+ if (k === "$namespace" || k === "$qualified") return false;
24056
+ const kLocalName = k.split(":").pop() || k;
24057
+ return kLocalName === typeLocalName;
24058
+ });
24059
+ if (foundKey && foundKey.includes(":")) {
24060
+ const [nsUri] = foundKey.split(":");
24061
+ referencedElementNamespace = nsUri;
24062
+ }
24063
+ }
24064
+ if (!foundKey && allComplexTypes) {
24065
+ foundKey = Object.keys(allComplexTypes).find((k) => {
24066
+ const kLocalName = k.split(":").pop() || k;
24067
+ return kLocalName === typeLocalName;
24068
+ });
24069
+ if (foundKey && foundKey.includes(":")) {
24070
+ const [nsUri] = foundKey.split(":");
24071
+ referencedElementNamespace = nsUri;
24072
+ }
24073
+ }
24074
+ }
24075
+ let wrapperNamespacePrefix = namespacePrefix;
24076
+ if (typeof referencedElementNamespace === "string") {
24077
+ if (prefixesMapping) {
24078
+ for (const [prefix, uri] of Object.entries(prefixesMapping)) {
24079
+ if (uri === referencedElementNamespace) {
24080
+ wrapperNamespacePrefix = prefix;
24081
+ break;
24082
+ }
24083
+ }
24084
+ } else {
24085
+ wrapperNamespacePrefix = getNamespacePrefix(
24086
+ namespacesTypeMapping,
24087
+ baseNamespacePrefix,
24088
+ key,
24089
+ parentKey,
24090
+ { $namespace: referencedElementNamespace },
24091
+ prefixesMapping
24092
+ );
24093
+ }
24094
+ }
24095
+ const wrapperIsQualified = referencedElement.$qualified !== false;
24096
+ const wrapperOpenTag = wrapperIsQualified ? `<${wrapperNamespacePrefix}.${tagLocalName}>` : `<${tagLocalName}>`;
24097
+ const wrapperCloseTag = wrapperIsQualified ? `</${wrapperNamespacePrefix}.${tagLocalName}>` : `</${tagLocalName}>`;
24098
+ if (tagUsageCollector && wrapperIsQualified) {
24099
+ tagUsageCollector.tagToPrefix.set(tagLocalName, wrapperNamespacePrefix);
24100
+ if (prefixesMapping && prefixesMapping[wrapperNamespacePrefix]) {
24101
+ tagUsageCollector.prefixToNamespace.set(wrapperNamespacePrefix, prefixesMapping[wrapperNamespacePrefix]);
24102
+ }
24103
+ }
24104
+ let finalReferencedElement = referencedElement;
24105
+ if ("type" in referencedElement && typeof referencedElement.type === "string") {
24106
+ const nestedReferencedElement = resolveNestedType(referencedElement.type, schemaObject, allComplexTypes);
24107
+ if (nestedReferencedElement && typeof nestedReferencedElement === "object") {
24108
+ finalReferencedElement = nestedReferencedElement;
24109
+ }
24110
+ }
24111
+ if ("type" in finalReferencedElement && typeof finalReferencedElement.type === "object" && finalReferencedElement.type !== null) {
24112
+ const keys = getFilteredKeys(finalReferencedElement.type);
24113
+ if (keys.length > 0) {
24114
+ let parentPropertyPath = "";
24115
+ if (propertyPath === tagCamelCase) {
24116
+ parentPropertyPath = "";
24117
+ } else if (propertyPath.endsWith(`.${tagCamelCase}`)) {
24118
+ parentPropertyPath = propertyPath.slice(0, -(tagCamelCase.length + 1));
24119
+ } else {
24120
+ parentPropertyPath = propertyPath;
24121
+ }
24122
+ const nestedProperties = keys.map((elementKey) => {
24123
+ const nestedElement = finalReferencedElement.type[elementKey];
24124
+ if (typeof nestedElement === "object" && nestedElement !== null) {
24125
+ const nestedKeyLocalName = extractLocalName(elementKey);
24126
+ const nestedKeyCamelCase = toCamelCase2(nestedKeyLocalName);
24127
+ const nestedPropertyPath = parentPropertyPath ? `${parentPropertyPath}.${nestedKeyCamelCase}` : nestedKeyCamelCase;
24128
+ return generateXmlPropertyCode(
24129
+ namespacesTypeMapping,
24130
+ baseNamespacePrefix,
24131
+ elementKey,
24132
+ nestedElement,
24133
+ key,
24134
+ nestedPropertyPath,
24135
+ isQualified,
24136
+ prefixesMapping,
24137
+ schemaObject,
24138
+ allComplexTypes,
24139
+ tagUsageCollector
24140
+ );
24141
+ }
24142
+ return "";
24143
+ }).filter(Boolean).join("\n");
24144
+ return `${wrapperOpenTag}
24145
+ ${nestedProperties}
24146
+ ${wrapperCloseTag}`;
24147
+ }
24148
+ }
24149
+ const referencedKeys = getFilteredKeys(finalReferencedElement);
24150
+ if (referencedKeys.length > 0) {
24151
+ let parentPropertyPath = "";
24152
+ if (propertyPath === tagCamelCase) {
24153
+ parentPropertyPath = "";
24154
+ } else if (propertyPath.endsWith(`.${tagCamelCase}`)) {
24155
+ parentPropertyPath = propertyPath.slice(0, -(tagCamelCase.length + 1));
24156
+ } else {
24157
+ parentPropertyPath = propertyPath;
24158
+ }
24159
+ const nestedProperties = referencedKeys.map((elementKey) => {
24160
+ const nestedElement = finalReferencedElement[elementKey];
24161
+ if (typeof nestedElement === "object" && nestedElement !== null) {
24162
+ const nestedKeyLocalName = extractLocalName(elementKey);
24163
+ const nestedKeyCamelCase = toCamelCase2(nestedKeyLocalName);
24164
+ const nestedPropertyPath = parentPropertyPath ? `${parentPropertyPath}.${nestedKeyCamelCase}` : nestedKeyCamelCase;
24165
+ return generateXmlPropertyCode(
24166
+ namespacesTypeMapping,
24167
+ baseNamespacePrefix,
24168
+ elementKey,
24169
+ nestedElement,
24170
+ key,
24171
+ nestedPropertyPath,
24172
+ isQualified,
24173
+ prefixesMapping,
24174
+ schemaObject,
24175
+ allComplexTypes,
24176
+ tagUsageCollector
24177
+ );
24178
+ }
24179
+ return "";
24180
+ }).filter(Boolean).join("\n");
24181
+ return `${wrapperOpenTag}
24182
+ ${nestedProperties}
24183
+ ${wrapperCloseTag}`;
24184
+ }
24185
+ }
24186
+ }
24187
+ if (typeof elementObject === "object" && elementObject !== null && typeof elementObject.type === "object") {
24188
+ const keys = getFilteredKeys(elementObject.type);
24189
+ if (isArray2) {
24190
+ const nestedProperties = keys.map((elementKey) => {
24191
+ const nestedElement = elementObject.type[elementKey];
24192
+ if (typeof nestedElement === "object" && nestedElement !== null) {
24193
+ const nestedIsArray = typeof nestedElement === "object" && nestedElement !== null && "maxOccurs" in nestedElement && nestedElement.maxOccurs !== void 0 && nestedElement.maxOccurs !== "1" && nestedElement.maxOccurs !== DEFAULT_OCCURS;
24194
+ if (nestedIsArray || typeof nestedElement === "object" && nestedElement !== null && typeof nestedElement.type === "object") {
24195
+ return generateXmlPropertyCode(
24196
+ namespacesTypeMapping,
24197
+ baseNamespacePrefix,
24198
+ elementKey,
24199
+ nestedElement,
24200
+ key,
24201
+ "item",
24202
+ // Usar 'item' directamente en lugar de la ruta completa con índice
24203
+ isQualified,
24204
+ prefixesMapping,
24205
+ schemaObject,
24206
+ allComplexTypes
24207
+ );
24208
+ } else {
24209
+ const nestedTagLocalName = extractLocalName(elementKey);
24210
+ const nestedTagCamelCase = toCamelCase2(nestedTagLocalName);
24211
+ const nestedIsQualified = shouldHavePrefix(nestedElement);
24212
+ if (nestedIsQualified) {
24213
+ const nestedNamespacePrefix = getNamespacePrefix(
24214
+ namespacesTypeMapping,
24215
+ baseNamespacePrefix,
24216
+ elementKey,
24217
+ key,
24218
+ nestedElement,
24219
+ prefixesMapping
24220
+ );
24221
+ return `<${nestedNamespacePrefix}.${nestedTagLocalName}>{item.${nestedTagCamelCase}}</${nestedNamespacePrefix}.${nestedTagLocalName}>`;
24222
+ } else {
24223
+ return `<${nestedTagLocalName}>{item.${nestedTagCamelCase}}</${nestedTagLocalName}>`;
24224
+ }
24225
+ }
24226
+ }
24227
+ return "";
24228
+ }).filter(Boolean).join("\n");
24229
+ const mapPath = propertyPath || currentPropertyPath;
24230
+ return `{props.${mapPath}.map((item, i) => (
24231
+ ${openTag}
24232
+ ${nestedProperties}
24233
+ ${closeTag}
24234
+ ))}`;
24235
+ } else {
24236
+ const nestedProperties = keys.map((elementKey) => {
24237
+ const nestedElement = elementObject.type[elementKey];
24238
+ if (typeof nestedElement === "object" && nestedElement !== null) {
24239
+ return generateXmlPropertyCode(
24240
+ namespacesTypeMapping,
24241
+ baseNamespacePrefix,
24242
+ elementKey,
24243
+ nestedElement,
24244
+ key,
24245
+ currentPropertyPath,
24246
+ // Mantener el propertyPath completo (incluye propsInterfaceName si existe)
24247
+ isQualified,
24248
+ prefixesMapping,
24249
+ schemaObject,
24250
+ allComplexTypes,
24251
+ tagUsageCollector
24252
+ );
24253
+ }
24254
+ return "";
24255
+ }).filter(Boolean).join("\n");
24256
+ return `${openTag}
24257
+ ${nestedProperties}
24258
+ ${closeTag}`;
24259
+ }
24260
+ }
24261
+ return `${openTag}{props.${currentPropertyPath}}${closeTag}`;
24262
+ }
24263
+
24264
+ // src/codegen/xml-generator/xml-body.ts
24265
+ function generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, baseTypeObject, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping, tagUsageCollector) {
24266
+ const keys = getFilteredKeys(baseTypeObject);
24267
+ const baseTypeLocalName = extractLocalName(baseTypeName);
24268
+ if (keys.length === 1) {
24269
+ const singleKey = keys[0];
24270
+ const element = baseTypeObject[singleKey];
24271
+ if (typeof element === "object" && element !== null && "type" in element) {
24272
+ const typeValue = element.type;
24273
+ if (typeof typeValue === "object" && typeValue !== null) {
24274
+ const typeKeys = getFilteredKeys(typeValue);
24275
+ if (typeKeys.length > 0) {
24276
+ return generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, typeValue, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping, tagUsageCollector);
24277
+ }
24278
+ }
24279
+ }
24280
+ }
24281
+ const properties = keys.map((key) => {
24282
+ const element = baseTypeObject[key];
24283
+ if (typeof element === "object" && element !== null) {
24284
+ const keyLocalName = extractLocalName(key);
24285
+ const keyCamelCase = toCamelCase2(keyLocalName);
24286
+ const propertyPath = propsInterfaceName ? `${propsInterfaceName}.${keyCamelCase}` : keyCamelCase;
24287
+ return generateXmlPropertyCode(
24288
+ namespacesTypeMapping,
24289
+ baseNamespacePrefix,
24290
+ key,
24291
+ element,
24292
+ null,
24293
+ propertyPath,
24294
+ true,
24295
+ // El padre (root element) siempre es qualified
24296
+ prefixesMapping,
24297
+ schemaObject,
24298
+ allComplexTypes,
24299
+ tagUsageCollector
24300
+ );
24301
+ }
24302
+ return "";
24303
+ }).filter(Boolean).join("\n");
24304
+ if (tagUsageCollector) {
24305
+ tagUsageCollector.tagToPrefix.set(baseTypeLocalName, baseNamespacePrefix);
24306
+ if (prefixesMapping && prefixesMapping[baseNamespacePrefix]) {
24307
+ tagUsageCollector.prefixToNamespace.set(baseNamespacePrefix, prefixesMapping[baseNamespacePrefix]);
24308
+ }
24309
+ }
24310
+ return `<${baseNamespacePrefix}.${baseTypeLocalName}>
24311
+ ${properties}
24312
+ </${baseNamespacePrefix}.${baseTypeLocalName}>`;
24313
+ }
24314
+
23894
24315
  // src/codegen/namespaces.ts
23895
24316
  function extractAllNamespaceMappings(baseTypeName, baseTypeObject, schemaObject, allComplexTypes) {
23896
24317
  const tagsMapping = {};
@@ -23987,43 +24408,67 @@ function extractAllNamespaceMappings(baseTypeName, baseTypeObject, schemaObject,
23987
24408
  tagsMapping[finalPrefix] = [];
23988
24409
  }
23989
24410
  }
23990
- for (const [nsUri, tags] of xmlBodyResult.tagsByNamespace) {
23991
- let finalPrefix;
23992
- for (const [p, u] of Object.entries(prefixesMapping)) {
23993
- if (u === nsUri) {
23994
- finalPrefix = p;
23995
- break;
23996
- }
24411
+ const tagUsageCollector = {
24412
+ tagToPrefix: /* @__PURE__ */ new Map(),
24413
+ prefixToNamespace: /* @__PURE__ */ new Map()
24414
+ };
24415
+ generateXmlBodyCode(
24416
+ baseNamespacePrefix,
24417
+ typesMapping,
24418
+ baseTypeName,
24419
+ baseTypeObject,
24420
+ void 0,
24421
+ // propsInterfaceName
24422
+ schemaObject,
24423
+ allComplexTypes,
24424
+ prefixesMapping,
24425
+ tagUsageCollector
24426
+ );
24427
+ const newTagsMapping = {};
24428
+ const prefixToTags = /* @__PURE__ */ new Map();
24429
+ const tagToPrefixMap = /* @__PURE__ */ new Map();
24430
+ for (const [tag, prefix] of tagUsageCollector.tagToPrefix) {
24431
+ if (tag.startsWith("_")) {
24432
+ continue;
23997
24433
  }
23998
- if (!finalPrefix) {
23999
- finalPrefix = extractNamespacePrefix(nsUri, existingPrefixesSet);
24000
- existingPrefixesSet.add(finalPrefix);
24434
+ if (tagToPrefixMap.has(tag)) {
24435
+ const existingPrefix = tagToPrefixMap.get(tag);
24436
+ if (existingPrefix !== prefix) {
24437
+ debugContext("extractAllNamespaceMappings", `Tag "${tag}" encontrado en m\xFAltiples prefijos: "${existingPrefix}" y "${prefix}", usando "${prefix}"`);
24438
+ }
24001
24439
  }
24002
- if (!tagsMapping[finalPrefix]) {
24003
- tagsMapping[finalPrefix] = [];
24440
+ tagToPrefixMap.set(tag, prefix);
24441
+ if (!prefixToTags.has(prefix)) {
24442
+ prefixToTags.set(prefix, /* @__PURE__ */ new Set());
24004
24443
  }
24005
- const existingTags = new Set(tagsMapping[finalPrefix] || []);
24006
- for (const tag of tags) {
24007
- if (!existingTags.has(tag)) {
24008
- tagsMapping[finalPrefix].push(tag);
24009
- existingTags.add(tag);
24444
+ prefixToTags.get(prefix).add(tag);
24445
+ }
24446
+ const allTagsAdded = /* @__PURE__ */ new Set();
24447
+ for (const [prefix, tagsSet] of prefixToTags) {
24448
+ const tagsArray = Array.from(tagsSet).filter((tag) => {
24449
+ if (allTagsAdded.has(tag)) {
24450
+ return false;
24010
24451
  }
24452
+ allTagsAdded.add(tag);
24453
+ return true;
24454
+ });
24455
+ if (tagsArray.length > 0) {
24456
+ newTagsMapping[prefix] = tagsArray;
24457
+ debugContext("extractAllNamespaceMappings", `Agregando ${tagsArray.length} tag(s) al namespace "${prefix}" basado en uso real en XML: ${tagsArray.join(", ")}`);
24011
24458
  }
24012
- debugContext("extractAllNamespaceMappings", `Agregando ${tags.length} tag(s) al namespace "${finalPrefix}" (${nsUri})`);
24013
24459
  }
24014
- if (xmlBodyResult.tags.length > 0) {
24015
- if (tagsMapping[baseNamespacePrefix] === void 0) {
24016
- tagsMapping[baseNamespacePrefix] = [];
24017
- prefixesMapping[baseNamespacePrefix] = baseNamespace;
24460
+ for (const [prefix, namespaceUri] of tagUsageCollector.prefixToNamespace) {
24461
+ if (!prefixesMapping[prefix]) {
24462
+ prefixesMapping[prefix] = namespaceUri;
24463
+ debugContext("extractAllNamespaceMappings", `Registrando namespace para prefijo "${prefix}": "${namespaceUri}"`);
24018
24464
  }
24019
- const existingTags = new Set(tagsMapping[baseNamespacePrefix] || []);
24020
- for (const tag of xmlBodyResult.tags) {
24021
- if (!existingTags.has(tag)) {
24022
- tagsMapping[baseNamespacePrefix].push(tag);
24023
- existingTags.add(tag);
24024
- }
24465
+ }
24466
+ for (const prefix of Object.keys(prefixesMapping)) {
24467
+ if (!newTagsMapping[prefix]) {
24468
+ newTagsMapping[prefix] = [];
24025
24469
  }
24026
24470
  }
24471
+ Object.assign(tagsMapping, newTagsMapping);
24027
24472
  return {
24028
24473
  tagsMapping,
24029
24474
  prefixesMapping,
@@ -24086,208 +24531,6 @@ function shouldHavePrefix(elementObject) {
24086
24531
  return false;
24087
24532
  }
24088
24533
 
24089
- // src/codegen/xml-generator/xml-property.ts
24090
- function generateXmlPropertyCode(namespacesTypeMapping, baseNamespacePrefix, key, elementObject, parentKey = null, propertyPath = "", parentIsQualified = true, prefixesMapping) {
24091
- const namespacePrefix = getNamespacePrefix(
24092
- namespacesTypeMapping,
24093
- baseNamespacePrefix,
24094
- key,
24095
- parentKey,
24096
- elementObject,
24097
- prefixesMapping
24098
- );
24099
- const tagLocalName = extractLocalName(key);
24100
- const tagCamelCase = toCamelCase2(tagLocalName);
24101
- const isQualified = shouldHavePrefix(elementObject);
24102
- const openTag = isQualified ? `<${namespacePrefix}.${tagLocalName}>` : `<${tagLocalName}>`;
24103
- const closeTag = isQualified ? `</${namespacePrefix}.${tagLocalName}>` : `</${tagLocalName}>`;
24104
- const isArray2 = typeof elementObject === "object" && elementObject !== null && "maxOccurs" in elementObject && elementObject.maxOccurs !== void 0 && elementObject.maxOccurs !== "1" && elementObject.maxOccurs !== DEFAULT_OCCURS;
24105
- const currentPropertyPath = propertyPath ? propertyPath.endsWith(`.${tagCamelCase}`) || propertyPath === tagCamelCase ? propertyPath : `${propertyPath}.${tagCamelCase}` : tagCamelCase;
24106
- if (typeof elementObject === "object" && elementObject !== null && typeof elementObject.type === "object") {
24107
- const keys = getFilteredKeys(elementObject.type);
24108
- if (isArray2) {
24109
- const nestedProperties = keys.map((elementKey) => {
24110
- const nestedElement = elementObject.type[elementKey];
24111
- if (typeof nestedElement === "object" && nestedElement !== null) {
24112
- const nestedIsArray = typeof nestedElement === "object" && nestedElement !== null && "maxOccurs" in nestedElement && nestedElement.maxOccurs !== void 0 && nestedElement.maxOccurs !== "1" && nestedElement.maxOccurs !== DEFAULT_OCCURS;
24113
- if (nestedIsArray || typeof nestedElement === "object" && nestedElement !== null && typeof nestedElement.type === "object") {
24114
- return generateXmlPropertyCode(
24115
- namespacesTypeMapping,
24116
- baseNamespacePrefix,
24117
- elementKey,
24118
- nestedElement,
24119
- key,
24120
- "item",
24121
- // Usar 'item' directamente en lugar de la ruta completa con índice
24122
- isQualified
24123
- );
24124
- } else {
24125
- const nestedTagLocalName = extractLocalName(elementKey);
24126
- const nestedTagCamelCase = toCamelCase2(nestedTagLocalName);
24127
- const nestedIsQualified = shouldHavePrefix(nestedElement);
24128
- if (nestedIsQualified) {
24129
- const nestedNamespacePrefix = getNamespacePrefix(
24130
- namespacesTypeMapping,
24131
- baseNamespacePrefix,
24132
- elementKey,
24133
- key,
24134
- nestedElement,
24135
- prefixesMapping
24136
- );
24137
- return `<${nestedNamespacePrefix}.${nestedTagLocalName}>{item.${nestedTagCamelCase}}</${nestedNamespacePrefix}.${nestedTagLocalName}>`;
24138
- } else {
24139
- return `<${nestedTagLocalName}>{item.${nestedTagCamelCase}}</${nestedTagLocalName}>`;
24140
- }
24141
- }
24142
- }
24143
- return "";
24144
- }).filter(Boolean).join("\n");
24145
- const mapPath = propertyPath || currentPropertyPath;
24146
- return `{props.${mapPath}.map((item, i) => (
24147
- ${openTag}
24148
- ${nestedProperties}
24149
- ${closeTag}
24150
- ))}`;
24151
- } else {
24152
- const nestedProperties = keys.map((elementKey) => {
24153
- const nestedElement = elementObject.type[elementKey];
24154
- if (typeof nestedElement === "object" && nestedElement !== null) {
24155
- return generateXmlPropertyCode(
24156
- namespacesTypeMapping,
24157
- baseNamespacePrefix,
24158
- elementKey,
24159
- nestedElement,
24160
- key,
24161
- currentPropertyPath,
24162
- // Mantener el propertyPath completo (incluye propsInterfaceName si existe)
24163
- isQualified,
24164
- prefixesMapping
24165
- );
24166
- }
24167
- return "";
24168
- }).filter(Boolean).join("\n");
24169
- return `${openTag}
24170
- ${nestedProperties}
24171
- ${closeTag}`;
24172
- }
24173
- }
24174
- return `${openTag}{props.${currentPropertyPath}}${closeTag}`;
24175
- }
24176
-
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
- // src/codegen/xml-generator/xml-body.ts
24237
- function generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, baseTypeObject, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping) {
24238
- const keys = getFilteredKeys(baseTypeObject);
24239
- const baseTypeLocalName = extractLocalName(baseTypeName);
24240
- if (keys.length === 1) {
24241
- const singleKey = keys[0];
24242
- const element = baseTypeObject[singleKey];
24243
- if (typeof element === "object" && element !== null && "type" in element) {
24244
- 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
- if (typeof typeValue === "object" && typeValue !== null) {
24259
- const typeKeys = getFilteredKeys(typeValue);
24260
- if (typeKeys.length > 0) {
24261
- return generateXmlBodyCode(baseNamespacePrefix, namespacesTypeMapping, baseTypeName, typeValue, propsInterfaceName, schemaObject, allComplexTypes, prefixesMapping);
24262
- }
24263
- }
24264
- }
24265
- }
24266
- const properties = keys.map((key) => {
24267
- const element = baseTypeObject[key];
24268
- if (typeof element === "object" && element !== null) {
24269
- const keyLocalName = extractLocalName(key);
24270
- const keyCamelCase = toCamelCase2(keyLocalName);
24271
- const propertyPath = propsInterfaceName ? `${propsInterfaceName}.${keyCamelCase}` : keyCamelCase;
24272
- return generateXmlPropertyCode(
24273
- namespacesTypeMapping,
24274
- baseNamespacePrefix,
24275
- key,
24276
- element,
24277
- null,
24278
- propertyPath,
24279
- true,
24280
- // El padre (root element) siempre es qualified
24281
- prefixesMapping
24282
- );
24283
- }
24284
- return "";
24285
- }).filter(Boolean).join("\n");
24286
- return `<${baseNamespacePrefix}.${baseTypeLocalName}>
24287
- ${properties}
24288
- </${baseNamespacePrefix}.${baseTypeLocalName}>`;
24289
- }
24290
-
24291
24534
  // src/codegen/data-preparer/simple-types.ts
24292
24535
  function prepareSimpleTypesData(typeObject, xmlSchemaUri) {
24293
24536
  return Object.keys(typeObject).filter((key) => {
@@ -24553,21 +24796,42 @@ function preparePropsInterfaceData(typeName, typeObject, allTypesForInterfaces,
24553
24796
  }
24554
24797
  if (nestedReferencedElement && typeof nestedReferencedElement === "object") {
24555
24798
  debugContext("preparePropsInterfaceData", `Expandiendo contenido del tipo anidado`);
24556
- return preparePropsInterfaceData(typeName, nestedReferencedElement, allTypesForInterfaces, schemaObject, allComplexTypes);
24799
+ const cleanedNestedElement = { ...nestedReferencedElement };
24800
+ Object.keys(cleanedNestedElement).forEach((key) => {
24801
+ if (key.startsWith("_")) {
24802
+ delete cleanedNestedElement[key];
24803
+ }
24804
+ });
24805
+ return preparePropsInterfaceData(typeName, cleanedNestedElement, allTypesForInterfaces, schemaObject, allComplexTypes);
24557
24806
  }
24558
24807
  }
24559
- return preparePropsInterfaceData(typeName, referencedElement, allTypesForInterfaces, schemaObject, allComplexTypes);
24808
+ const cleanedReferencedElement = { ...referencedElement };
24809
+ Object.keys(cleanedReferencedElement).forEach((key) => {
24810
+ if (key.startsWith("_")) {
24811
+ delete cleanedReferencedElement[key];
24812
+ }
24813
+ });
24814
+ return preparePropsInterfaceData(typeName, cleanedReferencedElement, allTypesForInterfaces, schemaObject, allComplexTypes);
24560
24815
  }
24561
24816
  }
24562
24817
  if (typeof typeValue === "object" && typeValue !== null) {
24563
- const typeKeys = getFilteredKeys(typeValue);
24818
+ const cleanedTypeValue = { ...typeValue };
24819
+ Object.keys(cleanedTypeValue).forEach((key) => {
24820
+ if (key.startsWith("_")) {
24821
+ delete cleanedTypeValue[key];
24822
+ }
24823
+ });
24824
+ const typeKeys = getFilteredKeys(cleanedTypeValue);
24564
24825
  if (typeKeys.length > 0) {
24565
- return preparePropsInterfaceData(typeName, typeValue, allTypesForInterfaces, schemaObject, allComplexTypes);
24826
+ return preparePropsInterfaceData(typeName, cleanedTypeValue, allTypesForInterfaces, schemaObject, allComplexTypes);
24566
24827
  }
24567
24828
  }
24568
24829
  }
24569
24830
  }
24570
- const properties = keys.map((key) => {
24831
+ const properties = keys.filter((key) => {
24832
+ const localName = extractLocalName(key);
24833
+ return !localName.startsWith("_");
24834
+ }).map((key) => {
24571
24835
  const localName = extractLocalName(key);
24572
24836
  const element = typeObject[key];
24573
24837
  let propertyType;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@karibulab/wsdl2tsx",
3
- "version": "0.17.0",
3
+ "version": "0.20.0",
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.0",
16
+ "@karibulab/wsdl2tsx-runtime": "0.20.0",
17
17
  "axios": "^1.7.9",
18
18
  "fast-xml-parser": "5.3.3",
19
19
  "handlebars": "4.7.8"