pixivflow 2.15.0 → 2.16.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/dist/auth/PixivAuth.d.ts +18 -0
- package/dist/auth/PixivAuth.d.ts.map +1 -0
- package/dist/auth/PixivAuth.js +200 -0
- package/dist/auth/PixivAuth.js.map +1 -0
- package/dist/commands/DoctorCommand.d.ts.map +1 -1
- package/dist/commands/DoctorCommand.js +23 -0
- package/dist/commands/DoctorCommand.js.map +1 -1
- package/dist/commands/DownloadCommand.js +4 -4
- package/dist/commands/DownloadCommand.js.map +1 -1
- package/dist/commands/HealthCommand.d.ts.map +1 -1
- package/dist/commands/HealthCommand.js +14 -1
- package/dist/commands/HealthCommand.js.map +1 -1
- package/dist/commands/RandomDownloadCommand.js +4 -4
- package/dist/commands/RandomDownloadCommand.js.map +1 -1
- package/dist/commands/TagsCommand.js +4 -4
- package/dist/commands/TagsCommand.js.map +1 -1
- package/dist/commands/TopicCommand.d.ts.map +1 -1
- package/dist/commands/TopicCommand.js +4 -4
- package/dist/commands/TopicCommand.js.map +1 -1
- package/dist/commands/scheduler-runtime.d.ts +2 -2
- package/dist/commands/scheduler-runtime.d.ts.map +1 -1
- package/dist/commands/scheduler-runtime.js +4 -4
- package/dist/commands/scheduler-runtime.js.map +1 -1
- package/dist/config/types.d.ts +7 -0
- package/dist/config/types.d.ts.map +1 -1
- package/dist/download/IllustrationDownloader.d.ts +1 -1
- package/dist/download/IllustrationDownloader.d.ts.map +1 -1
- package/dist/download/NovelDownloader.d.ts +1 -1
- package/dist/download/NovelDownloader.d.ts.map +1 -1
- package/dist/download/RankingService.d.ts +1 -1
- package/dist/download/RankingService.d.ts.map +1 -1
- package/dist/download/handlers/IllustrationTargetHandler.d.ts.map +1 -1
- package/dist/download/handlers/IllustrationTargetHandler.js +12 -5
- package/dist/download/handlers/IllustrationTargetHandler.js.map +1 -1
- package/dist/download/handlers/NovelTargetHandler.d.ts.map +1 -1
- package/dist/download/handlers/NovelTargetHandler.js +12 -5
- package/dist/download/handlers/NovelTargetHandler.js.map +1 -1
- package/dist/download/pipeline/DownloadPipeline.d.ts +1 -1
- package/dist/download/pipeline/DownloadPipeline.d.ts.map +1 -1
- package/dist/download/plan/DownloadPlanner.d.ts +1 -1
- package/dist/download/plan/DownloadPlanner.d.ts.map +1 -1
- package/dist/download/recovery/ErrorRecovery.d.ts.map +1 -1
- package/dist/download/recovery/ErrorRecovery.js +8 -2
- package/dist/download/recovery/ErrorRecovery.js.map +1 -1
- package/dist/interfaces/IPixivClient.d.ts +1 -5
- package/dist/interfaces/IPixivClient.d.ts.map +1 -1
- package/dist/package.json +1 -1
- package/dist/pixiv/AuthClient.d.ts +6 -12
- package/dist/pixiv/AuthClient.d.ts.map +1 -1
- package/dist/pixiv/AuthClient.js +7 -188
- package/dist/pixiv/AuthClient.js.map +1 -1
- package/dist/pixiv/PixivClient.d.ts +14 -156
- package/dist/pixiv/PixivClient.d.ts.map +1 -1
- package/dist/pixiv/PixivClient.js +15 -292
- package/dist/pixiv/PixivClient.js.map +1 -1
- package/dist/pixiv-client/PixivAuthTokenProvider.d.ts +16 -0
- package/dist/pixiv-client/PixivAuthTokenProvider.d.ts.map +1 -0
- package/dist/pixiv-client/PixivAuthTokenProvider.js +27 -0
- package/dist/pixiv-client/PixivAuthTokenProvider.js.map +1 -0
- package/dist/pixiv-client/PixivFlowPixivClient.d.ts +77 -0
- package/dist/pixiv-client/PixivFlowPixivClient.d.ts.map +1 -0
- package/dist/pixiv-client/PixivFlowPixivClient.js +146 -0
- package/dist/pixiv-client/PixivFlowPixivClient.js.map +1 -0
- package/dist/pixiv-client/TargetSearchRunner.d.ts +29 -0
- package/dist/pixiv-client/TargetSearchRunner.d.ts.map +1 -0
- package/dist/pixiv-client/TargetSearchRunner.js +182 -0
- package/dist/pixiv-client/TargetSearchRunner.js.map +1 -0
- package/dist/pixiv-client/createPixivFlowClient.d.ts +11 -0
- package/dist/pixiv-client/createPixivFlowClient.d.ts.map +1 -0
- package/dist/pixiv-client/createPixivFlowClient.js +29 -0
- package/dist/pixiv-client/createPixivFlowClient.js.map +1 -0
- package/dist/pixiv-client/query-mapper.d.ts +14 -0
- package/dist/pixiv-client/query-mapper.d.ts.map +1 -0
- package/dist/pixiv-client/query-mapper.js +63 -0
- package/dist/pixiv-client/query-mapper.js.map +1 -0
- package/dist/random-download.js +4 -4
- package/dist/random-download.js.map +1 -1
- package/dist/storage/Database.d.ts +4 -0
- package/dist/storage/Database.d.ts.map +1 -1
- package/dist/storage/Database.js +7 -0
- package/dist/storage/Database.js.map +1 -1
- package/dist/storage/DatabaseMigration.d.ts.map +1 -1
- package/dist/storage/DatabaseMigration.js +8 -0
- package/dist/storage/DatabaseMigration.js.map +1 -1
- package/dist/storage/repositories/RateLimitStateRepository.d.ts +17 -0
- package/dist/storage/repositories/RateLimitStateRepository.d.ts.map +1 -0
- package/dist/storage/repositories/RateLimitStateRepository.js +46 -0
- package/dist/storage/repositories/RateLimitStateRepository.js.map +1 -0
- package/dist/tags/types.d.ts +1 -1
- package/dist/tags/types.d.ts.map +1 -1
- package/dist/utils/concurrency.d.ts.map +1 -1
- package/dist/utils/concurrency.js +2 -1
- package/dist/utils/concurrency.js.map +1 -1
- package/dist/utils/errors.d.ts +20 -0
- package/dist/utils/errors.d.ts.map +1 -1
- package/dist/utils/errors.js +56 -1
- package/dist/utils/errors.js.map +1 -1
- package/dist/utils/pixiv-sort.d.ts +1 -1
- package/dist/utils/pixiv-sort.d.ts.map +1 -1
- package/dist/utils/pixiv-utils.d.ts +1 -1
- package/dist/utils/pixiv-utils.d.ts.map +1 -1
- package/dist/utils/token-maintenance.d.ts +1 -1
- package/dist/utils/token-maintenance.d.ts.map +1 -1
- package/dist/version.js +1 -1
- package/dist/webui/package.json +1 -1
- package/dist/webui/services/DownloadTaskManager.js +4 -4
- package/dist/webui/services/DownloadTaskManager.js.map +1 -1
- package/node_modules/@redtidev/pixiv-client/LICENSE +21 -0
- package/node_modules/@redtidev/pixiv-client/README.md +103 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/exports.d.ts +6 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/exports.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/exports.js +14 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/exports.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/illustrations.d.ts +30 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/illustrations.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/illustrations.js +137 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/illustrations.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/media.d.ts +16 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/media.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/media.js +25 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/media.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/novels.d.ts +43 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/novels.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/novels.js +250 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/novels.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/options.d.ts +42 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/options.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/options.js +7 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/options.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/tags.d.ts +9 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/tags.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/tags.js +22 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/tags.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/users.d.ts +17 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/users.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/users.js +23 -0
- package/node_modules/@redtidev/pixiv-client/dist/app-api/users.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/auth/types.d.ts +25 -0
- package/node_modules/@redtidev/pixiv-client/dist/auth/types.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/auth/types.js +24 -0
- package/node_modules/@redtidev/pixiv-client/dist/auth/types.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/client.d.ts +42 -0
- package/node_modules/@redtidev/pixiv-client/dist/client.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/client.js +86 -0
- package/node_modules/@redtidev/pixiv-client/dist/client.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/errors/errors.d.ts +117 -0
- package/node_modules/@redtidev/pixiv-client/dist/errors/errors.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/errors/errors.js +169 -0
- package/node_modules/@redtidev/pixiv-client/dist/errors/errors.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/index.d.ts +25 -0
- package/node_modules/@redtidev/pixiv-client/dist/index.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/index.js +50 -0
- package/node_modules/@redtidev/pixiv-client/dist/index.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/logger.d.ts +13 -0
- package/node_modules/@redtidev/pixiv-client/dist/logger.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/logger.js +10 -0
- package/node_modules/@redtidev/pixiv-client/dist/logger.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/models/index.d.ts +112 -0
- package/node_modules/@redtidev/pixiv-client/dist/models/index.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/models/index.js +8 -0
- package/node_modules/@redtidev/pixiv-client/dist/models/index.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/pagination.d.ts +22 -0
- package/node_modules/@redtidev/pixiv-client/dist/pagination.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/pagination.js +41 -0
- package/node_modules/@redtidev/pixiv-client/dist/pagination.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/rate-limit/RateLimitGate.d.ts +95 -0
- package/node_modules/@redtidev/pixiv-client/dist/rate-limit/RateLimitGate.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/rate-limit/RateLimitGate.js +344 -0
- package/node_modules/@redtidev/pixiv-client/dist/rate-limit/RateLimitGate.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/transport/transport.d.ts +65 -0
- package/node_modules/@redtidev/pixiv-client/dist/transport/transport.d.ts.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/transport/transport.js +410 -0
- package/node_modules/@redtidev/pixiv-client/dist/transport/transport.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/types.d.ts +186 -0
- package/node_modules/@redtidev/pixiv-client/dist/types.d.ts.map +1 -0
- package/{dist/pixiv/IPixivRequestHandler.js → node_modules/@redtidev/pixiv-client/dist/types.js} +1 -1
- package/node_modules/@redtidev/pixiv-client/dist/types.js.map +1 -0
- package/node_modules/@redtidev/pixiv-client/dist/web-api/types.d.ts +19 -0
- package/node_modules/@redtidev/pixiv-client/dist/web-api/types.d.ts.map +1 -0
- package/{dist/pixiv → node_modules/@redtidev/pixiv-client/dist/web-api}/types.js +0 -3
- package/{dist/pixiv → node_modules/@redtidev/pixiv-client/dist/web-api}/types.js.map +1 -1
- package/node_modules/@redtidev/pixiv-client/package.json +55 -0
- package/node_modules/@redtidev/pixiv-client/src/__tests__/independence.test.ts +75 -0
- package/node_modules/@redtidev/pixiv-client/src/__tests__/integration.test.ts +268 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/__tests__/services.test.ts +199 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/exports.ts +5 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/illustrations.ts +144 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/media.ts +20 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/novels.ts +269 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/options.ts +73 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/tags.ts +21 -0
- package/node_modules/@redtidev/pixiv-client/src/app-api/users.ts +22 -0
- package/node_modules/@redtidev/pixiv-client/src/auth/types.ts +33 -0
- package/node_modules/@redtidev/pixiv-client/src/client.ts +105 -0
- package/node_modules/@redtidev/pixiv-client/src/errors/errors.ts +180 -0
- package/node_modules/@redtidev/pixiv-client/src/index.ts +91 -0
- package/node_modules/@redtidev/pixiv-client/src/logger.ts +18 -0
- package/node_modules/@redtidev/pixiv-client/src/models/index.ts +117 -0
- package/node_modules/@redtidev/pixiv-client/src/pagination.ts +46 -0
- package/node_modules/@redtidev/pixiv-client/src/rate-limit/RateLimitGate.ts +365 -0
- package/node_modules/@redtidev/pixiv-client/src/rate-limit/__tests__/RateLimitGate.test.ts +258 -0
- package/node_modules/@redtidev/pixiv-client/src/transport/__tests__/transport.test.ts +282 -0
- package/node_modules/@redtidev/pixiv-client/src/transport/transport.ts +500 -0
- package/node_modules/@redtidev/pixiv-client/src/types.ts +168 -0
- package/node_modules/@redtidev/pixiv-client/src/web-api/types.ts +19 -0
- package/node_modules/agent-base/LICENSE +22 -0
- package/node_modules/agent-base/README.md +69 -0
- package/node_modules/agent-base/dist/helpers.d.ts +15 -0
- package/node_modules/agent-base/dist/helpers.d.ts.map +1 -0
- package/node_modules/agent-base/dist/helpers.js +66 -0
- package/node_modules/agent-base/dist/helpers.js.map +1 -0
- package/node_modules/agent-base/dist/index.d.ts +41 -0
- package/node_modules/agent-base/dist/index.d.ts.map +1 -0
- package/node_modules/agent-base/dist/index.js +178 -0
- package/node_modules/agent-base/dist/index.js.map +1 -0
- package/node_modules/agent-base/package.json +46 -0
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/axios/CHANGELOG.md +1934 -0
- package/node_modules/axios/LICENSE +7 -0
- package/node_modules/axios/MIGRATION_GUIDE.md +877 -0
- package/node_modules/axios/README.md +2851 -0
- package/node_modules/axios/dist/axios.js +5807 -0
- package/node_modules/axios/dist/axios.min.js +5 -0
- package/node_modules/axios/dist/axios.min.js.map +1 -0
- package/node_modules/axios/dist/browser/axios.cjs +5829 -0
- package/node_modules/axios/dist/esm/axios.js +5850 -0
- package/node_modules/axios/dist/esm/axios.min.js +3 -0
- package/node_modules/axios/dist/esm/axios.min.js.map +1 -0
- package/node_modules/axios/dist/node/axios.cjs +6808 -0
- package/node_modules/axios/index.d.cts +766 -0
- package/node_modules/axios/index.d.ts +787 -0
- package/node_modules/axios/index.js +45 -0
- package/node_modules/axios/lib/adapters/README.md +36 -0
- package/node_modules/axios/lib/adapters/adapters.js +132 -0
- package/node_modules/axios/lib/adapters/fetch.js +696 -0
- package/node_modules/axios/lib/adapters/http.js +1490 -0
- package/node_modules/axios/lib/adapters/xhr.js +277 -0
- package/node_modules/axios/lib/axios.js +89 -0
- package/node_modules/axios/lib/cancel/CancelToken.js +135 -0
- package/node_modules/axios/lib/cancel/CanceledError.js +22 -0
- package/node_modules/axios/lib/cancel/isCancel.js +5 -0
- package/node_modules/axios/lib/core/Axios.js +306 -0
- package/node_modules/axios/lib/core/AxiosError.js +219 -0
- package/node_modules/axios/lib/core/AxiosHeaders.js +474 -0
- package/node_modules/axios/lib/core/InterceptorManager.js +171 -0
- package/node_modules/axios/lib/core/README.md +8 -0
- package/node_modules/axios/lib/core/buildFullPath.js +76 -0
- package/node_modules/axios/lib/core/dispatchRequest.js +95 -0
- package/node_modules/axios/lib/core/mergeConfig.js +174 -0
- package/node_modules/axios/lib/core/methodList.js +17 -0
- package/node_modules/axios/lib/core/setFormDataHeaders.js +27 -0
- package/node_modules/axios/lib/core/settle.js +27 -0
- package/node_modules/axios/lib/core/transformData.js +28 -0
- package/node_modules/axios/lib/defaults/index.js +178 -0
- package/node_modules/axios/lib/defaults/transitional.js +10 -0
- package/node_modules/axios/lib/env/README.md +3 -0
- package/node_modules/axios/lib/env/classes/FormData.js +2 -0
- package/node_modules/axios/lib/env/data.js +1 -0
- package/node_modules/axios/lib/helpers/AxiosTransformStream.js +156 -0
- package/node_modules/axios/lib/helpers/AxiosURLSearchParams.js +59 -0
- package/node_modules/axios/lib/helpers/Http2Sessions.js +121 -0
- package/node_modules/axios/lib/helpers/HttpStatusCode.js +88 -0
- package/node_modules/axios/lib/helpers/README.md +7 -0
- package/node_modules/axios/lib/helpers/ZlibHeaderTransformStream.js +29 -0
- package/node_modules/axios/lib/helpers/bind.js +14 -0
- package/node_modules/axios/lib/helpers/buildURL.js +69 -0
- package/node_modules/axios/lib/helpers/callbackify.js +18 -0
- package/node_modules/axios/lib/helpers/combineURLs.js +23 -0
- package/node_modules/axios/lib/helpers/composeSignals.js +68 -0
- package/node_modules/axios/lib/helpers/cookies.js +64 -0
- package/node_modules/axios/lib/helpers/deprecatedMethod.js +31 -0
- package/node_modules/axios/lib/helpers/estimateDataURLDecodedBytes.js +166 -0
- package/node_modules/axios/lib/helpers/formDataToJSON.js +125 -0
- package/node_modules/axios/lib/helpers/formDataToStream.js +119 -0
- package/node_modules/axios/lib/helpers/fromDataURI.js +69 -0
- package/node_modules/axios/lib/helpers/isAbsoluteURL.js +19 -0
- package/node_modules/axios/lib/helpers/isAxiosError.js +14 -0
- package/node_modules/axios/lib/helpers/isURLSameOrigin.js +16 -0
- package/node_modules/axios/lib/helpers/normalizeURLForProtocolCheck.js +24 -0
- package/node_modules/axios/lib/helpers/null.js +2 -0
- package/node_modules/axios/lib/helpers/parseHeaders.js +71 -0
- package/node_modules/axios/lib/helpers/parseProtocol.js +6 -0
- package/node_modules/axios/lib/helpers/progressEventReducer.js +54 -0
- package/node_modules/axios/lib/helpers/readBlob.js +15 -0
- package/node_modules/axios/lib/helpers/resolveConfig.js +107 -0
- package/node_modules/axios/lib/helpers/sanitizeHeaderValue.js +60 -0
- package/node_modules/axios/lib/helpers/shouldBypassProxy.js +505 -0
- package/node_modules/axios/lib/helpers/speedometer.js +55 -0
- package/node_modules/axios/lib/helpers/spread.js +28 -0
- package/node_modules/axios/lib/helpers/throttle.js +45 -0
- package/node_modules/axios/lib/helpers/toFormData.js +279 -0
- package/node_modules/axios/lib/helpers/toURLEncodedForm.js +19 -0
- package/node_modules/axios/lib/helpers/trackStream.js +89 -0
- package/node_modules/axios/lib/helpers/validator.js +112 -0
- package/node_modules/axios/lib/platform/browser/classes/Blob.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/browser/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/browser/index.js +13 -0
- package/node_modules/axios/lib/platform/common/utils.js +52 -0
- package/node_modules/axios/lib/platform/index.js +7 -0
- package/node_modules/axios/lib/platform/node/classes/Buffer.js +11 -0
- package/node_modules/axios/lib/platform/node/classes/FormData.js +3 -0
- package/node_modules/axios/lib/platform/node/classes/URLSearchParams.js +4 -0
- package/node_modules/axios/lib/platform/node/index.js +37 -0
- package/node_modules/axios/lib/utils.js +1150 -0
- package/node_modules/axios/node_modules/agent-base/README.md +145 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.d.ts +78 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js +203 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/index.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.d.ts +4 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js +18 -0
- package/node_modules/axios/node_modules/agent-base/dist/src/promisify.js.map +1 -0
- package/node_modules/axios/node_modules/agent-base/package.json +64 -0
- package/node_modules/axios/node_modules/agent-base/src/index.ts +345 -0
- package/node_modules/axios/node_modules/agent-base/src/promisify.ts +33 -0
- package/node_modules/axios/node_modules/debug/LICENSE +20 -0
- package/node_modules/axios/node_modules/debug/README.md +481 -0
- package/node_modules/axios/node_modules/debug/package.json +64 -0
- package/node_modules/axios/node_modules/debug/src/browser.js +272 -0
- package/node_modules/axios/node_modules/debug/src/common.js +292 -0
- package/node_modules/axios/node_modules/debug/src/index.js +10 -0
- package/node_modules/axios/node_modules/debug/src/node.js +263 -0
- package/node_modules/axios/node_modules/https-proxy-agent/README.md +137 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.d.ts +30 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js +177 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/agent.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.d.ts +23 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js +14 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.d.ts +7 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js +66 -0
- package/node_modules/axios/node_modules/https-proxy-agent/dist/parse-proxy-response.js.map +1 -0
- package/node_modules/axios/node_modules/https-proxy-agent/package.json +56 -0
- package/node_modules/axios/node_modules/ms/index.js +162 -0
- package/node_modules/axios/node_modules/ms/license.md +21 -0
- package/node_modules/axios/node_modules/ms/package.json +38 -0
- package/node_modules/axios/node_modules/ms/readme.md +59 -0
- package/node_modules/axios/package.json +203 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +37 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +80 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +6 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/follow-redirects/LICENSE +18 -0
- package/node_modules/follow-redirects/README.md +157 -0
- package/node_modules/follow-redirects/debug.js +15 -0
- package/node_modules/follow-redirects/http.js +1 -0
- package/node_modules/follow-redirects/https.js +1 -0
- package/node_modules/follow-redirects/index.js +709 -0
- package/node_modules/follow-redirects/package.json +58 -0
- package/node_modules/form-data/CHANGELOG.md +686 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md +355 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +4 -0
- package/node_modules/form-data/lib/form_data.js +506 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/package.json +82 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/ip-address/LICENSE +19 -0
- package/node_modules/ip-address/README.md +308 -0
- package/node_modules/ip-address/dist/address-error.d.ts +15 -0
- package/node_modules/ip-address/dist/address-error.js +12 -0
- package/node_modules/ip-address/dist/address-error.js.map +1 -0
- package/node_modules/ip-address/dist/common.d.ts +69 -0
- package/node_modules/ip-address/dist/common.js +142 -0
- package/node_modules/ip-address/dist/common.js.map +1 -0
- package/node_modules/ip-address/dist/ip-address.d.ts +7 -0
- package/node_modules/ip-address/dist/ip-address.js +35 -0
- package/node_modules/ip-address/dist/ip-address.js.map +1 -0
- package/node_modules/ip-address/dist/ipv4.d.ts +340 -0
- package/node_modules/ip-address/dist/ipv4.js +580 -0
- package/node_modules/ip-address/dist/ipv4.js.map +1 -0
- package/node_modules/ip-address/dist/ipv6.d.ts +630 -0
- package/node_modules/ip-address/dist/ipv6.js +1443 -0
- package/node_modules/ip-address/dist/ipv6.js.map +1 -0
- package/node_modules/ip-address/dist/v4/constants.d.ts +16 -0
- package/node_modules/ip-address/dist/v4/constants.js +51 -0
- package/node_modules/ip-address/dist/v4/constants.js.map +1 -0
- package/node_modules/ip-address/dist/v6/constants.d.ts +58 -0
- package/node_modules/ip-address/dist/v6/constants.js +128 -0
- package/node_modules/ip-address/dist/v6/constants.js.map +1 -0
- package/node_modules/ip-address/dist/v6/helpers.d.ts +18 -0
- package/node_modules/ip-address/dist/v6/helpers.js +54 -0
- package/node_modules/ip-address/dist/v6/helpers.js.map +1 -0
- package/node_modules/ip-address/dist/v6/regular-expressions.d.ts +5 -0
- package/node_modules/ip-address/dist/v6/regular-expressions.js +95 -0
- package/node_modules/ip-address/dist/v6/regular-expressions.js.map +1 -0
- package/node_modules/ip-address/package.json +90 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/mime-db/README.md +100 -0
- package/node_modules/mime-db/db.json +8519 -0
- package/node_modules/mime-db/index.js +12 -0
- package/node_modules/mime-db/package.json +60 -0
- package/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/mime-types/README.md +113 -0
- package/node_modules/mime-types/index.js +188 -0
- package/node_modules/mime-types/package.json +44 -0
- package/node_modules/proxy-from-env/LICENSE +20 -0
- package/node_modules/proxy-from-env/README.md +163 -0
- package/node_modules/proxy-from-env/index.cjs +105 -0
- package/node_modules/proxy-from-env/index.js +103 -0
- package/node_modules/proxy-from-env/package.json +43 -0
- package/node_modules/smart-buffer/.prettierrc.yaml +5 -0
- package/node_modules/smart-buffer/.travis.yml +13 -0
- package/node_modules/smart-buffer/LICENSE +20 -0
- package/node_modules/smart-buffer/README.md +633 -0
- package/node_modules/smart-buffer/build/smartbuffer.js +1233 -0
- package/node_modules/smart-buffer/build/smartbuffer.js.map +1 -0
- package/node_modules/smart-buffer/build/utils.js +108 -0
- package/node_modules/smart-buffer/build/utils.js.map +1 -0
- package/node_modules/smart-buffer/docs/CHANGELOG.md +70 -0
- package/node_modules/smart-buffer/docs/README_v3.md +367 -0
- package/node_modules/smart-buffer/docs/ROADMAP.md +0 -0
- package/node_modules/smart-buffer/package.json +79 -0
- package/node_modules/smart-buffer/typings/smartbuffer.d.ts +755 -0
- package/node_modules/smart-buffer/typings/utils.d.ts +66 -0
- package/node_modules/socks/.eslintrc.cjs +11 -0
- package/node_modules/socks/.prettierrc.yaml +7 -0
- package/node_modules/socks/LICENSE +20 -0
- package/node_modules/socks/README.md +686 -0
- package/node_modules/socks/build/client/socksclient.js +793 -0
- package/node_modules/socks/build/client/socksclient.js.map +1 -0
- package/node_modules/socks/build/common/constants.js +108 -0
- package/node_modules/socks/build/common/constants.js.map +1 -0
- package/node_modules/socks/build/common/helpers.js +167 -0
- package/node_modules/socks/build/common/helpers.js.map +1 -0
- package/node_modules/socks/build/common/receivebuffer.js +43 -0
- package/node_modules/socks/build/common/receivebuffer.js.map +1 -0
- package/node_modules/socks/build/common/util.js +25 -0
- package/node_modules/socks/build/common/util.js.map +1 -0
- package/node_modules/socks/build/index.js +18 -0
- package/node_modules/socks/build/index.js.map +1 -0
- package/node_modules/socks/docs/examples/index.md +17 -0
- package/node_modules/socks/docs/examples/javascript/associateExample.md +90 -0
- package/node_modules/socks/docs/examples/javascript/bindExample.md +83 -0
- package/node_modules/socks/docs/examples/javascript/connectExample.md +258 -0
- package/node_modules/socks/docs/examples/typescript/associateExample.md +93 -0
- package/node_modules/socks/docs/examples/typescript/bindExample.md +86 -0
- package/node_modules/socks/docs/examples/typescript/connectExample.md +265 -0
- package/node_modules/socks/docs/index.md +5 -0
- package/node_modules/socks/docs/migratingFromV1.md +86 -0
- package/node_modules/socks/package.json +58 -0
- package/node_modules/socks/typings/client/socksclient.d.ts +162 -0
- package/node_modules/socks/typings/common/constants.d.ts +151 -0
- package/node_modules/socks/typings/common/helpers.d.ts +17 -0
- package/node_modules/socks/typings/common/receivebuffer.d.ts +12 -0
- package/node_modules/socks/typings/common/util.d.ts +14 -0
- package/node_modules/socks/typings/index.d.ts +1 -0
- package/node_modules/socks-proxy-agent/LICENSE +22 -0
- package/node_modules/socks-proxy-agent/README.md +50 -0
- package/node_modules/socks-proxy-agent/dist/index.d.ts +27 -0
- package/node_modules/socks-proxy-agent/dist/index.d.ts.map +1 -0
- package/node_modules/socks-proxy-agent/dist/index.js +195 -0
- package/node_modules/socks-proxy-agent/dist/index.js.map +1 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/LICENSE +20 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/README.md +481 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/package.json +64 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/src/browser.js +272 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/src/common.js +292 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/src/index.js +10 -0
- package/node_modules/socks-proxy-agent/node_modules/debug/src/node.js +263 -0
- package/node_modules/socks-proxy-agent/node_modules/ms/index.js +162 -0
- package/node_modules/socks-proxy-agent/node_modules/ms/license.md +21 -0
- package/node_modules/socks-proxy-agent/node_modules/ms/package.json +38 -0
- package/node_modules/socks-proxy-agent/node_modules/ms/readme.md +59 -0
- package/node_modules/socks-proxy-agent/package.json +142 -0
- package/node_modules/undici/LICENSE +21 -0
- package/node_modules/undici/README.md +473 -0
- package/node_modules/undici/docs/docs/api/Agent.md +80 -0
- package/node_modules/undici/docs/docs/api/BalancedPool.md +99 -0
- package/node_modules/undici/docs/docs/api/CacheStorage.md +30 -0
- package/node_modules/undici/docs/docs/api/Client.md +277 -0
- package/node_modules/undici/docs/docs/api/Connector.md +115 -0
- package/node_modules/undici/docs/docs/api/ContentType.md +57 -0
- package/node_modules/undici/docs/docs/api/Cookies.md +101 -0
- package/node_modules/undici/docs/docs/api/Debug.md +62 -0
- package/node_modules/undici/docs/docs/api/DiagnosticsChannel.md +204 -0
- package/node_modules/undici/docs/docs/api/DispatchInterceptor.md +60 -0
- package/node_modules/undici/docs/docs/api/Dispatcher.md +1347 -0
- package/node_modules/undici/docs/docs/api/EnvHttpProxyAgent.md +162 -0
- package/node_modules/undici/docs/docs/api/Errors.md +49 -0
- package/node_modules/undici/docs/docs/api/EventSource.md +45 -0
- package/node_modules/undici/docs/docs/api/Fetch.md +52 -0
- package/node_modules/undici/docs/docs/api/MockAgent.md +540 -0
- package/node_modules/undici/docs/docs/api/MockClient.md +77 -0
- package/node_modules/undici/docs/docs/api/MockErrors.md +12 -0
- package/node_modules/undici/docs/docs/api/MockPool.md +547 -0
- package/node_modules/undici/docs/docs/api/Pool.md +84 -0
- package/node_modules/undici/docs/docs/api/PoolStats.md +35 -0
- package/node_modules/undici/docs/docs/api/ProxyAgent.md +131 -0
- package/node_modules/undici/docs/docs/api/RedirectHandler.md +96 -0
- package/node_modules/undici/docs/docs/api/RetryAgent.md +45 -0
- package/node_modules/undici/docs/docs/api/RetryHandler.md +117 -0
- package/node_modules/undici/docs/docs/api/Util.md +25 -0
- package/node_modules/undici/docs/docs/api/WebSocket.md +51 -0
- package/node_modules/undici/docs/docs/api/api-lifecycle.md +91 -0
- package/node_modules/undici/docs/docs/best-practices/client-certificate.md +64 -0
- package/node_modules/undici/docs/docs/best-practices/mocking-request.md +136 -0
- package/node_modules/undici/docs/docs/best-practices/proxy.md +127 -0
- package/node_modules/undici/docs/docs/best-practices/writing-tests.md +20 -0
- package/node_modules/undici/index-fetch.js +35 -0
- package/node_modules/undici/index.d.ts +3 -0
- package/node_modules/undici/index.js +169 -0
- package/node_modules/undici/lib/api/abort-signal.js +57 -0
- package/node_modules/undici/lib/api/api-connect.js +108 -0
- package/node_modules/undici/lib/api/api-pipeline.js +251 -0
- package/node_modules/undici/lib/api/api-request.js +214 -0
- package/node_modules/undici/lib/api/api-stream.js +220 -0
- package/node_modules/undici/lib/api/api-upgrade.js +108 -0
- package/node_modules/undici/lib/api/index.js +7 -0
- package/node_modules/undici/lib/api/readable.js +385 -0
- package/node_modules/undici/lib/api/util.js +93 -0
- package/node_modules/undici/lib/core/connect.js +240 -0
- package/node_modules/undici/lib/core/constants.js +118 -0
- package/node_modules/undici/lib/core/diagnostics.js +202 -0
- package/node_modules/undici/lib/core/errors.js +425 -0
- package/node_modules/undici/lib/core/request.js +416 -0
- package/node_modules/undici/lib/core/symbols.js +67 -0
- package/node_modules/undici/lib/core/tree.js +152 -0
- package/node_modules/undici/lib/core/util.js +719 -0
- package/node_modules/undici/lib/dispatcher/agent.js +129 -0
- package/node_modules/undici/lib/dispatcher/balanced-pool.js +209 -0
- package/node_modules/undici/lib/dispatcher/client-h1.js +1496 -0
- package/node_modules/undici/lib/dispatcher/client-h2.js +744 -0
- package/node_modules/undici/lib/dispatcher/client.js +623 -0
- package/node_modules/undici/lib/dispatcher/dispatcher-base.js +199 -0
- package/node_modules/undici/lib/dispatcher/dispatcher.js +65 -0
- package/node_modules/undici/lib/dispatcher/env-http-proxy-agent.js +160 -0
- package/node_modules/undici/lib/dispatcher/fixed-queue.js +117 -0
- package/node_modules/undici/lib/dispatcher/pool-base.js +194 -0
- package/node_modules/undici/lib/dispatcher/pool-stats.js +34 -0
- package/node_modules/undici/lib/dispatcher/pool.js +107 -0
- package/node_modules/undici/lib/dispatcher/proxy-agent.js +274 -0
- package/node_modules/undici/lib/dispatcher/retry-agent.js +35 -0
- package/node_modules/undici/lib/global.js +32 -0
- package/node_modules/undici/lib/handler/decorator-handler.js +44 -0
- package/node_modules/undici/lib/handler/redirect-handler.js +232 -0
- package/node_modules/undici/lib/handler/retry-handler.js +408 -0
- package/node_modules/undici/lib/interceptor/dns.js +375 -0
- package/node_modules/undici/lib/interceptor/dump.js +123 -0
- package/node_modules/undici/lib/interceptor/redirect-interceptor.js +21 -0
- package/node_modules/undici/lib/interceptor/redirect.js +24 -0
- package/node_modules/undici/lib/interceptor/response-error.js +86 -0
- package/node_modules/undici/lib/interceptor/retry.js +19 -0
- package/node_modules/undici/lib/llhttp/.gitkeep +0 -0
- package/node_modules/undici/lib/llhttp/constants.js +278 -0
- package/node_modules/undici/lib/llhttp/llhttp-wasm.js +5 -0
- package/node_modules/undici/lib/llhttp/llhttp_simd-wasm.js +5 -0
- package/node_modules/undici/lib/llhttp/utils.js +15 -0
- package/node_modules/undici/lib/mock/mock-agent.js +160 -0
- package/node_modules/undici/lib/mock/mock-client.js +59 -0
- package/node_modules/undici/lib/mock/mock-errors.js +28 -0
- package/node_modules/undici/lib/mock/mock-interceptor.js +207 -0
- package/node_modules/undici/lib/mock/mock-pool.js +59 -0
- package/node_modules/undici/lib/mock/mock-symbols.js +23 -0
- package/node_modules/undici/lib/mock/mock-utils.js +367 -0
- package/node_modules/undici/lib/mock/pending-interceptors-formatter.js +43 -0
- package/node_modules/undici/lib/mock/pluralizer.js +29 -0
- package/node_modules/undici/lib/util/timers.js +423 -0
- package/node_modules/undici/lib/web/cache/cache.js +859 -0
- package/node_modules/undici/lib/web/cache/cachestorage.js +152 -0
- package/node_modules/undici/lib/web/cache/symbols.js +5 -0
- package/node_modules/undici/lib/web/cache/util.js +45 -0
- package/node_modules/undici/lib/web/cookies/constants.js +12 -0
- package/node_modules/undici/lib/web/cookies/index.js +184 -0
- package/node_modules/undici/lib/web/cookies/parse.js +310 -0
- package/node_modules/undici/lib/web/cookies/util.js +352 -0
- package/node_modules/undici/lib/web/eventsource/eventsource-stream.js +398 -0
- package/node_modules/undici/lib/web/eventsource/eventsource.js +480 -0
- package/node_modules/undici/lib/web/eventsource/util.js +37 -0
- package/node_modules/undici/lib/web/fetch/LICENSE +21 -0
- package/node_modules/undici/lib/web/fetch/body.js +529 -0
- package/node_modules/undici/lib/web/fetch/constants.js +124 -0
- package/node_modules/undici/lib/web/fetch/data-url.js +744 -0
- package/node_modules/undici/lib/web/fetch/dispatcher-weakref.js +46 -0
- package/node_modules/undici/lib/web/fetch/file.js +126 -0
- package/node_modules/undici/lib/web/fetch/formdata-parser.js +474 -0
- package/node_modules/undici/lib/web/fetch/formdata.js +252 -0
- package/node_modules/undici/lib/web/fetch/global.js +40 -0
- package/node_modules/undici/lib/web/fetch/headers.js +687 -0
- package/node_modules/undici/lib/web/fetch/index.js +2272 -0
- package/node_modules/undici/lib/web/fetch/request.js +1037 -0
- package/node_modules/undici/lib/web/fetch/response.js +610 -0
- package/node_modules/undici/lib/web/fetch/symbols.js +9 -0
- package/node_modules/undici/lib/web/fetch/util.js +1632 -0
- package/node_modules/undici/lib/web/fetch/webidl.js +695 -0
- package/node_modules/undici/lib/web/fileapi/encoding.js +290 -0
- package/node_modules/undici/lib/web/fileapi/filereader.js +344 -0
- package/node_modules/undici/lib/web/fileapi/progressevent.js +78 -0
- package/node_modules/undici/lib/web/fileapi/symbols.js +10 -0
- package/node_modules/undici/lib/web/fileapi/util.js +391 -0
- package/node_modules/undici/lib/web/websocket/connection.js +371 -0
- package/node_modules/undici/lib/web/websocket/constants.js +66 -0
- package/node_modules/undici/lib/web/websocket/events.js +329 -0
- package/node_modules/undici/lib/web/websocket/frame.js +96 -0
- package/node_modules/undici/lib/web/websocket/permessage-deflate.js +100 -0
- package/node_modules/undici/lib/web/websocket/receiver.js +513 -0
- package/node_modules/undici/lib/web/websocket/sender.js +104 -0
- package/node_modules/undici/lib/web/websocket/symbols.js +12 -0
- package/node_modules/undici/lib/web/websocket/util.js +322 -0
- package/node_modules/undici/lib/web/websocket/websocket.js +595 -0
- package/node_modules/undici/package.json +160 -0
- package/node_modules/undici/scripts/strip-comments.js +8 -0
- package/node_modules/undici/types/README.md +6 -0
- package/node_modules/undici/types/agent.d.ts +31 -0
- package/node_modules/undici/types/api.d.ts +43 -0
- package/node_modules/undici/types/balanced-pool.d.ts +29 -0
- package/node_modules/undici/types/cache.d.ts +36 -0
- package/node_modules/undici/types/client.d.ts +125 -0
- package/node_modules/undici/types/connector.d.ts +34 -0
- package/node_modules/undici/types/content-type.d.ts +21 -0
- package/node_modules/undici/types/cookies.d.ts +28 -0
- package/node_modules/undici/types/diagnostics-channel.d.ts +66 -0
- package/node_modules/undici/types/dispatcher.d.ts +256 -0
- package/node_modules/undici/types/env-http-proxy-agent.d.ts +21 -0
- package/node_modules/undici/types/errors.d.ts +155 -0
- package/node_modules/undici/types/eventsource.d.ts +61 -0
- package/node_modules/undici/types/fetch.d.ts +209 -0
- package/node_modules/undici/types/file.d.ts +39 -0
- package/node_modules/undici/types/filereader.d.ts +54 -0
- package/node_modules/undici/types/formdata.d.ts +108 -0
- package/node_modules/undici/types/global-dispatcher.d.ts +9 -0
- package/node_modules/undici/types/global-origin.d.ts +7 -0
- package/node_modules/undici/types/handlers.d.ts +15 -0
- package/node_modules/undici/types/header.d.ts +4 -0
- package/node_modules/undici/types/index.d.ts +71 -0
- package/node_modules/undici/types/interceptors.d.ts +32 -0
- package/node_modules/undici/types/mock-agent.d.ts +50 -0
- package/node_modules/undici/types/mock-client.d.ts +25 -0
- package/node_modules/undici/types/mock-errors.d.ts +12 -0
- package/node_modules/undici/types/mock-interceptor.d.ts +93 -0
- package/node_modules/undici/types/mock-pool.d.ts +25 -0
- package/node_modules/undici/types/patch.d.ts +33 -0
- package/node_modules/undici/types/pool-stats.d.ts +19 -0
- package/node_modules/undici/types/pool.d.ts +39 -0
- package/node_modules/undici/types/proxy-agent.d.ts +29 -0
- package/node_modules/undici/types/readable.d.ts +65 -0
- package/node_modules/undici/types/retry-agent.d.ts +8 -0
- package/node_modules/undici/types/retry-handler.d.ts +116 -0
- package/node_modules/undici/types/util.d.ts +18 -0
- package/node_modules/undici/types/webidl.d.ts +228 -0
- package/node_modules/undici/types/websocket.d.ts +150 -0
- package/package.json +14 -4
- package/dist/pixiv/IPixivRequestHandler.d.ts +0 -26
- package/dist/pixiv/IPixivRequestHandler.d.ts.map +0 -1
- package/dist/pixiv/IPixivRequestHandler.js.map +0 -1
- package/dist/pixiv/RateLimitCoordinator.d.ts +0 -30
- package/dist/pixiv/RateLimitCoordinator.d.ts.map +0 -1
- package/dist/pixiv/RateLimitCoordinator.js +0 -66
- package/dist/pixiv/RateLimitCoordinator.js.map +0 -1
- package/dist/pixiv/client/IllustService.d.ts +0 -24
- package/dist/pixiv/client/IllustService.d.ts.map +0 -1
- package/dist/pixiv/client/IllustService.js +0 -70
- package/dist/pixiv/client/IllustService.js.map +0 -1
- package/dist/pixiv/client/MediaDownloadService.d.ts +0 -11
- package/dist/pixiv/client/MediaDownloadService.d.ts.map +0 -1
- package/dist/pixiv/client/MediaDownloadService.js +0 -22
- package/dist/pixiv/client/MediaDownloadService.js.map +0 -1
- package/dist/pixiv/client/NovelService.d.ts +0 -30
- package/dist/pixiv/client/NovelService.d.ts.map +0 -1
- package/dist/pixiv/client/NovelService.js +0 -203
- package/dist/pixiv/client/NovelService.js.map +0 -1
- package/dist/pixiv/client/PixivApiCore.d.ts +0 -52
- package/dist/pixiv/client/PixivApiCore.d.ts.map +0 -1
- package/dist/pixiv/client/PixivApiCore.js +0 -412
- package/dist/pixiv/client/PixivApiCore.js.map +0 -1
- package/dist/pixiv/client/SearchService.d.ts +0 -21
- package/dist/pixiv/client/SearchService.d.ts.map +0 -1
- package/dist/pixiv/client/SearchService.js +0 -207
- package/dist/pixiv/client/SearchService.js.map +0 -1
- package/dist/pixiv/client/search/SearchFilters.d.ts +0 -31
- package/dist/pixiv/client/search/SearchFilters.d.ts.map +0 -1
- package/dist/pixiv/client/search/SearchFilters.js +0 -102
- package/dist/pixiv/client/search/SearchFilters.js.map +0 -1
- package/dist/pixiv/types.d.ts +0 -72
- package/dist/pixiv/types.d.ts.map +0 -1
|
@@ -1,412 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.PixivApiCore = void 0;
|
|
7
|
-
const node_url_1 = require("node:url");
|
|
8
|
-
const promises_1 = require("node:timers/promises");
|
|
9
|
-
const undici_1 = require("undici");
|
|
10
|
-
const socks_proxy_agent_1 = require("socks-proxy-agent");
|
|
11
|
-
const axios_1 = __importDefault(require("axios"));
|
|
12
|
-
const logger_1 = require("../../logger");
|
|
13
|
-
const errors_1 = require("../../utils/errors");
|
|
14
|
-
class PixivApiCore {
|
|
15
|
-
baseUrl;
|
|
16
|
-
userAgent;
|
|
17
|
-
defaultTimeoutMs;
|
|
18
|
-
maxRetries;
|
|
19
|
-
rateLimitPerSecond;
|
|
20
|
-
proxyUrl;
|
|
21
|
-
getAccessToken;
|
|
22
|
-
proxyAgent;
|
|
23
|
-
socksAgent;
|
|
24
|
-
useAxiosForProxy;
|
|
25
|
-
axiosInstance;
|
|
26
|
-
rateLimiter;
|
|
27
|
-
constructor(options = {}) {
|
|
28
|
-
this.baseUrl = options.baseUrl ?? 'https://app-api.pixiv.net';
|
|
29
|
-
this.userAgent = options.userAgent;
|
|
30
|
-
this.defaultTimeoutMs = options.defaultTimeoutMs ?? 30_000;
|
|
31
|
-
this.maxRetries = options.maxRetries ?? 2;
|
|
32
|
-
this.rateLimitPerSecond = options.rateLimitPerSecond;
|
|
33
|
-
this.proxyUrl = options.proxyUrl ? new node_url_1.URL(options.proxyUrl) : undefined;
|
|
34
|
-
this.getAccessToken = options.getAccessToken;
|
|
35
|
-
this.rateLimiter = options.rateLimiter;
|
|
36
|
-
// Determine if we need to use axios for SOCKS proxy
|
|
37
|
-
let useAxios = false;
|
|
38
|
-
if (this.proxyUrl) {
|
|
39
|
-
const protocol = this.proxyUrl.protocol.replace(':', '').toLowerCase();
|
|
40
|
-
// Check if it's a SOCKS protocol
|
|
41
|
-
if (protocol === 'socks4' || protocol === 'socks5' || protocol === 'socks') {
|
|
42
|
-
// Use socks-proxy-agent for SOCKS protocols
|
|
43
|
-
this.socksAgent = new socks_proxy_agent_1.SocksProxyAgent(this.proxyUrl.toString());
|
|
44
|
-
useAxios = true;
|
|
45
|
-
logger_1.logger.info('SOCKS proxy enabled', {
|
|
46
|
-
protocol,
|
|
47
|
-
host: this.proxyUrl.hostname,
|
|
48
|
-
port: this.proxyUrl.port,
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
else if (protocol === 'http' || protocol === 'https') {
|
|
52
|
-
// Use undici ProxyAgent for HTTP/HTTPS protocols
|
|
53
|
-
this.proxyAgent = new undici_1.ProxyAgent(this.proxyUrl.toString());
|
|
54
|
-
logger_1.logger.info('HTTP/HTTPS proxy enabled', {
|
|
55
|
-
protocol,
|
|
56
|
-
host: this.proxyUrl.hostname,
|
|
57
|
-
port: this.proxyUrl.port,
|
|
58
|
-
});
|
|
59
|
-
}
|
|
60
|
-
else {
|
|
61
|
-
logger_1.logger.warn('Unknown proxy protocol, attempting to use with undici ProxyAgent', {
|
|
62
|
-
protocol,
|
|
63
|
-
proxyUrl: this.proxyUrl.toString(),
|
|
64
|
-
});
|
|
65
|
-
try {
|
|
66
|
-
this.proxyAgent = new undici_1.ProxyAgent(this.proxyUrl.toString());
|
|
67
|
-
}
|
|
68
|
-
catch (error) {
|
|
69
|
-
const errorMessage = `Failed to create ProxyAgent with protocol '${protocol}'. ` +
|
|
70
|
-
`Supported protocols: 'http', 'https', 'socks4', 'socks5'.`;
|
|
71
|
-
logger_1.logger.error(errorMessage, {
|
|
72
|
-
protocol,
|
|
73
|
-
proxyUrl: this.proxyUrl.toString(),
|
|
74
|
-
error: error instanceof Error ? error.message : String(error),
|
|
75
|
-
});
|
|
76
|
-
throw new Error(errorMessage);
|
|
77
|
-
}
|
|
78
|
-
}
|
|
79
|
-
}
|
|
80
|
-
this.useAxiosForProxy = useAxios;
|
|
81
|
-
// Create axios instance for SOCKS proxy support
|
|
82
|
-
if (useAxios && this.socksAgent) {
|
|
83
|
-
this.axiosInstance = axios_1.default.create({
|
|
84
|
-
httpAgent: this.socksAgent,
|
|
85
|
-
httpsAgent: this.socksAgent,
|
|
86
|
-
timeout: this.defaultTimeoutMs,
|
|
87
|
-
});
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
// Minimal request method signature; implementation will be added during wiring.
|
|
91
|
-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
92
|
-
async request(path, init) {
|
|
93
|
-
const url = this.resolveUrl(path);
|
|
94
|
-
let lastError;
|
|
95
|
-
// maxRetries is the number of retries, so total attempts = maxRetries + 1 (initial attempt)
|
|
96
|
-
const maxAttempts = Math.max(1, this.maxRetries + 1);
|
|
97
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
98
|
-
try {
|
|
99
|
-
const controller = new AbortController();
|
|
100
|
-
const timeout = setTimeout(() => controller.abort(), this.defaultTimeoutMs);
|
|
101
|
-
try {
|
|
102
|
-
const headers = {
|
|
103
|
-
...(this.userAgent ? { 'User-Agent': this.userAgent } : {}),
|
|
104
|
-
Referer: 'https://app-api.pixiv.net/',
|
|
105
|
-
...init?.headers,
|
|
106
|
-
};
|
|
107
|
-
// Authorization header
|
|
108
|
-
// skipAuth: web endpoints (www.pixiv.net/ajax/*) reject the App
|
|
109
|
-
// Bearer token, so callers may opt out for those requests.
|
|
110
|
-
if (this.getAccessToken && !init?.skipAuth) {
|
|
111
|
-
const token = await Promise.resolve(this.getAccessToken());
|
|
112
|
-
if (token) {
|
|
113
|
-
headers.Authorization = `Bearer ${token}`;
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
// Shared global rate-limit gate (429 cooldown + pacing).
|
|
117
|
-
if (this.rateLimiter) {
|
|
118
|
-
await this.rateLimiter.acquire(controller.signal);
|
|
119
|
-
}
|
|
120
|
-
else {
|
|
121
|
-
const waitMs = this.calculateRateLimitWaitTime();
|
|
122
|
-
if (waitMs > 0)
|
|
123
|
-
await (0, promises_1.setTimeout)(waitMs);
|
|
124
|
-
}
|
|
125
|
-
let res;
|
|
126
|
-
if (this.useAxiosForProxy && this.axiosInstance) {
|
|
127
|
-
// Use axios for SOCKS proxy
|
|
128
|
-
const axiosResponse = await this.axiosInstance.request({
|
|
129
|
-
url,
|
|
130
|
-
method: init?.method || 'GET',
|
|
131
|
-
headers,
|
|
132
|
-
data: init?.body,
|
|
133
|
-
signal: controller.signal,
|
|
134
|
-
responseType: 'json',
|
|
135
|
-
});
|
|
136
|
-
// Convert axios response to fetch-like Response
|
|
137
|
-
res = new Response(JSON.stringify(axiosResponse.data), {
|
|
138
|
-
status: axiosResponse.status,
|
|
139
|
-
statusText: axiosResponse.statusText,
|
|
140
|
-
headers: axiosResponse.headers,
|
|
141
|
-
});
|
|
142
|
-
}
|
|
143
|
-
else {
|
|
144
|
-
// Use undici fetch for HTTP/HTTPS proxy or no proxy
|
|
145
|
-
const fetchOptions = {
|
|
146
|
-
...init,
|
|
147
|
-
headers,
|
|
148
|
-
signal: controller.signal,
|
|
149
|
-
};
|
|
150
|
-
if (this.proxyAgent) {
|
|
151
|
-
fetchOptions.dispatcher = this.proxyAgent;
|
|
152
|
-
}
|
|
153
|
-
res = await fetch(url, fetchOptions);
|
|
154
|
-
}
|
|
155
|
-
return await this.processResponse(res, url, attempt, init?.responseType);
|
|
156
|
-
}
|
|
157
|
-
finally {
|
|
158
|
-
clearTimeout(timeout);
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
catch (error) {
|
|
162
|
-
lastError = error;
|
|
163
|
-
// Do not retry 404
|
|
164
|
-
if ((0, errors_1.is404Error)(error)) {
|
|
165
|
-
throw error;
|
|
166
|
-
}
|
|
167
|
-
// If last attempt, throw
|
|
168
|
-
if (attempt >= maxAttempts - 1) {
|
|
169
|
-
throw error;
|
|
170
|
-
}
|
|
171
|
-
const wait = this.backoffWaitMs(error, attempt);
|
|
172
|
-
// Extract detailed error information
|
|
173
|
-
const errorInfo = {
|
|
174
|
-
url,
|
|
175
|
-
attempt: attempt + 1,
|
|
176
|
-
maxAttempts,
|
|
177
|
-
waitSec: Math.round(wait / 1000),
|
|
178
|
-
};
|
|
179
|
-
if (error instanceof Error) {
|
|
180
|
-
errorInfo.error = error.message;
|
|
181
|
-
errorInfo.errorType = error.name;
|
|
182
|
-
errorInfo.errorCode = error.code;
|
|
183
|
-
// Include cause if available
|
|
184
|
-
if (error.cause instanceof Error) {
|
|
185
|
-
errorInfo.cause = error.cause.message;
|
|
186
|
-
errorInfo.causeType = error.cause.name;
|
|
187
|
-
errorInfo.causeCode = error.cause.code;
|
|
188
|
-
}
|
|
189
|
-
// For AbortError (timeout), add timeout info
|
|
190
|
-
if (error.name === 'AbortError') {
|
|
191
|
-
errorInfo.reason = 'Request timeout';
|
|
192
|
-
errorInfo.timeoutMs = this.defaultTimeoutMs;
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
else {
|
|
196
|
-
errorInfo.error = String(error);
|
|
197
|
-
}
|
|
198
|
-
logger_1.logger.warn('PixivApiCore request failed, will retry', errorInfo);
|
|
199
|
-
await (0, promises_1.setTimeout)(wait);
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
// Should not reach here
|
|
203
|
-
const message = lastError instanceof Error ? lastError.message : String(lastError);
|
|
204
|
-
throw new errors_1.NetworkError(`Request to ${url} failed: ${message}`, url, lastError instanceof Error ? lastError : undefined);
|
|
205
|
-
}
|
|
206
|
-
async downloadBinary(pathOrUrl, init) {
|
|
207
|
-
const url = this.resolveUrl(pathOrUrl);
|
|
208
|
-
let lastError;
|
|
209
|
-
// Large binaries (e.g. ugoira zips) may need longer than the API default
|
|
210
|
-
const attemptTimeoutMs = init?.timeoutMs ?? this.defaultTimeoutMs;
|
|
211
|
-
// maxRetries is the number of retries, so total attempts = maxRetries + 1 (initial attempt)
|
|
212
|
-
const maxAttempts = Math.max(1, this.maxRetries + 1);
|
|
213
|
-
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
214
|
-
try {
|
|
215
|
-
const controller = new AbortController();
|
|
216
|
-
const timeout = setTimeout(() => controller.abort(), attemptTimeoutMs);
|
|
217
|
-
try {
|
|
218
|
-
const headers = {
|
|
219
|
-
...(this.userAgent ? { 'User-Agent': this.userAgent } : {}),
|
|
220
|
-
Referer: 'https://app-api.pixiv.net/',
|
|
221
|
-
...init?.headers,
|
|
222
|
-
};
|
|
223
|
-
if (this.getAccessToken) {
|
|
224
|
-
const token = await Promise.resolve(this.getAccessToken());
|
|
225
|
-
if (token) {
|
|
226
|
-
headers.Authorization = `Bearer ${token}`;
|
|
227
|
-
}
|
|
228
|
-
}
|
|
229
|
-
if (this.rateLimiter) {
|
|
230
|
-
await this.rateLimiter.acquire(controller.signal);
|
|
231
|
-
}
|
|
232
|
-
else {
|
|
233
|
-
const waitMs = this.calculateRateLimitWaitTime();
|
|
234
|
-
if (waitMs > 0)
|
|
235
|
-
await (0, promises_1.setTimeout)(waitMs);
|
|
236
|
-
}
|
|
237
|
-
if (this.useAxiosForProxy && this.axiosInstance) {
|
|
238
|
-
// Use axios for SOCKS proxy
|
|
239
|
-
const axiosResponse = await this.axiosInstance.request({
|
|
240
|
-
url,
|
|
241
|
-
method: init?.method || 'GET',
|
|
242
|
-
headers,
|
|
243
|
-
data: init?.body,
|
|
244
|
-
signal: controller.signal,
|
|
245
|
-
responseType: 'arraybuffer',
|
|
246
|
-
});
|
|
247
|
-
if (axiosResponse.status < 200 || axiosResponse.status >= 300) {
|
|
248
|
-
const body = typeof axiosResponse.data === 'string'
|
|
249
|
-
? axiosResponse.data
|
|
250
|
-
: Buffer.from(axiosResponse.data).toString('utf-8');
|
|
251
|
-
throw new errors_1.NetworkError(`Pixiv API binary error: ${axiosResponse.status} ${axiosResponse.statusText}${body ? ` - ${body}` : ''}`, url);
|
|
252
|
-
}
|
|
253
|
-
return axiosResponse.data;
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
// Use undici fetch for HTTP/HTTPS proxy or no proxy
|
|
257
|
-
const fetchOptions = {
|
|
258
|
-
method: 'GET',
|
|
259
|
-
...init,
|
|
260
|
-
headers,
|
|
261
|
-
signal: controller.signal,
|
|
262
|
-
};
|
|
263
|
-
if (this.proxyAgent) {
|
|
264
|
-
fetchOptions.dispatcher = this.proxyAgent;
|
|
265
|
-
}
|
|
266
|
-
const res = await fetch(url, fetchOptions);
|
|
267
|
-
if (!res.ok) {
|
|
268
|
-
const body = await this.tryReadText(res);
|
|
269
|
-
throw new errors_1.NetworkError(`Pixiv API binary error: ${res.status} ${res.statusText}${body ? ` - ${body}` : ''}`, url);
|
|
270
|
-
}
|
|
271
|
-
return await res.arrayBuffer();
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
finally {
|
|
275
|
-
clearTimeout(timeout);
|
|
276
|
-
}
|
|
277
|
-
}
|
|
278
|
-
catch (error) {
|
|
279
|
-
lastError = error;
|
|
280
|
-
if ((0, errors_1.is404Error)(error)) {
|
|
281
|
-
throw error;
|
|
282
|
-
}
|
|
283
|
-
if (attempt >= maxAttempts - 1) {
|
|
284
|
-
throw error;
|
|
285
|
-
}
|
|
286
|
-
const wait = this.backoffWaitMs(error, attempt);
|
|
287
|
-
// Extract detailed error information
|
|
288
|
-
const errorInfo = {
|
|
289
|
-
url,
|
|
290
|
-
attempt: attempt + 1,
|
|
291
|
-
maxAttempts,
|
|
292
|
-
waitSec: Math.round(wait / 1000),
|
|
293
|
-
};
|
|
294
|
-
if (error instanceof Error) {
|
|
295
|
-
errorInfo.error = error.message;
|
|
296
|
-
errorInfo.errorType = error.name;
|
|
297
|
-
errorInfo.errorCode = error.code;
|
|
298
|
-
// Include cause if available
|
|
299
|
-
if (error.cause instanceof Error) {
|
|
300
|
-
errorInfo.cause = error.cause.message;
|
|
301
|
-
errorInfo.causeType = error.cause.name;
|
|
302
|
-
errorInfo.causeCode = error.cause.code;
|
|
303
|
-
}
|
|
304
|
-
// For AbortError (timeout), add timeout info
|
|
305
|
-
if (error.name === 'AbortError') {
|
|
306
|
-
errorInfo.reason = 'Request timeout';
|
|
307
|
-
errorInfo.timeoutMs = this.defaultTimeoutMs;
|
|
308
|
-
}
|
|
309
|
-
}
|
|
310
|
-
else {
|
|
311
|
-
errorInfo.error = String(error);
|
|
312
|
-
}
|
|
313
|
-
logger_1.logger.warn('PixivApiCore binary download failed, will retry', errorInfo);
|
|
314
|
-
await (0, promises_1.setTimeout)(wait);
|
|
315
|
-
}
|
|
316
|
-
}
|
|
317
|
-
// Provide detailed error message for final failure
|
|
318
|
-
let errorMessage = `Binary download from ${url} failed after ${maxAttempts} attempts`;
|
|
319
|
-
if (lastError instanceof Error) {
|
|
320
|
-
errorMessage += `: ${lastError.message}`;
|
|
321
|
-
if (lastError.name === 'AbortError') {
|
|
322
|
-
errorMessage += ` (timeout after ${this.defaultTimeoutMs}ms)`;
|
|
323
|
-
}
|
|
324
|
-
const errorCode = lastError.code;
|
|
325
|
-
if (errorCode) {
|
|
326
|
-
errorMessage += ` [${errorCode}]`;
|
|
327
|
-
}
|
|
328
|
-
}
|
|
329
|
-
else {
|
|
330
|
-
errorMessage += `: ${String(lastError)}`;
|
|
331
|
-
}
|
|
332
|
-
throw new errors_1.NetworkError(errorMessage, url, lastError instanceof Error ? lastError : undefined);
|
|
333
|
-
}
|
|
334
|
-
calculateRateLimitWaitTime() {
|
|
335
|
-
if (!this.rateLimitPerSecond || this.rateLimitPerSecond <= 0)
|
|
336
|
-
return 0;
|
|
337
|
-
return Math.ceil(1000 / this.rateLimitPerSecond);
|
|
338
|
-
}
|
|
339
|
-
async processResponse(response, url, attempt, responseType) {
|
|
340
|
-
// 401: likely token issue
|
|
341
|
-
if (response.status === 401) {
|
|
342
|
-
const body = await this.tryReadText(response);
|
|
343
|
-
throw new errors_1.NetworkError(`Pixiv API error: 401 Unauthorized${body ? ` - ${body}` : ''}`, url);
|
|
344
|
-
}
|
|
345
|
-
// 404: not found, do not retry
|
|
346
|
-
if (response.status === 404) {
|
|
347
|
-
const body = await this.tryReadText(response);
|
|
348
|
-
throw new errors_1.NetworkError(`Pixiv API error: 404 Not Found${body ? ` - ${body}` : ''}`, url);
|
|
349
|
-
}
|
|
350
|
-
// 429: rate limited
|
|
351
|
-
if (response.status === 429) {
|
|
352
|
-
const body = await this.tryReadText(response);
|
|
353
|
-
const retryAfter = response.headers.get('Retry-After');
|
|
354
|
-
const waitMs = this.rateLimiter
|
|
355
|
-
? this.rateLimiter.reportRateLimited(retryAfter)
|
|
356
|
-
: this.parseRetryAfterHeader(retryAfter) ?? this.exponentialBackoffMs(attempt);
|
|
357
|
-
throw new errors_1.NetworkError(`Pixiv API error: 429 Rate Limit${body ? ` - ${body.slice(0, 120)}` : ''}`, url, undefined, { isRateLimit: true, waitTime: waitMs });
|
|
358
|
-
}
|
|
359
|
-
if (!response.ok) {
|
|
360
|
-
const body = await this.tryReadText(response);
|
|
361
|
-
throw new errors_1.NetworkError(`Pixiv API error: ${response.status} ${response.statusText}${body ? ` - ${body}` : ''}`, url);
|
|
362
|
-
}
|
|
363
|
-
this.rateLimiter?.reportSuccess();
|
|
364
|
-
if (responseType === 'text') {
|
|
365
|
-
return (await response.text());
|
|
366
|
-
}
|
|
367
|
-
return (await response.json());
|
|
368
|
-
}
|
|
369
|
-
parseRetryAfterHeader(value) {
|
|
370
|
-
if (!value)
|
|
371
|
-
return undefined;
|
|
372
|
-
const seconds = Number(value);
|
|
373
|
-
if (Number.isFinite(seconds))
|
|
374
|
-
return seconds * 1000;
|
|
375
|
-
const date = Date.parse(value);
|
|
376
|
-
return Number.isFinite(date) ? Math.max(0, date - Date.now()) : undefined;
|
|
377
|
-
}
|
|
378
|
-
resolveUrl(pathOrUrl) {
|
|
379
|
-
try {
|
|
380
|
-
// If it's already an absolute URL, return as is
|
|
381
|
-
const maybeUrl = new node_url_1.URL(pathOrUrl);
|
|
382
|
-
return maybeUrl.toString();
|
|
383
|
-
}
|
|
384
|
-
catch {
|
|
385
|
-
// Not a full URL, resolve against base
|
|
386
|
-
const withLeadingSlash = pathOrUrl.startsWith('/') ? pathOrUrl : `/${pathOrUrl}`;
|
|
387
|
-
return new node_url_1.URL(withLeadingSlash, this.baseUrl).toString();
|
|
388
|
-
}
|
|
389
|
-
}
|
|
390
|
-
exponentialBackoffMs(attempt) {
|
|
391
|
-
// 1s, 2s, 4s, 8s ... capped at 10 minutes
|
|
392
|
-
return Math.min(1000 * Math.pow(2, attempt), 600_000);
|
|
393
|
-
}
|
|
394
|
-
backoffWaitMs(error, attempt) {
|
|
395
|
-
const isRateLimit = error instanceof errors_1.NetworkError && error.isRateLimit === true;
|
|
396
|
-
if (isRateLimit) {
|
|
397
|
-
const wait = error.waitTime ?? this.exponentialBackoffMs(attempt);
|
|
398
|
-
return wait;
|
|
399
|
-
}
|
|
400
|
-
return Math.min(1000 * (attempt + 1), 5000);
|
|
401
|
-
}
|
|
402
|
-
async tryReadText(response) {
|
|
403
|
-
try {
|
|
404
|
-
return await response.text();
|
|
405
|
-
}
|
|
406
|
-
catch {
|
|
407
|
-
return '';
|
|
408
|
-
}
|
|
409
|
-
}
|
|
410
|
-
}
|
|
411
|
-
exports.PixivApiCore = PixivApiCore;
|
|
412
|
-
//# sourceMappingURL=PixivApiCore.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"PixivApiCore.js","sourceRoot":"","sources":["../../../src/pixiv/client/PixivApiCore.ts"],"names":[],"mappings":";;;;;;AAAA,uCAA+B;AAC/B,mDAA2D;AAC3D,mCAAoC;AACpC,yDAAoD;AACpD,kDAA6C;AAC7C,yCAAsC;AACtC,+CAA8D;AA0B9D,MAAa,YAAY;IACN,OAAO,CAAS;IAChB,SAAS,CAAqB;IAC9B,gBAAgB,CAAS;IACzB,UAAU,CAAS;IACnB,kBAAkB,CAAqB;IACvC,QAAQ,CAAkB;IAC1B,cAAc,CAAkC;IAChD,UAAU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AC9C,CAAC;IAEO,KAAK,CAAC,WAAW,CAAC,QAAkB;QAC1C,IAAI,CAAC;YACH,OAAO,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;QAC/B,CAAC;QAAC,MAAM,CAAC;YACP,OAAO,EAAE,CAAC;QACZ,CAAC;IACH,CAAC;CACF;AApbD,oCAobC"}
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { PixivApiCore } from './PixivApiCore';
|
|
2
|
-
import type { PixivIllust, PixivNovel, PixivTag } from '../types';
|
|
3
|
-
import type { TargetConfig } from '../../config';
|
|
4
|
-
/**
|
|
5
|
-
* Search service for illustrations and novels with pagination, filtering and sorting.
|
|
6
|
-
* Depends on PixivApiCore for HTTP concerns.
|
|
7
|
-
*/
|
|
8
|
-
export declare class SearchService {
|
|
9
|
-
private readonly api;
|
|
10
|
-
constructor(api: PixivApiCore);
|
|
11
|
-
getTagAutocomplete(seed: string): Promise<PixivTag[]>;
|
|
12
|
-
searchIllustrations(target: TargetConfig, requestDelayMs: number): Promise<PixivIllust[]>;
|
|
13
|
-
searchNovels(target: TargetConfig, requestDelayMs: number): Promise<PixivNovel[]>;
|
|
14
|
-
private searchIllustrationsSingleTag;
|
|
15
|
-
private searchNovelsSingleTag;
|
|
16
|
-
/**
|
|
17
|
-
* Generic pagination search method that works for both illustrations and novels.
|
|
18
|
-
*/
|
|
19
|
-
private searchWithPagination;
|
|
20
|
-
}
|
|
21
|
-
//# sourceMappingURL=SearchService.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"SearchService.d.ts","sourceRoot":"","sources":["../../../src/pixiv/client/SearchService.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,KAAK,EAAE,WAAW,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,UAAU,CAAC;AAGlE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD;;;GAGG;AACH,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,GAAG;gBAAH,GAAG,EAAE,YAAY;IAExC,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,QAAQ,EAAE,CAAC;IAcrD,mBAAmB,CAAC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,WAAW,EAAE,CAAC;IA6CzF,YAAY,CAAC,MAAM,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,GAAG,OAAO,CAAC,UAAU,EAAE,CAAC;YA6CzE,4BAA4B;YA+C5B,qBAAqB;IA2CnC;;OAEG;YACW,oBAAoB;CAsEnC"}
|
|
@@ -1,207 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.SearchService = void 0;
|
|
4
|
-
const promises_1 = require("node:timers/promises");
|
|
5
|
-
const logger_1 = require("../../logger");
|
|
6
|
-
const pixiv_sort_1 = require("../../utils/pixiv-sort");
|
|
7
|
-
const SearchFilters_1 = require("./search/SearchFilters");
|
|
8
|
-
/**
|
|
9
|
-
* Search service for illustrations and novels with pagination, filtering and sorting.
|
|
10
|
-
* Depends on PixivApiCore for HTTP concerns.
|
|
11
|
-
*/
|
|
12
|
-
class SearchService {
|
|
13
|
-
api;
|
|
14
|
-
constructor(api) {
|
|
15
|
-
this.api = api;
|
|
16
|
-
}
|
|
17
|
-
async getTagAutocomplete(seed) {
|
|
18
|
-
const params = new URLSearchParams({
|
|
19
|
-
word: seed,
|
|
20
|
-
merge_plain_keyword_results: 'true',
|
|
21
|
-
});
|
|
22
|
-
const response = await this.api.request(`/v2/search/autocomplete?${params.toString()}`, { method: 'GET' });
|
|
23
|
-
if (Array.isArray(response.tags))
|
|
24
|
-
return response.tags;
|
|
25
|
-
return (response.search_auto_complete_keywords ?? []).map((name) => ({ name }));
|
|
26
|
-
}
|
|
27
|
-
async searchIllustrations(target, requestDelayMs) {
|
|
28
|
-
if (!target.tag) {
|
|
29
|
-
throw new Error('tag is required for illustration search');
|
|
30
|
-
}
|
|
31
|
-
// Support tagRelation === 'or': split space-separated tags, query sequentially, merge & dedupe
|
|
32
|
-
if (target.tagRelation === 'or') {
|
|
33
|
-
const tags = target.tag.split(/\s+/).map((t) => t.trim()).filter(Boolean);
|
|
34
|
-
if (tags.length <= 1) {
|
|
35
|
-
return this.searchIllustrationsSingleTag(target, target.tag, requestDelayMs);
|
|
36
|
-
}
|
|
37
|
-
const seen = new Set();
|
|
38
|
-
const merged = [];
|
|
39
|
-
for (let i = 0; i < tags.length; i++) {
|
|
40
|
-
const tag = tags[i];
|
|
41
|
-
const part = await this.searchIllustrationsSingleTag(target, tag, requestDelayMs);
|
|
42
|
-
for (const item of part) {
|
|
43
|
-
const key = String(item.id);
|
|
44
|
-
if (!seen.has(key)) {
|
|
45
|
-
seen.add(key);
|
|
46
|
-
merged.push(item);
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
// Respect global limit early if possible
|
|
50
|
-
if (target.limit && merged.length >= target.limit) {
|
|
51
|
-
break;
|
|
52
|
-
}
|
|
53
|
-
// Add delay between tag requests to reduce rate limiting
|
|
54
|
-
if (i < tags.length - 1 && requestDelayMs > 0) {
|
|
55
|
-
await (0, promises_1.setTimeout)(requestDelayMs);
|
|
56
|
-
}
|
|
57
|
-
}
|
|
58
|
-
const sorted = (0, pixiv_sort_1.sortPixivItems)(merged, target.sort);
|
|
59
|
-
if (target.limit && sorted.length > target.limit) {
|
|
60
|
-
return sorted.slice(0, target.limit);
|
|
61
|
-
}
|
|
62
|
-
return sorted;
|
|
63
|
-
}
|
|
64
|
-
return this.searchIllustrationsSingleTag(target, target.tag, requestDelayMs);
|
|
65
|
-
}
|
|
66
|
-
async searchNovels(target, requestDelayMs) {
|
|
67
|
-
if (!target.tag) {
|
|
68
|
-
throw new Error('tag is required for novel search');
|
|
69
|
-
}
|
|
70
|
-
// Support tagRelation === 'or': split space-separated tags, query sequentially, merge & dedupe
|
|
71
|
-
if (target.tagRelation === 'or') {
|
|
72
|
-
const tags = target.tag.split(/\s+/).map((t) => t.trim()).filter(Boolean);
|
|
73
|
-
if (tags.length <= 1) {
|
|
74
|
-
return this.searchNovelsSingleTag(target, target.tag, requestDelayMs);
|
|
75
|
-
}
|
|
76
|
-
const seen = new Set();
|
|
77
|
-
const merged = [];
|
|
78
|
-
for (let i = 0; i < tags.length; i++) {
|
|
79
|
-
const tag = tags[i];
|
|
80
|
-
const part = await this.searchNovelsSingleTag(target, tag, requestDelayMs);
|
|
81
|
-
for (const item of part) {
|
|
82
|
-
const key = String(item.id);
|
|
83
|
-
if (!seen.has(key)) {
|
|
84
|
-
seen.add(key);
|
|
85
|
-
merged.push(item);
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
// Respect global limit early if possible
|
|
89
|
-
if (target.limit && merged.length >= target.limit) {
|
|
90
|
-
break;
|
|
91
|
-
}
|
|
92
|
-
// Add delay between tag requests to reduce rate limiting
|
|
93
|
-
if (i < tags.length - 1 && requestDelayMs > 0) {
|
|
94
|
-
await (0, promises_1.setTimeout)(requestDelayMs);
|
|
95
|
-
}
|
|
96
|
-
}
|
|
97
|
-
const sorted = (0, pixiv_sort_1.sortPixivItems)(merged, target.sort);
|
|
98
|
-
if (target.limit && sorted.length > target.limit) {
|
|
99
|
-
return sorted.slice(0, target.limit);
|
|
100
|
-
}
|
|
101
|
-
return sorted;
|
|
102
|
-
}
|
|
103
|
-
return this.searchNovelsSingleTag(target, target.tag, requestDelayMs);
|
|
104
|
-
}
|
|
105
|
-
async searchIllustrationsSingleTag(target, tag, requestDelayMs) {
|
|
106
|
-
logger_1.logger.debug('Searching illustrations', {
|
|
107
|
-
tag,
|
|
108
|
-
sort: target.sort,
|
|
109
|
-
searchTarget: target.searchTarget,
|
|
110
|
-
startDate: target.startDate,
|
|
111
|
-
endDate: target.endDate,
|
|
112
|
-
});
|
|
113
|
-
const dateRange = SearchFilters_1.SearchFilters.parseDateRangeFromTarget(target);
|
|
114
|
-
if (dateRange === null) {
|
|
115
|
-
return [];
|
|
116
|
-
}
|
|
117
|
-
const { startDate, endDate } = dateRange;
|
|
118
|
-
// filter=for_ios excludes R-18 works; omit it when the target opts in.
|
|
119
|
-
const paramsObj = {
|
|
120
|
-
word: tag,
|
|
121
|
-
search_target: target.searchTarget ?? 'partial_match_for_tags',
|
|
122
|
-
include_translated_tag_results: 'true',
|
|
123
|
-
};
|
|
124
|
-
if (!target.r18)
|
|
125
|
-
paramsObj.filter = 'for_ios';
|
|
126
|
-
const params = new URLSearchParams(paramsObj);
|
|
127
|
-
if (target.sort)
|
|
128
|
-
params.set('sort', target.sort);
|
|
129
|
-
const sortMode = target.sort || 'date_desc';
|
|
130
|
-
const hasDateFilter = !!(startDate || endDate);
|
|
131
|
-
const fetchLimit = SearchFilters_1.SearchFilters.calculateFetchLimit(target, sortMode, hasDateFilter);
|
|
132
|
-
return this.searchWithPagination(`/v1/search/illust?${params.toString()}`, 'illusts', target, tag, requestDelayMs, sortMode, startDate, endDate, hasDateFilter, fetchLimit);
|
|
133
|
-
}
|
|
134
|
-
async searchNovelsSingleTag(target, tag, requestDelayMs) {
|
|
135
|
-
logger_1.logger.debug('Searching novels', {
|
|
136
|
-
tag,
|
|
137
|
-
sort: target.sort,
|
|
138
|
-
searchTarget: target.searchTarget,
|
|
139
|
-
startDate: target.startDate,
|
|
140
|
-
endDate: target.endDate,
|
|
141
|
-
});
|
|
142
|
-
const dateRange = SearchFilters_1.SearchFilters.parseDateRangeFromTarget(target);
|
|
143
|
-
if (dateRange === null) {
|
|
144
|
-
return [];
|
|
145
|
-
}
|
|
146
|
-
const { startDate, endDate } = dateRange;
|
|
147
|
-
const params = new URLSearchParams({
|
|
148
|
-
word: tag,
|
|
149
|
-
search_target: target.searchTarget ?? 'partial_match_for_tags',
|
|
150
|
-
});
|
|
151
|
-
if (target.sort)
|
|
152
|
-
params.set('sort', target.sort);
|
|
153
|
-
const sortMode = target.sort || 'date_desc';
|
|
154
|
-
const hasDateFilter = !!(startDate || endDate);
|
|
155
|
-
const fetchLimit = SearchFilters_1.SearchFilters.calculateFetchLimit(target, sortMode, hasDateFilter);
|
|
156
|
-
return this.searchWithPagination(`/v1/search/novel?${params.toString()}`, 'novels', target, tag, requestDelayMs, sortMode, startDate, endDate, hasDateFilter, fetchLimit);
|
|
157
|
-
}
|
|
158
|
-
/**
|
|
159
|
-
* Generic pagination search method that works for both illustrations and novels.
|
|
160
|
-
*/
|
|
161
|
-
async searchWithPagination(initialUrl, itemsKey, target, tag, requestDelayMs, sortMode, startDate, endDate, hasDateFilter, fetchLimit) {
|
|
162
|
-
const results = [];
|
|
163
|
-
let nextUrl = initialUrl;
|
|
164
|
-
let pageCount = 0;
|
|
165
|
-
let shouldStop = false;
|
|
166
|
-
while (nextUrl && (!fetchLimit || results.length < fetchLimit) && !shouldStop) {
|
|
167
|
-
pageCount++;
|
|
168
|
-
const response = await this.api.request(nextUrl, { method: 'GET' });
|
|
169
|
-
const items = response[itemsKey] || [];
|
|
170
|
-
const responseNextUrl = response.next_url;
|
|
171
|
-
for (const item of items) {
|
|
172
|
-
const filterResult = SearchFilters_1.SearchFilters.filterItemByDate(item, target, startDate, endDate, sortMode);
|
|
173
|
-
if (filterResult.shouldStop) {
|
|
174
|
-
shouldStop = true;
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
if (filterResult.shouldInclude) {
|
|
178
|
-
results.push(item);
|
|
179
|
-
if (fetchLimit && results.length >= fetchLimit) {
|
|
180
|
-
break;
|
|
181
|
-
}
|
|
182
|
-
}
|
|
183
|
-
}
|
|
184
|
-
nextUrl = responseNextUrl;
|
|
185
|
-
if (nextUrl && requestDelayMs > 0 && !shouldStop) {
|
|
186
|
-
logger_1.logger.debug(`Tag "${tag}" page ${pageCount}: found ${items.length} ${itemsKey}, total collected: ${results.length}, waiting ${requestDelayMs}ms before next page...`);
|
|
187
|
-
await (0, promises_1.setTimeout)(requestDelayMs);
|
|
188
|
-
}
|
|
189
|
-
}
|
|
190
|
-
// Post-process for popular_desc mode with date filter
|
|
191
|
-
let finalResults = results;
|
|
192
|
-
if (sortMode === 'popular_desc' && hasDateFilter && results.length > 0) {
|
|
193
|
-
const validResults = SearchFilters_1.SearchFilters.filterResultsByDateRange(results, startDate, endDate);
|
|
194
|
-
if (validResults.length < results.length) {
|
|
195
|
-
logger_1.logger.debug(`Date filtering in popular_desc mode: ${results.length} total results, ${validResults.length} within date range`);
|
|
196
|
-
}
|
|
197
|
-
finalResults = validResults;
|
|
198
|
-
}
|
|
199
|
-
const sortedResults = (0, pixiv_sort_1.sortPixivItems)(finalResults, target.sort);
|
|
200
|
-
if (target.limit && sortedResults.length > target.limit) {
|
|
201
|
-
return sortedResults.slice(0, target.limit);
|
|
202
|
-
}
|
|
203
|
-
return sortedResults;
|
|
204
|
-
}
|
|
205
|
-
}
|
|
206
|
-
exports.SearchService = SearchService;
|
|
207
|
-
//# sourceMappingURL=SearchService.js.map
|