mdmodels-core 0.2.1 → 0.2.2

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.
@@ -81,48 +81,99 @@ export enum Templates {
81
81
  Julia = 19,
82
82
  }
83
83
  /**
84
- * Represents different types of model imports.
84
+ * A raw key-value representation of an attribute option.
85
85
  *
86
- * Can be either a remote URL or a local file path.
86
+ * This struct provides a simple string-based representation of options,
87
+ * which is useful for serialization/deserialization and when working
88
+ * with untyped data.
87
89
  */
88
- export type ImportType = { Remote: string } | { Local: string };
90
+ export interface RawOption {
91
+ /**
92
+ * The key/name of the option
93
+ */
94
+ key: string;
95
+ /**
96
+ * The string value of the option
97
+ */
98
+ value: string;
99
+ }
89
100
 
90
101
  /**
91
- * Represents the front matter data of a markdown file.
102
+ * Represents an option for an attribute in a data model.
103
+ *
104
+ * This enum provides a strongly-typed representation of various attribute options
105
+ * that can be used to configure and constrain attributes in a data model.
106
+ *
107
+ * The options are grouped into several categories:
108
+ * - JSON Schema validation options (e.g., minimum/maximum values, length constraints)
109
+ * - SQL database options (e.g., primary key)
110
+ * - LinkML specific options (e.g., readonly, recommended)
111
+ * - Custom options via the `Other` variant
112
+ *
92
113
  */
93
- export interface FrontMatter {
114
+ export type AttrOption = { Example: string } | { MinimumValue: number } | { MaximumValue: number } | { MinItems: number } | { MaxItems: number } | { MinLength: number } | { MaxLength: number } | { Pattern: string } | { Unique: boolean } | { MultipleOf: number } | { ExclusiveMinimum: number } | { ExclusiveMaximum: number } | { PrimaryKey: boolean } | { ReadOnly: boolean } | { Recommended: boolean } | { Other: { key: string; value: string } };
115
+
116
+ /**
117
+ * Represents an enumeration with a name and mappings.
118
+ */
119
+ export interface Enumeration {
94
120
  /**
95
- * Identifier field of the model.
121
+ * Name of the enumeration.
96
122
  */
97
- id: string | undefined;
123
+ name: string;
98
124
  /**
99
- * A boolean field with a default value, renamed from `id-field`.
125
+ * Mappings associated with the enumeration.
100
126
  */
101
- "id-field"?: boolean;
127
+ mappings: Map<string, string>;
102
128
  /**
103
- * Optional hashmap of prefixes.
129
+ * Documentation string for the enumeration.
104
130
  */
105
- prefixes: Map<string, string> | undefined;
131
+ docstring: string;
106
132
  /**
107
- * Optional namespace map.
133
+ * The line number of the enumeration
108
134
  */
109
- nsmap: Map<string, string> | undefined;
135
+ position: Position | undefined;
136
+ }
137
+
138
+ /**
139
+ * Represents an object with a name, attributes, docstring, and an optional term.
140
+ */
141
+ export interface Object {
110
142
  /**
111
- * A string field with a default value representing the repository URL.
143
+ * Name of the object.
112
144
  */
113
- repo?: string;
145
+ name: string;
114
146
  /**
115
- * A string field with a default value representing the prefix.
147
+ * List of attributes associated with the object.
116
148
  */
117
- prefix?: string;
149
+ attributes: Attribute[];
118
150
  /**
119
- * Import remote or local models.
151
+ * Documentation string for the object.
120
152
  */
121
- imports?: Map<string, ImportType>;
153
+ docstring: string;
122
154
  /**
123
- * Allow empty models.
155
+ * Optional term associated with the object.
124
156
  */
125
- "allow-empty"?: boolean;
157
+ term?: string;
158
+ /**
159
+ * Parent object of the object.
160
+ */
161
+ parent?: string;
162
+ /**
163
+ * The line number of the object
164
+ */
165
+ position?: Position;
166
+ }
167
+
168
+ export interface PositionRange {
169
+ start: number;
170
+ end: number;
171
+ }
172
+
173
+ export interface Position {
174
+ line: number;
175
+ column: PositionRange;
176
+ offset: PositionRange;
126
177
  }
127
178
 
128
179
  export interface DataModel {
@@ -197,100 +248,49 @@ export interface Attribute {
197
248
  */
198
249
  export type XMLType = { Attribute: { is_attr: boolean; name: string } } | { Element: { is_attr: boolean; name: string } } | { Wrapped: { is_attr: boolean; name: string; wrapped: string[] | undefined } };
199
250
 
200
- export interface PositionRange {
201
- start: number;
202
- end: number;
203
- }
204
-
205
- export interface Position {
206
- line: number;
207
- column: PositionRange;
208
- offset: PositionRange;
209
- }
210
-
211
251
  /**
212
- * A raw key-value representation of an attribute option.
213
- *
214
- * This struct provides a simple string-based representation of options,
215
- * which is useful for serialization/deserialization and when working
216
- * with untyped data.
217
- */
218
- export interface RawOption {
219
- /**
220
- * The key/name of the option
221
- */
222
- key: string;
223
- /**
224
- * The string value of the option
225
- */
226
- value: string;
227
- }
228
-
229
- /**
230
- * Represents an option for an attribute in a data model.
231
- *
232
- * This enum provides a strongly-typed representation of various attribute options
233
- * that can be used to configure and constrain attributes in a data model.
234
- *
235
- * The options are grouped into several categories:
236
- * - JSON Schema validation options (e.g., minimum/maximum values, length constraints)
237
- * - SQL database options (e.g., primary key)
238
- * - LinkML specific options (e.g., readonly, recommended)
239
- * - Custom options via the `Other` variant
252
+ * Represents different types of model imports.
240
253
  *
254
+ * Can be either a remote URL or a local file path.
241
255
  */
242
- export type AttrOption = { Example: string } | { MinimumValue: number } | { MaximumValue: number } | { MinItems: number } | { MaxItems: number } | { MinLength: number } | { MaxLength: number } | { Pattern: string } | { Unique: boolean } | { MultipleOf: number } | { ExclusiveMinimum: number } | { ExclusiveMaximum: number } | { PrimaryKey: boolean } | { ReadOnly: boolean } | { Recommended: boolean } | { Other: { key: string; value: string } };
256
+ export type ImportType = { Remote: string } | { Local: string };
243
257
 
244
258
  /**
245
- * Represents an enumeration with a name and mappings.
259
+ * Represents the front matter data of a markdown file.
246
260
  */
247
- export interface Enumeration {
248
- /**
249
- * Name of the enumeration.
250
- */
251
- name: string;
252
- /**
253
- * Mappings associated with the enumeration.
254
- */
255
- mappings: Map<string, string>;
261
+ export interface FrontMatter {
256
262
  /**
257
- * Documentation string for the enumeration.
263
+ * Identifier field of the model.
258
264
  */
259
- docstring: string;
265
+ id: string | undefined;
260
266
  /**
261
- * The line number of the enumeration
267
+ * A boolean field with a default value, renamed from `id-field`.
262
268
  */
263
- position: Position | undefined;
264
- }
265
-
266
- /**
267
- * Represents an object with a name, attributes, docstring, and an optional term.
268
- */
269
- export interface Object {
269
+ "id-field"?: boolean;
270
270
  /**
271
- * Name of the object.
271
+ * Optional hashmap of prefixes.
272
272
  */
273
- name: string;
273
+ prefixes: Map<string, string> | undefined;
274
274
  /**
275
- * List of attributes associated with the object.
275
+ * Optional namespace map.
276
276
  */
277
- attributes: Attribute[];
277
+ nsmap: Map<string, string> | undefined;
278
278
  /**
279
- * Documentation string for the object.
279
+ * A string field with a default value representing the repository URL.
280
280
  */
281
- docstring: string;
281
+ repo?: string;
282
282
  /**
283
- * Optional term associated with the object.
283
+ * A string field with a default value representing the prefix.
284
284
  */
285
- term?: string;
285
+ prefix?: string;
286
286
  /**
287
- * Parent object of the object.
287
+ * Import remote or local models.
288
288
  */
289
- parent?: string;
289
+ imports?: Map<string, ImportType>;
290
290
  /**
291
- * The line number of the object
291
+ * Allow empty models.
292
292
  */
293
- position?: Position;
293
+ "allow-empty"?: boolean;
294
294
  }
295
295
 
296
296
  /**
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.1",
8
+ "version": "0.2.2",
9
9
  "license": "MIT",
10
10
  "repository": {
11
11
  "type": "git",