Compare commits
14 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 8b2b1d2b13 | |||
| 59bfd58fba | |||
| 8c4dfeaa77 | |||
| e4338c80e7 | |||
| 004bfde9af | |||
| 895b693f81 | |||
| 336db2a5ca | |||
| f57ca58935 | |||
| f2c2007e07 | |||
| 47ead2151c | |||
| c2c9e6a8c1 | |||
| 2d1523de93 | |||
| 000dda7c4a | |||
| 714a3b852c |
@@ -1,48 +1,62 @@
|
|||||||
# Better uwuzu SDK
|
# Better uwuzu SDK
|
||||||
[uwuzu.js](https://github.com/PutonFPS/uwuzu.js)みたいなやつです。uwuzuのAPIがいじれます。
|
[uwuzu.js](https://github.com/PutonFPS/uwuzu.js)みたいなやつです。uwuzuのAPIがいじれます。
|
||||||
|
|
||||||
# 使い方
|
# 使い方
|
||||||
## インストール
|
## インストール
|
||||||
初期リリース出たら書きます
|
```bash
|
||||||
|
# npm
|
||||||
## 初期化
|
npm install git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.0.1
|
||||||
```ts
|
|
||||||
import uwuzu from "better-uwuzu-sdk";
|
# yarn
|
||||||
import type ApiMap from "better-uwuzu-sdk/1.6.11/map";
|
yarn add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.0.1
|
||||||
|
|
||||||
const client = new uwuzu<ApiMap>({
|
# pnpm
|
||||||
origin: "https://uwuzu.net",
|
pnpm add git+https://gitea.last2014.com/last2014/better-uwuzu-sdk.git#1.0.1
|
||||||
});
|
```
|
||||||
|
> **NOTE**
|
||||||
try {
|
> このSDKはnpmリポジトリがありません。Gitリポジトリを使用しています。
|
||||||
client.token = "APITOKEN";
|
|
||||||
} catch (err) {
|
> **WARNING**
|
||||||
console.error(err);
|
> `#main`でのインストールもできますが破壊的変更の際に面倒だと思います。サポートしません。
|
||||||
}
|
|
||||||
```
|
## 初期化
|
||||||
型とJSDoc見ればわかります。トークンはなくても`serverinfo-api`や`token/get`は動きますが大体の事例では入れると思います。`uwuzu().token`の`set`は検証を行うわけではありませんが64文字でない、空文字列であるなどの場合はエラーが発生します。
|
```ts
|
||||||
|
import uwuzu from "better-uwuzu-sdk";
|
||||||
## APIリクエスト
|
import type ApiMap from "better-uwuzu-sdk/1.6.11/map";
|
||||||
```ts
|
|
||||||
import uwuzu from "better-uwuzu-sdk";
|
const client = new uwuzu<ApiMap>({
|
||||||
import type ApiMap from "better-uwuzu-sdk/1.6.11/map";
|
origin: "https://uwuzu.net",
|
||||||
|
});
|
||||||
const client = new uwuzu<ApiMap>({
|
|
||||||
origin: "https://uwuzu.net",
|
try {
|
||||||
});
|
client.token = "APITOKEN";
|
||||||
|
} catch (err) {
|
||||||
try {
|
console.error(err);
|
||||||
client.token = "APITOKEN";
|
}
|
||||||
|
```
|
||||||
const me = await client.request("me/");
|
型とJSDoc見ればわかります。トークンはなくても`serverinfo-api`や`token/get`は動きますが大体の事例では入れると思います。`uwuzu().token`の`set`は検証を行うわけではありませんが64文字でない、空文字列であるなどの場合はエラーが発生します。
|
||||||
|
|
||||||
if (me.error_code) {
|
## APIリクエスト
|
||||||
throw new Error(me.error_code);
|
```ts
|
||||||
}
|
import uwuzu from "better-uwuzu-sdk";
|
||||||
|
import type ApiMap from "better-uwuzu-sdk/1.6.11/map";
|
||||||
console.log(`あなたは${me.username}です。`);
|
|
||||||
} catch (err) {
|
const client = new uwuzu<ApiMap>({
|
||||||
console.error(err);
|
origin: "https://uwuzu.net",
|
||||||
}
|
});
|
||||||
```
|
|
||||||
|
try {
|
||||||
|
client.token = "APITOKEN";
|
||||||
|
|
||||||
|
const me = await client.request("me/");
|
||||||
|
|
||||||
|
if (me.error_code) {
|
||||||
|
throw new Error(me.error_code);
|
||||||
|
}
|
||||||
|
|
||||||
|
console.log(`あなたは${me.username}です。`);
|
||||||
|
} catch (err) {
|
||||||
|
console.error(err);
|
||||||
|
}
|
||||||
|
```
|
||||||
普通のSDKです。`uwuzu().request()`の第一引数はエンドポイント、第二引数はbodyです。bodyにトークンは自動入力されるので上記の例のように省略できます。
|
普通のSDKです。`uwuzu().request()`の第一引数はエンドポイント、第二引数はbodyです。bodyにトークンは自動入力されるので上記の例のように省略できます。
|
||||||
+30
-7
@@ -1,13 +1,13 @@
|
|||||||
{
|
{
|
||||||
"name": "better-uwuzu-sdk",
|
"name": "better-uwuzu-sdk",
|
||||||
"version": "1.0.0",
|
"version": "1.0.2",
|
||||||
"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",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "tsc && tsc-alias",
|
"build": "tsc && tsc-alias && cpx \"src/**/*.d.ts\" dist/types",
|
||||||
"prepare": "tsc && tsc-alias"
|
"prepare": "tsc && tsc-alias && cpx \"src/**/*.d.ts\" dist/types"
|
||||||
},
|
},
|
||||||
"keywords": [
|
"keywords": [
|
||||||
"uwuzu",
|
"uwuzu",
|
||||||
@@ -23,16 +23,39 @@
|
|||||||
"email": "info@last2014.com",
|
"email": "info@last2014.com",
|
||||||
"url": "https://about.last2014.com"
|
"url": "https://about.last2014.com"
|
||||||
},
|
},
|
||||||
|
"exports": {
|
||||||
|
".": {
|
||||||
|
"import": "./dist/index.js",
|
||||||
|
"types": "./dist/types/index.d.ts"
|
||||||
|
},
|
||||||
|
"./*": {
|
||||||
|
"import": "./dist/*.js",
|
||||||
|
"types": "./dist/types/*.d.ts"
|
||||||
|
},
|
||||||
|
"./*/*": {
|
||||||
|
"import": "./dist/types/*/*.js",
|
||||||
|
"types": "./dist/types/*/*.d.ts"
|
||||||
|
},
|
||||||
|
"./*/*/*": {
|
||||||
|
"import": "./dist/types/*/*/*.js",
|
||||||
|
"types": "./dist/types/*/*/*.d.ts"
|
||||||
|
},
|
||||||
|
"./*/*/*/*": {
|
||||||
|
"import": "./dist/types/*/*/*/*.js",
|
||||||
|
"types": "./dist/types/*/*/*/*.d.ts"
|
||||||
|
},
|
||||||
|
"./*/*/*/*/*": {
|
||||||
|
"import": "./dist/types/*/*/*/*/*.js",
|
||||||
|
"types": "./dist/types/*/*/*/*/*.d.ts"
|
||||||
|
}
|
||||||
|
},
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"packageManager": "pnpm@10.17.0",
|
"packageManager": "pnpm@10.17.0",
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@types/node": "^25.0.3",
|
"@types/node": "^25.0.3",
|
||||||
"fs": "0.0.1-security",
|
"cpx": "^1.5.0",
|
||||||
"tsc-alias": "^1.8.16",
|
"tsc-alias": "^1.8.16",
|
||||||
"typescript": "^5.9.3",
|
"typescript": "^5.9.3",
|
||||||
"uuid": "^13.0.0"
|
"uuid": "^13.0.0"
|
||||||
},
|
|
||||||
"dependencies": {
|
|
||||||
"@types/semver": "^7.7.1"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+1252
-13
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,2 @@
|
|||||||
|
onlyBuiltDependencies:
|
||||||
|
- core-js
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import type { generateAuthURIOptions } from "1.6.8/types/auth";
|
import type { generateAuthURIOptions } from "./types/auth";
|
||||||
import { v4 as uuidv4 } from "uuid";
|
import { v4 as uuidv4 } from "uuid";
|
||||||
|
|
||||||
/** ユーザー認可によるトークン取得のURIを生成します。 */
|
/** ユーザー認可によるトークン取得のURIを生成します。 */
|
||||||
|
|||||||
Vendored
+2
@@ -0,0 +1,2 @@
|
|||||||
|
import { ApiMap } from "./types/api/map";
|
||||||
|
export default ApiMap;
|
||||||
@@ -1,2 +0,0 @@
|
|||||||
import { ApiMap } from "1.6.8/types/api/map";
|
|
||||||
export default ApiMap;
|
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
import Page from "1.6.8/types/modules/page";
|
import Page from "../../../modules/page";
|
||||||
|
|
||||||
export default interface AdminReports {
|
export default interface AdminReports {
|
||||||
"admin/reports/": {
|
"admin/reports/": {
|
||||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
|
|
||||||
export default interface AdminReportsResolve {
|
export default interface AdminReportsResolve {
|
||||||
"admin/reports/resolve": {
|
"admin/reports/resolve": {
|
||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import { UserResponse } from "1.6.8/types/api/users";
|
import { UserResponse } from "../../../api/users";
|
||||||
|
|
||||||
export default interface AdminUsers {
|
export default interface AdminUsers {
|
||||||
"admin/users/": {
|
"admin/users/": {
|
||||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
import { UserDataNotFound } from "1.6.8/types/modules/error/critical";
|
import { UserDataNotFound } from "../../../modules/error/critical";
|
||||||
|
|
||||||
interface RequestBase<T extends string> {
|
interface RequestBase<T extends string> {
|
||||||
/** 対象のユーザーID */
|
/** 対象のユーザーID */
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
|
|
||||||
export default interface FavoriteChange {
|
export default interface FavoriteChange {
|
||||||
"favorite/change": {
|
"favorite/change": {
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
|
|
||||||
export default interface FavoriteGet {
|
export default interface FavoriteGet {
|
||||||
"favorite/get": {
|
"favorite/get": {
|
||||||
Vendored
+46
@@ -0,0 +1,46 @@
|
|||||||
|
import ServerInfo from "./serverinfo-api";
|
||||||
|
import Users from "./users";
|
||||||
|
import UsersFollow from "./users/follow";
|
||||||
|
import Me from "./me";
|
||||||
|
import MeNotification from "./me/notification";
|
||||||
|
import MeNotificationRead from "./me/notification/read";
|
||||||
|
import MeSettings from "./me/settings";
|
||||||
|
import Ueuse from "./ueuse";
|
||||||
|
import UeuseGet from "./ueuse/get";
|
||||||
|
import UeuseReplies from "./ueuse/replies";
|
||||||
|
import UeuseMentions from "./ueuse/mentions";
|
||||||
|
import UeuseSearch from "./ueuse/search";
|
||||||
|
import UeuseCreate from "./ueuse/create";
|
||||||
|
import UeuseDelete from "./ueuse/delete";
|
||||||
|
import UeuseBookmark from "./ueuse/bookmark";
|
||||||
|
import FavoriteChange from "./favorite/change";
|
||||||
|
import FavoriteGet from "./favorite/get";
|
||||||
|
import TokenGet from "./token/get";
|
||||||
|
import AdminUsers from "./admin/users";
|
||||||
|
import AdminUsersSanction from "./admin/users/sanction";
|
||||||
|
import AdminReports from "./admin/reports";
|
||||||
|
import AdminReportsResolve from "./admin/reports/resolve";
|
||||||
|
|
||||||
|
export type ApiMap =
|
||||||
|
& ServerInfo
|
||||||
|
& Me
|
||||||
|
& MeNotification
|
||||||
|
& MeNotificationRead
|
||||||
|
& MeSettings
|
||||||
|
& Users
|
||||||
|
& UsersFollow
|
||||||
|
& Ueuse
|
||||||
|
& UeuseGet
|
||||||
|
& UeuseReplies
|
||||||
|
& UeuseMentions
|
||||||
|
& UeuseSearch
|
||||||
|
& UeuseCreate
|
||||||
|
& UeuseDelete
|
||||||
|
& UeuseBookmark
|
||||||
|
& FavoriteChange
|
||||||
|
& FavoriteGet
|
||||||
|
& TokenGet
|
||||||
|
& AdminUsers
|
||||||
|
& AdminUsersSanction
|
||||||
|
& AdminReports
|
||||||
|
& AdminReportsResolve;
|
||||||
@@ -1,18 +0,0 @@
|
|||||||
import ServerInfo from "1.6.8/types/api/serverinfo-api";
|
|
||||||
import Users from "1.6.8/types/api/users";
|
|
||||||
import UsersFollow from "1.6.8/types/api/users/follow";
|
|
||||||
import Me from "1.6.8/types/api/me";
|
|
||||||
import MeNotification from "1.6.8/types/api/me/notification";
|
|
||||||
import MeNotificationRead from "1.6.8/types/api/me/notification/read";
|
|
||||||
import MeSettings from "1.6.8/types/api/me/settings";
|
|
||||||
import Ueuse from "1.6.8/types/api/ueuse";
|
|
||||||
|
|
||||||
export type ApiMap =
|
|
||||||
& ServerInfo
|
|
||||||
& Me
|
|
||||||
& MeNotification
|
|
||||||
& MeNotificationRead
|
|
||||||
& MeSettings
|
|
||||||
& Users
|
|
||||||
& UsersFollow
|
|
||||||
& Ueuse;
|
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
import { UserResponse } from "1.6.8/types/api/users";
|
import { UserResponse } from "../../api/users";
|
||||||
|
|
||||||
export default interface Me {
|
export default interface Me {
|
||||||
"me/": {
|
"me/": {
|
||||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
import Page from "1.6.8/types/modules/page";
|
import Page from "../../../modules/page";
|
||||||
|
|
||||||
export default interface MeNotification {
|
export default interface MeNotification {
|
||||||
"me/notification/": {
|
"me/notification/": {
|
||||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../../modules/error/auth";
|
||||||
import UpdateError from "1.6.8/types/modules/error/update";
|
import UpdateError from "../../../modules/error/update";
|
||||||
|
|
||||||
export default interface MeNotificationRead {
|
export default interface MeNotificationRead {
|
||||||
"me/notification/read": {
|
"me/notification/read": {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import UpdateError from "1.6.8/types/modules/error/update";
|
import UpdateError from "../../modules/error/update";
|
||||||
import { Upload1Error, Upload2Error, UploadCommonError } from "1.6.8/types/modules/error/upload";
|
import { Upload1Error, Upload2Error, UploadCommonError } from "../../modules/error/upload";
|
||||||
|
|
||||||
type AtLeastOne<T> = {
|
type AtLeastOne<T> = {
|
||||||
[K in keyof T]: Required<Pick<T, K>> & Partial<Omit<T, K>>
|
[K in keyof T]: Required<Pick<T, K>> & Partial<Omit<T, K>>
|
||||||
@@ -1,5 +1,5 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import { UserDataNotFound } from "1.6.8/types/modules/error/critical";
|
import { UserDataNotFound } from "../../modules/error/critical";
|
||||||
|
|
||||||
export default interface TokenGet {
|
export default interface TokenGet {
|
||||||
"ueuse/get": {
|
"ueuse/get": {
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import InputError from "../../../modules/error/input";
|
||||||
|
import AuthError from "../../../modules/error/auth";
|
||||||
|
import { ueuseModule } from "../../../modules/ueuse";
|
||||||
|
import ueuseError from "../../../modules/error/ueuse";
|
||||||
|
import Page from "../../../modules/page";
|
||||||
|
|
||||||
|
export default interface UeuseBookmark {
|
||||||
|
"ueuse/bookmark/": {
|
||||||
|
body?: Page;
|
||||||
|
response: {
|
||||||
|
/** 成功かどうか */
|
||||||
|
success: true;
|
||||||
|
/** ブックマークしているユーズ */
|
||||||
|
data: ueuseModule[];
|
||||||
|
} | InputError | AuthError | ueuseError;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
|
||||||
import Page from "1.6.8/types/modules/page";
|
|
||||||
|
|
||||||
export default interface UeuseBookmark {
|
|
||||||
"ueuse/bookmark/": {
|
|
||||||
body?: Page;
|
|
||||||
response: {
|
|
||||||
/** 成功かどうか */
|
|
||||||
success: true;
|
|
||||||
/** ブックマークしているユーズ */
|
|
||||||
data: ueuseModule[];
|
|
||||||
} | InputError | AuthError | ueuseError;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
+3
-3
@@ -1,6 +1,6 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { Media } from "1.6.8/types/modules/ueuse";
|
import { Media } from "../../modules/ueuse";
|
||||||
|
|
||||||
export default interface UeuseCreate {
|
export default interface UeuseCreate {
|
||||||
"ueuse/get": {
|
"ueuse/get": {
|
||||||
+2
-2
@@ -1,5 +1,5 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
|
|
||||||
interface ResponseBase<T extends string, S extends boolean> {
|
interface ResponseBase<T extends string, S extends boolean> {
|
||||||
/** 成功かどうか */
|
/** 成功かどうか */
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
import { ueuseModule } from "../../modules/ueuse";
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
|
|
||||||
export default interface UeuseGet {
|
export default interface UeuseGet {
|
||||||
"ueuse/get": {
|
"ueuse/get": {
|
||||||
Vendored
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import InputError from "../../modules/error/input";
|
||||||
|
import AuthError from "../../modules/error/auth";
|
||||||
|
import { ueuseModule } from "../../modules/ueuse";
|
||||||
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
export default interface Ueuse {
|
||||||
|
"ueuse/": {
|
||||||
|
body?: Page;
|
||||||
|
response: {
|
||||||
|
/** 成功かどうか */
|
||||||
|
success: true;
|
||||||
|
/** ユーズ(LTL) */
|
||||||
|
data: ueuseModule[];
|
||||||
|
} | InputError | AuthError | ueuseError;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
|
||||||
import Page from "1.6.8/types/modules/page";
|
|
||||||
|
|
||||||
export default interface Ueuse {
|
|
||||||
"ueuse/": {
|
|
||||||
body?: Page;
|
|
||||||
response: {
|
|
||||||
/** 成功かどうか */
|
|
||||||
success: true;
|
|
||||||
/** ユーズ(LTL) */
|
|
||||||
data: ueuseModule[];
|
|
||||||
} | InputError | AuthError | ueuseError;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
+17
@@ -0,0 +1,17 @@
|
|||||||
|
import InputError from "../../modules/error/input";
|
||||||
|
import AuthError from "../../modules/error/auth";
|
||||||
|
import { ueuseModule } from "../../modules/ueuse";
|
||||||
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
|
export default interface UeuseMentions {
|
||||||
|
"ueuse/mentions": {
|
||||||
|
body?: Page;
|
||||||
|
response: {
|
||||||
|
/** 成功かどうか */
|
||||||
|
success: true;
|
||||||
|
/** メンションされているユーズ */
|
||||||
|
data: ueuseModule[];
|
||||||
|
} | InputError | AuthError | ueuseError;
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -1,17 +0,0 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
|
||||||
import Page from "1.6.8/types/modules/page";
|
|
||||||
|
|
||||||
export default interface UeuseMentions {
|
|
||||||
"ueuse/mentions": {
|
|
||||||
body?: Page;
|
|
||||||
response: {
|
|
||||||
/** 成功かどうか */
|
|
||||||
success: true;
|
|
||||||
/** メンションされているユーズ */
|
|
||||||
data: ueuseModule[];
|
|
||||||
} | InputError | AuthError | ueuseError;
|
|
||||||
}
|
|
||||||
};
|
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
import { ueuseModule } from "../../modules/ueuse";
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "1.6.8/types/modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
export default interface UeuseReplies {
|
export default interface UeuseReplies {
|
||||||
"ueuse/replies": {
|
"ueuse/replies": {
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { ueuseModule } from "1.6.8/types/modules/ueuse";
|
import { ueuseModule } from "../../modules/ueuse";
|
||||||
import ueuseError from "1.6.8/types/modules/error/ueuse";
|
import ueuseError from "../../modules/error/ueuse";
|
||||||
import Page from "1.6.8/types/modules/page";
|
import Page from "../../modules/page";
|
||||||
|
|
||||||
export default interface UeuseSearch {
|
export default interface UeuseSearch {
|
||||||
"ueuse/search": {
|
"ueuse/search": {
|
||||||
+5
-5
@@ -1,8 +1,8 @@
|
|||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import UpdateError, { CouldNotComplete } from "1.6.8/types/modules/error/update";
|
import UpdateError, { CouldNotComplete } from "../../modules/error/update";
|
||||||
import ToYouNotAllowed from "1.6.8/types/modules/error/follow";
|
import ToYouNotAllowed from "../../modules/error/follow";
|
||||||
import { UserDataNotFound } from "1.6.8/types/modules/error/critical";
|
import { UserDataNotFound } from "../../modules/error/critical";
|
||||||
|
|
||||||
interface Follow<T extends string> {
|
interface Follow<T extends string> {
|
||||||
body: {
|
body: {
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
import Role from "1.6.8/types/modules/role";
|
import Role from "../../modules/role";
|
||||||
import InputError from "1.6.8/types/modules/error/input";
|
import InputError from "../../modules/error/input";
|
||||||
import AuthError from "1.6.8/types/modules/error/auth";
|
import AuthError from "../../modules/error/auth";
|
||||||
import { UserDataNotFound } from "1.6.8/types/modules/error/critical";
|
import { UserDataNotFound } from "../../modules/error/critical";
|
||||||
|
|
||||||
export type UserResponse = {
|
export type UserResponse = {
|
||||||
/** 成功かどうか */
|
/** 成功かどうか */
|
||||||
+2
-5
@@ -1,5 +1,5 @@
|
|||||||
import uwuzuError from "@/lib/error";
|
import uwuzuError from "./lib/error";
|
||||||
import uwuzuFetch from "@/lib/fetch";
|
import uwuzuFetch from "./lib/fetch";
|
||||||
|
|
||||||
interface sdkOptions {
|
interface sdkOptions {
|
||||||
/** uwuzuサーバーのorigin */
|
/** uwuzuサーバーのorigin */
|
||||||
@@ -88,9 +88,6 @@ export default class uwuzu<
|
|||||||
endpoint as string,
|
endpoint as string,
|
||||||
{
|
{
|
||||||
method: "POST",
|
method: "POST",
|
||||||
headers: {
|
|
||||||
"Content-Type": "application/json",
|
|
||||||
},
|
|
||||||
cache: "no-store",
|
cache: "no-store",
|
||||||
body: bodyParsed,
|
body: bodyParsed,
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -1,4 +1,4 @@
|
|||||||
import uwuzuError from "@/lib/error";
|
import uwuzuError from "./error";
|
||||||
|
|
||||||
export function generateURL(
|
export function generateURL(
|
||||||
origin: string,
|
origin: string,
|
||||||
|
|||||||
@@ -17,13 +17,6 @@
|
|||||||
"typeRoots": [
|
"typeRoots": [
|
||||||
"./node_modules/@types",
|
"./node_modules/@types",
|
||||||
],
|
],
|
||||||
"paths": {
|
|
||||||
"@/*": ["./*"],
|
|
||||||
"1.6.8/*": ["./1.6.8/*"],
|
|
||||||
"1.6.9/*": ["./1.6.8/*"],
|
|
||||||
"1.6.10/*": ["./1.6.8/*"],
|
|
||||||
"1.6.11/*": ["./1.6.8/*"],
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
"tsc-alias": {
|
"tsc-alias": {
|
||||||
"resolveFullPaths": true,
|
"resolveFullPaths": true,
|
||||||
|
|||||||
Reference in New Issue
Block a user