@synova-cloud/sdk 1.7.0 → 1.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/errors/index.ts","../src/version.ts","../src/utils/http.ts","../src/schema/types.ts","../src/schema/decorators.ts","../src/schema/class-schema.ts","../src/resources/prompts.ts","../src/resources/models.ts","../src/resources/files.ts","../src/client.ts"],"names":[],"mappings":";;;;;;;;;;AAKO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,aAAA;AACZ,IAAA,MAAA,CAAO,cAAA,CAAe,IAAA,EAAM,GAAA,CAAA,MAAA,CAAW,SAAS,CAAA;AAAA,EAClD;AACF;AAMO,IAAM,cAAA,GAAN,cAA6B,WAAA,CAAY;AAAA,EACrC,IAAA;AAAA,EACA,QAAA;AAAA,EACA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,IAAA;AAAA,EACA,MAAA;AAAA,EACA,OAAA;AAAA,EAET,YAAY,QAAA,EAA6B;AACvC,IAAA,KAAA,CAAM,SAAS,OAAO,CAAA;AACtB,IAAA,IAAA,CAAK,IAAA,GAAO,gBAAA;AACZ,IAAA,IAAA,CAAK,OAAO,QAAA,CAAS,IAAA;AACrB,IAAA,IAAA,CAAK,WAAW,QAAA,CAAS,QAAA;AACzB,IAAA,IAAA,CAAK,YAAY,QAAA,CAAS,SAAA;AAC1B,IAAA,IAAA,CAAK,YAAY,QAAA,CAAS,SAAA;AAC1B,IAAA,IAAA,CAAK,OAAO,QAAA,CAAS,IAAA;AACrB,IAAA,IAAA,CAAK,SAAS,QAAA,CAAS,MAAA;AACvB,IAAA,IAAA,CAAK,UAAU,QAAA,CAAS,OAAA;AAAA,EAC1B;AACF;AAKO,IAAM,eAAA,G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AAM,IAAI,MAAM,qBAAqB,CAAA;AAAA,IACvC;AAEA,IAAA,IAAA,CAAK,IAAA,GAAO,IAAI,UAAA,CAAW;AAAA,MACzB,OAAA,EAAS,QAAQ,OAAA,IAAW,gBAAA;AAAA,MAC5B,MAAA;AAAA,MACA,OAAA,EAAS,QAAQ,OAAA,IAAW,eAAA;AAAA,MAC5B,KAAA,EAAO;AAAA,QACL,UAAA,EAAY,MAAA,EAAQ,KAAA,EAAO,UAAA,IAAc,aAAA,CAAc,UAAA;AAAA,QACvD,QAAA,EAAU,MAAA,EAAQ,KAAA,EAAO,QAAA,IAAY,aAAA,CAAc,QAAA;AAAA,QACnD,cAAA,EAAgB,MAAA,EAAQ,KAAA,EAAO,cAAA,IAAkB,aAAA,CAAc,cAAA;AAAA,QAC/D,UAAA,EAAY,MAAA,EAAQ,KAAA,EAAO,UAAA,IAAc,aAAA,CAAc,UAAA;AAAA,QACvD,iBAAA,EAAmB,MAAA,EAAQ,KAAA,EAAO,iBAAA,IAAqB,aAAA,CAAc;AAAA,OACvE;AAAA,MACA,KAAA,EAAO,QAAQ,KAAA,IAAS,KAAA;AAAA,MACxB,MAAA,EAAQ,QAAQ,MAAA,IAAU;AAAA,KAC3B,CAAA;AAED,IAAA,IAAA,CAAK,OAAA,GAAU,IAAI,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA;AAC5C,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,cAAA,CAAe,IAAA,CAAK,IAAI,CAAA;AAC1C,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,aAAA,CAAc,IAAA,CAAK,IAAI,CAAA;AAAA,EAC1C;AACF","file":"index.js","sourcesContent":["import type { IApiErrorResponse, ISynovaExecutionError } from '../types';\n\n/**\n * Base error class for all Synova SDK errors\n */\nexport class SynovaError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SynovaError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * Error thrown when API returns an error response.\n * Base class for all API-related errors.\n */\nexport class ApiSynovaError extends SynovaError {\n readonly code: string;\n readonly httpCode: number;\n readonly requestId: string;\n readonly timestamp: string;\n readonly path?: string;\n readonly method?: string;\n readonly details?: unknown;\n\n constructor(response: IApiErrorResponse) {\n super(response.message);\n this.name = 'ApiSynovaError';\n this.code = response.code;\n this.httpCode = response.httpCode;\n this.requestId = response.requestId;\n this.timestamp = response.timestamp;\n this.path = response.path;\n this.method = response.method;\n this.details = response.details;\n }\n}\n\n/**\n * Error thrown when authentication fails (401)\n */\nexport class AuthSynovaError extends ApiSynovaError {\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'AuthSynovaError';\n }\n}\n\n/**\n * Error thrown when resource is not found (404)\n */\nexport class NotFoundSynovaError extends ApiSynovaError {\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'NotFoundSynovaError';\n }\n}\n\n/**\n * Error thrown when rate limit is exceeded (429)\n */\nexport class RateLimitSynovaError extends ApiSynovaError {\n readonly retryAfterMs?: number;\n\n constructor(response: IApiErrorResponse, retryAfterMs?: number) {\n super(response);\n this.name = 'RateLimitSynovaError';\n this.retryAfterMs = retryAfterMs;\n }\n}\n\n/**\n * Error thrown when server returns 5xx error\n */\nexport class ServerSynovaError extends ApiSynovaError {\n readonly retryable: boolean = true;\n\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'ServerSynovaError';\n }\n}\n\n/**\n * Error thrown when request times out (client-side)\n */\nexport class TimeoutSynovaError extends SynovaError {\n readonly timeoutMs: number;\n\n constructor(timeoutMs: number) {\n super(`Request timed out after ${timeoutMs}ms`);\n this.name = 'TimeoutSynovaError';\n this.timeoutMs = timeoutMs;\n }\n}\n\n/**\n * Error thrown when network request fails (client-side)\n */\nexport class NetworkSynovaError extends SynovaError {\n readonly cause?: Error;\n\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'NetworkSynovaError';\n this.cause = cause;\n }\n}\n\n/**\n * Error thrown when LLM execution fails (returned in response with type='error')\n */\nexport class ExecutionSynovaError extends SynovaError {\n readonly code: string;\n readonly provider?: string;\n readonly retryable: boolean;\n readonly retryAfterMs?: number;\n readonly details?: ISynovaExecutionError['details'];\n\n constructor(error: ISynovaExecutionError) {\n super(error.message);\n this.name = 'ExecutionSynovaError';\n this.code = error.code;\n this.provider = error.provider;\n this.retryable = error.retryable;\n this.retryAfterMs = error.retryAfterMs;\n this.details = error.details;\n }\n}\n\n/**\n * Validation violation details\n */\nexport interface IValidationViolation {\n property: string;\n constraints: Record<string, string>;\n value?: unknown;\n}\n\n/**\n * Error thrown when LLM response fails class-validator validation\n */\nexport class ValidationSynovaError extends SynovaError {\n readonly violations: IValidationViolation[];\n\n constructor(violations: IValidationViolation[]) {\n const message = `Validation failed: ${violations.map((v) => v.property).join(', ')}`;\n super(message);\n this.name = 'ValidationSynovaError';\n this.violations = violations;\n }\n}\n","declare const __SDK_VERSION__: string;\n\nexport const SDK_VERSION = typeof __SDK_VERSION__ !== 'undefined' ? __SDK_VERSION__ : 'dev';\n","import type { IApiErrorResponse, ISynovaLogger, TSynovaRetryStrategy } from '../types';\nimport {\n ApiSynovaError,\n AuthSynovaError,\n NetworkSynovaError,\n NotFoundSynovaError,\n RateLimitSynovaError,\n ServerSynovaError,\n TimeoutSynovaError,\n} from '../errors';\nimport { SDK_VERSION } from '../version';\n\nexport interface IRetryOptions {\n maxRetries: number;\n strategy: TSynovaRetryStrategy;\n initialDelayMs: number;\n maxDelayMs: number;\n backoffMultiplier: number;\n}\n\nexport interface IHttpClientConfig {\n baseUrl: string;\n apiKey: string;\n timeout: number;\n retry: IRetryOptions;\n debug: boolean;\n logger: ISynovaLogger;\n}\n\nexport interface IRequestOptions {\n method: 'GET' | 'POST' | 'PUT' | 'DELETE';\n path: string;\n body?: unknown;\n query?: Record<string, string | undefined>;\n}\n\nexport interface IUploadOptions {\n path: string;\n formData: FormData;\n}\n\nexport class HttpClient {\n private readonly config: IHttpClientConfig;\n\n constructor(config: IHttpClientConfig) {\n this.config = config;\n }\n\n async request<T>(options: IRequestOptions): Promise<T> {\n const url = this.buildUrl(options.path, options.query);\n const { maxRetries } = this.config.retry;\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n if (attempt > 0) {\n const delay = this.calculateRetryDelay(attempt, lastError);\n this.log(\n `Retry attempt ${attempt}/${maxRetries} after ${delay}ms (strategy: ${this.config.retry.strategy})`,\n );\n await this.sleep(delay);\n }\n\n return await this.makeRequest<T>(url, options);\n } catch (error) {\n lastError = error as Error;\n\n if (!this.isRetryable(error)) {\n throw error;\n }\n\n if (attempt === maxRetries) {\n throw error;\n }\n\n this.log(`Request failed, will retry: ${(error as Error).message}`);\n }\n }\n\n throw lastError;\n }\n\n async upload<T>(options: IUploadOptions): Promise<T> {\n const url = this.buildUrl(options.path);\n const { maxRetries } = this.config.retry;\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n if (attempt > 0) {\n const delay = this.calculateRetryDelay(attempt, lastError);\n this.log(\n `Retry attempt ${attempt}/${maxRetries} after ${delay}ms (strategy: ${this.config.retry.strategy})`,\n );\n await this.sleep(delay);\n }\n\n return await this.makeUploadRequest<T>(url, options.formData);\n } catch (error) {\n lastError = error as Error;\n\n if (!this.isRetryable(error)) {\n throw error;\n }\n\n if (attempt === maxRetries) {\n throw error;\n }\n\n this.log(`Upload failed, will retry: ${(error as Error).message}`);\n }\n }\n\n throw lastError;\n }\n\n private async makeRequest<T>(url: string, options: IRequestOptions): Promise<T> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n this.log(`${options.method} ${url}`);\n\n try {\n const response = await fetch(url, {\n method: options.method,\n headers: {\n Authorization: `Bearer ${this.config.apiKey}`,\n 'Content-Type': 'application/json',\n 'User-Agent': `synova-cloud-sdk-node/${SDK_VERSION}`,\n },\n body: options.body ? JSON.stringify(options.body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n await this.handleErrorResponse(response);\n }\n\n const data = (await response.json()) as T;\n this.log(`Response: ${response.status}`);\n return data;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof Error && error.name === 'AbortError') {\n throw new TimeoutSynovaError(this.config.timeout);\n }\n\n if (\n error instanceof ApiSynovaError ||\n error instanceof AuthSynovaError ||\n error instanceof NotFoundSynovaError ||\n error instanceof RateLimitSynovaError ||\n error instanceof ServerSynovaError\n ) {\n throw error;\n }\n\n throw new NetworkSynovaError(\n `Network request failed: ${(error as Error).message}`,\n error as Error,\n );\n }\n }\n\n private async makeUploadRequest<T>(url: string, formData: FormData): Promise<T> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n this.log(`POST (upload) ${url}`);\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${this.config.apiKey}`,\n 'User-Agent': `synova-cloud-sdk-node/${SDK_VERSION}`,\n // Note: Content-Type is not set for FormData - browser/node sets it with boundary\n },\n body: formData,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n await this.handleErrorResponse(response);\n }\n\n const data = (await response.json()) as T;\n this.log(`Response: ${response.status}`);\n return data;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof Error && error.name === 'AbortError') {\n throw new TimeoutSynovaError(this.config.timeout);\n }\n\n if (\n error instanceof ApiSynovaError ||\n error instanceof AuthSynovaError ||\n error instanceof NotFoundSynovaError ||\n error instanceof RateLimitSynovaError ||\n error instanceof ServerSynovaError\n ) {\n throw error;\n }\n\n throw new NetworkSynovaError(\n `Upload request failed: ${(error as Error).message}`,\n error as Error,\n );\n }\n }\n\n private async handleErrorResponse(response: Response): Promise<never> {\n const status = response.status;\n\n // Try to parse error body\n let errorBody: IApiErrorResponse | null = null;\n try {\n errorBody = (await response.json()) as IApiErrorResponse;\n } catch {\n // Ignore JSON parse errors\n }\n\n // Create default error body if parsing failed\n const defaultErrorBody: IApiErrorResponse = {\n code: 'UNKNOWN_ERROR',\n httpCode: status,\n message: errorBody?.message || `HTTP ${status}: ${response.statusText}`,\n requestId: errorBody?.requestId || 'unknown',\n timestamp: errorBody?.timestamp || new Date().toISOString(),\n path: errorBody?.path,\n method: errorBody?.method,\n details: errorBody?.details,\n };\n\n const body = errorBody || defaultErrorBody;\n\n if (status === 401) {\n throw new AuthSynovaError(body);\n }\n\n if (status === 404) {\n throw new NotFoundSynovaError(body);\n }\n\n if (status === 429) {\n const retryAfter = response.headers.get('Retry-After');\n const retryAfterMs = retryAfter ? parseInt(retryAfter, 10) * 1000 : undefined;\n throw new RateLimitSynovaError(body, retryAfterMs);\n }\n\n if (status >= 500) {\n throw new ServerSynovaError(body);\n }\n\n throw new ApiSynovaError(body);\n }\n\n private buildUrl(path: string, query?: Record<string, string | undefined>): string {\n const url = new URL(path, this.config.baseUrl);\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n url.searchParams.set(key, value);\n }\n }\n }\n\n return url.toString();\n }\n\n private isRetryable(error: unknown): boolean {\n if (error instanceof RateLimitSynovaError) return true;\n if (error instanceof ServerSynovaError) return true;\n if (error instanceof NetworkSynovaError) return true;\n if (error instanceof TimeoutSynovaError) return true;\n return false;\n }\n\n private calculateRetryDelay(attempt: number, error: Error | null): number {\n const { strategy, initialDelayMs, maxDelayMs, backoffMultiplier } = this.config.retry;\n\n // Use Retry-After header if available (takes priority)\n if (error instanceof RateLimitSynovaError && error.retryAfterMs) {\n return Math.min(error.retryAfterMs, maxDelayMs);\n }\n\n let baseDelay: number;\n\n if (strategy === 'linear') {\n // Linear: initialDelay * attempt (1000, 2000, 3000, ...)\n baseDelay = initialDelayMs * attempt;\n } else {\n // Exponential: initialDelay * multiplier^(attempt-1) (1000, 2000, 4000, ...)\n baseDelay = initialDelayMs * Math.pow(backoffMultiplier, attempt - 1);\n }\n\n // Add jitter (±10%) to prevent thundering herd\n const jitter = baseDelay * 0.1 * (Math.random() * 2 - 1);\n const delay = baseDelay + jitter;\n\n return Math.min(Math.max(delay, 0), maxDelayMs);\n }\n\n private sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n private log(message: string): void {\n if (this.config.debug) {\n this.config.logger.debug(`[Synova SDK] ${message}`);\n }\n }\n}\n","// ============================================================================\n// JSON Schema Types (Draft-07 compatible)\n// ============================================================================\n\n/**\n * JSON Schema primitive types\n */\nexport type TJsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';\n\n/**\n * JSON Schema string formats\n * @see https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n */\nexport type TJsonSchemaFormat =\n | 'date-time'\n | 'date'\n | 'time'\n | 'duration'\n | 'email'\n | 'idn-email'\n | 'hostname'\n | 'idn-hostname'\n | 'ipv4'\n | 'ipv6'\n | 'uri'\n | 'uri-reference'\n | 'iri'\n | 'iri-reference'\n | 'uuid'\n | 'json-pointer'\n | 'relative-json-pointer'\n | 'regex';\n\n/**\n * JSON Schema definition\n * @see https://json-schema.org/specification\n */\nexport interface IJsonSchema {\n // ─── Type ───────────────────────────────────────────────────────────────\n type?: TJsonSchemaType | TJsonSchemaType[];\n\n // ─── Metadata ───────────────────────────────────────────────────────────\n description?: string;\n examples?: unknown[];\n default?: unknown;\n\n // ─── Enum ───────────────────────────────────────────────────────────────\n enum?: (string | number | boolean | null)[];\n\n // ─── String constraints ─────────────────────────────────────────────────\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n format?: TJsonSchemaFormat;\n\n // ─── Number constraints ─────────────────────────────────────────────────\n minimum?: number;\n maximum?: number;\n exclusiveMinimum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n\n // ─── Array constraints ──────────────────────────────────────────────────\n items?: IJsonSchema;\n minItems?: number;\n maxItems?: number;\n uniqueItems?: boolean;\n\n // ─── Object constraints ─────────────────────────────────────────────────\n properties?: Record<string, IJsonSchema>;\n required?: string[];\n additionalProperties?: boolean | IJsonSchema;\n\n // ─── Composition ────────────────────────────────────────────────────────\n allOf?: IJsonSchema[];\n anyOf?: IJsonSchema[];\n oneOf?: IJsonSchema[];\n not?: IJsonSchema;\n}\n\n// ============================================================================\n// Decorator Metadata Keys\n// ============================================================================\n\n/**\n * Metadata keys used by schema decorators\n */\nexport const SCHEMA_METADATA_KEYS = {\n // Metadata\n DESCRIPTION: 'synova:schema:description',\n EXAMPLES: 'synova:schema:examples',\n DEFAULT: 'synova:schema:default',\n // Type helpers\n FORMAT: 'synova:schema:format',\n ARRAY_ITEM_TYPE: 'synova:schema:arrayItemType',\n NULLABLE: 'synova:schema:nullable',\n ENUM: 'synova:schema:enum',\n // String constraints\n MIN_LENGTH: 'synova:schema:minLength',\n MAX_LENGTH: 'synova:schema:maxLength',\n PATTERN: 'synova:schema:pattern',\n // Number constraints\n MINIMUM: 'synova:schema:minimum',\n MAXIMUM: 'synova:schema:maximum',\n EXCLUSIVE_MINIMUM: 'synova:schema:exclusiveMinimum',\n EXCLUSIVE_MAXIMUM: 'synova:schema:exclusiveMaximum',\n MULTIPLE_OF: 'synova:schema:multipleOf',\n // Array constraints\n MIN_ITEMS: 'synova:schema:minItems',\n MAX_ITEMS: 'synova:schema:maxItems',\n UNIQUE_ITEMS: 'synova:schema:uniqueItems',\n} as const;\n\n/**\n * Options for schema generation\n */\nexport interface IGenerateSchemaOptions {\n /** Allow additional properties on objects (default: false) */\n additionalProperties?: boolean;\n}\n\n/**\n * Constructor type for classes\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TClassConstructor<T = unknown> = new (...args: any[]) => T;\n","import 'reflect-metadata';\nimport { SCHEMA_METADATA_KEYS, type TJsonSchemaFormat, type TClassConstructor } from './types';\n\n// ============================================================================\n// Helper function\n// ============================================================================\n\nfunction createMetadataDecorator<T>(key: string, value: T): PropertyDecorator {\n return function (target: object, propertyKey: string | symbol) {\n Reflect.defineMetadata(key, value, target, propertyKey);\n };\n}\n\n// ============================================================================\n// Metadata Decorators (LLM helpers)\n// ============================================================================\n\n/**\n * Adds a description to the property schema.\n * Helps LLMs understand the expected content.\n *\n * @example\n * ```typescript\n * class Article {\n * @Description('SEO-optimized article title, 50-60 characters')\n * title: string;\n * }\n * ```\n */\nexport function Description(description: string): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.DESCRIPTION, description);\n}\n\n/**\n * Adds example values to the property schema.\n * Helps LLMs understand the expected format.\n *\n * @example\n * ```typescript\n * class Article {\n * @Example('How to Optimize SQL Queries', '10 Tips for Better Code')\n * title: string;\n * }\n * ```\n */\nexport function Example(...examples: unknown[]): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXAMPLES, examples);\n}\n\n/**\n * Sets the default value for the property.\n *\n * @example\n * ```typescript\n * class Settings {\n * @Default('en')\n * language: string;\n * }\n * ```\n */\nexport function Default(value: unknown): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.DEFAULT, value);\n}\n\n// ============================================================================\n// Type Decorators\n// ============================================================================\n\n/**\n * Sets the type of array items.\n * Required since TypeScript loses array item types at runtime.\n *\n * @example\n * ```typescript\n * class Article {\n * @ArrayItems(String)\n * keywords: string[];\n *\n * @ArrayItems(Comment)\n * comments: Comment[];\n * }\n * ```\n */\nexport function ArrayItems(\n itemType: TClassConstructor | StringConstructor | NumberConstructor | BooleanConstructor,\n): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.ARRAY_ITEM_TYPE, itemType);\n}\n\n/**\n * Sets semantic format for string (email, uri, uuid, date-time, etc.).\n *\n * @example\n * ```typescript\n * class User {\n * @Format('email')\n * email: string;\n *\n * @Format('date-time')\n * createdAt: string;\n * }\n * ```\n */\nexport function Format(format: TJsonSchemaFormat): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.FORMAT, format);\n}\n\n/**\n * Marks the property as nullable (can be null).\n *\n * @example\n * ```typescript\n * class User {\n * @Nullable()\n * middleName: string | null;\n * }\n * ```\n */\nexport function Nullable(): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.NULLABLE, true);\n}\n\n// ============================================================================\n// String Constraint Decorators (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets minimum string length.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaMinLength(3)\n * username: string;\n * }\n * ```\n */\nexport function SchemaMinLength(length: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MIN_LENGTH, length);\n}\n\n/**\n * Sets maximum string length.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaMaxLength(100)\n * bio: string;\n * }\n * ```\n */\nexport function SchemaMaxLength(length: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAX_LENGTH, length);\n}\n\n/**\n * Sets regex pattern for string validation.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaPattern('^[a-z0-9_]+$')\n * username: string;\n * }\n * ```\n */\nexport function SchemaPattern(pattern: string): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.PATTERN, pattern);\n}\n\n// ============================================================================\n// Number Constraint Decorators\n// ============================================================================\n\n/**\n * Sets minimum value (inclusive).\n *\n * @example\n * ```typescript\n * class Product {\n * @SchemaMin(0)\n * price: number;\n * }\n * ```\n */\nexport function SchemaMin(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MINIMUM, value);\n}\n\n/**\n * Sets maximum value (inclusive).\n *\n * @example\n * ```typescript\n * class Rating {\n * @SchemaMax(5)\n * score: number;\n * }\n * ```\n */\nexport function SchemaMax(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAXIMUM, value);\n}\n\n/**\n * Sets minimum value (exclusive).\n *\n * @example\n * ```typescript\n * class Discount {\n * @ExclusiveMin(0) // must be > 0\n * percentage: number;\n * }\n * ```\n */\nexport function ExclusiveMin(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXCLUSIVE_MINIMUM, value);\n}\n\n/**\n * Sets maximum value (exclusive).\n *\n * @example\n * ```typescript\n * class Probability {\n * @ExclusiveMax(1) // must be < 1\n * value: number;\n * }\n * ```\n */\nexport function ExclusiveMax(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXCLUSIVE_MAXIMUM, value);\n}\n\n/**\n * Value must be a multiple of this number.\n *\n * @example\n * ```typescript\n * class Currency {\n * @MultipleOf(0.01)\n * amount: number;\n * }\n * ```\n */\nexport function MultipleOf(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MULTIPLE_OF, value);\n}\n\n// ============================================================================\n// Array Constraint Decorators (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets minimum array length.\n *\n * @example\n * ```typescript\n * class Order {\n * @SchemaMinItems(1)\n * items: OrderItem[];\n * }\n * ```\n */\nexport function SchemaMinItems(count: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MIN_ITEMS, count);\n}\n\n/**\n * Sets maximum array length.\n *\n * @example\n * ```typescript\n * class Article {\n * @SchemaMaxItems(10)\n * tags: string[];\n * }\n * ```\n */\nexport function SchemaMaxItems(count: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAX_ITEMS, count);\n}\n\n/**\n * Requires all array items to be unique.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaUniqueItems()\n * roles: string[];\n * }\n * ```\n */\nexport function SchemaUniqueItems(): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.UNIQUE_ITEMS, true);\n}\n\n// ============================================================================\n// Enum Decorator (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets allowed enum values.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaEnum(['admin', 'user', 'guest'])\n * role: string;\n * }\n * ```\n *\n * With TypeScript enum:\n * ```typescript\n * enum Status { Active = 'active', Inactive = 'inactive' }\n *\n * class User {\n * @SchemaEnum(Object.values(Status))\n * status: Status;\n * }\n * ```\n */\nexport function SchemaEnum(values: (string | number | boolean | null)[]): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.ENUM, values);\n}\n\n// ============================================================================\n// Metadata Getter (for internal use)\n// ============================================================================\n\nexport function getSchemaMetadata<T>(\n key: string,\n target: object,\n propertyKey: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, propertyKey);\n}\n","import 'reflect-metadata';\nimport {\n type IGenerateSchemaOptions,\n type IJsonSchema,\n SCHEMA_METADATA_KEYS,\n type TClassConstructor,\n type TJsonSchemaType,\n} from './types';\nimport { getSchemaMetadata } from './decorators';\n\n/**\n * Generates JSON Schema from TypeScript classes decorated with schema decorators.\n *\n * @example\n * ```typescript\n * import { ClassSchema, Description, Example, SchemaMin, SchemaMax } from '@synova-cloud/sdk';\n *\n * class User {\n * @Description('User ID')\n * @Example('usr_123')\n * id: string;\n *\n * @Description('User age')\n * @SchemaMin(0)\n * @SchemaMax(150)\n * age: number;\n * }\n *\n * const schema = ClassSchema.generate(User);\n * ```\n */\nexport class ClassSchema {\n /**\n * Generate JSON Schema from a class\n */\n static generate<T>(\n targetClass: TClassConstructor<T>,\n options: IGenerateSchemaOptions = {},\n ): IJsonSchema {\n const { additionalProperties = false } = options;\n\n const properties = this.getProperties(targetClass);\n const required = this.getRequiredProperties(targetClass, properties);\n\n return {\n type: 'object',\n properties,\n required: required.length > 0 ? required : undefined,\n additionalProperties,\n };\n }\n\n /**\n * Get all properties with their schemas\n */\n private static getProperties(targetClass: TClassConstructor): Record<string, IJsonSchema> {\n const properties: Record<string, IJsonSchema> = {};\n const prototype = targetClass.prototype;\n\n // Get property names from class-validator metadata if available\n const classValidatorProperties = this.getClassValidatorProperties(targetClass);\n\n // Get property names from our decorators metadata\n const decoratorProperties = this.getDecoratorProperties(prototype);\n\n // Combine all property names\n const allProperties = new Set([...classValidatorProperties, ...decoratorProperties]);\n\n for (const propertyName of allProperties) {\n properties[propertyName] = this.getPropertySchema(targetClass, propertyName);\n }\n\n return properties;\n }\n\n /**\n * Get property names from class-validator metadata\n */\n private static getClassValidatorProperties(targetClass: TClassConstructor): string[] {\n try {\n // Try to import class-validator dynamically\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n const propertyNames = targetMetadatas.map((m: { propertyName: string }) => m.propertyName);\n return [...new Set(propertyNames)] as string[];\n } catch {\n // class-validator not available\n return [];\n }\n }\n\n /**\n * Get property names from our decorator metadata\n */\n private static getDecoratorProperties(prototype: object): string[] {\n const properties: string[] = [];\n\n const ownKeys = Reflect.ownKeys(prototype);\n for (const key of ownKeys) {\n if (typeof key === 'string' && key !== 'constructor') {\n // Check if any of our metadata is set on this property\n for (const metaKey of Object.values(SCHEMA_METADATA_KEYS)) {\n if (Reflect.hasMetadata(metaKey, prototype, key)) {\n properties.push(key);\n break;\n }\n }\n }\n }\n\n return properties;\n }\n\n /**\n * Get JSON Schema for a single property\n */\n private static getPropertySchema(\n targetClass: TClassConstructor,\n propertyName: string,\n ): IJsonSchema {\n const prototype = targetClass.prototype;\n const schema: IJsonSchema = {};\n\n // Get base type from TypeScript reflection\n const designType = Reflect.getMetadata('design:type', prototype, propertyName);\n const baseSchema = this.getBaseTypeSchema(designType, targetClass, propertyName);\n Object.assign(schema, baseSchema);\n\n // Apply class-validator constraints\n this.applyClassValidatorConstraints(schema, targetClass, propertyName);\n\n // Apply our decorator metadata (takes precedence)\n this.applyDecoratorMetadata(schema, prototype, propertyName);\n\n // Handle nullable\n const isNullable = getSchemaMetadata<boolean>(\n SCHEMA_METADATA_KEYS.NULLABLE,\n prototype,\n propertyName,\n );\n if (isNullable && schema.type && typeof schema.type === 'string') {\n schema.type = [schema.type, 'null'] as TJsonSchemaType[];\n }\n\n return schema;\n }\n\n /**\n * Get base schema from TypeScript type\n */\n private static getBaseTypeSchema(\n designType: unknown,\n targetClass: TClassConstructor,\n propertyName: string,\n ): IJsonSchema {\n if (designType === String) {\n return { type: 'string' };\n }\n if (designType === Number) {\n return { type: 'number' };\n }\n if (designType === Boolean) {\n return { type: 'boolean' };\n }\n if (designType === Array) {\n // Get array item type from our decorator\n const itemType = getSchemaMetadata<TClassConstructor>(\n SCHEMA_METADATA_KEYS.ARRAY_ITEM_TYPE,\n targetClass.prototype,\n propertyName,\n );\n return {\n type: 'array',\n items: this.getArrayItemSchema(itemType),\n };\n }\n if (designType === Object) {\n return { type: 'object' };\n }\n // Check if it's a class (nested object)\n if (typeof designType === 'function' && designType.prototype) {\n // It's a class, generate nested schema\n return this.generate(designType as TClassConstructor);\n }\n\n // Default to string\n return { type: 'string' };\n }\n\n /**\n * Get schema for array items\n */\n private static getArrayItemSchema(\n itemType:\n | TClassConstructor\n | StringConstructor\n | NumberConstructor\n | BooleanConstructor\n | undefined,\n ): IJsonSchema {\n if (!itemType) {\n return { type: 'string' }; // Default\n }\n if (itemType === String) {\n return { type: 'string' };\n }\n if (itemType === Number) {\n return { type: 'number' };\n }\n if (itemType === Boolean) {\n return { type: 'boolean' };\n }\n // It's a class\n return this.generate(itemType as TClassConstructor);\n }\n\n /**\n * Apply class-validator constraints to schema\n */\n private static applyClassValidatorConstraints(\n schema: IJsonSchema,\n targetClass: TClassConstructor,\n propertyName: string,\n ): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n\n const propertyMetadatas = targetMetadatas.filter(\n (m: { propertyName: string }) => m.propertyName === propertyName,\n );\n\n for (const metadata of propertyMetadatas) {\n this.applyValidationConstraint(schema, metadata);\n }\n } catch {\n // class-validator not available\n }\n }\n\n /**\n * Apply a single class-validator constraint\n */\n private static applyValidationConstraint(\n schema: IJsonSchema,\n metadata: { name?: string; type?: string; constraints?: unknown[] },\n ): void {\n // class-validator stores constraint name in 'name' property\n const constraintType = metadata.name || metadata.type || '';\n const constraints = metadata.constraints || [];\n\n switch (constraintType) {\n case 'isString':\n schema.type = 'string';\n break;\n case 'isNumber':\n case 'isInt':\n schema.type = constraintType === 'isInt' ? 'integer' : 'number';\n break;\n case 'isBoolean':\n schema.type = 'boolean';\n break;\n case 'isArray':\n schema.type = 'array';\n break;\n case 'isEnum':\n if (constraints[0]) {\n schema.enum = Object.values(constraints[0] as object);\n }\n break;\n case 'minLength':\n schema.minLength = constraints[0] as number;\n break;\n case 'maxLength':\n schema.maxLength = constraints[0] as number;\n break;\n case 'min':\n schema.minimum = constraints[0] as number;\n break;\n case 'max':\n schema.maximum = constraints[0] as number;\n break;\n case 'isEmail':\n schema.format = 'email';\n break;\n case 'isUrl':\n case 'isURL':\n schema.format = 'uri';\n break;\n case 'isUUID':\n schema.format = 'uuid';\n break;\n case 'isDateString':\n case 'isISO8601':\n schema.format = 'date-time';\n break;\n case 'matches':\n if (constraints[0] instanceof RegExp) {\n schema.pattern = constraints[0].source;\n } else if (typeof constraints[0] === 'string') {\n schema.pattern = constraints[0];\n }\n break;\n case 'arrayMinSize':\n schema.minItems = constraints[0] as number;\n break;\n case 'arrayMaxSize':\n schema.maxItems = constraints[0] as number;\n break;\n case 'arrayUnique':\n schema.uniqueItems = true;\n break;\n }\n }\n\n /**\n * Apply our decorator metadata to schema.\n * Our decorators take precedence over class-validator if both are used.\n */\n private static applyDecoratorMetadata(\n schema: IJsonSchema,\n prototype: object,\n propertyName: string,\n ): void {\n // Metadata decorators (LLM helpers)\n const description = getSchemaMetadata<string>(\n SCHEMA_METADATA_KEYS.DESCRIPTION,\n prototype,\n propertyName,\n );\n if (description) schema.description = description;\n\n const examples = getSchemaMetadata<unknown[]>(\n SCHEMA_METADATA_KEYS.EXAMPLES,\n prototype,\n propertyName,\n );\n if (examples) schema.examples = examples;\n\n const defaultValue = getSchemaMetadata<unknown>(\n SCHEMA_METADATA_KEYS.DEFAULT,\n prototype,\n propertyName,\n );\n if (defaultValue !== undefined) schema.default = defaultValue;\n\n // Format\n const format = getSchemaMetadata<string>(SCHEMA_METADATA_KEYS.FORMAT, prototype, propertyName);\n if (format) schema.format = format as IJsonSchema['format'];\n\n // Enum\n const enumValues = getSchemaMetadata<(string | number | boolean | null)[]>(\n SCHEMA_METADATA_KEYS.ENUM,\n prototype,\n propertyName,\n );\n if (enumValues) schema.enum = enumValues;\n\n // String constraints\n const minLength = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MIN_LENGTH,\n prototype,\n propertyName,\n );\n if (minLength !== undefined) schema.minLength = minLength;\n\n const maxLength = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAX_LENGTH,\n prototype,\n propertyName,\n );\n if (maxLength !== undefined) schema.maxLength = maxLength;\n\n const pattern = getSchemaMetadata<string>(\n SCHEMA_METADATA_KEYS.PATTERN,\n prototype,\n propertyName,\n );\n if (pattern) schema.pattern = pattern;\n\n // Number constraints\n const minimum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MINIMUM,\n prototype,\n propertyName,\n );\n if (minimum !== undefined) schema.minimum = minimum;\n\n const maximum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAXIMUM,\n prototype,\n propertyName,\n );\n if (maximum !== undefined) schema.maximum = maximum;\n\n const exclusiveMinimum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.EXCLUSIVE_MINIMUM,\n prototype,\n propertyName,\n );\n if (exclusiveMinimum !== undefined) schema.exclusiveMinimum = exclusiveMinimum;\n\n const exclusiveMaximum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.EXCLUSIVE_MAXIMUM,\n prototype,\n propertyName,\n );\n if (exclusiveMaximum !== undefined) schema.exclusiveMaximum = exclusiveMaximum;\n\n const multipleOf = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MULTIPLE_OF,\n prototype,\n propertyName,\n );\n if (multipleOf !== undefined) schema.multipleOf = multipleOf;\n\n // Array constraints\n const minItems = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MIN_ITEMS,\n prototype,\n propertyName,\n );\n if (minItems !== undefined) schema.minItems = minItems;\n\n const maxItems = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAX_ITEMS,\n prototype,\n propertyName,\n );\n if (maxItems !== undefined) schema.maxItems = maxItems;\n\n const uniqueItems = getSchemaMetadata<boolean>(\n SCHEMA_METADATA_KEYS.UNIQUE_ITEMS,\n prototype,\n propertyName,\n );\n if (uniqueItems) schema.uniqueItems = uniqueItems;\n }\n\n /**\n * Get required properties (properties without @IsOptional)\n */\n private static getRequiredProperties(\n targetClass: TClassConstructor,\n properties: Record<string, IJsonSchema>,\n ): string[] {\n const required: string[] = [];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n\n for (const propertyName of Object.keys(properties)) {\n const isOptional = targetMetadatas.some(\n (m: { propertyName: string; type: string }) =>\n m.propertyName === propertyName &&\n (m.type === 'isOptional' || m.type === 'conditionalValidation'),\n );\n if (!isOptional) {\n required.push(propertyName);\n }\n }\n } catch {\n // class-validator not available, all properties are required by default\n required.push(...Object.keys(properties));\n }\n\n return required;\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type {\n ISynovaPrompt,\n ISynovaGetPromptOptions,\n ISynovaExecuteOptions,\n ISynovaExecuteResponse,\n} from '../types';\nimport type { TClassConstructor } from '../schema/types';\nimport { ClassSchema } from '../schema/class-schema';\nimport { ExecutionSynovaError, ValidationSynovaError, type IValidationViolation } from '../errors';\n\n/**\n * Execute options with optional responseClass for typed responses\n */\nexport interface ISynovaExecuteTypedOptions<T> extends Omit<\n ISynovaExecuteOptions,\n 'responseSchema'\n> {\n /** Class to use for response typing and schema generation */\n responseClass: TClassConstructor<T>;\n /** Enable class-validator validation (default: true) */\n validate?: boolean;\n}\n\nexport class PromptsResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a prompt by ID (returns version with 'latest' tag)\n */\n async get(promptId: string, options?: ISynovaGetPromptOptions): Promise<ISynovaPrompt> {\n if (options?.version) {\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}/versions/${options.version}`,\n });\n }\n\n const tag = options?.tag || 'latest';\n if (tag === 'latest') {\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}`,\n });\n }\n\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}/tags/${tag}`,\n });\n }\n\n /**\n * Execute a prompt with typed response\n *\n * @example\n * ```ts\n * // With responseClass - returns typed object\n * const topic = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * responseClass: TopicDto,\n * });\n * console.log(topic.title); // Typed as string\n * ```\n */\n execute<T>(promptId: string, options: ISynovaExecuteTypedOptions<T>): Promise<T>;\n\n /**\n * Execute a prompt\n *\n * @example\n * ```ts\n * // Without responseClass - returns ISynovaExecuteResponse\n * const result = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * });\n * if (result.type === 'message') {\n * console.log(result.content);\n * }\n * ```\n */\n execute(promptId: string, options: ISynovaExecuteOptions): Promise<ISynovaExecuteResponse>;\n\n async execute<T>(\n promptId: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n // Check if responseClass is provided\n if ('responseClass' in options && options.responseClass) {\n return this.executeTyped(promptId, options as ISynovaExecuteTypedOptions<T>);\n }\n\n return this.executeRaw(promptId, options as ISynovaExecuteOptions);\n }\n\n /**\n * Execute a prompt by tag with typed response\n */\n executeByTag<T>(\n promptId: string,\n tag: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T>;\n\n /**\n * Execute a prompt by tag\n */\n executeByTag(\n promptId: string,\n tag: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse>;\n\n async executeByTag<T>(\n promptId: string,\n tag: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n return this.execute(promptId, { ...options, tag } as\n | ISynovaExecuteOptions\n | ISynovaExecuteTypedOptions<T>);\n }\n\n /**\n * Execute a prompt by version with typed response\n */\n executeByVersion<T>(\n promptId: string,\n version: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T>;\n\n /**\n * Execute a prompt by version\n */\n executeByVersion(\n promptId: string,\n version: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse>;\n\n async executeByVersion<T>(\n promptId: string,\n version: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n return this.execute(promptId, { ...options, version } as\n | ISynovaExecuteOptions\n | ISynovaExecuteTypedOptions<T>);\n }\n\n /**\n * Execute raw request without typed response\n * @throws {ExecutionSynovaError} If LLM returns an error\n */\n private async executeRaw(\n promptId: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse> {\n const body: Record<string, unknown> = {\n provider: options.provider,\n model: options.model,\n };\n\n if (options.apiKey !== undefined) body.apiKey = options.apiKey;\n if (options.azureEndpoint !== undefined) body.azureEndpoint = options.azureEndpoint;\n if (options.variables !== undefined) body.variables = options.variables;\n if (options.messages !== undefined) body.messages = options.messages;\n if (options.tag !== undefined) body.tag = options.tag;\n if (options.version !== undefined) body.version = options.version;\n if (options.metadata !== undefined) body.metadata = options.metadata;\n if (options.parameters !== undefined) body.parameters = options.parameters;\n if (options.responseSchema !== undefined) body.responseSchema = options.responseSchema;\n\n const response = await this.http.request<ISynovaExecuteResponse>({\n method: 'POST',\n path: `/api/v1/prompts/${promptId}/run`,\n body,\n });\n\n // Always throw on LLM error\n if (response.type === 'error' && response.error) {\n throw new ExecutionSynovaError(response.error);\n }\n\n return response;\n }\n\n /**\n * Execute with typed response class\n */\n private async executeTyped<T>(\n promptId: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T> {\n const { responseClass, validate = true, ...executeOptions } = options;\n\n // Generate JSON Schema from class\n const responseSchema = ClassSchema.generate(responseClass);\n\n // Execute with schema (executeRaw throws on LLM error)\n const response = await this.executeRaw(promptId, {\n ...executeOptions,\n responseSchema,\n } as ISynovaExecuteOptions);\n\n // Get the object from response\n const object = response.object as T;\n\n // Validate with class-validator if enabled\n if (validate) {\n await this.validateObject(object, responseClass);\n }\n\n return object;\n }\n\n /**\n * Validate object using class-validator\n */\n private async validateObject<T>(object: T, responseClass: TClassConstructor<T>): Promise<void> {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { plainToInstance } = require('class-transformer');\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { validate } = require('class-validator');\n\n const instance = plainToInstance(responseClass, object);\n const errors = await validate(instance);\n\n if (errors.length > 0) {\n const violations: IValidationViolation[] = errors.map(\n (error: { property: string; constraints?: Record<string, string>; value?: unknown }) => ({\n property: error.property,\n constraints: error.constraints || {},\n value: error.value,\n }),\n );\n\n throw new ValidationSynovaError(violations);\n }\n } catch (error) {\n if (error instanceof ValidationSynovaError) {\n throw error;\n }\n console.warn(\n '[Synova SDK] Validation skipped: class-validator or class-transformer not installed. ' +\n 'Install them with: npm install class-validator class-transformer',\n );\n }\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type { ISynovaModel, ISynovaModelsResponse, ISynovaListModelsOptions } from '../types';\n\ninterface IProviderModelsResponse {\n models: ISynovaModel[];\n}\n\nexport class ModelsResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * List all available models\n *\n * @param options - Optional filters\n * @returns List of providers with their models\n *\n * @example\n * ```ts\n * // Get all models\n * const { providers } = await client.models.list();\n *\n * // Filter by type\n * const imageModels = await client.models.list({ type: 'image' });\n *\n * // Filter by capability\n * const functionCallingModels = await client.models.list({\n * capability: 'function_calling',\n * });\n *\n * // Filter by provider\n * const openaiModels = await client.models.list({ provider: 'openai' });\n * ```\n */\n async list(options?: ISynovaListModelsOptions): Promise<ISynovaModelsResponse> {\n return this.http.request<ISynovaModelsResponse>({\n method: 'GET',\n path: '/api/v1/models',\n query: {\n type: options?.type,\n capability: options?.capability,\n provider: options?.provider,\n },\n });\n }\n\n /**\n * Get models for a specific provider\n *\n * @param provider - Provider ID (e.g., 'openai', 'anthropic')\n * @returns List of models for the provider\n *\n * @example\n * ```ts\n * const { models } = await client.models.getByProvider('openai');\n * ```\n */\n async getByProvider(provider: string): Promise<ISynovaModel[]> {\n const response = await this.http.request<IProviderModelsResponse>({\n method: 'GET',\n path: `/api/v1/models/${provider}`,\n });\n return response.models;\n }\n\n /**\n * Get a specific model\n *\n * @param provider - Provider ID\n * @param model - Model ID\n * @returns Model details\n *\n * @example\n * ```ts\n * const model = await client.models.get('openai', 'gpt-4o');\n * console.log(model.capabilities);\n * console.log(model.limits);\n * ```\n */\n async get(provider: string, model: string): Promise<ISynovaModel> {\n return this.http.request<ISynovaModel>({\n method: 'GET',\n path: `/api/v1/models/${provider}/${model}`,\n });\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type { ISynovaUploadResponse, ISynovaUploadOptions } from '../types';\n\nexport class FilesResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Upload files for use in prompt execution\n *\n * @param files - Array of File or Blob objects to upload\n * @param options - Upload options including projectId\n * @returns Upload response with file metadata\n *\n * @example\n * ```ts\n * // Upload files\n * const result = await client.files.upload(\n * [file1, file2],\n * { projectId: 'prj_abc123' }\n * );\n *\n * console.log('Uploaded files:', result.data);\n *\n * // Use uploaded file in prompt execution\n * const response = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * messages: [\n * {\n * role: 'user',\n * content: 'Describe this image',\n * files: [{ fileId: result.data[0].id }],\n * },\n * ],\n * });\n * ```\n */\n async upload(\n files: (File | Blob)[],\n options: ISynovaUploadOptions,\n ): Promise<ISynovaUploadResponse> {\n const formData = new FormData();\n\n for (const file of files) {\n formData.append('files', file);\n }\n\n formData.append('projectId', options.projectId);\n\n return this.http.upload<ISynovaUploadResponse>({\n path: '/api/v1/files/upload',\n formData,\n });\n }\n}\n","import type { ISynovaConfig, ISynovaLogger } from './types';\nimport type { IRetryOptions } from './utils/http';\nimport { HttpClient } from './utils/http';\nimport { PromptsResource } from './resources/prompts';\nimport { ModelsResource } from './resources/models';\nimport { FilesResource } from './resources/files';\n\nconst DEFAULT_BASE_URL = 'https://api.synova.cloud';\nconst DEFAULT_TIMEOUT = 30000;\n\nconst DEFAULT_RETRY: IRetryOptions = {\n maxRetries: 3,\n strategy: 'exponential',\n initialDelayMs: 1000,\n maxDelayMs: 30000,\n backoffMultiplier: 2,\n};\n\nconst DEFAULT_LOGGER: ISynovaLogger = {\n debug: (message, ...args) => console.debug(message, ...args),\n info: (message, ...args) => console.info(message, ...args),\n warn: (message, ...args) => console.warn(message, ...args),\n error: (messageOrError, ...args) => console.error(messageOrError, ...args),\n};\n\n/**\n * Synova Cloud SDK client\n *\n * @example\n * ```ts\n * import { SynovaCloudSdk } from '@synova-cloud/sdk';\n *\n * const client = new SynovaCloudSdk('your-api-key');\n *\n * // Get a prompt\n * const prompt = await client.prompts.get('prm_abc123');\n *\n * // Execute a prompt with direct API key\n * const result = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * apiKey: 'sk-...',\n * variables: { topic: 'TypeScript' },\n * });\n *\n * // Execute with Azure OpenAI\n * const azureResult = await client.prompts.execute('prm_abc123', {\n * provider: 'azure_openai',\n * model: 'gpt-4o',\n * apiKey: 'your-azure-key',\n * azureEndpoint: 'https://my-resource.openai.azure.com',\n * variables: { topic: 'TypeScript' },\n * });\n *\n * // List available models\n * const { providers } = await client.models.list();\n *\n * // Get models for a specific provider\n * const openaiModels = await client.models.getByProvider('openai');\n *\n * // With custom retry config\n * const clientWithRetry = new SynovaCloudSdk('your-api-key', {\n * retry: {\n * maxRetries: 5,\n * strategy: 'linear',\n * initialDelayMs: 500,\n * },\n * });\n * ```\n */\nexport class SynovaCloudSdk {\n readonly prompts: PromptsResource;\n readonly models: ModelsResource;\n readonly files: FilesResource;\n\n private readonly http: HttpClient;\n\n /**\n * Create a new Synova Cloud SDK client\n *\n * @param apiKey - Your Synova API key\n * @param config - Optional configuration\n */\n constructor(apiKey: string, config?: ISynovaConfig) {\n if (!apiKey) {\n throw new Error('API key is required');\n }\n\n this.http = new HttpClient({\n baseUrl: config?.baseUrl ?? DEFAULT_BASE_URL,\n apiKey,\n timeout: config?.timeout ?? DEFAULT_TIMEOUT,\n retry: {\n maxRetries: config?.retry?.maxRetries ?? DEFAULT_RETRY.maxRetries,\n strategy: config?.retry?.strategy ?? DEFAULT_RETRY.strategy,\n initialDelayMs: config?.retry?.initialDelayMs ?? DEFAULT_RETRY.initialDelayMs,\n maxDelayMs: config?.retry?.maxDelayMs ?? DEFAULT_RETRY.maxDelayMs,\n backoffMultiplier: config?.retry?.backoffMultiplier ?? DEFAULT_RETRY.backoffMultiplier,\n },\n debug: config?.debug ?? false,\n logger: config?.logger ?? DEFAULT_LOGGER,\n });\n\n this.prompts = new PromptsResource(this.http);\n this.models = new ModelsResource(this.http);\n this.files = new FilesResource(this.http);\n }\n}\n"]}
1
+ {"version":3,"sources":["../src/errors/index.ts","../src/version.ts","../src/utils/http.ts","../src/schema/types.ts","../src/schema/decorators.ts","../src/schema/class-schema.ts","../src/resources/prompts.ts","../src/resources/models.ts","../src/resources/files.ts","../src/resources/spans.ts","../src/client.ts"],"names":[],"mappings":";;;;;;;;;;AAKO,IAAM,WAAA,GAAN,cAA0B,KAAA,CAAM;AAAA,EACrC,YAAY,OAAA,EAAiB;AAC3B,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,EAAO;AAAA,QACL,UAAA,EAAY,MAAA,EAAQ,KAAA,EAAO,UAAA,IAAc,aAAA,CAAc,UAAA;AAAA,QACvD,QAAA,EAAU,MAAA,EAAQ,KAAA,EAAO,QAAA,IAAY,aAAA,CAAc,QAAA;AAAA,QACnD,cAAA,EAAgB,MAAA,EAAQ,KAAA,EAAO,cAAA,IAAkB,aAAA,CAAc,cAAA;AAAA,QAC/D,UAAA,EAAY,MAAA,EAAQ,KAAA,EAAO,UAAA,IAAc,aAAA,CAAc,UAAA;AAAA,QACvD,iBAAA,EAAmB,MAAA,EAAQ,KAAA,EAAO,iBAAA,IAAqB,aAAA,CAAc;AAAA,OACvE;AAAA,MACA,KAAA,EAAO,QAAQ,KAAA,IAAS,KAAA;AAAA,MACxB,MAAA,EAAQ,QAAQ,MAAA,IAAU;AAAA,KAC3B,CAAA;AAED,IAAA,IAAA,CAAK,OAAA,GAAU,IAAI,eAAA,CAAgB,IAAA,CAAK,IAAI,CAAA;AAC5C,IAAA,IAAA,CAAK,MAAA,GAAS,IAAI,cAAA,CAAe,IAAA,CAAK,IAAI,CAAA;AAC1C,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,aAAA,CAAc,IAAA,CAAK,IAAI,CAAA;AACxC,IAAA,IAAA,CAAK,KAAA,GAAQ,IAAI,aAAA,CAAc,IAAA,CAAK,IAAI,CAAA;AAAA,EAC1C;AACF","file":"index.js","sourcesContent":["import type { IApiErrorResponse, ISynovaExecutionError } from '../types';\n\n/**\n * Base error class for all Synova SDK errors\n */\nexport class SynovaError extends Error {\n constructor(message: string) {\n super(message);\n this.name = 'SynovaError';\n Object.setPrototypeOf(this, new.target.prototype);\n }\n}\n\n/**\n * Error thrown when API returns an error response.\n * Base class for all API-related errors.\n */\nexport class ApiSynovaError extends SynovaError {\n readonly code: string;\n readonly httpCode: number;\n readonly requestId: string;\n readonly timestamp: string;\n readonly path?: string;\n readonly method?: string;\n readonly details?: unknown;\n\n constructor(response: IApiErrorResponse) {\n super(response.message);\n this.name = 'ApiSynovaError';\n this.code = response.code;\n this.httpCode = response.httpCode;\n this.requestId = response.requestId;\n this.timestamp = response.timestamp;\n this.path = response.path;\n this.method = response.method;\n this.details = response.details;\n }\n}\n\n/**\n * Error thrown when authentication fails (401)\n */\nexport class AuthSynovaError extends ApiSynovaError {\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'AuthSynovaError';\n }\n}\n\n/**\n * Error thrown when resource is not found (404)\n */\nexport class NotFoundSynovaError extends ApiSynovaError {\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'NotFoundSynovaError';\n }\n}\n\n/**\n * Error thrown when rate limit is exceeded (429)\n */\nexport class RateLimitSynovaError extends ApiSynovaError {\n readonly retryAfterMs?: number;\n\n constructor(response: IApiErrorResponse, retryAfterMs?: number) {\n super(response);\n this.name = 'RateLimitSynovaError';\n this.retryAfterMs = retryAfterMs;\n }\n}\n\n/**\n * Error thrown when server returns 5xx error\n */\nexport class ServerSynovaError extends ApiSynovaError {\n readonly retryable: boolean = true;\n\n constructor(response: IApiErrorResponse) {\n super(response);\n this.name = 'ServerSynovaError';\n }\n}\n\n/**\n * Error thrown when request times out (client-side)\n */\nexport class TimeoutSynovaError extends SynovaError {\n readonly timeoutMs: number;\n\n constructor(timeoutMs: number) {\n super(`Request timed out after ${timeoutMs}ms`);\n this.name = 'TimeoutSynovaError';\n this.timeoutMs = timeoutMs;\n }\n}\n\n/**\n * Error thrown when network request fails (client-side)\n */\nexport class NetworkSynovaError extends SynovaError {\n readonly cause?: Error;\n\n constructor(message: string, cause?: Error) {\n super(message);\n this.name = 'NetworkSynovaError';\n this.cause = cause;\n }\n}\n\n/**\n * Error thrown when LLM execution fails (returned in response with type='error')\n */\nexport class ExecutionSynovaError extends SynovaError {\n readonly code: string;\n readonly provider?: string;\n readonly retryable: boolean;\n readonly retryAfterMs?: number;\n readonly details?: ISynovaExecutionError['details'];\n\n constructor(error: ISynovaExecutionError) {\n super(error.message);\n this.name = 'ExecutionSynovaError';\n this.code = error.code;\n this.provider = error.provider;\n this.retryable = error.retryable;\n this.retryAfterMs = error.retryAfterMs;\n this.details = error.details;\n }\n}\n\n/**\n * Validation violation details\n */\nexport interface IValidationViolation {\n property: string;\n constraints: Record<string, string>;\n value?: unknown;\n}\n\n/**\n * Error thrown when LLM response fails class-validator validation\n */\nexport class ValidationSynovaError extends SynovaError {\n readonly violations: IValidationViolation[];\n\n constructor(violations: IValidationViolation[]) {\n const message = `Validation failed: ${violations.map((v) => v.property).join(', ')}`;\n super(message);\n this.name = 'ValidationSynovaError';\n this.violations = violations;\n }\n}\n","declare const __SDK_VERSION__: string;\n\nexport const SDK_VERSION = typeof __SDK_VERSION__ !== 'undefined' ? __SDK_VERSION__ : 'dev';\n","import type { IApiErrorResponse, ISynovaLogger, TSynovaRetryStrategy } from '../types';\nimport {\n ApiSynovaError,\n AuthSynovaError,\n NetworkSynovaError,\n NotFoundSynovaError,\n RateLimitSynovaError,\n ServerSynovaError,\n TimeoutSynovaError,\n} from '../errors';\nimport { SDK_VERSION } from '../version';\n\nexport interface IRetryOptions {\n maxRetries: number;\n strategy: TSynovaRetryStrategy;\n initialDelayMs: number;\n maxDelayMs: number;\n backoffMultiplier: number;\n}\n\nexport interface IHttpClientConfig {\n baseUrl: string;\n apiKey: string;\n timeout: number;\n retry: IRetryOptions;\n debug: boolean;\n logger: ISynovaLogger;\n}\n\nexport interface IRequestOptions {\n method: 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE';\n path: string;\n body?: unknown;\n query?: Record<string, string | undefined>;\n}\n\nexport interface IUploadOptions {\n path: string;\n formData: FormData;\n}\n\nexport class HttpClient {\n private readonly config: IHttpClientConfig;\n\n constructor(config: IHttpClientConfig) {\n this.config = config;\n }\n\n async request<T>(options: IRequestOptions): Promise<T> {\n const url = this.buildUrl(options.path, options.query);\n const { maxRetries } = this.config.retry;\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n if (attempt > 0) {\n const delay = this.calculateRetryDelay(attempt, lastError);\n this.log(\n `Retry attempt ${attempt}/${maxRetries} after ${delay}ms (strategy: ${this.config.retry.strategy})`,\n );\n await this.sleep(delay);\n }\n\n return await this.makeRequest<T>(url, options);\n } catch (error) {\n lastError = error as Error;\n\n if (!this.isRetryable(error)) {\n throw error;\n }\n\n if (attempt === maxRetries) {\n throw error;\n }\n\n this.log(`Request failed, will retry: ${(error as Error).message}`);\n }\n }\n\n throw lastError;\n }\n\n async upload<T>(options: IUploadOptions): Promise<T> {\n const url = this.buildUrl(options.path);\n const { maxRetries } = this.config.retry;\n let lastError: Error | null = null;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n if (attempt > 0) {\n const delay = this.calculateRetryDelay(attempt, lastError);\n this.log(\n `Retry attempt ${attempt}/${maxRetries} after ${delay}ms (strategy: ${this.config.retry.strategy})`,\n );\n await this.sleep(delay);\n }\n\n return await this.makeUploadRequest<T>(url, options.formData);\n } catch (error) {\n lastError = error as Error;\n\n if (!this.isRetryable(error)) {\n throw error;\n }\n\n if (attempt === maxRetries) {\n throw error;\n }\n\n this.log(`Upload failed, will retry: ${(error as Error).message}`);\n }\n }\n\n throw lastError;\n }\n\n private async makeRequest<T>(url: string, options: IRequestOptions): Promise<T> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n this.log(`${options.method} ${url}`);\n\n try {\n const response = await fetch(url, {\n method: options.method,\n headers: {\n Authorization: `Bearer ${this.config.apiKey}`,\n 'Content-Type': 'application/json',\n 'User-Agent': `synova-cloud-sdk-node/${SDK_VERSION}`,\n },\n body: options.body ? JSON.stringify(options.body) : undefined,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n await this.handleErrorResponse(response);\n }\n\n const data = (await response.json()) as T;\n this.log(`Response: ${response.status}`);\n return data;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof Error && error.name === 'AbortError') {\n throw new TimeoutSynovaError(this.config.timeout);\n }\n\n if (\n error instanceof ApiSynovaError ||\n error instanceof AuthSynovaError ||\n error instanceof NotFoundSynovaError ||\n error instanceof RateLimitSynovaError ||\n error instanceof ServerSynovaError\n ) {\n throw error;\n }\n\n throw new NetworkSynovaError(\n `Network request failed: ${(error as Error).message}`,\n error as Error,\n );\n }\n }\n\n private async makeUploadRequest<T>(url: string, formData: FormData): Promise<T> {\n const controller = new AbortController();\n const timeoutId = setTimeout(() => controller.abort(), this.config.timeout);\n\n this.log(`POST (upload) ${url}`);\n\n try {\n const response = await fetch(url, {\n method: 'POST',\n headers: {\n Authorization: `Bearer ${this.config.apiKey}`,\n 'User-Agent': `synova-cloud-sdk-node/${SDK_VERSION}`,\n // Note: Content-Type is not set for FormData - browser/node sets it with boundary\n },\n body: formData,\n signal: controller.signal,\n });\n\n clearTimeout(timeoutId);\n\n if (!response.ok) {\n await this.handleErrorResponse(response);\n }\n\n const data = (await response.json()) as T;\n this.log(`Response: ${response.status}`);\n return data;\n } catch (error) {\n clearTimeout(timeoutId);\n\n if (error instanceof Error && error.name === 'AbortError') {\n throw new TimeoutSynovaError(this.config.timeout);\n }\n\n if (\n error instanceof ApiSynovaError ||\n error instanceof AuthSynovaError ||\n error instanceof NotFoundSynovaError ||\n error instanceof RateLimitSynovaError ||\n error instanceof ServerSynovaError\n ) {\n throw error;\n }\n\n throw new NetworkSynovaError(\n `Upload request failed: ${(error as Error).message}`,\n error as Error,\n );\n }\n }\n\n private async handleErrorResponse(response: Response): Promise<never> {\n const status = response.status;\n\n // Try to parse error body\n let errorBody: IApiErrorResponse | null = null;\n try {\n errorBody = (await response.json()) as IApiErrorResponse;\n } catch {\n // Ignore JSON parse errors\n }\n\n // Create default error body if parsing failed\n const defaultErrorBody: IApiErrorResponse = {\n code: 'UNKNOWN_ERROR',\n httpCode: status,\n message: errorBody?.message || `HTTP ${status}: ${response.statusText}`,\n requestId: errorBody?.requestId || 'unknown',\n timestamp: errorBody?.timestamp || new Date().toISOString(),\n path: errorBody?.path,\n method: errorBody?.method,\n details: errorBody?.details,\n };\n\n const body = errorBody || defaultErrorBody;\n\n if (status === 401) {\n throw new AuthSynovaError(body);\n }\n\n if (status === 404) {\n throw new NotFoundSynovaError(body);\n }\n\n if (status === 429) {\n const retryAfter = response.headers.get('Retry-After');\n const retryAfterMs = retryAfter ? parseInt(retryAfter, 10) * 1000 : undefined;\n throw new RateLimitSynovaError(body, retryAfterMs);\n }\n\n if (status >= 500) {\n throw new ServerSynovaError(body);\n }\n\n throw new ApiSynovaError(body);\n }\n\n private buildUrl(path: string, query?: Record<string, string | undefined>): string {\n const url = new URL(path, this.config.baseUrl);\n\n if (query) {\n for (const [key, value] of Object.entries(query)) {\n if (value !== undefined) {\n url.searchParams.set(key, value);\n }\n }\n }\n\n return url.toString();\n }\n\n private isRetryable(error: unknown): boolean {\n if (error instanceof RateLimitSynovaError) return true;\n if (error instanceof ServerSynovaError) return true;\n if (error instanceof NetworkSynovaError) return true;\n if (error instanceof TimeoutSynovaError) return true;\n return false;\n }\n\n private calculateRetryDelay(attempt: number, error: Error | null): number {\n const { strategy, initialDelayMs, maxDelayMs, backoffMultiplier } = this.config.retry;\n\n // Use Retry-After header if available (takes priority)\n if (error instanceof RateLimitSynovaError && error.retryAfterMs) {\n return Math.min(error.retryAfterMs, maxDelayMs);\n }\n\n let baseDelay: number;\n\n if (strategy === 'linear') {\n // Linear: initialDelay * attempt (1000, 2000, 3000, ...)\n baseDelay = initialDelayMs * attempt;\n } else {\n // Exponential: initialDelay * multiplier^(attempt-1) (1000, 2000, 4000, ...)\n baseDelay = initialDelayMs * Math.pow(backoffMultiplier, attempt - 1);\n }\n\n // Add jitter (±10%) to prevent thundering herd\n const jitter = baseDelay * 0.1 * (Math.random() * 2 - 1);\n const delay = baseDelay + jitter;\n\n return Math.min(Math.max(delay, 0), maxDelayMs);\n }\n\n private sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n private log(message: string): void {\n if (this.config.debug) {\n this.config.logger.debug(`[Synova SDK] ${message}`);\n }\n }\n}\n","// ============================================================================\n// JSON Schema Types (Draft-07 compatible)\n// ============================================================================\n\n/**\n * JSON Schema primitive types\n */\nexport type TJsonSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object' | 'array';\n\n/**\n * JSON Schema string formats\n * @see https://json-schema.org/understanding-json-schema/reference/string#built-in-formats\n */\nexport type TJsonSchemaFormat =\n | 'date-time'\n | 'date'\n | 'time'\n | 'duration'\n | 'email'\n | 'idn-email'\n | 'hostname'\n | 'idn-hostname'\n | 'ipv4'\n | 'ipv6'\n | 'uri'\n | 'uri-reference'\n | 'iri'\n | 'iri-reference'\n | 'uuid'\n | 'json-pointer'\n | 'relative-json-pointer'\n | 'regex';\n\n/**\n * JSON Schema definition\n * @see https://json-schema.org/specification\n */\nexport interface IJsonSchema {\n // ─── Type ───────────────────────────────────────────────────────────────\n type?: TJsonSchemaType | TJsonSchemaType[];\n\n // ─── Metadata ───────────────────────────────────────────────────────────\n description?: string;\n examples?: unknown[];\n default?: unknown;\n\n // ─── Enum ───────────────────────────────────────────────────────────────\n enum?: (string | number | boolean | null)[];\n\n // ─── String constraints ─────────────────────────────────────────────────\n minLength?: number;\n maxLength?: number;\n pattern?: string;\n format?: TJsonSchemaFormat;\n\n // ─── Number constraints ─────────────────────────────────────────────────\n minimum?: number;\n maximum?: number;\n exclusiveMinimum?: number;\n exclusiveMaximum?: number;\n multipleOf?: number;\n\n // ─── Array constraints ──────────────────────────────────────────────────\n items?: IJsonSchema;\n minItems?: number;\n maxItems?: number;\n uniqueItems?: boolean;\n\n // ─── Object constraints ─────────────────────────────────────────────────\n properties?: Record<string, IJsonSchema>;\n required?: string[];\n additionalProperties?: boolean | IJsonSchema;\n\n // ─── Composition ────────────────────────────────────────────────────────\n allOf?: IJsonSchema[];\n anyOf?: IJsonSchema[];\n oneOf?: IJsonSchema[];\n not?: IJsonSchema;\n}\n\n// ============================================================================\n// Decorator Metadata Keys\n// ============================================================================\n\n/**\n * Metadata keys used by schema decorators\n */\nexport const SCHEMA_METADATA_KEYS = {\n // Metadata\n DESCRIPTION: 'synova:schema:description',\n EXAMPLES: 'synova:schema:examples',\n DEFAULT: 'synova:schema:default',\n // Type helpers\n FORMAT: 'synova:schema:format',\n ARRAY_ITEM_TYPE: 'synova:schema:arrayItemType',\n NULLABLE: 'synova:schema:nullable',\n ENUM: 'synova:schema:enum',\n // String constraints\n MIN_LENGTH: 'synova:schema:minLength',\n MAX_LENGTH: 'synova:schema:maxLength',\n PATTERN: 'synova:schema:pattern',\n // Number constraints\n MINIMUM: 'synova:schema:minimum',\n MAXIMUM: 'synova:schema:maximum',\n EXCLUSIVE_MINIMUM: 'synova:schema:exclusiveMinimum',\n EXCLUSIVE_MAXIMUM: 'synova:schema:exclusiveMaximum',\n MULTIPLE_OF: 'synova:schema:multipleOf',\n // Array constraints\n MIN_ITEMS: 'synova:schema:minItems',\n MAX_ITEMS: 'synova:schema:maxItems',\n UNIQUE_ITEMS: 'synova:schema:uniqueItems',\n} as const;\n\n/**\n * Options for schema generation\n */\nexport interface IGenerateSchemaOptions {\n /** Allow additional properties on objects (default: false) */\n additionalProperties?: boolean;\n}\n\n/**\n * Constructor type for classes\n */\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport type TClassConstructor<T = unknown> = new (...args: any[]) => T;\n","import 'reflect-metadata';\nimport { SCHEMA_METADATA_KEYS, type TJsonSchemaFormat, type TClassConstructor } from './types';\n\n// ============================================================================\n// Helper function\n// ============================================================================\n\nfunction createMetadataDecorator<T>(key: string, value: T): PropertyDecorator {\n return function (target: object, propertyKey: string | symbol) {\n Reflect.defineMetadata(key, value, target, propertyKey);\n };\n}\n\n// ============================================================================\n// Metadata Decorators (LLM helpers)\n// ============================================================================\n\n/**\n * Adds a description to the property schema.\n * Helps LLMs understand the expected content.\n *\n * @example\n * ```typescript\n * class Article {\n * @Description('SEO-optimized article title, 50-60 characters')\n * title: string;\n * }\n * ```\n */\nexport function Description(description: string): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.DESCRIPTION, description);\n}\n\n/**\n * Adds example values to the property schema.\n * Helps LLMs understand the expected format.\n *\n * @example\n * ```typescript\n * class Article {\n * @Example('How to Optimize SQL Queries', '10 Tips for Better Code')\n * title: string;\n * }\n * ```\n */\nexport function Example(...examples: unknown[]): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXAMPLES, examples);\n}\n\n/**\n * Sets the default value for the property.\n *\n * @example\n * ```typescript\n * class Settings {\n * @Default('en')\n * language: string;\n * }\n * ```\n */\nexport function Default(value: unknown): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.DEFAULT, value);\n}\n\n// ============================================================================\n// Type Decorators\n// ============================================================================\n\n/**\n * Sets the type of array items.\n * Required since TypeScript loses array item types at runtime.\n *\n * @example\n * ```typescript\n * class Article {\n * @ArrayItems(String)\n * keywords: string[];\n *\n * @ArrayItems(Comment)\n * comments: Comment[];\n * }\n * ```\n */\nexport function ArrayItems(\n itemType: TClassConstructor | StringConstructor | NumberConstructor | BooleanConstructor,\n): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.ARRAY_ITEM_TYPE, itemType);\n}\n\n/**\n * Sets semantic format for string (email, uri, uuid, date-time, etc.).\n *\n * @example\n * ```typescript\n * class User {\n * @Format('email')\n * email: string;\n *\n * @Format('date-time')\n * createdAt: string;\n * }\n * ```\n */\nexport function Format(format: TJsonSchemaFormat): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.FORMAT, format);\n}\n\n/**\n * Marks the property as nullable (can be null).\n *\n * @example\n * ```typescript\n * class User {\n * @Nullable()\n * middleName: string | null;\n * }\n * ```\n */\nexport function Nullable(): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.NULLABLE, true);\n}\n\n// ============================================================================\n// String Constraint Decorators (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets minimum string length.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaMinLength(3)\n * username: string;\n * }\n * ```\n */\nexport function SchemaMinLength(length: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MIN_LENGTH, length);\n}\n\n/**\n * Sets maximum string length.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaMaxLength(100)\n * bio: string;\n * }\n * ```\n */\nexport function SchemaMaxLength(length: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAX_LENGTH, length);\n}\n\n/**\n * Sets regex pattern for string validation.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaPattern('^[a-z0-9_]+$')\n * username: string;\n * }\n * ```\n */\nexport function SchemaPattern(pattern: string): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.PATTERN, pattern);\n}\n\n// ============================================================================\n// Number Constraint Decorators\n// ============================================================================\n\n/**\n * Sets minimum value (inclusive).\n *\n * @example\n * ```typescript\n * class Product {\n * @SchemaMin(0)\n * price: number;\n * }\n * ```\n */\nexport function SchemaMin(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MINIMUM, value);\n}\n\n/**\n * Sets maximum value (inclusive).\n *\n * @example\n * ```typescript\n * class Rating {\n * @SchemaMax(5)\n * score: number;\n * }\n * ```\n */\nexport function SchemaMax(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAXIMUM, value);\n}\n\n/**\n * Sets minimum value (exclusive).\n *\n * @example\n * ```typescript\n * class Discount {\n * @ExclusiveMin(0) // must be > 0\n * percentage: number;\n * }\n * ```\n */\nexport function ExclusiveMin(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXCLUSIVE_MINIMUM, value);\n}\n\n/**\n * Sets maximum value (exclusive).\n *\n * @example\n * ```typescript\n * class Probability {\n * @ExclusiveMax(1) // must be < 1\n * value: number;\n * }\n * ```\n */\nexport function ExclusiveMax(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.EXCLUSIVE_MAXIMUM, value);\n}\n\n/**\n * Value must be a multiple of this number.\n *\n * @example\n * ```typescript\n * class Currency {\n * @MultipleOf(0.01)\n * amount: number;\n * }\n * ```\n */\nexport function MultipleOf(value: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MULTIPLE_OF, value);\n}\n\n// ============================================================================\n// Array Constraint Decorators (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets minimum array length.\n *\n * @example\n * ```typescript\n * class Order {\n * @SchemaMinItems(1)\n * items: OrderItem[];\n * }\n * ```\n */\nexport function SchemaMinItems(count: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MIN_ITEMS, count);\n}\n\n/**\n * Sets maximum array length.\n *\n * @example\n * ```typescript\n * class Article {\n * @SchemaMaxItems(10)\n * tags: string[];\n * }\n * ```\n */\nexport function SchemaMaxItems(count: number): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.MAX_ITEMS, count);\n}\n\n/**\n * Requires all array items to be unique.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaUniqueItems()\n * roles: string[];\n * }\n * ```\n */\nexport function SchemaUniqueItems(): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.UNIQUE_ITEMS, true);\n}\n\n// ============================================================================\n// Enum Decorator (prefixed to avoid class-validator conflict)\n// ============================================================================\n\n/**\n * Sets allowed enum values.\n *\n * @example\n * ```typescript\n * class User {\n * @SchemaEnum(['admin', 'user', 'guest'])\n * role: string;\n * }\n * ```\n *\n * With TypeScript enum:\n * ```typescript\n * enum Status { Active = 'active', Inactive = 'inactive' }\n *\n * class User {\n * @SchemaEnum(Object.values(Status))\n * status: Status;\n * }\n * ```\n */\nexport function SchemaEnum(values: (string | number | boolean | null)[]): PropertyDecorator {\n return createMetadataDecorator(SCHEMA_METADATA_KEYS.ENUM, values);\n}\n\n// ============================================================================\n// Metadata Getter (for internal use)\n// ============================================================================\n\nexport function getSchemaMetadata<T>(\n key: string,\n target: object,\n propertyKey: string,\n): T | undefined {\n return Reflect.getMetadata(key, target, propertyKey);\n}\n","import 'reflect-metadata';\nimport {\n type IGenerateSchemaOptions,\n type IJsonSchema,\n SCHEMA_METADATA_KEYS,\n type TClassConstructor,\n type TJsonSchemaType,\n} from './types';\nimport { getSchemaMetadata } from './decorators';\n\n/**\n * Generates JSON Schema from TypeScript classes decorated with schema decorators.\n *\n * @example\n * ```typescript\n * import { ClassSchema, Description, Example, SchemaMin, SchemaMax } from '@synova-cloud/sdk';\n *\n * class User {\n * @Description('User ID')\n * @Example('usr_123')\n * id: string;\n *\n * @Description('User age')\n * @SchemaMin(0)\n * @SchemaMax(150)\n * age: number;\n * }\n *\n * const schema = ClassSchema.generate(User);\n * ```\n */\nexport class ClassSchema {\n /**\n * Generate JSON Schema from a class\n */\n static generate<T>(\n targetClass: TClassConstructor<T>,\n options: IGenerateSchemaOptions = {},\n ): IJsonSchema {\n const { additionalProperties = false } = options;\n\n const properties = this.getProperties(targetClass);\n const required = this.getRequiredProperties(targetClass, properties);\n\n return {\n type: 'object',\n properties,\n required: required.length > 0 ? required : undefined,\n additionalProperties,\n };\n }\n\n /**\n * Get all properties with their schemas\n */\n private static getProperties(targetClass: TClassConstructor): Record<string, IJsonSchema> {\n const properties: Record<string, IJsonSchema> = {};\n const prototype = targetClass.prototype;\n\n // Get property names from class-validator metadata if available\n const classValidatorProperties = this.getClassValidatorProperties(targetClass);\n\n // Get property names from our decorators metadata\n const decoratorProperties = this.getDecoratorProperties(prototype);\n\n // Combine all property names\n const allProperties = new Set([...classValidatorProperties, ...decoratorProperties]);\n\n for (const propertyName of allProperties) {\n properties[propertyName] = this.getPropertySchema(targetClass, propertyName);\n }\n\n return properties;\n }\n\n /**\n * Get property names from class-validator metadata\n */\n private static getClassValidatorProperties(targetClass: TClassConstructor): string[] {\n try {\n // Try to import class-validator dynamically\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n const propertyNames = targetMetadatas.map((m: { propertyName: string }) => m.propertyName);\n return [...new Set(propertyNames)] as string[];\n } catch {\n // class-validator not available\n return [];\n }\n }\n\n /**\n * Get property names from our decorator metadata\n */\n private static getDecoratorProperties(prototype: object): string[] {\n const properties: string[] = [];\n\n const ownKeys = Reflect.ownKeys(prototype);\n for (const key of ownKeys) {\n if (typeof key === 'string' && key !== 'constructor') {\n // Check if any of our metadata is set on this property\n for (const metaKey of Object.values(SCHEMA_METADATA_KEYS)) {\n if (Reflect.hasMetadata(metaKey, prototype, key)) {\n properties.push(key);\n break;\n }\n }\n }\n }\n\n return properties;\n }\n\n /**\n * Get JSON Schema for a single property\n */\n private static getPropertySchema(\n targetClass: TClassConstructor,\n propertyName: string,\n ): IJsonSchema {\n const prototype = targetClass.prototype;\n const schema: IJsonSchema = {};\n\n // Get base type from TypeScript reflection\n const designType = Reflect.getMetadata('design:type', prototype, propertyName);\n const baseSchema = this.getBaseTypeSchema(designType, targetClass, propertyName);\n Object.assign(schema, baseSchema);\n\n // Apply class-validator constraints\n this.applyClassValidatorConstraints(schema, targetClass, propertyName);\n\n // Apply our decorator metadata (takes precedence)\n this.applyDecoratorMetadata(schema, prototype, propertyName);\n\n // Handle nullable\n const isNullable = getSchemaMetadata<boolean>(\n SCHEMA_METADATA_KEYS.NULLABLE,\n prototype,\n propertyName,\n );\n if (isNullable && schema.type && typeof schema.type === 'string') {\n schema.type = [schema.type, 'null'] as TJsonSchemaType[];\n }\n\n return schema;\n }\n\n /**\n * Get base schema from TypeScript type\n */\n private static getBaseTypeSchema(\n designType: unknown,\n targetClass: TClassConstructor,\n propertyName: string,\n ): IJsonSchema {\n if (designType === String) {\n return { type: 'string' };\n }\n if (designType === Number) {\n return { type: 'number' };\n }\n if (designType === Boolean) {\n return { type: 'boolean' };\n }\n if (designType === Array) {\n // Get array item type from our decorator\n const itemType = getSchemaMetadata<TClassConstructor>(\n SCHEMA_METADATA_KEYS.ARRAY_ITEM_TYPE,\n targetClass.prototype,\n propertyName,\n );\n return {\n type: 'array',\n items: this.getArrayItemSchema(itemType),\n };\n }\n if (designType === Object) {\n return { type: 'object' };\n }\n // Check if it's a class (nested object)\n if (typeof designType === 'function' && designType.prototype) {\n // It's a class, generate nested schema\n return this.generate(designType as TClassConstructor);\n }\n\n // Default to string\n return { type: 'string' };\n }\n\n /**\n * Get schema for array items\n */\n private static getArrayItemSchema(\n itemType:\n | TClassConstructor\n | StringConstructor\n | NumberConstructor\n | BooleanConstructor\n | undefined,\n ): IJsonSchema {\n if (!itemType) {\n return { type: 'string' }; // Default\n }\n if (itemType === String) {\n return { type: 'string' };\n }\n if (itemType === Number) {\n return { type: 'number' };\n }\n if (itemType === Boolean) {\n return { type: 'boolean' };\n }\n // It's a class\n return this.generate(itemType as TClassConstructor);\n }\n\n /**\n * Apply class-validator constraints to schema\n */\n private static applyClassValidatorConstraints(\n schema: IJsonSchema,\n targetClass: TClassConstructor,\n propertyName: string,\n ): void {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n\n const propertyMetadatas = targetMetadatas.filter(\n (m: { propertyName: string }) => m.propertyName === propertyName,\n );\n\n for (const metadata of propertyMetadatas) {\n this.applyValidationConstraint(schema, metadata);\n }\n } catch {\n // class-validator not available\n }\n }\n\n /**\n * Apply a single class-validator constraint\n */\n private static applyValidationConstraint(\n schema: IJsonSchema,\n metadata: { name?: string; type?: string; constraints?: unknown[] },\n ): void {\n // class-validator stores constraint name in 'name' property\n const constraintType = metadata.name || metadata.type || '';\n const constraints = metadata.constraints || [];\n\n switch (constraintType) {\n case 'isString':\n schema.type = 'string';\n break;\n case 'isNumber':\n case 'isInt':\n schema.type = constraintType === 'isInt' ? 'integer' : 'number';\n break;\n case 'isBoolean':\n schema.type = 'boolean';\n break;\n case 'isArray':\n schema.type = 'array';\n break;\n case 'isEnum':\n if (constraints[0]) {\n schema.enum = Object.values(constraints[0] as object);\n }\n break;\n case 'minLength':\n schema.minLength = constraints[0] as number;\n break;\n case 'maxLength':\n schema.maxLength = constraints[0] as number;\n break;\n case 'min':\n schema.minimum = constraints[0] as number;\n break;\n case 'max':\n schema.maximum = constraints[0] as number;\n break;\n case 'isEmail':\n schema.format = 'email';\n break;\n case 'isUrl':\n case 'isURL':\n schema.format = 'uri';\n break;\n case 'isUUID':\n schema.format = 'uuid';\n break;\n case 'isDateString':\n case 'isISO8601':\n schema.format = 'date-time';\n break;\n case 'matches':\n if (constraints[0] instanceof RegExp) {\n schema.pattern = constraints[0].source;\n } else if (typeof constraints[0] === 'string') {\n schema.pattern = constraints[0];\n }\n break;\n case 'arrayMinSize':\n schema.minItems = constraints[0] as number;\n break;\n case 'arrayMaxSize':\n schema.maxItems = constraints[0] as number;\n break;\n case 'arrayUnique':\n schema.uniqueItems = true;\n break;\n }\n }\n\n /**\n * Apply our decorator metadata to schema.\n * Our decorators take precedence over class-validator if both are used.\n */\n private static applyDecoratorMetadata(\n schema: IJsonSchema,\n prototype: object,\n propertyName: string,\n ): void {\n // Metadata decorators (LLM helpers)\n const description = getSchemaMetadata<string>(\n SCHEMA_METADATA_KEYS.DESCRIPTION,\n prototype,\n propertyName,\n );\n if (description) schema.description = description;\n\n const examples = getSchemaMetadata<unknown[]>(\n SCHEMA_METADATA_KEYS.EXAMPLES,\n prototype,\n propertyName,\n );\n if (examples) schema.examples = examples;\n\n const defaultValue = getSchemaMetadata<unknown>(\n SCHEMA_METADATA_KEYS.DEFAULT,\n prototype,\n propertyName,\n );\n if (defaultValue !== undefined) schema.default = defaultValue;\n\n // Format\n const format = getSchemaMetadata<string>(SCHEMA_METADATA_KEYS.FORMAT, prototype, propertyName);\n if (format) schema.format = format as IJsonSchema['format'];\n\n // Enum\n const enumValues = getSchemaMetadata<(string | number | boolean | null)[]>(\n SCHEMA_METADATA_KEYS.ENUM,\n prototype,\n propertyName,\n );\n if (enumValues) schema.enum = enumValues;\n\n // String constraints\n const minLength = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MIN_LENGTH,\n prototype,\n propertyName,\n );\n if (minLength !== undefined) schema.minLength = minLength;\n\n const maxLength = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAX_LENGTH,\n prototype,\n propertyName,\n );\n if (maxLength !== undefined) schema.maxLength = maxLength;\n\n const pattern = getSchemaMetadata<string>(\n SCHEMA_METADATA_KEYS.PATTERN,\n prototype,\n propertyName,\n );\n if (pattern) schema.pattern = pattern;\n\n // Number constraints\n const minimum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MINIMUM,\n prototype,\n propertyName,\n );\n if (minimum !== undefined) schema.minimum = minimum;\n\n const maximum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAXIMUM,\n prototype,\n propertyName,\n );\n if (maximum !== undefined) schema.maximum = maximum;\n\n const exclusiveMinimum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.EXCLUSIVE_MINIMUM,\n prototype,\n propertyName,\n );\n if (exclusiveMinimum !== undefined) schema.exclusiveMinimum = exclusiveMinimum;\n\n const exclusiveMaximum = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.EXCLUSIVE_MAXIMUM,\n prototype,\n propertyName,\n );\n if (exclusiveMaximum !== undefined) schema.exclusiveMaximum = exclusiveMaximum;\n\n const multipleOf = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MULTIPLE_OF,\n prototype,\n propertyName,\n );\n if (multipleOf !== undefined) schema.multipleOf = multipleOf;\n\n // Array constraints\n const minItems = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MIN_ITEMS,\n prototype,\n propertyName,\n );\n if (minItems !== undefined) schema.minItems = minItems;\n\n const maxItems = getSchemaMetadata<number>(\n SCHEMA_METADATA_KEYS.MAX_ITEMS,\n prototype,\n propertyName,\n );\n if (maxItems !== undefined) schema.maxItems = maxItems;\n\n const uniqueItems = getSchemaMetadata<boolean>(\n SCHEMA_METADATA_KEYS.UNIQUE_ITEMS,\n prototype,\n propertyName,\n );\n if (uniqueItems) schema.uniqueItems = uniqueItems;\n }\n\n /**\n * Get required properties (properties without @IsOptional)\n */\n private static getRequiredProperties(\n targetClass: TClassConstructor,\n properties: Record<string, IJsonSchema>,\n ): string[] {\n const required: string[] = [];\n\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { getMetadataStorage } = require('class-validator');\n const metadataStorage = getMetadataStorage();\n const targetMetadatas = metadataStorage.getTargetValidationMetadatas(\n targetClass,\n '',\n true,\n false,\n );\n\n for (const propertyName of Object.keys(properties)) {\n const isOptional = targetMetadatas.some(\n (m: { propertyName: string; type: string }) =>\n m.propertyName === propertyName &&\n (m.type === 'isOptional' || m.type === 'conditionalValidation'),\n );\n if (!isOptional) {\n required.push(propertyName);\n }\n }\n } catch {\n // class-validator not available, all properties are required by default\n required.push(...Object.keys(properties));\n }\n\n return required;\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type {\n ISynovaPrompt,\n ISynovaGetPromptOptions,\n ISynovaExecuteOptions,\n ISynovaExecuteResponse,\n} from '../types';\nimport type { TClassConstructor } from '../schema/types';\nimport { ClassSchema } from '../schema/class-schema';\nimport { ExecutionSynovaError, ValidationSynovaError, type IValidationViolation } from '../errors';\n\n/**\n * Execute options with optional responseClass for typed responses\n */\nexport interface ISynovaExecuteTypedOptions<T> extends Omit<\n ISynovaExecuteOptions,\n 'responseSchema'\n> {\n /** Class to use for response typing and schema generation */\n responseClass: TClassConstructor<T>;\n /** Enable class-validator validation (default: true) */\n validate?: boolean;\n}\n\nexport class PromptsResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Get a prompt by ID (returns version with 'latest' tag)\n */\n async get(promptId: string, options?: ISynovaGetPromptOptions): Promise<ISynovaPrompt> {\n if (options?.version) {\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}/versions/${options.version}`,\n });\n }\n\n const tag = options?.tag || 'latest';\n if (tag === 'latest') {\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}`,\n });\n }\n\n return this.http.request<ISynovaPrompt>({\n method: 'GET',\n path: `/api/v1/prompts/${promptId}/tags/${tag}`,\n });\n }\n\n /**\n * Execute a prompt with typed response\n *\n * @example\n * ```ts\n * // With responseClass - returns typed object\n * const topic = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * responseClass: TopicDto,\n * });\n * console.log(topic.title); // Typed as string\n * ```\n */\n execute<T>(promptId: string, options: ISynovaExecuteTypedOptions<T>): Promise<T>;\n\n /**\n * Execute a prompt\n *\n * @example\n * ```ts\n * // Without responseClass - returns ISynovaExecuteResponse\n * const result = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * });\n * if (result.type === 'message') {\n * console.log(result.content);\n * }\n * ```\n */\n execute(promptId: string, options: ISynovaExecuteOptions): Promise<ISynovaExecuteResponse>;\n\n async execute<T>(\n promptId: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n // Check if responseClass is provided\n if ('responseClass' in options && options.responseClass) {\n return this.executeTyped(promptId, options as ISynovaExecuteTypedOptions<T>);\n }\n\n return this.executeRaw(promptId, options as ISynovaExecuteOptions);\n }\n\n /**\n * Execute a prompt by tag with typed response\n */\n executeByTag<T>(\n promptId: string,\n tag: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T>;\n\n /**\n * Execute a prompt by tag\n */\n executeByTag(\n promptId: string,\n tag: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse>;\n\n async executeByTag<T>(\n promptId: string,\n tag: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n return this.execute(promptId, { ...options, tag } as\n | ISynovaExecuteOptions\n | ISynovaExecuteTypedOptions<T>);\n }\n\n /**\n * Execute a prompt by version with typed response\n */\n executeByVersion<T>(\n promptId: string,\n version: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T>;\n\n /**\n * Execute a prompt by version\n */\n executeByVersion(\n promptId: string,\n version: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse>;\n\n async executeByVersion<T>(\n promptId: string,\n version: string,\n options: ISynovaExecuteOptions | ISynovaExecuteTypedOptions<T>,\n ): Promise<T | ISynovaExecuteResponse> {\n return this.execute(promptId, { ...options, version } as\n | ISynovaExecuteOptions\n | ISynovaExecuteTypedOptions<T>);\n }\n\n /**\n * Execute raw request without typed response\n * @throws {ExecutionSynovaError} If LLM returns an error\n */\n private async executeRaw(\n promptId: string,\n options: ISynovaExecuteOptions,\n ): Promise<ISynovaExecuteResponse> {\n const body: Record<string, unknown> = {\n provider: options.provider,\n model: options.model,\n };\n\n if (options.apiKey !== undefined) body.apiKey = options.apiKey;\n if (options.azureEndpoint !== undefined) body.azureEndpoint = options.azureEndpoint;\n if (options.variables !== undefined) body.variables = options.variables;\n if (options.messages !== undefined) body.messages = options.messages;\n if (options.tag !== undefined) body.tag = options.tag;\n if (options.version !== undefined) body.version = options.version;\n if (options.metadata !== undefined) body.metadata = options.metadata;\n if (options.parameters !== undefined) body.parameters = options.parameters;\n if (options.responseSchema !== undefined) body.responseSchema = options.responseSchema;\n if (options.sessionId !== undefined) body.sessionId = options.sessionId;\n\n const response = await this.http.request<ISynovaExecuteResponse>({\n method: 'POST',\n path: `/api/v1/prompts/${promptId}/run`,\n body,\n });\n\n // Always throw on LLM error\n if (response.type === 'error' && response.error) {\n throw new ExecutionSynovaError(response.error);\n }\n\n return response;\n }\n\n /**\n * Execute with typed response class\n */\n private async executeTyped<T>(\n promptId: string,\n options: ISynovaExecuteTypedOptions<T>,\n ): Promise<T> {\n const { responseClass, validate = true, ...executeOptions } = options;\n\n // Generate JSON Schema from class\n const responseSchema = ClassSchema.generate(responseClass);\n\n // Execute with schema (executeRaw throws on LLM error)\n const response = await this.executeRaw(promptId, {\n ...executeOptions,\n responseSchema,\n } as ISynovaExecuteOptions);\n\n // Get the object from response\n const object = response.object as T;\n\n // Validate with class-validator if enabled\n if (validate) {\n await this.validateObject(object, responseClass);\n }\n\n return object;\n }\n\n /**\n * Validate object using class-validator\n */\n private async validateObject<T>(object: T, responseClass: TClassConstructor<T>): Promise<void> {\n try {\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { plainToInstance } = require('class-transformer');\n // eslint-disable-next-line @typescript-eslint/no-require-imports\n const { validate } = require('class-validator');\n\n const instance = plainToInstance(responseClass, object);\n const errors = await validate(instance);\n\n if (errors.length > 0) {\n const violations: IValidationViolation[] = errors.map(\n (error: { property: string; constraints?: Record<string, string>; value?: unknown }) => ({\n property: error.property,\n constraints: error.constraints || {},\n value: error.value,\n }),\n );\n\n throw new ValidationSynovaError(violations);\n }\n } catch (error) {\n if (error instanceof ValidationSynovaError) {\n throw error;\n }\n console.warn(\n '[Synova SDK] Validation skipped: class-validator or class-transformer not installed. ' +\n 'Install them with: npm install class-validator class-transformer',\n );\n }\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type { ISynovaModel, ISynovaModelsResponse, ISynovaListModelsOptions } from '../types';\n\ninterface IProviderModelsResponse {\n models: ISynovaModel[];\n}\n\nexport class ModelsResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * List all available models\n *\n * @param options - Optional filters\n * @returns List of providers with their models\n *\n * @example\n * ```ts\n * // Get all models\n * const { providers } = await client.models.list();\n *\n * // Filter by type\n * const imageModels = await client.models.list({ type: 'image' });\n *\n * // Filter by capability\n * const functionCallingModels = await client.models.list({\n * capability: 'function_calling',\n * });\n *\n * // Filter by provider\n * const openaiModels = await client.models.list({ provider: 'openai' });\n * ```\n */\n async list(options?: ISynovaListModelsOptions): Promise<ISynovaModelsResponse> {\n return this.http.request<ISynovaModelsResponse>({\n method: 'GET',\n path: '/api/v1/models',\n query: {\n type: options?.type,\n capability: options?.capability,\n provider: options?.provider,\n },\n });\n }\n\n /**\n * Get models for a specific provider\n *\n * @param provider - Provider ID (e.g., 'openai', 'anthropic')\n * @returns List of models for the provider\n *\n * @example\n * ```ts\n * const { models } = await client.models.getByProvider('openai');\n * ```\n */\n async getByProvider(provider: string): Promise<ISynovaModel[]> {\n const response = await this.http.request<IProviderModelsResponse>({\n method: 'GET',\n path: `/api/v1/models/${provider}`,\n });\n return response.models;\n }\n\n /**\n * Get a specific model\n *\n * @param provider - Provider ID\n * @param model - Model ID\n * @returns Model details\n *\n * @example\n * ```ts\n * const model = await client.models.get('openai', 'gpt-4o');\n * console.log(model.capabilities);\n * console.log(model.limits);\n * ```\n */\n async get(provider: string, model: string): Promise<ISynovaModel> {\n return this.http.request<ISynovaModel>({\n method: 'GET',\n path: `/api/v1/models/${provider}/${model}`,\n });\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type { ISynovaUploadResponse, ISynovaUploadOptions } from '../types';\n\nexport class FilesResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Upload files for use in prompt execution\n *\n * @param files - Array of File or Blob objects to upload\n * @param options - Upload options including projectId\n * @returns Upload response with file metadata\n *\n * @example\n * ```ts\n * // Upload files\n * const result = await client.files.upload(\n * [file1, file2],\n * { projectId: 'prj_abc123' }\n * );\n *\n * console.log('Uploaded files:', result.data);\n *\n * // Use uploaded file in prompt execution\n * const response = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * messages: [\n * {\n * role: 'user',\n * content: 'Describe this image',\n * files: [{ fileId: result.data[0].id }],\n * },\n * ],\n * });\n * ```\n */\n async upload(\n files: (File | Blob)[],\n options: ISynovaUploadOptions,\n ): Promise<ISynovaUploadResponse> {\n const formData = new FormData();\n\n for (const file of files) {\n formData.append('files', file);\n }\n\n formData.append('projectId', options.projectId);\n\n return this.http.upload<ISynovaUploadResponse>({\n path: '/api/v1/files/upload',\n formData,\n });\n }\n}\n","import type { HttpClient } from '../utils/http';\nimport type {\n ISynovaSpan,\n ISynovaCreateSpanOptions,\n ISynovaEndSpanOptions,\n TSynovaSpanType,\n} from '../types';\n\n/**\n * Options for wrapping a function with span tracking\n */\nexport interface ISynovaWrapOptions {\n /** Trace ID */\n traceId: string;\n /** Span type */\n type: TSynovaSpanType;\n /** Span name */\n name?: string;\n /** Parent span ID */\n parentSpanId?: string;\n /** Custom metadata */\n metadata?: Record<string, string>;\n}\n\n/**\n * Options for wrapping a tool function\n */\nexport interface ISynovaWrapToolOptions {\n /** Trace ID */\n traceId: string;\n /** Tool name */\n toolName: string;\n /** Parent span ID */\n parentSpanId?: string;\n /** Custom metadata */\n metadata?: Record<string, string>;\n}\n\n/**\n * Spans resource for observability\n *\n * @example\n * ```ts\n * // Manual: create and end span\n * const span = await client.spans.create('trc_123', {\n * type: 'tool',\n * toolName: 'fetch_weather',\n * toolArguments: { city: 'NYC' },\n * });\n * const result = await fetchWeather('NYC');\n * await client.spans.end(span.id, { status: 'completed', toolResult: result });\n *\n * // Wrapper: automatic span lifecycle\n * const weather = await client.spans.wrapTool(\n * { traceId: 'trc_123', toolName: 'fetch_weather' },\n * { city: 'NYC' },\n * (args) => fetchWeather(args.city),\n * );\n *\n * // Generic wrapper for custom spans\n * const result = await client.spans.wrap(\n * { traceId: 'trc_123', type: 'custom', name: 'validate' },\n * { input: data },\n * async () => validateData(data),\n * );\n * ```\n */\nexport class SpansResource {\n constructor(private readonly http: HttpClient) {}\n\n /**\n * Create a new span within a trace\n *\n * @param traceId - The trace ID to create span in\n * @param options - Span creation options\n * @returns Created span\n */\n async create(traceId: string, options: ISynovaCreateSpanOptions): Promise<ISynovaSpan> {\n const body: Record<string, unknown> = {\n type: options.type,\n };\n\n if (options.parentSpanId !== undefined) body.parentSpanId = options.parentSpanId;\n if (options.name !== undefined) body.name = options.name;\n if (options.input !== undefined) body.input = options.input;\n if (options.toolName !== undefined) body.toolName = options.toolName;\n if (options.toolArguments !== undefined) body.toolArguments = options.toolArguments;\n if (options.metadata !== undefined) body.metadata = options.metadata;\n\n return this.http.request<ISynovaSpan>({\n method: 'POST',\n path: `/api/v1/traces/${traceId}/spans`,\n body,\n });\n }\n\n /**\n * End/complete a span\n *\n * @param spanId - The span ID to end\n * @param options - Span end options\n * @returns Updated span\n */\n async end(spanId: string, options?: ISynovaEndSpanOptions): Promise<ISynovaSpan> {\n const body: Record<string, unknown> = {};\n\n if (options?.status !== undefined) body.status = options.status;\n if (options?.level !== undefined) body.level = options.level;\n if (options?.statusMessage !== undefined) body.statusMessage = options.statusMessage;\n if (options?.output !== undefined) body.output = options.output;\n if (options?.toolResult !== undefined) body.toolResult = options.toolResult;\n if (options?.durationMs !== undefined) body.durationMs = options.durationMs;\n\n return this.http.request<ISynovaSpan>({\n method: 'PATCH',\n path: `/api/v1/spans/${spanId}`,\n body,\n });\n }\n\n /**\n * Wrap an async function with automatic span tracking\n *\n * @param options - Span options (traceId, type, name, etc.)\n * @param input - Input data to record in span\n * @param fn - Async function to execute\n * @returns Result of the function\n *\n * @example\n * ```ts\n * const result = await client.spans.wrap(\n * { traceId: 'trc_123', type: 'retriever', name: 'vector_search' },\n * { query: 'how to...', topK: 5 },\n * async () => vectorDb.search(query),\n * );\n * ```\n */\n async wrap<T>(options: ISynovaWrapOptions, input: unknown, fn: () => Promise<T>): Promise<T> {\n const span = await this.create(options.traceId, {\n type: options.type,\n name: options.name,\n parentSpanId: options.parentSpanId,\n input,\n metadata: options.metadata,\n });\n\n try {\n const result = await fn();\n await this.end(span.id, {\n status: 'completed',\n output: result,\n });\n return result;\n } catch (error) {\n await this.end(span.id, {\n status: 'error',\n statusMessage: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n }\n\n /**\n * Wrap a tool function with automatic span tracking\n *\n * @param options - Tool span options (traceId, toolName, etc.)\n * @param args - Tool arguments to record\n * @param fn - Tool function to execute\n * @returns Result of the tool\n *\n * @example\n * ```ts\n * const weather = await client.spans.wrapTool(\n * { traceId: 'trc_123', toolName: 'fetch_weather', parentSpanId: 'spn_abc' },\n * { city: 'NYC' },\n * async (args) => fetchWeather(args.city),\n * );\n * ```\n */\n async wrapTool<TArgs extends Record<string, unknown>, TResult>(\n options: ISynovaWrapToolOptions,\n args: TArgs,\n fn: (args: TArgs) => Promise<TResult>,\n ): Promise<TResult> {\n const span = await this.create(options.traceId, {\n type: 'tool',\n toolName: options.toolName,\n toolArguments: args,\n parentSpanId: options.parentSpanId,\n metadata: options.metadata,\n });\n\n try {\n const result = await fn(args);\n await this.end(span.id, {\n status: 'completed',\n toolResult: result,\n });\n return result;\n } catch (error) {\n await this.end(span.id, {\n status: 'error',\n statusMessage: error instanceof Error ? error.message : String(error),\n });\n throw error;\n }\n }\n}\n","import type { ISynovaConfig, ISynovaLogger } from './types';\nimport type { IRetryOptions } from './utils/http';\nimport { HttpClient } from './utils/http';\nimport { PromptsResource } from './resources/prompts';\nimport { ModelsResource } from './resources/models';\nimport { FilesResource } from './resources/files';\nimport { SpansResource } from './resources/spans';\n\nconst DEFAULT_BASE_URL = 'https://api.synova.cloud';\nconst DEFAULT_TIMEOUT = 30000;\n\nconst DEFAULT_RETRY: IRetryOptions = {\n maxRetries: 3,\n strategy: 'exponential',\n initialDelayMs: 1000,\n maxDelayMs: 30000,\n backoffMultiplier: 2,\n};\n\nconst DEFAULT_LOGGER: ISynovaLogger = {\n debug: (message, ...args) => console.debug(message, ...args),\n info: (message, ...args) => console.info(message, ...args),\n warn: (message, ...args) => console.warn(message, ...args),\n error: (messageOrError, ...args) => console.error(messageOrError, ...args),\n};\n\n/**\n * Synova Cloud SDK client\n *\n * @example\n * ```ts\n * import { SynovaCloudSdk } from '@synova-cloud/sdk';\n *\n * const client = new SynovaCloudSdk('your-api-key');\n *\n * // Get a prompt\n * const prompt = await client.prompts.get('prm_abc123');\n *\n * // Execute a prompt with direct API key\n * const result = await client.prompts.execute('prm_abc123', {\n * provider: 'openai',\n * model: 'gpt-4o',\n * apiKey: 'sk-...',\n * variables: { topic: 'TypeScript' },\n * });\n *\n * // Execute with Azure OpenAI\n * const azureResult = await client.prompts.execute('prm_abc123', {\n * provider: 'azure_openai',\n * model: 'gpt-4o',\n * apiKey: 'your-azure-key',\n * azureEndpoint: 'https://my-resource.openai.azure.com',\n * variables: { topic: 'TypeScript' },\n * });\n *\n * // List available models\n * const { providers } = await client.models.list();\n *\n * // Get models for a specific provider\n * const openaiModels = await client.models.getByProvider('openai');\n *\n * // With custom retry config\n * const clientWithRetry = new SynovaCloudSdk('your-api-key', {\n * retry: {\n * maxRetries: 5,\n * strategy: 'linear',\n * initialDelayMs: 500,\n * },\n * });\n * ```\n */\nexport class SynovaCloudSdk {\n readonly prompts: PromptsResource;\n readonly models: ModelsResource;\n readonly files: FilesResource;\n readonly spans: SpansResource;\n\n private readonly http: HttpClient;\n\n /**\n * Create a new Synova Cloud SDK client\n *\n * @param apiKey - Your Synova API key\n * @param config - Optional configuration\n */\n constructor(apiKey: string, config?: ISynovaConfig) {\n if (!apiKey) {\n throw new Error('API key is required');\n }\n\n this.http = new HttpClient({\n baseUrl: config?.baseUrl ?? DEFAULT_BASE_URL,\n apiKey,\n timeout: config?.timeout ?? DEFAULT_TIMEOUT,\n retry: {\n maxRetries: config?.retry?.maxRetries ?? DEFAULT_RETRY.maxRetries,\n strategy: config?.retry?.strategy ?? DEFAULT_RETRY.strategy,\n initialDelayMs: config?.retry?.initialDelayMs ?? DEFAULT_RETRY.initialDelayMs,\n maxDelayMs: config?.retry?.maxDelayMs ?? DEFAULT_RETRY.maxDelayMs,\n backoffMultiplier: config?.retry?.backoffMultiplier ?? DEFAULT_RETRY.backoffMultiplier,\n },\n debug: config?.debug ?? false,\n logger: config?.logger ?? DEFAULT_LOGGER,\n });\n\n this.prompts = new PromptsResource(this.http);\n this.models = new ModelsResource(this.http);\n this.files = new FilesResource(this.http);\n this.spans = new SpansResource(this.http);\n }\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@synova-cloud/sdk",
3
- "version": "1.7.0",
3
+ "version": "1.8.0",
4
4
  "description": "Official Node.js SDK for Synova Cloud API",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",