pixivflow 2.14.0 → 2.16.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 +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/OutboxCommand.d.ts.map +1 -1
- package/dist/commands/OutboxCommand.js +49 -2
- package/dist/commands/OutboxCommand.js.map +1 -1
- package/dist/commands/RandomDownloadCommand.js +4 -4
- package/dist/commands/RandomDownloadCommand.js.map +1 -1
- package/dist/commands/RunsCommand.d.ts +21 -0
- package/dist/commands/RunsCommand.d.ts.map +1 -0
- package/dist/commands/RunsCommand.js +65 -0
- package/dist/commands/RunsCommand.js.map +1 -0
- 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/VersionCommand.d.ts +2 -0
- package/dist/commands/VersionCommand.d.ts.map +1 -1
- package/dist/commands/VersionCommand.js +10 -46
- package/dist/commands/VersionCommand.js.map +1 -1
- 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 +2 -2
- package/dist/commands/scheduler-runtime.d.ts.map +1 -1
- package/dist/commands/scheduler-runtime.js +6 -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/delivery/DeliveryDispatcher.d.ts +3 -0
- package/dist/delivery/DeliveryDispatcher.d.ts.map +1 -1
- package/dist/delivery/DeliveryDispatcher.js +6 -2
- package/dist/delivery/DeliveryDispatcher.js.map +1 -1
- package/dist/delivery/HttpMultipartDelivery.d.ts +13 -0
- package/dist/delivery/HttpMultipartDelivery.d.ts.map +1 -1
- package/dist/delivery/HttpMultipartDelivery.js +34 -19
- package/dist/delivery/HttpMultipartDelivery.js.map +1 -1
- package/dist/delivery/OutboxWorker.d.ts +14 -0
- package/dist/delivery/OutboxWorker.d.ts.map +1 -1
- package/dist/delivery/OutboxWorker.js +120 -5
- package/dist/delivery/OutboxWorker.js.map +1 -1
- package/dist/delivery/errorClass.d.ts +12 -0
- package/dist/delivery/errorClass.d.ts.map +1 -0
- package/dist/delivery/errorClass.js +34 -0
- package/dist/delivery/errorClass.js.map +1 -0
- 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/index.js +1 -1
- package/dist/index.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/scheduler/SlotCoordinator.d.ts +7 -0
- package/dist/scheduler/SlotCoordinator.d.ts.map +1 -1
- package/dist/scheduler/SlotCoordinator.js +26 -0
- package/dist/scheduler/SlotCoordinator.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 +30 -0
- package/dist/storage/DatabaseMigration.js.map +1 -1
- package/dist/storage/repositories/OutboxRepository.d.ts +56 -0
- package/dist/storage/repositories/OutboxRepository.d.ts.map +1 -1
- package/dist/storage/repositories/OutboxRepository.js +189 -0
- package/dist/storage/repositories/OutboxRepository.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/redact.d.ts +14 -0
- package/dist/utils/redact.d.ts.map +1 -0
- package/dist/utils/redact.js +47 -0
- package/dist/utils/redact.js.map +1 -0
- package/dist/utils/token-maintenance.d.ts +1 -1
- package/dist/utils/token-maintenance.d.ts.map +1 -1
- package/dist/version.d.ts +5 -0
- package/dist/version.d.ts.map +1 -0
- package/dist/version.js +6 -0
- package/dist/version.js.map +1 -0
- 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/package.json +11 -4
- package/dist/pixiv/IPixivRequestHandler.d.ts +0 -26
- package/dist/pixiv/IPixivRequestHandler.d.ts.map +0 -1
- package/dist/pixiv/IPixivRequestHandler.js +0 -3
- 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
- package/dist/pixiv/types.js +0 -6
- package/dist/pixiv/types.js.map +0 -1
package/dist/pixiv/AuthClient.js
CHANGED
|
@@ -1,192 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
-
var ownKeys = function(o) {
|
|
20
|
-
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
-
var ar = [];
|
|
22
|
-
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
-
return ar;
|
|
24
|
-
};
|
|
25
|
-
return ownKeys(o);
|
|
26
|
-
};
|
|
27
|
-
return function (mod) {
|
|
28
|
-
if (mod && mod.__esModule) return mod;
|
|
29
|
-
var result = {};
|
|
30
|
-
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
-
__setModuleDefault(result, mod);
|
|
32
|
-
return result;
|
|
33
|
-
};
|
|
34
|
-
})();
|
|
35
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
3
|
exports.PixivAuth = void 0;
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
class PixivAuth {
|
|
45
|
-
credentials;
|
|
46
|
-
network;
|
|
47
|
-
database;
|
|
48
|
-
configPath;
|
|
49
|
-
constructor(credentials, network, database, configPath) {
|
|
50
|
-
this.credentials = credentials;
|
|
51
|
-
this.network = network;
|
|
52
|
-
this.database = database;
|
|
53
|
-
this.configPath = configPath;
|
|
54
|
-
}
|
|
55
|
-
async getAccessToken() {
|
|
56
|
-
const cached = this.database.getToken(TOKEN_CACHE_KEY);
|
|
57
|
-
if (cached && cached.accessToken && cached.expiresAt > Date.now() + 60_000) {
|
|
58
|
-
return cached.accessToken;
|
|
59
|
-
}
|
|
60
|
-
const refreshed = await this.refreshAccessToken();
|
|
61
|
-
return refreshed.accessToken;
|
|
62
|
-
}
|
|
63
|
-
async refreshAccessToken() {
|
|
64
|
-
const url = 'https://oauth.secure.pixiv.net/auth/token';
|
|
65
|
-
let lastError;
|
|
66
|
-
for (let attempt = 0; attempt < (this.network.retries ?? 3); attempt++) {
|
|
67
|
-
try {
|
|
68
|
-
const body = new URLSearchParams({
|
|
69
|
-
client_id: this.credentials.clientId,
|
|
70
|
-
client_secret: this.credentials.clientSecret,
|
|
71
|
-
grant_type: 'refresh_token',
|
|
72
|
-
refresh_token: this.credentials.refreshToken,
|
|
73
|
-
include_policy: 'true',
|
|
74
|
-
});
|
|
75
|
-
const clientTime = new Date().toISOString();
|
|
76
|
-
const headers = {
|
|
77
|
-
'User-Agent': this.credentials.userAgent,
|
|
78
|
-
'Content-Type': 'application/x-www-form-urlencoded',
|
|
79
|
-
'X-Client-Time': clientTime,
|
|
80
|
-
'X-Client-Hash': this.generateClientHash(clientTime),
|
|
81
|
-
};
|
|
82
|
-
const controller = new AbortController();
|
|
83
|
-
const timeout = setTimeout(() => controller.abort(), this.network.timeoutMs);
|
|
84
|
-
try {
|
|
85
|
-
// Route the token refresh through the configured proxy when enabled:
|
|
86
|
-
// native fetch ignores HTTP(S)_PROXY env, so a plain fetch here would
|
|
87
|
-
// bypass the proxy on servers that can only reach Pixiv through it.
|
|
88
|
-
const fetchOptions = {
|
|
89
|
-
method: 'POST',
|
|
90
|
-
body,
|
|
91
|
-
headers,
|
|
92
|
-
signal: controller.signal,
|
|
93
|
-
};
|
|
94
|
-
const proxy = this.network?.proxy;
|
|
95
|
-
if (proxy?.enabled && proxy.host && proxy.port) {
|
|
96
|
-
const { ProxyAgent } = require('undici');
|
|
97
|
-
const proto = (proxy.protocol || 'http').toLowerCase();
|
|
98
|
-
const auth = proxy.username && proxy.password
|
|
99
|
-
? `${encodeURIComponent(proxy.username)}:${encodeURIComponent(proxy.password)}@`
|
|
100
|
-
: '';
|
|
101
|
-
fetchOptions.dispatcher = new ProxyAgent(`${proto}://${auth}${proxy.host}:${proxy.port}`);
|
|
102
|
-
}
|
|
103
|
-
const response = await fetch(url, fetchOptions);
|
|
104
|
-
if (!response.ok) {
|
|
105
|
-
// Check for authentication errors (401, 403) which indicate refresh token is invalid/expired
|
|
106
|
-
if (response.status === 401 || response.status === 403) {
|
|
107
|
-
const errorMessage = `Pixiv authentication failed (HTTP ${response.status}): Your refresh token is invalid or has expired.`;
|
|
108
|
-
throw new errors_1.AuthenticationError(errorMessage);
|
|
109
|
-
}
|
|
110
|
-
throw new Error(`Failed to refresh token: ${response.status} ${response.statusText}`);
|
|
111
|
-
}
|
|
112
|
-
const data = (await response.json());
|
|
113
|
-
const expiresAt = Date.now() + data.expires_in * 1000;
|
|
114
|
-
const stored = {
|
|
115
|
-
accessToken: data.access_token,
|
|
116
|
-
expiresAt,
|
|
117
|
-
refreshToken: data.refresh_token,
|
|
118
|
-
tokenType: data.token_type,
|
|
119
|
-
};
|
|
120
|
-
this.database.setToken(TOKEN_CACHE_KEY, stored);
|
|
121
|
-
// CRITICAL: Auto-update refresh token in all storage locations
|
|
122
|
-
// This ensures the refresh token never expires and is always up-to-date
|
|
123
|
-
if (data.refresh_token && data.refresh_token !== this.credentials.refreshToken) {
|
|
124
|
-
logger_1.logger.info('Received updated refresh token, updating all storage locations');
|
|
125
|
-
// Update internal credentials immediately
|
|
126
|
-
this.credentials.refreshToken = data.refresh_token;
|
|
127
|
-
// 1. Store in database (primary storage)
|
|
128
|
-
this.database.setToken(REFRESH_TOKEN_CACHE_KEY, {
|
|
129
|
-
accessToken: '',
|
|
130
|
-
expiresAt,
|
|
131
|
-
refreshToken: data.refresh_token,
|
|
132
|
-
tokenType: data.token_type,
|
|
133
|
-
});
|
|
134
|
-
logger_1.logger.debug('✓ Token saved to database');
|
|
135
|
-
// 2. Store in file system (unified storage)
|
|
136
|
-
try {
|
|
137
|
-
const { saveTokenToStorage } = await Promise.resolve().then(() => __importStar(require('../utils/token-manager')));
|
|
138
|
-
const databasePath = this.database ? this.database.databasePath : undefined;
|
|
139
|
-
saveTokenToStorage(data.refresh_token, databasePath);
|
|
140
|
-
logger_1.logger.debug('✓ Token saved to file system');
|
|
141
|
-
}
|
|
142
|
-
catch (error) {
|
|
143
|
-
logger_1.logger.warn('Failed to save token to file system', {
|
|
144
|
-
error: error instanceof Error ? error.message : String(error),
|
|
145
|
-
});
|
|
146
|
-
}
|
|
147
|
-
// 3. Auto-update config file to ensure refresh token never expires
|
|
148
|
-
// This is the key to "one-time setup, forever working" solution
|
|
149
|
-
if (this.configPath) {
|
|
150
|
-
try {
|
|
151
|
-
await (0, login_helper_1.updateConfigWithToken)(this.configPath, data.refresh_token);
|
|
152
|
-
logger_1.logger.debug('✓ Config file automatically updated with new refresh token');
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
logger_1.logger.warn('Failed to update config file with new refresh token', {
|
|
156
|
-
error: error instanceof Error ? error.message : String(error),
|
|
157
|
-
});
|
|
158
|
-
// Don't throw - other storage updates succeeded
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
logger_1.logger.info('✓ Refresh token updated in all storage locations');
|
|
162
|
-
}
|
|
163
|
-
logger_1.logger.info('Refreshed Pixiv access token');
|
|
164
|
-
return stored;
|
|
165
|
-
}
|
|
166
|
-
finally {
|
|
167
|
-
clearTimeout(timeout);
|
|
168
|
-
}
|
|
169
|
-
}
|
|
170
|
-
catch (error) {
|
|
171
|
-
lastError = error;
|
|
172
|
-
// If it's an authentication error, don't retry - the token is definitely invalid
|
|
173
|
-
if (error instanceof errors_1.AuthenticationError) {
|
|
174
|
-
throw error;
|
|
175
|
-
}
|
|
176
|
-
logger_1.logger.warn('Refresh token attempt failed', { attempt: attempt + 1, error: `${error}` });
|
|
177
|
-
await (0, promises_1.setTimeout)(Math.min(1000 * (attempt + 1), 5000));
|
|
178
|
-
}
|
|
179
|
-
}
|
|
180
|
-
// Check if the last error was an authentication error
|
|
181
|
-
if (lastError instanceof errors_1.AuthenticationError) {
|
|
182
|
-
throw lastError;
|
|
183
|
-
}
|
|
184
|
-
throw new Error(`Unable to refresh Pixiv token after ${this.network.retries} attempts: ${lastError}`);
|
|
185
|
-
}
|
|
186
|
-
generateClientHash(time) {
|
|
187
|
-
const salt = '28c1fdd170a5204386cb1313c7077b32';
|
|
188
|
-
return (0, node_crypto_1.createHash)('md5').update(time + salt).digest('hex');
|
|
189
|
-
}
|
|
190
|
-
}
|
|
191
|
-
exports.PixivAuth = PixivAuth;
|
|
4
|
+
/**
|
|
5
|
+
* @deprecated Pixiv OAuth/refresh-token handling is PixivFlow product code and
|
|
6
|
+
* now lives at `../auth/PixivAuth`. This shim preserves the old import path.
|
|
7
|
+
* The reusable kit only consumes access tokens via AccessTokenProvider.
|
|
8
|
+
*/
|
|
9
|
+
var PixivAuth_1 = require("../auth/PixivAuth");
|
|
10
|
+
Object.defineProperty(exports, "PixivAuth", { enumerable: true, get: function () { return PixivAuth_1.PixivAuth; } });
|
|
192
11
|
//# sourceMappingURL=AuthClient.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"AuthClient.js","sourceRoot":"","sources":["../../src/pixiv/AuthClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"AuthClient.js","sourceRoot":"","sources":["../../src/pixiv/AuthClient.ts"],"names":[],"mappings":";;;AAAA;;;;GAIG;AACH,+CAA8C;AAArC,sGAAA,SAAS,OAAA"}
|
|
@@ -1,157 +1,15 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
private readonly novelService;
|
|
16
|
-
private readonly mediaService;
|
|
17
|
-
private readonly searchService;
|
|
18
|
-
constructor(auth: PixivAuth, config: StandaloneConfig);
|
|
19
|
-
/** Process-wide Pixiv rate-limit gate (used by doctor/health). */
|
|
20
|
-
getRateLimiter(): RateLimitCoordinator;
|
|
21
|
-
/**
|
|
22
|
-
* Safely parse date string to timestamp
|
|
23
|
-
* Returns 0 for invalid dates to ensure consistent sorting
|
|
24
|
-
* @deprecated Use parsePixivDate from pixiv-utils instead
|
|
25
|
-
*/
|
|
26
|
-
private parseDate;
|
|
27
|
-
/**
|
|
28
|
-
* Parse date range from target config
|
|
29
|
-
* Returns { startDate, endDate } as Date objects, or null if invalid
|
|
30
|
-
* Validates that startDate <= endDate
|
|
31
|
-
*/
|
|
32
|
-
private parseDateRange;
|
|
33
|
-
/**
|
|
34
|
-
* Check if item date is within the specified range
|
|
35
|
-
* Handles invalid dates gracefully
|
|
36
|
-
*/
|
|
37
|
-
private isDateInRange;
|
|
38
|
-
/**
|
|
39
|
-
* Search illustrations using target config
|
|
40
|
-
* Implements IPixivClient interface
|
|
41
|
-
*/
|
|
42
|
-
searchIllustrations(target: TargetConfig): Promise<PixivIllust[]>;
|
|
43
|
-
getTagAutocomplete(seed: string): Promise<PixivTag[]>;
|
|
44
|
-
searchIllustrationsForTags(seed: string, limit: number, options?: {
|
|
45
|
-
startDate?: string;
|
|
46
|
-
endDate?: string;
|
|
47
|
-
includeR18?: boolean;
|
|
48
|
-
}): Promise<PixivIllust[]>;
|
|
49
|
-
searchNovelsForTags(seed: string, limit: number, options?: {
|
|
50
|
-
startDate?: string;
|
|
51
|
-
endDate?: string;
|
|
52
|
-
includeR18?: boolean;
|
|
53
|
-
}): Promise<PixivNovel[]>;
|
|
54
|
-
/**
|
|
55
|
-
* Get current user information
|
|
56
|
-
* Implements IPixivClient interface
|
|
57
|
-
*/
|
|
58
|
-
getUser(): Promise<PixivUser>;
|
|
59
|
-
/**
|
|
60
|
-
* Get illustration details by ID
|
|
61
|
-
* Implements IPixivClient interface
|
|
62
|
-
*/
|
|
63
|
-
getIllustration(id: number): Promise<PixivIllust>;
|
|
64
|
-
/**
|
|
65
|
-
* Get novel details by ID
|
|
66
|
-
* Implements IPixivClient interface
|
|
67
|
-
*/
|
|
68
|
-
getNovel(id: number): Promise<PixivNovel>;
|
|
69
|
-
/**
|
|
70
|
-
* Get user illustrations
|
|
71
|
-
* Implements IPixivClient interface
|
|
72
|
-
*/
|
|
73
|
-
getUserIllustrations(userId: string, options?: {
|
|
74
|
-
limit?: number;
|
|
75
|
-
offset?: number;
|
|
76
|
-
}): Promise<PixivIllust[]>;
|
|
77
|
-
/**
|
|
78
|
-
* Get user novels
|
|
79
|
-
* Implements IPixivClient interface
|
|
80
|
-
*/
|
|
81
|
-
getUserNovels(userId: string, options?: {
|
|
82
|
-
limit?: number;
|
|
83
|
-
offset?: number;
|
|
84
|
-
}): Promise<PixivNovel[]>;
|
|
85
|
-
/**
|
|
86
|
-
* Search illustrations for a single tag (internal method)
|
|
87
|
-
*/
|
|
88
|
-
/**
|
|
89
|
-
* Search novels using target config
|
|
90
|
-
* Implements IPixivClient interface
|
|
91
|
-
*/
|
|
92
|
-
searchNovels(target: TargetConfig): Promise<PixivNovel[]>;
|
|
93
|
-
/**
|
|
94
|
-
* Search novels for a single tag (internal method)
|
|
95
|
-
*/
|
|
96
|
-
/**
|
|
97
|
-
* Get ranking illustrations
|
|
98
|
-
* @param mode Ranking mode (day, week, month, etc.)
|
|
99
|
-
* @param date Date in YYYY-MM-DD format (optional, defaults to today)
|
|
100
|
-
* @param limit Maximum number of results
|
|
101
|
-
*/
|
|
102
|
-
getRankingIllustrations(mode?: string, date?: string, limit?: number): Promise<PixivIllust[]>;
|
|
103
|
-
/**
|
|
104
|
-
* Get ranking novels
|
|
105
|
-
* @param mode Ranking mode (day, week, month, etc.)
|
|
106
|
-
* @param date Date in YYYY-MM-DD format (optional, defaults to today)
|
|
107
|
-
* @param limit Maximum number of results
|
|
108
|
-
*/
|
|
109
|
-
getRankingNovels(mode?: string, date?: string, limit?: number): Promise<PixivNovel[]>;
|
|
110
|
-
/**
|
|
111
|
-
* Get illustration detail with tags for filtering
|
|
112
|
-
*/
|
|
113
|
-
getIllustDetailWithTags(illustId: number): Promise<{
|
|
114
|
-
illust: PixivIllust;
|
|
115
|
-
tags: Array<{
|
|
116
|
-
name: string;
|
|
117
|
-
translated_name?: string;
|
|
118
|
-
}>;
|
|
119
|
-
}>;
|
|
120
|
-
/**
|
|
121
|
-
* Get novel detail with tags for filtering
|
|
122
|
-
*/
|
|
123
|
-
getNovelDetailWithTags(novelId: number): Promise<{
|
|
124
|
-
novel: PixivNovel;
|
|
125
|
-
tags: Array<{
|
|
126
|
-
name: string;
|
|
127
|
-
translated_name?: string;
|
|
128
|
-
}>;
|
|
129
|
-
}>;
|
|
130
|
-
getIllustDetail(illustId: number): Promise<PixivIllust>;
|
|
131
|
-
getNovelDetail(novelId: number): Promise<PixivNovel>;
|
|
132
|
-
/**
|
|
133
|
-
* Get novel text content
|
|
134
|
-
* Implements IPixivClient interface
|
|
135
|
-
*/
|
|
136
|
-
getNovelText(novelId: number): Promise<PixivNovelTextResponse>;
|
|
137
|
-
ugoiraMetadata(illustId: number): Promise<{
|
|
138
|
-
zip_urls: {
|
|
139
|
-
medium?: string;
|
|
140
|
-
original?: string;
|
|
141
|
-
};
|
|
142
|
-
frames: Array<{
|
|
143
|
-
file: string;
|
|
144
|
-
delay: number;
|
|
145
|
-
}>;
|
|
146
|
-
silence_before?: number;
|
|
147
|
-
silence_after?: number;
|
|
148
|
-
}>;
|
|
149
|
-
/**
|
|
150
|
-
* Get all novels in a series
|
|
151
|
-
*/
|
|
152
|
-
getNovelSeries(seriesId: number): Promise<PixivNovel[]>;
|
|
153
|
-
downloadImage(originalUrl: string): Promise<ArrayBuffer>;
|
|
154
|
-
private createRequestUrl;
|
|
155
|
-
private request;
|
|
156
|
-
}
|
|
1
|
+
/**
|
|
2
|
+
* @deprecated Import from `../pixiv-client/PixivFlowPixivClient` (product) or
|
|
3
|
+
* from `@redtidev/pixiv-client` (the independent kit). This module is a
|
|
4
|
+
* thin backward-compatibility shim for code that still imports the old path.
|
|
5
|
+
*
|
|
6
|
+
* The reusable Pixiv protocol/client code now lives in the
|
|
7
|
+
* `packages/pixiv-client` workspace package (@redtidev/pixiv-client). The
|
|
8
|
+
* class below is the PixivFlow-specific compatibility adapter (TargetConfig
|
|
9
|
+
* queries, product defaults) composed on top of it.
|
|
10
|
+
*/
|
|
11
|
+
export { PixivFlowPixivClient as PixivClient } from '../pixiv-client/PixivFlowPixivClient';
|
|
12
|
+
export { createPixivFlowClient } from '../pixiv-client/createPixivFlowClient';
|
|
13
|
+
export type { PixivFlowPixivClientOptions } from '../pixiv-client/PixivFlowPixivClient';
|
|
14
|
+
export type { PixivUser, PixivIllust, PixivNovel, PixivIllustPage, PixivNovelTextResponse, PixivTag, UgoiraMetadata, } from '@redtidev/pixiv-client';
|
|
157
15
|
//# sourceMappingURL=PixivClient.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PixivClient.d.ts","sourceRoot":"","sources":["../../src/pixiv/PixivClient.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PixivClient.d.ts","sourceRoot":"","sources":["../../src/pixiv/PixivClient.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AACH,OAAO,EAAE,oBAAoB,IAAI,WAAW,EAAE,MAAM,sCAAsC,CAAC;AAC3F,OAAO,EAAE,qBAAqB,EAAE,MAAM,uCAAuC,CAAC;AAC9E,YAAY,EAAE,2BAA2B,EAAE,MAAM,sCAAsC,CAAC;AAGxF,YAAY,EACV,SAAS,EACT,WAAW,EACX,UAAU,EACV,eAAe,EACf,sBAAsB,EACtB,QAAQ,EACR,cAAc,GACf,MAAM,wBAAwB,CAAC"}
|