pixivflow 2.16.0 → 2.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/auth/PixivAuth.d.ts +12 -0
- package/dist/auth/PixivAuth.d.ts.map +1 -1
- package/dist/auth/PixivAuth.js +26 -0
- package/dist/auth/PixivAuth.js.map +1 -1
- package/dist/batch/executionResult.d.ts +85 -0
- package/dist/batch/executionResult.d.ts.map +1 -0
- package/dist/batch/executionResult.js +102 -0
- package/dist/batch/executionResult.js.map +1 -0
- package/dist/batch/runDiagnostics.d.ts +48 -0
- package/dist/batch/runDiagnostics.d.ts.map +1 -0
- package/dist/batch/runDiagnostics.js +103 -0
- package/dist/batch/runDiagnostics.js.map +1 -0
- package/dist/commands/Command.d.ts +5 -0
- package/dist/commands/Command.d.ts.map +1 -1
- package/dist/commands/Command.js +7 -0
- package/dist/commands/Command.js.map +1 -1
- package/dist/commands/ExecuteSlotCommand.d.ts +37 -0
- package/dist/commands/ExecuteSlotCommand.d.ts.map +1 -0
- package/dist/commands/ExecuteSlotCommand.js +267 -0
- package/dist/commands/ExecuteSlotCommand.js.map +1 -0
- package/dist/commands/index.d.ts +2 -1
- package/dist/commands/index.d.ts.map +1 -1
- package/dist/commands/index.js +4 -1
- package/dist/commands/index.js.map +1 -1
- package/dist/commands/scheduler-runtime.d.ts +37 -1
- package/dist/commands/scheduler-runtime.d.ts.map +1 -1
- package/dist/commands/scheduler-runtime.js +52 -19
- package/dist/commands/scheduler-runtime.js.map +1 -1
- package/dist/commands/types.d.ts +6 -0
- package/dist/commands/types.d.ts.map +1 -1
- package/dist/config/types.d.ts +33 -1
- package/dist/config/types.d.ts.map +1 -1
- package/dist/config/validation.d.ts +14 -1
- package/dist/config/validation.d.ts.map +1 -1
- package/dist/config/validation.js +109 -33
- package/dist/config/validation.js.map +1 -1
- package/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js.map +1 -1
- package/dist/delivery/DeliveryDispatcher.d.ts.map +1 -1
- package/dist/delivery/DeliveryDispatcher.js +7 -0
- package/dist/delivery/DeliveryDispatcher.js.map +1 -1
- package/dist/delivery/HttpMultipartDelivery.d.ts +12 -0
- package/dist/delivery/HttpMultipartDelivery.d.ts.map +1 -1
- package/dist/delivery/HttpMultipartDelivery.js +89 -70
- package/dist/delivery/HttpMultipartDelivery.js.map +1 -1
- package/dist/delivery/TelegramReviewDelivery.d.ts +49 -0
- package/dist/delivery/TelegramReviewDelivery.d.ts.map +1 -0
- package/dist/delivery/TelegramReviewDelivery.js +307 -0
- package/dist/delivery/TelegramReviewDelivery.js.map +1 -0
- package/dist/download/DownloadManager.d.ts +10 -0
- package/dist/download/DownloadManager.d.ts.map +1 -1
- package/dist/download/DownloadManager.js +21 -0
- package/dist/download/DownloadManager.js.map +1 -1
- package/dist/download/plan/DownloadPlanner.d.ts +10 -0
- package/dist/download/plan/DownloadPlanner.d.ts.map +1 -1
- package/dist/download/plan/DownloadPlanner.js +19 -0
- package/dist/download/plan/DownloadPlanner.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/notification/NotificationPolicy.d.ts.map +1 -1
- package/dist/notification/NotificationPolicy.js +4 -1
- package/dist/notification/NotificationPolicy.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/pixiv-token-getter-adapter.d.ts +27 -7
- package/dist/pixiv-token-getter-adapter.d.ts.map +1 -1
- package/dist/pixiv-token-getter-adapter.js +44 -27
- package/dist/pixiv-token-getter-adapter.js.map +1 -1
- package/dist/utils/concurrency.d.ts.map +1 -1
- package/dist/utils/concurrency.js +9 -2
- package/dist/utils/concurrency.js.map +1 -1
- package/dist/utils/config-validator-unified.d.ts.map +1 -1
- package/dist/utils/config-validator-unified.js +15 -1
- package/dist/utils/config-validator-unified.js.map +1 -1
- package/dist/utils/token-maintenance.d.ts +0 -4
- package/dist/utils/token-maintenance.d.ts.map +1 -1
- package/dist/utils/token-maintenance.js +5 -25
- package/dist/utils/token-maintenance.js.map +1 -1
- package/dist/version.js +1 -1
- package/dist/webui/package.json +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/node_modules/@redtidev/pixiv-client/dist/types.js +3 -0
- 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/node_modules/@redtidev/pixiv-client/dist/web-api/types.js +3 -0
- package/node_modules/@redtidev/pixiv-client/dist/web-api/types.js.map +1 -0
- 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 +5 -2
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Typed error hierarchy for the Pixiv Client Kit.
|
|
3
|
+
*
|
|
4
|
+
* Callers classify failures structurally (instanceof + fields), never by
|
|
5
|
+
* matching strings in error messages:
|
|
6
|
+
*
|
|
7
|
+
* try {
|
|
8
|
+
* await pixiv.illustrations.get(123);
|
|
9
|
+
* } catch (e) {
|
|
10
|
+
* if (e instanceof PixivRateLimitError) await sleep(e.retryAfterMs);
|
|
11
|
+
* else if (e instanceof PixivNotFoundError) skip();
|
|
12
|
+
* else throw e;
|
|
13
|
+
* }
|
|
14
|
+
*
|
|
15
|
+
* Compatibility: every error exposes `statusCode` / `code` / `isRateLimit` /
|
|
16
|
+
* `waitTime` getters, so host code written against the legacy PixivFlow
|
|
17
|
+
* `NetworkError(message, url, cause, metadata)` shape keeps working.
|
|
18
|
+
*/
|
|
19
|
+
export interface PixivErrorDetails {
|
|
20
|
+
/** HTTP status code, when the failure came from an HTTP response. */
|
|
21
|
+
status?: number;
|
|
22
|
+
/** Machine-readable code (e.g. 'rate_limited', 'timeout'). */
|
|
23
|
+
code?: string;
|
|
24
|
+
/** Whether the operation may succeed if retried later. */
|
|
25
|
+
retryable?: boolean;
|
|
26
|
+
/** Delay the caller should wait before retrying, when known (ms). */
|
|
27
|
+
retryAfterMs?: number;
|
|
28
|
+
/** Endpoint / absolute URL the request targeted (never contains secrets). */
|
|
29
|
+
endpoint?: string;
|
|
30
|
+
/** Original underlying error. */
|
|
31
|
+
cause?: unknown;
|
|
32
|
+
}
|
|
33
|
+
export declare class PixivError extends Error {
|
|
34
|
+
readonly status?: number;
|
|
35
|
+
readonly code?: string;
|
|
36
|
+
readonly retryable: boolean;
|
|
37
|
+
readonly retryAfterMs?: number;
|
|
38
|
+
readonly endpoint?: string;
|
|
39
|
+
readonly cause?: unknown;
|
|
40
|
+
constructor(message: string, details?: PixivErrorDetails);
|
|
41
|
+
/** @deprecated use `status`. Kept so legacy `NetworkError` consumers compile. */
|
|
42
|
+
get statusCode(): number | undefined;
|
|
43
|
+
/** @deprecated use `endpoint`. */
|
|
44
|
+
get url(): string | undefined;
|
|
45
|
+
/** @deprecated use `instanceof PixivRateLimitError`. */
|
|
46
|
+
get isRateLimit(): boolean;
|
|
47
|
+
/** @deprecated use `retryAfterMs`. */
|
|
48
|
+
get waitTime(): number | undefined;
|
|
49
|
+
}
|
|
50
|
+
/** Network-level failure (DNS, reset, proxy, timeout): no HTTP response. */
|
|
51
|
+
export declare class PixivNetworkError extends PixivError {
|
|
52
|
+
constructor(message: string, details?: PixivErrorDetails);
|
|
53
|
+
}
|
|
54
|
+
/** Request timed out (our AbortController, not an HTTP response). */
|
|
55
|
+
export declare class PixivTimeoutError extends PixivNetworkError {
|
|
56
|
+
constructor(message: string, details?: PixivErrorDetails);
|
|
57
|
+
}
|
|
58
|
+
/** Non-2xx HTTP response base. */
|
|
59
|
+
export declare class PixivHttpError extends PixivError {
|
|
60
|
+
/** Response body text, truncated (may be empty). */
|
|
61
|
+
readonly body?: string;
|
|
62
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
63
|
+
body?: string;
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
/** 401: access token missing/expired and refresh did not recover it. */
|
|
67
|
+
export declare class PixivAuthenticationError extends PixivHttpError {
|
|
68
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
69
|
+
body?: string;
|
|
70
|
+
});
|
|
71
|
+
}
|
|
72
|
+
/** 403: forbidden (private/deleted content, account restriction). */
|
|
73
|
+
export declare class PixivForbiddenError extends PixivHttpError {
|
|
74
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
75
|
+
body?: string;
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/** 404: endpoint or work does not exist. Never retried. */
|
|
79
|
+
export declare class PixivNotFoundError extends PixivHttpError {
|
|
80
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
81
|
+
body?: string;
|
|
82
|
+
});
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* 429 / rate limited. `retryAfterMs` carries the gate cooldown. The shared
|
|
86
|
+
* gate has ALREADY applied this cooldown by the time this is thrown, so the
|
|
87
|
+
* durable caller (scheduler/outbox) should back off rather than retry tight.
|
|
88
|
+
*/
|
|
89
|
+
export declare class PixivRateLimitError extends PixivHttpError {
|
|
90
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
91
|
+
body?: string;
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
/** 5xx server error. */
|
|
95
|
+
export declare class PixivServerError extends PixivHttpError {
|
|
96
|
+
constructor(message: string, details?: PixivErrorDetails & {
|
|
97
|
+
body?: string;
|
|
98
|
+
});
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* Circuit breaker is OPEN: requests fail fast instead of queuing dozens of
|
|
102
|
+
* tasks against a rate-limiting Pixiv. Retryable after `retryAfterMs`.
|
|
103
|
+
*/
|
|
104
|
+
export declare class PixivCircuitOpenError extends PixivError {
|
|
105
|
+
constructor(message: string, details?: PixivErrorDetails);
|
|
106
|
+
}
|
|
107
|
+
/** Caller-supplied AbortSignal aborted the operation. */
|
|
108
|
+
export declare class PixivAbortError extends PixivError {
|
|
109
|
+
constructor(message?: string, details?: PixivErrorDetails);
|
|
110
|
+
}
|
|
111
|
+
/** Generic API-level error (unexpected payload shape, empty body, ...). */
|
|
112
|
+
export declare class PixivApiError extends PixivError {
|
|
113
|
+
constructor(message: string, details?: PixivErrorDetails);
|
|
114
|
+
}
|
|
115
|
+
/** True when the error originated from this kit (used by host adapters). */
|
|
116
|
+
export declare function isPixivError(error: unknown): error is PixivError;
|
|
117
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.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,2EAA2E;AAC3E,qBAAa,aAAc,SAAQ,UAAU;gBAC/B,OAAO,EAAE,MAAM,EAAE,OAAO,GAAE,iBAAsB;CAI7D;AAED,4EAA4E;AAC5E,wBAAgB,YAAY,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,UAAU,CAEhE"}
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Typed error hierarchy for the Pixiv Client Kit.
|
|
4
|
+
*
|
|
5
|
+
* Callers classify failures structurally (instanceof + fields), never by
|
|
6
|
+
* matching strings in error messages:
|
|
7
|
+
*
|
|
8
|
+
* try {
|
|
9
|
+
* await pixiv.illustrations.get(123);
|
|
10
|
+
* } catch (e) {
|
|
11
|
+
* if (e instanceof PixivRateLimitError) await sleep(e.retryAfterMs);
|
|
12
|
+
* else if (e instanceof PixivNotFoundError) skip();
|
|
13
|
+
* else throw e;
|
|
14
|
+
* }
|
|
15
|
+
*
|
|
16
|
+
* Compatibility: every error exposes `statusCode` / `code` / `isRateLimit` /
|
|
17
|
+
* `waitTime` getters, so host code written against the legacy PixivFlow
|
|
18
|
+
* `NetworkError(message, url, cause, metadata)` shape keeps working.
|
|
19
|
+
*/
|
|
20
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
21
|
+
exports.PixivApiError = exports.PixivAbortError = exports.PixivCircuitOpenError = exports.PixivServerError = exports.PixivRateLimitError = exports.PixivNotFoundError = exports.PixivForbiddenError = exports.PixivAuthenticationError = exports.PixivHttpError = exports.PixivTimeoutError = exports.PixivNetworkError = exports.PixivError = void 0;
|
|
22
|
+
exports.isPixivError = isPixivError;
|
|
23
|
+
class PixivError extends Error {
|
|
24
|
+
status;
|
|
25
|
+
code;
|
|
26
|
+
retryable;
|
|
27
|
+
retryAfterMs;
|
|
28
|
+
endpoint;
|
|
29
|
+
cause;
|
|
30
|
+
constructor(message, details = {}) {
|
|
31
|
+
super(message);
|
|
32
|
+
this.name = 'PixivError';
|
|
33
|
+
this.status = details.status;
|
|
34
|
+
this.code = details.code;
|
|
35
|
+
this.retryable = details.retryable ?? false;
|
|
36
|
+
this.retryAfterMs = details.retryAfterMs;
|
|
37
|
+
this.endpoint = details.endpoint;
|
|
38
|
+
if (details.cause !== undefined)
|
|
39
|
+
this.cause = details.cause;
|
|
40
|
+
if (Error.captureStackTrace)
|
|
41
|
+
Error.captureStackTrace(this, new.target);
|
|
42
|
+
}
|
|
43
|
+
// --- legacy PixivFlow compatibility accessors -----------------------------
|
|
44
|
+
/** @deprecated use `status`. Kept so legacy `NetworkError` consumers compile. */
|
|
45
|
+
get statusCode() {
|
|
46
|
+
return this.status;
|
|
47
|
+
}
|
|
48
|
+
/** @deprecated use `endpoint`. */
|
|
49
|
+
get url() {
|
|
50
|
+
return this.endpoint;
|
|
51
|
+
}
|
|
52
|
+
/** @deprecated use `instanceof PixivRateLimitError`. */
|
|
53
|
+
get isRateLimit() {
|
|
54
|
+
return this instanceof PixivRateLimitError;
|
|
55
|
+
}
|
|
56
|
+
/** @deprecated use `retryAfterMs`. */
|
|
57
|
+
get waitTime() {
|
|
58
|
+
return this.retryAfterMs;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
exports.PixivError = PixivError;
|
|
62
|
+
/** Network-level failure (DNS, reset, proxy, timeout): no HTTP response. */
|
|
63
|
+
class PixivNetworkError extends PixivError {
|
|
64
|
+
constructor(message, details = {}) {
|
|
65
|
+
super(message, { retryable: true, code: 'network_error', ...details });
|
|
66
|
+
this.name = 'PixivNetworkError';
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
exports.PixivNetworkError = PixivNetworkError;
|
|
70
|
+
/** Request timed out (our AbortController, not an HTTP response). */
|
|
71
|
+
class PixivTimeoutError extends PixivNetworkError {
|
|
72
|
+
constructor(message, details = {}) {
|
|
73
|
+
super(message, { code: 'timeout', ...details });
|
|
74
|
+
this.name = 'PixivTimeoutError';
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
exports.PixivTimeoutError = PixivTimeoutError;
|
|
78
|
+
/** Non-2xx HTTP response base. */
|
|
79
|
+
class PixivHttpError extends PixivError {
|
|
80
|
+
/** Response body text, truncated (may be empty). */
|
|
81
|
+
body;
|
|
82
|
+
constructor(message, details = {}) {
|
|
83
|
+
super(message, { code: `http_${details.status ?? 'unknown'}`, ...details });
|
|
84
|
+
this.name = 'PixivHttpError';
|
|
85
|
+
this.body = details.body;
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
exports.PixivHttpError = PixivHttpError;
|
|
89
|
+
/** 401: access token missing/expired and refresh did not recover it. */
|
|
90
|
+
class PixivAuthenticationError extends PixivHttpError {
|
|
91
|
+
constructor(message, details = {}) {
|
|
92
|
+
super(message, { status: 401, code: 'unauthorized', retryable: false, ...details });
|
|
93
|
+
this.name = 'PixivAuthenticationError';
|
|
94
|
+
}
|
|
95
|
+
}
|
|
96
|
+
exports.PixivAuthenticationError = PixivAuthenticationError;
|
|
97
|
+
/** 403: forbidden (private/deleted content, account restriction). */
|
|
98
|
+
class PixivForbiddenError extends PixivHttpError {
|
|
99
|
+
constructor(message, details = {}) {
|
|
100
|
+
super(message, { status: 403, code: 'forbidden', retryable: false, ...details });
|
|
101
|
+
this.name = 'PixivForbiddenError';
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
exports.PixivForbiddenError = PixivForbiddenError;
|
|
105
|
+
/** 404: endpoint or work does not exist. Never retried. */
|
|
106
|
+
class PixivNotFoundError extends PixivHttpError {
|
|
107
|
+
constructor(message, details = {}) {
|
|
108
|
+
super(message, { status: 404, code: 'not_found', retryable: false, ...details });
|
|
109
|
+
this.name = 'PixivNotFoundError';
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
exports.PixivNotFoundError = PixivNotFoundError;
|
|
113
|
+
/**
|
|
114
|
+
* 429 / rate limited. `retryAfterMs` carries the gate cooldown. The shared
|
|
115
|
+
* gate has ALREADY applied this cooldown by the time this is thrown, so the
|
|
116
|
+
* durable caller (scheduler/outbox) should back off rather than retry tight.
|
|
117
|
+
*/
|
|
118
|
+
class PixivRateLimitError extends PixivHttpError {
|
|
119
|
+
constructor(message, details = {}) {
|
|
120
|
+
super(message, {
|
|
121
|
+
status: 429,
|
|
122
|
+
code: 'rate_limited',
|
|
123
|
+
retryable: true,
|
|
124
|
+
...details,
|
|
125
|
+
});
|
|
126
|
+
this.name = 'PixivRateLimitError';
|
|
127
|
+
}
|
|
128
|
+
}
|
|
129
|
+
exports.PixivRateLimitError = PixivRateLimitError;
|
|
130
|
+
/** 5xx server error. */
|
|
131
|
+
class PixivServerError extends PixivHttpError {
|
|
132
|
+
constructor(message, details = {}) {
|
|
133
|
+
super(message, { retryable: true, code: `http_${details.status ?? 500}`, ...details });
|
|
134
|
+
this.name = 'PixivServerError';
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
exports.PixivServerError = PixivServerError;
|
|
138
|
+
/**
|
|
139
|
+
* Circuit breaker is OPEN: requests fail fast instead of queuing dozens of
|
|
140
|
+
* tasks against a rate-limiting Pixiv. Retryable after `retryAfterMs`.
|
|
141
|
+
*/
|
|
142
|
+
class PixivCircuitOpenError extends PixivError {
|
|
143
|
+
constructor(message, details = {}) {
|
|
144
|
+
super(message, { code: 'circuit_open', retryable: true, ...details });
|
|
145
|
+
this.name = 'PixivCircuitOpenError';
|
|
146
|
+
}
|
|
147
|
+
}
|
|
148
|
+
exports.PixivCircuitOpenError = PixivCircuitOpenError;
|
|
149
|
+
/** Caller-supplied AbortSignal aborted the operation. */
|
|
150
|
+
class PixivAbortError extends PixivError {
|
|
151
|
+
constructor(message = 'Operation aborted', details = {}) {
|
|
152
|
+
super(message, { code: 'aborted', retryable: false, ...details });
|
|
153
|
+
this.name = 'PixivAbortError';
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
exports.PixivAbortError = PixivAbortError;
|
|
157
|
+
/** Generic API-level error (unexpected payload shape, empty body, ...). */
|
|
158
|
+
class PixivApiError extends PixivError {
|
|
159
|
+
constructor(message, details = {}) {
|
|
160
|
+
super(message, { code: 'api_error', ...details });
|
|
161
|
+
this.name = 'PixivApiError';
|
|
162
|
+
}
|
|
163
|
+
}
|
|
164
|
+
exports.PixivApiError = PixivApiError;
|
|
165
|
+
/** True when the error originated from this kit (used by host adapters). */
|
|
166
|
+
function isPixivError(error) {
|
|
167
|
+
return error instanceof PixivError;
|
|
168
|
+
}
|
|
169
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/errors/errors.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;;GAiBG;;;AAgKH,oCAEC;AAjJD,MAAa,UAAW,SAAQ,KAAK;IAC1B,MAAM,CAAU;IAChB,IAAI,CAAU;IACd,SAAS,CAAU;IACnB,YAAY,CAAU;IACtB,QAAQ,CAAU;IACT,KAAK,CAAW;IAElC,YAAY,OAAe,EAAE,UAA6B,EAAE;QAC1D,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC;QACzB,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;QAC7B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;QACzB,IAAI,CAAC,SAAS,GAAG,OAAO,CAAC,SAAS,IAAI,KAAK,CAAC;QAC5C,IAAI,CAAC,YAAY,GAAG,OAAO,CAAC,YAAY,CAAC;QACzC,IAAI,CAAC,QAAQ,GAAG,OAAO,CAAC,QAAQ,CAAC;QACjC,IAAI,OAAO,CAAC,KAAK,KAAK,SAAS;YAAE,IAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;QAC5D,IAAI,KAAK,CAAC,iBAAiB;YAAE,KAAK,CAAC,iBAAiB,CAAC,IAAI,EAAE,GAAG,CAAC,MAAM,CAAC,CAAC;IACzE,CAAC;IAED,6EAA6E;IAC7E,iF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ev/pixiv-client — independent Pixiv App-API client kit.
|
|
3
|
+
*
|
|
4
|
+
* Small, stable public surface. Consumers must import from the package root;
|
|
5
|
+
* transport/rate-limit internals are exported as named members for advanced
|
|
6
|
+
* embedding (custom state stores, health UIs, test doubles) but the
|
|
7
|
+
* service-level API (PixivClient) is what stays semver-stable.
|
|
8
|
+
*/
|
|
9
|
+
export { PixivClient, createPixivClient } from './client';
|
|
10
|
+
export type { CreatePixivClientOptions } from './client';
|
|
11
|
+
export { StaticTokenProvider, isRefreshable } from './auth/types';
|
|
12
|
+
export type { AccessTokenProvider, RefreshableAccessTokenProvider } from './auth/types';
|
|
13
|
+
export { RateLimitGate, MemoryRateLimitStateStore, DEFAULT_RATE_LIMIT, parseRetryAfter, } from './rate-limit/RateLimitGate';
|
|
14
|
+
export { Transport } from './transport/transport';
|
|
15
|
+
export type { TransportConfig } from './transport/transport';
|
|
16
|
+
export { paginate, firstPage } from './pagination';
|
|
17
|
+
export { IllustrationsApi, NovelsApi, TagsApi, MediaApi, UsersApi, } from './app-api/exports';
|
|
18
|
+
export type { IllustSearchOptions, NovelSearchOptions, RankingOptions, UserWorksOptions, IllustRankingMode, NovelRankingMode, SearchSort, SearchTarget, OnePageResult, } from './app-api/options';
|
|
19
|
+
export type { PixivUser, PixivTag, PixivIllust, PixivIllustPage, PixivNovel, PixivNovelTextResponse, UgoiraFrame, UgoiraMetadata, Paginated, PixivListResponse, } from './models';
|
|
20
|
+
export type { PixivClientOptions, ProxyOptions, RateLimitOptions, RateLimitState, RateLimitStateStore, RateLimitStatus, RequestOptions, PaginationOptions, KitEvent, KitEventListener, FetchLike, ResponseLike, } from './types';
|
|
21
|
+
export { silentLogger } from './logger';
|
|
22
|
+
export type { KitLogger } from './logger';
|
|
23
|
+
export { PixivError, PixivHttpError, PixivNetworkError, PixivTimeoutError, PixivRateLimitError, PixivAuthenticationError, PixivForbiddenError, PixivNotFoundError, PixivServerError, PixivCircuitOpenError, PixivAbortError, PixivApiError, isPixivError, } from './errors/errors';
|
|
24
|
+
export type { PixivErrorDetails } from './errors/errors';
|
|
25
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AAC1D,YAAY,EAAE,wBAAwB,EAAE,MAAM,UAAU,CAAC;AAEzD,OAAO,EAAE,mBAAmB,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAClE,YAAY,EAAE,mBAAmB,EAAE,8BAA8B,EAAE,MAAM,cAAc,CAAC;AAExF,OAAO,EACL,aAAa,EACb,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,GAChB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAClD,YAAY,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAC7D,OAAO,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,cAAc,CAAC;AAEnD,OAAO,EACL,gBAAgB,EAChB,SAAS,EACT,OAAO,EACP,QAAQ,EACR,QAAQ,GACT,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,mBAAmB,EACnB,kBAAkB,EAClB,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EACjB,gBAAgB,EAChB,UAAU,EACV,YAAY,EACZ,aAAa,GACd,MAAM,mBAAmB,CAAC;AAE3B,YAAY,EACV,SAAS,EACT,QAAQ,EACR,WAAW,EACX,eAAe,EACf,UAAU,EACV,sBAAsB,EACtB,WAAW,EACX,cAAc,EACd,SAAS,EACT,iBAAiB,GAClB,MAAM,UAAU,CAAC;AAElB,YAAY,EACV,kBAAkB,EAClB,YAAY,EACZ,gBAAgB,EAChB,cAAc,EACd,mBAAmB,EACnB,eAAe,EACf,cAAc,EACd,iBAAiB,EACjB,QAAQ,EACR,gBAAgB,EAChB,SAAS,EACT,YAAY,GACb,MAAM,SAAS,CAAC;AACjB,OAAO,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AACxC,YAAY,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C,OAAO,EACL,UAAU,EACV,cAAc,EACd,iBAAiB,EACjB,iBAAiB,EACjB,mBAAmB,EACnB,wBAAwB,EACxB,mBAAmB,EACnB,kBAAkB,EAClB,gBAAgB,EAChB,qBAAqB,EACrB,eAAe,EACf,aAAa,EACb,YAAY,GACb,MAAM,iBAAiB,CAAC;AACzB,YAAY,EAAE,iBAAiB,EAAE,MAAM,iBAAiB,CAAC"}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @redtidev/pixiv-client — independent Pixiv App-API client kit.
|
|
4
|
+
*
|
|
5
|
+
* Small, stable public surface. Consumers must import from the package root;
|
|
6
|
+
* transport/rate-limit internals are exported as named members for advanced
|
|
7
|
+
* embedding (custom state stores, health UIs, test doubles) but the
|
|
8
|
+
* service-level API (PixivClient) is what stays semver-stable.
|
|
9
|
+
*/
|
|
10
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
11
|
+
exports.isPixivError = exports.PixivApiError = exports.PixivAbortError = exports.PixivCircuitOpenError = exports.PixivServerError = exports.PixivNotFoundError = exports.PixivForbiddenError = exports.PixivAuthenticationError = exports.PixivRateLimitError = exports.PixivTimeoutError = exports.PixivNetworkError = exports.PixivHttpError = exports.PixivError = exports.silentLogger = exports.UsersApi = exports.MediaApi = exports.TagsApi = exports.NovelsApi = exports.IllustrationsApi = exports.firstPage = exports.paginate = exports.Transport = exports.parseRetryAfter = exports.DEFAULT_RATE_LIMIT = exports.MemoryRateLimitStateStore = exports.RateLimitGate = exports.isRefreshable = exports.StaticTokenProvider = exports.createPixivClient = exports.PixivClient = void 0;
|
|
12
|
+
var client_1 = require("./client");
|
|
13
|
+
Object.defineProperty(exports, "PixivClient", { enumerable: true, get: function () { return client_1.PixivClient; } });
|
|
14
|
+
Object.defineProperty(exports, "createPixivClient", { enumerable: true, get: function () { return client_1.createPixivClient; } });
|
|
15
|
+
var types_1 = require("./auth/types");
|
|
16
|
+
Object.defineProperty(exports, "StaticTokenProvider", { enumerable: true, get: function () { return types_1.StaticTokenProvider; } });
|
|
17
|
+
Object.defineProperty(exports, "isRefreshable", { enumerable: true, get: function () { return types_1.isRefreshable; } });
|
|
18
|
+
var RateLimitGate_1 = require("./rate-limit/RateLimitGate");
|
|
19
|
+
Object.defineProperty(exports, "RateLimitGate", { enumerable: true, get: function () { return RateLimitGate_1.RateLimitGate; } });
|
|
20
|
+
Object.defineProperty(exports, "MemoryRateLimitStateStore", { enumerable: true, get: function () { return RateLimitGate_1.MemoryRateLimitStateStore; } });
|
|
21
|
+
Object.defineProperty(exports, "DEFAULT_RATE_LIMIT", { enumerable: true, get: function () { return RateLimitGate_1.DEFAULT_RATE_LIMIT; } });
|
|
22
|
+
Object.defineProperty(exports, "parseRetryAfter", { enumerable: true, get: function () { return RateLimitGate_1.parseRetryAfter; } });
|
|
23
|
+
var transport_1 = require("./transport/transport");
|
|
24
|
+
Object.defineProperty(exports, "Transport", { enumerable: true, get: function () { return transport_1.Transport; } });
|
|
25
|
+
var pagination_1 = require("./pagination");
|
|
26
|
+
Object.defineProperty(exports, "paginate", { enumerable: true, get: function () { return pagination_1.paginate; } });
|
|
27
|
+
Object.defineProperty(exports, "firstPage", { enumerable: true, get: function () { return pagination_1.firstPage; } });
|
|
28
|
+
var exports_1 = require("./app-api/exports");
|
|
29
|
+
Object.defineProperty(exports, "IllustrationsApi", { enumerable: true, get: function () { return exports_1.IllustrationsApi; } });
|
|
30
|
+
Object.defineProperty(exports, "NovelsApi", { enumerable: true, get: function () { return exports_1.NovelsApi; } });
|
|
31
|
+
Object.defineProperty(exports, "TagsApi", { enumerable: true, get: function () { return exports_1.TagsApi; } });
|
|
32
|
+
Object.defineProperty(exports, "MediaApi", { enumerable: true, get: function () { return exports_1.MediaApi; } });
|
|
33
|
+
Object.defineProperty(exports, "UsersApi", { enumerable: true, get: function () { return exports_1.UsersApi; } });
|
|
34
|
+
var logger_1 = require("./logger");
|
|
35
|
+
Object.defineProperty(exports, "silentLogger", { enumerable: true, get: function () { return logger_1.silentLogger; } });
|
|
36
|
+
var errors_1 = require("./errors/errors");
|
|
37
|
+
Object.defineProperty(exports, "PixivError", { enumerable: true, get: function () { return errors_1.PixivError; } });
|
|
38
|
+
Object.defineProperty(exports, "PixivHttpError", { enumerable: true, get: function () { return errors_1.PixivHttpError; } });
|
|
39
|
+
Object.defineProperty(exports, "PixivNetworkError", { enumerable: true, get: function () { return errors_1.PixivNetworkError; } });
|
|
40
|
+
Object.defineProperty(exports, "PixivTimeoutError", { enumerable: true, get: function () { return errors_1.PixivTimeoutError; } });
|
|
41
|
+
Object.defineProperty(exports, "PixivRateLimitError", { enumerable: true, get: function () { return errors_1.PixivRateLimitError; } });
|
|
42
|
+
Object.defineProperty(exports, "PixivAuthenticationError", { enumerable: true, get: function () { return errors_1.PixivAuthenticationError; } });
|
|
43
|
+
Object.defineProperty(exports, "PixivForbiddenError", { enumerable: true, get: function () { return errors_1.PixivForbiddenError; } });
|
|
44
|
+
Object.defineProperty(exports, "PixivNotFoundError", { enumerable: true, get: function () { return errors_1.PixivNotFoundError; } });
|
|
45
|
+
Object.defineProperty(exports, "PixivServerError", { enumerable: true, get: function () { return errors_1.PixivServerError; } });
|
|
46
|
+
Object.defineProperty(exports, "PixivCircuitOpenError", { enumerable: true, get: function () { return errors_1.PixivCircuitOpenError; } });
|
|
47
|
+
Object.defineProperty(exports, "PixivAbortError", { enumerable: true, get: function () { return errors_1.PixivAbortError; } });
|
|
48
|
+
Object.defineProperty(exports, "PixivApiError", { enumerable: true, get: function () { return errors_1.PixivApiError; } });
|
|
49
|
+
Object.defineProperty(exports, "isPixivError", { enumerable: true, get: function () { return errors_1.isPixivError; } });
|
|
50
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;GAOG;;;AAEH,mCAA0D;AAAjD,qGAAA,WAAW,OAAA;AAAE,2GAAA,iBAAiB,OAAA;AAGvC,sCAAkE;AAAzD,4GAAA,mBAAmB,OAAA;AAAE,sGAAA,aAAa,OAAA;AAG3C,4DAKoC;AAJlC,8GAAA,aAAa,OAAA;AACb,0HAAA,yBAAyB,OAAA;AACzB,mHAAA,kBAAkB,OAAA;AAClB,gHAAA,eAAe,OAAA;AAEjB,mDAAkD;AAAzC,sGAAA,SAAS,OAAA;AAElB,2CAAmD;AAA1C,sGAAA,QAAQ,OAAA;AAAE,uGAAA,SAAS,OAAA;AAE5B,6CAM2B;AALzB,2GAAA,gBAAgB,OAAA;AAChB,oGAAA,SAAS,OAAA;AACT,kGAAA,OAAO,OAAA;AACP,mGAAA,QAAQ,OAAA;AACR,mGAAA,QAAQ,OAAA;AA0CV,mCAAwC;AAA/B,sGAAA,YAAY,OAAA;AAGrB,0CAcyB;AAbvB,oGAAA,UAAU,OAAA;AACV,wGAAA,cAAc,OAAA;AACd,2GAAA,iBAAiB,OAAA;AACjB,2GAAA,iBAAiB,OAAA;AACjB,6GAAA,mBAAmB,OAAA;AACnB,kHAAA,wBAAwB,OAAA;AACxB,6GAAA,mBAAmB,OAAA;AACnB,4GAAA,kBAAkB,OAAA;AAClB,0GAAA,gBAAgB,OAAA;AAChB,+GAAA,qBAAqB,OAAA;AACrB,yGAAA,eAAe,OAAA;AACf,uGAAA,aAAa,OAAA;AACb,sGAAA,YAAY,OAAA"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal structured logger port. Default is silent; hosts inject their own
|
|
3
|
+
* logger when wiring the client. The kit never logs credentials: the
|
|
4
|
+
* transport emits request events with URLs/hosts only.
|
|
5
|
+
*/
|
|
6
|
+
export interface KitLogger {
|
|
7
|
+
debug(message: string, meta?: Record<string, unknown>): void;
|
|
8
|
+
info(message: string, meta?: Record<string, unknown>): void;
|
|
9
|
+
warn(message: string, meta?: Record<string, unknown>): void;
|
|
10
|
+
error(message: string, meta?: Record<string, unknown>): void;
|
|
11
|
+
}
|
|
12
|
+
export declare const silentLogger: KitLogger;
|
|
13
|
+
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.d.ts","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,MAAM,WAAW,SAAS;IACxB,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC7D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;IAC5D,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,CAAC;CAC9D;AAED,eAAO,MAAM,YAAY,EAAE,SAK1B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"logger.js","sourceRoot":"","sources":["../src/logger.ts"],"names":[],"mappings":";;;AAYa,QAAA,YAAY,GAAc;IACrC,KAAK,KAAI,CAAC;IACV,IAAI,KAAI,CAAC;IACT,IAAI,KAAI,CAAC;IACT,KAAK,KAAI,CAAC;CACX,CAAC"}
|
|
@@ -0,0 +1,112 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Pixiv domain models as returned by the public App API
|
|
3
|
+
* (https://app-api.pixiv.net). These are wire-shape interfaces (snake_case
|
|
4
|
+
* matches Pixiv), intentionally uncoupled from any host application types.
|
|
5
|
+
*/
|
|
6
|
+
export interface PixivUser {
|
|
7
|
+
id: string;
|
|
8
|
+
name: string;
|
|
9
|
+
account?: string;
|
|
10
|
+
profile_image_urls?: Record<string, string>;
|
|
11
|
+
}
|
|
12
|
+
export interface PixivTag {
|
|
13
|
+
name: string;
|
|
14
|
+
translated_name?: string;
|
|
15
|
+
add_by_uploaded_user?: boolean;
|
|
16
|
+
}
|
|
17
|
+
export interface PixivImageUrls {
|
|
18
|
+
square_medium: string;
|
|
19
|
+
medium: string;
|
|
20
|
+
large: string;
|
|
21
|
+
original?: string;
|
|
22
|
+
}
|
|
23
|
+
export interface PixivIllustPage {
|
|
24
|
+
image_urls: PixivImageUrls;
|
|
25
|
+
meta_single_page?: {
|
|
26
|
+
original_image_url?: string;
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
export interface PixivSeries {
|
|
30
|
+
id: number;
|
|
31
|
+
title: string;
|
|
32
|
+
}
|
|
33
|
+
export interface PixivIllust {
|
|
34
|
+
id: number;
|
|
35
|
+
title: string;
|
|
36
|
+
type?: 'illust' | 'manga' | 'ugoira';
|
|
37
|
+
/** Detail responses use illust_type; search/list responses use type. */
|
|
38
|
+
illust_type?: 'illust' | 'manga' | 'ugoira';
|
|
39
|
+
page_count: number;
|
|
40
|
+
user: PixivUser;
|
|
41
|
+
image_urls: {
|
|
42
|
+
square_medium: string;
|
|
43
|
+
medium: string;
|
|
44
|
+
large: string;
|
|
45
|
+
};
|
|
46
|
+
meta_single_page?: {
|
|
47
|
+
original_image_url?: string;
|
|
48
|
+
};
|
|
49
|
+
meta_pages?: PixivIllustPage[];
|
|
50
|
+
create_date: string;
|
|
51
|
+
caption?: string;
|
|
52
|
+
total_bookmarks?: number;
|
|
53
|
+
total_view?: number;
|
|
54
|
+
bookmark_count?: number;
|
|
55
|
+
view_count?: number;
|
|
56
|
+
width?: number;
|
|
57
|
+
height?: number;
|
|
58
|
+
sanity_level?: number;
|
|
59
|
+
x_restrict?: number;
|
|
60
|
+
illust_ai_type?: number;
|
|
61
|
+
series?: PixivSeries | null;
|
|
62
|
+
tags?: PixivTag[];
|
|
63
|
+
}
|
|
64
|
+
export type PixivIllustPageItem = PixivIllustPage;
|
|
65
|
+
export interface PixivNovel {
|
|
66
|
+
id: number;
|
|
67
|
+
title: string;
|
|
68
|
+
user: PixivUser;
|
|
69
|
+
create_date: string;
|
|
70
|
+
caption?: string;
|
|
71
|
+
text_length?: number;
|
|
72
|
+
total_bookmarks?: number;
|
|
73
|
+
total_view?: number;
|
|
74
|
+
bookmark_count?: number;
|
|
75
|
+
view_count?: number;
|
|
76
|
+
x_restrict?: number;
|
|
77
|
+
series?: PixivSeries | null;
|
|
78
|
+
tags?: PixivTag[];
|
|
79
|
+
image_urls?: Record<string, string>;
|
|
80
|
+
}
|
|
81
|
+
export interface PixivNovelTextResponse {
|
|
82
|
+
novel_text: string;
|
|
83
|
+
/**
|
|
84
|
+
* Marker/next-url style fields are endpoint-specific; the webview fallback
|
|
85
|
+
* parses only the text. Hosts should not rely on other fields.
|
|
86
|
+
*/
|
|
87
|
+
[key: string]: unknown;
|
|
88
|
+
}
|
|
89
|
+
export interface UgoiraFrame {
|
|
90
|
+
file: string;
|
|
91
|
+
delay: number;
|
|
92
|
+
}
|
|
93
|
+
export interface UgoiraMetadata {
|
|
94
|
+
zip_urls: {
|
|
95
|
+
medium?: string;
|
|
96
|
+
original?: string;
|
|
97
|
+
};
|
|
98
|
+
frames: UgoiraFrame[];
|
|
99
|
+
silence_before?: number;
|
|
100
|
+
silence_after?: number;
|
|
101
|
+
}
|
|
102
|
+
/** Common envelope for Pixiv paginated list responses. */
|
|
103
|
+
export interface PixivListResponse<T> {
|
|
104
|
+
next_url: string | null;
|
|
105
|
+
[key: string]: unknown;
|
|
106
|
+
}
|
|
107
|
+
export interface Paginated<T> {
|
|
108
|
+
items: T[];
|
|
109
|
+
/** Opaque next-page token (currently a full Pixiv next_url). */
|
|
110
|
+
nextCursor: string | null;
|
|
111
|
+
}
|
|
112
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,MAAM,WAAW,SAAS;IACxB,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,kBAAkB,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CAC7C;AAED,MAAM,WAAW,QAAQ;IACvB,IAAI,EAAE,MAAM,CAAC;IACb,eAAe,CAAC,EAAE,MAAM,CAAC;IACzB,oBAAoB,CAAC,EAAE,OAAO,CAAC;CAChC;AAED,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,MAAM,CAAC;IACtB,MAAM,EAAE,MAAM,CAAC;IACf,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB;AAED,MAAM,WAAW,eAAe;IAC9B,UAAU,EAAE,cAAc,CAAC;IAC3B,gBAAgB,CAAC,EAAE;QAAE,kBAAkB,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;CACpD;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,IAAI,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IACrC,wEAAwE;IACxE,WAAW,CAAC,EAAE,QAAQ,GAAG,OAAO,GAAG,QAAQ,CAAC;IAC5C,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,SAAS,CAAC;IAChB,UAAU,EAAE;QACV,aAAa,EA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AU,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;CACrC;AAED,MAAM,WAAW,sBAAsB;IACrC,UAAU,EAAE,MAAM,CAAC;IACnB;;;OAGG;IACH,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,cAAc;IAC7B,QAAQ,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,CAAC;QAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;KAAE,CAAC;IACjD,MAAM,EAAE,WAAW,EAAE,CAAC;IACtB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,aAAa,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,0DAA0D;AAC1D,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,QAAQ,EAAE,MAAM,GAAG,IAAI,CAAC;IACxB,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAC;CACxB;AAED,MAAM,WAAW,SAAS,CAAC,CAAC;IAC1B,KAAK,EAAE,CAAC,EAAE,CAAC;IACX,gEAAgE;IAChE,UAAU,EAAE,MAAM,GAAG,IAAI,CAAC;CAC3B"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Pixiv domain models as returned by the public App API
|
|
4
|
+
* (https://app-api.pixiv.net). These are wire-shape interfaces (snake_case
|
|
5
|
+
* matches Pixiv), intentionally uncoupled from any host application types.
|
|
6
|
+
*/
|
|
7
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
8
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/models/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { PaginationOptions } from './types';
|
|
2
|
+
import type { Paginated } from './models';
|
|
3
|
+
/**
|
|
4
|
+
* Walk a Pixiv `next_url` page chain one page at a time. This never performs
|
|
5
|
+
* unbounded auto-pagination: callers pass `limit`/`maxPages` and can abort.
|
|
6
|
+
* The transport's global gate spaces the requests; there is no extra delay
|
|
7
|
+
* parameter here.
|
|
8
|
+
*/
|
|
9
|
+
export declare function paginate<T>(fetchPage: (cursor: string | null, signal?: AbortSignal) => Promise<{
|
|
10
|
+
items: T[];
|
|
11
|
+
next: string | null;
|
|
12
|
+
}>, options?: PaginationOptions): Promise<Paginated<T>>;
|
|
13
|
+
/**
|
|
14
|
+
* Fetch exactly ONE page (the first page when no cursor is given).
|
|
15
|
+
* Used by host applications that own their pagination loop (PixivFlow's
|
|
16
|
+
* date-aware search stops early).
|
|
17
|
+
*/
|
|
18
|
+
export declare function firstPage<T>(fetchPage: (cursor: string | null, signal?: AbortSignal) => Promise<{
|
|
19
|
+
items: T[];
|
|
20
|
+
next: string | null;
|
|
21
|
+
}>, cursor?: string | null, signal?: AbortSignal): Promise<Paginated<T>>;
|
|
22
|
+
//# sourceMappingURL=pagination.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.d.ts","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,UAAU,CAAC;AAE1C;;;;;GAKG;AACH,wBAAsB,QAAQ,CAAC,CAAC,EAC9B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,EACxG,OAAO,GAAE,iBAAsB,GAC9B,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAmBvB;AAED;;;;GAIG;AACH,wBAAsB,SAAS,CAAC,CAAC,EAC/B,SAAS,EAAE,CAAC,MAAM,EAAE,MAAM,GAAG,IAAI,EAAE,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC;IAAE,KAAK,EAAE,CAAC,EAAE,CAAC;IAAC,IAAI,EAAE,MAAM,GAAG,IAAI,CAAA;CAAE,CAAC,EACxG,MAAM,CAAC,EAAE,MAAM,GAAG,IAAI,EACtB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,SAAS,CAAC,CAAC,CAAC,CAAC,CAGvB"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.paginate = paginate;
|
|
4
|
+
exports.firstPage = firstPage;
|
|
5
|
+
/**
|
|
6
|
+
* Walk a Pixiv `next_url` page chain one page at a time. This never performs
|
|
7
|
+
* unbounded auto-pagination: callers pass `limit`/`maxPages` and can abort.
|
|
8
|
+
* The transport's global gate spaces the requests; there is no extra delay
|
|
9
|
+
* parameter here.
|
|
10
|
+
*/
|
|
11
|
+
async function paginate(fetchPage, options = {}) {
|
|
12
|
+
const items = [];
|
|
13
|
+
const limit = options.limit;
|
|
14
|
+
const maxPages = options.maxPages ?? (limit ? Math.ceil(limit / 30) + 5 : 10);
|
|
15
|
+
let cursor = options.cursor ?? null;
|
|
16
|
+
for (let page = 0; page < maxPages; page++) {
|
|
17
|
+
if (options.signal?.aborted)
|
|
18
|
+
break;
|
|
19
|
+
const result = await fetchPage(cursor, options.signal);
|
|
20
|
+
items.push(...result.items);
|
|
21
|
+
options.onPage?.(page, items.length);
|
|
22
|
+
cursor = result.next;
|
|
23
|
+
if (!cursor || !result.items.length)
|
|
24
|
+
break;
|
|
25
|
+
if (limit !== undefined && items.length >= limit)
|
|
26
|
+
break;
|
|
27
|
+
}
|
|
28
|
+
const sliced = limit !== undefined ? items.slice(0, limit) : items;
|
|
29
|
+
const more = items.length > sliced.length || (cursor !== null && sliced.length === items.length);
|
|
30
|
+
return { items: sliced, nextCursor: more ? cursor : null };
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Fetch exactly ONE page (the first page when no cursor is given).
|
|
34
|
+
* Used by host applications that own their pagination loop (PixivFlow's
|
|
35
|
+
* date-aware search stops early).
|
|
36
|
+
*/
|
|
37
|
+
async function firstPage(fetchPage, cursor, signal) {
|
|
38
|
+
const result = await fetchPage(cursor ?? null, signal);
|
|
39
|
+
return { items: result.items, nextCursor: result.next };
|
|
40
|
+
}
|
|
41
|
+
//# sourceMappingURL=pagination.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"pagination.js","sourceRoot":"","sources":["../src/pagination.ts"],"names":[],"mappings":";;AASA,4BAsBC;AAOD,8BAOC;AA1CD;;;;;GAKG;AACI,KAAK,UAAU,QAAQ,CAC5B,SAAwG,EACxG,UAA6B,EAAE;IAE/B,MAAM,KAAK,GAAQ,EAAE,CAAC;IACtB,MAAM,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;IAC5B,MAAM,QAAQ,GAAG,OAAO,CAAC,QAAQ,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,KAAK,GAAG,EAAE,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;IAC9E,IAAI,MAAM,GAAG,OAAO,CAAC,MAAM,IAAI,IAAI,CAAC;IAEpC,KAAK,IAAI,IAAI,GAAG,CAAC,EAAE,IAAI,GAAG,QAAQ,EAAE,IAAI,EAAE,EAAE,CAAC;QAC3C,IAAI,OAAO,CAAC,MAAM,EAAE,OAAO;YAAE,MAAM;QACnC,MAAM,MAAM,GAAG,MAAM,SAAS,CAAC,MAAM,EAAE,OAAO,CAAC,MAAM,CAAC,CAAC;QACvD,KAAK,CAAC,IAAI,CAAC,GAAG,M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