From 8af78fd736244fc1c2c786760477f15660cdc451 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 18:05:15 -0400 Subject: [PATCH 1/9] fix --- src/index.ts | 2 ++ tsconfig.json | 4 +++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index e7e3cb8..076a53b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -76,6 +76,8 @@ export default class PixivApp { this._once = false if (options) { this.camelcaseKeys = Boolean(options.camelcaseKeys) as CamelcaseKeys + } else { + this.camelcaseKeys = true as CamelcaseKeys } } diff --git a/tsconfig.json b/tsconfig.json index d978a9f..48cff57 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -3,7 +3,9 @@ "compilerOptions": { "outDir": "dist", "strict": true, - "noImplicitAny": true + "noImplicitAny": true, + "declaration": true, + "declarationDir": "dist" }, "include": ["src", "declarations.d.ts"] } From 97a6671fff2e58f193bdd2ee1e9af3ac0cf21527 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 18:25:25 -0400 Subject: [PATCH 2/9] package.json --- package.json | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/package.json b/package.json index 5bc7c73..69437b3 100644 --- a/package.json +++ b/package.json @@ -34,7 +34,10 @@ ] }, "files": [ - "dist" + "dist", + "src", + "tsconfig.json", + "declarations.d.ts" ], "keywords": [ "pixiv", From 2fd07fab82d676d2aea0c5ee4682bae9792cfdc1 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 18:44:17 -0400 Subject: [PATCH 3/9] stopped ignoring dist (to install via github repo) --- .gitignore | 1 - dist/PixivTypes.d.ts | 313 +++++++++++++++++++++++++++++++++++ dist/PixivTypes.js | 3 + dist/PixivTypes.js.map | 1 + dist/Pixiv_Types.d.ts | 265 ++++++++++++++++++++++++++++++ dist/Pixiv_Types.js | 3 + dist/Pixiv_Types.js.map | 1 + dist/index.d.ts | 158 ++++++++++++++++++ dist/index.js | 355 ++++++++++++++++++++++++++++++++++++++++ dist/index.js.map | 1 + dist/index.test.d.ts | 1 + dist/index.test.js | 122 ++++++++++++++ dist/index.test.js.map | 1 + dist/test.d.ts | 1 + dist/test.js | 13 ++ dist/test.js.map | 1 + package.json | 5 +- 17 files changed, 1240 insertions(+), 5 deletions(-) create mode 100644 dist/PixivTypes.d.ts create mode 100644 dist/PixivTypes.js create mode 100644 dist/PixivTypes.js.map create mode 100644 dist/Pixiv_Types.d.ts create mode 100644 dist/Pixiv_Types.js create mode 100644 dist/Pixiv_Types.js.map create mode 100644 dist/index.d.ts create mode 100644 dist/index.js create mode 100644 dist/index.js.map create mode 100644 dist/index.test.d.ts create mode 100644 dist/index.test.js create mode 100644 dist/index.test.js.map create mode 100644 dist/test.d.ts create mode 100644 dist/test.js create mode 100644 dist/test.js.map diff --git a/.gitignore b/.gitignore index 2c6ebfe..de85933 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,3 @@ node_modules .envrc -dist .vscode diff --git a/dist/PixivTypes.d.ts b/dist/PixivTypes.d.ts new file mode 100644 index 0000000..05f1079 --- /dev/null +++ b/dist/PixivTypes.d.ts @@ -0,0 +1,313 @@ +export interface PixivClient { + accessToken: string + expiresIn: number + tokenType: string + scope: string + refreshToken: string + user: PixivClientUser + deviceToken: string +} +export interface PixivClientUser { + profileImageUrls: { + px16X16: string + px50X50: string + px170X170: string + } + id: string + name: string + account: string + mailAddress: string + isPremium: boolean + xRestrict: number + isMailAuthorized: boolean +} +export interface PixivRequestData { + clientId: string + clientSecret: string + getSecureUrl: string + grantType: string + refreshToken: string + username: string + password: string +} +export interface PixivParams { + userId?: number + type?: string + filter?: string + restrict?: 'public' | 'private' + illustId?: number + contentType?: string + includeTotalComments?: boolean + includeRankingLabel?: boolean + includeRankingIllusts?: boolean + includeRankingNovels?: boolean + mode?: + | 'day' + | 'week' + | 'month' + | 'day_male' + | 'day_female' + | 'week_original' + | 'week_rookie' + | 'day_r18' + | 'day_male_r18' + | 'day_female_r18' + | 'week_r18' + | 'week_r18g' + | 'day_manga' + | 'week_manga' + | 'month_manga' + | 'week_rookie_manga' + | 'day_r18_manga' + | 'week_r18_manga' + | 'week_r18g_manga' + word?: string + searchTarget?: + | 'partial_match_for_tags' + | 'exact_match_for_tags' + | 'title_and_caption' + sort?: 'date_desc' | 'date_asc' | 'popular_desc' + startDate?: string + endDate?: string +} +export interface PixivFetchOptions { + data?: string + method?: string + headers?: { + [header: string]: string + } + params?: PixivParams +} +export interface PixivUser { + id: number + name: string + account: string + profileImageUrls: { + medium: string + } + comment: string + isFollowed: boolean +} +export interface PixivUserDetail { + user: PixivUser + profile: { + webpage: string + gender: string + birth: string + birthDay: string + birthYear: number + region: string + addressId: number + countryCode: string + job: string + jobId: number + totalFollowUsers: number + totalMypixivUsers: number + totalIllusts: number + totalManga: number + totalNovels: number + totalIllustBookmarksPublic: number + totalIllustSeries: number + backgroundImageUrl: string + twitterAccount: string + twitterUrl: string + pawooUrl: string + isPremium: boolean + isUsingCustomProfileImage: boolean + } + profilePublicity: { + gender: string + region: string + birthDay: string + birthYear: string + job: string + pawoo: boolean + } + workspace: { + pc: string + monitor: string + tool: string + scanner: string + tablet: string + mouse: string + printer: string + desktop: string + music: string + desk: string + chair: string + comment: string + workspaceImageUrl: string | null + } +} +export interface PixivIllustSearch { + illusts: PixivIllust[] + nextUrl: string | null + searchSpanLimit?: number +} +export interface PixivUserSearch { + userPreviews: { + user: PixivUser + illusts: PixivIllust[] + novels: PixivNovel[] + isMuted: boolean + }[] + nextUrl: string | null +} +export interface PixivCommentSearch { + totalComments: number + comments: PixivComment[] + nextUrl: string | null +} +export interface PixivNovelSearch { + novels: PixivNovel[] + nextUrl: string | null + privacyPolicy?: {} + searchSpanLimit?: number +} +export interface PixivBookmarkSearch { + bookmarkTags: PixivTag[] + nextUrl: string | null +} +export interface PixivMangaSearch { + illusts: PixivManga[] + rankingIllusts: PixivManga[] | [] + privacyPolicy: {} + nextUrl: string | null +} +export interface PixivIllust { + id: number + title: string + type: string + imageUrls: { + squareMedium: string + medium: string + large?: string + } + caption: string + restrict: number + user: PixivUser + tags: PixivTag[] + tools: string[] + createDate: string + pageCount: number + width: number + height: number + sanityLevel: number + metaSinglePage: { + originalImageUrl?: string + } + metaPages: PixivMetaPage[] + totalView: number + totalBookmarks: number + isBookmarked: boolean + visible: boolean + isMuted: boolean + totalComments: number +} +export interface PixivTag { + name: string + translatedName: string | null + addedByUploadedUser?: boolean + illust?: PixivIllust + isRegistered?: boolean +} +export interface PixivMetaPage { + imageUrls: { + squareMedium: string + medium: string + large: string + original: string + } +} +export interface PixivComment { + id: number + comment: string + date: string + user: PixivUser + parentComment: PixivComment | {} +} +export interface PixivNovel { + id: number + title: string + caption: string + restrict: number + xRestrict: number + imageUrls: { + squareMedium: string + medium: string + large?: string + } + createDate: string + tags: PixivTag[] + pageCount: number + textLength: number + user: PixivUser + series: + | { + id: number + title: string + } + | {} + isBookmarked: boolean + totalBookmarks: number + totalView: number + visible: boolean + totalComments: number + isMuted: boolean + isMypixivOnly: boolean + isXRestricted: boolean +} +export interface PixivManga { + id: number + title: string + type: string + imageUrls: { + squareMedium: string + medium: string + large?: string + } + caption: string + restrict: number + user: PixivUser + tags: PixivTag[] + tools: string[] + createDate: string + pageCount: string + width: number + height: number + sanityLevel: number + xRestrict: number + series: { + id: number + title: string + } | null + metaSinglePage: {} + metaPages: PixivMetaPage[] + totalView: number + totalBookmarks: number + isBookmarked: boolean + visible: boolean + isMuted: boolean +} +export interface PixivTrendTags { + trend_tags: PixivTag[] +} +export interface PixivAutoComplete { + searchAutoCompleteKeywords: string[] +} +export interface PixivBookmarkDetail { + isBookmarked: boolean + tags: PixivTag[] + restrict: string +} +export interface UgoiraMetaData { + ugoiraMetadata: { + zipUrls: { + medium: string + } + frames: { + file: string + delay: number + }[] + } +} diff --git a/dist/PixivTypes.js b/dist/PixivTypes.js new file mode 100644 index 0000000..6332d90 --- /dev/null +++ b/dist/PixivTypes.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=PixivTypes.js.map \ No newline at end of file diff --git a/dist/PixivTypes.js.map b/dist/PixivTypes.js.map new file mode 100644 index 0000000..5aa3e1e --- /dev/null +++ b/dist/PixivTypes.js.map @@ -0,0 +1 @@ +{"version":3,"file":"PixivTypes.js","sourceRoot":"","sources":["../src/PixivTypes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/Pixiv_Types.d.ts b/dist/Pixiv_Types.d.ts new file mode 100644 index 0000000..88c3c45 --- /dev/null +++ b/dist/Pixiv_Types.d.ts @@ -0,0 +1,265 @@ +export interface Pixiv_Client { + access_token: string + expires_in: number + token_type: string + scope: string + refresh_token: string + user: Pixiv_Client_User + device_token: string +} +export interface Pixiv_Client_User { + profile_image_urls: { + px_16x16: string + px_50x50: string + px_170x170: string + } + id: string + name: string + account: string + mail_address: string + is_premium: boolean + x_restrict: number + is_mail_authorized: boolean +} +export interface Pixiv_Request_Data { + client_id: string + client_secret: string + get_secure_url: string + grant_type: string + refresh_token: string + username: string + password: string +} +export interface Pixiv_User { + id: number + name: string + account: string + profile_image_urls: { + medium: string + } + comment: string + is_followed: boolean +} +export interface Pixiv_User_Detail { + user: Pixiv_User + profile: { + webpage: string + gender: string + birth: string + birth_day: string + birth_year: number + region: string + address_id: number + country_code: string + job: string + job_id: number + total_follow_users: number + total_mypixiv_users: number + total_illusts: number + total_manga: number + total_novels: number + total_illust_bookmarks_public: number + total_illust_series: number + background_image_url: string + twitter_account: string + twitter_url: string + pawoo_url: string + is_premium: boolean + is_using_custom_profile_image: boolean + } + profile_publicity: { + gender: string + region: string + birth_day: string + birth_year: string + job: string + pawoo: boolean + } + workspace: { + pc: string + monitor: string + tool: string + scanner: string + tablet: string + mouse: string + printer: string + desktop: string + music: string + desk: string + chair: string + comment: string + workspace_image_url: string | null + } +} +export interface Pixiv_Illust_Search { + illusts: Pixiv_Illust[] + next_url: string | null + search_span_limit?: number +} +export interface Pixiv_User_Search { + user_previews: { + user: Pixiv_User + illusts: Pixiv_Illust[] + novels: Pixiv_Novel[] + is_muted: boolean + }[] + next_url: string | null +} +export interface Pixiv_Comment_Search { + total_comments: number + comments: Pixiv_Comment[] + next_url: string | null +} +export interface Pixiv_Novel_Search { + novels: Pixiv_Novel[] + next_url: string | null + privacy_policy?: {} + search_span_limit?: number +} +export interface Pixiv_Bookmark_Search { + bookmark_tags: Pixiv_Tag[] + next_url: string | null +} +export interface Pixiv_Manga_Search { + illusts: Pixiv_Manga[] + ranking_illusts: Pixiv_Manga[] | [] + privacy_policy: {} + next_url: string | null +} +export interface Pixiv_Illust { + id: number + title: string + type: string + image_urls: { + square_medium: string + medium: string + large?: string + } + caption: string + restrict: number + user: Pixiv_User + tags: Pixiv_Tag[] + tools: string[] + create_date: string + page_count: number + width: number + height: number + sanity_level: number + meta_single_page: { + original_image_url?: string + } + meta_pages: Pixiv_Meta_Page[] + total_view: number + total_bookmarks: number + is_bookmarked: boolean + visible: boolean + is_muted: boolean + total_comments: number +} +export interface Pixiv_Tag { + name: string + translated_name: string | null + added_by_uploaded_user?: boolean + illust?: Pixiv_Illust + is_registered?: boolean +} +export interface Pixiv_Meta_Page { + image_urls: { + square_medium: string + medium: string + large: string + original: string + } +} +export interface Pixiv_Comment { + id: number + comment: string + date: string + user: Pixiv_User + parent_comment: Pixiv_Comment | {} +} +export interface Pixiv_Novel { + id: number + title: string + caption: string + restrict: number + x_restrict: number + image_urls: { + square_medium: string + medium: string + large?: string + } + create_date: string + tags: Pixiv_Tag[] + page_count: number + text_length: number + user: Pixiv_User + series: + | { + id: number + title: string + } + | {} + is_bookmarked: boolean + total_bookmarks: number + total_view: number + visible: boolean + total_comments: number + is_muted: boolean + is_mypixiv_only: boolean + is_x_restricted: boolean +} +export interface Pixiv_Manga { + id: number + title: string + type: string + image_urls: { + square_medium: string + medium: string + large?: string + } + caption: string + restrict: number + user: Pixiv_User + tags: Pixiv_Tag[] + tools: string[] + create_date: string + page_count: string + width: number + height: number + sanity_level: number + x_restrict: number + series: { + id: number + title: string + } | null + meta_single_page: {} + meta_pages: Pixiv_Meta_Page[] + total_view: number + total_bookmarks: number + is_bookmarked: boolean + visible: boolean + is_muted: boolean +} +export interface Pixiv_Trend_Tags { + trend_tags: Pixiv_Tag[] +} +export interface Pixiv_Auto_Complete { + search_auto_complete_keywords: string[] +} +export interface Pixiv_Bookmark_Detail { + is_bookmarked: boolean + tags: Pixiv_Tag[] + restrict: string +} +export interface Ugoira_Meta_Data { + ugoira_metadata: { + zip_urls: { + medium: string + } + frames: { + file: string + delay: number + }[] + } +} diff --git a/dist/Pixiv_Types.js b/dist/Pixiv_Types.js new file mode 100644 index 0000000..9846cd1 --- /dev/null +++ b/dist/Pixiv_Types.js @@ -0,0 +1,3 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +//# sourceMappingURL=Pixiv_Types.js.map \ No newline at end of file diff --git a/dist/Pixiv_Types.js.map b/dist/Pixiv_Types.js.map new file mode 100644 index 0000000..38c043f --- /dev/null +++ b/dist/Pixiv_Types.js.map @@ -0,0 +1 @@ +{"version":3,"file":"Pixiv_Types.js","sourceRoot":"","sources":["../src/Pixiv_Types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts new file mode 100644 index 0000000..867aafa --- /dev/null +++ b/dist/index.d.ts @@ -0,0 +1,158 @@ +import { + Pixiv_Client, + Pixiv_User_Detail, + Pixiv_Illust_Search, + Pixiv_User_Search, + Pixiv_Illust, + Pixiv_Comment_Search, + Pixiv_Trend_Tags, + Pixiv_Novel_Search, + Pixiv_Auto_Complete, + Pixiv_Bookmark_Detail, + Pixiv_Bookmark_Search, + Ugoira_Meta_Data, + Pixiv_Manga_Search +} from './Pixiv_Types' +import { + PixivClient, + PixivIllustSearch, + PixivParams, + PixivFetchOptions, + PixivBookmarkDetail, + PixivBookmarkSearch, + PixivUserDetail, + PixivUserSearch, + PixivIllust, + PixivCommentSearch, + PixivNovelSearch, + PixivAutoComplete, + UgoiraMetaData, + PixivMangaSearch, + PixivTrendTags +} from './PixivTypes' +export default class PixivApp { + camelcaseKeys: B + private username + private password + private refreshToken + private nextUrl + private auth + private once + constructor( + username?: string, + password?: string, + options?: { + camelcaseKeys?: B + } + ) + login( + username?: string, + password?: string + ): Promise + authInfo(): B extends true ? PixivClient : Pixiv_Client + hasNext(): boolean + next(): Promise + nextQuery(): undefined | string + makeIterable(resp: any): AsyncIterable + userDetail( + id: number, + params?: PixivParams + ): Promise + userIllusts( + id: number, + params?: PixivParams + ): Promise + userFollowAdd(id: number, params?: PixivParams): Promise + userFollowDelete(id: number, params?: PixivParams): Promise + userBookmarksIllust( + id: number, + params?: PixivParams + ): Promise + userFollowing( + id: number, + params?: PixivParams + ): Promise + userFollower( + id: number, + params?: PixivParams + ): Promise + userMypixiv( + id: number, + params?: PixivParams + ): Promise + userList(id: number, params?: PixivParams): Promise + illustDetail( + id: number, + params?: PixivParams + ): Promise + illustNew( + params?: PixivParams + ): Promise + illustFollow( + id: number, + params?: PixivParams + ): Promise + illustComments( + id: number, + params?: PixivParams + ): Promise + illustRelated( + id: number, + params?: PixivParams + ): Promise + illustRecommended( + params?: PixivParams + ): Promise + illustRecommendedNologin( + params?: PixivParams + ): Promise + illustRanking( + params?: PixivParams + ): Promise + trendingTagsIllust( + params?: PixivParams + ): Promise + searchIllust( + word: string, + params?: PixivParams + ): Promise + searchNovel( + word: string, + params?: PixivParams + ): Promise + searchUser( + word: string, + params?: PixivParams + ): Promise + searchAutoComplete( + word: string + ): Promise + illustBookmarkDetail( + id: number, + params?: PixivParams + ): Promise + illustBookmarkAdd(id: number, params?: PixivParams): Promise + illustBookmarkDelete(id: number, params?: PixivParams): Promise + userBookmarkTagsIllust( + params?: PixivParams + ): Promise + novelRecommended( + params?: PixivParams + ): Promise + mangaNew(params?: PixivParams): Promise + mangaRecommended( + params?: PixivParams + ): Promise + novelRecommendedNologin( + params?: PixivParams + ): Promise + novelNew( + params?: PixivParams + ): Promise + ugoiraMetaData( + id: number, + params?: PixivParams + ): Promise + fetch(target: string, options?: PixivFetchOptions): Promise + private _get +} diff --git a/dist/index.js b/dist/index.js new file mode 100644 index 0000000..c55fb20 --- /dev/null +++ b/dist/index.js @@ -0,0 +1,355 @@ +"use strict"; +var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } +var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { + if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); + var g = generator.apply(thisArg, _arguments || []), i, q = []; + return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; + function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } + function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } + function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } + function fulfill(value) { resume("next", value); } + function reject(value) { resume("throw", value); } + function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } +}; +var __importStar = (this && this.__importStar) || function (mod) { + if (mod && mod.__esModule) return mod; + var result = {}; + if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; + result["default"] = mod; + return result; +}; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const querystring_1 = require("querystring"); +const crypto = __importStar(require("crypto")); +const url_1 = __importDefault(require("url")); +const axios_1 = __importDefault(require("axios")); +const decamelize_keys_1 = __importDefault(require("decamelize-keys")); +const camelcase_keys_1 = __importDefault(require("camelcase-keys")); +const baseURL = 'https://app-api.pixiv.net/'; +const instance = axios_1.default.create({ + baseURL, + headers: { + 'App-OS': 'ios', + 'App-OS-Version': '9.3.3', + 'App-Version': '6.0.9' + } +}); +const CLIENT_ID = 'MOBrBDS8blbauoSck0ZfDbtuzpyT'; +const CLIENT_SECRET = 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj'; +const HASH_SECRET = '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c'; +const filter = 'for_ios'; +class PixivApp { + constructor(username, password, options) { + this.camelcaseKeys = true; + this.username = username; + this.password = password; + this.refreshToken = ''; + this.nextUrl = null; + this.auth = null; + this.once = false; + if (options) { + this.camelcaseKeys = Boolean(options.camelcaseKeys); + } + } + async login(username, password) { + this.username = username || this.username; + this.password = password || this.password; + if (typeof this.username !== 'string' && typeof this.password !== 'string') { + return Promise.reject(new TypeError(`Auth is required. + Expected a string, got ${typeof this.username !== 'string' ? typeof this.username : typeof this.password}`)); + } + const local_time = new Date().toISOString(); + const headers = { + 'X-Client-Time': local_time, + 'X-Client-Hash': crypto + .createHash('md5') + .update(Buffer.from(`${local_time}${HASH_SECRET}`, 'utf8')) + .digest('hex') + }; + const data = { + clientId: CLIENT_ID, + clientSecret: CLIENT_SECRET, + getSecureUrl: '1', + grantType: '', + username: '', + password: '', + refreshToken: '' + }; + if (this.refreshToken === '') { + data.grantType = 'password'; + data.username = this.username; + data.password = this.password; + } + else { + data.grantType = 'refresh_token'; + data.refreshToken = this.refreshToken; + } + const axiosResponse = await axios_1.default.post('https://oauth.secure.pixiv.net/auth/token', querystring_1.stringify(decamelize_keys_1.default(data)), { headers }); + const { response } = axiosResponse.data; + this.auth = response; + this.refreshToken = axiosResponse.data.response.refresh_token; + instance.defaults.headers.common.Authorization = `Bearer ${response.access_token}`; + return this.camelcaseKeys ? camelcase_keys_1.default(response, { deep: true }) : response; + } + authInfo() { + return this.camelcaseKeys + ? camelcase_keys_1.default(this.auth, { + deep: true + }) + : this.auth; + } + hasNext() { + return Boolean(this.nextUrl); + } + next() { + return this.fetch(this.nextUrl); + } + nextQuery() { + // This always returns undefined + // @ts-ignore + return url_1.default.parse(this.nextUrl, true).params; + } + makeIterable(resp) { + const self = this; + const nextUrl = this.camelcaseKeys ? 'nextUrl' : 'next_url'; + return { + [Symbol.asyncIterator]() { + return __asyncGenerator(this, arguments, function* _a() { + yield yield __await(resp); + while (resp[nextUrl]) { + resp = yield __await(self.fetch(resp[nextUrl])); + yield yield __await(resp); + } + }); + } + }; + } + userDetail(id, params) { + params = Object.assign({ userId: id, filter }, params); + return this.fetch('/v1/user/detail', { params }); + } + userIllusts(id, params) { + params = Object.assign({ userId: id, type: 'illust', filter }, params); + return this.fetch('/v1/user/illusts', { params }); + } + // This endpoint doesn't exist + userFollowAdd(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id, restrict: 'public', filter }, params); + return this.fetch('/v1/user/follow/add', { params }); + } + // This endpoint doesn't exist + userFollowDelete(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id, restrict: 'public', filter }, params); + return this.fetch('/v1/user/follow/delete', { params }); + } + userBookmarksIllust(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id, restrict: 'public', filter }, params); + return this.fetch('/v1/user/bookmarks/illust', { params }); + } + userFollowing(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id, restrict: 'public' }, params); + return this.fetch('/v1/user/following', { params }); + } + userFollower(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id }, params); + return this.fetch('/v1/user/follower', { params }); + } + userMypixiv(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id }, params); + return this.fetch('/v1/user/mypixiv', { params }); + } + // This endpoint doesn't exist + userList(id, params) { + if (!id) { + return Promise.reject(new Error('userId required')); + } + params = Object.assign({ userId: id, filter }, params); + return this.fetch('/v1/user/list', { params }); + } + illustDetail(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id, filter }, params); + return this.fetch('/v1/illust/detail', { params }); + } + illustNew(params) { + params = Object.assign({ contentType: 'illust', filter }, params); + return this.fetch('/v1/illust/new', { params }); + } + illustFollow(id, params) { + params = Object.assign({ userId: id, restrict: 'public' }, params); + return this.fetch('/v2/illust/follow', { params }); + } + illustComments(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id, includeTotalComments: true }, params); + return this.fetch('/v1/illust/comments', { params }); + } + illustRelated(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id, filter }, params); + return this.fetch('/v2/illust/related', { params }); + } + illustRecommended(params) { + params = Object.assign({ contentType: 'illust', includeRankingLabel: true, filter }, params); + return this.fetch('/v1/illust/recommended', { params }); + } + illustRecommendedNologin(params) { + params = Object.assign({ includeRankingIllusts: true, filter }, params); + return this.fetch('/v1/illust/recommended-nologin', { params }); + } + illustRanking(params) { + params = Object.assign({ mode: 'day', filter }, params); + return this.fetch('/v1/illust/ranking', { params }); + } + trendingTagsIllust(params) { + params = Object.assign({ filter }, params); + return this.fetch('/v1/trending-tags/illust', { params }); + } + searchIllust(word, params) { + if (!word) { + return Promise.reject(new Error('Word required')); + } + params = Object.assign({ word, searchTarget: 'partial_match_for_tags', sort: 'date_desc', filter }, params); + return this.fetch('/v1/search/illust', { params }); + } + searchNovel(word, params) { + if (!word) { + return Promise.reject(new Error('Word required')); + } + params = Object.assign({ word, searchTarget: 'partial_match_for_tags', sort: 'date_desc', filter }, params); + return this.fetch('/v1/search/novel', { params }); + } + searchUser(word, params) { + if (!word) { + return Promise.reject(new Error('Word required')); + } + params = Object.assign({ word, + filter }, params); + return this.fetch('/v1/search/user', { params }); + } + searchAutoComplete(word) { + if (!word) { + return Promise.reject(new Error('word required')); + } + return this.fetch('/v1/search/autocomplete', { params: { word } }); + } + illustBookmarkDetail(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id }, params); + return this.fetch('/v2/illust/bookmark/detail', { params }); + } + // This endpoint doesn't exist + illustBookmarkAdd(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id, restrict: 'public' }, params); + return this.fetch('/v2/illust/bookmark/add', { params }); + } + // This endpoint doesn't exist + illustBookmarkDelete(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id }, params); + return this.fetch('/v1/illust/bookmark/delete', { params }); + } + userBookmarkTagsIllust(params) { + params = Object.assign({ restrict: 'public' }, params); + return this.fetch('/v1/user/bookmark-tags/illust', { params }); + } + novelRecommended(params) { + params = Object.assign({ includeRankingNovels: true, filter }, params); + return this.fetch('/v1/novel/recommended', { params }); + } + // This endpoint doesn't exist + mangaNew(params) { + params = Object.assign({ contentType: 'manga', filter }, params); + return this.fetch('/v1/manga/new', { params }); + } + mangaRecommended(params) { + params = Object.assign({ includeRankingLabel: true, filter }, params); + return this.fetch('/v1/manga/recommended', { params }); + } + novelRecommendedNologin(params) { + params = Object.assign({ includeRankingNovels: true, filter }, params); + return this.fetch('/v1/novel/recommended-nologin', { params }); + } + novelNew(params) { + params = Object.assign({ filter }, params); + return this.fetch('/v1/novel/new', { params }); + } + ugoiraMetaData(id, params) { + if (!id) { + return Promise.reject(new Error('illustId required')); + } + params = Object.assign({ illustId: id, filter }, params); + return this.fetch('/v1/ugoira/metadata', { params }); + } + async fetch(target, options) { + if (!target) { + return Promise.reject(new Error('url required')); + } + try { + return this._get(target, options); + } + catch (error) { + if (this.once) { + this.once = false; + throw error; + } + await this.login(); + this.once = true; + return this._get(target, options); + } + } + async _get(target, options = {}) { + options = options || {}; + if (options.data) { + options.method = 'post'; + options.headers = { + 'Content-Type': 'application/x-www-form-urlencoded' + }; + options.data = querystring_1.stringify(decamelize_keys_1.default(options.data)); + } + if (options.params) { + options.params = decamelize_keys_1.default(options.params); + } + const { data } = await instance(target, options); + this.nextUrl = data && data.next_url ? data.next_url : null; + return this.camelcaseKeys ? camelcase_keys_1.default(data, { deep: true }) : data; + } +} +exports.default = PixivApp; +module.exports.default = PixivApp; +module.exports = PixivApp; +//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map new file mode 100644 index 0000000..83271bb --- /dev/null +++ b/dist/index.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AACrC,+CAAgC;AAChC,8CAAqB;AACrB,kDAA+C;AAC/C,sEAA4C;AAC5C,oEAA0C;AAmC1C,MAAM,OAAO,GAAG,4BAA4B,CAAA;AAC5C,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC;IAC5B,OAAO;IACP,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK;QACf,gBAAgB,EAAE,OAAO;QACzB,aAAa,EAAE,OAAO;KACvB;CACF,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG,8BAA8B,CAAA;AAChD,MAAM,aAAa,GAAG,0CAA0C,CAAA;AAChE,MAAM,WAAW,GAAG,kEAAkE,CAAA;AACtF,MAAM,MAAM,GAAG,SAAS,CAAA;AAExB,MAAqB,QAAQ;IAS3B,YAAY,QAAiB,EAAE,QAAiB,EAAE,OAA6B;QARxE,kBAAa,GAAG,IAAS,CAAA;QAS9B,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,IAAI,GAAG,KAAK,CAAA;QACjB,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,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AAG,uBAAS,CAAC,yBAAc,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAA;SACvD;QAED,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,CAAC,MAAM,GAAG,yBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SAChD;QACD,MAAM,EAAC,IAAI,EAAC,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,OAA6B,CAAC,CAAA;QACpE,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;QAC3D,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAa,CAAC,IAAI,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACtE,CAAC;CACF;AA7eD,2BA6eC;AAED,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAA;AACjC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/index.test.d.ts b/dist/index.test.d.ts new file mode 100644 index 0000000..336ce12 --- /dev/null +++ b/dist/index.test.d.ts @@ -0,0 +1 @@ +export {} diff --git a/dist/index.test.js b/dist/index.test.js new file mode 100644 index 0000000..7d1cc6c --- /dev/null +++ b/dist/index.test.js @@ -0,0 +1,122 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const lodash_isequal_1 = __importDefault(require("lodash.isequal")); +const is_plain_obj_1 = __importDefault(require("is-plain-obj")); +const _1 = __importDefault(require(".")); +const userId = 471355; +const illustId = 57907953; +const PASSWORD = process.env.PASSWORD; +const NAME = process.env.NAME; +jest.setTimeout(10000); +function setup() { + return new _1.default(NAME, PASSWORD); +} +const pixiv = setup(); +let auth = null; +async function setAuth() { + auth = await pixiv.login(); +} +// リクエストを送りまくると制限されるので1度だけlogin +beforeAll(() => { + return setAuth(); +}); +test('expose a constructor', () => { + expect(typeof _1.default === 'function').toBe(true); +}); +test('auth', () => { + const json = pixiv.authInfo(); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('userDetail', async () => { + expect.assertions(1); + const json = await pixiv.userDetail(userId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('userIllusts', async () => { + expect.assertions(1); + const json = await pixiv.userIllusts(userId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('userBookmarksIllust', async () => { + expect.assertions(1); + const json = await pixiv.userBookmarksIllust(auth.user.id); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('userBookmarksIllust private', async () => { + expect.assertions(1); + const json = await pixiv.userBookmarksIllust(auth.user.id, { + restrict: 'private' + }); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustDetail', async () => { + expect.assertions(1); + const json = await pixiv.illustDetail(illustId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustFollow', async () => { + expect.assertions(1); + const json = await pixiv.illustFollow(userId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustComments', async () => { + expect.assertions(1); + const json = await pixiv.illustComments(illustId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustRelated', async () => { + expect.assertions(1); + const json = await pixiv.illustRelated(illustId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustRecommended', async () => { + expect.assertions(1); + const json = await pixiv.illustRecommended(); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustRanking', async () => { + expect.assertions(1); + const json = await pixiv.illustRanking(); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('trendingTagsIllust', async () => { + expect.assertions(1); + const json = await pixiv.trendingTagsIllust(); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('searchIllust', async () => { + expect.assertions(1); + const json = await pixiv.searchIllust('レム'); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('illustBookmarkDetail', async () => { + expect.assertions(1); + const json = await pixiv.illustBookmarkDetail(illustId); + expect(is_plain_obj_1.default(json)).toBe(true); +}); +test('decamelize params', async () => { + expect.assertions(1); + const json1 = await pixiv.userIllusts(userId); + const json2 = await pixiv.userIllusts(userId, { userId: 2957827 }); + expect(lodash_isequal_1.default(json1, json2)).toBe(false); +}); +test('camelcaseKeys', async () => { + expect.assertions(1); + const json = await pixiv.userIllusts(userId, { userId: 2957827 }); + expect({}.hasOwnProperty.call(json, 'nextUrl')).toBe(true); +}); +test('not camelcaseKeys', async () => { + expect.assertions(1); + const json = await pixiv.userIllusts(userId, { userId: 2957827 }); + expect({}.hasOwnProperty.call(json, 'next_url')).toBe(false); +}); +test('makeIterable', async () => { + expect.assertions(1); + const json = await pixiv.userIllusts(userId, { userId: 2957827 }); + const iterable = pixiv.makeIterable(json); + expect({}.hasOwnProperty.call(iterable, Symbol.asyncIterator)).toBe(true); +}); +//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/dist/index.test.js.map b/dist/index.test.js.map new file mode 100644 index 0000000..67a20de --- /dev/null +++ b/dist/index.test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":";;;;;AAAA,oEAAoC;AACpC,gEAAqC;AACrC,yCAA2B;AAE3B,MAAM,MAAM,GAAG,MAAM,CAAA;AACrB,MAAM,QAAQ,GAAG,QAAQ,CAAA;AACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAkB,CAAA;AAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAc,CAAA;AAEvC,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;AAEtB,SAAS,KAAK;IACZ,OAAO,IAAI,UAAW,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAA;AACxC,CAAC;AAED,MAAM,KAAK,GAAG,KAAK,EAAE,CAAA;AACrB,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CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;IACnC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjE,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjE,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3E,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/dist/test.d.ts b/dist/test.d.ts new file mode 100644 index 0000000..336ce12 --- /dev/null +++ b/dist/test.d.ts @@ -0,0 +1 @@ +export {} diff --git a/dist/test.js b/dist/test.js new file mode 100644 index 0000000..0b5f159 --- /dev/null +++ b/dist/test.js @@ -0,0 +1,13 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const index_1 = __importDefault(require("./index")); +const pixiv = new index_1.default("unpopularguy200112@gmail.com", "KannaKamui011", { camelcaseKeys: false }); +(async () => { + await pixiv.login(); + let res = await pixiv.illustRanking(); + console.log(res); +})(); +//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/dist/test.js.map b/dist/test.js.map new file mode 100644 index 0000000..2e2ba07 --- /dev/null +++ b/dist/test.js.map @@ -0,0 +1 @@ +{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;;;;AACA,oDAA8B;AAE9B,MAAM,KAAK,GAAG,IAAI,eAAQ,CAAC,8BAA8B,EAAE,eAAe,EAAE,EAAC,aAAa,EAAE,KAAK,EAAC,CAAC,CAElG;AAAA,CAAC,KAAK,IAAI,EAAE;IACT,MAAM,KAAK,CAAC,KAAK,EAAE,CAAA;IACnB,IAAI,GAAG,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAA;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC,CAAC,EAAE,CAAA"} \ No newline at end of file diff --git a/package.json b/package.json index 69437b3..5bc7c73 100644 --- a/package.json +++ b/package.json @@ -34,10 +34,7 @@ ] }, "files": [ - "dist", - "src", - "tsconfig.json", - "declarations.d.ts" + "dist" ], "keywords": [ "pixiv", From 845bf7fccf091a1f59b885078fb093b2c85c6784 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 18:50:39 -0400 Subject: [PATCH 4/9] added types --- package.json | 1 + 1 file changed, 1 insertion(+) diff --git a/package.json b/package.json index 5bc7c73..11e9dbf 100644 --- a/package.json +++ b/package.json @@ -13,6 +13,7 @@ "node": ">=8" }, "main": "dist/index.js", + "types": "dist/index.d.ts", "scripts": { "add-contributor": "all-contributors add", "fmt": "prettier --write '**/*.{ts,js,json,md}'", From 6323a6333648d2ad3f9dae8a3408d9fbb954eb04 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 19:00:47 -0400 Subject: [PATCH 5/9] added declaration map --- dist/PixivTypes.d.ts | 1 + dist/PixivTypes.d.ts.map | 1 + dist/Pixiv_Types.d.ts | 1 + dist/Pixiv_Types.d.ts.map | 1 + dist/index.d.ts | 103 ++++++++++++++++++++++++-------------- dist/index.d.ts.map | 1 + dist/index.js | 25 ++++++--- dist/index.js.map | 2 +- dist/index.test.d.ts | 1 + dist/index.test.d.ts.map | 1 + dist/test.d.ts | 1 - dist/test.js | 13 ----- dist/test.js.map | 1 - tsconfig.json | 2 +- 14 files changed, 91 insertions(+), 63 deletions(-) create mode 100644 dist/PixivTypes.d.ts.map create mode 100644 dist/Pixiv_Types.d.ts.map create mode 100644 dist/index.d.ts.map create mode 100644 dist/index.test.d.ts.map delete mode 100644 dist/test.d.ts delete mode 100644 dist/test.js delete mode 100644 dist/test.js.map diff --git a/dist/PixivTypes.d.ts b/dist/PixivTypes.d.ts index 05f1079..1f76879 100644 --- a/dist/PixivTypes.d.ts +++ b/dist/PixivTypes.d.ts @@ -311,3 +311,4 @@ export interface UgoiraMetaData { }[] } } +//# sourceMappingURL=PixivTypes.d.ts.map diff --git a/dist/PixivTypes.d.ts.map b/dist/PixivTypes.d.ts.map new file mode 100644 index 0000000..a3470c1 --- /dev/null +++ b/dist/PixivTypes.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"PixivTypes.d.ts","sourceRoot":"","sources":["../src/PixivTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,eAAe,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE;QAChB,OAAO,EAA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,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,QAAQ,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE;QACd,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,CAAA;CACF"} \ No newline at end of file diff --git a/dist/Pixiv_Types.d.ts b/dist/Pixiv_Types.d.ts index 88c3c45..4b42195 100644 --- a/dist/Pixiv_Types.d.ts +++ b/dist/Pixiv_Types.d.ts @@ -263,3 +263,4 @@ export interface Ugoira_Meta_Data { }[] } } +//# sourceMappingURL=Pixiv_Types.d.ts.map diff --git a/dist/Pixiv_Types.d.ts.map b/dist/Pixiv_Types.d.ts.map new file mode 100644 index 0000000..e7e717b --- /dev/null +++ b/dist/Pixiv_Types.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"Pixiv_Types.d.ts","sourceRoot":"","sources":["../src/Pixiv_Types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,iBAAiB,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE;QAClB,QAAQ,EAAE,MAAM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AE,CAAA;IAC7B,UAAU,EAAE,MAAM,CAAA;IAClB,eAAe,EAAE,MAAM,CAAA;IACvB,aAAa,EAAE,OAAO,CAAA;IACtB,OAAO,EAAE,OAAO,CAAA;IAChB,QAAQ,EAAE,OAAO,CAAA;CAClB;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE,SAAS,EAAE,CAAA;CACxB;AAED,MAAM,WAAW,mBAAmB;IAClC,6BAA6B,EAAE,MAAM,EAAE,CAAA;CACxC;AAED,MAAM,WAAW,qBAAqB;IACpC,aAAa,EAAE,OAAO,CAAA;IACtB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE;YACR,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,CAAA;CACF"} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts index 867aafa..9994833 100644 --- a/dist/index.d.ts +++ b/dist/index.d.ts @@ -30,26 +30,26 @@ import { PixivMangaSearch, PixivTrendTags } from './PixivTypes' -export default class PixivApp { - camelcaseKeys: B - private username - private password - private refreshToken - private nextUrl - private auth - private once +export default class PixivApp { + camelcaseKeys: CamelcaseKeys + username: string | undefined + password: string | undefined + refreshToken: string + nextUrl: string | null + auth: PixivClient | null + private _once constructor( username?: string, password?: string, options?: { - camelcaseKeys?: B + camelcaseKeys?: CamelcaseKeys } ) login( username?: string, password?: string - ): Promise - authInfo(): B extends true ? PixivClient : Pixiv_Client + ): Promise + authInfo(): CamelcaseKeys extends true ? PixivClient : Pixiv_Client hasNext(): boolean next(): Promise nextQuery(): undefined | string @@ -57,102 +57,129 @@ export default class PixivApp { userDetail( id: number, params?: PixivParams - ): Promise + ): Promise userIllusts( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > userFollowAdd(id: number, params?: PixivParams): Promise userFollowDelete(id: number, params?: PixivParams): Promise userBookmarksIllust( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > userFollowing( id: number, params?: PixivParams - ): Promise + ): Promise userFollower( id: number, params?: PixivParams - ): Promise + ): Promise userMypixiv( id: number, params?: PixivParams - ): Promise + ): Promise userList(id: number, params?: PixivParams): Promise illustDetail( id: number, params?: PixivParams - ): Promise + ): Promise illustNew( params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > illustFollow( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > illustComments( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivCommentSearch : Pixiv_Comment_Search + > illustRelated( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > illustRecommended( params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > illustRecommendedNologin( params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > illustRanking( params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > trendingTagsIllust( params?: PixivParams - ): Promise + ): Promise searchIllust( word: string, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search + > searchNovel( word: string, params?: PixivParams - ): Promise + ): Promise searchUser( word: string, params?: PixivParams - ): Promise + ): Promise searchAutoComplete( word: string - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivAutoComplete : Pixiv_Auto_Complete + > illustBookmarkDetail( id: number, params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivBookmarkDetail : Pixiv_Bookmark_Detail + > illustBookmarkAdd(id: number, params?: PixivParams): Promise illustBookmarkDelete(id: number, params?: PixivParams): Promise userBookmarkTagsIllust( params?: PixivParams - ): Promise + ): Promise< + CamelcaseKeys extends true ? PixivBookmarkSearch : Pixiv_Bookmark_Search + > novelRecommended( params?: PixivParams - ): Promise - mangaNew(params?: PixivParams): Promise + ): Promise + mangaNew(params?: PixivParams): Promise mangaRecommended( params?: PixivParams - ): Promise + ): Promise novelRecommendedNologin( params?: PixivParams - ): Promise + ): Promise novelNew( params?: PixivParams - ): Promise + ): Promise ugoiraMetaData( id: number, params?: PixivParams - ): Promise + ): Promise fetch(target: string, options?: PixivFetchOptions): Promise private _get } +//# sourceMappingURL=index.d.ts.map diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map new file mode 100644 index 0000000..3da7dae --- /dev/null +++ b/dist/index.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,WAAW,EACX,iBAAiB,EAEjB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAAe,EACf,WAAW,EACX,kBAAkB,EAClB,gBAAgB,EAChB,iBAAiB,EACjB,cAAc,EACd,gBAAgB,EAChB,cAAc,EACf,MAAM,cAAc,CAAA;AAkBrB,MAAM,CAAC,OAAO,OAAO,QAAQ,CAAC,aAAa,SAAS,OAAO;IACzD,aAAa,gBAAwB;IACrC,QAAQ,EAA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,MAAM,EAAE,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAWxE,sBAAsB,CACpB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,aAAa,SAAS,IAAI,GAAG,mBAAmB,GAAG,qBAAqB,CACzE;IAQD,gBAAgB,CACd,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,aAAa,SAAS,IAAI,GAAG,gBAAgB,GAAG,kBAAkB,CACnE;IAUD,QAAQ,CAAC,MAAM,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;IAShD,gBAAgB,CACd,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,aAAa,SAAS,IAAI,GAAG,gBAAgB,GAAG,kBAAkB,CACnE;IASD,uBAAuB,CACrB,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,aAAa,SAAS,IAAI,GAAG,gBAAgB,GAAG,kBAAkB,CACnE;IAUD,QAAQ,CACN,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CACR,aAAa,SAAS,IAAI,GAAG,gBAAgB,GAAG,kBAAkB,CACnE;IAQD,cAAc,CACZ,EAAE,EAAE,MAAM,EACV,MAAM,CAAC,EAAE,WAAW,GACnB,OAAO,CAAC,aAAa,SAAS,IAAI,GAAG,cAAc,GAAG,gBAAgB,CAAC;IAYpE,KAAK,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,iBAAiB,GAAG,OAAO,CAAC,GAAG,CAAC;YAkBxD,IAAI;CAqBnB"} \ No newline at end of file diff --git a/dist/index.js b/dist/index.js index c55fb20..2db015e 100644 --- a/dist/index.js +++ b/dist/index.js @@ -49,17 +49,22 @@ class PixivApp { this.refreshToken = ''; this.nextUrl = null; this.auth = null; - this.once = false; + this._once = false; if (options) { this.camelcaseKeys = Boolean(options.camelcaseKeys); } + else { + this.camelcaseKeys = true; + } } async login(username, password) { this.username = username || this.username; this.password = password || this.password; - if (typeof this.username !== 'string' && typeof this.password !== 'string') { - return Promise.reject(new TypeError(`Auth is required. - Expected a string, got ${typeof this.username !== 'string' ? typeof this.username : typeof this.password}`)); + if (typeof this.username !== 'string') { + return Promise.reject(new TypeError(`Auth is required. Expected a string, got ${typeof this.username}`)); + } + if (typeof this.password !== 'string') { + return Promise.reject(new TypeError(`Auth is required. Expected a string, got ${typeof this.password}`)); } const local_time = new Date().toISOString(); const headers = { @@ -92,7 +97,9 @@ class PixivApp { this.auth = response; this.refreshToken = axiosResponse.data.response.refresh_token; instance.defaults.headers.common.Authorization = `Bearer ${response.access_token}`; - return this.camelcaseKeys ? camelcase_keys_1.default(response, { deep: true }) : response; + return this.camelcaseKeys + ? camelcase_keys_1.default(response, { deep: true }) + : response; } authInfo() { return this.camelcaseKeys @@ -113,6 +120,7 @@ class PixivApp { return url_1.default.parse(this.nextUrl, true).params; } makeIterable(resp) { + // eslint-disable-next-line @typescript-eslint/no-this-alias const self = this; const nextUrl = this.camelcaseKeys ? 'nextUrl' : 'next_url'; return { @@ -120,6 +128,7 @@ class PixivApp { return __asyncGenerator(this, arguments, function* _a() { yield yield __await(resp); while (resp[nextUrl]) { + // eslint-disable-next-line require-atomic-updates resp = yield __await(self.fetch(resp[nextUrl])); yield yield __await(resp); } @@ -323,12 +332,12 @@ class PixivApp { return this._get(target, options); } catch (error) { - if (this.once) { - this.once = false; + if (this._once) { + this._once = false; throw error; } await this.login(); - this.once = true; + this._once = true; return this._get(target, options); } } diff --git a/dist/index.js.map b/dist/index.js.map index 83271bb..9cf73f9 100644 --- a/dist/index.js.map +++ b/dist/index.js.map @@ -1 +1 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAqC;AACrC,+CAAgC;AAChC,8CAAqB;AACrB,kDAA+C;AAC/C,sEAA4C;AAC5C,oEAA0C;AAmC1C,MAAM,OAAO,GAAG,4BAA4B,CAAA;AAC5C,MAAM,QA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ACvD;QAED,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,CAAC,MAAM,GAAG,yBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SAChD;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,OAA6B,CAAC,CAAA;QACtE,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;QAC3D,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAa,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxE,CAAC;CACF;AAjnBD,2BAinBC;AAED,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAA;AACjC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/index.test.d.ts b/dist/index.test.d.ts index 336ce12..856d8b4 100644 --- a/dist/index.test.d.ts +++ b/dist/index.test.d.ts @@ -1 +1,2 @@ export {} +//# sourceMappingURL=index.test.d.ts.map diff --git a/dist/index.test.d.ts.map b/dist/index.test.d.ts.map new file mode 100644 index 0000000..b5774e1 --- /dev/null +++ b/dist/index.test.d.ts.map @@ -0,0 +1 @@ +{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/test.d.ts b/dist/test.d.ts deleted file mode 100644 index 336ce12..0000000 --- a/dist/test.d.ts +++ /dev/null @@ -1 +0,0 @@ -export {} diff --git a/dist/test.js b/dist/test.js deleted file mode 100644 index 0b5f159..0000000 --- a/dist/test.js +++ /dev/null @@ -1,13 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const index_1 = __importDefault(require("./index")); -const pixiv = new index_1.default("unpopularguy200112@gmail.com", "KannaKamui011", { camelcaseKeys: false }); -(async () => { - await pixiv.login(); - let res = await pixiv.illustRanking(); - console.log(res); -})(); -//# sourceMappingURL=test.js.map \ No newline at end of file diff --git a/dist/test.js.map b/dist/test.js.map deleted file mode 100644 index 2e2ba07..0000000 --- a/dist/test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"test.js","sourceRoot":"","sources":["../src/test.ts"],"names":[],"mappings":";;;;;AACA,oDAA8B;AAE9B,MAAM,KAAK,GAAG,IAAI,eAAQ,CAAC,8BAA8B,EAAE,eAAe,EAAE,EAAC,aAAa,EAAE,KAAK,EAAC,CAAC,CAElG;AAAA,CAAC,KAAK,IAAI,EAAE;IACT,MAAM,KAAK,CAAC,KAAK,EAAE,CAAA;IACnB,IAAI,GAAG,GAAG,MAAM,KAAK,CAAC,aAAa,EAAE,CAAA;IACrC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAA;AACpB,CAAC,CAAC,EAAE,CAAA"} \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json index 48cff57..b8fd79d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -5,7 +5,7 @@ "strict": true, "noImplicitAny": true, "declaration": true, - "declarationDir": "dist" + "declarationMap": true }, "include": ["src", "declarations.d.ts"] } From 5974c2c78c2edd8a143d01644f2028857be5ba6b Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 20:00:31 -0400 Subject: [PATCH 6/9] generic parameter default --- .gitignore | 2 + dist/PixivTypes.d.ts | 314 -------------------------------- dist/PixivTypes.d.ts.map | 1 - dist/PixivTypes.js | 3 - dist/PixivTypes.js.map | 1 - dist/Pixiv_Types.d.ts | 266 ---------------------------- dist/Pixiv_Types.d.ts.map | 1 - dist/Pixiv_Types.js | 3 - dist/Pixiv_Types.js.map | 1 - dist/index.d.ts | 185 ------------------- dist/index.d.ts.map | 1 - dist/index.js | 364 -------------------------------------- dist/index.js.map | 1 - dist/index.test.d.ts | 2 - dist/index.test.d.ts.map | 1 - dist/index.test.js | 122 ------------- dist/index.test.js.map | 1 - package.json | 1 + src/index.ts | 7 +- tsconfig.json | 3 +- yarn.lock | 5 + 21 files changed, 13 insertions(+), 1272 deletions(-) delete mode 100644 dist/PixivTypes.d.ts delete mode 100644 dist/PixivTypes.d.ts.map delete mode 100644 dist/PixivTypes.js delete mode 100644 dist/PixivTypes.js.map delete mode 100644 dist/Pixiv_Types.d.ts delete mode 100644 dist/Pixiv_Types.d.ts.map delete mode 100644 dist/Pixiv_Types.js delete mode 100644 dist/Pixiv_Types.js.map delete mode 100644 dist/index.d.ts delete mode 100644 dist/index.d.ts.map delete mode 100644 dist/index.js delete mode 100644 dist/index.js.map delete mode 100644 dist/index.test.d.ts delete mode 100644 dist/index.test.d.ts.map delete mode 100644 dist/index.test.js delete mode 100644 dist/index.test.js.map diff --git a/.gitignore b/.gitignore index de85933..f1cc977 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,5 @@ node_modules .envrc .vscode +dist +src/test.ts diff --git a/dist/PixivTypes.d.ts b/dist/PixivTypes.d.ts deleted file mode 100644 index 1f76879..0000000 --- a/dist/PixivTypes.d.ts +++ /dev/null @@ -1,314 +0,0 @@ -export interface PixivClient { - accessToken: string - expiresIn: number - tokenType: string - scope: string - refreshToken: string - user: PixivClientUser - deviceToken: string -} -export interface PixivClientUser { - profileImageUrls: { - px16X16: string - px50X50: string - px170X170: string - } - id: string - name: string - account: string - mailAddress: string - isPremium: boolean - xRestrict: number - isMailAuthorized: boolean -} -export interface PixivRequestData { - clientId: string - clientSecret: string - getSecureUrl: string - grantType: string - refreshToken: string - username: string - password: string -} -export interface PixivParams { - userId?: number - type?: string - filter?: string - restrict?: 'public' | 'private' - illustId?: number - contentType?: string - includeTotalComments?: boolean - includeRankingLabel?: boolean - includeRankingIllusts?: boolean - includeRankingNovels?: boolean - mode?: - | 'day' - | 'week' - | 'month' - | 'day_male' - | 'day_female' - | 'week_original' - | 'week_rookie' - | 'day_r18' - | 'day_male_r18' - | 'day_female_r18' - | 'week_r18' - | 'week_r18g' - | 'day_manga' - | 'week_manga' - | 'month_manga' - | 'week_rookie_manga' - | 'day_r18_manga' - | 'week_r18_manga' - | 'week_r18g_manga' - word?: string - searchTarget?: - | 'partial_match_for_tags' - | 'exact_match_for_tags' - | 'title_and_caption' - sort?: 'date_desc' | 'date_asc' | 'popular_desc' - startDate?: string - endDate?: string -} -export interface PixivFetchOptions { - data?: string - method?: string - headers?: { - [header: string]: string - } - params?: PixivParams -} -export interface PixivUser { - id: number - name: string - account: string - profileImageUrls: { - medium: string - } - comment: string - isFollowed: boolean -} -export interface PixivUserDetail { - user: PixivUser - profile: { - webpage: string - gender: string - birth: string - birthDay: string - birthYear: number - region: string - addressId: number - countryCode: string - job: string - jobId: number - totalFollowUsers: number - totalMypixivUsers: number - totalIllusts: number - totalManga: number - totalNovels: number - totalIllustBookmarksPublic: number - totalIllustSeries: number - backgroundImageUrl: string - twitterAccount: string - twitterUrl: string - pawooUrl: string - isPremium: boolean - isUsingCustomProfileImage: boolean - } - profilePublicity: { - gender: string - region: string - birthDay: string - birthYear: string - job: string - pawoo: boolean - } - workspace: { - pc: string - monitor: string - tool: string - scanner: string - tablet: string - mouse: string - printer: string - desktop: string - music: string - desk: string - chair: string - comment: string - workspaceImageUrl: string | null - } -} -export interface PixivIllustSearch { - illusts: PixivIllust[] - nextUrl: string | null - searchSpanLimit?: number -} -export interface PixivUserSearch { - userPreviews: { - user: PixivUser - illusts: PixivIllust[] - novels: PixivNovel[] - isMuted: boolean - }[] - nextUrl: string | null -} -export interface PixivCommentSearch { - totalComments: number - comments: PixivComment[] - nextUrl: string | null -} -export interface PixivNovelSearch { - novels: PixivNovel[] - nextUrl: string | null - privacyPolicy?: {} - searchSpanLimit?: number -} -export interface PixivBookmarkSearch { - bookmarkTags: PixivTag[] - nextUrl: string | null -} -export interface PixivMangaSearch { - illusts: PixivManga[] - rankingIllusts: PixivManga[] | [] - privacyPolicy: {} - nextUrl: string | null -} -export interface PixivIllust { - id: number - title: string - type: string - imageUrls: { - squareMedium: string - medium: string - large?: string - } - caption: string - restrict: number - user: PixivUser - tags: PixivTag[] - tools: string[] - createDate: string - pageCount: number - width: number - height: number - sanityLevel: number - metaSinglePage: { - originalImageUrl?: string - } - metaPages: PixivMetaPage[] - totalView: number - totalBookmarks: number - isBookmarked: boolean - visible: boolean - isMuted: boolean - totalComments: number -} -export interface PixivTag { - name: string - translatedName: string | null - addedByUploadedUser?: boolean - illust?: PixivIllust - isRegistered?: boolean -} -export interface PixivMetaPage { - imageUrls: { - squareMedium: string - medium: string - large: string - original: string - } -} -export interface PixivComment { - id: number - comment: string - date: string - user: PixivUser - parentComment: PixivComment | {} -} -export interface PixivNovel { - id: number - title: string - caption: string - restrict: number - xRestrict: number - imageUrls: { - squareMedium: string - medium: string - large?: string - } - createDate: string - tags: PixivTag[] - pageCount: number - textLength: number - user: PixivUser - series: - | { - id: number - title: string - } - | {} - isBookmarked: boolean - totalBookmarks: number - totalView: number - visible: boolean - totalComments: number - isMuted: boolean - isMypixivOnly: boolean - isXRestricted: boolean -} -export interface PixivManga { - id: number - title: string - type: string - imageUrls: { - squareMedium: string - medium: string - large?: string - } - caption: string - restrict: number - user: PixivUser - tags: PixivTag[] - tools: string[] - createDate: string - pageCount: string - width: number - height: number - sanityLevel: number - xRestrict: number - series: { - id: number - title: string - } | null - metaSinglePage: {} - metaPages: PixivMetaPage[] - totalView: number - totalBookmarks: number - isBookmarked: boolean - visible: boolean - isMuted: boolean -} -export interface PixivTrendTags { - trend_tags: PixivTag[] -} -export interface PixivAutoComplete { - searchAutoCompleteKeywords: string[] -} -export interface PixivBookmarkDetail { - isBookmarked: boolean - tags: PixivTag[] - restrict: string -} -export interface UgoiraMetaData { - ugoiraMetadata: { - zipUrls: { - medium: string - } - frames: { - file: string - delay: number - }[] - } -} -//# sourceMappingURL=PixivTypes.d.ts.map diff --git a/dist/PixivTypes.d.ts.map b/dist/PixivTypes.d.ts.map deleted file mode 100644 index a3470c1..0000000 --- a/dist/PixivTypes.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PixivTypes.d.ts","sourceRoot":"","sources":["../src/PixivTypes.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,WAAW;IAC1B,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,EAAE,eAAe,CAAA;IACrB,WAAW,EAAE,MAAM,CAAA;CACpB;AAED,MAAM,WAAW,eAAe;IAC9B,gBAAgB,EAAE;QAChB,OAAO,EAAE,MAAM,CAAA;QACf,OAAO,EAAE,MAAM,CAAA;QACf,SAAS,EAAE,MAAM,CAAA;KAClB,CAAA;IACD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,OAAO,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,gBAAgB,EAAE,OAAO,CAAA;CAC1B;AAED,MAAM,WAAW,gBAAgB;IAC/B,QAAQ,EAAE,MAAM,CAAA;IAChB,YAAY,EAAE,MAAM,CAAA;IACpB,YAAY,EAAE,MAAM,CAAA;IACpB,SAAS,EAAE,MAAM,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,QAAQ,EAAE,MAAM,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,WAAW;IAC1B,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,MAAM,CAAC,EAAE,MAAM,CAAA;IACf,QAAQ,CA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;IACf,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,KAAK,EAAE,MAAM,EAAE,CAAA;IACf,UAAU,EAAE,MAAM,CAAA;IAClB,SAAS,EAAE,MAAM,CAAA;IACjB,KAAK,EAAE,MAAM,CAAA;IACb,MAAM,EAAE,MAAM,CAAA;IACd,WAAW,EAAE,MAAM,CAAA;IACnB,SAAS,EAAE,MAAM,CAAA;IACjB,MAAM,EAAE;QACN,EAAE,EAAE,MAAM,CAAA;QACV,KAAK,EAAE,MAAM,CAAA;KACd,GAAG,IAAI,CAAA;IACR,cAAc,EAAE,EAAE,CAAA;IAClB,SAAS,EAAE,aAAa,EAAE,CAAA;IAC1B,SAAS,EAAE,MAAM,CAAA;IACjB,cAAc,EAAE,MAAM,CAAA;IACtB,YAAY,EAAE,OAAO,CAAA;IACrB,OAAO,EAAE,OAAO,CAAA;IAChB,OAAO,EAAE,OAAO,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,UAAU,EAAE,QAAQ,EAAE,CAAA;CACvB;AAED,MAAM,WAAW,iBAAiB;IAChC,0BAA0B,EAAE,MAAM,EAAE,CAAA;CACrC;AAED,MAAM,WAAW,mBAAmB;IAClC,YAAY,EAAE,OAAO,CAAA;IACrB,IAAI,EAAE,QAAQ,EAAE,CAAA;IAChB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,cAAc;IAC7B,cAAc,EAAE;QACd,OAAO,EAAE;YACP,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,CAAA;CACF"} \ No newline at end of file diff --git a/dist/PixivTypes.js b/dist/PixivTypes.js deleted file mode 100644 index 6332d90..0000000 --- a/dist/PixivTypes.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=PixivTypes.js.map \ No newline at end of file diff --git a/dist/PixivTypes.js.map b/dist/PixivTypes.js.map deleted file mode 100644 index 5aa3e1e..0000000 --- a/dist/PixivTypes.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"PixivTypes.js","sourceRoot":"","sources":["../src/PixivTypes.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/Pixiv_Types.d.ts b/dist/Pixiv_Types.d.ts deleted file mode 100644 index 4b42195..0000000 --- a/dist/Pixiv_Types.d.ts +++ /dev/null @@ -1,266 +0,0 @@ -export interface Pixiv_Client { - access_token: string - expires_in: number - token_type: string - scope: string - refresh_token: string - user: Pixiv_Client_User - device_token: string -} -export interface Pixiv_Client_User { - profile_image_urls: { - px_16x16: string - px_50x50: string - px_170x170: string - } - id: string - name: string - account: string - mail_address: string - is_premium: boolean - x_restrict: number - is_mail_authorized: boolean -} -export interface Pixiv_Request_Data { - client_id: string - client_secret: string - get_secure_url: string - grant_type: string - refresh_token: string - username: string - password: string -} -export interface Pixiv_User { - id: number - name: string - account: string - profile_image_urls: { - medium: string - } - comment: string - is_followed: boolean -} -export interface Pixiv_User_Detail { - user: Pixiv_User - profile: { - webpage: string - gender: string - birth: string - birth_day: string - birth_year: number - region: string - address_id: number - country_code: string - job: string - job_id: number - total_follow_users: number - total_mypixiv_users: number - total_illusts: number - total_manga: number - total_novels: number - total_illust_bookmarks_public: number - total_illust_series: number - background_image_url: string - twitter_account: string - twitter_url: string - pawoo_url: string - is_premium: boolean - is_using_custom_profile_image: boolean - } - profile_publicity: { - gender: string - region: string - birth_day: string - birth_year: string - job: string - pawoo: boolean - } - workspace: { - pc: string - monitor: string - tool: string - scanner: string - tablet: string - mouse: string - printer: string - desktop: string - music: string - desk: string - chair: string - comment: string - workspace_image_url: string | null - } -} -export interface Pixiv_Illust_Search { - illusts: Pixiv_Illust[] - next_url: string | null - search_span_limit?: number -} -export interface Pixiv_User_Search { - user_previews: { - user: Pixiv_User - illusts: Pixiv_Illust[] - novels: Pixiv_Novel[] - is_muted: boolean - }[] - next_url: string | null -} -export interface Pixiv_Comment_Search { - total_comments: number - comments: Pixiv_Comment[] - next_url: string | null -} -export interface Pixiv_Novel_Search { - novels: Pixiv_Novel[] - next_url: string | null - privacy_policy?: {} - search_span_limit?: number -} -export interface Pixiv_Bookmark_Search { - bookmark_tags: Pixiv_Tag[] - next_url: string | null -} -export interface Pixiv_Manga_Search { - illusts: Pixiv_Manga[] - ranking_illusts: Pixiv_Manga[] | [] - privacy_policy: {} - next_url: string | null -} -export interface Pixiv_Illust { - id: number - title: string - type: string - image_urls: { - square_medium: string - medium: string - large?: string - } - caption: string - restrict: number - user: Pixiv_User - tags: Pixiv_Tag[] - tools: string[] - create_date: string - page_count: number - width: number - height: number - sanity_level: number - meta_single_page: { - original_image_url?: string - } - meta_pages: Pixiv_Meta_Page[] - total_view: number - total_bookmarks: number - is_bookmarked: boolean - visible: boolean - is_muted: boolean - total_comments: number -} -export interface Pixiv_Tag { - name: string - translated_name: string | null - added_by_uploaded_user?: boolean - illust?: Pixiv_Illust - is_registered?: boolean -} -export interface Pixiv_Meta_Page { - image_urls: { - square_medium: string - medium: string - large: string - original: string - } -} -export interface Pixiv_Comment { - id: number - comment: string - date: string - user: Pixiv_User - parent_comment: Pixiv_Comment | {} -} -export interface Pixiv_Novel { - id: number - title: string - caption: string - restrict: number - x_restrict: number - image_urls: { - square_medium: string - medium: string - large?: string - } - create_date: string - tags: Pixiv_Tag[] - page_count: number - text_length: number - user: Pixiv_User - series: - | { - id: number - title: string - } - | {} - is_bookmarked: boolean - total_bookmarks: number - total_view: number - visible: boolean - total_comments: number - is_muted: boolean - is_mypixiv_only: boolean - is_x_restricted: boolean -} -export interface Pixiv_Manga { - id: number - title: string - type: string - image_urls: { - square_medium: string - medium: string - large?: string - } - caption: string - restrict: number - user: Pixiv_User - tags: Pixiv_Tag[] - tools: string[] - create_date: string - page_count: string - width: number - height: number - sanity_level: number - x_restrict: number - series: { - id: number - title: string - } | null - meta_single_page: {} - meta_pages: Pixiv_Meta_Page[] - total_view: number - total_bookmarks: number - is_bookmarked: boolean - visible: boolean - is_muted: boolean -} -export interface Pixiv_Trend_Tags { - trend_tags: Pixiv_Tag[] -} -export interface Pixiv_Auto_Complete { - search_auto_complete_keywords: string[] -} -export interface Pixiv_Bookmark_Detail { - is_bookmarked: boolean - tags: Pixiv_Tag[] - restrict: string -} -export interface Ugoira_Meta_Data { - ugoira_metadata: { - zip_urls: { - medium: string - } - frames: { - file: string - delay: number - }[] - } -} -//# sourceMappingURL=Pixiv_Types.d.ts.map diff --git a/dist/Pixiv_Types.d.ts.map b/dist/Pixiv_Types.d.ts.map deleted file mode 100644 index e7e717b..0000000 --- a/dist/Pixiv_Types.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Pixiv_Types.d.ts","sourceRoot":"","sources":["../src/Pixiv_Types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,YAAY;IAC3B,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,MAAM,CAAA;IAClB,UAAU,EAAE,MAAM,CAAA;IAClB,KAAK,EAAE,MAAM,CAAA;IACb,aAAa,EAAE,MAAM,CAAA;IACrB,IAAI,EAAE,iBAAiB,CAAA;IACvB,YAAY,EAAE,MAAM,CAAA;CACrB;AAED,MAAM,WAAW,iBAAiB;IAChC,kBAAkB,EAAE;QAClB,QAAQ,EAAE,MAAM,CAAA;QAChB,QAAQ,EAAE,MAAM,CAAA;QAChB,UAAU,EAAE,MAAM,CAAA;KACnB,CAAA;IACD,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;IACZ,OAAO,EAAE,MAAM,CAAA;IACf,YAAY,EAAE,MAAM,CAAA;IACpB,UAAU,EAAE,OAAO,CAAA;IACnB,UAAU,EAAE,MAAM,CAAA;IAClB,kBAAkB,EAAE,OAAO,CAAA;CAC5B;AAED,MAAM,WAAW,kBAAkB;IACjC,SAAS,EAAE,MAAM,CAAA;IACjB,aAAa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ACtB,IAAI,EAAE,SAAS,EAAE,CAAA;IACjB,QAAQ,EAAE,MAAM,CAAA;CACjB;AAED,MAAM,WAAW,gBAAgB;IAC/B,eAAe,EAAE;QACf,QAAQ,EAAE;YACR,MAAM,EAAE,MAAM,CAAA;SACf,CAAA;QACD,MAAM,EAAE;YACN,IAAI,EAAE,MAAM,CAAA;YACZ,KAAK,EAAE,MAAM,CAAA;SACd,EAAE,CAAA;KACJ,CAAA;CACF"} \ No newline at end of file diff --git a/dist/Pixiv_Types.js b/dist/Pixiv_Types.js deleted file mode 100644 index 9846cd1..0000000 --- a/dist/Pixiv_Types.js +++ /dev/null @@ -1,3 +0,0 @@ -"use strict"; -Object.defineProperty(exports, "__esModule", { value: true }); -//# sourceMappingURL=Pixiv_Types.js.map \ No newline at end of file diff --git a/dist/Pixiv_Types.js.map b/dist/Pixiv_Types.js.map deleted file mode 100644 index 38c043f..0000000 --- a/dist/Pixiv_Types.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"Pixiv_Types.js","sourceRoot":"","sources":["../src/Pixiv_Types.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/index.d.ts b/dist/index.d.ts deleted file mode 100644 index 9994833..0000000 --- a/dist/index.d.ts +++ /dev/null @@ -1,185 +0,0 @@ -import { - Pixiv_Client, - Pixiv_User_Detail, - Pixiv_Illust_Search, - Pixiv_User_Search, - Pixiv_Illust, - Pixiv_Comment_Search, - Pixiv_Trend_Tags, - Pixiv_Novel_Search, - Pixiv_Auto_Complete, - Pixiv_Bookmark_Detail, - Pixiv_Bookmark_Search, - Ugoira_Meta_Data, - Pixiv_Manga_Search -} from './Pixiv_Types' -import { - PixivClient, - PixivIllustSearch, - PixivParams, - PixivFetchOptions, - PixivBookmarkDetail, - PixivBookmarkSearch, - PixivUserDetail, - PixivUserSearch, - PixivIllust, - PixivCommentSearch, - PixivNovelSearch, - PixivAutoComplete, - UgoiraMetaData, - PixivMangaSearch, - PixivTrendTags -} from './PixivTypes' -export default class PixivApp { - camelcaseKeys: CamelcaseKeys - username: string | undefined - password: string | undefined - refreshToken: string - nextUrl: string | null - auth: PixivClient | null - private _once - constructor( - username?: string, - password?: string, - options?: { - camelcaseKeys?: CamelcaseKeys - } - ) - login( - username?: string, - password?: string - ): Promise - authInfo(): CamelcaseKeys extends true ? PixivClient : Pixiv_Client - hasNext(): boolean - next(): Promise - nextQuery(): undefined | string - makeIterable(resp: any): AsyncIterable - userDetail( - id: number, - params?: PixivParams - ): Promise - userIllusts( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - userFollowAdd(id: number, params?: PixivParams): Promise - userFollowDelete(id: number, params?: PixivParams): Promise - userBookmarksIllust( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - userFollowing( - id: number, - params?: PixivParams - ): Promise - userFollower( - id: number, - params?: PixivParams - ): Promise - userMypixiv( - id: number, - params?: PixivParams - ): Promise - userList(id: number, params?: PixivParams): Promise - illustDetail( - id: number, - params?: PixivParams - ): Promise - illustNew( - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - illustFollow( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - illustComments( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivCommentSearch : Pixiv_Comment_Search - > - illustRelated( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - illustRecommended( - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - illustRecommendedNologin( - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - illustRanking( - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - trendingTagsIllust( - params?: PixivParams - ): Promise - searchIllust( - word: string, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivIllustSearch : Pixiv_Illust_Search - > - searchNovel( - word: string, - params?: PixivParams - ): Promise - searchUser( - word: string, - params?: PixivParams - ): Promise - searchAutoComplete( - word: string - ): Promise< - CamelcaseKeys extends true ? PixivAutoComplete : Pixiv_Auto_Complete - > - illustBookmarkDetail( - id: number, - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivBookmarkDetail : Pixiv_Bookmark_Detail - > - illustBookmarkAdd(id: number, params?: PixivParams): Promise - illustBookmarkDelete(id: number, params?: PixivParams): Promise - userBookmarkTagsIllust( - params?: PixivParams - ): Promise< - CamelcaseKeys extends true ? PixivBookmarkSearch : Pixiv_Bookmark_Search - > - novelRecommended( - params?: PixivParams - ): Promise - mangaNew(params?: PixivParams): Promise - mangaRecommended( - params?: PixivParams - ): Promise - novelRecommendedNologin( - params?: PixivParams - ): Promise - novelNew( - params?: PixivParams - ): Promise - ugoiraMetaData( - id: number, - params?: PixivParams - ): Promise - fetch(target: string, options?: PixivFetchOptions): Promise - private _get -} -//# sourceMappingURL=index.d.ts.map diff --git a/dist/index.d.ts.map b/dist/index.d.ts.map deleted file mode 100644 index 3da7dae..0000000 --- a/dist/index.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAMA,OAAO,EACL,YAAY,EACZ,iBAAiB,EACjB,mBAAmB,EACnB,iBAAiB,EACjB,YAAY,EACZ,oBAAoB,EACpB,gBAAgB,EAChB,kBAAkB,EAClB,mBAAmB,EACnB,qBAAqB,EACrB,qBAAqB,EACrB,gBAAgB,EAChB,kBAAkB,EACnB,MAAM,eAAe,CAAA;AACtB,OAAO,EACL,WAAW,EACX,iBAAiB,EAEjB,WAAW,EACX,iBAAiB,EACjB,mBAAmB,EACnB,mBAAmB,EACnB,eAAe,EACf,eAA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db015e..0000000 --- a/dist/index.js +++ /dev/null @@ -1,364 +0,0 @@ -"use strict"; -var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); } -var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) { - if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined."); - var g = generator.apply(thisArg, _arguments || []), i, q = []; - return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i; - function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; } - function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } } - function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); } - function fulfill(value) { resume("next", value); } - function reject(value) { resume("throw", value); } - function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); } -}; -var __importStar = (this && this.__importStar) || function (mod) { - if (mod && mod.__esModule) return mod; - var result = {}; - if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k]; - result["default"] = mod; - return result; -}; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const querystring_1 = require("querystring"); -const crypto = __importStar(require("crypto")); -const url_1 = __importDefault(require("url")); -const axios_1 = __importDefault(require("axios")); -const decamelize_keys_1 = __importDefault(require("decamelize-keys")); -const camelcase_keys_1 = __importDefault(require("camelcase-keys")); -const baseURL = 'https://app-api.pixiv.net/'; -const instance = axios_1.default.create({ - baseURL, - headers: { - 'App-OS': 'ios', - 'App-OS-Version': '9.3.3', - 'App-Version': '6.0.9' - } -}); -const CLIENT_ID = 'MOBrBDS8blbauoSck0ZfDbtuzpyT'; -const CLIENT_SECRET = 'lsACyCD94FhDUtGTXi3QzcFE2uU1hqtDaKeqrdwj'; -const HASH_SECRET = '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c'; -const filter = 'for_ios'; -class PixivApp { - constructor(username, password, options) { - this.camelcaseKeys = true; - this.username = username; - this.password = password; - this.refreshToken = ''; - this.nextUrl = null; - this.auth = null; - this._once = false; - if (options) { - this.camelcaseKeys = Boolean(options.camelcaseKeys); - } - else { - this.camelcaseKeys = true; - } - } - async login(username, password) { - this.username = username || this.username; - this.password = password || this.password; - if (typeof this.username !== 'string') { - return Promise.reject(new TypeError(`Auth is required. Expected a string, got ${typeof this.username}`)); - } - if (typeof this.password !== 'string') { - return Promise.reject(new TypeError(`Auth is required. Expected a string, got ${typeof this.password}`)); - } - const local_time = new Date().toISOString(); - const headers = { - 'X-Client-Time': local_time, - 'X-Client-Hash': crypto - .createHash('md5') - .update(Buffer.from(`${local_time}${HASH_SECRET}`, 'utf8')) - .digest('hex') - }; - const data = { - clientId: CLIENT_ID, - clientSecret: CLIENT_SECRET, - getSecureUrl: '1', - grantType: '', - username: '', - password: '', - refreshToken: '' - }; - if (this.refreshToken === '') { - data.grantType = 'password'; - data.username = this.username; - data.password = this.password; - } - else { - data.grantType = 'refresh_token'; - data.refreshToken = this.refreshToken; - } - const axiosResponse = await axios_1.default.post('https://oauth.secure.pixiv.net/auth/token', querystring_1.stringify(decamelize_keys_1.default(data)), { headers }); - const { response } = axiosResponse.data; - this.auth = response; - this.refreshToken = axiosResponse.data.response.refresh_token; - instance.defaults.headers.common.Authorization = `Bearer ${response.access_token}`; - return this.camelcaseKeys - ? camelcase_keys_1.default(response, { deep: true }) - : response; - } - authInfo() { - return this.camelcaseKeys - ? camelcase_keys_1.default(this.auth, { - deep: true - }) - : this.auth; - } - hasNext() { - return Boolean(this.nextUrl); - } - next() { - return this.fetch(this.nextUrl); - } - nextQuery() { - // This always returns undefined - // @ts-ignore - return url_1.default.parse(this.nextUrl, true).params; - } - makeIterable(resp) { - // eslint-disable-next-line @typescript-eslint/no-this-alias - const self = this; - const nextUrl = this.camelcaseKeys ? 'nextUrl' : 'next_url'; - return { - [Symbol.asyncIterator]() { - return __asyncGenerator(this, arguments, function* _a() { - yield yield __await(resp); - while (resp[nextUrl]) { - // eslint-disable-next-line require-atomic-updates - resp = yield __await(self.fetch(resp[nextUrl])); - yield yield __await(resp); - } - }); - } - }; - } - userDetail(id, params) { - params = Object.assign({ userId: id, filter }, params); - return this.fetch('/v1/user/detail', { params }); - } - userIllusts(id, params) { - params = Object.assign({ userId: id, type: 'illust', filter }, params); - return this.fetch('/v1/user/illusts', { params }); - } - // This endpoint doesn't exist - userFollowAdd(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id, restrict: 'public', filter }, params); - return this.fetch('/v1/user/follow/add', { params }); - } - // This endpoint doesn't exist - userFollowDelete(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id, restrict: 'public', filter }, params); - return this.fetch('/v1/user/follow/delete', { params }); - } - userBookmarksIllust(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id, restrict: 'public', filter }, params); - return this.fetch('/v1/user/bookmarks/illust', { params }); - } - userFollowing(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id, restrict: 'public' }, params); - return this.fetch('/v1/user/following', { params }); - } - userFollower(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id }, params); - return this.fetch('/v1/user/follower', { params }); - } - userMypixiv(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id }, params); - return this.fetch('/v1/user/mypixiv', { params }); - } - // This endpoint doesn't exist - userList(id, params) { - if (!id) { - return Promise.reject(new Error('userId required')); - } - params = Object.assign({ userId: id, filter }, params); - return this.fetch('/v1/user/list', { params }); - } - illustDetail(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id, filter }, params); - return this.fetch('/v1/illust/detail', { params }); - } - illustNew(params) { - params = Object.assign({ contentType: 'illust', filter }, params); - return this.fetch('/v1/illust/new', { params }); - } - illustFollow(id, params) { - params = Object.assign({ userId: id, restrict: 'public' }, params); - return this.fetch('/v2/illust/follow', { params }); - } - illustComments(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id, includeTotalComments: true }, params); - return this.fetch('/v1/illust/comments', { params }); - } - illustRelated(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id, filter }, params); - return this.fetch('/v2/illust/related', { params }); - } - illustRecommended(params) { - params = Object.assign({ contentType: 'illust', includeRankingLabel: true, filter }, params); - return this.fetch('/v1/illust/recommended', { params }); - } - illustRecommendedNologin(params) { - params = Object.assign({ includeRankingIllusts: true, filter }, params); - return this.fetch('/v1/illust/recommended-nologin', { params }); - } - illustRanking(params) { - params = Object.assign({ mode: 'day', filter }, params); - return this.fetch('/v1/illust/ranking', { params }); - } - trendingTagsIllust(params) { - params = Object.assign({ filter }, params); - return this.fetch('/v1/trending-tags/illust', { params }); - } - searchIllust(word, params) { - if (!word) { - return Promise.reject(new Error('Word required')); - } - params = Object.assign({ word, searchTarget: 'partial_match_for_tags', sort: 'date_desc', filter }, params); - return this.fetch('/v1/search/illust', { params }); - } - searchNovel(word, params) { - if (!word) { - return Promise.reject(new Error('Word required')); - } - params = Object.assign({ word, searchTarget: 'partial_match_for_tags', sort: 'date_desc', filter }, params); - return this.fetch('/v1/search/novel', { params }); - } - searchUser(word, params) { - if (!word) { - return Promise.reject(new Error('Word required')); - } - params = Object.assign({ word, - filter }, params); - return this.fetch('/v1/search/user', { params }); - } - searchAutoComplete(word) { - if (!word) { - return Promise.reject(new Error('word required')); - } - return this.fetch('/v1/search/autocomplete', { params: { word } }); - } - illustBookmarkDetail(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id }, params); - return this.fetch('/v2/illust/bookmark/detail', { params }); - } - // This endpoint doesn't exist - illustBookmarkAdd(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id, restrict: 'public' }, params); - return this.fetch('/v2/illust/bookmark/add', { params }); - } - // This endpoint doesn't exist - illustBookmarkDelete(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id }, params); - return this.fetch('/v1/illust/bookmark/delete', { params }); - } - userBookmarkTagsIllust(params) { - params = Object.assign({ restrict: 'public' }, params); - return this.fetch('/v1/user/bookmark-tags/illust', { params }); - } - novelRecommended(params) { - params = Object.assign({ includeRankingNovels: true, filter }, params); - return this.fetch('/v1/novel/recommended', { params }); - } - // This endpoint doesn't exist - mangaNew(params) { - params = Object.assign({ contentType: 'manga', filter }, params); - return this.fetch('/v1/manga/new', { params }); - } - mangaRecommended(params) { - params = Object.assign({ includeRankingLabel: true, filter }, params); - return this.fetch('/v1/manga/recommended', { params }); - } - novelRecommendedNologin(params) { - params = Object.assign({ includeRankingNovels: true, filter }, params); - return this.fetch('/v1/novel/recommended-nologin', { params }); - } - novelNew(params) { - params = Object.assign({ filter }, params); - return this.fetch('/v1/novel/new', { params }); - } - ugoiraMetaData(id, params) { - if (!id) { - return Promise.reject(new Error('illustId required')); - } - params = Object.assign({ illustId: id, filter }, params); - return this.fetch('/v1/ugoira/metadata', { params }); - } - async fetch(target, options) { - if (!target) { - return Promise.reject(new Error('url required')); - } - try { - return this._get(target, options); - } - catch (error) { - if (this._once) { - this._once = false; - throw error; - } - await this.login(); - this._once = true; - return this._get(target, options); - } - } - async _get(target, options = {}) { - options = options || {}; - if (options.data) { - options.method = 'post'; - options.headers = { - 'Content-Type': 'application/x-www-form-urlencoded' - }; - options.data = querystring_1.stringify(decamelize_keys_1.default(options.data)); - } - if (options.params) { - options.params = decamelize_keys_1.default(options.params); - } - const { data } = await instance(target, options); - this.nextUrl = data && data.next_url ? data.next_url : null; - return this.camelcaseKeys ? camelcase_keys_1.default(data, { deep: true }) : data; - } -} -exports.default = PixivApp; -module.exports.default = PixivApp; -module.exports = PixivApp; -//# sourceMappingURL=index.js.map \ No newline at end of file diff --git a/dist/index.js.map b/dist/index.js.map deleted file mode 100644 index 9cf73f9..0000000 --- a/dist/index.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAAuC;AACvC,+CAAgC;AAChC,8CAAqB;AACrB,kDAAiD;AACjD,sEAA4C;AAC5C,oEAA0C;AAmC1C,MAAM,OAAO,GAAG,4BAA4B,CAAA;AAC5C,MAAM,QAAQ,GAAG,eAAK,CAAC,MAAM,CAAC;IAC5B,OAAO;IACP,OAAO,EAAE;QACP,QAAQ,EAAE,KAAK;QACf,gBAAgB,EAAE,OAAO;QACzB,aAAa,EAAE,OAAO;KACvB;CACF,CAAC,CAAA;AAEF,MAAM,SAAS,GAAG,8BAA8B,CAAA;AAChD,MAAM,aAAa,GAAG,0CAA0C,CAAA;AAChE,MAAM,WAAW,GACf,kEAAkE,CAAA;AACpE,MAAM,MAAM,GAAG,SAAS,CAAA;AAExB,MAAqB,QAAQ;IAS3B,YACE,QAAiB,EACjB,QAAiB,EACjB,OAA2C;QAX7C,kBAAa,GAAG,IAAqB,CAAA;QAanC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAA;QACxB,IAAI,CAAC,YAAY,GAAG,EAAE,CAAA;QACtB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAA;QACnB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAA;QAChB,IAAI,CAAC,KAAK,GAAG,KAAK,CAAA;QAClB,IAAI,OAAO,EAAE;YACX,IAAI,CAAC,aAAa,GAAG,OAAO,CAAC,OAAO,CAAC,aAAa,CAAkB,CAAA;SACrE;aAAM;YACL,IAAI,CAAC,aAAa,GAAG,IAAqB,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IAAI,CAAC,CAAC,CAAA;SACvD;QAED,IAAI,OAAO,CAAC,MAAM,EAAE;YAClB,OAAO,CAAC,MAAM,GAAG,yBAAc,CAAC,OAAO,CAAC,MAAM,CAAC,CAAA;SAChD;QACD,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,QAAQ,CAAC,MAAM,EAAE,OAA6B,CAAC,CAAA;QACtE,IAAI,CAAC,OAAO,GAAG,IAAI,IAAI,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,IAAI,CAAA;QAC3D,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC,CAAC,wBAAa,CAAC,IAAI,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC,IAAI,CAAA;IACxE,CAAC;CACF;AAjnBD,2BAinBC;AAED,MAAM,CAAC,OAAO,CAAC,OAAO,GAAG,QAAQ,CAAA;AACjC,MAAM,CAAC,OAAO,GAAG,QAAQ,CAAA"} \ No newline at end of file diff --git a/dist/index.test.d.ts b/dist/index.test.d.ts deleted file mode 100644 index 856d8b4..0000000 --- a/dist/index.test.d.ts +++ /dev/null @@ -1,2 +0,0 @@ -export {} -//# sourceMappingURL=index.test.d.ts.map diff --git a/dist/index.test.d.ts.map b/dist/index.test.d.ts.map deleted file mode 100644 index b5774e1..0000000 --- a/dist/index.test.d.ts.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.test.d.ts","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":""} \ No newline at end of file diff --git a/dist/index.test.js b/dist/index.test.js deleted file mode 100644 index 7d1cc6c..0000000 --- a/dist/index.test.js +++ /dev/null @@ -1,122 +0,0 @@ -"use strict"; -var __importDefault = (this && this.__importDefault) || function (mod) { - return (mod && mod.__esModule) ? mod : { "default": mod }; -}; -Object.defineProperty(exports, "__esModule", { value: true }); -const lodash_isequal_1 = __importDefault(require("lodash.isequal")); -const is_plain_obj_1 = __importDefault(require("is-plain-obj")); -const _1 = __importDefault(require(".")); -const userId = 471355; -const illustId = 57907953; -const PASSWORD = process.env.PASSWORD; -const NAME = process.env.NAME; -jest.setTimeout(10000); -function setup() { - return new _1.default(NAME, PASSWORD); -} -const pixiv = setup(); -let auth = null; -async function setAuth() { - auth = await pixiv.login(); -} -// リクエストを送りまくると制限されるので1度だけlogin -beforeAll(() => { - return setAuth(); -}); -test('expose a constructor', () => { - expect(typeof _1.default === 'function').toBe(true); -}); -test('auth', () => { - const json = pixiv.authInfo(); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('userDetail', async () => { - expect.assertions(1); - const json = await pixiv.userDetail(userId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('userIllusts', async () => { - expect.assertions(1); - const json = await pixiv.userIllusts(userId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('userBookmarksIllust', async () => { - expect.assertions(1); - const json = await pixiv.userBookmarksIllust(auth.user.id); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('userBookmarksIllust private', async () => { - expect.assertions(1); - const json = await pixiv.userBookmarksIllust(auth.user.id, { - restrict: 'private' - }); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustDetail', async () => { - expect.assertions(1); - const json = await pixiv.illustDetail(illustId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustFollow', async () => { - expect.assertions(1); - const json = await pixiv.illustFollow(userId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustComments', async () => { - expect.assertions(1); - const json = await pixiv.illustComments(illustId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustRelated', async () => { - expect.assertions(1); - const json = await pixiv.illustRelated(illustId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustRecommended', async () => { - expect.assertions(1); - const json = await pixiv.illustRecommended(); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustRanking', async () => { - expect.assertions(1); - const json = await pixiv.illustRanking(); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('trendingTagsIllust', async () => { - expect.assertions(1); - const json = await pixiv.trendingTagsIllust(); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('searchIllust', async () => { - expect.assertions(1); - const json = await pixiv.searchIllust('レム'); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('illustBookmarkDetail', async () => { - expect.assertions(1); - const json = await pixiv.illustBookmarkDetail(illustId); - expect(is_plain_obj_1.default(json)).toBe(true); -}); -test('decamelize params', async () => { - expect.assertions(1); - const json1 = await pixiv.userIllusts(userId); - const json2 = await pixiv.userIllusts(userId, { userId: 2957827 }); - expect(lodash_isequal_1.default(json1, json2)).toBe(false); -}); -test('camelcaseKeys', async () => { - expect.assertions(1); - const json = await pixiv.userIllusts(userId, { userId: 2957827 }); - expect({}.hasOwnProperty.call(json, 'nextUrl')).toBe(true); -}); -test('not camelcaseKeys', async () => { - expect.assertions(1); - const json = await pixiv.userIllusts(userId, { userId: 2957827 }); - expect({}.hasOwnProperty.call(json, 'next_url')).toBe(false); -}); -test('makeIterable', async () => { - expect.assertions(1); - const json = await pixiv.userIllusts(userId, { userId: 2957827 }); - const iterable = pixiv.makeIterable(json); - expect({}.hasOwnProperty.call(iterable, Symbol.asyncIterator)).toBe(true); -}); -//# sourceMappingURL=index.test.js.map \ No newline at end of file diff --git a/dist/index.test.js.map b/dist/index.test.js.map deleted file mode 100644 index 67a20de..0000000 --- a/dist/index.test.js.map +++ /dev/null @@ -1 +0,0 @@ -{"version":3,"file":"index.test.js","sourceRoot":"","sources":["../src/index.test.ts"],"names":[],"mappings":";;;;;AAAA,oEAAoC;AACpC,gEAAqC;AACrC,yCAA2B;AAE3B,MAAM,MAAM,GAAG,MAAM,CAAA;AACrB,MAAM,QAAQ,GAAG,QAAQ,CAAA;AACzB,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,QAAkB,CAAA;AAC/C,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,CAAC,IAAc,CAAA;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,EAAE;IAC/B,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjE,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC5D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,mBAAmB,EAAE,KAAK,IAAI,EAAE;IACnC,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjE,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAA;AAC9D,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,cAAc,EAAE,KAAK,IAAI,EAAE;IAC9B,MAAM,CAAC,UAAU,CAAC,CAAC,CAAC,CAAA;IACpB,MAAM,IAAI,GAAG,MAAM,KAAK,CAAC,WAAW,CAAC,MAAM,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAA;IACjE,MAAM,QAAQ,GAAG,KAAK,CAAC,YAAY,CAAC,IAAI,CAAC,CAAA;IACzC,MAAM,CAAC,EAAE,CAAC,cAAc,CAAC,IAAI,CAAC,QAAQ,EAAE,MAAM,CAAC,aAAa,CAAC,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;AAC3E,CAAC,CAAC,CAAA"} \ No newline at end of file diff --git a/package.json b/package.json index 11e9dbf..0cf5e68 100644 --- a/package.json +++ b/package.json @@ -57,6 +57,7 @@ "@types/lodash.isequal": "^4.5.5", "@types/node": "^12.7.4", "all-contributors-cli": "^6.9.0", + "dotenv": "^8.1.0", "eslint": "^6.3.0", "eslint-config-precure": "^5.1.0", "husky": "^3.0.5", diff --git a/src/index.ts b/src/index.ts index 076a53b..0343a6b 100644 --- a/src/index.ts +++ b/src/index.ts @@ -54,8 +54,8 @@ const HASH_SECRET = '28c1fdd170a5204386cb1313c7077b34f83e4aaf4aa829ce78c231e05b0bae2c' const filter = 'for_ios' -export default class PixivApp { - camelcaseKeys = true as CamelcaseKeys +export default class PixivApp { + camelcaseKeys: CamelcaseKeys username: string | undefined password: string | undefined refreshToken: string @@ -66,7 +66,7 @@ export default class PixivApp { constructor( username?: string, password?: string, - options?: { camelcaseKeys?: CamelcaseKeys } + options?: { camelcaseKeys: CamelcaseKeys } ) { this.username = username this.password = password @@ -74,6 +74,7 @@ export default class PixivApp { this.nextUrl = null this.auth = null this._once = false + this.camelcaseKeys = true as CamelcaseKeys if (options) { this.camelcaseKeys = Boolean(options.camelcaseKeys) as CamelcaseKeys } else { diff --git a/tsconfig.json b/tsconfig.json index b8fd79d..e083f8d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,7 @@ "outDir": "dist", "strict": true, "noImplicitAny": true, - "declaration": true, - "declarationMap": true + "declaration": true }, "include": ["src", "declarations.d.ts"] } diff --git a/yarn.lock b/yarn.lock index 56d8075..f10243c 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1421,6 +1421,11 @@ domexception@^1.0.1: dependencies: webidl-conversions "^4.0.2" +dotenv@^8.1.0: + version "8.1.0" + resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.1.0.tgz#d811e178652bfb8a1e593c6dd704ec7e90d85ea2" + integrity sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA== + duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" From f10a87d470359c9c93bb2ac1f769ea585acb89ce Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 20:03:18 -0400 Subject: [PATCH 7/9] updated lock file --- package.json | 1 - yarn.lock | 5 ----- 2 files changed, 6 deletions(-) diff --git a/package.json b/package.json index 0cf5e68..11e9dbf 100644 --- a/package.json +++ b/package.json @@ -57,7 +57,6 @@ "@types/lodash.isequal": "^4.5.5", "@types/node": "^12.7.4", "all-contributors-cli": "^6.9.0", - "dotenv": "^8.1.0", "eslint": "^6.3.0", "eslint-config-precure": "^5.1.0", "husky": "^3.0.5", diff --git a/yarn.lock b/yarn.lock index f10243c..56d8075 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1421,11 +1421,6 @@ domexception@^1.0.1: dependencies: webidl-conversions "^4.0.2" -dotenv@^8.1.0: - version "8.1.0" - resolved "https://registry.yarnpkg.com/dotenv/-/dotenv-8.1.0.tgz#d811e178652bfb8a1e593c6dd704ec7e90d85ea2" - integrity sha512-GUE3gqcDCaMltj2++g6bRQ5rBJWtkWTmqmD0fo1RnnMuUqHNCt2oTPeDnS9n6fKYvlhn7AeBkb38lymBtWBQdA== - duplexer3@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/duplexer3/-/duplexer3-0.1.4.tgz#ee01dd1cac0ed3cbc7fdbea37dc0a8f1ce002ce2" From 5d8b47c4e17b7d5e24fd702c3b55d174c2a8b751 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 20:04:48 -0400 Subject: [PATCH 8/9] typo --- src/index.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 0343a6b..6a9ac57 100644 --- a/src/index.ts +++ b/src/index.ts @@ -74,7 +74,6 @@ export default class PixivApp { this.nextUrl = null this.auth = null this._once = false - this.camelcaseKeys = true as CamelcaseKeys if (options) { this.camelcaseKeys = Boolean(options.camelcaseKeys) as CamelcaseKeys } else { From 9c1d67c91768d28ad4579c7fae41b813e2c66674 Mon Sep 17 00:00:00 2001 From: Tenpi <37512637+Tenpi@users.noreply.github.com> Date: Thu, 3 Oct 2019 20:06:09 -0400 Subject: [PATCH 9/9] typo --- src/index.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/index.ts b/src/index.ts index 6a9ac57..481263f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -66,7 +66,7 @@ export default class PixivApp { constructor( username?: string, password?: string, - options?: { camelcaseKeys: CamelcaseKeys } + options?: { camelcaseKeys?: CamelcaseKeys } ) { this.username = username this.password = password