{"_id":"@aiwheels/rollup-plugin-build-config","_rev":"1-d6fe1a3e76cfa99c53dde9173accaded","name":"@aiwheels/rollup-plugin-build-config","dist-tags":{"latest":"0.0.2"},"versions":{"0.0.2":{"name":"@aiwheels/rollup-plugin-build-config","version":"0.0.2","description":"> TODO:生成 rollup 打包配置工具","homepage":"","license":"ISC","main":"lib/index.js","module":"esm/index.js","browser":"dist/index.js","typings":"types/index.d.ts","directories":{"lib":"lib","esm":"esm","types":"types","dist":"dist","test":"__tests__"},"publishConfig":{"access":"public","main":"lib/index.js","typings":"types/index.d.ts"},"keywords":[],"dependencies":{"lodash":"^4.17.21"},"devDependencies":{"@aiwheels/node-extra":"0.0.2","@aiwheels/rollup-plugin-build-config":"0.0.2","@rollup/plugin-alias":"^3.1.9","@rollup/plugin-babel":"^5.3.0","@rollup/plugin-commonjs":"^21.0.1","@rollup/plugin-html":"^0.2.4","@rollup/plugin-json":"^4.1.0","@rollup/plugin-node-resolve":"^13.1.3","@rollup/plugin-replace":"^3.0.1","@rollup/plugin-typescript":"^8.3.0","@types/fs-extra":"^2.1.0","@types/lodash":"^4.14.178","@types/lodash-es":"^4.17.5","fs-extra":"^10.0.0","rollup":"^2.63.0","rollup-plugin-babel":"^4.4.0","rollup-plugin-clear":"^2.0.7","rollup-plugin-livereload":"^2.0.5","rollup-plugin-serve":"^1.1.0","rollup-plugin-terser":"^7.0.2"},"scripts":{"build:types":"tsc -p ./tsconfig.build.json --emitDeclarationOnly","build:packages":"rollup -c && pnpm run build:types","clean:packages":"rimraf -rf node_modules && rimraf -rf pnpm-lock.yaml && rimraf -rf dist && rimraf -rf esm && rimraf -rf lib"},"_resolved":"","_integrity":"","_from":"file:aiwheels-rollup-plugin-build-config-0.0.2.tgz","_id":"@aiwheels/rollup-plugin-build-config@0.0.2","_nodeVersion":"14.17.2","_npmVersion":"6.14.13","dist":{"integrity":"sha512-rMfZVv625pWFtABphG7rV7GeVK87foQF8KDCmFCUh8/etkdeoYxxKlJ6Tbg3s6bLCISWrOEeK/Lxr0+vkfJbIA==","shasum":"cac3e13914b6193cef5049ce81ed2fe1cc574bb9","tarball":"https://registry.npmjs.org/@aiwheels/rollup-plugin-build-config/-/rollup-plugin-build-config-0.0.2.tgz","fileCount":8,"unpackedSize":22143,"npm-signature":"-----BEGIN PGP SIGNATURE-----\r\nVersion: OpenPGP.js v3.0.13\r\nComment: https://openpgpjs.org\r\n\r\nwsFcBAEBCAAQBQJh4VxyCRA9TVsSAnZWagAAgksP/A+t8qkfUXvJOePtfWGq\nThkw5V8FpqHZlIq4lEQt5rKcy0Ri86m5vp6ak2tDJLJNR4kAQIwgbN2uJr9e\naIvRqS+w8OrtAt+IB7wP4GL8o/cptGrbELwYURBT0eBGqw9k8mDbF7boWGwP\ndUoz6XV38006rKCtYca2lt+ApLtRe6rK/KBbp3e/wOOAtGBCB3qambT2bMY7\nNMncdv1gJwc8jt0Yl3hWAwJeWY765Ty2OaxyuB4ywCQRDLCBK4UNuLxTkYLh\n+sO+AD+nZGhKodWRA2n+Vl0uBOnK7Ve5BiDvFZw3s9MQ0F51a2RfpVGBB8n0\n+Bwh3cKv2PlsP0w74Dy5MGArtKVxF2xV8SU1On2hT8zr77Wsml9dH0UYlIfk\n0OonCJAaV+WzXgb3PaW1spb/hhAl05DvvZog5YwMb/A9yIy1q4VAD9C4QxcJ\nd4uVUhYLA5cGDTlmaNdVIiKNcnPIJLeOOdodt1Cs8W5li6kZeX/1o2VeZq5e\n1TmgriWgugoHopggkwHxBGFOGX7Bov+0rXDN3rkzZs9BlGGRMa89GUQhi6xz\nb/4VWmvKXAsYQhoqMN1LYUY7IiZLKqCBz9TqUw8kwOzhRIupEhjbglnZORlF\niKqmNZJ4zYwHJpqE3A0X6Hc91PXJOsI76ykX1eBlV9Qo53MD2wpcz9NWaOHU\ntqM/\r\n=ywTw\r\n-----END PGP SIGNATURE-----\r\n","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQCDDL67YcOeuEKCr22VW7yd/0GhZ+pSwos1aX2SwIvI6AIhAPbZ8FvawuoCbi/NhzdeMC/lSSKUr1Co+FeNKkDA+AhB"}]},"_npmUser":{"name":"aaron-zm","email":"xiaochunyan_oo@126.com"},"maintainers":[{"name":"aaron-zm","email":"xiaochunyan_oo@126.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/rollup-plugin-build-config_0.0.2_1642159218053_0.7728986635418373"},"_hasShrinkwrap":false}},"time":{"created":"2022-01-14T11:20:17.992Z","0.0.2":"2022-01-14T11:20:18.414Z","modified":"2022-04-04T12:25:46.804Z"},"maintainers":[{"name":"aaron-zm","email":"xiaochunyan_oo@126.com"}],"description":"> TODO:生成 rollup 打包配置工具","keywords":[],"license":"ISC","readme":"# api-js 工具\n\n## 安装\n\n```shell\n# 通过 npm 安装\nnpm i @aiwheels/axios-api-js -S\n\n# 通过 yarn 安装\nyarn add @aiwheels/axios-api-js -S\n\n# 通过 pnpm 安装\npnpm add @aiwheels/axios-api-js -S\n```\n\n## methods\n\n## 示例代码\n\n```js\nimport { createApiService } from '@aiwheels/axios-api-js';\nimport axios from 'axios';\n\nconst http = axios.create();\n\nconst createApi = createApiService(http);\n\ncreateApi({\n  url: 'xxx',\n  method: 'get',\n}).request({\n  body: {},\n});\n```\n\n## API\n\n### createApiService\n\n```ts\ninterface ApiConfig {\n  url: string | ((path: ApiRequestConfig['path']) => string);\n  method: Method;\n  cache: boolean;\n  cacheTime: number;\n  headers: AxiosRequestConfig['headers'];\n  axiosConfig: AxiosRequestConfig;\n}\n\ninterface ApiRequestConfig<T = any> {\n  headers?: AxiosRequestConfig<T>['headers'];\n  path?: Record<string, string>;\n  query?: Record<string, string>;\n  body?: AxiosRequestConfig<T>['data'];\n  axiosConfig?: AxiosRequestConfig<T>;\n}\n\nclass Api {\n  http: AxiosInstance;\n\n  config: ApiConfig;\n\n  cache: Record<\n    string,\n    {\n      promise: Promise<any>;\n      expireTime: number | null;\n    }\n  >;\n\n  constructor(http: AxiosInstance, config: ApiConfig): Api;\n\n  request<T = never, R = AxiosResponse<T>>(requestConfig?: ApiRequestConfig<T>): Promise<R>;\n\n  clearCache(): void;\n}\n\nfunction createApiService(http: AxiosInstance): (apiConfig: ApiConfig) => Api;\n```\n","readmeFilename":""}