Merge branch 'develop' into mahjong
This commit is contained in:
@@ -5,3 +5,4 @@ node_modules
|
||||
/jest.config.ts
|
||||
/test
|
||||
/test-d
|
||||
build.js
|
||||
|
||||
@@ -45,7 +45,7 @@
|
||||
*
|
||||
* SUPPORTED TOKENS: <projectFolder>, <packageName>, <unscopedPackageName>
|
||||
*/
|
||||
"mainEntryPointFilePath": "<projectFolder>/built/dts/index.d.ts",
|
||||
"mainEntryPointFilePath": "<projectFolder>/built/index.d.ts",
|
||||
|
||||
/**
|
||||
* A list of NPM package names whose exports should be treated as part of this package.
|
||||
|
||||
105
packages/misskey-js/build.js
Normal file
105
packages/misskey-js/build.js
Normal file
@@ -0,0 +1,105 @@
|
||||
import * as esbuild from "esbuild";
|
||||
import { build } from "esbuild";
|
||||
import { globSync } from "glob";
|
||||
import { execa } from "execa";
|
||||
import fs from "node:fs";
|
||||
import { fileURLToPath } from "node:url";
|
||||
import { dirname } from "node:path";
|
||||
|
||||
const _filename = fileURLToPath(import.meta.url);
|
||||
const _dirname = dirname(_filename);
|
||||
const _package = JSON.parse(fs.readFileSync(_dirname + '/package.json', 'utf-8'));
|
||||
|
||||
const entryPoints = globSync("./src/**/**.{ts,tsx}");
|
||||
|
||||
/** @type {import('esbuild').BuildOptions} */
|
||||
const options = {
|
||||
entryPoints,
|
||||
minify: process.env.NODE_ENV === 'production',
|
||||
outdir: "./built",
|
||||
target: "es2022",
|
||||
platform: "browser",
|
||||
format: "esm",
|
||||
sourcemap: 'linked',
|
||||
};
|
||||
|
||||
// built配下をすべて削除する
|
||||
fs.rmSync('./built', { recursive: true, force: true });
|
||||
|
||||
if (process.argv.map(arg => arg.toLowerCase()).includes("--watch")) {
|
||||
await watchSrc();
|
||||
} else {
|
||||
await buildSrc();
|
||||
}
|
||||
|
||||
async function buildSrc() {
|
||||
console.log(`[${_package.name}] start building...`);
|
||||
|
||||
await build(options)
|
||||
.then(it => {
|
||||
console.log(`[${_package.name}] build succeeded.`);
|
||||
})
|
||||
.catch((err) => {
|
||||
process.stderr.write(err.stderr);
|
||||
process.exit(1);
|
||||
});
|
||||
|
||||
if (process.env.NODE_ENV === 'production') {
|
||||
console.log(`[${_package.name}] skip building d.ts because NODE_ENV is production.`);
|
||||
} else {
|
||||
await buildDts();
|
||||
}
|
||||
|
||||
console.log(`[${_package.name}] finish building.`);
|
||||
}
|
||||
|
||||
function buildDts() {
|
||||
return execa(
|
||||
'tsc',
|
||||
[
|
||||
'--project', 'tsconfig.json',
|
||||
'--outDir', 'built',
|
||||
'--declaration', 'true',
|
||||
'--emitDeclarationOnly', 'true',
|
||||
],
|
||||
{
|
||||
stdout: process.stdout,
|
||||
stderr: process.stderr,
|
||||
}
|
||||
);
|
||||
}
|
||||
|
||||
async function watchSrc() {
|
||||
const plugins = [{
|
||||
name: 'gen-dts',
|
||||
setup(build) {
|
||||
build.onStart(() => {
|
||||
console.log(`[${_package.name}] detect changed...`);
|
||||
});
|
||||
build.onEnd(async result => {
|
||||
if (result.errors.length > 0) {
|
||||
console.error(`[${_package.name}] watch build failed:`, result);
|
||||
return;
|
||||
}
|
||||
await buildDts();
|
||||
});
|
||||
},
|
||||
}];
|
||||
|
||||
console.log(`[${_package.name}] start watching...`)
|
||||
|
||||
const context = await esbuild.context({ ...options, plugins });
|
||||
await context.watch();
|
||||
|
||||
await new Promise((resolve, reject) => {
|
||||
process.on('SIGHUP', resolve);
|
||||
process.on('SIGINT', resolve);
|
||||
process.on('SIGTERM', resolve);
|
||||
process.on('SIGKILL', resolve);
|
||||
process.on('uncaughtException', reject);
|
||||
process.on('exit', resolve);
|
||||
}).finally(async () => {
|
||||
await context.dispose();
|
||||
console.log(`[${_package.name}] finish watching.`);
|
||||
});
|
||||
}
|
||||
File diff suppressed because it is too large
Load Diff
@@ -60,13 +60,17 @@ async function generateEndpoints(
|
||||
// misskey-jsはPOST固定で送っているので、こちらも決め打ちする。別メソッドに対応することがあればこちらも直す必要あり
|
||||
const paths = openApiDocs.paths ?? {};
|
||||
const postPathItems = Object.keys(paths)
|
||||
.map(it => paths[it]?.post)
|
||||
.map(it => ({
|
||||
_path_: it.replace(/^\//, ''),
|
||||
...paths[it]?.post,
|
||||
}))
|
||||
.filter(filterUndefined);
|
||||
|
||||
for (const operation of postPathItems) {
|
||||
const path = operation._path_;
|
||||
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion
|
||||
const operationId = operation.operationId!;
|
||||
const endpoint = new Endpoint(operationId);
|
||||
const endpoint = new Endpoint(path);
|
||||
endpoints.push(endpoint);
|
||||
|
||||
if (isRequestBodyObject(operation.requestBody)) {
|
||||
@@ -76,19 +80,21 @@ async function generateEndpoints(
|
||||
// いまのところ複数のメディアタイプをとるエンドポイントは無いので決め打ちする
|
||||
endpoint.request = new OperationTypeAlias(
|
||||
operationId,
|
||||
path,
|
||||
supportMediaTypes[0],
|
||||
OperationsAliasType.REQUEST,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
if (isResponseObject(operation.responses['200']) && operation.responses['200'].content) {
|
||||
if (operation.responses && isResponseObject(operation.responses['200']) && operation.responses['200'].content) {
|
||||
const resContent = operation.responses['200'].content;
|
||||
const supportMediaTypes = Object.keys(resContent);
|
||||
if (supportMediaTypes.length > 0) {
|
||||
// いまのところ複数のメディアタイプを返すエンドポイントは無いので決め打ちする
|
||||
endpoint.response = new OperationTypeAlias(
|
||||
operationId,
|
||||
path,
|
||||
supportMediaTypes[0],
|
||||
OperationsAliasType.RESPONSE,
|
||||
);
|
||||
@@ -98,6 +104,8 @@ async function generateEndpoints(
|
||||
|
||||
const entitiesOutputLine: string[] = [];
|
||||
|
||||
entitiesOutputLine.push('/* eslint @typescript-eslint/naming-convention: 0 */');
|
||||
|
||||
entitiesOutputLine.push(`import { operations } from '${toImportPath(typeFileName)}';`);
|
||||
entitiesOutputLine.push('');
|
||||
|
||||
@@ -138,12 +146,19 @@ async function generateApiClientJSDoc(
|
||||
endpointsFileName: string,
|
||||
warningsOutputPath: string,
|
||||
) {
|
||||
const endpoints: { operationId: string; description: string; }[] = [];
|
||||
const endpoints: {
|
||||
operationId: string;
|
||||
path: string;
|
||||
description: string;
|
||||
}[] = [];
|
||||
|
||||
// misskey-jsはPOST固定で送っているので、こちらも決め打ちする。別メソッドに対応することがあればこちらも直す必要あり
|
||||
const paths = openApiDocs.paths ?? {};
|
||||
const postPathItems = Object.keys(paths)
|
||||
.map(it => paths[it]?.post)
|
||||
.map(it => ({
|
||||
_path_: it.replace(/^\//, ''),
|
||||
...paths[it]?.post,
|
||||
}))
|
||||
.filter(filterUndefined);
|
||||
|
||||
for (const operation of postPathItems) {
|
||||
@@ -153,6 +168,7 @@ async function generateApiClientJSDoc(
|
||||
if (operation.description) {
|
||||
endpoints.push({
|
||||
operationId: operationId,
|
||||
path: operation._path_,
|
||||
description: operation.description,
|
||||
});
|
||||
}
|
||||
@@ -173,7 +189,7 @@ async function generateApiClientJSDoc(
|
||||
' /**',
|
||||
` * ${endpoint.description.split('\n').join('\n * ')}`,
|
||||
' */',
|
||||
` request<E extends '${endpoint.operationId}', P extends Endpoints[E][\'req\']>(`,
|
||||
` request<E extends '${endpoint.path}', P extends Endpoints[E][\'req\']>(`,
|
||||
' endpoint: E,',
|
||||
' params: P,',
|
||||
' credential?: string | null,',
|
||||
@@ -232,21 +248,24 @@ interface IOperationTypeAlias {
|
||||
|
||||
class OperationTypeAlias implements IOperationTypeAlias {
|
||||
public readonly operationId: string;
|
||||
public readonly path: string;
|
||||
public readonly mediaType: string;
|
||||
public readonly type: OperationsAliasType;
|
||||
|
||||
constructor(
|
||||
operationId: string,
|
||||
path: string,
|
||||
mediaType: string,
|
||||
type: OperationsAliasType,
|
||||
) {
|
||||
this.operationId = operationId;
|
||||
this.path = path;
|
||||
this.mediaType = mediaType;
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
generateName(): string {
|
||||
const nameBase = this.operationId.replace(/\//g, '-');
|
||||
const nameBase = this.path.replace(/\//g, '-');
|
||||
return toPascal(nameBase + this.type);
|
||||
}
|
||||
|
||||
@@ -279,19 +298,19 @@ const emptyRequest = new EmptyTypeAlias(OperationsAliasType.REQUEST);
|
||||
const emptyResponse = new EmptyTypeAlias(OperationsAliasType.RESPONSE);
|
||||
|
||||
class Endpoint {
|
||||
public readonly operationId: string;
|
||||
public readonly path: string;
|
||||
public request?: IOperationTypeAlias;
|
||||
public response?: IOperationTypeAlias;
|
||||
|
||||
constructor(operationId: string) {
|
||||
this.operationId = operationId;
|
||||
constructor(path: string) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
toLine(): string {
|
||||
const reqName = this.request?.generateName() ?? emptyRequest.generateName();
|
||||
const resName = this.response?.generateName() ?? emptyResponse.generateName();
|
||||
|
||||
return `'${this.operationId}': { req: ${reqName}; res: ${resName} };`;
|
||||
return `'${this.path}': { req: ${reqName}; res: ${resName} };`;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,25 +1,24 @@
|
||||
{
|
||||
"type": "module",
|
||||
"name": "misskey-js",
|
||||
"version": "2024.2.0-beta.11",
|
||||
"version": "2024.5.0",
|
||||
"description": "Misskey SDK for JavaScript",
|
||||
"types": "./built/dts/index.d.ts",
|
||||
"license": "MIT",
|
||||
"main": "./built/index.js",
|
||||
"types": "./built/index.d.ts",
|
||||
"exports": {
|
||||
".": {
|
||||
"import": "./built/esm/index.js",
|
||||
"types": "./built/dts/index.d.ts"
|
||||
"import": "./built/index.js",
|
||||
"types": "./built/index.d.ts"
|
||||
},
|
||||
"./*": {
|
||||
"import": "./built/esm/*",
|
||||
"types": "./built/dts/*"
|
||||
"import": "./built/*",
|
||||
"types": "./built/*"
|
||||
}
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm run ts",
|
||||
"ts": "npm run ts-esm && npm run ts-dts",
|
||||
"ts-esm": "tsc --outDir built/esm",
|
||||
"ts-dts": "tsc --outDir built/dts --declaration true --emitDeclarationOnly true --declarationMap true",
|
||||
"watch": "nodemon -w src -e ts,js,cjs,mjs,json --exec \"pnpm run ts\"",
|
||||
"build": "node ./build.js",
|
||||
"watch": "nodemon -w package.json -e json --exec \"node ./build.js --watch\"",
|
||||
"tsd": "tsd",
|
||||
"api": "pnpm api-extractor run --local --verbose",
|
||||
"api-prod": "pnpm api-extractor run --verbose",
|
||||
@@ -32,34 +31,34 @@
|
||||
},
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/misskey-dev/misskey.js.git"
|
||||
"url": "https://github.com/misskey-dev/misskey.git",
|
||||
"directory": "packages/misskey-js"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@microsoft/api-extractor": "7.39.1",
|
||||
"@microsoft/api-extractor": "7.43.1",
|
||||
"@misskey-dev/eslint-plugin": "1.0.0",
|
||||
"@swc/jest": "0.2.31",
|
||||
"@types/jest": "29.5.11",
|
||||
"@types/node": "20.11.17",
|
||||
"@typescript-eslint/eslint-plugin": "6.18.1",
|
||||
"@typescript-eslint/parser": "6.18.1",
|
||||
"eslint": "8.56.0",
|
||||
"@swc/jest": "0.2.36",
|
||||
"@types/jest": "29.5.12",
|
||||
"@types/node": "20.12.7",
|
||||
"@typescript-eslint/eslint-plugin": "7.7.1",
|
||||
"@typescript-eslint/parser": "7.7.1",
|
||||
"eslint": "8.57.0",
|
||||
"jest": "29.7.0",
|
||||
"jest-fetch-mock": "3.0.3",
|
||||
"jest-websocket-mock": "2.5.0",
|
||||
"mock-socket": "9.3.1",
|
||||
"ncp": "2.0.0",
|
||||
"nodemon": "3.0.3",
|
||||
"tsd": "0.30.4",
|
||||
"typescript": "5.3.3"
|
||||
"nodemon": "3.1.0",
|
||||
"execa": "8.0.1",
|
||||
"tsd": "0.30.7",
|
||||
"typescript": "5.5.2",
|
||||
"esbuild": "0.19.11",
|
||||
"glob": "10.3.12"
|
||||
},
|
||||
"files": [
|
||||
"built",
|
||||
"built/esm",
|
||||
"built/dts"
|
||||
"built"
|
||||
],
|
||||
"dependencies": {
|
||||
"@swc/cli": "0.1.63",
|
||||
"@swc/core": "1.3.105",
|
||||
"eventemitter3": "5.0.1",
|
||||
"reconnecting-websocket": "4.4.0"
|
||||
}
|
||||
|
||||
@@ -3,7 +3,7 @@ import './autogen/apiClientJSDoc.js';
|
||||
import { SwitchCaseResponseType } from './api.types.js';
|
||||
import type { Endpoints } from './api.types.js';
|
||||
|
||||
export {
|
||||
export type {
|
||||
SwitchCaseResponseType,
|
||||
} from './api.types.js';
|
||||
|
||||
|
||||
@@ -25,6 +25,66 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *read:admin:abuse-report:notification-recipient*
|
||||
*/
|
||||
request<E extends 'admin/abuse-report/notification-recipient/list', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *read:admin:abuse-report:notification-recipient*
|
||||
*/
|
||||
request<E extends 'admin/abuse-report/notification-recipient/show', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:abuse-report:notification-recipient*
|
||||
*/
|
||||
request<E extends 'admin/abuse-report/notification-recipient/create', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:abuse-report:notification-recipient*
|
||||
*/
|
||||
request<E extends 'admin/abuse-report/notification-recipient/update', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:abuse-report:notification-recipient*
|
||||
*/
|
||||
request<E extends 'admin/abuse-report/notification-recipient/delete', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
@@ -678,7 +738,7 @@ declare module '../api.js' {
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *read:admin:show-users*
|
||||
* **Credential required**: *Yes* / **Permission**: *read:admin:show-user*
|
||||
*/
|
||||
request<E extends 'admin/show-users', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
@@ -840,6 +900,66 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:system-webhook*
|
||||
*/
|
||||
request<E extends 'admin/system-webhook/create', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:system-webhook*
|
||||
*/
|
||||
request<E extends 'admin/system-webhook/delete', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:system-webhook*
|
||||
*/
|
||||
request<E extends 'admin/system-webhook/list', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:system-webhook*
|
||||
*/
|
||||
request<E extends 'admin/system-webhook/show', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Internal Endpoint**: This endpoint is an API for the misskey mainframe and is not intended for use by third parties.
|
||||
* **Credential required**: *Yes* / **Permission**: *write:admin:system-webhook*
|
||||
*/
|
||||
request<E extends 'admin/system-webhook/update', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
@@ -851,6 +971,17 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *No*
|
||||
*/
|
||||
request<E extends 'announcements/show', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
@@ -3195,6 +3326,17 @@ declare module '../api.js' {
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
* **Credential required**: *Yes* / **Permission**: *write:notifications*
|
||||
*/
|
||||
request<E extends 'notifications/flush', P extends Endpoints[E]['req']>(
|
||||
endpoint: E,
|
||||
params: P,
|
||||
credential?: string | null,
|
||||
): Promise<SwitchCaseResponseType<E, P>>;
|
||||
|
||||
/**
|
||||
* No description provided.
|
||||
*
|
||||
|
||||
@@ -4,6 +4,15 @@ import type {
|
||||
AdminMetaResponse,
|
||||
AdminAbuseUserReportsRequest,
|
||||
AdminAbuseUserReportsResponse,
|
||||
AdminAbuseReportNotificationRecipientListRequest,
|
||||
AdminAbuseReportNotificationRecipientListResponse,
|
||||
AdminAbuseReportNotificationRecipientShowRequest,
|
||||
AdminAbuseReportNotificationRecipientShowResponse,
|
||||
AdminAbuseReportNotificationRecipientCreateRequest,
|
||||
AdminAbuseReportNotificationRecipientCreateResponse,
|
||||
AdminAbuseReportNotificationRecipientUpdateRequest,
|
||||
AdminAbuseReportNotificationRecipientUpdateResponse,
|
||||
AdminAbuseReportNotificationRecipientDeleteRequest,
|
||||
AdminAccountsCreateRequest,
|
||||
AdminAccountsCreateResponse,
|
||||
AdminAccountsDeleteRequest,
|
||||
@@ -35,6 +44,7 @@ import type {
|
||||
AdminDriveShowFileResponse,
|
||||
AdminEmojiAddAliasesBulkRequest,
|
||||
AdminEmojiAddRequest,
|
||||
AdminEmojiAddResponse,
|
||||
AdminEmojiCopyRequest,
|
||||
AdminEmojiCopyResponse,
|
||||
AdminEmojiDeleteBulkRequest,
|
||||
@@ -85,7 +95,6 @@ import type {
|
||||
AdminUnsuspendUserRequest,
|
||||
AdminUpdateMetaRequest,
|
||||
AdminDeleteAccountRequest,
|
||||
AdminDeleteAccountResponse,
|
||||
AdminUpdateUserNoteRequest,
|
||||
AdminRolesCreateRequest,
|
||||
AdminRolesCreateResponse,
|
||||
@@ -99,8 +108,19 @@ import type {
|
||||
AdminRolesUpdateDefaultPoliciesRequest,
|
||||
AdminRolesUsersRequest,
|
||||
AdminRolesUsersResponse,
|
||||
AdminSystemWebhookCreateRequest,
|
||||
AdminSystemWebhookCreateResponse,
|
||||
AdminSystemWebhookDeleteRequest,
|
||||
AdminSystemWebhookListRequest,
|
||||
AdminSystemWebhookListResponse,
|
||||
AdminSystemWebhookShowRequest,
|
||||
AdminSystemWebhookShowResponse,
|
||||
AdminSystemWebhookUpdateRequest,
|
||||
AdminSystemWebhookUpdateResponse,
|
||||
AnnouncementsRequest,
|
||||
AnnouncementsResponse,
|
||||
AnnouncementsShowRequest,
|
||||
AnnouncementsShowResponse,
|
||||
AntennasCreateRequest,
|
||||
AntennasCreateResponse,
|
||||
AntennasDeleteRequest,
|
||||
@@ -283,6 +303,7 @@ import type {
|
||||
HashtagsUsersResponse,
|
||||
IResponse,
|
||||
I2faDoneRequest,
|
||||
I2faDoneResponse,
|
||||
I2faKeyDoneRequest,
|
||||
I2faKeyDoneResponse,
|
||||
I2faPasswordLessRequest,
|
||||
@@ -333,6 +354,7 @@ import type {
|
||||
IRegistryKeysWithTypeRequest,
|
||||
IRegistryKeysWithTypeResponse,
|
||||
IRegistryKeysRequest,
|
||||
IRegistryKeysResponse,
|
||||
IRegistryRemoveRequest,
|
||||
IRegistryScopesWithDomainResponse,
|
||||
IRegistrySetRequest,
|
||||
@@ -536,11 +558,9 @@ import type {
|
||||
FetchExternalResourcesResponse,
|
||||
RetentionResponse,
|
||||
BubbleGameRegisterRequest,
|
||||
BubbleGameRegisterResponse,
|
||||
BubbleGameRankingRequest,
|
||||
BubbleGameRankingResponse,
|
||||
ReversiCancelMatchRequest,
|
||||
ReversiCancelMatchResponse,
|
||||
ReversiGamesRequest,
|
||||
ReversiGamesResponse,
|
||||
ReversiMatchRequest,
|
||||
@@ -561,6 +581,11 @@ import type {
|
||||
export type Endpoints = {
|
||||
'admin/meta': { req: EmptyRequest; res: AdminMetaResponse };
|
||||
'admin/abuse-user-reports': { req: AdminAbuseUserReportsRequest; res: AdminAbuseUserReportsResponse };
|
||||
'admin/abuse-report/notification-recipient/list': { req: AdminAbuseReportNotificationRecipientListRequest; res: AdminAbuseReportNotificationRecipientListResponse };
|
||||
'admin/abuse-report/notification-recipient/show': { req: AdminAbuseReportNotificationRecipientShowRequest; res: AdminAbuseReportNotificationRecipientShowResponse };
|
||||
'admin/abuse-report/notification-recipient/create': { req: AdminAbuseReportNotificationRecipientCreateRequest; res: AdminAbuseReportNotificationRecipientCreateResponse };
|
||||
'admin/abuse-report/notification-recipient/update': { req: AdminAbuseReportNotificationRecipientUpdateRequest; res: AdminAbuseReportNotificationRecipientUpdateResponse };
|
||||
'admin/abuse-report/notification-recipient/delete': { req: AdminAbuseReportNotificationRecipientDeleteRequest; res: EmptyResponse };
|
||||
'admin/accounts/create': { req: AdminAccountsCreateRequest; res: AdminAccountsCreateResponse };
|
||||
'admin/accounts/delete': { req: AdminAccountsDeleteRequest; res: EmptyResponse };
|
||||
'admin/accounts/find-by-email': { req: AdminAccountsFindByEmailRequest; res: AdminAccountsFindByEmailResponse };
|
||||
@@ -584,7 +609,7 @@ export type Endpoints = {
|
||||
'admin/drive/files': { req: AdminDriveFilesRequest; res: AdminDriveFilesResponse };
|
||||
'admin/drive/show-file': { req: AdminDriveShowFileRequest; res: AdminDriveShowFileResponse };
|
||||
'admin/emoji/add-aliases-bulk': { req: AdminEmojiAddAliasesBulkRequest; res: EmptyResponse };
|
||||
'admin/emoji/add': { req: AdminEmojiAddRequest; res: EmptyResponse };
|
||||
'admin/emoji/add': { req: AdminEmojiAddRequest; res: AdminEmojiAddResponse };
|
||||
'admin/emoji/copy': { req: AdminEmojiCopyRequest; res: AdminEmojiCopyResponse };
|
||||
'admin/emoji/delete-bulk': { req: AdminEmojiDeleteBulkRequest; res: EmptyResponse };
|
||||
'admin/emoji/delete': { req: AdminEmojiDeleteRequest; res: EmptyResponse };
|
||||
@@ -624,7 +649,7 @@ export type Endpoints = {
|
||||
'admin/suspend-user': { req: AdminSuspendUserRequest; res: EmptyResponse };
|
||||
'admin/unsuspend-user': { req: AdminUnsuspendUserRequest; res: EmptyResponse };
|
||||
'admin/update-meta': { req: AdminUpdateMetaRequest; res: EmptyResponse };
|
||||
'admin/delete-account': { req: AdminDeleteAccountRequest; res: AdminDeleteAccountResponse };
|
||||
'admin/delete-account': { req: AdminDeleteAccountRequest; res: EmptyResponse };
|
||||
'admin/update-user-note': { req: AdminUpdateUserNoteRequest; res: EmptyResponse };
|
||||
'admin/roles/create': { req: AdminRolesCreateRequest; res: AdminRolesCreateResponse };
|
||||
'admin/roles/delete': { req: AdminRolesDeleteRequest; res: EmptyResponse };
|
||||
@@ -635,7 +660,13 @@ export type Endpoints = {
|
||||
'admin/roles/unassign': { req: AdminRolesUnassignRequest; res: EmptyResponse };
|
||||
'admin/roles/update-default-policies': { req: AdminRolesUpdateDefaultPoliciesRequest; res: EmptyResponse };
|
||||
'admin/roles/users': { req: AdminRolesUsersRequest; res: AdminRolesUsersResponse };
|
||||
'admin/system-webhook/create': { req: AdminSystemWebhookCreateRequest; res: AdminSystemWebhookCreateResponse };
|
||||
'admin/system-webhook/delete': { req: AdminSystemWebhookDeleteRequest; res: EmptyResponse };
|
||||
'admin/system-webhook/list': { req: AdminSystemWebhookListRequest; res: AdminSystemWebhookListResponse };
|
||||
'admin/system-webhook/show': { req: AdminSystemWebhookShowRequest; res: AdminSystemWebhookShowResponse };
|
||||
'admin/system-webhook/update': { req: AdminSystemWebhookUpdateRequest; res: AdminSystemWebhookUpdateResponse };
|
||||
'announcements': { req: AnnouncementsRequest; res: AnnouncementsResponse };
|
||||
'announcements/show': { req: AnnouncementsShowRequest; res: AnnouncementsShowResponse };
|
||||
'antennas/create': { req: AntennasCreateRequest; res: AntennasCreateResponse };
|
||||
'antennas/delete': { req: AntennasDeleteRequest; res: EmptyResponse };
|
||||
'antennas/list': { req: EmptyRequest; res: AntennasListResponse };
|
||||
@@ -744,7 +775,7 @@ export type Endpoints = {
|
||||
'hashtags/trend': { req: EmptyRequest; res: HashtagsTrendResponse };
|
||||
'hashtags/users': { req: HashtagsUsersRequest; res: HashtagsUsersResponse };
|
||||
'i': { req: EmptyRequest; res: IResponse };
|
||||
'i/2fa/done': { req: I2faDoneRequest; res: EmptyResponse };
|
||||
'i/2fa/done': { req: I2faDoneRequest; res: I2faDoneResponse };
|
||||
'i/2fa/key-done': { req: I2faKeyDoneRequest; res: I2faKeyDoneResponse };
|
||||
'i/2fa/password-less': { req: I2faPasswordLessRequest; res: EmptyResponse };
|
||||
'i/2fa/register-key': { req: I2faRegisterKeyRequest; res: I2faRegisterKeyResponse };
|
||||
@@ -785,7 +816,7 @@ export type Endpoints = {
|
||||
'i/registry/get-detail': { req: IRegistryGetDetailRequest; res: IRegistryGetDetailResponse };
|
||||
'i/registry/get': { req: IRegistryGetRequest; res: IRegistryGetResponse };
|
||||
'i/registry/keys-with-type': { req: IRegistryKeysWithTypeRequest; res: IRegistryKeysWithTypeResponse };
|
||||
'i/registry/keys': { req: IRegistryKeysRequest; res: EmptyResponse };
|
||||
'i/registry/keys': { req: IRegistryKeysRequest; res: IRegistryKeysResponse };
|
||||
'i/registry/remove': { req: IRegistryRemoveRequest; res: EmptyResponse };
|
||||
'i/registry/scopes-with-domain': { req: EmptyRequest; res: IRegistryScopesWithDomainResponse };
|
||||
'i/registry/set': { req: IRegistrySetRequest; res: EmptyResponse };
|
||||
@@ -846,6 +877,7 @@ export type Endpoints = {
|
||||
'notes/unrenote': { req: NotesUnrenoteRequest; res: EmptyResponse };
|
||||
'notes/user-list-timeline': { req: NotesUserListTimelineRequest; res: NotesUserListTimelineResponse };
|
||||
'notifications/create': { req: NotificationsCreateRequest; res: EmptyResponse };
|
||||
'notifications/flush': { req: EmptyRequest; res: EmptyResponse };
|
||||
'notifications/mark-all-as-read': { req: EmptyRequest; res: EmptyResponse };
|
||||
'notifications/test-notification': { req: EmptyRequest; res: EmptyResponse };
|
||||
'page-push': { req: PagePushRequest; res: EmptyResponse };
|
||||
@@ -917,9 +949,9 @@ export type Endpoints = {
|
||||
'fetch-rss': { req: FetchRssRequest; res: FetchRssResponse };
|
||||
'fetch-external-resources': { req: FetchExternalResourcesRequest; res: FetchExternalResourcesResponse };
|
||||
'retention': { req: EmptyRequest; res: RetentionResponse };
|
||||
'bubble-game/register': { req: BubbleGameRegisterRequest; res: BubbleGameRegisterResponse };
|
||||
'bubble-game/register': { req: BubbleGameRegisterRequest; res: EmptyResponse };
|
||||
'bubble-game/ranking': { req: BubbleGameRankingRequest; res: BubbleGameRankingResponse };
|
||||
'reversi/cancel-match': { req: ReversiCancelMatchRequest; res: ReversiCancelMatchResponse };
|
||||
'reversi/cancel-match': { req: ReversiCancelMatchRequest; res: EmptyResponse };
|
||||
'reversi/games': { req: ReversiGamesRequest; res: ReversiGamesResponse };
|
||||
'reversi/match': { req: ReversiMatchRequest; res: ReversiMatchResponse };
|
||||
'reversi/invitations': { req: EmptyRequest; res: ReversiInvitationsResponse };
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -35,9 +35,22 @@ export type EmojiSimple = components['schemas']['EmojiSimple'];
|
||||
export type EmojiDetailed = components['schemas']['EmojiDetailed'];
|
||||
export type Flash = components['schemas']['Flash'];
|
||||
export type Signin = components['schemas']['Signin'];
|
||||
export type RoleCondFormulaLogics = components['schemas']['RoleCondFormulaLogics'];
|
||||
export type RoleCondFormulaValueNot = components['schemas']['RoleCondFormulaValueNot'];
|
||||
export type RoleCondFormulaValueIsLocalOrRemote = components['schemas']['RoleCondFormulaValueIsLocalOrRemote'];
|
||||
export type RoleCondFormulaValueUserSettingBooleanSchema = components['schemas']['RoleCondFormulaValueUserSettingBooleanSchema'];
|
||||
export type RoleCondFormulaValueAssignedRole = components['schemas']['RoleCondFormulaValueAssignedRole'];
|
||||
export type RoleCondFormulaValueCreated = components['schemas']['RoleCondFormulaValueCreated'];
|
||||
export type RoleCondFormulaFollowersOrFollowingOrNotes = components['schemas']['RoleCondFormulaFollowersOrFollowingOrNotes'];
|
||||
export type RoleCondFormulaValue = components['schemas']['RoleCondFormulaValue'];
|
||||
export type RoleLite = components['schemas']['RoleLite'];
|
||||
export type Role = components['schemas']['Role'];
|
||||
export type RolePolicies = components['schemas']['RolePolicies'];
|
||||
export type ReversiGameLite = components['schemas']['ReversiGameLite'];
|
||||
export type ReversiGameDetailed = components['schemas']['ReversiGameDetailed'];
|
||||
export type MetaLite = components['schemas']['MetaLite'];
|
||||
export type MetaDetailedOnly = components['schemas']['MetaDetailedOnly'];
|
||||
export type MetaDetailed = components['schemas']['MetaDetailed'];
|
||||
export type SystemWebhook = components['schemas']['SystemWebhook'];
|
||||
export type AbuseReportNotificationRecipient = components['schemas']['AbuseReportNotificationRecipient'];
|
||||
export type MahjongRoomDetailed = components['schemas']['MahjongRoomDetailed'];
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -58,7 +58,6 @@ export const permissions = [
|
||||
'read:admin:server-info',
|
||||
'read:admin:show-moderation-log',
|
||||
'read:admin:show-user',
|
||||
'read:admin:show-users',
|
||||
'write:admin:suspend-user',
|
||||
'write:admin:unset-user-avatar',
|
||||
'write:admin:unset-user-banner',
|
||||
@@ -121,6 +120,7 @@ export const moderationLogTypes = [
|
||||
'resetPassword',
|
||||
'suspendRemoteInstance',
|
||||
'unsuspendRemoteInstance',
|
||||
'updateRemoteInstanceNote',
|
||||
'markSensitiveDriveFile',
|
||||
'unmarkSensitiveDriveFile',
|
||||
'resolveAbuseReport',
|
||||
@@ -261,6 +261,12 @@ export type ModerationLogPayloads = {
|
||||
id: string;
|
||||
host: string;
|
||||
};
|
||||
updateRemoteInstanceNote: {
|
||||
id: string;
|
||||
host: string;
|
||||
before: string | null;
|
||||
after: string | null;
|
||||
};
|
||||
markSensitiveDriveFile: {
|
||||
fileId: string;
|
||||
fileUserId: string | null;
|
||||
@@ -319,4 +325,30 @@ export type ModerationLogPayloads = {
|
||||
userHost: string | null;
|
||||
fileId: string;
|
||||
};
|
||||
createSystemWebhook: {
|
||||
systemWebhookId: string;
|
||||
webhook: any;
|
||||
};
|
||||
updateSystemWebhook: {
|
||||
systemWebhookId: string;
|
||||
before: any;
|
||||
after: any;
|
||||
};
|
||||
deleteSystemWebhook: {
|
||||
systemWebhookId: string;
|
||||
webhook: any;
|
||||
};
|
||||
createAbuseReportNotificationRecipient: {
|
||||
recipientId: string;
|
||||
recipient: any;
|
||||
};
|
||||
updateAbuseReportNotificationRecipient: {
|
||||
recipientId: string;
|
||||
before: any;
|
||||
after: any;
|
||||
};
|
||||
deleteAbuseReportNotificationRecipient: {
|
||||
recipientId: string;
|
||||
recipient: any;
|
||||
};
|
||||
};
|
||||
|
||||
@@ -95,6 +95,9 @@ export type ModerationLog = {
|
||||
} | {
|
||||
type: 'unsuspendRemoteInstance';
|
||||
info: ModerationLogPayloads['unsuspendRemoteInstance'];
|
||||
} | {
|
||||
type: 'updateRemoteInstanceNote';
|
||||
info: ModerationLogPayloads['updateRemoteInstanceNote'];
|
||||
} | {
|
||||
type: 'markSensitiveDriveFile';
|
||||
info: ModerationLogPayloads['markSensitiveDriveFile'];
|
||||
@@ -129,8 +132,23 @@ export type ModerationLog = {
|
||||
type: 'unsetUserAvatar';
|
||||
info: ModerationLogPayloads['unsetUserAvatar'];
|
||||
} | {
|
||||
type: 'unsetUserBanner';
|
||||
info: ModerationLogPayloads['unsetUserBanner'];
|
||||
type: 'createSystemWebhook';
|
||||
info: ModerationLogPayloads['createSystemWebhook'];
|
||||
} | {
|
||||
type: 'updateSystemWebhook';
|
||||
info: ModerationLogPayloads['updateSystemWebhook'];
|
||||
} | {
|
||||
type: 'deleteSystemWebhook';
|
||||
info: ModerationLogPayloads['deleteSystemWebhook'];
|
||||
} | {
|
||||
type: 'createAbuseReportNotificationRecipient';
|
||||
info: ModerationLogPayloads['createAbuseReportNotificationRecipient'];
|
||||
} | {
|
||||
type: 'updateAbuseReportNotificationRecipient';
|
||||
info: ModerationLogPayloads['updateAbuseReportNotificationRecipient'];
|
||||
} | {
|
||||
type: 'deleteAbuseReportNotificationRecipient';
|
||||
info: ModerationLogPayloads['deleteAbuseReportNotificationRecipient'];
|
||||
});
|
||||
|
||||
export type ServerStats = {
|
||||
|
||||
@@ -1,17 +1,20 @@
|
||||
import { Endpoints } from './api.types.js';
|
||||
import { type Endpoints } from './api.types.js';
|
||||
import Stream, { Connection } from './streaming.js';
|
||||
import { Channels } from './streaming.types.js';
|
||||
import { Acct } from './acct.js';
|
||||
import { type Channels } from './streaming.types.js';
|
||||
import { type Acct } from './acct.js';
|
||||
import * as consts from './consts.js';
|
||||
|
||||
export {
|
||||
export type {
|
||||
Endpoints,
|
||||
Stream,
|
||||
Connection as ChannelConnection,
|
||||
Channels,
|
||||
Acct,
|
||||
};
|
||||
|
||||
export {
|
||||
Stream,
|
||||
Connection as ChannelConnection,
|
||||
};
|
||||
|
||||
export const permissions = consts.permissions;
|
||||
export const notificationTypes = consts.notificationTypes;
|
||||
export const noteVisibilities = consts.noteVisibilities;
|
||||
|
||||
@@ -40,6 +40,7 @@ export type Channels = {
|
||||
unreadNotification: (payload: Notification) => void;
|
||||
unreadMention: (payload: Note['id']) => void;
|
||||
readAllUnreadMentions: () => void;
|
||||
notificationFlushed: () => void;
|
||||
unreadSpecifiedNote: (payload: Note['id']) => void;
|
||||
readAllUnreadSpecifiedNotes: () => void;
|
||||
readAllAntennas: () => void;
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
"moduleResolution": "nodenext",
|
||||
"declaration": true,
|
||||
"declarationMap": true,
|
||||
"sourceMap": true,
|
||||
"sourceMap": false,
|
||||
"outDir": "./built/",
|
||||
"removeComments": true,
|
||||
"strict": true,
|
||||
|
||||
Reference in New Issue
Block a user