@ukwhatn/wikidot 4.0.2 → 4.0.3
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/README.md +46 -30
- package/dist/index.cjs +206 -215
- package/dist/index.d.cts +56 -4
- package/dist/index.d.ts +56 -4
- package/dist/index.js +2169 -238
- package/package.json +1 -1
- package/dist/shared/index-7dqqxq7x.js +0 -105
- package/dist/shared/index-f2eh3ykk.js +0 -172
- package/dist/shared/index-kka6e8cb.js +0 -627
- package/dist/shared/index-ytknx2hn.js +0 -980
package/dist/index.d.cts
CHANGED
|
@@ -1942,8 +1942,18 @@ declare class SiteAccessor {
|
|
|
1942
1942
|
constructor(client: Client);
|
|
1943
1943
|
/**
|
|
1944
1944
|
* UNIX名からサイトを取得する
|
|
1945
|
+
*
|
|
1945
1946
|
* @param unixName - サイトのUNIX名(例: 'scp-jp')
|
|
1946
|
-
* @returns
|
|
1947
|
+
* @returns Result型でラップされたサイトオブジェクト
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* const siteResult = await client.site.get('scp-jp');
|
|
1952
|
+
* if (!siteResult.isOk()) {
|
|
1953
|
+
* throw new Error('サイトの取得に失敗しました');
|
|
1954
|
+
* }
|
|
1955
|
+
* const site = siteResult.value;
|
|
1956
|
+
* ```
|
|
1947
1957
|
*/
|
|
1948
1958
|
get(unixName: string): WikidotResultAsync<Site>;
|
|
1949
1959
|
}
|
|
@@ -1962,9 +1972,19 @@ declare class UserAccessor {
|
|
|
1962
1972
|
constructor(client: Client);
|
|
1963
1973
|
/**
|
|
1964
1974
|
* ユーザー名からユーザーを取得する
|
|
1975
|
+
*
|
|
1965
1976
|
* @param name - ユーザー名
|
|
1966
1977
|
* @param options - 取得オプション
|
|
1967
|
-
* @returns
|
|
1978
|
+
* @returns Result型でラップされたユーザー(存在しない場合はnull、raiseWhenNotFoundがtrueの場合はエラー)
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* ```typescript
|
|
1982
|
+
* const userResult = await client.user.get('username');
|
|
1983
|
+
* if (!userResult.isOk()) {
|
|
1984
|
+
* throw new Error('ユーザーの取得に失敗しました');
|
|
1985
|
+
* }
|
|
1986
|
+
* const user = userResult.value;
|
|
1987
|
+
* ```
|
|
1968
1988
|
*/
|
|
1969
1989
|
get(name: string, options?: GetUserOptions): WikidotResultAsync<User | null>;
|
|
1970
1990
|
/**
|
|
@@ -2023,8 +2043,29 @@ declare class Client {
|
|
|
2023
2043
|
get me(): User | null;
|
|
2024
2044
|
/**
|
|
2025
2045
|
* クライアントを作成する
|
|
2046
|
+
*
|
|
2026
2047
|
* @param options - クライアントオプション
|
|
2027
|
-
* @returns
|
|
2048
|
+
* @returns Result型でラップされたクライアントインスタンス
|
|
2049
|
+
*
|
|
2050
|
+
* @example
|
|
2051
|
+
* ```typescript
|
|
2052
|
+
* import { Client } from '@ukwhatn/wikidot';
|
|
2053
|
+
*
|
|
2054
|
+
* // クライアントを作成
|
|
2055
|
+
* const clientResult = await Client.create({
|
|
2056
|
+
* username: 'your_username',
|
|
2057
|
+
* password: 'your_password',
|
|
2058
|
+
* });
|
|
2059
|
+
*
|
|
2060
|
+
* // Result型なのでisOk()でチェック後、.valueで取得
|
|
2061
|
+
* if (!clientResult.isOk()) {
|
|
2062
|
+
* throw new Error('クライアントの作成に失敗しました');
|
|
2063
|
+
* }
|
|
2064
|
+
* const client = clientResult.value;
|
|
2065
|
+
*
|
|
2066
|
+
* // これでclient.site等にアクセス可能
|
|
2067
|
+
* const siteResult = await client.site.get('scp-jp');
|
|
2068
|
+
* ```
|
|
2028
2069
|
*/
|
|
2029
2070
|
static create(options?: ClientOptions): WikidotResultAsync<Client>;
|
|
2030
2071
|
/**
|
|
@@ -2052,14 +2093,25 @@ declare class Client {
|
|
|
2052
2093
|
}
|
|
2053
2094
|
/**
|
|
2054
2095
|
* プライベートメッセージ操作アクセサ
|
|
2096
|
+
*
|
|
2097
|
+
* @example
|
|
2098
|
+
* ```typescript
|
|
2099
|
+
* // 受信箱を取得
|
|
2100
|
+
* const inboxResult = await client.privateMessage.inbox();
|
|
2101
|
+
* if (!inboxResult.isOk()) {
|
|
2102
|
+
* throw new Error('受信箱の取得に失敗しました');
|
|
2103
|
+
* }
|
|
2104
|
+
* const inbox = inboxResult.value;
|
|
2105
|
+
* ```
|
|
2055
2106
|
*/
|
|
2056
2107
|
declare class PrivateMessageAccessor {
|
|
2057
2108
|
readonly client: Client;
|
|
2058
2109
|
constructor(client: Client);
|
|
2059
2110
|
/**
|
|
2060
2111
|
* メッセージIDからメッセージを取得する
|
|
2112
|
+
*
|
|
2061
2113
|
* @param id - メッセージID
|
|
2062
|
-
* @returns
|
|
2114
|
+
* @returns Result型でラップされたメッセージオブジェクト
|
|
2063
2115
|
*/
|
|
2064
2116
|
get(id: number): WikidotResultAsync<PrivateMessage>;
|
|
2065
2117
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -1942,8 +1942,18 @@ declare class SiteAccessor {
|
|
|
1942
1942
|
constructor(client: Client);
|
|
1943
1943
|
/**
|
|
1944
1944
|
* UNIX名からサイトを取得する
|
|
1945
|
+
*
|
|
1945
1946
|
* @param unixName - サイトのUNIX名(例: 'scp-jp')
|
|
1946
|
-
* @returns
|
|
1947
|
+
* @returns Result型でラップされたサイトオブジェクト
|
|
1948
|
+
*
|
|
1949
|
+
* @example
|
|
1950
|
+
* ```typescript
|
|
1951
|
+
* const siteResult = await client.site.get('scp-jp');
|
|
1952
|
+
* if (!siteResult.isOk()) {
|
|
1953
|
+
* throw new Error('サイトの取得に失敗しました');
|
|
1954
|
+
* }
|
|
1955
|
+
* const site = siteResult.value;
|
|
1956
|
+
* ```
|
|
1947
1957
|
*/
|
|
1948
1958
|
get(unixName: string): WikidotResultAsync<Site>;
|
|
1949
1959
|
}
|
|
@@ -1962,9 +1972,19 @@ declare class UserAccessor {
|
|
|
1962
1972
|
constructor(client: Client);
|
|
1963
1973
|
/**
|
|
1964
1974
|
* ユーザー名からユーザーを取得する
|
|
1975
|
+
*
|
|
1965
1976
|
* @param name - ユーザー名
|
|
1966
1977
|
* @param options - 取得オプション
|
|
1967
|
-
* @returns
|
|
1978
|
+
* @returns Result型でラップされたユーザー(存在しない場合はnull、raiseWhenNotFoundがtrueの場合はエラー)
|
|
1979
|
+
*
|
|
1980
|
+
* @example
|
|
1981
|
+
* ```typescript
|
|
1982
|
+
* const userResult = await client.user.get('username');
|
|
1983
|
+
* if (!userResult.isOk()) {
|
|
1984
|
+
* throw new Error('ユーザーの取得に失敗しました');
|
|
1985
|
+
* }
|
|
1986
|
+
* const user = userResult.value;
|
|
1987
|
+
* ```
|
|
1968
1988
|
*/
|
|
1969
1989
|
get(name: string, options?: GetUserOptions): WikidotResultAsync<User | null>;
|
|
1970
1990
|
/**
|
|
@@ -2023,8 +2043,29 @@ declare class Client {
|
|
|
2023
2043
|
get me(): User | null;
|
|
2024
2044
|
/**
|
|
2025
2045
|
* クライアントを作成する
|
|
2046
|
+
*
|
|
2026
2047
|
* @param options - クライアントオプション
|
|
2027
|
-
* @returns
|
|
2048
|
+
* @returns Result型でラップされたクライアントインスタンス
|
|
2049
|
+
*
|
|
2050
|
+
* @example
|
|
2051
|
+
* ```typescript
|
|
2052
|
+
* import { Client } from '@ukwhatn/wikidot';
|
|
2053
|
+
*
|
|
2054
|
+
* // クライアントを作成
|
|
2055
|
+
* const clientResult = await Client.create({
|
|
2056
|
+
* username: 'your_username',
|
|
2057
|
+
* password: 'your_password',
|
|
2058
|
+
* });
|
|
2059
|
+
*
|
|
2060
|
+
* // Result型なのでisOk()でチェック後、.valueで取得
|
|
2061
|
+
* if (!clientResult.isOk()) {
|
|
2062
|
+
* throw new Error('クライアントの作成に失敗しました');
|
|
2063
|
+
* }
|
|
2064
|
+
* const client = clientResult.value;
|
|
2065
|
+
*
|
|
2066
|
+
* // これでclient.site等にアクセス可能
|
|
2067
|
+
* const siteResult = await client.site.get('scp-jp');
|
|
2068
|
+
* ```
|
|
2028
2069
|
*/
|
|
2029
2070
|
static create(options?: ClientOptions): WikidotResultAsync<Client>;
|
|
2030
2071
|
/**
|
|
@@ -2052,14 +2093,25 @@ declare class Client {
|
|
|
2052
2093
|
}
|
|
2053
2094
|
/**
|
|
2054
2095
|
* プライベートメッセージ操作アクセサ
|
|
2096
|
+
*
|
|
2097
|
+
* @example
|
|
2098
|
+
* ```typescript
|
|
2099
|
+
* // 受信箱を取得
|
|
2100
|
+
* const inboxResult = await client.privateMessage.inbox();
|
|
2101
|
+
* if (!inboxResult.isOk()) {
|
|
2102
|
+
* throw new Error('受信箱の取得に失敗しました');
|
|
2103
|
+
* }
|
|
2104
|
+
* const inbox = inboxResult.value;
|
|
2105
|
+
* ```
|
|
2055
2106
|
*/
|
|
2056
2107
|
declare class PrivateMessageAccessor {
|
|
2057
2108
|
readonly client: Client;
|
|
2058
2109
|
constructor(client: Client);
|
|
2059
2110
|
/**
|
|
2060
2111
|
* メッセージIDからメッセージを取得する
|
|
2112
|
+
*
|
|
2061
2113
|
* @param id - メッセージID
|
|
2062
|
-
* @returns
|
|
2114
|
+
* @returns Result型でラップされたメッセージオブジェクト
|
|
2063
2115
|
*/
|
|
2064
2116
|
get(id: number): WikidotResultAsync<PrivateMessage>;
|
|
2065
2117
|
/**
|