amazon-route-53-dns-zone-file
Version:
Makes DNS Zone File easy. Parses and validates BIND zone files and can be extended for custom features. Functionality is modular. Features are made open for extension and closed for runtime mutation. Written in TypeScript.
49 lines (43 loc) • 1.19 kB
text/typescript
import { ParserTypings, SourceMapTypings } from '../src/parser/types_parser';
import { ParsedTypings } from '../src/shared/types_domain_specific';
import { ParsingError } from '../src/errors/parsing_error';
import {
RecordType,
WarningKeyKind,
} from '../src/shared/constants_domain_specific';
import { RoutingPolicy } from './example_constants';
export namespace ExampleDomain {
export interface HostedZone {
name: string;
isPrivate?: boolean;
comment?: string;
id?: string;
recordCount?: number;
[key: string]: unknown;
}
export interface ApiRecord {
recordName: string;
recordType: RecordType;
routeTrafficToEndpoints: string[];
routingPolicy: RoutingPolicy;
ttl: number;
}
export interface ClientRecord {
name: string;
endpoints: string[];
ttl?: number;
type: RecordType;
}
}
export namespace ExampleZoneFile {
export type ParsedAndValidated = {
parser: ParserTypings.Parser;
records: ExampleDomain.ClientRecord[];
warnings: WarningKeyKind[];
error?: ParsingError;
};
export type ParsedAndAdapted = {
records: ExampleDomain.ApiRecord[];
warnings: WarningKeyKind[];
};
}