@api-client/core 0.7.12 → 0.8.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 (88) hide show
  1. package/SECURITY.md +14 -0
  2. package/build/browser.d.ts +6 -0
  3. package/build/browser.js +6 -0
  4. package/build/browser.js.map +1 -1
  5. package/build/index.d.ts +6 -0
  6. package/build/index.js +6 -0
  7. package/build/index.js.map +1 -1
  8. package/build/src/amf/AmfMixin.d.ts +55 -42
  9. package/build/src/amf/AmfMixin.js +9 -3
  10. package/build/src/amf/AmfMixin.js.map +1 -1
  11. package/build/src/amf/AmfSerializer.d.ts +72 -72
  12. package/build/src/amf/AmfSerializer.js +9 -4
  13. package/build/src/amf/AmfSerializer.js.map +1 -1
  14. package/build/src/amf/AmfShapeGenerator.d.ts +17 -17
  15. package/build/src/amf/AmfShapeGenerator.js +3 -3
  16. package/build/src/amf/AmfShapeGenerator.js.map +1 -1
  17. package/build/src/amf/AmfTypes.d.ts +16 -16
  18. package/build/src/amf/AmfTypes.js +16 -16
  19. package/build/src/amf/AmfTypes.js.map +1 -1
  20. package/build/src/amf/ApiExampleGenerator.d.ts +3 -3
  21. package/build/src/amf/ApiExampleGenerator.js.map +1 -1
  22. package/build/src/amf/ApiMonacoSchemaGenerator.d.ts +6 -6
  23. package/build/src/amf/ApiMonacoSchemaGenerator.js.map +1 -1
  24. package/build/src/amf/ApiSchemaGenerator.d.ts +2 -2
  25. package/build/src/amf/ApiSchemaGenerator.js.map +1 -1
  26. package/build/src/amf/ApiSchemaValues.d.ts +12 -12
  27. package/build/src/amf/ApiSchemaValues.js.map +1 -1
  28. package/build/src/amf/Parsing.d.ts +5 -5
  29. package/build/src/amf/Utils.d.ts +6 -6
  30. package/build/src/amf/Utils.js.map +1 -1
  31. package/build/src/amf/data-node/DataNodeBase.d.ts +5 -5
  32. package/build/src/amf/data-node/DataNodeBase.js.map +1 -1
  33. package/build/src/amf/data-node/JsonDataNodeGenerator.d.ts +2 -2
  34. package/build/src/amf/data-node/JsonDataNodeGenerator.js.map +1 -1
  35. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.d.ts +2 -2
  36. package/build/src/amf/data-node/UrlEncodedDataNodeGenerator.js.map +1 -1
  37. package/build/src/amf/data-node/XmlDataNodeGenerator.d.ts +2 -2
  38. package/build/src/amf/data-node/XmlDataNodeGenerator.js.map +1 -1
  39. package/build/src/amf/definitions/Amf.d.ts +339 -339
  40. package/build/src/amf/definitions/Api.d.ts +158 -158
  41. package/build/src/amf/definitions/Base.d.ts +5 -5
  42. package/build/src/amf/definitions/Shapes.d.ts +46 -46
  43. package/build/src/amf/definitions/Shapes.js +11 -11
  44. package/build/src/amf/definitions/Shapes.js.map +1 -1
  45. package/build/src/amf/models/AmfDataNode.d.ts +5 -5
  46. package/build/src/amf/models/AmfDataNode.js +4 -4
  47. package/build/src/amf/models/AmfDataNode.js.map +1 -1
  48. package/build/src/amf/shape/ShapeBase.d.ts +13 -13
  49. package/build/src/amf/shape/ShapeBase.js.map +1 -1
  50. package/build/src/amf/shape/ShapeJsonSchemaGenerator.d.ts +13 -13
  51. package/build/src/amf/shape/ShapeJsonSchemaGenerator.js.map +1 -1
  52. package/build/src/amf/shape/ShapeXmlSchemaGenerator.d.ts +16 -16
  53. package/build/src/amf/shape/ShapeXmlSchemaGenerator.js.map +1 -1
  54. package/build/src/events/amf/AmfEvents.d.ts +4 -4
  55. package/build/src/events/amf/AmfEvents.js.map +1 -1
  56. package/build/src/models/data/Bindings.d.ts +2 -2
  57. package/build/src/models/data/DataAssociation.d.ts +4 -4
  58. package/build/src/models/data/DataAssociation.js.map +1 -1
  59. package/build/src/models/data/DataEntity.d.ts +2 -2
  60. package/build/src/models/data/DataProperty.d.ts +2 -2
  61. package/package.json +1 -1
  62. package/src/amf/AmfMixin.ts +124 -117
  63. package/src/amf/AmfSerializer.ts +245 -240
  64. package/src/amf/AmfShapeGenerator.ts +23 -23
  65. package/src/amf/AmfTypes.ts +16 -16
  66. package/src/amf/ApiExampleGenerator.ts +4 -4
  67. package/src/amf/ApiMonacoSchemaGenerator.ts +11 -11
  68. package/src/amf/ApiSchemaGenerator.ts +3 -3
  69. package/src/amf/ApiSchemaValues.ts +21 -21
  70. package/src/amf/Parsing.ts +5 -5
  71. package/src/amf/Utils.ts +15 -15
  72. package/src/amf/data-node/DataNodeBase.ts +8 -8
  73. package/src/amf/data-node/JsonDataNodeGenerator.ts +2 -2
  74. package/src/amf/data-node/UrlEncodedDataNodeGenerator.ts +2 -2
  75. package/src/amf/data-node/XmlDataNodeGenerator.ts +2 -2
  76. package/src/amf/definitions/Amf.ts +315 -314
  77. package/src/amf/definitions/Api.ts +158 -157
  78. package/src/amf/definitions/Base.ts +5 -5
  79. package/src/amf/definitions/Shapes.ts +60 -60
  80. package/src/amf/models/AmfDataNode.ts +17 -17
  81. package/src/amf/shape/ShapeBase.ts +16 -16
  82. package/src/amf/shape/ShapeJsonSchemaGenerator.ts +27 -27
  83. package/src/amf/shape/ShapeXmlSchemaGenerator.ts +42 -42
  84. package/src/events/amf/AmfEvents.ts +7 -7
  85. package/src/models/data/Bindings.ts +2 -2
  86. package/src/models/data/DataAssociation.ts +4 -4
  87. package/src/models/data/DataEntity.ts +2 -2
  88. package/src/models/data/DataProperty.ts +2 -2
@@ -1,10 +1,10 @@
1
- import { AnyTypes, ArrayTypes, FileTypes, NodeTypes, PropertyTypes, RecursiveTypes, ScalarTypes, TupleTypes, UnionTypes, XmlSerializationTypes } from '../AmfTypes.js';
2
- import { ApiDocumentation, ApiDocumentSourceMaps } from './Api.js';
3
- import { IDomainProperty } from './Base.js';
1
+ import { IAmfAnyTypes, IAmfArrayTypes, IAmfFileTypes, IAmfNodeTypes, IAmfPropertyTypes, IAmfRecursiveTypes, IAmfScalarTypes, IAmfTupleTypes, IAmfUnionTypes, IAmfXmlSerializationTypes } from '../AmfTypes.js';
2
+ import { IApiDocumentation, IApiDocumentSourceMaps } from './Api.js';
3
+ import { IApiDomainProperty } from './Base.js';
4
4
 
5
- export type IShapeUnion = IScalarShape | INodeShape | IUnionShape | IFileShape | ISchemaShape | IAnyShape | IArrayShape | ITupleShape | IRecursiveShape;
5
+ export type IShapeUnion = IApiScalarShape | IApiNodeShape | IApiUnionShape | IApiFileShape | IApiSchemaShape | IApiAnyShape | IApiArrayShape | IApiTupleShape | IApiRecursiveShape;
6
6
 
7
- export interface IAssociationShape {
7
+ export interface IApiAssociationShape {
8
8
  /**
9
9
  * This is custom property not available in AMF and used with data associations.
10
10
  *
@@ -53,7 +53,7 @@ export interface IAssociationShape {
53
53
  unionType?: 'allOf' | 'anyOf' | 'oneOf' | 'not';
54
54
  }
55
55
 
56
- export interface IDataExample extends IDomainProperty {
56
+ export interface IApiDataExample extends IApiDomainProperty {
57
57
  name?: string;
58
58
  displayName?: string;
59
59
  description?: string;
@@ -61,23 +61,23 @@ export interface IDataExample extends IDomainProperty {
61
61
  * This is the "raw" property of AMF
62
62
  */
63
63
  value?: string;
64
- structuredValue?: IDataNodeUnion;
64
+ structuredValue?: IApiDataNodeUnion;
65
65
  strict: boolean;
66
66
  mediaType?: string;
67
67
  location?: string;
68
- sourceMaps?: ApiDocumentSourceMaps;
68
+ sourceMaps?: IApiDocumentSourceMaps;
69
69
  }
70
70
 
71
- export function xmlSerializer(id: string): IXmlSerializer {
71
+ export function xmlSerializer(id: string): IApiXmlSerializer {
72
72
  return {
73
73
  id: `xml-serializer-${id}`,
74
- types: XmlSerializationTypes,
74
+ types: IAmfXmlSerializationTypes,
75
75
  customDomainProperties: [],
76
76
  };
77
77
  }
78
78
 
79
- export function shape(id: string): IShape {
80
- const result: IShape = {
79
+ export function shape(id: string): IApiShape {
80
+ const result: IApiShape = {
81
81
  id,
82
82
  types: [],
83
83
  values: [],
@@ -90,19 +90,19 @@ export function shape(id: string): IShape {
90
90
  return result;
91
91
  }
92
92
 
93
- export function anyShape(id: string): IAnyShape {
94
- const result: IAnyShape = {
93
+ export function anyShape(id: string): IApiAnyShape {
94
+ const result: IApiAnyShape = {
95
95
  ...shape(id),
96
- types: AnyTypes,
96
+ types: IAmfAnyTypes,
97
97
  examples: [],
98
98
  xmlSerialization: xmlSerializer(id),
99
99
  };
100
100
  return result;
101
101
  }
102
102
 
103
- export function nodeShape(id: string): INodeShape {
103
+ export function nodeShape(id: string): IApiNodeShape {
104
104
  const result = anyShape(id);
105
- result.types = NodeTypes;
105
+ result.types = IAmfNodeTypes;
106
106
  result.id = `node-shape-${id}`;
107
107
  return {
108
108
  ...result,
@@ -113,62 +113,62 @@ export function nodeShape(id: string): INodeShape {
113
113
  };
114
114
  }
115
115
 
116
- export function scalarShape(id: string): IScalarShape {
116
+ export function scalarShape(id: string): IApiScalarShape {
117
117
  const result = anyShape(id);
118
118
  result.id = `scalar-shape-${id}`;
119
- result.types = ScalarTypes;
119
+ result.types = IAmfScalarTypes;
120
120
  return result;
121
121
  }
122
122
 
123
- export function unionShape(id: string): IUnionShape {
123
+ export function unionShape(id: string): IApiUnionShape {
124
124
  const result = anyShape(id);
125
125
  result.id = `union-shape-${id}`;
126
- result.types = UnionTypes;
126
+ result.types = IAmfUnionTypes;
127
127
  return { ...result, anyOf: [] };
128
128
  }
129
129
 
130
- export function fileShape(id: string): IFileShape {
130
+ export function fileShape(id: string): IApiFileShape {
131
131
  const result = anyShape(id);
132
132
  result.id = `file-shape-${id}`;
133
- result.types = FileTypes;
133
+ result.types = IAmfFileTypes;
134
134
  return result;
135
135
  }
136
136
 
137
- export function arrayShape(id: string): IArrayShape {
137
+ export function arrayShape(id: string): IApiArrayShape {
138
138
  const result = anyShape(id);
139
139
  result.id = `array-shape-${id}`;
140
- result.types = ArrayTypes;
140
+ result.types = IAmfArrayTypes;
141
141
  return result;
142
142
  }
143
143
 
144
- export function tupleShape(id: string): ITupleShape {
144
+ export function tupleShape(id: string): IApiTupleShape {
145
145
  const result = anyShape(id);
146
146
  result.id = `tuple-shape-${id}`;
147
- result.types = TupleTypes;
147
+ result.types = IAmfTupleTypes;
148
148
  return { ...result, items: [] };
149
149
  }
150
150
 
151
- export function propertyShape(id: string): IPropertyShape {
151
+ export function propertyShape(id: string): IApiPropertyShape {
152
152
  const result = anyShape(id);
153
- result.types = PropertyTypes;
153
+ result.types = IAmfPropertyTypes;
154
154
  return result;
155
155
  }
156
156
 
157
- export function recursiveShape(id: string, fixedId?: string): IRecursiveShape {
158
- const result: IRecursiveShape = {
157
+ export function recursiveShape(id: string, fixedId?: string): IApiRecursiveShape {
158
+ const result: IApiRecursiveShape = {
159
159
  ...shape(id),
160
160
  id: `recursive-${id}`,
161
- types: RecursiveTypes,
161
+ types: IAmfRecursiveTypes,
162
162
  fixPoint: fixedId || '',
163
163
  };
164
164
  return result;
165
165
  }
166
166
 
167
- export interface IShape extends IDomainProperty {
167
+ export interface IApiShape extends IApiDomainProperty {
168
168
  /**
169
169
  * Enum values for this shape.
170
170
  */
171
- values: IDataNodeUnion[];
171
+ values: IApiDataNodeUnion[];
172
172
  /**
173
173
  * The list of shapes that this shape inherits from
174
174
  */
@@ -204,7 +204,7 @@ export interface IShape extends IDomainProperty {
204
204
  /**
205
205
  * The description of the default value of the shape.
206
206
  */
207
- defaultValue?: IDataNodeUnion;
207
+ defaultValue?: IApiDataNodeUnion;
208
208
  /**
209
209
  * Whether the shape is deprecated.
210
210
  */
@@ -222,13 +222,13 @@ export interface IShape extends IDomainProperty {
222
222
  * A label that appeared on a link.
223
223
  */
224
224
  linkLabel?: string;
225
- sourceMaps?: ApiDocumentSourceMaps;
225
+ sourceMaps?: IApiDocumentSourceMaps;
226
226
  }
227
227
 
228
228
  /**
229
229
  * A property of an API operation.
230
230
  */
231
- export interface IPropertyShape<T = IShapeUnion> extends IShape {
231
+ export interface IApiPropertyShape<T = IShapeUnion> extends IApiShape {
232
232
  /**
233
233
  * The path of the property. Essentially, it is link generated by the AMF library
234
234
  * where the fragment part is the name of the property.
@@ -245,22 +245,22 @@ export interface IPropertyShape<T = IShapeUnion> extends IShape {
245
245
  maxCount?: number;
246
246
  }
247
247
 
248
- export interface IAnyShape extends IShape {
249
- documentation?: ApiDocumentation;
248
+ export interface IApiAnyShape extends IApiShape {
249
+ documentation?: IApiDocumentation;
250
250
  /**
251
251
  * Description of how the shape should be serialized as XML.
252
252
  */
253
- xmlSerialization: IXmlSerializer;
253
+ xmlSerialization: IApiXmlSerializer;
254
254
  /**
255
255
  * Examples defined for the shape.
256
256
  */
257
- examples: IDataExample[];
257
+ examples: IApiDataExample[];
258
258
  }
259
259
 
260
260
  /**
261
261
  * Describes an object shape.
262
262
  */
263
- export interface INodeShape extends IAnyShape {
263
+ export interface IApiNodeShape extends IApiAnyShape {
264
264
  minProperties?: number;
265
265
  maxProperties?: number;
266
266
  closed?: boolean;
@@ -268,11 +268,11 @@ export interface INodeShape extends IAnyShape {
268
268
  customShapePropertyDefinitions: string[];
269
269
  discriminator?: string;
270
270
  discriminatorValue?: string;
271
- properties: IPropertyShape[];
271
+ properties: IApiPropertyShape[];
272
272
  dependencies: string[];
273
273
  }
274
274
 
275
- export interface IXmlSerializer extends IDomainProperty {
275
+ export interface IApiXmlSerializer extends IApiDomainProperty {
276
276
  /**
277
277
  * Whether this property should be represented as an attribute of the parent shape.
278
278
  *
@@ -337,10 +337,10 @@ export interface IXmlSerializer extends IDomainProperty {
337
337
  * ```
338
338
  */
339
339
  prefix?: string;
340
- sourceMaps?: ApiDocumentSourceMaps;
340
+ sourceMaps?: IApiDocumentSourceMaps;
341
341
  }
342
342
 
343
- export interface IScalarShape extends IAnyShape {
343
+ export interface IApiScalarShape extends IApiAnyShape {
344
344
  dataType?: string;
345
345
  pattern?: string;
346
346
  minLength?: number;
@@ -353,7 +353,7 @@ export interface IScalarShape extends IAnyShape {
353
353
  multipleOf?: number;
354
354
  }
355
355
 
356
- export interface IFileShape extends IAnyShape {
356
+ export interface IApiFileShape extends IApiAnyShape {
357
357
  fileTypes?: string[];
358
358
  pattern?: string;
359
359
  minLength?: number;
@@ -366,49 +366,49 @@ export interface IFileShape extends IAnyShape {
366
366
  multipleOf?: number;
367
367
  }
368
368
 
369
- export interface ISchemaShape extends IAnyShape {
369
+ export interface IApiSchemaShape extends IApiAnyShape {
370
370
  mediaType?: string;
371
371
  raw?: string;
372
372
  }
373
373
 
374
- export interface IUnionShape extends IAnyShape {
374
+ export interface IApiUnionShape extends IApiAnyShape {
375
375
  anyOf: IShapeUnion[];
376
376
  }
377
377
 
378
- export interface IDataArrangeShape extends IAnyShape {
378
+ export interface IApiDataArrangeShape extends IApiAnyShape {
379
379
  minItems?: number;
380
380
  maxItems?: number;
381
381
  uniqueItems?: boolean;
382
382
  }
383
383
 
384
- export interface IArrayShape<T = IShapeUnion> extends IDataArrangeShape {
384
+ export interface IApiArrayShape<T = IShapeUnion> extends IApiDataArrangeShape {
385
385
  items?: T;
386
386
  }
387
387
 
388
- export interface ITupleShape<T = IShapeUnion> extends IDataArrangeShape {
388
+ export interface IApiTupleShape<T = IShapeUnion> extends IApiDataArrangeShape {
389
389
  items: T[];
390
390
  additionalItems?: boolean;
391
391
  }
392
392
 
393
- export interface IRecursiveShape extends IShape {
393
+ export interface IApiRecursiveShape extends IApiShape {
394
394
  fixPoint: string;
395
395
  }
396
396
 
397
- export interface IDataNode extends IDomainProperty {
397
+ export interface IApiDataNode extends IApiDomainProperty {
398
398
  name?: string;
399
399
  }
400
400
 
401
- export interface IObjectNode extends IDataNode {
402
- properties: { [key: string]: IDataNodeUnion };
401
+ export interface IApiObjectNode extends IApiDataNode {
402
+ properties: { [key: string]: IApiDataNodeUnion };
403
403
  }
404
404
 
405
- export interface IScalarNode extends IDataNode {
405
+ export interface IApiScalarNode extends IApiDataNode {
406
406
  value?: string;
407
407
  dataType?: string;
408
408
  }
409
409
 
410
- export interface IArrayNode extends IDataNode {
411
- members: IDataNodeUnion[];
410
+ export interface IApiArrayNode extends IApiDataNode {
411
+ members: IApiDataNodeUnion[];
412
412
  }
413
413
 
414
- export type IDataNodeUnion = IDataNode | IObjectNode | IScalarNode | IArrayNode;
414
+ export type IApiDataNodeUnion = IApiDataNode | IApiObjectNode | IApiScalarNode | IApiArrayNode;
@@ -1,8 +1,8 @@
1
1
  import v4 from '../../lib/uuid.js';
2
- import { ArrayNodeTypes, ObjectNodeTypes, ScalarNodeTypes } from '../AmfTypes.js';
3
- import { ICustomDomainProperty } from '../definitions/Base.js';
2
+ import { IAmfArrayNodeTypes, IAmfObjectNodeTypes, IAmfScalarNodeTypes } from '../AmfTypes.js';
3
+ import { IApiCustomDomainProperty } from '../definitions/Base.js';
4
4
  import { AmfNamespace } from '../definitions/Namespace.js';
5
- import { IArrayNode, IDataNode, IDataNodeUnion, IObjectNode, IScalarNode } from '../definitions/Shapes.js';
5
+ import { IApiArrayNode, IApiDataNode, IApiDataNodeUnion, IApiObjectNode, IApiScalarNode } from '../definitions/Shapes.js';
6
6
 
7
7
  export type IDataNodeInit = 'scalar' | 'object' | 'array';
8
8
 
@@ -43,7 +43,7 @@ export class AmfDataNode {
43
43
  */
44
44
  members?: AmfDataNode[];
45
45
 
46
- customDomainProperties: ICustomDomainProperty[] = [];
46
+ customDomainProperties: IApiCustomDomainProperty[] = [];
47
47
 
48
48
  static scalar(value: string, type: string): AmfDataNode {
49
49
  const result = new AmfDataNode('scalar');
@@ -52,14 +52,14 @@ export class AmfDataNode {
52
52
  return result;
53
53
  }
54
54
 
55
- constructor(init: IDataNodeUnion | IDataNodeInit) {
55
+ constructor(init: IApiDataNodeUnion | IDataNodeInit) {
56
56
  if (typeof init === 'string') {
57
57
  if (init === 'scalar') {
58
- this.types = ScalarNodeTypes;
58
+ this.types = IAmfScalarNodeTypes;
59
59
  } else if (init === 'array') {
60
- this.types = ArrayNodeTypes;
60
+ this.types = IAmfArrayNodeTypes;
61
61
  } else if (init === 'object') {
62
- this.types = ObjectNodeTypes;
62
+ this.types = IAmfObjectNodeTypes;
63
63
  } else {
64
64
  throw new Error(`Invalid data node init option: ${init}`);
65
65
  }
@@ -68,24 +68,24 @@ export class AmfDataNode {
68
68
  if (!init) {
69
69
  throw new Error(`Expected an initialization option.`);
70
70
  }
71
- const union = init as IDataNodeUnion;
71
+ const union = init as IApiDataNodeUnion;
72
72
  const { id, types, customDomainProperties } = union;
73
73
  this.id = id;
74
74
  this.types = types;
75
75
  this.customDomainProperties = customDomainProperties;
76
76
  if (types.includes(AmfNamespace.aml.vocabularies.data.Scalar)) {
77
- const typed = union as IScalarNode;
77
+ const typed = union as IApiScalarNode;
78
78
  this.value = typed.value;
79
79
  this.dataType = typed.dataType;
80
80
  } else if (types.includes(AmfNamespace.aml.vocabularies.data.Object)) {
81
- const typed = union as IObjectNode;
81
+ const typed = union as IApiObjectNode;
82
82
  this.properties = {};
83
83
  Object.keys(typed.properties).forEach((key) => {
84
84
  const instance = new AmfDataNode(typed.properties[key]);
85
85
  this.properties![key] = instance;
86
86
  });
87
87
  } else if (types.includes(AmfNamespace.aml.vocabularies.data.Array)) {
88
- const typed = union as IArrayNode;
88
+ const typed = union as IApiArrayNode;
89
89
  this.members = [];
90
90
  if (Array.isArray(typed.members)) {
91
91
  typed.members.forEach((member) => {
@@ -96,9 +96,9 @@ export class AmfDataNode {
96
96
  }
97
97
  }
98
98
 
99
- toJSON(): IDataNodeUnion {
99
+ toJSON(): IApiDataNodeUnion {
100
100
  const { id, customDomainProperties, types, name } = this;
101
- const result: IDataNode = {
101
+ const result: IApiDataNode = {
102
102
  id,
103
103
  types,
104
104
  customDomainProperties,
@@ -108,11 +108,11 @@ export class AmfDataNode {
108
108
  }
109
109
 
110
110
  if (types.includes(AmfNamespace.aml.vocabularies.data.Scalar)) {
111
- const typed = result as IScalarNode;
111
+ const typed = result as IApiScalarNode;
112
112
  typed.dataType = this.dataType;
113
113
  typed.value = this.value;
114
114
  } else if (types.includes(AmfNamespace.aml.vocabularies.data.Object)) {
115
- const typed = result as IObjectNode;
115
+ const typed = result as IApiObjectNode;
116
116
  typed.properties = {};
117
117
  if (this.properties) {
118
118
  Object.keys(this.properties).forEach((key) => {
@@ -120,7 +120,7 @@ export class AmfDataNode {
120
120
  });
121
121
  }
122
122
  } else if (types.includes(AmfNamespace.aml.vocabularies.data.Array)) {
123
- const typed = result as IArrayNode;
123
+ const typed = result as IApiArrayNode;
124
124
  typed.members = [];
125
125
  if (this.members) {
126
126
  this.members.forEach((member) => {
@@ -2,7 +2,7 @@ import { Time } from '@pawel-up/data-mock';
2
2
  import { AmfNamespace as ns } from "../definitions/Namespace.js";
3
3
  import { ApiSchemaValues } from '../ApiSchemaValues.js';
4
4
  import { JsonDataNodeGenerator } from '../data-node/JsonDataNodeGenerator.js';
5
- import { IAnyShape, IArrayShape, IDataExample, IFileShape, INodeShape, IPropertyShape, IScalarNode, IScalarShape, ISchemaShape, IShapeUnion, ITupleShape, IUnionShape } from '../definitions/Shapes.js';
5
+ import { IApiAnyShape, IApiArrayShape, IApiDataExample, IApiFileShape, IApiNodeShape, IApiPropertyShape, IApiScalarNode, IApiScalarShape, IApiSchemaShape, IShapeUnion, IApiTupleShape, IApiUnionShape } from '../definitions/Shapes.js';
6
6
 
7
7
  export interface IShapeRenderOptions {
8
8
  /**
@@ -42,7 +42,7 @@ export abstract class ShapeBase {
42
42
  this.opts = Object.freeze({ ...opts });
43
43
  }
44
44
 
45
- protected _scalarValue(schema: IScalarShape): string | number | boolean {
45
+ protected _scalarValue(schema: IApiScalarShape): string | number | boolean {
46
46
  const { defaultValue, examples, values, inherits, dataType } = schema;
47
47
  // check examples
48
48
  if (this.opts.renderExamples && examples && examples.length) {
@@ -62,7 +62,7 @@ export abstract class ShapeBase {
62
62
  }
63
63
  // check enum values
64
64
  if (values && values.length) {
65
- const typed = values[0] as IScalarNode;
65
+ const typed = values[0] as IApiScalarNode;
66
66
  if (typed.value !== undefined) {
67
67
  return ApiSchemaValues.readTypedValue(typed.value, dataType);
68
68
  }
@@ -70,7 +70,7 @@ export abstract class ShapeBase {
70
70
  // check parents
71
71
  if (Array.isArray(inherits) && inherits.length) {
72
72
  for (let i = 0, len = inherits.length; i < len; i += 1) {
73
- const result = this._scalarValue(inherits[i] as IScalarShape);
73
+ const result = this._scalarValue(inherits[i] as IApiScalarShape);
74
74
  if (result !== undefined) {
75
75
  return result;
76
76
  }
@@ -100,7 +100,7 @@ export abstract class ShapeBase {
100
100
  if (i.types.includes(ns.aml.vocabularies.shapes.NilShape)) {
101
101
  hasNil = true;
102
102
  } else if (i.types.includes(ns.aml.vocabularies.shapes.ScalarShape)) {
103
- const scalar = i as IScalarShape;
103
+ const scalar = i as IApiScalarShape;
104
104
  if (scalar.dataType === ns.w3.xmlSchema.nil) {
105
105
  hasNil = true;
106
106
  } else {
@@ -139,25 +139,25 @@ export abstract class ShapeBase {
139
139
  * @param {ApiExample} example The example to turn into a JS object
140
140
  * @returns {any}
141
141
  */
142
- protected abstract _exampleToObject(example?: IDataExample): any;
142
+ protected abstract _exampleToObject(example?: IApiDataExample): any;
143
143
 
144
- protected abstract _scalarShapeObject(schema: IScalarShape): any;
144
+ protected abstract _scalarShapeObject(schema: IApiScalarShape): any;
145
145
 
146
- protected abstract _nilShapeObject(schema: IScalarShape): any;
146
+ protected abstract _nilShapeObject(schema: IApiScalarShape): any;
147
147
 
148
- protected abstract _nodeShapeObject(schema: INodeShape): any;
148
+ protected abstract _nodeShapeObject(schema: IApiNodeShape): any;
149
149
 
150
- protected abstract _unionShapeObject(schema: IUnionShape): any;
150
+ protected abstract _unionShapeObject(schema: IApiUnionShape): any;
151
151
 
152
- protected abstract _fileShapeObject(schema?: IFileShape): any;
152
+ protected abstract _fileShapeObject(schema?: IApiFileShape): any;
153
153
 
154
- protected abstract _schemaShapeObject(schema?: ISchemaShape): any;
154
+ protected abstract _schemaShapeObject(schema?: IApiSchemaShape): any;
155
155
 
156
- protected abstract _arrayShapeObject(schema: IArrayShape): any;
156
+ protected abstract _arrayShapeObject(schema: IApiArrayShape): any;
157
157
 
158
- protected abstract _tupleShapeObject(schema?: ITupleShape): any;
158
+ protected abstract _tupleShapeObject(schema?: IApiTupleShape): any;
159
159
 
160
- protected abstract _anyShapeObject(schema: IAnyShape): any;
160
+ protected abstract _anyShapeObject(schema: IApiAnyShape): any;
161
161
 
162
- protected abstract _propertyShapeObject(schema: IPropertyShape): any;
162
+ protected abstract _propertyShapeObject(schema: IApiPropertyShape): any;
163
163
  }