@book000/pixivts 0.56.0 → 0.56.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -695,7 +695,7 @@ function buildSearchParams(params) {
695
695
  for (const [key, value] of Object.entries(params)) {
696
696
  if (value === null || value === void 0) continue;
697
697
  if (Array.isArray(value)) {
698
- for (const item of value) usp.append(key, String(item));
698
+ for (const item of value) usp.append(`${key}[]`, String(item));
699
699
  } else {
700
700
  usp.set(key, String(value));
701
701
  }
@@ -883,15 +883,19 @@ var NovelResource = class {
883
883
  );
884
884
  }
885
885
  /**
886
- * Fetches the full text of a novel.
886
+ * Fetches the WebView HTML for a novel.
887
887
  * GET /webview/v2/novel
888
888
  *
889
+ * Returns the raw HTML page that the pixiv app renders in a WebView.
890
+ * To extract the plain text, parse the returned HTML (e.g. strip tags).
891
+ *
889
892
  * @param params - Request parameters
890
893
  */
891
894
  text(params) {
892
895
  return this.#http.get(
893
896
  "/webview/v2/novel",
894
- buildParams({ id: params.id })
897
+ // The webview endpoint uses the query parameter 'id', not 'novel_id'
898
+ buildParams({ id: params.novelId })
895
899
  );
896
900
  }
897
901
  /**
package/dist/index.d.cts CHANGED
@@ -1248,10 +1248,10 @@ interface NovelDetailParams {
1248
1248
  /** ID of the novel to fetch. */
1249
1249
  novelId: number;
1250
1250
  }
1251
- /** Parameters for fetching novel text content. */
1251
+ /** Parameters for fetching the WebView HTML of a novel. */
1252
1252
  interface NovelTextParams {
1253
- /** ID of the novel whose text to fetch. */
1254
- id: number;
1253
+ /** ID of the novel whose WebView HTML to fetch. */
1254
+ novelId: number;
1255
1255
  }
1256
1256
  /** Parameters for fetching related novels. */
1257
1257
  interface NovelRelatedParams {
@@ -1330,9 +1330,12 @@ declare class NovelResource {
1330
1330
  */
1331
1331
  detail(params: NovelDetailParams): ResultAsync<NovelDetailResponse, PixivError>;
1332
1332
  /**
1333
- * Fetches the full text of a novel.
1333
+ * Fetches the WebView HTML for a novel.
1334
1334
  * GET /webview/v2/novel
1335
1335
  *
1336
+ * Returns the raw HTML page that the pixiv app renders in a WebView.
1337
+ * To extract the plain text, parse the returned HTML (e.g. strip tags).
1338
+ *
1336
1339
  * @param params - Request parameters
1337
1340
  */
1338
1341
  text(params: NovelTextParams): ResultAsync<string, PixivError>;
package/dist/index.d.ts CHANGED
@@ -1248,10 +1248,10 @@ interface NovelDetailParams {
1248
1248
  /** ID of the novel to fetch. */
1249
1249
  novelId: number;
1250
1250
  }
1251
- /** Parameters for fetching novel text content. */
1251
+ /** Parameters for fetching the WebView HTML of a novel. */
1252
1252
  interface NovelTextParams {
1253
- /** ID of the novel whose text to fetch. */
1254
- id: number;
1253
+ /** ID of the novel whose WebView HTML to fetch. */
1254
+ novelId: number;
1255
1255
  }
1256
1256
  /** Parameters for fetching related novels. */
1257
1257
  interface NovelRelatedParams {
@@ -1330,9 +1330,12 @@ declare class NovelResource {
1330
1330
  */
1331
1331
  detail(params: NovelDetailParams): ResultAsync<NovelDetailResponse, PixivError>;
1332
1332
  /**
1333
- * Fetches the full text of a novel.
1333
+ * Fetches the WebView HTML for a novel.
1334
1334
  * GET /webview/v2/novel
1335
1335
  *
1336
+ * Returns the raw HTML page that the pixiv app renders in a WebView.
1337
+ * To extract the plain text, parse the returned HTML (e.g. strip tags).
1338
+ *
1336
1339
  * @param params - Request parameters
1337
1340
  */
1338
1341
  text(params: NovelTextParams): ResultAsync<string, PixivError>;
package/dist/index.js CHANGED
@@ -693,7 +693,7 @@ function buildSearchParams(params) {
693
693
  for (const [key, value] of Object.entries(params)) {
694
694
  if (value === null || value === void 0) continue;
695
695
  if (Array.isArray(value)) {
696
- for (const item of value) usp.append(key, String(item));
696
+ for (const item of value) usp.append(`${key}[]`, String(item));
697
697
  } else {
698
698
  usp.set(key, String(value));
699
699
  }
@@ -881,15 +881,19 @@ var NovelResource = class {
881
881
  );
882
882
  }
883
883
  /**
884
- * Fetches the full text of a novel.
884
+ * Fetches the WebView HTML for a novel.
885
885
  * GET /webview/v2/novel
886
886
  *
887
+ * Returns the raw HTML page that the pixiv app renders in a WebView.
888
+ * To extract the plain text, parse the returned HTML (e.g. strip tags).
889
+ *
887
890
  * @param params - Request parameters
888
891
  */
889
892
  text(params) {
890
893
  return this.#http.get(
891
894
  "/webview/v2/novel",
892
- buildParams({ id: params.id })
895
+ // The webview endpoint uses the query parameter 'id', not 'novel_id'
896
+ buildParams({ id: params.novelId })
893
897
  );
894
898
  }
895
899
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@book000/pixivts",
3
- "version": "0.56.0",
3
+ "version": "0.56.2",
4
4
  "description": "pixiv Unofficial API Library for TypeScript",
5
5
  "keywords": [
6
6
  "pixiv",
@@ -42,7 +42,7 @@
42
42
  "devDependencies": {
43
43
  "@types/node": "24.13.2",
44
44
  "@vitest/coverage-v8": "3.2.4",
45
- "msw": "2.7.4",
45
+ "msw": "2.14.6",
46
46
  "tsup": "8.5.0",
47
47
  "typedoc": "^0.28.19",
48
48
  "typescript": "6.0.3",
@@ -54,7 +54,7 @@
54
54
  "build:dts-guard": "node ../../scripts/check-dts-no-zod.mjs",
55
55
  "clean": "rimraf dist",
56
56
  "generate-docs": "typedoc",
57
- "lint": "tsc --noEmit",
57
+ "lint": "tsc -p tsconfig.test.json",
58
58
  "fix": "echo 'no fix needed'",
59
59
  "test:e2e": "vitest run --config vitest.e2e.config.ts"
60
60
  }