Compare commits
23 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 6a8ddae772 | |||
| 57da0ec0f3 | |||
| 8017146b1a | |||
| 5b048f18bf | |||
| 1d8a5d3937 | |||
| ed710dc45a | |||
| 2efa5ec057 | |||
| 6e8a1018b3 | |||
| e16ab5b22f | |||
| f65b3d5e72 | |||
| fc325be4c7 | |||
| 87a424a6b7 | |||
| 331cff0550 | |||
| 714edfa147 | |||
| ab701005ec | |||
| 72d7616c16 | |||
| 0e3ce6a58a | |||
| 51a2acd8c3 | |||
| fb218bcbe1 | |||
| 4c508008b2 | |||
| 6371315b71 | |||
| 9ba65ee60a | |||
| d102adcebc |
@@ -5,13 +5,13 @@
|
|||||||
## インストール
|
## インストール
|
||||||
```bash
|
```bash
|
||||||
# npm
|
# npm
|
||||||
npm install git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.0
|
npm install git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.7
|
||||||
|
|
||||||
# yarn
|
# yarn
|
||||||
yarn add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.0
|
yarn add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.7
|
||||||
|
|
||||||
# pnpm
|
# pnpm
|
||||||
pnpm add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.0
|
pnpm add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.1.7
|
||||||
```
|
```
|
||||||
> **NOTE**
|
> **NOTE**
|
||||||
> このSDKはnpmリポジトリがありません。Gitリポジトリを使用しています。
|
> このSDKはnpmリポジトリがありません。Gitリポジトリを使用しています。
|
||||||
|
|||||||
+5
-5
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "better-uwuzu-sdk",
|
"name": "better-uwuzu-sdk",
|
||||||
"version": "1.1.0",
|
"version": "1.1.7",
|
||||||
"description": "A better uwuzu SDK.",
|
"description": "A better uwuzu SDK.",
|
||||||
"main": "dist/index.js",
|
"main": "dist/index.js",
|
||||||
"types": "dist/types/index.d.ts",
|
"types": "dist/types/index.d.ts",
|
||||||
@@ -33,19 +33,19 @@
|
|||||||
"types": "./dist/types/*.d.ts"
|
"types": "./dist/types/*.d.ts"
|
||||||
},
|
},
|
||||||
"./*/*": {
|
"./*/*": {
|
||||||
"import": "./dist/types/*/*.js",
|
"import": "./dist/*/*.js",
|
||||||
"types": "./dist/types/*/*.d.ts"
|
"types": "./dist/types/*/*.d.ts"
|
||||||
},
|
},
|
||||||
"./*/*/*": {
|
"./*/*/*": {
|
||||||
"import": "./dist/types/*/*/*.js",
|
"import": "./dist/*/*/*.js",
|
||||||
"types": "./dist/types/*/*/*.d.ts"
|
"types": "./dist/types/*/*/*.d.ts"
|
||||||
},
|
},
|
||||||
"./*/*/*/*": {
|
"./*/*/*/*": {
|
||||||
"import": "./dist/types/*/*/*/*.js",
|
"import": "./dist/*/*/*/*.js",
|
||||||
"types": "./dist/types/*/*/*/*.d.ts"
|
"types": "./dist/types/*/*/*/*.d.ts"
|
||||||
},
|
},
|
||||||
"./*/*/*/*/*": {
|
"./*/*/*/*/*": {
|
||||||
"import": "./dist/types/*/*/*/*/*.js",
|
"import": "./dist/*/*/*/*/*.js",
|
||||||
"types": "./dist/types/*/*/*/*/*.d.ts"
|
"types": "./dist/types/*/*/*/*/*.d.ts"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|||||||
+7
-1
@@ -39,13 +39,19 @@ const Parser: parserType = (data, type, endpoint) => {
|
|||||||
|
|
||||||
if (type === "request") {
|
if (type === "request") {
|
||||||
if (result.media && result.text && endpoint === "ueuse/create") {
|
if (result.media && result.text && endpoint === "ueuse/create") {
|
||||||
|
if (result.media.photo) {
|
||||||
for (let i = 0; i < result.media.photo.length; i++) {
|
for (let i = 0; i < result.media.photo.length; i++) {
|
||||||
result[`photo${i + 1}`] = result.media.photo[i];
|
result[`image${i + 1}`] = result.media.photo[i];
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*if (result.media.video) {
|
||||||
for (let i = 0; i < result.media.video.length; i++) {
|
for (let i = 0; i < result.media.video.length; i++) {
|
||||||
result[`video${i + 1}`] = result.media.video[i];
|
result[`video${i + 1}`] = result.media.video[i];
|
||||||
}
|
}
|
||||||
|
}*/
|
||||||
|
|
||||||
|
delete result.media;
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -2,7 +2,7 @@ import InputError from "../../modules/error/input";
|
|||||||
import { UserDataNotFound } from "../../modules/error/critical";
|
import { UserDataNotFound } from "../../modules/error/critical";
|
||||||
|
|
||||||
export default interface TokenGet {
|
export default interface TokenGet {
|
||||||
"ueuse/get": {
|
"token/get": {
|
||||||
body: {
|
body: {
|
||||||
/** api/authで使用したセッション */
|
/** api/authで使用したセッション */
|
||||||
session: string;
|
session: string;
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../../modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "../../../modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../../modules/ueuse";
|
import ueuseModule from "../../../modules/ueuse";
|
||||||
import ueuseError from "../../../modules/error/ueuse";
|
import ueuseError from "../../../modules/error/ueuse";
|
||||||
import Page from "../../../modules/page";
|
import Page from "../../../modules/page";
|
||||||
|
|
||||||
|
|||||||
+2
-2
@@ -8,14 +8,14 @@ export default interface UeuseCreate {
|
|||||||
/** 本文 */
|
/** 本文 */
|
||||||
text: string;
|
text: string;
|
||||||
/** メディア */
|
/** メディア */
|
||||||
media: Media;
|
media?: Media;
|
||||||
/** NSFWにするかどうか */
|
/** NSFWにするかどうか */
|
||||||
nsfw?: boolean;
|
nsfw?: boolean;
|
||||||
/** 返信先ユーズのユニークID */
|
/** 返信先ユーズのユニークID */
|
||||||
replyid?: string;
|
replyid?: string;
|
||||||
/** リユーズ/引用元ユーズのユニークID */
|
/** リユーズ/引用元ユーズのユニークID */
|
||||||
reuseid?: string;
|
reuseid?: string;
|
||||||
} & Media;
|
};
|
||||||
response: {
|
response: {
|
||||||
/** 成功かどうか */
|
/** 成功かどうか */
|
||||||
success: true;
|
success: true;
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "../../modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../modules/ueuse";
|
import ueuseModule from "../../modules/ueuse";
|
||||||
import ueuseError from "../../modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
|
|
||||||
export default interface UeuseGet {
|
export default interface UeuseGet {
|
||||||
|
|||||||
Vendored
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "../../modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../modules/ueuse";
|
import ueuseModule from "../../modules/ueuse";
|
||||||
import ueuseError from "../../modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "../../modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "../../modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../modules/ueuse";
|
import ueuseModule from "../../modules/ueuse";
|
||||||
import ueuseError from "../../modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "../../modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "../../modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../modules/ueuse";
|
import ueuseModule from "../../modules/ueuse";
|
||||||
import ueuseError from "../../modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "../../modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "../../modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "../../modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "../../modules/ueuse";
|
import ueuseModule from "../../modules/ueuse";
|
||||||
import ueuseError from "../../modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "../../modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
|||||||
Vendored
+4
-2
@@ -1,8 +1,8 @@
|
|||||||
export interface Media {
|
export interface Media {
|
||||||
/** 画像URL */
|
/** 画像URL */
|
||||||
photo: string[];
|
photo: string[];
|
||||||
/** 動画URL */
|
///** 動画URL */
|
||||||
video: string[];
|
//video: string[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export default interface ueuseModule {
|
export default interface ueuseModule {
|
||||||
@@ -31,6 +31,8 @@ export default interface ueuseModule {
|
|||||||
/** Botフラグ(自主設定)かどうか */
|
/** Botフラグ(自主設定)かどうか */
|
||||||
is_bot: boolean;
|
is_bot: boolean;
|
||||||
};
|
};
|
||||||
|
/** 本文 */
|
||||||
|
text: string;
|
||||||
/** いいねしたユーザーID */
|
/** いいねしたユーザーID */
|
||||||
favorite: string[];
|
favorite: string[];
|
||||||
/** メディア */
|
/** メディア */
|
||||||
|
|||||||
+5
-1
@@ -90,8 +90,12 @@ export default class uwuzu<
|
|||||||
|
|
||||||
bodyParsed = {
|
bodyParsed = {
|
||||||
...bodyParsed,
|
...bodyParsed,
|
||||||
token: this._token,
|
token: this._token ?? "",
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (bodyParsed.token === "")
|
||||||
|
delete bodyParsed.token;
|
||||||
|
|
||||||
bodyParsed = JSON.stringify(bodyParsed);
|
bodyParsed = JSON.stringify(bodyParsed);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user