mdmodels-core 0.2.6 → 0.2.7

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.
@@ -156,6 +156,44 @@ export enum Templates {
156
156
  */
157
157
  Mermaid = 20,
158
158
  }
159
+ /**
160
+ * Represents an XML type, either an attribute or an element.
161
+ */
162
+ export type XMLType = { Attribute: { is_attr: boolean; name: string } } | { Element: { is_attr: boolean; name: string } } | { Wrapped: { is_attr: boolean; name: string; wrapped: string[] | undefined } };
163
+
164
+ /**
165
+ * Validator for checking the integrity of a data model.
166
+ */
167
+ export interface Validator {
168
+ is_valid: boolean;
169
+ errors: ValidationError[];
170
+ }
171
+
172
+ /**
173
+ * Enum representing the type of validation error.
174
+ */
175
+ export type ErrorType = "NameError" | "TypeError" | "DuplicateError" | "GlobalError" | "XMLError" | "ObjectError";
176
+
177
+ /**
178
+ * Represents a validation error in the data model.
179
+ */
180
+ export interface ValidationError {
181
+ message: string;
182
+ object: string | undefined;
183
+ attribute: string | undefined;
184
+ location: string;
185
+ solution: string | undefined;
186
+ error_type: ErrorType;
187
+ positions: Position[];
188
+ }
189
+
190
+ export interface DataModel {
191
+ name?: string;
192
+ objects: Object[];
193
+ enums: Enumeration[];
194
+ config?: FrontMatter;
195
+ }
196
+
159
197
  export interface PositionRange {
160
198
  start: number;
161
199
  end: number;
@@ -168,9 +206,49 @@ export interface Position {
168
206
  }
169
207
 
170
208
  /**
171
- * Represents an XML type, either an attribute or an element.
209
+ * Represents different types of model imports.
210
+ *
211
+ * Can be either a remote URL or a local file path.
172
212
  */
173
- export type XMLType = { Attribute: { is_attr: boolean; name: string } } | { Element: { is_attr: boolean; name: string } } | { Wrapped: { is_attr: boolean; name: string; wrapped: string[] | undefined } };
213
+ export type ImportType = { Remote: string } | { Local: string };
214
+
215
+ /**
216
+ * Represents the front matter data of a markdown file.
217
+ */
218
+ export interface FrontMatter {
219
+ /**
220
+ * Identifier field of the model.
221
+ */
222
+ id: string | undefined;
223
+ /**
224
+ * A boolean field with a default value, renamed from `id-field`.
225
+ */
226
+ "id-field"?: boolean;
227
+ /**
228
+ * Optional hashmap of prefixes.
229
+ */
230
+ prefixes: Map<string, string> | undefined;
231
+ /**
232
+ * Optional namespace map.
233
+ */
234
+ nsmap: Map<string, string> | undefined;
235
+ /**
236
+ * A string field with a default value representing the repository URL.
237
+ */
238
+ repo?: string;
239
+ /**
240
+ * A string field with a default value representing the prefix.
241
+ */
242
+ prefix?: string;
243
+ /**
244
+ * Import remote or local models.
245
+ */
246
+ imports?: Map<string, ImportType>;
247
+ /**
248
+ * Allow empty models.
249
+ */
250
+ "allow-empty"?: boolean;
251
+ }
174
252
 
175
253
  /**
176
254
  * A raw key-value representation of an attribute option.
@@ -257,58 +335,6 @@ export interface Object {
257
335
  position?: Position;
258
336
  }
259
337
 
260
- /**
261
- * Represents different types of model imports.
262
- *
263
- * Can be either a remote URL or a local file path.
264
- */
265
- export type ImportType = { Remote: string } | { Local: string };
266
-
267
- /**
268
- * Represents the front matter data of a markdown file.
269
- */
270
- export interface FrontMatter {
271
- /**
272
- * Identifier field of the model.
273
- */
274
- id: string | undefined;
275
- /**
276
- * A boolean field with a default value, renamed from `id-field`.
277
- */
278
- "id-field"?: boolean;
279
- /**
280
- * Optional hashmap of prefixes.
281
- */
282
- prefixes: Map<string, string> | undefined;
283
- /**
284
- * Optional namespace map.
285
- */
286
- nsmap: Map<string, string> | undefined;
287
- /**
288
- * A string field with a default value representing the repository URL.
289
- */
290
- repo?: string;
291
- /**
292
- * A string field with a default value representing the prefix.
293
- */
294
- prefix?: string;
295
- /**
296
- * Import remote or local models.
297
- */
298
- imports?: Map<string, ImportType>;
299
- /**
300
- * Allow empty models.
301
- */
302
- "allow-empty"?: boolean;
303
- }
304
-
305
- export interface DataModel {
306
- name?: string;
307
- objects: Object[];
308
- enums: Enumeration[];
309
- config?: FrontMatter;
310
- }
311
-
312
338
  export type DataType = { Boolean: boolean } | { Integer: number } | { Float: number } | { String: string };
313
339
 
314
340
  /**
@@ -369,29 +395,3 @@ export interface Attribute {
369
395
  import_prefix?: string;
370
396
  }
371
397
 
372
- /**
373
- * Validator for checking the integrity of a data model.
374
- */
375
- export interface Validator {
376
- is_valid: boolean;
377
- errors: ValidationError[];
378
- }
379
-
380
- /**
381
- * Enum representing the type of validation error.
382
- */
383
- export type ErrorType = "NameError" | "TypeError" | "DuplicateError" | "GlobalError" | "XMLError" | "ObjectError";
384
-
385
- /**
386
- * Represents a validation error in the data model.
387
- */
388
- export interface ValidationError {
389
- message: string;
390
- object: string | undefined;
391
- attribute: string | undefined;
392
- location: string;
393
- solution: string | undefined;
394
- error_type: ErrorType;
395
- positions: Position[];
396
- }
397
-
Binary file
package/package.json CHANGED
@@ -5,7 +5,7 @@
5
5
  "Jan Range <jan.range@simtech.uni-stuttgart.de>"
6
6
  ],
7
7
  "description": "A tool to generate models, code and schemas from markdown files",
8
- "version": "0.2.6",
8
+ "version": "0.2.7",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",