@mediusinc/mng-commons 0.2.14 → 0.2.17
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/esm2020/lib/api/models/filter-match-type.model.mjs +11 -12
- package/esm2020/lib/api/models/filter-param.model.mjs +11 -12
- package/esm2020/lib/api/models/query-mode.model.mjs +4 -4
- package/esm2020/lib/api/models/query-param.model.mjs +29 -30
- package/esm2020/lib/components/form/autocomplete/autocomplete.component.mjs +9 -13
- package/esm2020/lib/components/form/dropdown/dropdown.component.mjs +13 -15
- package/esm2020/lib/components/form/formly/fields/formly-field-dropdown/formly-field-dropdown.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-input/formly-field-input.component.mjs +3 -3
- package/esm2020/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.mjs +7 -6
- package/esm2020/lib/components/layout/main-layout.component.mjs +1 -3
- package/esm2020/lib/components/layout/topbar.component.mjs +1 -3
- package/esm2020/lib/components/tableview/table/column-filter/column-filter.component.mjs +1 -1
- package/esm2020/lib/components/tableview/table/table.component.mjs +7 -9
- package/esm2020/lib/descriptors/editor.descriptor.mjs +8 -3
- package/esm2020/lib/descriptors/table.descriptor.mjs +1 -2
- package/esm2020/lib/router/models/router.model.mjs +1 -1
- package/esm2020/lib/router/route-builder.mjs +75 -11
- package/esm2020/lib/services/configuration.service.mjs +3 -3
- package/fesm2015/mediusinc-mng-commons.mjs +176 -111
- package/fesm2015/mediusinc-mng-commons.mjs.map +1 -1
- package/fesm2020/mediusinc-mng-commons.mjs +169 -114
- package/fesm2020/mediusinc-mng-commons.mjs.map +1 -1
- package/lib/api/models/filter-match-type.model.d.ts +10 -10
- package/lib/api/models/filter-param.model.d.ts +6 -6
- package/lib/api/models/query-mode.model.d.ts +3 -3
- package/lib/api/models/query-param.model.d.ts +13 -13
- package/lib/components/form/autocomplete/autocomplete.component.d.ts +3 -2
- package/lib/components/form/dropdown/dropdown.component.d.ts +6 -3
- package/lib/components/form/formly/fields/formly-field-table-dialog-multiselect/formly-field-table-dialog-multiselect.component.d.ts +1 -0
- package/lib/components/layout/main-layout.component.d.ts +2 -3
- package/lib/components/layout/topbar.component.d.ts +2 -3
- package/lib/descriptors/editor.descriptor.d.ts +3 -1
- package/lib/router/models/router.model.d.ts +2 -2
- package/lib/router/route-builder.d.ts +18 -4
- package/openapi/templates/model.mustache +82 -0
- package/openapi/templates/models.mustache +50 -0
- package/package.json +1 -1
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
* Do not edit the class manually.
|
|
11
11
|
*/
|
|
12
12
|
export declare enum MediusFilterMatchType {
|
|
13
|
-
Equals,
|
|
14
|
-
NotEquals,
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
StartsWith,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
13
|
+
Equals = "EQUALS",
|
|
14
|
+
NotEquals = "NOT_EQUALS",
|
|
15
|
+
FromTo = "FROM_TO",
|
|
16
|
+
Contains = "CONTAINS",
|
|
17
|
+
StartsWith = "STARTS_WITH",
|
|
18
|
+
EndsWith = "ENDS_WITH",
|
|
19
|
+
In = "IN",
|
|
20
|
+
NotIn = "NOT_IN",
|
|
21
|
+
SmallerThan = "SMALLER_THAN",
|
|
22
|
+
GreaterThan = "GREATER_THAN"
|
|
23
23
|
}
|
|
@@ -12,12 +12,12 @@
|
|
|
12
12
|
import { MediusFilterMatchType } from './filter-match-type.model';
|
|
13
13
|
import { AttributeDef } from './serialization.model';
|
|
14
14
|
export declare class MediusFilterParam {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
static discriminator
|
|
15
|
+
property?: string;
|
|
16
|
+
filterValue?: object;
|
|
17
|
+
filterValueTo?: object;
|
|
18
|
+
filterMatchType?: MediusFilterMatchType;
|
|
19
|
+
filterMatchCaseSensitive?: boolean;
|
|
20
|
+
static discriminator?: string;
|
|
21
21
|
static attributeTypeMap: Array<AttributeDef>;
|
|
22
22
|
static getAttributeTypeMap(): AttributeDef[];
|
|
23
23
|
}
|
|
@@ -13,19 +13,19 @@ import { MediusFilterParam } from './filter-param.model';
|
|
|
13
13
|
import { MediusQueryMode } from './query-mode.model';
|
|
14
14
|
import { AttributeDef } from './serialization.model';
|
|
15
15
|
export declare class MediusQueryParam {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
static discriminator
|
|
16
|
+
sortProperty?: Array<string>;
|
|
17
|
+
sortAsc?: Array<boolean>;
|
|
18
|
+
itemsOffset?: number;
|
|
19
|
+
itemsPerPage?: number;
|
|
20
|
+
filterParams?: Array<MediusFilterParam>;
|
|
21
|
+
filterAllParam?: string;
|
|
22
|
+
filterAllProperties?: Array<string>;
|
|
23
|
+
validateProperties?: Array<string>;
|
|
24
|
+
selectInTwoSteps?: boolean;
|
|
25
|
+
sortEnumByOrdinal?: boolean;
|
|
26
|
+
groupByProperties?: Array<string>;
|
|
27
|
+
queryMode?: MediusQueryMode;
|
|
28
|
+
static discriminator?: string;
|
|
29
29
|
static attributeTypeMap: Array<AttributeDef>;
|
|
30
30
|
static getAttributeTypeMap(): AttributeDef[];
|
|
31
31
|
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventEmitter, ExistingProvider, Injector, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { AutoComplete } from 'primeng/autocomplete';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const MNG_AUTOCOMPLETE_VALUE_ACCESSOR: ExistingProvider;
|
|
8
|
-
export declare class MngAutocompleteComponent implements OnInit, ControlValueAccessor {
|
|
8
|
+
export declare class MngAutocompleteComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
9
9
|
private injector;
|
|
10
10
|
dataProvider?: ILookupDataProvider<any, any>;
|
|
11
11
|
dataKeyProperty?: string;
|
|
@@ -26,6 +26,7 @@ export declare class MngAutocompleteComponent implements OnInit, ControlValueAcc
|
|
|
26
26
|
isLoading: boolean;
|
|
27
27
|
constructor(injector: Injector);
|
|
28
28
|
ngOnInit(): void;
|
|
29
|
+
ngOnDestroy(): void;
|
|
29
30
|
onSearch(event: any): void;
|
|
30
31
|
onSelect(value: any): void;
|
|
31
32
|
registerOnChange(fn: any): void;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { EventEmitter, ExistingProvider, Injector, OnInit } from '@angular/core';
|
|
1
|
+
import { EventEmitter, ExistingProvider, Injector, OnDestroy, OnInit } from '@angular/core';
|
|
2
2
|
import { ControlValueAccessor, FormControl } from '@angular/forms';
|
|
3
3
|
import { Dropdown } from 'primeng/dropdown';
|
|
4
4
|
import { Observable } from 'rxjs';
|
|
5
5
|
import { ILookupDataProvider } from '../../../data-providers';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
7
|
export declare const MNG_DROPDOWN_VALUE_ACCESSOR: ExistingProvider;
|
|
8
|
-
export declare class MngDropdownComponent implements OnInit, ControlValueAccessor {
|
|
8
|
+
export declare class MngDropdownComponent implements OnInit, OnDestroy, ControlValueAccessor {
|
|
9
9
|
private injector;
|
|
10
10
|
dataProvider?: ILookupDataProvider<any, any>;
|
|
11
11
|
dataKeyProperty?: string;
|
|
@@ -14,6 +14,7 @@ export declare class MngDropdownComponent implements OnInit, ControlValueAccesso
|
|
|
14
14
|
multiselect: boolean;
|
|
15
15
|
placeholder?: string;
|
|
16
16
|
showClear: boolean;
|
|
17
|
+
selectFirstItem: boolean;
|
|
17
18
|
className: string | null;
|
|
18
19
|
dropdownClassName: string | null;
|
|
19
20
|
valueChangeEventEmitter: EventEmitter<any>;
|
|
@@ -24,12 +25,14 @@ export declare class MngDropdownComponent implements OnInit, ControlValueAccesso
|
|
|
24
25
|
private onTouchedFn;
|
|
25
26
|
dropdownFormControl: FormControl;
|
|
26
27
|
items$: Observable<Array<any>>;
|
|
28
|
+
private itemsSubscription?;
|
|
27
29
|
constructor(injector: Injector);
|
|
28
30
|
ngOnInit(): void;
|
|
31
|
+
ngOnDestroy(): void;
|
|
29
32
|
registerOnChange(fn: any): void;
|
|
30
33
|
registerOnTouched(fn: any): void;
|
|
31
34
|
setDisabledState(isDisabled: boolean): void;
|
|
32
35
|
writeValue(obj: any): void;
|
|
33
36
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngDropdownComponent, never>;
|
|
34
|
-
static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
|
|
37
|
+
static ɵcmp: i0.ɵɵComponentDeclaration<MngDropdownComponent, "mng-dropdown", never, { "dataProvider": "dataProvider"; "dataKeyProperty": "dataKeyProperty"; "itemsLabelProperty": "itemsLabelProperty"; "itemsValueProperty": "itemsValueProperty"; "multiselect": "multiselect"; "placeholder": "placeholder"; "showClear": "showClear"; "selectFirstItem": "selectFirstItem"; "className": "className"; "dropdownClassName": "dropdownClassName"; }, { "valueChangeEventEmitter": "valueChange"; }, never, never>;
|
|
35
38
|
}
|
|
@@ -22,6 +22,7 @@ export declare class MngFormlyFieldTableDialogMultiselectComponent<T, ET> extend
|
|
|
22
22
|
dialogIsLoading$: Observable<boolean>;
|
|
23
23
|
hasAddAction: boolean;
|
|
24
24
|
hasDeleteAction: boolean;
|
|
25
|
+
private lookupDataProviderSubscription?;
|
|
25
26
|
private subscriptions;
|
|
26
27
|
constructor(injector: Injector);
|
|
27
28
|
ngOnInit(): void;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, QueryList, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { MngTemplateDirective } from '../../directives';
|
|
4
4
|
import { MngCommonsService } from '../../services';
|
|
5
5
|
import { MngMainLayoutComponentService } from './services';
|
|
6
6
|
import * as i0 from "@angular/core";
|
|
7
|
-
export declare class MngMainLayoutComponent implements OnInit
|
|
7
|
+
export declare class MngMainLayoutComponent implements OnInit {
|
|
8
8
|
private route;
|
|
9
9
|
mngCommons: MngCommonsService;
|
|
10
10
|
mainLayoutService: MngMainLayoutComponentService;
|
|
@@ -14,7 +14,6 @@ export declare class MngMainLayoutComponent implements OnInit, AfterViewInit {
|
|
|
14
14
|
footerComponent: Type<any>;
|
|
15
15
|
constructor(route: ActivatedRoute, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
|
|
16
16
|
ngOnInit(): void;
|
|
17
|
-
ngAfterViewInit(): void;
|
|
18
17
|
onWindowResize(event: UIEvent): void;
|
|
19
18
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngMainLayoutComponent, never>;
|
|
20
19
|
static ɵcmp: i0.ɵɵComponentDeclaration<MngMainLayoutComponent, "mng-main-layout", never, {}, {}, never, never>;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OnInit, QueryList, Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRoute } from '@angular/router';
|
|
3
3
|
import { MngTemplateDirective } from '../../directives';
|
|
4
4
|
import { IUser } from '../../models';
|
|
5
5
|
import { MngCommonsService } from '../../services';
|
|
6
6
|
import { MngMainLayoutComponentService } from './services';
|
|
7
7
|
import * as i0 from "@angular/core";
|
|
8
|
-
export declare class MngTopbarComponent implements OnInit
|
|
8
|
+
export declare class MngTopbarComponent implements OnInit {
|
|
9
9
|
private route;
|
|
10
10
|
mngCommons: MngCommonsService;
|
|
11
11
|
mainLayoutService: MngMainLayoutComponentService;
|
|
@@ -17,7 +17,6 @@ export declare class MngTopbarComponent implements OnInit, AfterViewInit {
|
|
|
17
17
|
user?: IUser;
|
|
18
18
|
constructor(route: ActivatedRoute, mngCommons: MngCommonsService, mainLayoutService: MngMainLayoutComponentService);
|
|
19
19
|
ngOnInit(): void;
|
|
20
|
-
ngAfterViewInit(): void;
|
|
21
20
|
switchLanguage(language: string): void;
|
|
22
21
|
logout(user: IUser, event: Event): void;
|
|
23
22
|
static ɵfac: i0.ɵɵFactoryDeclaration<MngTopbarComponent, never>;
|
|
@@ -90,6 +90,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
90
90
|
private _numberStep?;
|
|
91
91
|
private _numberMinFractionDigits?;
|
|
92
92
|
private _numberMaxFractionDigits?;
|
|
93
|
+
private _numberUseGrouping;
|
|
93
94
|
private _radioOptions;
|
|
94
95
|
private _datePickerFormat?;
|
|
95
96
|
private _datePickerMin?;
|
|
@@ -109,6 +110,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
109
110
|
get numberStep(): number | undefined;
|
|
110
111
|
get numberMinFractionDigits(): number | undefined;
|
|
111
112
|
get numberMaxFractionDigits(): number | undefined;
|
|
113
|
+
get numberUseGrouping(): boolean;
|
|
112
114
|
get radioOptions(): EnumValue<string | number | boolean | Date>[];
|
|
113
115
|
get datePickerFormat(): string | undefined;
|
|
114
116
|
get datePickerMin(): Date | undefined;
|
|
@@ -122,7 +124,7 @@ export declare class FieldInputDescriptor<ET> extends AFieldDescriptor<string |
|
|
|
122
124
|
get customComponentName(): string | undefined;
|
|
123
125
|
asText(minLength?: number, maxLength?: number, pattern?: string | RegExp, isEmail?: boolean): this;
|
|
124
126
|
asTextarea(rows?: number, minLength?: number, maxLength?: number, pattern?: string | RegExp): this;
|
|
125
|
-
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number): this;
|
|
127
|
+
asNumber(step?: number, min?: number, max?: number, minFractionDigits?: number, maxFractionDigits?: number, numberUseGrouping?: boolean): this;
|
|
126
128
|
asSwitch(): this;
|
|
127
129
|
asRadio(options: Array<string | number>, optionsTitlePath?: string): this;
|
|
128
130
|
asRadioFromEnum(enumType: EnumType, optionsTitlePath?: string | null, values?: Array<EnumConstantType>, nameAsValue?: boolean): this;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
2
|
import { ActivatedRouteSnapshot, Data } from '@angular/router';
|
|
3
3
|
import { MenuItem } from 'primeng/api';
|
|
4
|
-
import {
|
|
4
|
+
import { ITableviewDataProvider } from '../../data-providers';
|
|
5
5
|
import { ActionDescriptor, TableviewDescriptor } from '../../descriptors';
|
|
6
6
|
export declare type BreadcrumbType = string | string[] | MngBreadcrumbMenuItem | MngBreadcrumbMenuItem[] | ((routeUrl: string, route: ActivatedRouteSnapshot) => MngBreadcrumbMenuItem[]);
|
|
7
7
|
export interface MngBreadcrumbMenuItem extends MenuItem {
|
|
@@ -12,7 +12,7 @@ export interface MngRouterData extends Data {
|
|
|
12
12
|
pageTitle?: string;
|
|
13
13
|
tableview?: {
|
|
14
14
|
descriptor: TableviewDescriptor<any>;
|
|
15
|
-
dataProvider:
|
|
15
|
+
dataProvider: ITableviewDataProvider<any, any>;
|
|
16
16
|
actions?: Array<ActionDescriptor<any>>;
|
|
17
17
|
};
|
|
18
18
|
topbarComponent?: Type<any>;
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
import { Type } from '@angular/core';
|
|
2
|
-
import { LoadChildren, Route, Routes } from '@angular/router';
|
|
2
|
+
import { Data, LoadChildren, Route, Routes } from '@angular/router';
|
|
3
3
|
import { MngMainLayoutComponent } from '../components/layout';
|
|
4
4
|
import { ITableviewDataProvider } from '../data-providers';
|
|
5
5
|
import { ActionDescriptor, TableviewDescriptor } from '../descriptors';
|
|
6
6
|
import { MngMenuItem } from '../models';
|
|
7
|
-
import { BreadcrumbType } from './models';
|
|
7
|
+
import { BreadcrumbType, MngRouterData } from './models';
|
|
8
8
|
export declare class RoutesBuilder {
|
|
9
9
|
private readonly layoutRoute?;
|
|
10
10
|
private routes;
|
|
11
11
|
private currentRoute?;
|
|
12
12
|
private constructor();
|
|
13
13
|
static create(): RoutesBuilder;
|
|
14
|
-
static createWithLayout(layoutComponent?: typeof MngMainLayoutComponent): RoutesBuilder;
|
|
14
|
+
static createWithLayout(layoutComponent?: typeof MngMainLayoutComponent, topbarComponent?: Type<any>, breadcrumbComponent?: Type<any>, menuComponent?: Type<any>, footerComponent?: Type<any>): RoutesBuilder;
|
|
15
15
|
addAngularRoute(route: Route): this;
|
|
16
16
|
addRouteRedirect(path: string, redirectTo: string, pathMatch?: 'full' | 'prefix'): this;
|
|
17
17
|
addLazyRoute(path: string, loadChildren: LoadChildren, canLoad?: Array<any>): this;
|
|
@@ -37,7 +37,7 @@ export declare class RouteBuilder {
|
|
|
37
37
|
static create(path: string, component: Type<any>): RouteBuilder;
|
|
38
38
|
static createRedirect(path: string, redirectTo: string, pathMatch?: 'full' | 'prefix'): RouteBuilder;
|
|
39
39
|
static createFromRoute(route: Route): RouteBuilder;
|
|
40
|
-
static createTableviewRoutes<T, S>(path: string, descriptor: TableviewDescriptor<T>,
|
|
40
|
+
static createTableviewRoutes<T, S>(path: string, descriptor: TableviewDescriptor<T>, dataProvider: ITableviewDataProvider<T, S>, actions?: Array<ActionDescriptor<T>>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
|
|
41
41
|
static createTableviewRoutesFromComponent(path: string, component: Type<any>, hasDetails?: boolean, hasEdit?: boolean, hasAdd?: boolean): RouteBuilder;
|
|
42
42
|
private static addActionsSubroutesToTableviewParent;
|
|
43
43
|
withRoot(routesBuilder: RoutesBuilder): this;
|
|
@@ -51,6 +51,7 @@ export declare class RouteBuilder {
|
|
|
51
51
|
withCanDeactivate(diToken: any): this;
|
|
52
52
|
withResolver(diToken: any, name: string): this;
|
|
53
53
|
withData(data: any): this;
|
|
54
|
+
withDataBuilder(dataBuilder: RouteDataBuilder): this;
|
|
54
55
|
withMngMenuItem(menuItem: MngMenuItem): this;
|
|
55
56
|
withMenuItem(icon?: string, label?: string, routerLink?: Array<string>): this;
|
|
56
57
|
withMenuItemChild(label: string, icon?: string, routerLink?: Array<string>): this;
|
|
@@ -68,3 +69,16 @@ export declare class RouteBuilder {
|
|
|
68
69
|
private adjustMenuRouterLinksFromBuilder;
|
|
69
70
|
private findMenuItemGuards;
|
|
70
71
|
}
|
|
72
|
+
export declare class RouteDataBuilder {
|
|
73
|
+
private data;
|
|
74
|
+
constructor(init?: Data);
|
|
75
|
+
static create(data?: Data): RouteDataBuilder;
|
|
76
|
+
withBreadcrumb(breadcrumb: BreadcrumbType): this;
|
|
77
|
+
withPageTitle(pageTitle: string): this;
|
|
78
|
+
withTableview(descriptor: TableviewDescriptor<any>, dataProvider: ITableviewDataProvider<any, any>, actions?: Array<ActionDescriptor<any>>): this;
|
|
79
|
+
withTopbarComponent(component: Type<any>): this;
|
|
80
|
+
withBreadcrumbComponent(component: Type<any>): this;
|
|
81
|
+
withMenuComponent(component: Type<any>): this;
|
|
82
|
+
withFooterComponent(component: Type<any>): this;
|
|
83
|
+
build(): MngRouterData;
|
|
84
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
{{>licenseInfo}}
|
|
2
|
+
import {AttributeDef} from '@mediusinc/mng-commons';
|
|
3
|
+
{{#models}}
|
|
4
|
+
{{#model}}
|
|
5
|
+
{{#tsImports}}
|
|
6
|
+
{{=<% %>=}}
|
|
7
|
+
import {<%classname%>} from '<%filename%>';
|
|
8
|
+
<%={{ }}=%>
|
|
9
|
+
{{/tsImports}}
|
|
10
|
+
{{#description}}
|
|
11
|
+
/**
|
|
12
|
+
* {{{.}}}
|
|
13
|
+
*/
|
|
14
|
+
{{/description}}
|
|
15
|
+
{{^isEnum}}
|
|
16
|
+
export class {{classname}} {{#parent}}extends {{{.}}} {{/parent}}{
|
|
17
|
+
{{#vars}}
|
|
18
|
+
{{#description}}
|
|
19
|
+
/**
|
|
20
|
+
* {{{.}}}
|
|
21
|
+
*/
|
|
22
|
+
{{/description}}
|
|
23
|
+
{{name}}?: {{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{#isNullable}}|null{{/isNullable}}{{/isEnum}}{{#jsonSchema.default}} = {{{.}}}{{/jsonSchema.default}}{{^jsonSchema.default}}{{#isNullable}} = null{{/isNullable}}{{/jsonSchema.default}};
|
|
24
|
+
{{/vars}}
|
|
25
|
+
|
|
26
|
+
{{#discriminator}}
|
|
27
|
+
public static discriminator?: string = '{{discriminatorName}}';
|
|
28
|
+
{{/discriminator}}
|
|
29
|
+
{{^discriminator}}
|
|
30
|
+
public static discriminator?: string;
|
|
31
|
+
{{/discriminator}}
|
|
32
|
+
|
|
33
|
+
{{^isArray}}
|
|
34
|
+
public static attributeTypeMap: Array<AttributeDef> = [
|
|
35
|
+
{{#vars}}
|
|
36
|
+
{
|
|
37
|
+
name: '{{name}}',
|
|
38
|
+
baseName: '{{baseName}}',
|
|
39
|
+
type: '{{#isEnum}}{{{datatypeWithEnum}}}{{/isEnum}}{{^isEnum}}{{{dataType}}}{{/isEnum}}'
|
|
40
|
+
}{{^-last}},
|
|
41
|
+
{{/-last}}
|
|
42
|
+
{{/vars}}
|
|
43
|
+
|
|
44
|
+
];
|
|
45
|
+
|
|
46
|
+
public static getAttributeTypeMap() {
|
|
47
|
+
{{#parent}}
|
|
48
|
+
return super.getAttributeTypeMap().concat({{classname}}.attributeTypeMap);
|
|
49
|
+
{{/parent}}
|
|
50
|
+
{{^parent}}
|
|
51
|
+
return {{classname}}.attributeTypeMap;
|
|
52
|
+
{{/parent}}
|
|
53
|
+
}
|
|
54
|
+
{{/isArray}}
|
|
55
|
+
}
|
|
56
|
+
{{#hasEnums}}
|
|
57
|
+
export namespace {{classname}} {
|
|
58
|
+
{{#vars}}
|
|
59
|
+
{{#isEnum}}
|
|
60
|
+
export enum {{enumName}} {
|
|
61
|
+
{{#allowableValues}}
|
|
62
|
+
{{#enumVars}}
|
|
63
|
+
{{name}} = {{{value}}}{{^-last}},{{/-last}}
|
|
64
|
+
{{/enumVars}}
|
|
65
|
+
{{/allowableValues}}
|
|
66
|
+
}
|
|
67
|
+
{{/isEnum}}
|
|
68
|
+
{{/vars}}
|
|
69
|
+
}
|
|
70
|
+
{{/hasEnums}}
|
|
71
|
+
{{/isEnum}}
|
|
72
|
+
{{#isEnum}}
|
|
73
|
+
export enum {{classname}} {
|
|
74
|
+
{{#allowableValues}}
|
|
75
|
+
{{#enumVars}}
|
|
76
|
+
{{name}} = {{{value}}}{{^-last}},{{/-last}}
|
|
77
|
+
{{/enumVars}}
|
|
78
|
+
{{/allowableValues}}
|
|
79
|
+
}
|
|
80
|
+
{{/isEnum}}
|
|
81
|
+
{{/model}}
|
|
82
|
+
{{/models}}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
/* eslint-disable */
|
|
2
|
+
{{>licenseInfo}}
|
|
3
|
+
{{#models}}
|
|
4
|
+
{{#model}}
|
|
5
|
+
export * from '{{{ classFilename }}}';
|
|
6
|
+
{{/model}}
|
|
7
|
+
{{/models}}
|
|
8
|
+
|
|
9
|
+
{{#models}}
|
|
10
|
+
{{#model}}
|
|
11
|
+
import { {{classname}} } from '{{{ classFilename }}}';
|
|
12
|
+
{{/model}}
|
|
13
|
+
{{/models}}
|
|
14
|
+
|
|
15
|
+
/**
|
|
16
|
+
* Use this enums as the base for usage in exports and registering to ObjectSerializer.
|
|
17
|
+
* DO NOT FORGET to exclude FilterMatchTypeEnum and QueryModeEnum from enum map as they are already included in @mediusinc/mng-commons.
|
|
18
|
+
* Example for registering enumsMap: ObjectSerializer.get().registerEnums(enumsMap);
|
|
19
|
+
*/
|
|
20
|
+
const enumsMap: {[index: string]: any} = {
|
|
21
|
+
{{#models}}
|
|
22
|
+
{{#model}}
|
|
23
|
+
{{#hasEnums}}
|
|
24
|
+
{{#vars}}
|
|
25
|
+
{{#isEnum}}
|
|
26
|
+
{{#isContainer}}'{{classname}}.{{enumName}}': {{classname}}.{{enumName}}{{/isContainer}}{{^isContainer}}'{{datatypeWithEnum}}': {{datatypeWithEnum}}{{/isContainer}},
|
|
27
|
+
{{/isEnum}}
|
|
28
|
+
{{/vars}}
|
|
29
|
+
{{/hasEnums}}
|
|
30
|
+
{{#isEnum}}
|
|
31
|
+
{{classname}}: {{classname}},
|
|
32
|
+
{{/isEnum}}
|
|
33
|
+
{{/model}}
|
|
34
|
+
{{/models}}
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Use this types as the base for usage in exports and registering to ObjectSerializer.
|
|
39
|
+
* DO NOT FORGET to exclude FilterParam and QueryParam from types map as they are already included in @mediusinc/mng-commons.
|
|
40
|
+
* Example for registering enumsMap: ObjectSerializer.get().registerTypes(typeMap);
|
|
41
|
+
*/
|
|
42
|
+
const typeMap: {[index: string]: any} = {
|
|
43
|
+
{{#models}}
|
|
44
|
+
{{#model}}
|
|
45
|
+
{{^isEnum}}
|
|
46
|
+
{{classname}}: {{classname}},
|
|
47
|
+
{{/isEnum}}
|
|
48
|
+
{{/model}}
|
|
49
|
+
{{/models}}
|
|
50
|
+
}
|