@flow-conductor/core 1.0.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/README.md +213 -0
- package/build/index.d.ts +674 -0
- package/build/index.js +667 -0
- package/build/index.js.map +1 -0
- package/package.json +84 -0
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/utils/url-validator.ts","../src/request-adapter.ts","../src/request-manager.ts","../src/utils/retry-utils.ts","../src/utils/chunk-processor.ts","../src/request-chain.ts"],"names":["previousEntity","previousResult"],"mappings":";AA6BO,IAAM,SAAA,GAAN,cAAwB,KAAA,CAAM;AAAA,EACnC,YAAY,OAAA,EAAiB;AAC3B,IAAA,KAAA,CAAM,OAAO,CAAA;AACb,IAAA,IAAA,CAAK,IAAA,GAAO,WAAA;AAAA,EACd;AACF;AAKA,IAAM,iBAAA,GAAoB;AAAA;AAAA,EAExB,OAAA;AAAA,EACA,+BAAA;AAAA,EACA,aAAA;AAAA;AAAA,EAEA,SAAA;AAAA,EACA,SAAA;AAAA,EACA,OAAA;AAAA,EACA;AACF,CAAA;AAQO,SAAS,WAAA,CACd,GAAA,EACA,OAAA,GAAgC,EAAC,EAC3B;AACN,EAAA,MAAM;AAAA,IACJ,eAAA,GAAkB,KAAA;AAAA,IAClB,cAAA,GAAiB,KAAA;AAAA,IACjB,gBAAA,GAAmB,CAAC,OAAA,EAAS,QAAQ,CAAA;AAAA,IACrC,iBAAA,GAAoB;AAAA,GACtB,GAAI,OAAA;AAEJ,EAAA,IAAI,iBAAA,EAAmB;AACrB,IAAA;AAAA,EACF;AAEA,EAAA,IAAI,CAAC,GAAA,IAAO,OAAO,GAAA,KAAQ,QAAA,EAAU;AACnC,IAAA,MAAM,IAAI,UAAU,gCAAgC,CAAA;AAAA,EACtD;AAEA,EAAA,IAAI,SAAA;AACJ,EAAA,IAAI;AACF,IAAA,SAAA,GAAY,IAAI,IAAI,GAAG,CAAA;AAAA,EACzB,CAAA,CAAA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AA,EAAG,KAAK,CAAA;AAAA,EAC1B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQQ,MAAM,EAAA,EAA2B;AACvC,IAAA,OAAO,IAAI,OAAA,CAAQ,CAAC,YAAY,UAAA,CAAW,OAAA,EAAS,EAAE,CAAC,CAAA;AAAA,EACzD;AAAA;AAGF,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAzbqB,aAAA,CAmBL,KAAA,GAAQ,CAKpB,KAAA,EAGA,OAAA,KAC2E;AAC3E,EAAA,MAAM,YAAA,GAAe,IAAI,aAAA,EAKvB;AACF,EAAA,YAAA,CAAa,kBAAkB,OAAO,CAAA;AACtC,EAAA,OAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAChC,CAAA;AArCF,IAAqB,YAAA,GAArB;AAscO,SAAS,KAAA,CAKd,OAGA,OAAA,EACwE;AACxE,EAAA,MAAM,YAAA,GAAe,IAAI,YAAA,EAKvB;AACF,EAAA,YAAA,CAAa,kBAAkB,OAAO,CAAA;AACtC,EAAA,OAAO,YAAA,CAAa,KAAK,KAAK,CAAA;AAChC;AAWA,SAAS,uBAMP,KAAA,EAkBA;AACA,EAAA,OAAO,QAAA,IAAY,KAAA,IAAS,EAAE,SAAA,IAAa,KAAA,CAAA;AAC7C;AAYA,SAAS,uBAMP,KAAA,EAkBA;AACA,EAAA,OAAO,SAAA,IAAa,KAAA,IAAS,EAAE,QAAA,IAAY,KAAA,CAAA;AAC7C","file":"index.js","sourcesContent":["/**\n * URL validation utilities to prevent SSRF (Server-Side Request Forgery) attacks\n */\n\nexport interface UrlValidationOptions {\n /**\n * Allow private/internal IP addresses (default: false)\n * WARNING: Enabling this can expose your application to SSRF attacks\n */\n allowPrivateIPs?: boolean;\n\n /**\n * Allow localhost addresses (default: false)\n * WARNING: Enabling this can expose your application to SSRF attacks\n */\n allowLocalhost?: boolean;\n\n /**\n * Custom list of allowed protocols (default: ['http:', 'https:'])\n */\n allowedProtocols?: string[];\n\n /**\n * Disable URL validation entirely (default: false)\n * WARNING: This completely disables SSRF protection\n */\n disableValidation?: boolean;\n}\n\nexport class SSRFError extends Error {\n constructor(message: string) {\n super(message);\n this.name = \"SSRFError\";\n }\n}\n\n/**\n * Private IP ranges that should be blocked to prevent SSRF attacks\n */\nconst PRIVATE_IP_RANGES = [\n // IPv4 private ranges\n /^10\\./,\n /^172\\.(1[6-9]|2[0-9]|3[01])\\./,\n /^192\\.168\\./,\n // IPv6 private ranges\n /^fc00:/i,\n /^fe80:/i,\n /^::1$/,\n /^fd/,\n];\n\n/**\n * Validates a URL to prevent SSRF attacks\n * @param url - The URL to validate\n * @param options - Validation options\n * @throws {SSRFError} If the URL is invalid or potentially dangerous\n */\nexport function validateUrl(\n url: string,\n options: UrlValidationOptions = {}\n): void {\n const {\n allowPrivateIPs = false,\n allowLocalhost = false,\n allowedProtocols = [\"http:\", \"https:\"],\n disableValidation = false,\n } = options;\n\n if (disableValidation) {\n return;\n }\n\n if (!url || typeof url !== \"string\") {\n throw new SSRFError(\"URL must be a non-empty string\");\n }\n\n let parsedUrl: URL;\n try {\n parsedUrl = new URL(url);\n } catch {\n throw new SSRFError(`Invalid URL format: ${url}`);\n }\n\n // Validate protocol\n const protocol = parsedUrl.protocol.toLowerCase();\n if (!allowedProtocols.includes(protocol)) {\n throw new SSRFError(\n `Protocol \"${protocol}\" is not allowed. Only ${allowedProtocols.join(\", \")} are permitted.`\n );\n }\n\n // Check for localhost\n const hostname = parsedUrl.hostname.toLowerCase();\n // Normalize IPv6 addresses (remove brackets if present)\n const normalizedHostname = hostname.replace(/^\\[|\\]$/g, \"\");\n const isLocalhost =\n normalizedHostname === \"localhost\" ||\n normalizedHostname === \"127.0.0.1\" ||\n normalizedHostname === \"::1\" ||\n normalizedHostname.startsWith(\"127.\") ||\n normalizedHostname === \"0.0.0.0\";\n\n if (isLocalhost && !allowLocalhost) {\n throw new SSRFError(\n \"Localhost addresses are not allowed for security reasons. Set allowLocalhost=true to override.\"\n );\n }\n\n // Check for private IP ranges\n if (!allowPrivateIPs) {\n // Check IPv4 addresses first with specific error messages\n if (/^\\d+\\.\\d+\\.\\d+\\.\\d+$/.test(normalizedHostname)) {\n const parts = normalizedHostname.split(\".\").map(Number);\n const [a, b] = parts;\n\n // 10.0.0.0/8\n if (a === 10) {\n throw new SSRFError(\n \"Private IP addresses (10.x.x.x) are not allowed for security reasons.\"\n );\n }\n\n // 172.16.0.0/12\n if (a === 172 && b >= 16 && b <= 31) {\n throw new SSRFError(\n \"Private IP addresses (172.16-31.x.x) are not allowed for security reasons.\"\n );\n }\n\n // 192.168.0.0/16\n if (a === 192 && b === 168) {\n throw new SSRFError(\n \"Private IP addresses (192.168.x.x) are not allowed for security reasons.\"\n );\n }\n\n // 169.254.0.0/16 (link-local)\n if (a === 169 && b === 254) {\n throw new SSRFError(\n \"Link-local addresses (169.254.x.x) are not allowed for security reasons.\"\n );\n }\n }\n\n // Check IPv6 and other private IP ranges using regex\n const isPrivateIP = PRIVATE_IP_RANGES.some((range) =>\n range.test(normalizedHostname)\n );\n\n if (isPrivateIP) {\n throw new SSRFError(\n \"Private/internal IP addresses are not allowed for security reasons. Set allowPrivateIPs=true to override.\"\n );\n }\n }\n}\n","import type { IRequestConfig } from \"./models/request-params\";\nimport { validateUrl, type UrlValidationOptions } from \"./utils/url-validator\";\n\n/**\n * Abstract base class for request adapters that handle HTTP requests.\n * Provides URL validation and a common interface for different HTTP client implementations.\n *\n * @template ExecutionResult - The type of result returned by the adapter's HTTP client\n * @template RequestConfig - The type of request configuration, must extend IRequestConfig\n *\n * @example\n * ```typescript\n * class MyAdapter extends RequestAdapter<Response> {\n * async createRequest(config: IRequestConfig): Promise<Response> {\n * // Implementation\n * }\n * }\n * ```\n */\nexport default abstract class RequestAdapter<\n ExecutionResult,\n RequestConfig extends IRequestConfig = IRequestConfig,\n> {\n /**\n * URL validation options used to prevent SSRF attacks\n */\n protected urlValidationOptions: UrlValidationOptions;\n\n /**\n * Creates a new RequestAdapter instance.\n *\n * @param urlValidationOptions - Options for URL validation to prevent SSRF attacks\n */\n constructor(urlValidationOptions: UrlValidationOptions = {}) {\n this.urlValidationOptions = urlValidationOptions;\n }\n\n /**\n * Creates and executes an HTTP request using the adapter's underlying HTTP client.\n * This method must be implemented by concrete adapter classes.\n *\n * @param requestConfig - The request configuration object\n * @returns A promise that resolves to the execution result\n */\n public abstract createRequest(\n requestConfig: RequestConfig\n ): Promise<ExecutionResult>;\n\n /**\n * Type-safe getter for the execution result.\n * Allows casting the result to a specific type.\n *\n * @template T - The desired result type\n * @param result - The execution result to cast\n * @returns The result cast to type T\n */\n public getResult<T extends ExecutionResult>(result: ExecutionResult): T {\n return result as T;\n }\n\n /**\n * Executes a request with URL validation.\n * Validates the URL to prevent SSRF attacks before creating the request.\n *\n * @param requestConfig - The request configuration object\n * @returns A promise that resolves to the execution result\n * @throws {SSRFError} If the URL is invalid or potentially dangerous\n */\n public executeRequest(\n requestConfig: RequestConfig\n ): Promise<ExecutionResult> {\n // Validate URL to prevent SSRF attacks\n validateUrl(requestConfig.url, this.urlValidationOptions);\n return this.createRequest(requestConfig);\n }\n}\n","import type RequestAdapter from \"./request-adapter\";\nimport type {\n PipelineManagerStage,\n PipelineRequestStage,\n} from \"./models/request-params\";\nimport type { ErrorHandler, ResultHandler } from \"./models/handlers\";\nimport type { IRequestConfig } from \"./models/request-params\";\n\n/**\n * Abstract base class for managing request pipelines and flows.\n * Provides functionality for chaining requests, error handling, and result processing.\n *\n * @template Out - The output type of the request flow\n * @template AdapterExecutionResult - The type of result returned by the adapter\n * @template RequestConfig - The type of request configuration, must extend IRequestConfig\n */\nexport default abstract class RequestFlow<\n Out,\n AdapterExecutionResult = Out,\n RequestConfig extends IRequestConfig = IRequestConfig,\n> {\n /**\n * List of pipeline stages to execute\n */\n protected requestList: (\n | PipelineRequestStage<any, any, any>\n | PipelineManagerStage<any, any, any>\n )[] = [];\n /**\n * Optional error handler callback\n */\n protected errorHandler?: ErrorHandler;\n /**\n * Optional result handler callback\n */\n protected resultHandler?: ResultHandler<Out | Out[]>;\n /**\n * Optional finish handler callback executed after completion\n */\n protected finishHandler?: () => void;\n /**\n * The request adapter used to execute HTTP requests\n */\n protected adapter: RequestAdapter<AdapterExecutionResult, RequestConfig>;\n\n /**\n * Executes the request flow and returns the final result.\n * Must be implemented by concrete subclasses.\n *\n * @returns A promise that resolves to the output result\n */\n public abstract execute(): Promise<Out>;\n\n /**\n * Sets the request adapter to use for executing HTTP requests.\n *\n * @param adapter - The request adapter instance\n * @returns The current RequestFlow instance for method chaining\n */\n public setRequestAdapter(\n adapter: RequestAdapter<AdapterExecutionResult, RequestConfig>\n ): RequestFlow<Out, AdapterExecutionResult, RequestConfig> {\n this.adapter = adapter;\n return this;\n }\n\n /**\n * Adds multiple pipeline stages to the request list.\n *\n * @param requestList - Array of pipeline stages to add\n * @returns The current RequestFlow instance for method chaining\n */\n public addAll(\n requestList: Array<\n | PipelineRequestStage<AdapterExecutionResult, Out, RequestConfig>\n | PipelineManagerStage<Out, AdapterExecutionResult, RequestConfig>\n > = []\n ): RequestFlow<Out, AdapterExecutionResult, RequestConfig> {\n this.requestList = this.requestList.concat(requestList);\n return this;\n }\n\n /**\n * Sets an error handler callback that will be called when an error occurs during execution.\n *\n * @param errorHandler - Function to handle errors\n * @returns The current RequestFlow instance for method chaining\n */\n public withErrorHandler(\n errorHandler: ErrorHandler\n ): RequestFlow<Out, AdapterExecutionResult, RequestConfig> {\n this.errorHandler = errorHandler;\n return this;\n }\n\n /**\n * Sets a result handler callback that will be called with the execution result.\n *\n * @param resultHandler - Function to handle results\n * @returns The current RequestFlow instance for method chaining\n */\n public withResultHandler(\n resultHandler: ResultHandler<Out | Out[]>\n ): RequestFlow<Out, AdapterExecutionResult, RequestConfig> {\n this.resultHandler = resultHandler;\n return this;\n }\n\n /**\n * Sets a finish handler callback that will be called after execution completes (success or failure).\n *\n * @param finishHandler - Function to execute on completion\n * @returns The current RequestFlow instance for method chaining\n */\n public withFinishHandler(\n finishHandler: () => void\n ): RequestFlow<Out, AdapterExecutionResult, RequestConfig> {\n this.finishHandler = finishHandler;\n return this;\n }\n}\n","/**\n * Utility functions for retry logic and error handling.\n */\n\n/**\n * Attempts to extract HTTP status code from an error object.\n * Works with different adapter error formats (Axios, Fetch, etc.).\n *\n * @param error - The error object\n * @returns The HTTP status code if available, undefined otherwise\n */\nexport function getErrorStatus(error: Error): number | undefined {\n // Axios errors have response.status\n if (\n typeof (error as any).response !== \"undefined\" &&\n typeof (error as any).response.status === \"number\"\n ) {\n return (error as any).response.status;\n }\n\n // Some adapters might put status directly on error\n if (typeof (error as any).status === \"number\") {\n return (error as any).status;\n }\n\n // Check for statusCode (some libraries use this)\n if (typeof (error as any).statusCode === \"number\") {\n return (error as any).statusCode;\n }\n\n return undefined;\n}\n\n/**\n * Checks if an error is a network error (connection failure, timeout, etc.).\n *\n * @param error - The error object\n * @returns True if the error appears to be a network error\n */\nexport function isNetworkError(error: Error): boolean {\n // Common network error names\n const networkErrorNames = [\n \"TypeError\",\n \"NetworkError\",\n \"TimeoutError\",\n \"AbortError\",\n \"ECONNREFUSED\",\n \"ENOTFOUND\",\n \"ETIMEDOUT\",\n ];\n\n if (networkErrorNames.includes(error.name)) {\n return true;\n }\n\n // Check error message for network-related keywords\n const networkKeywords = [\n \"network\",\n \"connection\",\n \"timeout\",\n \"fetch\",\n \"failed to fetch\",\n \"ECONNREFUSED\",\n \"ENOTFOUND\",\n \"ETIMEDOUT\",\n ];\n\n const errorMessage = error.message?.toLowerCase() || \"\";\n return networkKeywords.some((keyword) => errorMessage.includes(keyword));\n}\n\n/**\n * Default retry condition that retries on network errors.\n * This is used when no retryCondition is provided in RetryConfig.\n *\n * @param error - The error that occurred\n * @returns True if the error is a network error\n */\nexport function defaultRetryCondition(error: Error): boolean {\n return isNetworkError(error);\n}\n\n/**\n * Helper function to create a retry condition that retries on specific HTTP status codes.\n *\n * @param statusCodes - Array of HTTP status codes to retry on\n * @returns A retry condition function\n *\n * @example\n * ```typescript\n * retry: {\n * retryCondition: retryOnStatusCodes(500, 502, 503, 504, 429)\n * }\n * ```\n */\nexport function retryOnStatusCodes(\n ...statusCodes: number[]\n): (error: Error) => boolean {\n return (error: Error) => {\n const status = getErrorStatus(error);\n return status !== undefined && statusCodes.includes(status);\n };\n}\n\n/**\n * Helper function to create a retry condition that retries on network errors OR specific status codes.\n *\n * @param statusCodes - Array of HTTP status codes to retry on\n * @returns A retry condition function\n *\n * @example\n * ```typescript\n * retry: {\n * retryCondition: retryOnNetworkOrStatusCodes(500, 502, 503, 504, 429)\n * }\n * ```\n */\nexport function retryOnNetworkOrStatusCodes(\n ...statusCodes: number[]\n): (error: Error, attempt: number) => boolean {\n return (error: Error) => {\n // Always retry network errors\n if (isNetworkError(error)) {\n return true;\n }\n // Retry on specified status codes\n const status = getErrorStatus(error);\n return status !== undefined && statusCodes.includes(status);\n };\n}\n","import type { ChunkHandler } from \"../models/handlers\";\nimport type { ChunkProcessingConfig } from \"../models/request-params\";\n\n/**\n * Processes a ReadableStream progressively, calling the chunk handler for each chunk.\n * Supports both text and binary streams.\n *\n * @template Chunk - The type of chunk data\n * @param stream - The ReadableStream to process\n * @param config - The chunk processing configuration\n * @returns A promise that resolves when processing is complete, optionally with accumulated data\n */\nexport async function processStream<Chunk = string | Uint8Array>(\n stream: ReadableStream<Uint8Array>,\n config: ChunkProcessingConfig<Chunk>\n): Promise<Chunk | undefined> {\n const { chunkHandler, encoding = \"utf-8\", accumulate = false } = config;\n\n const reader = stream.getReader();\n const decoder = new TextDecoder(encoding);\n let accumulatedData: string | Uint8Array | undefined;\n let chunkIndex = 0;\n let totalBytesRead = 0;\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n\n if (done) {\n // Process any remaining accumulated data\n if (accumulatedData !== undefined && accumulatedData.length > 0) {\n await processChunk(\n accumulatedData as Chunk,\n chunkHandler,\n chunkIndex,\n true,\n totalBytesRead\n );\n }\n break;\n }\n\n totalBytesRead += value.length;\n\n if (accumulate) {\n // Accumulate chunks\n if (accumulatedData === undefined) {\n accumulatedData = value;\n } else if (typeof accumulatedData === \"string\") {\n accumulatedData += decoder.decode(value, { stream: true });\n } else {\n // Concatenate Uint8Arrays\n const combined = new Uint8Array(\n accumulatedData.length + value.length\n );\n combined.set(accumulatedData);\n combined.set(value, accumulatedData.length);\n accumulatedData = combined;\n }\n }\n\n // Process chunk\n const isLast = false; // We don't know if it's the last until done\n await processChunk(\n value as Chunk,\n chunkHandler,\n chunkIndex,\n isLast,\n totalBytesRead\n );\n\n chunkIndex++;\n }\n\n return accumulatedData as Chunk | undefined;\n } finally {\n reader.releaseLock();\n }\n}\n\n/**\n * Processes a text stream line by line (useful for NDJSON, CSV, or line-delimited data).\n *\n * @param stream - The ReadableStream to process\n * @param config - The chunk processing configuration\n * @returns A promise that resolves when processing is complete\n */\nexport async function processTextStreamLineByLine(\n stream: ReadableStream<Uint8Array>,\n config: ChunkProcessingConfig<string>\n): Promise<string | undefined> {\n const { chunkHandler, encoding = \"utf-8\", accumulate = false } = config;\n\n const reader = stream.getReader();\n const decoder = new TextDecoder(encoding);\n let buffer = \"\";\n let lineIndex = 0;\n let totalBytesRead = 0;\n\n try {\n while (true) {\n const { done, value } = await reader.read();\n\n if (done) {\n // Process any remaining buffer content\n if (buffer.length > 0) {\n await processChunk(\n buffer,\n chunkHandler,\n lineIndex,\n true,\n totalBytesRead\n );\n }\n break;\n }\n\n totalBytesRead += value.length;\n buffer += decoder.decode(value, { stream: true });\n\n // Process complete lines\n const lines = buffer.split(\"\\n\");\n buffer = lines.pop() || \"\"; // Keep incomplete line in buffer\n\n for (const line of lines) {\n if (line.length > 0) {\n // Only process non-empty lines\n await processChunk(\n line,\n chunkHandler,\n lineIndex,\n false,\n totalBytesRead\n );\n lineIndex++;\n }\n }\n }\n\n return accumulate ? buffer : undefined;\n } finally {\n reader.releaseLock();\n }\n}\n\n/**\n * Processes a Response body as a stream with chunk processing.\n * Automatically detects if the response has a readable stream and processes it.\n *\n * @template Chunk - The type of chunk data\n * @param response - The Response object\n * @param config - The chunk processing configuration\n * @returns A promise that resolves with the processed result or the original response\n */\nexport async function processResponseStream<Chunk = string | Uint8Array>(\n response: Response,\n config: ChunkProcessingConfig<Chunk>\n): Promise<Response | Chunk> {\n if (!response.body) {\n throw new Error(\"Response body is not available for streaming\");\n }\n\n const processed = await processStream(response.body, config);\n\n // If accumulation is enabled, return the accumulated data\n // Otherwise, return the original response (chunks were processed via handler)\n if (config.accumulate && processed !== undefined) {\n return processed;\n }\n\n // Return a new Response with the processed data if needed\n // For now, return original response since chunks were handled via handler\n return response;\n}\n\n/**\n * Helper function to process a single chunk with the handler.\n *\n * @template Chunk - The type of chunk data\n * @param chunk - The chunk to process\n * @param handler - The chunk handler function\n * @param index - The chunk index\n * @param isLast - Whether this is the last chunk\n * @param totalBytesRead - Total bytes read so far\n */\nasync function processChunk<Chunk>(\n chunk: Chunk,\n handler: ChunkHandler<Chunk>,\n index: number,\n isLast: boolean,\n totalBytesRead: number\n): Promise<void> {\n const result = handler(chunk, {\n index,\n isLast,\n totalBytesRead,\n });\n\n if (result instanceof Promise) {\n await result;\n }\n}\n\n/**\n * Checks if a value is a ReadableStream.\n *\n * @param value - The value to check\n * @returns True if the value is a ReadableStream\n */\nexport function isReadableStream(\n value: unknown\n): value is ReadableStream<Uint8Array> {\n return (\n value !== null &&\n typeof value === \"object\" &&\n \"getReader\" in value &&\n typeof (value as ReadableStream).getReader === \"function\"\n );\n}\n\n/**\n * Checks if a Response has a readable body stream.\n *\n * @param response - The Response to check\n * @returns True if the response has a readable body stream\n */\nexport function hasReadableStream(response: Response): boolean {\n return response.body !== null && isReadableStream(response.body);\n}\n","import type RequestAdapter from \"./request-adapter\";\nimport RequestFlow from \"./request-manager\";\nimport type {\n IRequestConfig,\n PipelineRequestStage,\n PipelineManagerStage,\n RetryConfig,\n} from \"./models/request-params\";\nimport { defaultRetryCondition } from \"./utils/retry-utils\";\nimport {\n processResponseStream,\n hasReadableStream,\n} from \"./utils/chunk-processor\";\n\n/**\n * A chainable request pipeline that allows sequential execution of HTTP requests.\n * Each stage can depend on the result of the previous stage, and stages can be conditionally executed.\n *\n * @template Out - The output type of the current chain\n * @template AdapterExecutionResult - The type of result returned by the adapter\n * @template AdapterRequestConfig - The type of request configuration\n * @template Types - Tuple type tracking all output types in the chain\n *\n * @example\n * ```typescript\n * const chain = RequestChain.begin(\n * { config: { url: 'https://api.example.com/users', method: 'GET' } },\n * adapter\n * ).next({ config: { url: 'https://api.example.com/posts', method: 'GET' } });\n *\n * const result = await chain.execute();\n * ```\n */\nexport default class RequestChain<\n Out,\n AdapterExecutionResult = Out,\n AdapterRequestConfig extends IRequestConfig = IRequestConfig,\n Types extends readonly unknown[] = [Out],\n> extends RequestFlow<Out, AdapterExecutionResult, AdapterRequestConfig> {\n // #region Public methods\n\n /**\n * Creates a new RequestChain with an initial stage.\n * This is the entry point for building a request chain.\n *\n * @template Out - The output type of the initial stage\n * @template AdapterExecutionResult - The type of result returned by the adapter\n * @template AdapterRequestConfig - The type of request configuration\n * @param stage - The initial pipeline stage (request or manager stage)\n * @param adapter - The request adapter to use for HTTP requests\n * @returns A new RequestChain instance with the initial stage\n */\n public static begin = <\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig extends IRequestConfig = IRequestConfig,\n >(\n stage:\n | PipelineRequestStage<AdapterExecutionResult, Out, AdapterRequestConfig>\n | PipelineManagerStage<Out, AdapterExecutionResult, AdapterRequestConfig>,\n adapter: RequestAdapter<AdapterExecutionResult, AdapterRequestConfig>\n ): RequestChain<Out, AdapterExecutionResult, AdapterRequestConfig, [Out]> => {\n const requestChain = new RequestChain<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig,\n []\n >();\n requestChain.setRequestAdapter(adapter);\n return requestChain.next(stage);\n };\n\n /**\n * Adds a new stage to the request chain and returns a new chain with updated types.\n * This method enables type-safe chaining of requests.\n *\n * @template NewOut - The output type of the new stage\n * @param stage - The pipeline stage to add (request or manager stage)\n * @returns A new RequestChain instance with the added stage\n */\n public next = <NewOut>(\n stage:\n | PipelineRequestStage<\n AdapterExecutionResult,\n NewOut,\n AdapterRequestConfig,\n Out\n >\n | PipelineManagerStage<\n NewOut,\n AdapterExecutionResult,\n AdapterRequestConfig,\n Out\n >\n ): RequestChain<\n NewOut,\n AdapterExecutionResult,\n AdapterRequestConfig,\n [...Types, NewOut]\n > => {\n return this.addRequestEntity(stage);\n };\n\n /**\n * Executes all stages in the chain sequentially and returns the final result.\n * Handles errors and calls registered handlers appropriately.\n *\n * @returns A promise that resolves to the final output result\n * @throws {Error} If an error occurs and no error handler is registered\n */\n public execute = async (): Promise<Out> => {\n try {\n const results: Out[] = await this.executeAllRequests(this.requestList);\n const result: Out = results[results.length - 1];\n if (this.resultHandler && result) {\n this.resultHandler(result);\n }\n return result;\n } catch (error) {\n if (this.errorHandler) {\n this.errorHandler(error);\n return Promise.reject(error);\n } else {\n throw error;\n }\n } finally {\n if (this.finishHandler) {\n this.finishHandler();\n }\n }\n };\n\n /**\n * Executes all stages in the chain and returns all results as a tuple.\n * Useful when you need access to intermediate results.\n *\n * @returns A promise that resolves to a tuple of all stage results\n * @throws {Error} If an error occurs and no error handler is registered\n */\n public async executeAll(): Promise<Types> {\n try {\n const results = await this.executeAllRequests(this.requestList);\n if (this.resultHandler && results.length > 0) {\n this.resultHandler(results);\n }\n return results as unknown as Types;\n } catch (error) {\n if (this.errorHandler) {\n this.errorHandler(error);\n return Promise.reject(error);\n } else {\n throw error;\n }\n } finally {\n if (this.finishHandler) {\n this.finishHandler();\n }\n }\n }\n\n // #endregion\n\n // #region Private methods\n\n /**\n * Adds a request entity (stage) to the internal request list.\n *\n * @template NewOut - The output type of the new stage\n * @param stage - The pipeline stage to add\n * @returns A new RequestChain instance with updated types\n */\n private addRequestEntity = <NewOut, PrevOut = Out>(\n stage:\n | PipelineRequestStage<\n AdapterExecutionResult,\n NewOut,\n AdapterRequestConfig,\n PrevOut\n >\n | PipelineManagerStage<\n NewOut,\n AdapterExecutionResult,\n AdapterRequestConfig,\n PrevOut\n >\n ): RequestChain<\n NewOut,\n AdapterExecutionResult,\n AdapterRequestConfig,\n [...Types, NewOut]\n > => {\n this.requestList.push(stage);\n return this as unknown as RequestChain<\n NewOut,\n AdapterExecutionResult,\n AdapterRequestConfig,\n [...Types, NewOut]\n >;\n };\n\n /**\n * Executes all request entities in sequence, handling preconditions and mappers.\n * Stages with failed preconditions are skipped but preserve the previous result.\n *\n * @template Out - The output type\n * @param requestEntityList - List of pipeline stages to execute\n * @returns A promise that resolves to an array of all stage results\n */\n private executeAllRequests = async <Out>(\n requestEntityList: (\n | PipelineRequestStage<AdapterExecutionResult, Out, AdapterRequestConfig>\n | PipelineManagerStage<Out, AdapterExecutionResult, AdapterRequestConfig>\n )[]\n ): Promise<Out[]> => {\n const results: Out[] = [];\n for (let i = 0; i < requestEntityList.length; i++) {\n const requestEntity:\n | PipelineRequestStage<\n AdapterExecutionResult,\n Out,\n AdapterRequestConfig\n >\n | PipelineManagerStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig\n > = requestEntityList[i];\n\n // Check precondition - skip stage if precondition returns false\n if (requestEntity.precondition && !requestEntity.precondition()) {\n const previousEntity = requestEntityList[i - 1];\n const previousResult: Out | undefined = previousEntity?.result;\n // Use previous result or undefined if this is the first stage\n // Don't push to results - skipped stages don't produce new results\n requestEntityList[i].result = previousResult as Out | undefined;\n continue;\n }\n\n const previousEntity = requestEntityList[i - 1];\n const previousResult: Out | undefined = previousEntity?.result;\n try {\n const requestResult: Out = await this.executeSingle<Out>(\n requestEntity,\n previousResult\n );\n let result: Out = requestResult;\n if (requestEntity.mapper) {\n let mappedResult: Out | Promise<Out>;\n if (isPipelineRequestStage(requestEntity)) {\n mappedResult = requestEntity.mapper(\n requestResult as unknown as AdapterExecutionResult,\n previousResult\n );\n } else if (isPipelineManagerStage(requestEntity)) {\n mappedResult = requestEntity.mapper(\n requestResult as unknown as Out,\n previousResult\n );\n } else {\n mappedResult = result;\n }\n result =\n mappedResult instanceof Promise ? await mappedResult : mappedResult;\n }\n if (requestEntity.resultInterceptor) {\n await requestEntity.resultInterceptor(result);\n }\n requestEntityList[i].result = result as Out;\n results.push(result);\n } catch (error) {\n const requestConfig = isPipelineRequestStage(requestEntity)\n ? requestEntity.config\n : undefined;\n error.cause = { ...error.cause, requestConfig };\n if (requestEntity.errorHandler) {\n await requestEntity.errorHandler(error);\n }\n throw error;\n }\n }\n return results;\n };\n\n /**\n * Executes a single request entity (stage).\n * Handles both request stages and nested manager stages.\n * Implements retry logic for request stages when retry configuration is provided.\n * Supports progressive chunk processing for streaming responses.\n *\n * @template Out - The output type\n * @param requestEntity - The pipeline stage to execute\n * @param previousResult - The result from the previous stage (optional)\n * @returns A promise that resolves to the stage result\n * @throws {Error} If the stage type is unknown or all retries are exhausted\n */\n private executeSingle = async <Out>(\n requestEntity:\n | PipelineRequestStage<AdapterExecutionResult, Out, AdapterRequestConfig>\n | PipelineManagerStage<Out, AdapterExecutionResult, AdapterRequestConfig>,\n previousResult?: Out\n ): Promise<Out> => {\n if (isPipelineRequestStage(requestEntity)) {\n const { config, retry, chunkProcessing } = requestEntity;\n const requestConfig: AdapterRequestConfig =\n typeof config === \"function\"\n ? (config(previousResult as Out) as AdapterRequestConfig)\n : (config as AdapterRequestConfig);\n\n // If retry config is provided, wrap execution in retry logic\n if (retry) {\n return this.executeWithRetry<Out>(\n requestConfig,\n retry,\n chunkProcessing\n );\n }\n\n // Execute request and handle chunk processing if enabled\n const rawResult: AdapterExecutionResult =\n await this.adapter.executeRequest(requestConfig);\n return this.processResultWithChunks<Out>(rawResult, chunkProcessing);\n } else if (isPipelineManagerStage(requestEntity)) {\n const { request } = requestEntity;\n const rawResult: Out = await request.execute();\n // For nested managers, the result is already processed, so we return it directly\n // The adapter's getResult expects AdapterExecutionResult, but nested results are already Out\n return rawResult;\n } else {\n throw new Error(\"Unknown type\");\n }\n };\n\n /**\n * Executes a request with retry logic based on the provided retry configuration.\n * Supports chunk processing for streaming responses.\n *\n * @template Out - The output type\n * @param requestConfig - The request configuration\n * @param retryConfig - The retry configuration\n * @param chunkProcessing - Optional chunk processing configuration\n * @returns A promise that resolves to the request result\n * @throws {Error} If all retry attempts are exhausted\n */\n private executeWithRetry = async <Out>(\n requestConfig: AdapterRequestConfig,\n retryConfig: RetryConfig,\n chunkProcessing?: import(\"./models/request-params\").ChunkProcessingConfig\n ): Promise<Out> => {\n const maxRetries = retryConfig.maxRetries ?? 3;\n const retryCondition = retryConfig.retryCondition ?? defaultRetryCondition;\n let lastError: Error | undefined;\n\n for (let attempt = 0; attempt <= maxRetries; attempt++) {\n try {\n const rawResult: AdapterExecutionResult =\n await this.adapter.executeRequest(requestConfig);\n return this.processResultWithChunks<Out>(rawResult, chunkProcessing);\n } catch (error) {\n lastError = error instanceof Error ? error : new Error(String(error));\n\n // Check if we should retry\n const shouldRetry =\n attempt < maxRetries && retryCondition(lastError, attempt);\n\n if (!shouldRetry) {\n throw lastError;\n }\n\n // Calculate delay before retrying\n const delay = this.calculateRetryDelay(\n attempt + 1,\n lastError,\n retryConfig\n );\n\n // Wait before retrying\n if (delay > 0) {\n await this.sleep(delay);\n }\n }\n }\n\n // This should never be reached, but TypeScript needs it\n throw lastError || new Error(\"Retry failed\");\n };\n\n /**\n * Processes a result with chunk processing if enabled.\n * Handles streaming responses by processing chunks progressively.\n *\n * @template Out - The output type\n * @param rawResult - The raw result from the adapter\n * @param chunkProcessing - Optional chunk processing configuration\n * @returns A promise that resolves to the processed result\n */\n private processResultWithChunks = async <Out>(\n rawResult: AdapterExecutionResult,\n chunkProcessing?: import(\"./models/request-params\").ChunkProcessingConfig\n ): Promise<Out> => {\n // If chunk processing is enabled and result is a Response with readable stream\n if (\n chunkProcessing?.enabled &&\n rawResult instanceof Response &&\n hasReadableStream(rawResult)\n ) {\n // Clone the response to avoid consuming the original stream\n const clonedResponse = rawResult.clone();\n\n // Process the stream\n const processed = await processResponseStream(clonedResponse, {\n ...chunkProcessing,\n });\n\n // If accumulation is enabled, return the accumulated data\n // Otherwise, return the original response (chunks were processed via handler)\n if (chunkProcessing.accumulate && processed !== rawResult) {\n return processed as unknown as Out;\n }\n\n // Return original response if chunks were only processed via handler\n return this.adapter.getResult(rawResult) as unknown as Out;\n }\n\n // No chunk processing, return result normally\n return this.adapter.getResult(rawResult) as unknown as Out;\n };\n\n /**\n * Calculates the delay before the next retry attempt.\n *\n * @param attempt - The current attempt number (1-indexed for retries)\n * @param error - The error that occurred\n * @param retryConfig - The retry configuration\n * @returns The delay in milliseconds\n */\n private calculateRetryDelay(\n attempt: number,\n error: Error,\n retryConfig: RetryConfig\n ): number {\n const baseDelay = retryConfig.retryDelay ?? 1000;\n const maxDelay = retryConfig.maxDelay;\n\n let delay: number;\n\n if (typeof baseDelay === \"function\") {\n // Custom delay function\n delay = baseDelay(attempt, error);\n } else if (retryConfig.exponentialBackoff) {\n // Exponential backoff: delay * 2^attempt\n delay = baseDelay * Math.pow(2, attempt - 1);\n // Apply maxDelay cap if provided\n if (maxDelay !== undefined && delay > maxDelay) {\n delay = maxDelay;\n }\n } else {\n // Fixed delay\n delay = baseDelay;\n }\n\n return Math.max(0, delay);\n }\n\n /**\n * Sleeps for the specified number of milliseconds.\n *\n * @param ms - Milliseconds to sleep\n * @returns A promise that resolves after the delay\n */\n private sleep(ms: number): Promise<void> {\n return new Promise((resolve) => setTimeout(resolve, ms));\n }\n\n // #endregion\n}\n\n/**\n * Creates a new RequestChain with an initial stage.\n * This is a convenience function that wraps RequestChain.begin.\n *\n * @template Out - The output type of the initial stage\n * @template AdapterExecutionResult - The type of result returned by the adapter\n * @template AdapterRequestConfig - The type of request configuration\n * @param stage - The initial pipeline stage (request or manager stage)\n * @param adapter - The request adapter to use for HTTP requests\n * @returns A new RequestChain instance with the initial stage\n */\nexport function begin<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig extends IRequestConfig = IRequestConfig,\n>(\n stage:\n | PipelineRequestStage<AdapterExecutionResult, Out, AdapterRequestConfig>\n | PipelineManagerStage<Out, AdapterExecutionResult, AdapterRequestConfig>,\n adapter: RequestAdapter<AdapterExecutionResult, AdapterRequestConfig>\n): RequestChain<Out, AdapterExecutionResult, AdapterRequestConfig, [Out]> {\n const requestChain = new RequestChain<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig,\n []\n >();\n requestChain.setRequestAdapter(adapter);\n return requestChain.next(stage);\n}\n\n/**\n * Type guard to check if a stage is a PipelineRequestStage.\n *\n * @template Out - The output type\n * @template AdapterExecutionResult - The adapter execution result type\n * @template AdapterRequestConfig - The request configuration type\n * @param stage - The stage to check\n * @returns True if the stage is a PipelineRequestStage\n */\nfunction isPipelineRequestStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig extends IRequestConfig = IRequestConfig,\n PrevOut = Out,\n>(\n stage:\n | PipelineRequestStage<\n AdapterExecutionResult,\n Out,\n AdapterRequestConfig,\n PrevOut\n >\n | PipelineManagerStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig,\n PrevOut\n >\n): stage is PipelineRequestStage<\n AdapterExecutionResult,\n Out,\n AdapterRequestConfig,\n PrevOut\n> {\n return \"config\" in stage && !(\"request\" in stage);\n}\n\n/**\n * Type guard to check if a stage is a PipelineManagerStage.\n *\n * @template Out - The output type\n * @template AdapterExecutionResult - The adapter execution result type\n * @template AdapterRequestConfig - The request configuration type\n * @template PrevOut - The previous output type (defaults to Out)\n * @param stage - The stage to check\n * @returns True if the stage is a PipelineManagerStage\n */\nfunction isPipelineManagerStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig extends IRequestConfig = IRequestConfig,\n PrevOut = Out,\n>(\n stage:\n | PipelineRequestStage<\n AdapterExecutionResult,\n Out,\n AdapterRequestConfig,\n PrevOut\n >\n | PipelineManagerStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig,\n PrevOut\n >\n): stage is PipelineManagerStage<\n Out,\n AdapterExecutionResult,\n AdapterRequestConfig,\n PrevOut\n> {\n return \"request\" in stage && !(\"config\" in stage);\n}\n"]}
|
package/package.json
ADDED
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@flow-conductor/core",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Core types and base classes for flow-conductor request adapters",
|
|
6
|
+
"main": "./build/index.js",
|
|
7
|
+
"types": "./build/index.d.ts",
|
|
8
|
+
"exports": {
|
|
9
|
+
".": {
|
|
10
|
+
"types": "./build/index.d.ts",
|
|
11
|
+
"import": "./build/index.js"
|
|
12
|
+
},
|
|
13
|
+
"./RequestAdapter": {
|
|
14
|
+
"types": "./build/RequestAdapter.d.ts",
|
|
15
|
+
"import": "./build/RequestAdapter.js"
|
|
16
|
+
},
|
|
17
|
+
"./RequestManager": {
|
|
18
|
+
"types": "./build/RequestManager.d.ts",
|
|
19
|
+
"import": "./build/RequestManager.js"
|
|
20
|
+
},
|
|
21
|
+
"./RequestChain": {
|
|
22
|
+
"types": "./build/RequestChain.d.ts",
|
|
23
|
+
"import": "./build/RequestChain.js"
|
|
24
|
+
},
|
|
25
|
+
"./models/RequestParams": {
|
|
26
|
+
"types": "./build/models/RequestParams.d.ts",
|
|
27
|
+
"import": "./build/models/RequestParams.js"
|
|
28
|
+
},
|
|
29
|
+
"./models/Handlers": {
|
|
30
|
+
"types": "./build/models/Handlers.d.ts",
|
|
31
|
+
"import": "./build/models/Handlers.js"
|
|
32
|
+
}
|
|
33
|
+
},
|
|
34
|
+
"files": [
|
|
35
|
+
"build/**/*.js",
|
|
36
|
+
"build/**/*.d.ts",
|
|
37
|
+
"build/**/*.js.map",
|
|
38
|
+
"README.md",
|
|
39
|
+
"LICENSE"
|
|
40
|
+
],
|
|
41
|
+
"keywords": [
|
|
42
|
+
"flow-conductor",
|
|
43
|
+
"request",
|
|
44
|
+
"adapter",
|
|
45
|
+
"core",
|
|
46
|
+
"typescript"
|
|
47
|
+
],
|
|
48
|
+
"scripts": {
|
|
49
|
+
"test": "node --test --import tsx/esm 'src/__test__/**/*.test.ts'",
|
|
50
|
+
"test:watch": "node --test --import tsx/esm --watch 'src/__test__/**/*.test.ts'",
|
|
51
|
+
"build": "tsup",
|
|
52
|
+
"clean": "rm -rf build",
|
|
53
|
+
"lint": "eslint src --ext .ts",
|
|
54
|
+
"lint:fix": "eslint src --ext .ts --fix",
|
|
55
|
+
"type-check": "tsc --noEmit"
|
|
56
|
+
},
|
|
57
|
+
"author": "Dawid Hermann",
|
|
58
|
+
"license": "MIT",
|
|
59
|
+
"repository": {
|
|
60
|
+
"type": "git",
|
|
61
|
+
"url": "https://github.com/dawidhermann/flow-conductor.git",
|
|
62
|
+
"directory": "packages/core"
|
|
63
|
+
},
|
|
64
|
+
"sideEffects": false,
|
|
65
|
+
"publishConfig": {
|
|
66
|
+
"access": "public"
|
|
67
|
+
},
|
|
68
|
+
"engines": {
|
|
69
|
+
"node": ">=18.0.0"
|
|
70
|
+
},
|
|
71
|
+
"devDependencies": {
|
|
72
|
+
"@eslint/js": "^9.39.2",
|
|
73
|
+
"@typescript-eslint/eslint-plugin": "^8.50.1",
|
|
74
|
+
"@typescript-eslint/parser": "^8.50.1",
|
|
75
|
+
"c8": "^10.1.3",
|
|
76
|
+
"eslint": "^9.39.2",
|
|
77
|
+
"eslint-config-prettier": "^10.1.8",
|
|
78
|
+
"eslint-plugin-prettier": "^5.5.4",
|
|
79
|
+
"prettier": "^3.7.4",
|
|
80
|
+
"tsx": "^4.7.0",
|
|
81
|
+
"typescript": "^5.9.3",
|
|
82
|
+
"typescript-eslint": "^8.50.1"
|
|
83
|
+
}
|
|
84
|
+
}
|