UNPKG

@regacy-innovation/shared-services

Version:

Shared services for NestJS microservices

137 lines (136 loc) 5.47 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.CreateAISearchDto = exports.Prompt = exports.Filter = exports.JOB_TYPE_VALUES = exports.JOB_TYPE = exports.AI_AGENT_VALUES = exports.AI_AGENTS = void 0; const class_transformer_1 = require("class-transformer"); const class_validator_1 = require("class-validator"); exports.AI_AGENTS = { chatGPT: 'chatGPT', claude: 'claude', gemini: 'gemini', exa: 'exa', perplexity: 'perplexity', deepSeek: 'deepSeek', db: 'db', grok: 'grok', }; exports.AI_AGENT_VALUES = Object.values(exports.AI_AGENTS); exports.JOB_TYPE = { DUNE_AI_SEARCH: 'DUNE_AI_SEARCH', }; exports.JOB_TYPE_VALUES = Object.values(exports.JOB_TYPE); class Filter { } exports.Filter = Filter; __decorate([ (0, class_validator_1.IsInt)(), (0, class_validator_1.Min)(1900) // Adjust the minimum year as needed , (0, class_validator_1.Max)(new Date().getFullYear() + 1) // Ensure the year is within a valid range , __metadata("design:type", Number) ], Filter.prototype, "establishYearMin", void 0); __decorate([ (0, class_validator_1.IsInt)(), (0, class_validator_1.Min)(1900), (0, class_validator_1.Max)(new Date().getFullYear() + 1), __metadata("design:type", Number) ], Filter.prototype, "establishYearMax", void 0); __decorate([ (0, class_validator_1.IsArray)(), (0, class_validator_1.IsOptional)() // If excludeFundingStages is optional , __metadata("design:type", Array) ], Filter.prototype, "excludeFundingStages", void 0); class Prompt { } exports.Prompt = Prompt; __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsOptional)(), __metadata("design:type", String) ], Prompt.prototype, "name", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), __metadata("design:type", String) ], Prompt.prototype, "prompt", void 0); class CreateAISearchDto { } exports.CreateAISearchDto = CreateAISearchDto; __decorate([ (0, class_validator_1.IsString)(), __metadata("design:type", String) ], CreateAISearchDto.prototype, "name", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), __metadata("design:type", String) ], CreateAISearchDto.prototype, "jwt", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), (0, class_validator_1.IsMongoId)(), __metadata("design:type", String) ], CreateAISearchDto.prototype, "userId", void 0); __decorate([ (0, class_validator_1.IsMongoId)(), (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), __metadata("design:type", String) ], CreateAISearchDto.prototype, "projectId", void 0); __decorate([ (0, class_validator_1.IsMongoId)(), (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), __metadata("design:type", String) ], CreateAISearchDto.prototype, "teamId", void 0); __decorate([ (0, class_validator_1.IsArray)(), (0, class_validator_1.ArrayNotEmpty)(), __metadata("design:type", Array) ], CreateAISearchDto.prototype, "prompts", void 0); __decorate([ (0, class_validator_1.IsArray)(), (0, class_validator_1.ArrayNotEmpty)(), (0, class_validator_1.IsIn)(exports.AI_AGENT_VALUES, { each: true }), __metadata("design:type", Array) ], CreateAISearchDto.prototype, "aiAgents", void 0); __decorate([ (0, class_validator_1.IsString)(), (0, class_validator_1.IsNotEmpty)(), (0, class_validator_1.IsIn)(exports.JOB_TYPE_VALUES), __metadata("design:type", String) ], CreateAISearchDto.prototype, "jobType", void 0); __decorate([ (0, class_validator_1.IsNotEmpty)() // Ensures filter is required , (0, class_validator_1.IsObject)() // Ensures filter is an object , __metadata("design:type", Filter) ], CreateAISearchDto.prototype, "filter", void 0); __decorate([ (0, class_validator_1.IsInt)(), (0, class_validator_1.IsNotEmpty)(), (0, class_transformer_1.Type)(() => Number), __metadata("design:type", Number) ], CreateAISearchDto.prototype, "goalCount", void 0); __decorate([ (0, class_validator_1.IsBoolean)(), (0, class_validator_1.IsNotEmpty)(), (0, class_transformer_1.Type)(() => Boolean), __metadata("design:type", Boolean) ], CreateAISearchDto.prototype, "isForInternational", void 0); __decorate([ (0, class_validator_1.IsArray)({ message: 'suggestionKeywords must be an array' }), (0, class_validator_1.IsString)({ each: true, message: 'Each suggestionKeyword must be a string' }), __metadata("design:type", Array) ], CreateAISearchDto.prototype, "suggestionKeywords", void 0);