@api-client/core 0.6.14 → 0.6.15

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 (147) hide show
  1. package/build/browser.d.ts +9 -2
  2. package/build/browser.js +12 -2
  3. package/build/browser.js.map +1 -1
  4. package/build/index.d.ts +9 -2
  5. package/build/index.js +12 -2
  6. package/build/index.js.map +1 -1
  7. package/build/src/amf/AmfMixin.d.ts +395 -0
  8. package/build/src/amf/AmfMixin.js +1146 -0
  9. package/build/src/amf/AmfMixin.js.map +1 -0
  10. package/build/src/amf/AmfSerializer.d.ts +136 -0
  11. package/build/src/amf/AmfSerializer.js +1913 -0
  12. package/build/src/amf/AmfSerializer.js.map +1 -0
  13. package/build/src/amf/AmfShapeGenerator.d.ts +85 -0
  14. package/build/src/amf/AmfShapeGenerator.js +385 -0
  15. package/build/src/amf/AmfShapeGenerator.js.map +1 -0
  16. package/build/src/amf/AmfTypes.d.ts +24 -0
  17. package/build/src/amf/AmfTypes.js +122 -0
  18. package/build/src/amf/AmfTypes.js.map +1 -0
  19. package/build/src/amf/ApiExampleGenerator.d.ts +36 -0
  20. package/build/src/amf/ApiExampleGenerator.js +109 -0
  21. package/build/src/amf/ApiExampleGenerator.js.map +1 -0
  22. package/build/src/amf/ApiMonacoSchemaGenerator.d.ts +67 -0
  23. package/build/src/amf/ApiMonacoSchemaGenerator.js +243 -0
  24. package/build/src/amf/ApiMonacoSchemaGenerator.js.map +1 -0
  25. package/build/src/amf/ApiSchemaGenerator.d.ts +55 -0
  26. package/build/src/amf/ApiSchemaGenerator.js +94 -0
  27. package/build/src/amf/ApiSchemaGenerator.js.map +1 -0
  28. package/build/src/amf/ApiSchemaValues.d.ts +98 -0
  29. package/build/src/amf/ApiSchemaValues.js +382 -0
  30. package/build/src/amf/ApiSchemaValues.js.map +1 -0
  31. package/build/src/amf/Utils.d.ts +41 -0
  32. package/build/src/amf/Utils.js +176 -0
  33. package/build/src/amf/Utils.js.map +1 -0
  34. package/build/src/amf/data-node/DataNodeBase.d.ts +31 -0
  35. package/build/src/amf/data-node/DataNodeBase.js +77 -0
  36. package/build/src/amf/data-node/DataNodeBase.js.map +1 -0
  37. package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts +15 -0
  38. package/build/src/amf/data-node/JsonDataNodeGenerator.js +24 -0
  39. package/build/src/amf/data-node/JsonDataNodeGenerator.js.map +1 -0
  40. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts +13 -0
  41. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js +42 -0
  42. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js.map +1 -0
  43. package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts +21 -0
  44. package/build/src/amf/data-node/XmlDataNodeGenerator.js +30 -0
  45. package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +1 -0
  46. package/build/src/amf/definitions/Amf.d.ts +362 -0
  47. package/build/src/amf/definitions/Amf.js +2 -0
  48. package/build/src/amf/definitions/Amf.js.map +1 -0
  49. package/build/src/amf/definitions/Api.d.ts +381 -0
  50. package/build/src/amf/definitions/Api.js +2 -0
  51. package/build/src/amf/definitions/Api.js.map +1 -0
  52. package/build/src/amf/definitions/Base.d.ts +11 -0
  53. package/build/src/amf/definitions/Base.js +2 -0
  54. package/build/src/amf/definitions/Base.js.map +1 -0
  55. package/build/src/amf/definitions/Namespace.d.ts +311 -0
  56. package/build/src/amf/definitions/Namespace.js +330 -0
  57. package/build/src/amf/definitions/Namespace.js.map +1 -0
  58. package/build/src/amf/definitions/Shapes.d.ts +309 -0
  59. package/build/src/amf/definitions/Shapes.js +87 -0
  60. package/build/src/amf/definitions/Shapes.js.map +1 -0
  61. package/build/src/amf/models/AmfDataNode.d.ts +68 -0
  62. package/build/src/amf/models/AmfDataNode.js +188 -0
  63. package/build/src/amf/models/AmfDataNode.js.map +1 -0
  64. package/build/src/amf/shape/ShapeBase.d.ts +75 -0
  65. package/build/src/amf/shape/ShapeBase.js +90 -0
  66. package/build/src/amf/shape/ShapeBase.js.map +1 -0
  67. package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts +46 -0
  68. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js +406 -0
  69. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +1 -0
  70. package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +84 -0
  71. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js +820 -0
  72. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -0
  73. package/build/src/models/data/Bindings.d.ts +161 -0
  74. package/build/src/models/data/Bindings.js +2 -0
  75. package/build/src/models/data/Bindings.js.map +1 -0
  76. package/build/src/models/data/DataAssociation.d.ts +135 -14
  77. package/build/src/models/data/DataAssociation.js +154 -21
  78. package/build/src/models/data/DataAssociation.js.map +1 -1
  79. package/build/src/models/data/DataAssociationSchema.d.ts +36 -0
  80. package/build/src/models/data/DataEntity.d.ts +54 -4
  81. package/build/src/models/data/DataEntity.js +85 -9
  82. package/build/src/models/data/DataEntity.js.map +1 -1
  83. package/build/src/models/data/DataFile.d.ts +3 -0
  84. package/build/src/models/data/DataFile.js +3 -0
  85. package/build/src/models/data/DataFile.js.map +1 -1
  86. package/build/src/models/data/DataModel.d.ts +1 -1
  87. package/build/src/models/data/DataModel.js.map +1 -1
  88. package/build/src/models/data/DataProperty.d.ts +107 -36
  89. package/build/src/models/data/DataProperty.js +147 -17
  90. package/build/src/models/data/DataProperty.js.map +1 -1
  91. package/data/apis/oas-date/oas-date.yaml +28 -0
  92. package/data/apis/oas-types/oas-types.yaml +159 -0
  93. package/data/apis/oas-unions/oas-unions.yaml +75 -0
  94. package/data/apis/raml-date/raml-date.raml +28 -0
  95. package/data/apis/recursive/recursive.raml +14 -0
  96. package/data/apis/schema-api/examples/person.json +14 -0
  97. package/data/apis/schema-api/examples/person.raml +14 -0
  98. package/data/apis/schema-api/examples/person.url.encoded +1 -0
  99. package/data/apis/schema-api/examples/person.xml +14 -0
  100. package/data/apis/schema-api/library/demo-types.raml +43 -0
  101. package/data/apis/schema-api/schema-api.raml +644 -0
  102. package/data/apis/schema-api/schemas/person.json +104 -0
  103. package/data/apis/schema-api/schemas/person.xsd +26 -0
  104. package/data/apis/schema-api/types/DemoPerson.raml +67 -0
  105. package/data/model.js +106 -0
  106. package/data/models/oas-date.json +637 -0
  107. package/data/models/oas-types.json +5352 -0
  108. package/data/models/oas-unions.json +1881 -0
  109. package/data/models/raml-date.json +1096 -0
  110. package/data/models/recursive.json +610 -0
  111. package/data/models/schema-api.json +37319 -0
  112. package/package.json +9 -6
  113. package/src/amf/AmfMixin.ts +1623 -0
  114. package/src/amf/AmfSerializer.ts +2028 -0
  115. package/src/amf/AmfShapeGenerator.ts +400 -0
  116. package/src/amf/AmfTypes.ts +126 -0
  117. package/src/amf/ApiExampleGenerator.ts +112 -0
  118. package/src/amf/ApiMonacoSchemaGenerator.ts +296 -0
  119. package/src/amf/ApiSchemaGenerator.ts +108 -0
  120. package/src/amf/ApiSchemaValues.ts +411 -0
  121. package/src/amf/Utils.ts +182 -0
  122. package/src/amf/data-node/DataNodeBase.ts +81 -0
  123. package/src/amf/data-node/JsonDataNodeGenerator.ts +26 -0
  124. package/src/amf/data-node/README.md +3 -0
  125. package/src/amf/data-node/UrlEncodedDataNodeGenerator.ts +43 -0
  126. package/src/amf/data-node/XmlDataNodeGenerator.ts +38 -0
  127. package/src/amf/definitions/Amf.ts +443 -0
  128. package/src/amf/definitions/Api.ts +427 -0
  129. package/src/amf/definitions/Base.ts +13 -0
  130. package/src/amf/definitions/Namespace.ts +341 -0
  131. package/src/amf/definitions/Shapes.ts +414 -0
  132. package/src/amf/models/AmfDataNode.ts +200 -0
  133. package/src/amf/shape/README.md +4 -0
  134. package/src/amf/shape/ShapeBase.ts +160 -0
  135. package/src/amf/shape/ShapeJsonSchemaGenerator.ts +422 -0
  136. package/src/amf/shape/ShapeXmlSchemaGenerator.ts +876 -0
  137. package/src/models/data/Bindings.ts +186 -0
  138. package/src/models/data/DataAssociation.ts +226 -29
  139. package/src/models/data/DataAssociationSchema.ts +38 -0
  140. package/src/models/data/DataEntity.ts +112 -14
  141. package/src/models/data/DataFile.ts +3 -0
  142. package/src/models/data/DataModel.ts +1 -1
  143. package/src/models/data/DataProperty.ts +191 -47
  144. package/build/src/models/data/DataPropertySchema.d.ts +0 -125
  145. package/build/src/models/data/DataPropertySchema.js +0 -33
  146. package/build/src/models/data/DataPropertySchema.js.map +0 -1
  147. package/src/models/data/DataPropertySchema.ts +0 -156
@@ -0,0 +1,28 @@
1
+ openapi: '3.0.2'
2
+ info:
3
+ title: OAS dates
4
+ version: '1.0'
5
+
6
+ components:
7
+ schemas:
8
+ DateTypes:
9
+ type: object
10
+ properties:
11
+ dateString: # http://www.w3.org/2001/XMLSchema#date
12
+ type: string
13
+ format: date
14
+ dateTimeString: # http://www.w3.org/2001/XMLSchema#dateTime
15
+ type: string
16
+ format: date-time
17
+
18
+ paths:
19
+ /strings:
20
+ get:
21
+ summary: DateTypes
22
+ responses:
23
+ '200':
24
+ description: DateTypes
25
+ content:
26
+ application/json:
27
+ schema:
28
+ $ref: "#/components/schemas/DateTypes"
@@ -0,0 +1,159 @@
1
+ openapi: '3.0.2'
2
+ info:
3
+ title: OAS types
4
+ version: '1.0'
5
+ description: Different OAS types
6
+
7
+ components:
8
+ schemas:
9
+ NumberTypes:
10
+ type: object
11
+ properties:
12
+ simpleNumber:
13
+ type: number
14
+ simpleFloat:
15
+ type: number
16
+ format: float
17
+ simpleDouble:
18
+ type: number
19
+ format: double
20
+ simpleInteger:
21
+ type: integer
22
+ simpleInt32:
23
+ type: integer
24
+ format: int32
25
+ simpleInt64:
26
+ type: integer
27
+ format: int64
28
+ minMaxInteger:
29
+ type: integer
30
+ minimum: 1
31
+ maximum: 20
32
+ exclusiveMinimum: true
33
+ multipleInteger:
34
+ type: integer
35
+ multipleOf: 4
36
+ StringTypes:
37
+ type: object
38
+ properties:
39
+ simpleString:
40
+ type: string
41
+ minMaxString:
42
+ type: string
43
+ minLength: 3
44
+ maxLength: 20
45
+ dateString: # http://www.w3.org/2001/XMLSchema#date
46
+ type: string
47
+ format: date
48
+ dateTimeString: # http://www.w3.org/2001/XMLSchema#dateTime
49
+ type: string
50
+ format: date-time
51
+ passwordString:
52
+ type: string
53
+ format: password
54
+ byteString:
55
+ type: string
56
+ format: byte
57
+ binaryString:
58
+ type: string
59
+ format: binary
60
+ emailString:
61
+ type: string
62
+ format: email
63
+ uuidString:
64
+ type: string
65
+ format: uuid
66
+ uriString:
67
+ type: string
68
+ format: uri
69
+ hostnameString:
70
+ type: string
71
+ format: hostname
72
+ jsonPointerString:
73
+ type: string
74
+ format: json-pointer
75
+ patternString:
76
+ type: string
77
+ pattern: '^\d{3}-\d{2}-\d{4}$'
78
+ enumString:
79
+ type: string
80
+ enum: [asc, desc]
81
+ BooleanTypes:
82
+ type: object
83
+ properties:
84
+ simpleBoolean:
85
+ type: boolean
86
+ defaultBoolean:
87
+ type: boolean
88
+ default: true
89
+ NullableTypes:
90
+ type: object
91
+ properties:
92
+ nullableString:
93
+ type: string
94
+ nullable: true
95
+ nullableEnumString:
96
+ type: string
97
+ nullable: true
98
+ enum: [asc, desc, null]
99
+ FileTypes:
100
+ type: object
101
+ properties:
102
+ binaryFile:
103
+ type: string
104
+ format: binary
105
+ byteString:
106
+ type: string
107
+ format: byte
108
+
109
+ paths:
110
+ /numbers:
111
+ get:
112
+ summary: NumberTypes
113
+ responses:
114
+ '200':
115
+ description: NumberTypes
116
+ content:
117
+ application/json:
118
+ schema:
119
+ $ref: "#/components/schemas/NumberTypes"
120
+ /strings:
121
+ get:
122
+ summary: StringTypes
123
+ responses:
124
+ '200':
125
+ description: StringTypes
126
+ content:
127
+ application/json:
128
+ schema:
129
+ $ref: "#/components/schemas/StringTypes"
130
+ /booleans:
131
+ get:
132
+ summary: BooleanTypes
133
+ responses:
134
+ '200':
135
+ description: BooleanTypes
136
+ content:
137
+ application/json:
138
+ schema:
139
+ $ref: "#/components/schemas/BooleanTypes"
140
+ /nullables:
141
+ get:
142
+ summary: NullableTypes
143
+ responses:
144
+ '200':
145
+ description: NullableTypes
146
+ content:
147
+ application/json:
148
+ schema:
149
+ $ref: "#/components/schemas/NullableTypes"
150
+ /files:
151
+ get:
152
+ summary: FileTypes
153
+ responses:
154
+ '200':
155
+ description: FileTypes
156
+ content:
157
+ application/json:
158
+ schema:
159
+ $ref: "#/components/schemas/FileTypes"
@@ -0,0 +1,75 @@
1
+ openapi: '3.0.2'
2
+ info:
3
+ title: OAS unions
4
+ version: '1.0'
5
+
6
+ components:
7
+ schemas:
8
+ Dog:
9
+ type: object
10
+ properties:
11
+ bark:
12
+ type: boolean
13
+ breed:
14
+ type: string
15
+ enum: [Dingo, Husky, Retriever, Shepherd]
16
+ Cat:
17
+ type: object
18
+ properties:
19
+ hunts:
20
+ type: boolean
21
+ age:
22
+ type: integer
23
+ OneOfSchema:
24
+ oneOf:
25
+ - $ref: '#/components/schemas/Cat'
26
+ - $ref: '#/components/schemas/Dog'
27
+ AllOfSchema:
28
+ allOf:
29
+ - $ref: '#/components/schemas/Cat'
30
+ - $ref: '#/components/schemas/Dog'
31
+ AnyOfSchema:
32
+ anyOf:
33
+ - $ref: '#/components/schemas/Cat'
34
+ - $ref: '#/components/schemas/Dog'
35
+
36
+
37
+ paths:
38
+ /oneOf:
39
+ patch:
40
+ requestBody:
41
+ content:
42
+ application/json:
43
+ schema:
44
+ oneOf:
45
+ - $ref: '#/components/schemas/Cat'
46
+ - $ref: '#/components/schemas/Dog'
47
+ responses:
48
+ '200':
49
+ description: Updated
50
+ /allOf:
51
+ patch:
52
+ requestBody:
53
+ content:
54
+ application/json:
55
+ allOf:
56
+ - $ref: '#/components/schemas/Cat'
57
+ - $ref: '#/components/schemas/Dog'
58
+ discriminator:
59
+ propertyName: pet_type
60
+ responses:
61
+ '200':
62
+ description: Updated
63
+ /anyOf:
64
+ patch:
65
+ requestBody:
66
+ content:
67
+ application/json:
68
+ anyOf:
69
+ - $ref: '#/components/schemas/Cat'
70
+ - $ref: '#/components/schemas/Dog'
71
+ discriminator:
72
+ propertyName: pet_type
73
+ responses:
74
+ '200':
75
+ description: Updated
@@ -0,0 +1,28 @@
1
+ #%RAML 1.0
2
+ title: OAS dates
3
+ version: v1
4
+
5
+ types:
6
+ DateTypes:
7
+ type: object
8
+ properties:
9
+ dateOnly: # http://www.w3.org/2001/XMLSchema#date (OAS for "date")
10
+ type: date-only
11
+ timeOnly: # http://www.w3.org/2001/XMLSchema#time
12
+ type: time-only
13
+ datetimeOnly: # http://a.ml/vocabularies/shapes#dateTimeOnly
14
+ type: datetime-only
15
+ datetimeDefault: # http://www.w3.org/2001/XMLSchema#dateTime (OAS for date-time)
16
+ type: datetime
17
+ datetimeRfc3339: # http://www.w3.org/2001/XMLSchema#dateTime
18
+ type: datetime
19
+ format: rfc3339
20
+ datetimeRfc2616: # http://www.w3.org/2001/XMLSchema#dateTime
21
+ type: datetime
22
+ format: rfc2616
23
+
24
+ /dates:
25
+ post:
26
+ body:
27
+ application/json:
28
+ type: DateTypes
@@ -0,0 +1,14 @@
1
+ #%RAML 1.0
2
+
3
+ title: Recursive shape
4
+
5
+ types:
6
+ T1:
7
+ type: object
8
+ properties:
9
+ p1: T2
10
+ T2:
11
+ type: object
12
+ properties:
13
+ p2: string
14
+ p3: T1
@@ -0,0 +1,14 @@
1
+ {
2
+ "id": "R34fg663H9KW9MMSKISI",
3
+ "name": "Pawel Psztyc",
4
+ "birthday": "1983-10-20",
5
+ "gender": "male",
6
+ "url": "https://domain.com/profile/pawel.psztyc",
7
+ "image": {
8
+ "url": "https://domain.com/profile/pawel.psztyc/image",
9
+ "thumb": "https://domain.com/profile/pawel.psztyc/image/thumb"
10
+ },
11
+ "tagline": "Some text about me.",
12
+ "language": "en_GB",
13
+ "etag": "W\\244m4n5kj3gbn2nj4k4n4"
14
+ }
@@ -0,0 +1,14 @@
1
+ #%RAML 1.0 NamedExample
2
+
3
+ Person exmaple:
4
+ id: R34fg663H9KW9MMSKISI
5
+ name: Pawel Psztyc
6
+ birthday: 1983-10-20
7
+ gender: male
8
+ url: https://domain.com/profile/pawel.psztyc
9
+ image:
10
+ url: https://domain.com/profile/pawel.psztyc/image,
11
+ thumb: https://domain.com/profile/pawel.psztyc/image/thumb
12
+ tagline: Some text about me.
13
+ language: en_GB
14
+ etag: W\\244m4n5kj3gbn2nj4k4n4
@@ -0,0 +1 @@
1
+ id=R34fg663H9KW9MMSKISI&name=Pawel%20Psztyc&birthday=1983-10-20&gender=male&url=https%3A%2F%2Fdomain.com%2Fprofile%2Fpawel.psztyc&tagline=Some%20text%20about%20me.&language=en_GB&etag=W\244m4n5kj3gbn2nj4k4n4
@@ -0,0 +1,14 @@
1
+ <?xml version="1.0" encoding="UTF-8"?>
2
+ <resource error="false" type="AppPerson">
3
+ <id>Qawer63J73HJ6khjswuqyq62382jG21s</id>
4
+ <name>John Smith</name>
5
+ <birthday>1990-10-12</birthday>
6
+ <gender>male</gender>
7
+ <url>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s</url>
8
+ <image>
9
+ <url>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image</url>
10
+ <thumb>https://www.domain.com/people/Qawer63J73HJ6khjswuqyq62382jG21s/image/thumb</thumb>
11
+ </image>
12
+ <tagline>Hi, I'm John!</tagline>
13
+ <language>en_US</language>
14
+ </resource>
@@ -0,0 +1,43 @@
1
+ #%RAML 1.0 Library
2
+
3
+ types:
4
+ BaseResource:
5
+ description: |
6
+ API resource.
7
+ type: object
8
+ properties:
9
+ etag:
10
+ type: string
11
+ description: |
12
+ ETag of this resource for caching purposes.
13
+ __This property will be ignored when creating an object.__
14
+ Pet:
15
+ type: BaseResource
16
+ properties:
17
+ type:
18
+ type: string
19
+ description: The object type for child classes.
20
+ name:
21
+ type: string
22
+ description: The name of the pet.
23
+ sound:
24
+ type: string
25
+ description: The sound it makes.
26
+ discriminatorValue: type
27
+ Dog:
28
+ type: Pet
29
+ properties:
30
+ type:
31
+ default: Dog
32
+ sound:
33
+ default: Woof
34
+ friendly: boolean
35
+ Cat:
36
+ type: Pet
37
+ properties:
38
+ type:
39
+ default: Cat
40
+ Mamal:
41
+ type: object
42
+ properties:
43
+ birthDate: date-only