![](https://user-images.githubusercontent.com/9702154/70851497-088c3700-1ea7-11ea-98ec-92c0a4dd0630.png)
![npm](https://camo.githubusercontent.com/67db997c482aee81b188338baed84e4ad44847340b166da926402c971c15b185/68747470733a2f2f696d672e736869656c64732e696f2f6e706d2f762f7377617474732e737667)
npm i swatts
# or
yarn add swatts
import swatts from 'swatts';
swatts({
API: 'http://YOUR-DOMAIN.wtf/swagger/v1/swagger.json',
regexpMethods: {
nameInterface?: /(Container|ExtensionTotal)\[(.*)/, // swagger v2
matchInterfaceName?: /definitions\/(\w+)/, // swagger v2
excludeDTO: /(RequestDto|ExtensionEmpty)/,
replaceSpace: /^\s*[\r\n]/gm,
},
modificators: {
interfaceReplace?: { StatedContainerDto: 'any', 'StatedContainerDto[]': 'any[]' },
typeReplace: { 'integer': 'number' }
},
filePath: __dirname + '/types.ts'
})
export enum EnumUserRole {
administrator = 'administrator', // admin
organizationOwner = 'organizationOwner', // org
}
export interface ProfileDto {
profileID: number; // ProfileID
timeZone: string; // TimeZone
firstName: string; // First name
lastName: string; // Last name
email: string; // Email
userRole: EnumUserRole;
}