@api-client/core 0.7.12 → 0.8.1
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/SECURITY.md +14 -0
- package/build/browser.d.ts +8 -1
- package/build/browser.js +7 -0
- package/build/browser.js.map +1 -1
- package/build/index.d.ts +8 -1
- package/build/index.js +7 -0
- package/build/index.js.map +1 -1
- package/build/src/amf/AmfMixin.d.ts +56 -42
- package/build/src/amf/AmfMixin.js +9 -3
- package/build/src/amf/AmfMixin.js.map +1 -1
- package/build/src/amf/AmfSerializer.d.ts +72 -72
- package/build/src/amf/AmfSerializer.js +9 -4
- package/build/src/amf/AmfSerializer.js.map +1 -1
- package/build/src/amf/AmfShapeGenerator.d.ts +17 -17
- package/build/src/amf/AmfShapeGenerator.js +3 -3
- package/build/src/amf/AmfShapeGenerator.js.map +1 -1
- package/build/src/amf/AmfTypes.d.ts +16 -16
- package/build/src/amf/AmfTypes.js +16 -16
- package/build/src/amf/AmfTypes.js.map +1 -1
- package/build/src/amf/ApiExampleGenerator.d.ts +3 -3
- package/build/src/amf/ApiExampleGenerator.js.map +1 -1
- package/build/src/amf/ApiMonacoSchemaGenerator.d.ts +6 -6
- package/build/src/amf/ApiMonacoSchemaGenerator.js.map +1 -1
- package/build/src/amf/ApiSchemaGenerator.d.ts +2 -2
- package/build/src/amf/ApiSchemaGenerator.js.map +1 -1
- package/build/src/amf/ApiSchemaValues.d.ts +12 -12
- package/build/src/amf/ApiSchemaValues.js.map +1 -1
- package/build/src/amf/Parsing.d.ts +5 -5
- package/build/src/amf/Utils.d.ts +6 -6
- package/build/src/amf/Utils.js.map +1 -1
- package/build/src/amf/data-node/DataNodeBase.d.ts +5 -5
- package/build/src/amf/data-node/DataNodeBase.js.map +1 -1
- package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts +2 -2
- package/build/src/amf/data-node/JsonDataNodeGenerator.js.map +1 -1
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts +2 -2
- package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js.map +1 -1
- package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts +2 -2
- package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +1 -1
- package/build/src/amf/definitions/Amf.d.ts +339 -339
- package/build/src/amf/definitions/Api.d.ts +158 -158
- package/build/src/amf/definitions/Base.d.ts +5 -5
- package/build/src/amf/definitions/Shapes.d.ts +46 -46
- package/build/src/amf/definitions/Shapes.js +11 -11
- package/build/src/amf/definitions/Shapes.js.map +1 -1
- package/build/src/amf/models/AmfDataNode.d.ts +5 -5
- package/build/src/amf/models/AmfDataNode.js +4 -4
- package/build/src/amf/models/AmfDataNode.js.map +1 -1
- package/build/src/amf/shape/ShapeBase.d.ts +13 -13
- package/build/src/amf/shape/ShapeBase.js.map +1 -1
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts +13 -13
- package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +1 -1
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +16 -16
- package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -1
- package/build/src/events/amf/AmfEvents.d.ts +4 -4
- package/build/src/events/amf/AmfEvents.js.map +1 -1
- package/build/src/lib/timers/Timers.d.ts +9 -0
- package/build/src/lib/timers/Timers.js +13 -0
- package/build/src/lib/timers/Timers.js.map +1 -1
- package/build/src/models/data/Bindings.d.ts +2 -2
- package/build/src/models/data/DataAssociation.d.ts +4 -4
- package/build/src/models/data/DataAssociation.js.map +1 -1
- package/build/src/models/data/DataEntity.d.ts +2 -2
- package/build/src/models/data/DataProperty.d.ts +2 -2
- package/data/apis/amf-helper-api/amf-helper-api.raml +1024 -0
- package/data/apis/amf-helper-api/examples/comment-example.json +42 -0
- package/data/apis/amf-helper-api/examples/commentCreateRequest-example.json +7 -0
- package/data/apis/amf-helper-api/examples/commentList-example.json +48 -0
- package/data/apis/amf-helper-api/examples/person.json +14 -0
- package/data/apis/amf-helper-api/examples/person.raml +13 -0
- package/data/apis/amf-helper-api/examples/person.xml +14 -0
- package/data/apis/amf-helper-api/libraries/comment-lib.raml +143 -0
- package/data/apis/amf-helper-api/library.raml +7 -0
- package/data/apis/amf-helper-api/schemas/person.json +104 -0
- package/data/apis/amf-helper-api/schemas/person.xsd +26 -0
- package/data/apis/amf-helper-api/traits/file.raml +33 -0
- package/data/apis/amf-helper-api/traits/pagination.raml +80 -0
- package/data/apis/amf-helper-api/traits/results.raml +19 -0
- package/data/apis/amf-helper-api/traits/visibility.raml +14 -0
- package/data/apis/amf-helper-api/types/app-person.raml +101 -0
- package/data/apis/amf-helper-api/types/dimensions.raml +24 -0
- package/data/apis/amf-helper-api/types/external-type.raml +7 -0
- package/data/apis/amf-helper-api/types/image.raml +23 -0
- package/data/apis/amf-helper-api/types/product.raml +52 -0
- package/data/apis/amf-helper-api/types/resource.raml +11 -0
- package/data/apis/amf-helper-api/types/standard-request.raml +50 -0
- package/data/apis/amf-helper-api/types/user.raml +37 -0
- package/data/apis/async-api/async-api.yaml +96 -0
- package/data/apis/expanded-api/expanded-api.raml +8 -0
- package/data/apis/flattened-api/flattened-api.raml +8 -0
- package/data/apis/multiple-servers/multiple-servers.yaml +112 -0
- package/data/model.js +5 -0
- package/data/models/amf-helper-api.json +85908 -0
- package/data/models/async-api.json +3108 -0
- package/data/models/expanded-api.json +251 -0
- package/data/models/flattened-api.json +251 -0
- package/data/models/multiple-servers.json +2753 -0
- package/package.json +1 -1
- package/src/amf/AmfMixin.ts +125 -117
- package/src/amf/AmfSerializer.ts +245 -240
- package/src/amf/AmfShapeGenerator.ts +23 -23
- package/src/amf/AmfTypes.ts +16 -16
- package/src/amf/ApiExampleGenerator.ts +4 -4
- package/src/amf/ApiMonacoSchemaGenerator.ts +11 -11
- package/src/amf/ApiSchemaGenerator.ts +3 -3
- package/src/amf/ApiSchemaValues.ts +21 -21
- package/src/amf/Parsing.ts +5 -5
- package/src/amf/Utils.ts +15 -15
- package/src/amf/data-node/DataNodeBase.ts +8 -8
- package/src/amf/data-node/JsonDataNodeGenerator.ts +2 -2
- package/src/amf/data-node/UrlEncodedDataNodeGenerator.ts +2 -2
- package/src/amf/data-node/XmlDataNodeGenerator.ts +2 -2
- package/src/amf/definitions/Amf.ts +315 -314
- package/src/amf/definitions/Api.ts +158 -157
- package/src/amf/definitions/Base.ts +5 -5
- package/src/amf/definitions/Shapes.ts +60 -60
- package/src/amf/models/AmfDataNode.ts +17 -17
- package/src/amf/shape/ShapeBase.ts +16 -16
- package/src/amf/shape/ShapeJsonSchemaGenerator.ts +27 -27
- package/src/amf/shape/ShapeXmlSchemaGenerator.ts +42 -42
- package/src/events/amf/AmfEvents.ts +7 -7
- package/src/lib/timers/Timers.ts +14 -0
- package/src/models/data/Bindings.ts +2 -2
- package/src/models/data/DataAssociation.ts +4 -4
- package/src/models/data/DataEntity.ts +2 -2
- package/src/models/data/DataProperty.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { AmfNamespace as ns } from "../definitions/Namespace.js";
|
|
2
2
|
import { ShapeBase } from './ShapeBase.js';
|
|
3
3
|
import { JsonDataNodeGenerator } from '../data-node/JsonDataNodeGenerator.js';
|
|
4
|
-
import {
|
|
4
|
+
import { IApiAnyShape, IApiArrayShape, IApiDataExample, IApiDataNodeUnion, IApiNodeShape, IApiPropertyShape, IApiScalarShape, IShapeUnion, IApiTupleShape, IApiUnionShape } from "../definitions/Shapes.js";
|
|
5
5
|
|
|
6
6
|
export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
7
7
|
/**
|
|
@@ -23,13 +23,13 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
23
23
|
toObject(schema: IShapeUnion): any {
|
|
24
24
|
const { types } = schema;
|
|
25
25
|
if (types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
|
|
26
|
-
return this._scalarShapeObject(schema as
|
|
26
|
+
return this._scalarShapeObject(schema as IApiScalarShape);
|
|
27
27
|
}
|
|
28
28
|
if (types.includes(ns.w3.shacl.NodeShape)) {
|
|
29
|
-
return this._nodeShapeObject(schema as
|
|
29
|
+
return this._nodeShapeObject(schema as IApiNodeShape);
|
|
30
30
|
}
|
|
31
31
|
if (types.includes(ns.aml.vocabularies.shapes.UnionShape)) {
|
|
32
|
-
return this._unionShapeObject(schema as
|
|
32
|
+
return this._unionShapeObject(schema as IApiUnionShape);
|
|
33
33
|
}
|
|
34
34
|
if (types.includes(ns.aml.vocabularies.shapes.FileShape)) {
|
|
35
35
|
return this._fileShapeObject();
|
|
@@ -38,12 +38,12 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
38
38
|
return this._schemaShapeObject();
|
|
39
39
|
}
|
|
40
40
|
if (types.includes(ns.aml.vocabularies.shapes.TupleShape)) {
|
|
41
|
-
return this._tupleShapeObject(schema as
|
|
41
|
+
return this._tupleShapeObject(schema as IApiTupleShape);
|
|
42
42
|
}
|
|
43
43
|
if (types.includes(ns.aml.vocabularies.shapes.ArrayShape) || types.includes(ns.aml.vocabularies.shapes.MatrixShape)) {
|
|
44
|
-
return this._arrayShapeObject(schema as
|
|
44
|
+
return this._arrayShapeObject(schema as IApiArrayShape);
|
|
45
45
|
}
|
|
46
|
-
return this._anyShapeObject(schema as
|
|
46
|
+
return this._anyShapeObject(schema as IApiAnyShape);
|
|
47
47
|
}
|
|
48
48
|
|
|
49
49
|
/**
|
|
@@ -53,7 +53,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
53
53
|
return JSON.stringify(value, null, 2);
|
|
54
54
|
}
|
|
55
55
|
|
|
56
|
-
protected _scalarShapeObject(schema:
|
|
56
|
+
protected _scalarShapeObject(schema: IApiScalarShape): any|undefined {
|
|
57
57
|
return this._scalarValue(schema);
|
|
58
58
|
}
|
|
59
59
|
|
|
@@ -61,12 +61,12 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
61
61
|
return undefined;
|
|
62
62
|
}
|
|
63
63
|
|
|
64
|
-
protected _nodeShapeObject(schema:
|
|
64
|
+
protected _nodeShapeObject(schema: IApiNodeShape): any {
|
|
65
65
|
const { inherits } = schema;
|
|
66
66
|
let { examples=[] } = schema;
|
|
67
67
|
if (Array.isArray(inherits) && inherits.length) {
|
|
68
68
|
inherits.forEach((parent) => {
|
|
69
|
-
const anyParent = parent as
|
|
69
|
+
const anyParent = parent as IApiAnyShape;
|
|
70
70
|
if (Array.isArray(anyParent.examples) && anyParent.examples.length) {
|
|
71
71
|
examples = examples.concat(anyParent.examples);
|
|
72
72
|
}
|
|
@@ -99,7 +99,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
99
99
|
return result;
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
protected _unionShapeObject(schema:
|
|
102
|
+
protected _unionShapeObject(schema: IApiUnionShape): any {
|
|
103
103
|
if (schema.and && schema.and.length) {
|
|
104
104
|
return this._allOfUnion(schema);
|
|
105
105
|
}
|
|
@@ -110,15 +110,15 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
110
110
|
return this._anyOfUnion(schema);
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
protected _anyOfUnion(schema:
|
|
113
|
+
protected _anyOfUnion(schema: IApiUnionShape): any {
|
|
114
114
|
let { anyOf=[], examples=[] } = schema;
|
|
115
115
|
if (Array.isArray(schema.inherits) && schema.inherits) {
|
|
116
116
|
schema.inherits.forEach((parent) => {
|
|
117
|
-
const anyParent = parent as
|
|
117
|
+
const anyParent = parent as IApiAnyShape;
|
|
118
118
|
if (Array.isArray(anyParent.examples) && anyParent.examples.length) {
|
|
119
119
|
examples = examples.concat(anyParent.examples);
|
|
120
120
|
}
|
|
121
|
-
const typed = parent as
|
|
121
|
+
const typed = parent as IApiUnionShape;
|
|
122
122
|
if (Array.isArray(typed.anyOf) && typed.anyOf.length) {
|
|
123
123
|
anyOf = anyOf.concat(typed.anyOf);
|
|
124
124
|
}
|
|
@@ -154,11 +154,11 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
154
154
|
return undefined;
|
|
155
155
|
}
|
|
156
156
|
|
|
157
|
-
protected _oneOfUnion(schema:
|
|
157
|
+
protected _oneOfUnion(schema: IApiUnionShape): any {
|
|
158
158
|
let { xone=[], examples=[] } = schema;
|
|
159
159
|
if (Array.isArray(schema.inherits) && schema.inherits) {
|
|
160
160
|
schema.inherits.forEach((parent) => {
|
|
161
|
-
const anyParent = parent as
|
|
161
|
+
const anyParent = parent as IApiAnyShape;
|
|
162
162
|
if (Array.isArray(anyParent.examples) && anyParent.examples.length) {
|
|
163
163
|
examples = examples.concat(anyParent.examples);
|
|
164
164
|
}
|
|
@@ -191,11 +191,11 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
191
191
|
/**
|
|
192
192
|
* Combines all properties from both all shapes in the union
|
|
193
193
|
*/
|
|
194
|
-
protected _allOfUnion(schema:
|
|
194
|
+
protected _allOfUnion(schema: IApiUnionShape): any {
|
|
195
195
|
let { examples=[], and=[] } = schema;
|
|
196
196
|
if (Array.isArray(schema.inherits) && schema.inherits) {
|
|
197
197
|
schema.inherits.forEach((parent) => {
|
|
198
|
-
const anyParent = parent as
|
|
198
|
+
const anyParent = parent as IApiAnyShape;
|
|
199
199
|
if (Array.isArray(anyParent.examples) && anyParent.examples.length) {
|
|
200
200
|
examples = examples.concat(anyParent.examples);
|
|
201
201
|
}
|
|
@@ -222,7 +222,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
222
222
|
* @param union The list of unions in the shape
|
|
223
223
|
* @param defaultValue The definition of a default value.
|
|
224
224
|
*/
|
|
225
|
-
protected _unionDefaultValue(union: IShapeUnion[], defaultValue:
|
|
225
|
+
protected _unionDefaultValue(union: IShapeUnion[], defaultValue: IApiDataNodeUnion): any | undefined {
|
|
226
226
|
const gen = new JsonDataNodeGenerator();
|
|
227
227
|
const result = gen.generate(defaultValue);
|
|
228
228
|
let hasNumber = false;
|
|
@@ -235,7 +235,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
235
235
|
if (!i.types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
|
|
236
236
|
return;
|
|
237
237
|
}
|
|
238
|
-
const scalar = i as
|
|
238
|
+
const scalar = i as IApiScalarShape;
|
|
239
239
|
if (!hasBoolean) {
|
|
240
240
|
hasBoolean = scalar.dataType === ns.w3.xmlSchema.boolean;
|
|
241
241
|
}
|
|
@@ -277,12 +277,12 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
277
277
|
return result;
|
|
278
278
|
}
|
|
279
279
|
|
|
280
|
-
protected _arrayShapeObject(schema:
|
|
280
|
+
protected _arrayShapeObject(schema: IApiArrayShape): any[] {
|
|
281
281
|
const { items } = schema;
|
|
282
282
|
const defaultValue = schema.defaultValue || items && items.defaultValue;
|
|
283
283
|
|
|
284
284
|
let { examples=[] } = schema;
|
|
285
|
-
const anyItems = items as
|
|
285
|
+
const anyItems = items as IApiAnyShape;
|
|
286
286
|
if (Array.isArray(anyItems.examples)) {
|
|
287
287
|
examples = examples.concat(anyItems.examples);
|
|
288
288
|
}
|
|
@@ -314,7 +314,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
314
314
|
return [];
|
|
315
315
|
}
|
|
316
316
|
|
|
317
|
-
protected _tupleShapeObject(schema:
|
|
317
|
+
protected _tupleShapeObject(schema: IApiTupleShape): any {
|
|
318
318
|
const { items, examples } = schema;
|
|
319
319
|
if (this.opts.renderExamples && examples && examples.length) {
|
|
320
320
|
const example = examples.find((item) => !!item.structuredValue);
|
|
@@ -343,7 +343,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
343
343
|
return [];
|
|
344
344
|
}
|
|
345
345
|
|
|
346
|
-
protected _anyShapeObject(schema:
|
|
346
|
+
protected _anyShapeObject(schema: IApiAnyShape): any {
|
|
347
347
|
const { and=[], xone=[], or=[] } = schema;
|
|
348
348
|
if (and.length) {
|
|
349
349
|
let result: any = {};
|
|
@@ -379,7 +379,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
379
379
|
/**
|
|
380
380
|
* @returns The value for the property or undefined when cannot generate the value.
|
|
381
381
|
*/
|
|
382
|
-
protected _propertyShapeObject(schema:
|
|
382
|
+
protected _propertyShapeObject(schema: IApiPropertyShape): any | undefined {
|
|
383
383
|
const { minCount=0 } = schema;
|
|
384
384
|
if (minCount === 0 && !this.opts.renderOptional) {
|
|
385
385
|
return undefined;
|
|
@@ -398,7 +398,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
398
398
|
// return ApiSchemaValues.readTypedValue(value, /** @type IScalarShape */ (range).dataType);
|
|
399
399
|
// }
|
|
400
400
|
// }
|
|
401
|
-
const anyRange = range as
|
|
401
|
+
const anyRange = range as IApiAnyShape;
|
|
402
402
|
return this._scalarShapeObject(anyRange);
|
|
403
403
|
}
|
|
404
404
|
return this.toObject(range);
|
|
@@ -407,7 +407,7 @@ export class ShapeJsonSchemaGenerator extends ShapeBase {
|
|
|
407
407
|
/**
|
|
408
408
|
* @param example The example to turn into a JS object
|
|
409
409
|
*/
|
|
410
|
-
protected _exampleToObject(example?:
|
|
410
|
+
protected _exampleToObject(example?: IApiDataExample): any {
|
|
411
411
|
if (example && example.structuredValue) {
|
|
412
412
|
const jsonGenerator = new JsonDataNodeGenerator();
|
|
413
413
|
return jsonGenerator.processNode(example.structuredValue);
|
|
@@ -3,7 +3,7 @@ import { AmfNamespace as ns } from "../definitions/Namespace.js";
|
|
|
3
3
|
import { ShapeBase } from './ShapeBase.js';
|
|
4
4
|
import { XmlDataNodeGenerator } from '../data-node/XmlDataNodeGenerator.js';
|
|
5
5
|
import { collectNodeProperties, formatXmlValue, getUnionMember } from '../Utils.js';
|
|
6
|
-
import {
|
|
6
|
+
import { IApiAnyShape, IApiArrayShape, IApiDataExample, IApiDataNodeUnion, IApiNodeShape, IApiPropertyShape, IApiScalarShape, IShapeUnion, IApiUnionShape } from "../definitions/Shapes.js";
|
|
7
7
|
|
|
8
8
|
interface IProcessNodeOptions {
|
|
9
9
|
forceName?: string;
|
|
@@ -27,7 +27,7 @@ interface ICollectExamplesOptions {
|
|
|
27
27
|
export const normalizeXmlTagName = (name: string): string => name.replace(/[^a-zA-Z0-9-_.]/g, '');
|
|
28
28
|
const UNKNOWN_TYPE = 'unknown-type';
|
|
29
29
|
|
|
30
|
-
export function shapeToXmlTagName(shape:
|
|
30
|
+
export function shapeToXmlTagName(shape: IApiAnyShape): string {
|
|
31
31
|
const { name, inherits=[], xmlSerialization } = shape;
|
|
32
32
|
let label: string | undefined = xmlSerialization && xmlSerialization.name ? xmlSerialization.name : name || UNKNOWN_TYPE;
|
|
33
33
|
if (label === 'schema' && inherits.length) {
|
|
@@ -56,13 +56,13 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
56
56
|
processNode(schema: IShapeUnion, options: IProcessNodeOptions = {}): string {
|
|
57
57
|
const { types } = schema;
|
|
58
58
|
if (types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
|
|
59
|
-
return this._scalarShapeObject(schema as
|
|
59
|
+
return this._scalarShapeObject(schema as IApiScalarShape, options);
|
|
60
60
|
}
|
|
61
61
|
if (types.includes(ns.w3.shacl.NodeShape)) {
|
|
62
|
-
return this._nodeShapeObject(schema as
|
|
62
|
+
return this._nodeShapeObject(schema as IApiNodeShape, options);
|
|
63
63
|
}
|
|
64
64
|
if (types.includes(ns.aml.vocabularies.shapes.UnionShape)) {
|
|
65
|
-
return this._unionShapeObject(schema as
|
|
65
|
+
return this._unionShapeObject(schema as IApiUnionShape);
|
|
66
66
|
}
|
|
67
67
|
if (types.includes(ns.aml.vocabularies.shapes.FileShape)) {
|
|
68
68
|
return this._fileShapeObject();
|
|
@@ -74,9 +74,9 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
74
74
|
return this._tupleShapeObject();
|
|
75
75
|
}
|
|
76
76
|
if (types.includes(ns.aml.vocabularies.shapes.ArrayShape) || types.includes(ns.aml.vocabularies.shapes.MatrixShape)) {
|
|
77
|
-
return this._arrayShapeObject(schema as
|
|
77
|
+
return this._arrayShapeObject(schema as IApiArrayShape, options);
|
|
78
78
|
}
|
|
79
|
-
return this._anyShapeObject(schema as
|
|
79
|
+
return this._anyShapeObject(schema as IApiAnyShape);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
82
|
/**
|
|
@@ -94,12 +94,12 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
94
94
|
return getUnionMember(anyOf, selectedUnions);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
|
-
protected _collectProperties(schema:
|
|
97
|
+
protected _collectProperties(schema: IApiNodeShape): IApiPropertyShape[] {
|
|
98
98
|
const { selectedUnions } = this.opts;
|
|
99
99
|
return collectNodeProperties(schema, selectedUnions);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
|
-
protected _nodeShapeObject(schema:
|
|
102
|
+
protected _nodeShapeObject(schema: IApiNodeShape, options: IProcessNodeOptions={}): string {
|
|
103
103
|
const label = options.forceName || shapeToXmlTagName(schema);
|
|
104
104
|
const parts = [];
|
|
105
105
|
const currentIndent = (options.indent || 0);
|
|
@@ -118,7 +118,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
118
118
|
if (minCount === 0 && !this.opts.renderOptional || !range) {
|
|
119
119
|
return;
|
|
120
120
|
}
|
|
121
|
-
const anyRange = range as
|
|
121
|
+
const anyRange = range as IApiAnyShape;
|
|
122
122
|
if (anyRange.xmlSerialization) {
|
|
123
123
|
// Adds to the parent attributes list.
|
|
124
124
|
// When a non-scalar shape has `attribute` serialization this is an API spec error.
|
|
@@ -151,7 +151,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
151
151
|
return parts.join('\n');
|
|
152
152
|
}
|
|
153
153
|
|
|
154
|
-
protected _scalarShapeObject(schema:
|
|
154
|
+
protected _scalarShapeObject(schema: IApiScalarShape, options: IProcessNodeOptions={}): any {
|
|
155
155
|
const { xmlSerialization, defaultValue } = schema;
|
|
156
156
|
let content;
|
|
157
157
|
if (defaultValue) {
|
|
@@ -186,7 +186,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
186
186
|
return parts.join('');
|
|
187
187
|
}
|
|
188
188
|
|
|
189
|
-
protected _nilShapeObject(schema:
|
|
189
|
+
protected _nilShapeObject(schema: IApiScalarShape, options: IProcessNodeOptions={}): any|undefined {
|
|
190
190
|
const { xmlSerialization } = schema;
|
|
191
191
|
const content = '';
|
|
192
192
|
let label = options.forceName || shapeToXmlTagName(schema);
|
|
@@ -218,27 +218,27 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
218
218
|
/**
|
|
219
219
|
* @returns The value for the property or undefined when cannot generate the value.
|
|
220
220
|
*/
|
|
221
|
-
protected _propertyShapeObject(schema:
|
|
221
|
+
protected _propertyShapeObject(schema: IApiPropertyShape, options: IProcessNodeOptions = {}): string|undefined {
|
|
222
222
|
const { range, minCount=0 } = schema;
|
|
223
223
|
if (minCount === 0 && !this.opts.renderOptional || !range) {
|
|
224
224
|
return undefined;
|
|
225
225
|
}
|
|
226
226
|
const { types } = range;
|
|
227
|
-
const name = shapeToXmlTagName(schema as
|
|
227
|
+
const name = shapeToXmlTagName(schema as IApiAnyShape);
|
|
228
228
|
if (types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
|
|
229
|
-
return this._scalarShapeObject(range as
|
|
229
|
+
return this._scalarShapeObject(range as IApiScalarShape, { ...options });
|
|
230
230
|
}
|
|
231
231
|
if (types.includes(ns.aml.vocabularies.shapes.NilShape)) {
|
|
232
|
-
return this._nilShapeObject(range as
|
|
232
|
+
return this._nilShapeObject(range as IApiScalarShape, { ...options, forceName: name });
|
|
233
233
|
}
|
|
234
234
|
if (types.includes(ns.aml.vocabularies.shapes.RecursiveShape)) {
|
|
235
235
|
return undefined;
|
|
236
236
|
}
|
|
237
237
|
if (types.includes(ns.w3.shacl.NodeShape)) {
|
|
238
|
-
return this._nodePropertyObject(schema as
|
|
238
|
+
return this._nodePropertyObject(schema as IApiPropertyShape<IApiNodeShape>, options);
|
|
239
239
|
}
|
|
240
240
|
if (types.includes(ns.aml.vocabularies.shapes.ArrayShape) || types.includes(ns.aml.vocabularies.shapes.MatrixShape)) {
|
|
241
|
-
return this._nodePropertyArray(schema as
|
|
241
|
+
return this._nodePropertyArray(schema as IApiPropertyShape<IApiArrayShape>, options);
|
|
242
242
|
}
|
|
243
243
|
return this.processNode(range, { ...options, forceName: name });
|
|
244
244
|
}
|
|
@@ -248,17 +248,17 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
248
248
|
return undefined;
|
|
249
249
|
}
|
|
250
250
|
const { isWrapped, nodeName, tagFill='', indent = 0 } = opts;
|
|
251
|
-
let { examples=[] } = (schema as
|
|
251
|
+
let { examples=[] } = (schema as IApiAnyShape);
|
|
252
252
|
const { inherits } = schema;
|
|
253
253
|
if (Array.isArray(inherits) && inherits.length) {
|
|
254
254
|
inherits.forEach((parent) => {
|
|
255
255
|
let node = parent;
|
|
256
256
|
if (node.types.includes(ns.aml.vocabularies.shapes.UnionShape)) {
|
|
257
|
-
const union = node as
|
|
257
|
+
const union = node as IApiUnionShape;
|
|
258
258
|
const { anyOf=[] } = union;
|
|
259
259
|
node = this._readCurrentUnion(anyOf);
|
|
260
260
|
}
|
|
261
|
-
const anyShape = node as
|
|
261
|
+
const anyShape = node as IApiAnyShape;
|
|
262
262
|
if (Array.isArray(anyShape.examples) && anyShape.examples.length) {
|
|
263
263
|
examples = examples.concat(anyShape.examples);
|
|
264
264
|
}
|
|
@@ -292,13 +292,13 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
292
292
|
return new Array(indent * 2 + offset).fill(' ').join('');
|
|
293
293
|
}
|
|
294
294
|
|
|
295
|
-
protected _nodePropertyObject(schema:
|
|
295
|
+
protected _nodePropertyObject(schema: IApiPropertyShape<IApiNodeShape>, options: IProcessNodeOptions = {}): string {
|
|
296
296
|
const parts: string[] = [];
|
|
297
297
|
const name = normalizeXmlTagName(String(schema.name));
|
|
298
298
|
const { indent=0 } = options;
|
|
299
299
|
const baseTabs = this._createTabs(indent);
|
|
300
300
|
let value: string;
|
|
301
|
-
const range = schema.range as
|
|
301
|
+
const range = schema.range as IApiNodeShape;
|
|
302
302
|
const exampleValue = this._collectExamples(range, {
|
|
303
303
|
tagFill: baseTabs,
|
|
304
304
|
indent: indent + 1,
|
|
@@ -316,7 +316,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
316
316
|
if (minCount === 0 && !this.opts.renderOptional) {
|
|
317
317
|
return;
|
|
318
318
|
}
|
|
319
|
-
const anyRange = range as
|
|
319
|
+
const anyRange = range as IApiAnyShape;
|
|
320
320
|
|
|
321
321
|
if (anyRange.xmlSerialization) {
|
|
322
322
|
const { prefix, attribute } = anyRange.xmlSerialization;
|
|
@@ -350,8 +350,8 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
350
350
|
return parts.join('\n');
|
|
351
351
|
}
|
|
352
352
|
|
|
353
|
-
protected _nodePropertyArray(schema:
|
|
354
|
-
const range = schema.range as
|
|
353
|
+
protected _nodePropertyArray(schema: IApiPropertyShape<IApiArrayShape>, options: IProcessNodeOptions = {}): string {
|
|
354
|
+
const range = schema.range as IApiArrayShape;
|
|
355
355
|
const parts: string[] = [];
|
|
356
356
|
let name: string;
|
|
357
357
|
if (range.xmlSerialization && range.xmlSerialization.name) {
|
|
@@ -375,7 +375,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
375
375
|
return parts.join('\n');
|
|
376
376
|
}
|
|
377
377
|
|
|
378
|
-
protected _arrayShapeObject(schema:
|
|
378
|
+
protected _arrayShapeObject(schema: IApiArrayShape, options: IProcessNodeOptions={}): string {
|
|
379
379
|
const { items } = schema;
|
|
380
380
|
const isScalarItems = !!items && items.types.includes(ns.aml.vocabularies.shapes.ScalarShape);
|
|
381
381
|
// the name is either from the XML serialization info, or the parent property.
|
|
@@ -605,8 +605,8 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
605
605
|
* @param schema The array schema
|
|
606
606
|
* @param options Processing options.
|
|
607
607
|
*/
|
|
608
|
-
protected _scalarItems(schema:
|
|
609
|
-
const items = schema.items as
|
|
608
|
+
protected _scalarItems(schema: IApiArrayShape<IApiScalarShape>, options: IProcessNodeOptions={}): string {
|
|
609
|
+
const items = schema.items as IApiScalarShape;
|
|
610
610
|
const currentIndent = (options.indent || 0);
|
|
611
611
|
const tagFill = new Array(currentIndent * 2).fill(' ').join('');
|
|
612
612
|
|
|
@@ -661,8 +661,8 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
661
661
|
* @param schema The array shape with item that is NodeShape.
|
|
662
662
|
* @param options Rendering options.
|
|
663
663
|
*/
|
|
664
|
-
protected _nodeItems(schema:
|
|
665
|
-
const items = schema.items as
|
|
664
|
+
protected _nodeItems(schema: IApiArrayShape<IApiNodeShape>, options: IProcessNodeOptions={}): string {
|
|
665
|
+
const items = schema.items as IApiNodeShape;
|
|
666
666
|
const currentIndent = (options.indent || 0);
|
|
667
667
|
const tagFill = new Array(currentIndent * 2).fill(' ').join('');
|
|
668
668
|
const isWrapped = schema.xmlSerialization && !!schema.xmlSerialization.wrapped;
|
|
@@ -729,7 +729,7 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
729
729
|
/**
|
|
730
730
|
* @param example The example to turn into a JS object
|
|
731
731
|
*/
|
|
732
|
-
protected _exampleToObject(example?:
|
|
732
|
+
protected _exampleToObject(example?: IApiDataExample): any {
|
|
733
733
|
if (example && example.structuredValue) {
|
|
734
734
|
const generator = new XmlDataNodeGenerator();
|
|
735
735
|
return generator.generate(example.structuredValue);
|
|
@@ -737,15 +737,15 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
737
737
|
return undefined;
|
|
738
738
|
}
|
|
739
739
|
|
|
740
|
-
protected _unionShapeObject(schema:
|
|
740
|
+
protected _unionShapeObject(schema: IApiUnionShape, options: IProcessNodeOptions={}): any {
|
|
741
741
|
let { anyOf=[], examples=[] } = schema;
|
|
742
742
|
if (Array.isArray(schema.inherits) && schema.inherits) {
|
|
743
743
|
schema.inherits.forEach((parent) => {
|
|
744
|
-
const anyParent = parent as
|
|
744
|
+
const anyParent = parent as IApiAnyShape;
|
|
745
745
|
if (Array.isArray(anyParent.examples) && anyParent.examples.length) {
|
|
746
746
|
examples = examples.concat(anyParent.examples);
|
|
747
747
|
}
|
|
748
|
-
const typed = parent as
|
|
748
|
+
const typed = parent as IApiUnionShape;
|
|
749
749
|
if (Array.isArray(typed.anyOf) && typed.anyOf.length) {
|
|
750
750
|
anyOf = anyOf.concat(typed.anyOf);
|
|
751
751
|
}
|
|
@@ -787,10 +787,10 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
787
787
|
* @param schema The schema with unions
|
|
788
788
|
* @param defaultValue The definition of a default value.
|
|
789
789
|
*/
|
|
790
|
-
protected _unionDefaultValue(schema: IShapeUnion, defaultValue:
|
|
790
|
+
protected _unionDefaultValue(schema: IShapeUnion, defaultValue: IApiDataNodeUnion, options: IProcessNodeOptions = {}): any|undefined {
|
|
791
791
|
const gen = new XmlDataNodeGenerator();
|
|
792
792
|
const value = gen.generate(defaultValue);
|
|
793
|
-
const anySchema = schema as
|
|
793
|
+
const anySchema = schema as IApiAnyShape;
|
|
794
794
|
const label = shapeToXmlTagName(anySchema);
|
|
795
795
|
const currentIndent = (options.indent || 0);
|
|
796
796
|
const rootFill = new Array(currentIndent*2).fill(' ').join('');
|
|
@@ -815,23 +815,23 @@ export class ShapeXmlSchemaGenerator extends ShapeBase {
|
|
|
815
815
|
return undefined;
|
|
816
816
|
}
|
|
817
817
|
|
|
818
|
-
protected _anyShapeObject(schema:
|
|
818
|
+
protected _anyShapeObject(schema: IApiAnyShape): string {
|
|
819
819
|
const { and=[], xone=[], or=[] } = schema;
|
|
820
820
|
if (and.length) {
|
|
821
821
|
// we combine all properties together under `schema` with changed properties
|
|
822
|
-
const copy = JsonCore.clone(schema) as
|
|
822
|
+
const copy = JsonCore.clone(schema) as IApiNodeShape;
|
|
823
823
|
copy.and = [];
|
|
824
824
|
copy.properties = [];
|
|
825
825
|
and.forEach((item) => {
|
|
826
826
|
const { types } = item;
|
|
827
827
|
if (types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
|
|
828
|
-
const typed = item as
|
|
828
|
+
const typed = item as IApiScalarShape;
|
|
829
829
|
copy.properties.push(typed);
|
|
830
830
|
} else if (types.includes(ns.w3.shacl.NodeShape)) {
|
|
831
|
-
const typed = item as
|
|
831
|
+
const typed = item as IApiNodeShape;
|
|
832
832
|
typed.properties.forEach(i => copy.properties.push(i));
|
|
833
833
|
} else if (types.includes(ns.aml.vocabularies.shapes.ArrayShape) || types.includes(ns.aml.vocabularies.shapes.MatrixShape)) {
|
|
834
|
-
const typed = item as
|
|
834
|
+
const typed = item as IApiArrayShape;
|
|
835
835
|
if (typed.items) {
|
|
836
836
|
copy.properties.push(typed.items)
|
|
837
837
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { IApiParseResult, IAmfServiceProcessingOptions } from "../../amf/Parsing.js";
|
|
2
2
|
import { ContextEvent } from "../BaseEvents.js";
|
|
3
3
|
import { AmfEventTypes } from './AmfEventTypes.js'
|
|
4
4
|
|
|
@@ -12,12 +12,12 @@ export class AmfEvents {
|
|
|
12
12
|
* @param packaging Default to `zip`.
|
|
13
13
|
* @returns Promise resolved to the AMF json-ld model.
|
|
14
14
|
*/
|
|
15
|
-
static async processApiLink(url: string, mainFile?: string, md5?: string, packaging?: string, target: EventTarget = window): Promise<
|
|
15
|
+
static async processApiLink(url: string, mainFile?: string, md5?: string, packaging?: string, target: EventTarget = window): Promise<IApiParseResult> {
|
|
16
16
|
const e = new ContextEvent(AmfEventTypes.processApiLink, {
|
|
17
17
|
url, mainFile, md5, packaging,
|
|
18
18
|
});
|
|
19
19
|
target.dispatchEvent(e);
|
|
20
|
-
return (e.detail.result as unknown) as Promise<
|
|
20
|
+
return (e.detail.result as unknown) as Promise<IApiParseResult>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -26,12 +26,12 @@ export class AmfEvents {
|
|
|
26
26
|
* @param opts Processing options
|
|
27
27
|
* @returns Promise resolved to the AMF json-ld model
|
|
28
28
|
*/
|
|
29
|
-
static async processBuffer(buffer: Buffer, opts?:
|
|
29
|
+
static async processBuffer(buffer: Buffer, opts?: IAmfServiceProcessingOptions, target: EventTarget = window): Promise<IApiParseResult> {
|
|
30
30
|
const e = new ContextEvent(AmfEventTypes.processBuffer, {
|
|
31
31
|
buffer, opts,
|
|
32
32
|
});
|
|
33
33
|
target.dispatchEvent(e);
|
|
34
|
-
return (e.detail.result as unknown) as Promise<
|
|
34
|
+
return (e.detail.result as unknown) as Promise<IApiParseResult>;
|
|
35
35
|
}
|
|
36
36
|
|
|
37
37
|
/**
|
|
@@ -42,12 +42,12 @@ export class AmfEvents {
|
|
|
42
42
|
* @param file File to process.
|
|
43
43
|
* @returns Promise resolved to the AMF json-ld model
|
|
44
44
|
*/
|
|
45
|
-
static async processApiFile(file: File | Blob, target: EventTarget = window): Promise<
|
|
45
|
+
static async processApiFile(file: File | Blob, target: EventTarget = window): Promise<IApiParseResult> {
|
|
46
46
|
const e = new ContextEvent(AmfEventTypes.processApiFile, {
|
|
47
47
|
file,
|
|
48
48
|
});
|
|
49
49
|
target.dispatchEvent(e);
|
|
50
|
-
return (e.detail.result as unknown) as Promise<
|
|
50
|
+
return (e.detail.result as unknown) as Promise<IApiParseResult>;
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/**
|
package/src/lib/timers/Timers.ts
CHANGED
|
@@ -7,3 +7,17 @@ export function sleep(timeout = 0): Promise<void> {
|
|
|
7
7
|
setTimeout(() => resolve(), timeout);
|
|
8
8
|
});
|
|
9
9
|
}
|
|
10
|
+
|
|
11
|
+
/**
|
|
12
|
+
* Resolves after requestAnimationFrame.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* await nextFrame();
|
|
16
|
+
*
|
|
17
|
+
* @returns Promise that resolved after requestAnimationFrame
|
|
18
|
+
*/
|
|
19
|
+
export function nextFrame(): Promise<void> {
|
|
20
|
+
return new Promise(resolve => {
|
|
21
|
+
requestAnimationFrame(() => resolve());
|
|
22
|
+
});
|
|
23
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/* eslint-disable import/export */
|
|
2
|
-
import {
|
|
2
|
+
import { IApiXmlSerializer } from "../../amf/definitions/Shapes.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* A general schema definition for a property. This is propagated to all bindings (when they support these properties).
|
|
@@ -76,7 +76,7 @@ export interface IPropertyWebBindings {
|
|
|
76
76
|
/**
|
|
77
77
|
* The XML encoding instructions.
|
|
78
78
|
*/
|
|
79
|
-
xml?:
|
|
79
|
+
xml?: IApiXmlSerializer;
|
|
80
80
|
/**
|
|
81
81
|
* Only valid for the `file` property type.
|
|
82
82
|
* The list of file mime types.
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { Core as JsonCore } from '@api-client/json';
|
|
2
2
|
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js';
|
|
3
|
-
import {
|
|
3
|
+
import { IApiAssociationShape, IApiPropertyShape } from '../../amf/definitions/Shapes.js';
|
|
4
4
|
import v4 from '../../lib/uuid.js';
|
|
5
5
|
import { IThing, Thing } from "../Thing.js";
|
|
6
6
|
import { DataEntity, IDataEntity } from './DataEntity.js';
|
|
@@ -57,7 +57,7 @@ export interface IDataAssociation {
|
|
|
57
57
|
* Note, schema can only occur on an adapted property. Has no effect on the "main"
|
|
58
58
|
* property.
|
|
59
59
|
*/
|
|
60
|
-
schema?:
|
|
60
|
+
schema?: IApiAssociationShape;
|
|
61
61
|
/**
|
|
62
62
|
* The key of the association that is adapted by this association.
|
|
63
63
|
* Adapted associations can manipulate the shape of the schema for the association.
|
|
@@ -121,7 +121,7 @@ export class DataAssociation {
|
|
|
121
121
|
* Note, schema can only occur on an adapted property. Has no effect on the "main"
|
|
122
122
|
* property.
|
|
123
123
|
*/
|
|
124
|
-
schema?:
|
|
124
|
+
schema?: IApiAssociationShape;
|
|
125
125
|
|
|
126
126
|
/**
|
|
127
127
|
* The key of the association that is adapted by this association.
|
|
@@ -355,7 +355,7 @@ export class DataAssociation {
|
|
|
355
355
|
*
|
|
356
356
|
* @returns AMF property shape definition.
|
|
357
357
|
*/
|
|
358
|
-
toApiShape():
|
|
358
|
+
toApiShape(): IApiPropertyShape {
|
|
359
359
|
const serializer = new AmfShapeGenerator();
|
|
360
360
|
return serializer.associationProperty(this);
|
|
361
361
|
}
|
|
@@ -5,7 +5,7 @@ import { DataProperty, DataPropertyType } from "./DataProperty.js";
|
|
|
5
5
|
import { DataAssociation } from "./DataAssociation.js";
|
|
6
6
|
import { IBreadcrumb } from "../store/Breadcrumb.js";
|
|
7
7
|
import { DataModel } from "./DataModel.js";
|
|
8
|
-
import {
|
|
8
|
+
import { IApiNodeShape, IShapeUnion } from "../../amf/definitions/Shapes.js";
|
|
9
9
|
import { AmfShapeGenerator } from "../../amf/AmfShapeGenerator.js";
|
|
10
10
|
import { ApiSchemaGenerator } from "../../amf/ApiSchemaGenerator.js";
|
|
11
11
|
import { IShapeRenderOptions } from "../../amf/shape/ShapeBase.js";
|
|
@@ -72,7 +72,7 @@ export interface IDataEntity {
|
|
|
72
72
|
*
|
|
73
73
|
* - can only occur on an adapted property. Has no effect on the "main" property.
|
|
74
74
|
*/
|
|
75
|
-
schema?:
|
|
75
|
+
schema?: IApiNodeShape;
|
|
76
76
|
|
|
77
77
|
/**
|
|
78
78
|
* The key of the entity that is adapted by this entity.
|
|
@@ -2,7 +2,7 @@ import { Core as JsonCore } from '@api-client/json';
|
|
|
2
2
|
import { IThing, Thing } from "../Thing.js";
|
|
3
3
|
import v4 from '../../lib/uuid.js';
|
|
4
4
|
import { DataNamespace } from "./DataNamespace.js";
|
|
5
|
-
import {
|
|
5
|
+
import { IApiPropertyShape } from "../../amf/definitions/Shapes.js";
|
|
6
6
|
import { AmfShapeGenerator } from '../../amf/AmfShapeGenerator.js';
|
|
7
7
|
import { IPropertyBindings, IPropertySchema } from './Bindings.js';
|
|
8
8
|
|
|
@@ -478,7 +478,7 @@ export class DataProperty {
|
|
|
478
478
|
*
|
|
479
479
|
* @returns AMF property shape definition.
|
|
480
480
|
*/
|
|
481
|
-
toApiShape():
|
|
481
|
+
toApiShape(): IApiPropertyShape {
|
|
482
482
|
const serializer = new AmfShapeGenerator();
|
|
483
483
|
return serializer.property(this);
|
|
484
484
|
}
|