@mediusinc/mng-commons-data-api 5.2.0-rc.0 → 5.2.0-rc.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.
@@ -0,0 +1,321 @@
1
+ import { SchemaEnum, SchemaModel, SchemaProperty } from '@mediusinc/mng-commons-data-api';
2
+ import { ArrayItemType, KeyofAndOfType } from '@mediusinc/mng-commons/core';
3
+ import { EnumDescriptor, TypeDescriptor } from '@mediusinc/mng-commons/model';
4
+ import { ITableDataProvider, TableDescriptorInst } from '@mediusinc/mng-commons/table/api';
5
+ import { AFieldDescriptor, EditorDescriptorInst, FieldInputDescriptor, FieldLookupDescriptor, FieldLookupEnumDescriptor, FieldLookupProviderType, FieldManyEditorDescriptor, FieldManyToManyEditorDescriptor, TableviewDescriptorInst } from '@mediusinc/mng-commons/tableview/api';
6
+ import { FromSchemaCurrencyOptsType } from './internal/common-from-schema';
7
+ type FieldInputType = 'number' | 'currency' | 'boolean' | 'string' | 'text' | 'textarea' | 'date' | 'date-time' | 'enum' | 'hidden';
8
+ type FieldsFromSchemaOptsType<Model = any> = {
9
+ fieldTypes?: Partial<Record<keyof Model, FieldInputType>>;
10
+ enumModels?: Partial<Record<keyof Model, EnumDescriptor<any>>>;
11
+ enumSchemas?: Partial<Record<keyof Model, SchemaEnum<any>>>;
12
+ dateFormat?: string;
13
+ dateTimeFormat?: string;
14
+ };
15
+ type FieldInputFromSchemaOptsType<Model = any, Enum = any> = {
16
+ fieldType?: FieldInputType;
17
+ enumSchema?: SchemaEnum<Enum>;
18
+ enumModel?: EnumDescriptor<Enum>;
19
+ currency?: FromSchemaCurrencyOptsType<Model>;
20
+ dateFormat?: string;
21
+ dateTimeFormat?: string;
22
+ };
23
+ /**
24
+ * <em>Experimental:</em> Builder for adding fields to editor.
25
+ *
26
+ * @experimental
27
+ */
28
+ export declare class SchemaFieldsBuilder<Model, Parent = unknown, SchModel = Model> {
29
+ private readonly descriptor;
30
+ private readonly schema;
31
+ private opts?;
32
+ constructor(descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>, schema: SchemaModel<SchModel>, opts?: FieldsFromSchemaOptsType<SchModel> | undefined);
33
+ private mergeFieldsInputOpts;
34
+ private mergeFieldInputOpts;
35
+ /**
36
+ * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema}.
37
+ *
38
+ * @experimental
39
+ *
40
+ * @param {Property} property - The property to add the field for.
41
+ * @param {FieldInputFromSchemaOptsType<SchModel>} opts - Additional options.
42
+ *
43
+ * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.
44
+ */
45
+ add<Property extends Extract<keyof Model, keyof SchModel>>(property: Property, opts?: FieldInputFromSchemaOptsType<SchModel>): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>;
46
+ /**
47
+ * <em>Experimental:</em> Adds all input fields for the non-array properties via {addFieldInputFromSchema}.
48
+ *
49
+ * @experimental
50
+ *
51
+ * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.
52
+ *
53
+ * @return {this} - The current instance of the builder.
54
+ */
55
+ withAddAll(opts?: FieldsFromSchemaOptsType<SchModel>): this;
56
+ /**
57
+ * <em>Experimental:</em> Adds input fields for properties via {addFieldInputFromSchema}.
58
+ *
59
+ * @experimental
60
+ *
61
+ * @param {FieldsFromSchemaOptsType<SchModel>} opts - Additional options.
62
+ * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.
63
+ *
64
+ * @return {this} - The current instance of the builder.
65
+ */
66
+ withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(opts: FieldsFromSchemaOptsType<SchModel>, ...properties: PropertyKey[]): this;
67
+ /**
68
+ * <em>Experimental:</em> Adds fields for properties via {addFieldInputFromSchema}.
69
+ *
70
+ * @experimental
71
+ *
72
+ * @param {...Property[]} properties - Properties to add fields for. If non provided, all non-array properties from schema will be added.
73
+ *
74
+ * @return {this} - The current instance of the builder.
75
+ */
76
+ withAdd<PropertyKey extends Extract<keyof Model, keyof SchModel>>(...properties: PropertyKey[]): this;
77
+ private addFields;
78
+ /**
79
+ * <em>Experimental:</em> Adds a single input field via {addFieldInputFromSchema} where property schema is manually provided.
80
+ *
81
+ * @experimental
82
+ *
83
+ * @param {Property} property - The property to add the field for.
84
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
85
+ * @param {FieldInputFromSchemaOptsType<Model>} opts - Additional options.
86
+ *
87
+ * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} The added field descriptor.
88
+ */
89
+ addFromSchema<Property extends keyof Model>(property: Property, schemaProperty: SchemaProperty, opts?: FieldInputFromSchemaOptsType<Model>): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>;
90
+ /**
91
+ * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema}.
92
+ *
93
+ * @experimental
94
+ *
95
+ * @param {Property} property - The property to add the enum lookup field for.
96
+ * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.
97
+ *
98
+ * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.
99
+ *
100
+ * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.
101
+ */
102
+ addEnum<Property extends Extract<keyof Model, keyof SchModel>, Enum>(property: Property, enumOpt?: SchemaEnum<Enum> | EnumDescriptor<Enum>): FieldLookupEnumDescriptor<Enum, Model, Parent>;
103
+ /**
104
+ * <em>Experimental:</em> Adds an enum lookup field via {addFieldEnumLookupFromSchema} where property schema is manually provided.
105
+ *
106
+ * @experimental
107
+ *
108
+ * @param {Property} property - The property to add the enum lookup field for.
109
+ * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} [enumOpt] - The enum schema or the enum model descriptor. If non provided, builder opts will be checked.
110
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
111
+ *
112
+ * @returns {FieldLookupEnumDescriptor<Enum, Model, Parent>} - The added field descriptor.
113
+ *
114
+ * @throws {CommonsInternalError} - If no enum metadata is found for the property either from parameter or from builder's opts.
115
+ */
116
+ addEnumFromSchema<Property extends keyof Model, Enum>(property: Property, enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum> | undefined, schemaProperty: SchemaProperty): FieldLookupEnumDescriptor<Enum, Model, Parent>;
117
+ /**
118
+ * <em>Experimental:</em> Adds a lookup field.
119
+ * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
120
+ *
121
+ * @experimental
122
+ *
123
+ * @param {Property} property - The property to create the lookup field for.
124
+ *
125
+ * @return The created lookup field.
126
+ */
127
+ addLookup<Property extends Extract<keyof Model, keyof SchModel>, LookupModel = NonNullable<Model[Property]>, FieldValue = Model[Property]>(property: Property): FieldLookupDescriptor<LookupModel, Model, undefined, Model[Property], Parent>;
128
+ /**
129
+ * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.
130
+ * {EditorDescriptorInt.addFieldLookup} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
131
+ *
132
+ * @experimental
133
+ *
134
+ * @param {Property} property - The property to create the lookup field for.
135
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
136
+ *
137
+ * @return The created lookup field.
138
+ */
139
+ addLookupFromSchema<Property extends keyof Model, LookupModel = NonNullable<Model[Property]>, FieldValue = Model[Property]>(property: Property, schemaProperty: SchemaProperty): FieldLookupDescriptor<NonNullable<Model[Property]>, Model, undefined, Model[Property], Parent>;
140
+ /**
141
+ * <em>Experimental:</em> Adds a lookup field.
142
+ * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
143
+ *
144
+ * @experimental
145
+ *
146
+ * @param {Property} property - The property to create the lookup field for.
147
+ * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.
148
+ * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.
149
+ *
150
+ * @return The created lookup field.
151
+ */
152
+ addLookupWithOptionsValueProperty<Property extends Extract<keyof Model, keyof SchModel>, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>, FieldValue = Model[Property]>(property: Property, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty): FieldLookupDescriptor<LookupModel, Model, undefined, Model[Property], Parent>;
153
+ /**
154
+ * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.
155
+ * {EditorDescriptorInt.addFieldLookupWithOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
156
+ *
157
+ * @experimental
158
+ *
159
+ * @param {Property} property - The property to create the lookup field for.
160
+ * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.
161
+ * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.
162
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
163
+ *
164
+ * @return The created lookup field.
165
+ */
166
+ addLookupWithOptionsValuePropertyFromSchema<Property extends keyof Model, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>, FieldValue = Model[Property]>(property: Property, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty, schemaProperty: SchemaProperty): FieldLookupDescriptor<LookupModel, Model, undefined, Model[Property], Parent>;
167
+ /**
168
+ * <em>Experimental:</em> Adds a lookup field.
169
+ * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
170
+ *
171
+ * @experimental
172
+ *
173
+ * @param {Property} property - The property to create the lookup field for.
174
+ * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.
175
+ *
176
+ * @return The created lookup field.
177
+ */
178
+ addLookupWithProvider<Property extends Extract<keyof Model, keyof SchModel>, Service, LookupModel = NonNullable<Model[Property]>, FieldValue = Model[Property]>(property: Property, provider: FieldLookupProviderType<LookupModel, Service>): FieldLookupDescriptor<LookupModel, Model, Service, Model[Property], Parent>;
179
+ /**
180
+ * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.
181
+ * {EditorDescriptorInt.addFieldLookupWithProvider} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
182
+ *
183
+ * @experimental
184
+ *
185
+ * @param {Property} property - The property to create the lookup field for.
186
+ * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.
187
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
188
+ *
189
+ * @return The created lookup field.
190
+ */
191
+ addLookupWithProviderFromSchema<Property extends keyof Model, Service, LookupModel = NonNullable<Model[Property]>, FieldValue = Model[Property]>(property: Property, provider: FieldLookupProviderType<LookupModel, Service>, schemaProperty: SchemaProperty): FieldLookupDescriptor<LookupModel, Model, Service, Model[Property], Parent>;
192
+ /**
193
+ * <em>Experimental:</em> Adds a lookup field.
194
+ * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
195
+ *
196
+ * @experimental
197
+ *
198
+ * @param {Property} property - The property to create the lookup field for.
199
+ * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.
200
+ * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.
201
+ * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.
202
+ *
203
+ * @return The created lookup field.
204
+ */
205
+ addLookupWithProviderAndOptionsValueProperty<Property extends Extract<keyof Model, keyof SchModel>, Service, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>, FieldValue = Model[Property]>(property: Property, provider: FieldLookupProviderType<LookupModel, Service>, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue>;
206
+ /**
207
+ * <em>Experimental:</em> Adds a lookup field where property schema is manually provided.
208
+ * {EditorDescriptorInt.addFieldLookupWithProviderAndOptionsValueProperty} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
209
+ *
210
+ * @experimental
211
+ *
212
+ * @param {Property} property - The property to create the lookup field for.
213
+ * @param {FieldLookupProviderType<LookupModel, Service>} provider - Lookup provider.
214
+ * @param {TypeDescriptor<LookupModel>} type - Type of lookup model.
215
+ * @param {LookupValueProperty} lookupOptionsValueProperty - Value property from lookup model.
216
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
217
+ *
218
+ * @return The created lookup field.
219
+ */
220
+ addLookupWithProviderAndOptionsValuePropertyFromSchema<Property extends keyof Model, Service, LookupModel, LookupValueProperty extends KeyofAndOfType<LookupModel, Model[Property]>, FieldValue = Model[Property]>(property: Property, provider: FieldLookupProviderType<LookupModel, Service>, type: TypeDescriptor<LookupModel>, lookupOptionsValueProperty: LookupValueProperty, schemaProperty: SchemaProperty): FieldLookupDescriptor<LookupModel, Model, Service, FieldValue>;
221
+ /**
222
+ * <em>Experimental:</em> Adds a one-to-many editor field.
223
+ * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
224
+ *
225
+ * @experimental
226
+ *
227
+ * @param {Property} property - The property to create the many editor field for.
228
+ * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.
229
+ *
230
+ * @return The created one-to-many editor field.
231
+ */
232
+ addManyEditor<Property extends Extract<keyof Model, keyof SchModel>, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(property: Property, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>): FieldManyEditorDescriptor<FieldModel, Model, FieldValue>;
233
+ /**
234
+ * <em>Experimental:</em> Adds an one-to-many editor field where property schema is manually provided.
235
+ * {EditorDescriptorInt.addFieldManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
236
+ *
237
+ * @experimental
238
+ *
239
+ * @param {Property} property - The property to create the many editor field for.
240
+ * @param {TableviewDescriptorInst<FieldModel, any, any, Model>} tableviewDescriptor - Tableview descriptor.
241
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
242
+ *
243
+ * @return The created one-to-many editor field.
244
+ */
245
+ addManyEditorFromSchema<Property extends keyof Model, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(property: Property, tableviewDescriptor: TableviewDescriptorInst<FieldModel, any, any, Model>, schemaProperty: SchemaProperty): FieldManyEditorDescriptor<FieldModel, Model, FieldValue>;
246
+ /**
247
+ * <em>Experimental:</em> Adds a many-to-many editor field.
248
+ * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
249
+ *
250
+ * @experimental
251
+ *
252
+ * @param {Property} property - The property to create the many editor field for.
253
+ * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.
254
+ * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.
255
+ * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.
256
+ *
257
+ * @return The created many-to-many editor field.
258
+ */
259
+ addManyToManyEditor<Property extends Extract<keyof Model, keyof SchModel>, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(property: Property, mainTableDescriptor: TableDescriptorInst<FieldModel>, lookupTableDescriptor: TableDescriptorInst<FieldModel>, lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue>;
260
+ /**
261
+ * <em>Experimental:</em> Adds a many-to-many editor field where property schema is manually provided.
262
+ * {EditorDescriptorInt.addFieldManyToManyEditor} is used to create field and ${setFieldBasicOptionsFromSchema} to add basic field's options from schema.
263
+ *
264
+ * @experimental
265
+ *
266
+ * @param {Property} property - The property to create the many editor field for.
267
+ * @param {TableDescriptorInst<FieldModel>} mainTableDescriptor - Main table descriptor.
268
+ * @param {TableDescriptorInst<FieldModel>} lookupTableDescriptor - Lookup table descriptor.
269
+ * @param {ITableDataProvider<FieldModel, ServiceType>} lookupDataProvider - Lookup data provider.
270
+ * @param {SchemaProperty} schemaProperty - Manually provided schema property.
271
+ *
272
+ * @return The created many-to-many editor field.
273
+ */
274
+ addManyToManyEditorFromSchema<Property extends keyof Model, ServiceType, FieldModel = ArrayItemType<Model[Property]>, FieldValue = Model[Property]>(property: Property, mainTableDescriptor: TableDescriptorInst<FieldModel>, lookupTableDescriptor: TableDescriptorInst<FieldModel>, lookupDataProvider: ITableDataProvider<FieldModel, ServiceType>, schemaProperty: SchemaProperty): FieldManyToManyEditorDescriptor<FieldModel, Model, ServiceType, FieldValue>;
275
+ }
276
+ /**
277
+ * <em>Experimental:</em> Creates builder for adding fields to descriptor based on provided model schema.
278
+ *
279
+ * @experimental
280
+ *
281
+ * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>} descriptor - Descriptor to add fields to.
282
+ * @param {SchemaModel<SchModel>} schema - The schema with metadata about properties for fields.
283
+ * @param {FieldsFromSchemaOptsType<SchModel>} [opts] - Additional options.
284
+ *
285
+ * @return {SchemaFieldsBuilder<Model, Parent, SchModel>} - The SchemaFieldsBuilder object containing the extracted fields.
286
+ */
287
+ export declare function fieldsFromSchema<Model, Parent = unknown, SchModel = Model>(descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>, schema: SchemaModel<SchModel>, opts?: FieldsFromSchemaOptsType<SchModel>): SchemaFieldsBuilder<Model, Parent, SchModel>;
288
+ /**
289
+ * <em>Experimental:</em> Adds a field input to editor descriptor based on the given schema property and options.
290
+ *
291
+ * @experimental
292
+ *
293
+ * @param {TableviewDescriptorInst | EditorDescriptorInst} descriptor - Descriptor to add field to.
294
+ * @param {keyof Model} property - The property of the model.
295
+ * @param {SchemaProperty} propertySchema - The property's schema for the field.
296
+ * @param {FieldInputFromSchemaOptsType<Model>} [opts] - Additional options.
297
+ *
298
+ * @return {FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>} - The generated field input descriptor.
299
+ */
300
+ export declare function addFieldInputFromSchema<Property extends keyof Model, Model, Parent = unknown>(descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>, property: Property, propertySchema: SchemaProperty, opts?: FieldInputFromSchemaOptsType<Model>): FieldInputDescriptor<Model, NonNullable<Model[Property]>, Model[Property], Parent>;
301
+ /**
302
+ * <em>Experimental:</em> Adds a field enum lookup to editor descriptor based on the given schema property and options.
303
+ *
304
+ * @experimental
305
+ *
306
+ * @param {TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>} descriptor - Descriptor to add field to.
307
+ * @param {keyof Model} property - The property of the model.
308
+ * @param {SchemaEnum<Enum> | EnumDescriptor<Enum>} enumOpt - The enum schema or enum model descriptor.
309
+ * @param {SchemaProperty} propertySchema - The property's schema for the field.
310
+ *
311
+ * @returns {FieldLookupEnum<Enum>} - The field with enumeration values.
312
+ */
313
+ export declare function addFieldEnumLookupFromSchema<Model, Parent = unknown, Enum = any>(descriptor: TableviewDescriptorInst<Model, any, any, Parent> | EditorDescriptorInst<Model>, property: keyof Model, enumOpt: SchemaEnum<Enum> | EnumDescriptor<Enum>, propertySchema: SchemaProperty): FieldLookupEnumDescriptor<Enum, Model, Parent>;
314
+ /**
315
+ * <em>Experimental:</em> Sets basic options for a field based on a given property schema.
316
+ *
317
+ * @param {AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>} field - The field to set options for.
318
+ * @param {SchemaProperty} propertySchema - The property schema to base the options on.
319
+ */
320
+ export declare function setFieldBasicOptionsFromSchema<FieldModel = any, EditorModel = any, FieldValue = FieldModel, ParentEditorModel = undefined>(field: AFieldDescriptor<FieldModel, EditorModel, FieldValue, ParentEditorModel>, propertySchema: SchemaProperty): void;
321
+ export {};
@@ -0,0 +1,11 @@
1
+ export type FromSchemaCurrencyOptsType<Model> = string | {
2
+ currencyProperty?: keyof Model;
3
+ currency?: string;
4
+ currencyDisplay?: 'symbol' | 'code' | 'name';
5
+ };
6
+ export declare function fromSchemaCurrencyOptsToCurrency<Model>(opts: FromSchemaCurrencyOptsType<Model>): {
7
+ currency: string | undefined;
8
+ currencyDisplay: "symbol" | "name" | "code" | undefined;
9
+ currencyProperty: keyof Model | undefined;
10
+ };
11
+ export declare function fromSchemaFilterNonArrayProperties<Model>(propertySchemas: Record<keyof Model, any>): (keyof Model)[];
package/version-info.json CHANGED
@@ -1,11 +1,11 @@
1
1
  {
2
2
  "name": "@mediusinc/mng-commons-data-api",
3
- "version": "5.2.0-rc.0",
4
- "tag": "v5.1.0-rc.1",
5
- "distance": 11,
6
- "hash": "1fe015b8",
3
+ "version": "5.2.0-rc.2",
4
+ "tag": "v5.2.0-rc.2",
5
+ "distance": 0,
6
+ "hash": "41eee2dc",
7
7
  "dirty": true,
8
- "semver": "5.1.0-rc.1+11.g1fe015b8.dirty",
8
+ "semver": "5.2.0-rc.2+0.g41eee2dc.dirty",
9
9
  "buildTimestamp": null,
10
- "raw": "v5.1.0-rc.1-11-1fe015b8-dirty"
10
+ "raw": "v5.2.0-rc.2-41eee2dc-dirty"
11
11
  }
@@ -1,18 +0,0 @@
1
- export interface Schema {
2
- name: string;
3
- properties?: Record<string, SchemaProperty>;
4
- }
5
-
6
- export interface SchemaProperty {
7
- type: string;
8
- isReadOnly?: boolean;
9
- required?: boolean;
10
- isNullable?: boolean;
11
- minLength?: number;
12
- maxLength?: number;
13
- minimum?: number;
14
- maximum?: number;
15
- exclusiveMinimum?: boolean;
16
- exclusiveMaximum?: boolean;
17
- pattern?: string;
18
- }