UNPKG

@goparrot/geocoder

Version:

TypeScript GeoCoder, node geocoding library, supports google maps, mapquest, here, open street map, tom tom

92 lines 3.76 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.GeocodeQuery = void 0; const class_validator_1 = require("class-validator"); const transformer_1 = require("../util/transformer"); const validation_1 = require("../validation"); const query_1 = require("./query"); class GeocodeQuery extends query_1.Query { constructor() { super(...arguments); this.exactMatch = false; } } __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), (0, class_validator_1.MinLength)(5), (0, class_validator_1.MaxLength)(150), __metadata("design:type", String) ], GeocodeQuery.prototype, "address", void 0); __decorate([ (0, transformer_1.ToBoolean)(), (0, validation_1.IsExactMatchApplicable)(), __metadata("design:type", Boolean) ], GeocodeQuery.prototype, "exactMatch", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.MinLength)(2), (0, class_validator_1.MaxLength)(100), __metadata("design:type", String) ], GeocodeQuery.prototype, "country", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.MinLength)(2), (0, class_validator_1.MaxLength)(100), __metadata("design:type", String) ], GeocodeQuery.prototype, "state", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.MinLength)(2), (0, class_validator_1.MaxLength)(100), __metadata("design:type", String) ], GeocodeQuery.prototype, "stateCode", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.MinLength)(2), (0, class_validator_1.MaxLength)(50), __metadata("design:type", String) ], GeocodeQuery.prototype, "city", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.MinLength)(3), (0, class_validator_1.MaxLength)(20), __metadata("design:type", String) ], GeocodeQuery.prototype, "postalCode", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(-90), (0, class_validator_1.Max)(90), __metadata("design:type", Number) ], GeocodeQuery.prototype, "lat", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(-180), (0, class_validator_1.Max)(180), __metadata("design:type", Number) ], GeocodeQuery.prototype, "lon", void 0); __decorate([ (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsNumber)(), (0, class_validator_1.Min)(0), (0, class_validator_1.Max)(1000000), __metadata("design:type", Number) ], GeocodeQuery.prototype, "radius", void 0); exports.GeocodeQuery = GeocodeQuery; //# sourceMappingURL=geocode-query.js.map