@regacy-innovation/shared-services
Version:
Shared services for NestJS microservices
189 lines (188 loc) • 7.14 kB
JavaScript
;
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.ExaBasePayloadDto = void 0;
const class_validator_1 = require("class-validator");
const base_payload_dto_1 = require("./base-payload.dto");
var Category;
(function (Category) {
Category["COMPANY"] = "company";
Category["RESEARCH_PAPER"] = "research paper";
Category["NEWS"] = "news";
Category["PDF"] = "pdf";
Category["GITHUB"] = "github";
Category["TWEET"] = "tweet";
Category["PERSONAL_SITE"] = "personal site";
Category["LINKEDIN_PROFILE"] = "linkedin profile";
Category["FINANCIAL_REPORT"] = "financial report";
})(Category || (Category = {}));
var LivecrawlOptions;
(function (LivecrawlOptions) {
LivecrawlOptions["NEVER"] = "never";
LivecrawlOptions["FALLBACK"] = "fallback";
LivecrawlOptions["ALWAYS"] = "always";
LivecrawlOptions["AUTO"] = "auto";
})(LivecrawlOptions || (LivecrawlOptions = {}));
var SearchType;
(function (SearchType) {
SearchType["KEYWORD"] = "keyword";
SearchType["NEURAL"] = "neural";
SearchType["AUTO"] = "auto";
})(SearchType || (SearchType = {}));
class ContentsExtras {
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", Object)
], ContentsExtras.prototype, "extras", void 0);
class ContentsHighlights {
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", Object)
], ContentsHighlights.prototype, "highlights", void 0);
class ContentsSummary {
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ContentsSummary.prototype, "query", void 0);
class Contents {
constructor() {
this.livecrawlTimeout = 10000;
this.subpages = 0;
}
}
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", ContentsExtras)
], Contents.prototype, "extras", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", ContentsHighlights)
], Contents.prototype, "highlights", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(LivecrawlOptions),
__metadata("design:type", String)
], Contents.prototype, "livecrawl", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], Contents.prototype, "livecrawlTimeout", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], Contents.prototype, "subpages", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], Contents.prototype, "subpageTarget", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", ContentsSummary)
], Contents.prototype, "summary", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], Contents.prototype, "text", void 0);
class ExaBasePayloadDto extends base_payload_dto_1.BasePayloadDto {
constructor() {
super(...arguments);
this.numResults = 10;
this.type = SearchType.AUTO;
this.useAutoprompt = true;
}
}
exports.ExaBasePayloadDto = ExaBasePayloadDto;
__decorate([
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "query", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(Category),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "category", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsObject)(),
__metadata("design:type", Contents)
], ExaBasePayloadDto.prototype, "contents", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "endCrawlDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "endPublishedDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], ExaBasePayloadDto.prototype, "excludeDomains", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], ExaBasePayloadDto.prototype, "excludeText", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], ExaBasePayloadDto.prototype, "includeDomains", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsArray)(),
(0, class_validator_1.IsString)({ each: true }),
__metadata("design:type", Array)
], ExaBasePayloadDto.prototype, "includeText", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsInt)(),
__metadata("design:type", Number)
], ExaBasePayloadDto.prototype, "numResults", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "startCrawlDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsString)(),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "startPublishedDate", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsEnum)(SearchType),
__metadata("design:type", String)
], ExaBasePayloadDto.prototype, "type", void 0);
__decorate([
(0, class_validator_1.IsOptional)(),
(0, class_validator_1.IsBoolean)(),
__metadata("design:type", Boolean)
], ExaBasePayloadDto.prototype, "useAutoprompt", void 0);