New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@book000/pixivts

Package Overview
Dependencies
Maintainers
1
Versions
896
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@book000/pixivts - npm Package Compare versions

Comparing version 0.10.2 to 0.11.0

dist/types/endpoints/v1/manga/recommended.d.ts

1

dist/index.d.ts

@@ -5,2 +5,3 @@ export * from './types/endpoints/v2/illust/bookmark/add';

export * from './types/endpoints/v1/illust/series';
export * from './types/endpoints/v1/manga/recommended';
export * from './types/endpoints/v1/novel/recommended';

@@ -7,0 +8,0 @@ export * from './types/endpoints/v1/novel/text';

@@ -25,2 +25,3 @@ "use strict";

__exportStar(require("./types/endpoints/v1/illust/series"), exports);
__exportStar(require("./types/endpoints/v1/manga/recommended"), exports);
__exportStar(require("./types/endpoints/v1/novel/recommended"), exports);

@@ -27,0 +28,0 @@ __exportStar(require("./types/endpoints/v1/novel/text"), exports);

@@ -13,2 +13,3 @@ import { GetV1IllustDetailRequest } from './types/endpoints/v1/illust/detail';

import { GetV1UserDetailRequest } from './types/endpoints/v1/user/detail';
import { GetV1MangaRecommendedRequest } from './types/endpoints/v1/manga/recommended';
import { BaseSimpleCheck, CheckFunctions } from './checks';

@@ -119,2 +120,6 @@ /**

/**
* おすすめマンガ取得オプション
*/
export type MangaRecommendedOptions = SnakeToCamel<Partial<GetV1MangaRecommendedRequest>>;
/**
* 小説詳細取得オプション

@@ -121,0 +126,0 @@ */

10

dist/pixiv.d.ts

@@ -5,3 +5,3 @@ /// <reference types="node" />

import qs from 'qs';
import { IllustDetailOptions, SearchIllustOptions, RecommendedIllustOptions, IllustBookmarkAddOptions, NovelDetailOptions, SearchNovelOptions, RecommendedNovelOptions, NovelSeriesOptions, UserDetailOptions, IllustSeriesOptions, NovelTextOptions } from './options';
import { IllustDetailOptions, SearchIllustOptions, RecommendedIllustOptions, IllustBookmarkAddOptions, NovelDetailOptions, SearchNovelOptions, RecommendedNovelOptions, NovelSeriesOptions, UserDetailOptions, IllustSeriesOptions, NovelTextOptions, MangaRecommendedOptions } from './options';
import { PixivApiError } from './types/error-response';

@@ -19,2 +19,3 @@ import { GetV1IllustDetailResponse } from './types/endpoints/v1/illust/detail';

import { GetV1UserDetailResponse } from './types/endpoints/v1/user/detail';
import { GetV1MangaRecommendedResponse } from './types/endpoints/v1/manga/recommended';
/**

@@ -86,2 +87,3 @@ * pixiv API

illustSeries(options: IllustSeriesOptions): Promise<AxiosResponse<GetV1IllustSeriesResponse, any>>;
mangaRecommended(options?: MangaRecommendedOptions): Promise<AxiosResponse<GetV1MangaRecommendedResponse, any>>;
/**

@@ -124,3 +126,3 @@ * 小説の詳細情報を取得する。

/**
* ユーザーの詳細情報を取得する。
* ユーザの詳細情報を取得する。
*

@@ -166,2 +168,3 @@ * @param options オプション

* @param required 必須のオプションキー
* @throws 必須のオプションが含まれていない場合
*/

@@ -171,2 +174,5 @@ private checkRequiredOptions;

* スネークケースのオブジェクトキーをキャメルケースなオブジェクトキーに変換する。
*
* @param object オブジェクト
* @returns 変換後のオブジェクト
*/

@@ -173,0 +179,0 @@ private convertSnakeToCamel;

@@ -90,2 +90,3 @@ "use strict";

}
// ---------- イラスト ---------- //
/**

@@ -196,2 +197,19 @@ * イラストの詳細情報を取得する。

}
// ---------- マンガ ---------- //
async mangaRecommended(options = {}) {
const parameters = {
...this.convertSnakeToCamel(options),
filter: options.filter || options_1.Filter.FOR_IOS,
include_ranking_illusts: options.includeRankingIllusts || true,
max_bookmark_id: options.maxBookmarkId || undefined,
offset: options.offset || undefined,
include_privacy_policy: options.includePrivacyPolicy || true,
};
return this.request({
method: 'GET',
path: '/v1/manga/recommended',
params: parameters,
});
}
// ---------- 小説 ---------- //
/**

@@ -304,4 +322,5 @@ * 小説の詳細情報を取得する。

}
// ---------- ユーザ ---------- //
/**
* ユーザーの詳細情報を取得する。
* ユーザの詳細情報を取得する。
*

@@ -387,2 +406,3 @@ * @param options オプション

* @param required 必須のオプションキー
* @throws 必須のオプションが含まれていない場合
*/

@@ -398,2 +418,5 @@ checkRequiredOptions(options, required) {

* スネークケースのオブジェクトキーをキャメルケースなオブジェクトキーに変換する。
*
* @param object オブジェクト
* @returns 変換後のオブジェクト
*/

@@ -400,0 +423,0 @@ convertSnakeToCamel(object) {

@@ -11,3 +11,4 @@ "use strict";

const series_1 = require("./types/endpoints/v1/illust/series");
const recommended_2 = require("./types/endpoints/v1/novel/recommended");
const recommended_2 = require("./types/endpoints/v1/manga/recommended");
const recommended_3 = require("./types/endpoints/v1/novel/recommended");
const text_1 = require("./types/endpoints/v1/novel/text");

@@ -30,3 +31,3 @@ const illust_1 = require("./types/endpoints/v1/search/illust");

});
it('illustDetail:107565629', async () => {
it('illustDetail:107565629[illust]', async () => {
const illustDetail = await pixiv.illustDetail({

@@ -73,2 +74,43 @@ illustId: 107565629,

});
it('illustDetail:103905962[manga]', async () => {
const illustDetail = await pixiv.illustDetail({
illustId: 103905962,
});
expect(illustDetail.status).toBe(200);
expect(illustDetail.data.illust.id).toBe(103905962);
expect(illustDetail.data.illust.title).toBe('【C101】あくあに恋した猫の話');
expect(illustDetail.data.illust.type).toBe('manga');
// "square_medium": "https://i.pximg.net/c/360x360_70/img-master/img/2023/04/27/13/39/51/107565629_p0_square1200.jpg",
expect(illustDetail.data.illust.image_urls.square_medium).toMatch(/^https:\/\/i\.pximg\.net\/c\/360x360_70\/img-master\/img\/.+_square1200\.jpg$/);
// "medium": "https://i.pximg.net/c/540x540_70/img-master/img/2023/04/27/13/39/51/107565629_p0_master1200.jpg",
expect(illustDetail.data.illust.image_urls.medium).toMatch(/^https:\/\/i\.pximg\.net\/c\/540x540_70\/img-master\/img\/.+_master1200\.jpg$/);
// "large": "https://i.pximg.net/c/600x1200_90/img-master/img/2023/04/27/13/39/51/107565629_p0_master1200.jpg",
expect(illustDetail.data.illust.image_urls.large).toMatch(/^https:\/\/i\.pximg\.net\/c\/600x1200_90\/img-master\/img\/.+_master1200\.jpg$/);
expect(illustDetail.data.illust.caption).toBe("C101の新刊サンプルです!<br /><br />恋愛アドベンチャーゲーム『あくありうむ。』に登場する「猫」。<br />彼はどんなことを考えていたのか?<br />彼にとって、これはどんな物語だったのか?<br />そういった本編で語られなかった部分を想像で掘り下げたお話です。<br />※本文は『あくありうむ。』のネタバレおよび多少の負傷描写を含みます。苦手な方はご注意ください。<br /><br />【1日目東C-13b/くらうでぃ】でお待ちしています!<br /><br />メロンブックス様にて新刊の事前予約も始まっています!<br />気になる方は是非チェックしてみてください!<br />【<a href=\"https://www.melonbooks.co.jp/detail/detail.php?product_id=1746005\" target='_blank' rel='noopener noreferrer'>https://www.melonbooks.co.jp/detail/detail.php?product_id=1746005</a>】");
expect(illustDetail.data.illust.restrict).toBe(0);
expect(illustDetail.data.illust.user.id).toBe(8166267);
expect(illustDetail.data.illust.user.name).toBe('くらうど');
expect(illustDetail.data.illust.user.account).toBe('borinn0812');
// https://i.pximg.net/user-profile/img/
expect(illustDetail.data.illust.user.profile_image_urls.medium).toMatch(/^https:\/\/i\.pximg\.net\/user-profile\/img\/.+\.(?:jpg|png)$/);
expect(illustDetail.data.illust.tags.length).toBeGreaterThan(0);
expect(illustDetail.data.illust.tools).toBeDefined();
expect(illustDetail.data.illust.tools.length).toBeGreaterThan(0);
expect(illustDetail.data.illust.create_date).toBe('2022-12-25T18:31:02+09:00');
expect(illustDetail.data.illust.page_count).toBe(8);
expect(illustDetail.data.illust.width).toBe(2508);
expect(illustDetail.data.illust.height).toBe(3541);
expect(illustDetail.data.illust.sanity_level).toBe(2);
expect(illustDetail.data.illust.x_restrict).toBe(0);
expect(illustDetail.data.illust.series).toBeNull();
expect(illustDetail.data.illust.meta_single_page).toStrictEqual({});
expect(illustDetail.data.illust.meta_pages).toHaveLength(8);
expect(illustDetail.data.illust.total_bookmarks).toBeGreaterThan(0);
expect(illustDetail.data.illust.total_view).toBeGreaterThan(0);
expect(illustDetail.data.illust.visible).toBe(true);
expect(illustDetail.data.illust.illust_ai_type).toBe(1);
expect(illustDetail.data.illust.illust_book_style).toBe(0);
const check = new detail_1.GetV1IllustDetailCheck();
expect(() => check.throwIfResponseFailed(illustDetail.data)).not.toThrow();
});
it('searchIllust', async () => {

@@ -106,2 +148,11 @@ const searchIllust = await pixiv.searchIllust({

});
it('recommendedManga', async () => {
const mangaRecommended = await pixiv.mangaRecommended();
expect(mangaRecommended.status).toBe(200);
expect(mangaRecommended.data).toBeDefined();
expect(mangaRecommended.data.illusts).toBeDefined();
expect(mangaRecommended.data.illusts.length).toBeGreaterThan(0);
const check = new recommended_2.GetV1MangaRecommendedCheck();
expect(() => check.throwIfResponseFailed(mangaRecommended.data)).not.toThrow();
});
it('novelDetail', async () => {

@@ -132,3 +183,3 @@ const novelDetail = await pixiv.novelDetail({

expect(novelDetail.data.novel.user.profile_image_urls).toBeDefined();
expect(novelDetail.data.novel.user.profile_image_urls.medium).toMatch(/^https:\/\/i\.pximg\.net\/user-profile\/img\/.+\.jpg$/);
expect(novelDetail.data.novel.user.profile_image_urls.medium).toMatch(/^https:\/\/i\.pximg\.net\/user-profile\/img\/.+\.(?:jpg|png)$/);
expect(novelDetail.data.novel.user.is_followed).toBeDefined();

@@ -182,3 +233,3 @@ expect(novelDetail.data.novel.series).toStrictEqual({});

expect(novelRecommended.data.novels.length).toBeGreaterThan(0);
const check = new recommended_2.GetV1NovelRecommendedCheck();
const check = new recommended_3.GetV1NovelRecommendedCheck();
expect(() => check.throwIfResponseFailed(novelRecommended.data)).not.toThrow();

@@ -185,0 +236,0 @@ });

{
"name": "@book000/pixivts",
"version": "0.10.2",
"version": "0.11.0",
"description": "pixiv Unofficial API Library for TypeScript",

@@ -31,3 +31,3 @@ "homepage": "https://www.npmjs.com/package/@book000/pixivts",

"generate-docs": "typedoc --gitRevision master src/index.ts",
"fix": "run-s fix:prettier fix:eslint",
"fix": "run-s fix:prettier fix:eslint ctix",
"fix:eslint": "eslint . --ext ts,tsx --fix",

@@ -34,0 +34,0 @@ "fix:prettier": "prettier --write src",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc