@api-client/core 0.18.34 → 0.18.36
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/build/src/browser.d.ts +1 -0
- package/build/src/browser.d.ts.map +1 -1
- package/build/src/browser.js +1 -0
- package/build/src/browser.js.map +1 -1
- package/build/src/data/XmlReader.js +1 -1
- package/build/src/data/XmlReader.js.map +1 -1
- package/build/src/sdk/SdkMock.d.ts +318 -0
- package/build/src/sdk/SdkMock.d.ts.map +1 -0
- package/build/src/sdk/SdkMock.js +850 -0
- package/build/src/sdk/SdkMock.js.map +1 -0
- package/build/src/sdk/TrashSdk.d.ts +1 -1
- package/build/src/sdk/TrashSdk.d.ts.map +1 -1
- package/build/src/sdk/TrashSdk.js +1 -1
- package/build/src/sdk/TrashSdk.js.map +1 -1
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/src/data/XmlReader.ts +1 -1
- package/src/sdk/README-MOCK.md +40 -0
- package/src/sdk/SdkMock.ts +955 -0
- package/src/sdk/TrashSdk.ts +1 -1
- package/tests/unit/amf/schema_gen_xml.spec.ts +7 -8
package/src/sdk/TrashSdk.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
/* eslint-disable max-len */
|
|
2
2
|
import { test } from '@japa/runner'
|
|
3
|
-
import { DOMParser
|
|
3
|
+
import { DOMParser } from '@xmldom/xmldom'
|
|
4
4
|
import { ApiSchemaGenerator } from '../../../src/amf/ApiSchemaGenerator.js'
|
|
5
5
|
import { AmfLoader } from './AmfLoader.js'
|
|
6
6
|
import { IAmfDocument } from '../../../src/amf/definitions/Amf.js'
|
|
@@ -75,8 +75,7 @@ test.group('XML serialization', (group) => {
|
|
|
75
75
|
|
|
76
76
|
const objectElement = schema.getElementsByTagName('XmlSimpleArrayWrapped')[0]
|
|
77
77
|
assert.ok(objectElement, 'has the XmlSimpleArrayWrapped element')
|
|
78
|
-
|
|
79
|
-
const wrapped = objectElement.childNodes.filter((n) => n.nodeType === Node.ELEMENT_NODE)[0] as Element
|
|
78
|
+
const wrapped = Array.from(objectElement.childNodes).filter((n) => n.nodeType === 1)[0] as Element
|
|
80
79
|
assert.ok(wrapped, 'has the wrapped node')
|
|
81
80
|
assert.equal(wrapped.localName, 'books', 'has the wrapped element name')
|
|
82
81
|
|
|
@@ -105,7 +104,7 @@ test.group('XML serialization', (group) => {
|
|
|
105
104
|
const objectElement = schema.getElementsByTagName('XmlSimpleArrayWrapped')[0]
|
|
106
105
|
assert.ok(objectElement, 'has the XmlSimpleArrayWrapped element')
|
|
107
106
|
|
|
108
|
-
const wrapped = objectElement.childNodes.filter((n) => n.nodeType ===
|
|
107
|
+
const wrapped = Array.from(objectElement.childNodes).filter((n) => n.nodeType === 1)[0] as Element
|
|
109
108
|
assert.ok(wrapped, 'has the wrapped node')
|
|
110
109
|
|
|
111
110
|
const books = wrapped.getElementsByTagName('books')
|
|
@@ -650,8 +649,8 @@ test.group('XML serialization', (group) => {
|
|
|
650
649
|
const root = schema.getElementsByTagName('XmlArray')[0]
|
|
651
650
|
assert.ok(root, 'has the XmlArray node')
|
|
652
651
|
assert.lengthOf(root.childNodes, 2, 'has 2 children')
|
|
653
|
-
assert.equal(root.childNodes[0].
|
|
654
|
-
assert.equal(root.childNodes[1].
|
|
652
|
+
assert.equal(root.childNodes[0].nodeName.toLowerCase(), 'street', 'has the street child')
|
|
653
|
+
assert.equal(root.childNodes[1].nodeName.toLowerCase(), 'city', 'has the city child')
|
|
655
654
|
}).skip()
|
|
656
655
|
|
|
657
656
|
test('serializes wrapped and renamed root array', async ({ assert }) => {
|
|
@@ -677,8 +676,8 @@ test.group('XML serialization', (group) => {
|
|
|
677
676
|
const item = root.getElementsByTagName('address')[0]
|
|
678
677
|
assert.ok(item, 'has the wrapped item')
|
|
679
678
|
assert.lengthOf(item.childNodes, 2, 'has 2 children')
|
|
680
|
-
assert.equal(item.childNodes[0].
|
|
681
|
-
assert.equal(item.childNodes[1].
|
|
679
|
+
assert.equal(item.childNodes[0].nodeName.toLowerCase(), 'city', 'has the city child')
|
|
680
|
+
assert.equal(item.childNodes[1].nodeName.toLowerCase(), 'street', 'has the street child')
|
|
682
681
|
}).skip()
|
|
683
682
|
|
|
684
683
|
test('serializes schema from a library', async ({ assert }) => {
|