ebay-api 9.5.1 → 9.5.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/README.md CHANGED
@@ -75,7 +75,7 @@ For more examples, check out the [examples directory](./examples).
75
75
 
76
76
  ## Changelog
77
77
 
78
- * `v9.5.1` is the latest release.
78
+ * `v9.5.2` is the latest release.
79
79
  * See [here](https://github.com/hendt/ebay-api/blob/master/CHANGELOG.md) for the full changelog.
80
80
 
81
81
  ## Implementation status
@@ -601,6 +601,8 @@ export type Options = {
601
601
  [Fast XML](https://github.com/NaturalIntelligence/fast-xml-parser) is used to parse the XML. You can pass the parse
602
602
  option to `parseOptions` parameter.
603
603
 
604
+ Important for Traditional request bodies: when an element has both attributes and text content, the text must go under `#value`, not `#text`, because the XML builder is configured with `textNodeName: '#value'`. For example, use `StartPrice: { '@_currencyID': 'EUR', '#value': '20.00' }`. If you use `#text` instead, it will be serialized literally as `<#text>...</#text>`, which causes eBay XML parse errors that do not clearly point back to the JS-to-XML mapping.
605
+
604
606
  ### Parse JSON Array
605
607
  ```js
606
608
 
@@ -1,4 +1,4 @@
1
- import { X2jOptions, XMLBuilder, XmlBuilderOptions } from 'fast-xml-parser';
1
+ import { MatcherView, X2jOptions, XMLBuilder, XmlBuilderOptions } from 'fast-xml-parser';
2
2
  import { IEBayApiRequest } from '../../request.js';
3
3
  import { ApiRequestConfig, Headers } from '../../types/index.js';
4
4
  import { Fields } from './fields.js';
@@ -29,7 +29,7 @@ export declare const defaultXML2JSONParseOptions: {
29
29
  maxExpandedLength: number;
30
30
  maxEntityCount: number;
31
31
  };
32
- isArray: (name: string, jpath: string) => boolean;
32
+ isArray: (name: string, jpath: string | MatcherView) => boolean;
33
33
  };
34
34
  export type BodyHeaders = {
35
35
  body: any;
@@ -30,7 +30,7 @@ export const defaultXML2JSONParseOptions = {
30
30
  maxEntityCount: 100
31
31
  },
32
32
  isArray: (name, jpath) => {
33
- return /Array$/.test(jpath.slice(0, -name.length - 1));
33
+ return typeof jpath === 'string' && /Array$/.test(jpath.slice(0, -name.length - 1));
34
34
  }
35
35
  };
36
36
  export const defaultApiConfig = {