@flow-conductor/adapter-axios 1.0.0 → 1.0.1
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/build/index.d.ts +1 -1
- package/build/index.js +1 -1
- package/build/index.js.map +1 -1
- package/package.json +1 -1
package/build/index.d.ts
CHANGED
|
@@ -36,4 +36,4 @@ declare class AxiosRequestAdapter extends RequestAdapter<AxiosResponse, AxiosReq
|
|
|
36
36
|
createRequest(requestConfig: AxiosRequestConfigType): Promise<AxiosResponse>;
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
export { type AxiosRequestConfigType
|
|
39
|
+
export { AxiosRequestAdapter, type AxiosRequestConfigType };
|
package/build/index.js
CHANGED
package/build/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/axios-request-adapter.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"sources":["../src/axios-request-adapter.ts"],"names":[],"mappings":";;;;AA2BO,IAAM,mBAAA,GAAN,cAAkC,cAAA,CAGvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMA,YAAY,oBAAA,EAA6C;AACvD,IAAA,KAAA,CAAM,oBAAoB,CAAA;AAAA,EAC5B;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,MAAa,cACX,aAAA,EACwB;AACxB,IAAA,MAAM,EAAE,GAAA,EAAK,MAAA,EAAQ,IAAA,EAAM,GAAG,MAAK,GAAI,aAAA;AAEvC,IAAA,MAAM,WAAA,GAAkC;AAAA,MACtC,GAAA;AAAA,MACA,MAAA,EAAQ,OAAO,WAAA,EAAY;AAAA,MAC3B,IAAA;AAAA,MACA,GAAG;AAAA,KACL;AAEA,IAAA,OAAO,MAAM,WAAW,CAAA;AAAA,EAC1B;AACF","file":"index.js","sourcesContent":["import { RequestAdapter } from \"@flow-conductor/core\";\nimport type {\n IRequestConfig,\n UrlValidationOptions,\n} from \"@flow-conductor/core\";\nimport axios, { type AxiosRequestConfig, type AxiosResponse } from \"axios\";\n\n/**\n * Extended request configuration type that combines IRequestConfig with Axios-specific options.\n * Allows using all Axios configuration options while maintaining compatibility with flow-conductor.\n */\nexport type AxiosRequestConfigType = IRequestConfig &\n Partial<AxiosRequestConfig>;\n\n/**\n * Request adapter implementation using Axios as the underlying HTTP client.\n * Provides seamless integration between flow-conductor and Axios.\n *\n * @example\n * ```typescript\n * const adapter = new AxiosRequestAdapter();\n * const chain = begin(\n * { config: { url: 'https://api.example.com/users', method: 'GET' } },\n * adapter\n * );\n * ```\n */\nexport class AxiosRequestAdapter extends RequestAdapter<\n AxiosResponse,\n AxiosRequestConfigType\n> {\n /**\n * Creates a new AxiosRequestAdapter instance.\n *\n * @param urlValidationOptions - Optional URL validation options to prevent SSRF attacks\n */\n constructor(urlValidationOptions?: UrlValidationOptions) {\n super(urlValidationOptions);\n }\n\n /**\n * Creates and executes an HTTP request using Axios.\n * Converts flow-conductor request configuration to Axios format.\n *\n * @param requestConfig - The request configuration object\n * @returns A promise that resolves to an AxiosResponse\n */\n public async createRequest(\n requestConfig: AxiosRequestConfigType\n ): Promise<AxiosResponse> {\n const { url, method, data, ...rest } = requestConfig;\n\n const axiosConfig: AxiosRequestConfig = {\n url,\n method: method.toLowerCase() as AxiosRequestConfig[\"method\"],\n data,\n ...rest,\n };\n\n return axios(axiosConfig);\n }\n}\n"]}
|