From 32ff71a67d458b700a93e9a76b16a0ccafc6bf80 Mon Sep 17 00:00:00 2001 From: syuilo Date: Fri, 30 Jul 2021 13:01:52 +0900 Subject: [PATCH] introduce api-extractor --- .github/pull_request_template.md | 4 + .github/workflows/api.yml | 40 + api-extractor.json | 364 +++++ etc/misskey-js.api.md | 2432 ++++++++++++++++++++++++++++++ package-lock.json | 540 +++++++ package.json | 3 + src/index.ts | 8 +- tsconfig.json | 9 +- 8 files changed, 3395 insertions(+), 5 deletions(-) create mode 100644 .github/workflows/api.yml create mode 100644 api-extractor.json create mode 100644 etc/misskey-js.api.md diff --git a/.github/pull_request_template.md b/.github/pull_request_template.md index afa1e2f1f..8384cfade 100644 --- a/.github/pull_request_template.md +++ b/.github/pull_request_template.md @@ -5,9 +5,11 @@ PRありがとうございます! PRを作成する前に、以下をご確認 - また、PRの粒度が適切であることを確認してください。ひとつのPRに複数の種類の変更や関心を含めることは避けてください。 - このPRによって解決されるIssueがある場合は、そのIssueへの参照を本文内に含めてください。 - CHANGELOG.mdに変更点を追記してください。リファクタリングなど、利用者に影響を与えない変更についてはこの限りではありません。 +- この変更により新たに作成、もしくは更新すべきドキュメントがないか確認してください。 - 機能追加やバグ修正をした場合は、可能であればテストケースを追加してください。 - テスト、Lintが通っていることを予め確認してください。 - `npm run test`、`npm run lint`でぞれぞれ実施可能です +- `npm run api`を実行してAPIレポートを更新し、差分がある場合はコミットしてください。 ご協力ありがとうございます🤗 --> diff --git a/.github/workflows/api.yml b/.github/workflows/api.yml new file mode 100644 index 000000000..89b7257ca --- /dev/null +++ b/.github/workflows/api.yml @@ -0,0 +1,40 @@ +name: API report + +on: [push, pull_request] + +jobs: + report: + + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Setup Node.js + uses: actions/setup-node@v1 + with: + node-version: 16.5.0 + + - name: Cache dependencies + uses: actions/cache@v2 + with: + path: ~/.npm + key: npm-${{ hashFiles('package-lock.json') }} + restore-keys: npm- + + - name: Install dependencies + run: npm ci + + - name: Build + run: npm run build + + - name: Check files + run: ls built + + - name: API report + run: npm run api-prod + + - name: Show report + if: always() + run: cat temp/aiscript.api.md diff --git a/api-extractor.json b/api-extractor.json new file mode 100644 index 000000000..a95281a6d --- /dev/null +++ b/api-extractor.json @@ -0,0 +1,364 @@ +/** + * Config file for API Extractor. For more info, please visit: https://api-extractor.com + */ +{ + "$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json", + + /** + * Optionally specifies another JSON config file that this file extends from. This provides a way for + * standard settings to be shared across multiple projects. + * + * If the path starts with "./" or "../", the path is resolved relative to the folder of the file that contains + * the "extends" field. Otherwise, the first path segment is interpreted as an NPM package name, and will be + * resolved using NodeJS require(). + * + * SUPPORTED TOKENS: none + * DEFAULT VALUE: "" + */ + // "extends": "./shared/api-extractor-base.json" + // "extends": "my-package/include/api-extractor-base.json" + + /** + * Determines the "" token that can be used with other config file settings. The project folder + * typically contains the tsconfig.json and package.json config files, but the path is user-defined. + * + * The path is resolved relative to the folder of the config file that contains the setting. + * + * The default value for "projectFolder" is the token "", which means the folder is determined by traversing + * parent folders, starting from the folder containing api-extractor.json, and stopping at the first folder + * that contains a tsconfig.json file. If a tsconfig.json file cannot be found in this way, then an error + * will be reported. + * + * SUPPORTED TOKENS: + * DEFAULT VALUE: "" + */ + // "projectFolder": "..", + + /** + * (REQUIRED) Specifies the .d.ts file to be used as the starting point for analysis. API Extractor + * analyzes the symbols exported by this module. + * + * The file extension must be ".d.ts" and not ".ts". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + */ + "mainEntryPointFilePath": "/built/index.d.ts", + + /** + * A list of NPM package names whose exports should be treated as part of this package. + * + * For example, suppose that Webpack is used to generate a distributed bundle for the project "library1", + * and another NPM package "library2" is embedded in this bundle. Some types from library2 may become part + * of the exported API for library1, but by default API Extractor would generate a .d.ts rollup that explicitly + * imports library2. To avoid this, we can specify: + * + * "bundledPackages": [ "library2" ], + * + * This would direct API Extractor to embed those types directly in the .d.ts rollup, as if they had been + * local files for library1. + */ + "bundledPackages": [], + + /** + * Determines how the TypeScript compiler engine will be invoked by API Extractor. + */ + "compiler": { + /** + * Specifies the path to the tsconfig.json file to be used by API Extractor when analyzing the project. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * Note: This setting will be ignored if "overrideTsconfig" is used. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/tsconfig.json" + */ + // "tsconfigFilePath": "/tsconfig.json", + /** + * Provides a compiler configuration that will be used instead of reading the tsconfig.json file from disk. + * The object must conform to the TypeScript tsconfig schema: + * + * http://json.schemastore.org/tsconfig + * + * If omitted, then the tsconfig.json file will be read from the "projectFolder". + * + * DEFAULT VALUE: no overrideTsconfig section + */ + // "overrideTsconfig": { + // . . . + // } + /** + * This option causes the compiler to be invoked with the --skipLibCheck option. This option is not recommended + * and may cause API Extractor to produce incomplete or incorrect declarations, but it may be required when + * dependencies contain declarations that are incompatible with the TypeScript engine that API Extractor uses + * for its analysis. Where possible, the underlying issue should be fixed rather than relying on skipLibCheck. + * + * DEFAULT VALUE: false + */ + // "skipLibCheck": true, + }, + + /** + * Configures how the API report file (*.api.md) will be generated. + */ + "apiReport": { + /** + * (REQUIRED) Whether to generate an API report. + */ + "enabled": true + + /** + * The filename for the API report files. It will be combined with "reportFolder" or "reportTempFolder" to produce + * a full file path. + * + * The file extension should be ".api.md", and the string should not contain a path separator such as "\" or "/". + * + * SUPPORTED TOKENS: , + * DEFAULT VALUE: ".api.md" + */ + // "reportFileName": ".api.md", + + /** + * Specifies the folder where the API report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * The API report file is normally tracked by Git. Changes to it can be used to trigger a branch policy, + * e.g. for an API review. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/etc/" + */ + // "reportFolder": "/etc/", + + /** + * Specifies the folder where the temporary report file is written. The file name portion is determined by + * the "reportFileName" setting. + * + * After the temporary file is written to disk, it is compared with the file in the "reportFolder". + * If they are different, a production build will fail. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/" + */ + // "reportTempFolder": "/temp/" + }, + + /** + * Configures how the doc model file (*.api.json) will be generated. + */ + "docModel": { + /** + * (REQUIRED) Whether to generate a doc model file. + */ + "enabled": true + + /** + * The output path for the doc model file. The file extension should be ".api.json". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/temp/.api.json" + */ + // "apiJsonFilePath": "/temp/.api.json" + }, + + /** + * Configures how the .d.ts rollup file will be generated. + */ + "dtsRollup": { + /** + * (REQUIRED) Whether to generate the .d.ts rollup file. + */ + "enabled": false + + /** + * Specifies the output path for a .d.ts rollup file to be generated without any trimming. + * This file will include all declarations that are exported by the main entry point. + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "/dist/.d.ts" + */ + // "untrimmedFilePath": "/dist/.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "beta" release. + * This file will include only declarations that are marked as "@public" or "@beta". + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "betaTrimmedFilePath": "/dist/-beta.d.ts", + + /** + * Specifies the output path for a .d.ts rollup file to be generated with trimming for a "public" release. + * This file will include only declarations that are marked as "@public". + * + * If the path is an empty string, then this file will not be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "publicTrimmedFilePath": "/dist/-public.d.ts", + + /** + * When a declaration is trimmed, by default it will be replaced by a code comment such as + * "Excluded from this release type: exampleMember". Set "omitTrimmingComments" to true to remove the + * declaration completely. + * + * DEFAULT VALUE: false + */ + // "omitTrimmingComments": true + }, + + /** + * Configures how the tsdoc-metadata.json file will be generated. + */ + "tsdocMetadata": { + /** + * Whether to generate the tsdoc-metadata.json file. + * + * DEFAULT VALUE: true + */ + // "enabled": true, + /** + * Specifies where the TSDoc metadata file should be written. + * + * The path is resolved relative to the folder of the config file that contains the setting; to change this, + * prepend a folder token such as "". + * + * The default value is "", which causes the path to be automatically inferred from the "tsdocMetadata", + * "typings" or "main" fields of the project's package.json. If none of these fields are set, the lookup + * falls back to "tsdoc-metadata.json" in the package folder. + * + * SUPPORTED TOKENS: , , + * DEFAULT VALUE: "" + */ + // "tsdocMetadataFilePath": "/dist/tsdoc-metadata.json" + }, + + /** + * Specifies what type of newlines API Extractor should use when writing output files. By default, the output files + * will be written with Windows-style newlines. To use POSIX-style newlines, specify "lf" instead. + * To use the OS's default newline kind, specify "os". + * + * DEFAULT VALUE: "crlf" + */ + // "newlineKind": "crlf", + + /** + * Configures how API Extractor reports error and warning messages produced during analysis. + * + * There are three sources of messages: compiler messages, API Extractor messages, and TSDoc messages. + */ + "messages": { + /** + * Configures handling of diagnostic messages reported by the TypeScript compiler engine while analyzing + * the input .d.ts files. + * + * TypeScript message identifiers start with "TS" followed by an integer. For example: "TS2551" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "compilerMessageReporting": { + /** + * Configures the default routing for messages that don't match an explicit rule in this table. + */ + "default": { + /** + * Specifies whether the message should be written to the the tool's output log. Note that + * the "addToApiReportFile" property may supersede this option. + * + * Possible values: "error", "warning", "none" + * + * Errors cause the build to fail and return a nonzero exit code. Warnings cause a production build fail + * and return a nonzero exit code. For a non-production build (e.g. when "api-extractor run" includes + * the "--local" option), the warning is displayed but the build will not fail. + * + * DEFAULT VALUE: "warning" + */ + "logLevel": "warning" + + /** + * When addToApiReportFile is true: If API Extractor is configured to write an API report file (.api.md), + * then the message will be written inside that file; otherwise, the message is instead logged according to + * the "logLevel" option. + * + * DEFAULT VALUE: false + */ + // "addToApiReportFile": false + } + + // "TS2551": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by API Extractor during its analysis. + * + * API Extractor message identifiers start with "ae-". For example: "ae-extra-release-tag" + * + * DEFAULT VALUE: See api-extractor-defaults.json for the complete table of extractorMessageReporting mappings + */ + "extractorMessageReporting": { + "default": { + "logLevel": "none" + // "addToApiReportFile": false + } + + // "ae-extra-release-tag": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + }, + + /** + * Configures handling of messages reported by the TSDoc parser when analyzing code comments. + * + * TSDoc message identifiers start with "tsdoc-". For example: "tsdoc-link-tag-unescaped-text" + * + * DEFAULT VALUE: A single "default" entry with logLevel=warning. + */ + "tsdocMessageReporting": { + "default": { + "logLevel": "warning" + // "addToApiReportFile": false + } + + // "tsdoc-link-tag-unescaped-text": { + // "logLevel": "warning", + // "addToApiReportFile": true + // }, + // + // . . . + } + } +} diff --git a/etc/misskey-js.api.md b/etc/misskey-js.api.md new file mode 100644 index 000000000..5aacf2dbc --- /dev/null +++ b/etc/misskey-js.api.md @@ -0,0 +1,2432 @@ +## API Report File for "misskey-js" + +> Do not edit this file. It is a report generated by [API Extractor](https://api-extractor.com/). + +```ts + +import { EventEmitter } from 'eventemitter3'; + +// @public (undocumented) +export type Acct = { + username: string; + host: string | null; +}; + +// Warning: (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +type Ad = TODO_2; + +// @public (undocumented) +type Announcement = { + id: ID; + createdAt: DateString; + updatedAt: DateString | null; + text: string; + title: string; + imageUrl: string | null; + isRead?: boolean; +}; + +// @public (undocumented) +type Antenna = { + id: ID; + createdAt: DateString; + name: string; + keywords: string[][]; + excludeKeywords: string[][]; + src: 'home' | 'all' | 'users' | 'list' | 'group'; + userListId: ID | null; + userGroupId: ID | null; + users: string[]; + caseSensitive: boolean; + notify: boolean; + withReplies: boolean; + withFile: boolean; + hasUnreadNote: boolean; +}; + +declare namespace api { + export { + isAPIError, + APIError, + FetchLike, + APIClient + } +} +export { api } + +// @public (undocumented) +class APIClient { + constructor(opts: { + origin: APIClient['origin']; + credential?: APIClient['credential']; + fetch?: APIClient['fetch'] | null | undefined; + }); + // (undocumented) + credential: string | null | undefined; + // (undocumented) + fetch: FetchLike; + // (undocumented) + origin: string; + // Warning: (ae-forgotten-export) The symbol "IsCaseMatched" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "GetCaseResult" needs to be exported by the entry point index.d.ts + // + // (undocumented) + request(endpoint: E, params?: P, credential?: string | null | undefined): Promise extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : IsCaseMatched extends true ? GetCaseResult : Endpoints[E]['res']['$switch']['$default'] : Endpoints[E]['res']>; +} + +// @public (undocumented) +type APIError = { + id: string; + code: string; + message: string; + kind: 'client' | 'server'; + info: Record; +}; + +// @public (undocumented) +type App = TODO_2; + +// @public (undocumented) +type AuthSession = { + id: ID; + app: App; + token: string; +}; + +// @public (undocumented) +type Blocking = { + id: ID; + createdAt: DateString; + blockeeId: User['id']; + blockee: UserDetailed; +}; + +// @public (undocumented) +type Channel = { + id: ID; +}; + +// @public (undocumented) +type Clip = TODO_2; + +// @public (undocumented) +type CustomEmoji = { + id: string; + name: string; + url: string; + category: string; + aliases: string[]; +}; + +// @public (undocumented) +type DateString = string; + +// @public (undocumented) +type DetailedInstanceMetadata = LiteInstanceMetadata & { + features: Record; +}; + +// @public (undocumented) +type DriveFile = { + id: ID; + createdAt: DateString; + isSensitive: boolean; + name: string; + thumbnailUrl: string; + url: string; + type: string; + size: number; + md5: string; + blurhash: string; + properties: Record; +}; + +// @public (undocumented) +type DriveFolder = TODO_2; + +// @public (undocumented) +export type Endpoints = { + 'admin/abuse-user-reports': { + req: TODO; + res: TODO; + }; + 'admin/delete-all-files-of-a-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'admin/delete-logs': { + req: NoParams; + res: null; + }; + 'admin/get-index-stats': { + req: TODO; + res: TODO; + }; + 'admin/get-table-stats': { + req: TODO; + res: TODO; + }; + 'admin/invite': { + req: TODO; + res: TODO; + }; + 'admin/logs': { + req: TODO; + res: TODO; + }; + 'admin/reset-password': { + req: TODO; + res: TODO; + }; + 'admin/resolve-abuse-user-report': { + req: TODO; + res: TODO; + }; + 'admin/resync-chart': { + req: TODO; + res: TODO; + }; + 'admin/send-email': { + req: TODO; + res: TODO; + }; + 'admin/server-info': { + req: TODO; + res: TODO; + }; + 'admin/show-moderation-logs': { + req: TODO; + res: TODO; + }; + 'admin/show-user': { + req: TODO; + res: TODO; + }; + 'admin/show-users': { + req: TODO; + res: TODO; + }; + 'admin/silence-user': { + req: TODO; + res: TODO; + }; + 'admin/suspend-user': { + req: TODO; + res: TODO; + }; + 'admin/unsilence-user': { + req: TODO; + res: TODO; + }; + 'admin/unsuspend-user': { + req: TODO; + res: TODO; + }; + 'admin/update-meta': { + req: TODO; + res: TODO; + }; + 'admin/vacuum': { + req: TODO; + res: TODO; + }; + 'admin/accounts/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/create': { + req: TODO; + res: TODO; + }; + 'admin/ad/delete': { + req: { + id: Ad['id']; + }; + res: null; + }; + 'admin/ad/list': { + req: TODO; + res: TODO; + }; + 'admin/ad/update': { + req: TODO; + res: TODO; + }; + 'admin/announcements/create': { + req: TODO; + res: TODO; + }; + 'admin/announcements/delete': { + req: { + id: Announcement['id']; + }; + res: null; + }; + 'admin/announcements/list': { + req: TODO; + res: TODO; + }; + 'admin/announcements/update': { + req: TODO; + res: TODO; + }; + 'admin/drive/clean-remote-files': { + req: TODO; + res: TODO; + }; + 'admin/drive/cleanup': { + req: TODO; + res: TODO; + }; + 'admin/drive/files': { + req: TODO; + res: TODO; + }; + 'admin/drive/show-file': { + req: TODO; + res: TODO; + }; + 'admin/emoji/add': { + req: TODO; + res: TODO; + }; + 'admin/emoji/copy': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list-remote': { + req: TODO; + res: TODO; + }; + 'admin/emoji/list': { + req: TODO; + res: TODO; + }; + 'admin/emoji/remove': { + req: TODO; + res: TODO; + }; + 'admin/emoji/update': { + req: TODO; + res: TODO; + }; + 'admin/federation/delete-all-files': { + req: { + host: string; + }; + res: null; + }; + 'admin/federation/refresh-remote-instance-metadata': { + req: TODO; + res: TODO; + }; + 'admin/federation/remove-all-following': { + req: TODO; + res: TODO; + }; + 'admin/federation/update-instance': { + req: TODO; + res: TODO; + }; + 'admin/moderators/add': { + req: TODO; + res: TODO; + }; + 'admin/moderators/remove': { + req: TODO; + res: TODO; + }; + 'admin/promo/create': { + req: TODO; + res: TODO; + }; + 'admin/queue/clear': { + req: TODO; + res: TODO; + }; + 'admin/queue/deliver-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/inbox-delayed': { + req: TODO; + res: TODO; + }; + 'admin/queue/jobs': { + req: TODO; + res: TODO; + }; + 'admin/queue/stats': { + req: TODO; + res: TODO; + }; + 'admin/relays/add': { + req: TODO; + res: TODO; + }; + 'admin/relays/list': { + req: TODO; + res: TODO; + }; + 'admin/relays/remove': { + req: TODO; + res: TODO; + }; + 'announcements': { + req: { + limit?: number; + withUnreads?: boolean; + sinceId?: Announcement['id']; + untilId?: Announcement['id']; + }; + res: Announcement[]; + }; + 'antennas/create': { + req: TODO; + res: Antenna; + }; + 'antennas/delete': { + req: { + antennaId: Antenna['id']; + }; + res: null; + }; + 'antennas/list': { + req: NoParams; + res: Antenna[]; + }; + 'antennas/notes': { + req: { + antennaId: Antenna['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'antennas/show': { + req: { + antennaId: Antenna['id']; + }; + res: Antenna; + }; + 'antennas/update': { + req: TODO; + res: Antenna; + }; + 'ap/get': { + req: { + uri: string; + }; + res: Record; + }; + 'ap/show': { + req: { + uri: string; + }; + res: { + type: 'Note'; + object: Note; + } | { + type: 'User'; + object: UserDetailed; + }; + }; + 'app/create': { + req: TODO; + res: App; + }; + 'app/show': { + req: { + appId: App['id']; + }; + res: App; + }; + 'auth/accept': { + req: { + token: string; + }; + res: null; + }; + 'auth/session/generate': { + req: { + appSecret: string; + }; + res: { + token: string; + url: string; + }; + }; + 'auth/session/show': { + req: { + token: string; + }; + res: AuthSession; + }; + 'auth/session/userkey': { + req: { + appSecret: string; + token: string; + }; + res: { + accessToken: string; + user: User; + }; + }; + 'blocking/create': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/delete': { + req: { + userId: User['id']; + }; + res: UserDetailed; + }; + 'blocking/list': { + req: { + limit?: number; + sinceId?: Blocking['id']; + untilId?: Blocking['id']; + }; + res: Blocking[]; + }; + 'channels/create': { + req: TODO; + res: TODO; + }; + 'channels/featured': { + req: TODO; + res: TODO; + }; + 'channels/follow': { + req: TODO; + res: TODO; + }; + 'channels/followed': { + req: TODO; + res: TODO; + }; + 'channels/owned': { + req: TODO; + res: TODO; + }; + 'channels/pin-note': { + req: TODO; + res: TODO; + }; + 'channels/show': { + req: TODO; + res: TODO; + }; + 'channels/timeline': { + req: TODO; + res: TODO; + }; + 'channels/unfollow': { + req: TODO; + res: TODO; + }; + 'channels/update': { + req: TODO; + res: TODO; + }; + 'charts/active-users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + users: number[]; + }; + remote: { + users: number[]; + }; + }; + }; + 'charts/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + remote: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + }; + 'charts/federation': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + instance: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/hashtag': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/instance': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + host: string; + }; + res: { + drive: { + decFiles: number[]; + decUsage: number[]; + incFiles: number[]; + incUsage: number[]; + totalFiles: number[]; + totalUsage: number[]; + }; + followers: { + dec: number[]; + inc: number[]; + total: number[]; + }; + following: { + dec: number[]; + inc: number[]; + total: number[]; + }; + notes: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + requests: { + failed: number[]; + received: number[]; + succeeded: number[]; + }; + users: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'charts/network': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: TODO; + }; + 'charts/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + }; + 'charts/user/drive': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + decCount: number[]; + decSize: number[]; + incCount: number[]; + incSize: number[]; + totalCount: number[]; + totalSize: number[]; + }; + }; + 'charts/user/following': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/user/notes': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: { + dec: number[]; + inc: number[]; + total: number[]; + diffs: { + normal: number[]; + renote: number[]; + reply: number[]; + }; + }; + }; + 'charts/user/reactions': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + userId: User['id']; + }; + res: TODO; + }; + 'charts/users': { + req: { + span: 'day' | 'hour'; + limit?: number; + offset?: number | null; + }; + res: { + local: { + dec: number[]; + inc: number[]; + total: number[]; + }; + remote: { + dec: number[]; + inc: number[]; + total: number[]; + }; + }; + }; + 'clips/add-note': { + req: TODO; + res: TODO; + }; + 'clips/create': { + req: TODO; + res: TODO; + }; + 'clips/delete': { + req: { + clipId: Clip['id']; + }; + res: null; + }; + 'clips/list': { + req: TODO; + res: TODO; + }; + 'clips/notes': { + req: TODO; + res: TODO; + }; + 'clips/show': { + req: TODO; + res: TODO; + }; + 'clips/update': { + req: TODO; + res: TODO; + }; + 'drive': { + req: NoParams; + res: { + capacity: number; + usage: number; + }; + }; + 'drive/files': { + req: { + folderId?: DriveFolder['id'] | null; + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'drive/files/attached-notes': { + req: TODO; + res: TODO; + }; + 'drive/files/check-existence': { + req: TODO; + res: TODO; + }; + 'drive/files/create': { + req: TODO; + res: TODO; + }; + 'drive/files/delete': { + req: { + fileId: DriveFile['id']; + }; + res: null; + }; + 'drive/files/find-by-hash': { + req: TODO; + res: TODO; + }; + 'drive/files/find': { + req: { + name: string; + folderId?: DriveFolder['id'] | null; + }; + res: DriveFile[]; + }; + 'drive/files/show': { + req: { + fileId?: DriveFile['id']; + url?: string; + }; + res: DriveFile; + }; + 'drive/files/update': { + req: { + fileId: DriveFile['id']; + folderId?: DriveFolder['id'] | null; + name?: string; + isSensitive?: boolean; + comment?: string | null; + }; + res: DriveFile; + }; + 'drive/files/upload-from-url': { + req: { + url: string; + folderId?: DriveFolder['id'] | null; + isSensitive?: boolean; + comment?: string | null; + marker?: string | null; + force?: boolean; + }; + res: null; + }; + 'drive/folders': { + req: { + folderId?: DriveFolder['id'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFolder[]; + }; + 'drive/folders/create': { + req: { + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/folders/delete': { + req: { + folderId: DriveFolder['id']; + }; + res: null; + }; + 'drive/folders/find': { + req: { + name: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder[]; + }; + 'drive/folders/show': { + req: { + folderId: DriveFolder['id']; + }; + res: DriveFolder; + }; + 'drive/folders/update': { + req: { + folderId: DriveFolder['id']; + name?: string; + parentId?: DriveFolder['id'] | null; + }; + res: DriveFolder; + }; + 'drive/stream': { + req: { + type?: DriveFile['type'] | null; + limit?: number; + sinceId?: DriveFile['id']; + untilId?: DriveFile['id']; + }; + res: DriveFile[]; + }; + 'endpoint': { + req: { + endpoint: string; + }; + res: { + params: { + name: string; + type: string; + }[]; + }; + }; + 'endpoints': { + req: NoParams; + res: string[]; + }; + 'federation/dns': { + req: { + host: string; + }; + res: { + a: string[]; + aaaa: string[]; + cname: string[]; + txt: string[]; + }; + }; + 'federation/followers': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/following': { + req: { + host: string; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'federation/instances': { + req: { + host?: string | null; + blocked?: boolean | null; + notResponding?: boolean | null; + suspended?: boolean | null; + federating?: boolean | null; + subscribing?: boolean | null; + publishing?: boolean | null; + limit?: number; + offset?: number; + sort?: '+pubSub' | '-pubSub' | '+notes' | '-notes' | '+users' | '-users' | '+following' | '-following' | '+followers' | '-followers' | '+caughtAt' | '-caughtAt' | '+lastCommunicatedAt' | '-lastCommunicatedAt' | '+driveUsage' | '-driveUsage' | '+driveFiles' | '-driveFiles'; + }; + res: Instance[]; + }; + 'federation/show-instance': { + req: { + host: string; + }; + res: Instance; + }; + 'federation/update-remote-user': { + req: { + userId: User['id']; + }; + res: null; + }; + 'federation/users': { + req: { + host: string; + limit?: number; + sinceId?: User['id']; + untilId?: User['id']; + }; + res: UserDetailed[]; + }; + 'following/create': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/delete': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/accept': { + req: { + userId: User['id']; + }; + res: null; + }; + 'following/requests/cancel': { + req: { + userId: User['id']; + }; + res: User; + }; + 'following/requests/list': { + req: NoParams; + res: FollowRequest[]; + }; + 'following/requests/reject': { + req: { + userId: User['id']; + }; + res: null; + }; + 'gallery/featured': { + req: TODO; + res: TODO; + }; + 'gallery/popular': { + req: TODO; + res: TODO; + }; + 'gallery/posts': { + req: TODO; + res: TODO; + }; + 'gallery/posts/create': { + req: TODO; + res: TODO; + }; + 'gallery/posts/delete': { + req: { + postId: GalleryPost['id']; + }; + res: null; + }; + 'gallery/posts/like': { + req: TODO; + res: TODO; + }; + 'gallery/posts/show': { + req: TODO; + res: TODO; + }; + 'gallery/posts/unlike': { + req: TODO; + res: TODO; + }; + 'gallery/posts/update': { + req: TODO; + res: TODO; + }; + 'games/reversi/games': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/show': { + req: TODO; + res: TODO; + }; + 'games/reversi/games/surrender': { + req: TODO; + res: TODO; + }; + 'games/reversi/invitations': { + req: TODO; + res: TODO; + }; + 'games/reversi/match': { + req: TODO; + res: TODO; + }; + 'games/reversi/match/cancel': { + req: TODO; + res: TODO; + }; + 'get-online-users-count': { + req: NoParams; + res: { + count: number; + }; + }; + 'hashtags/list': { + req: TODO; + res: TODO; + }; + 'hashtags/search': { + req: TODO; + res: TODO; + }; + 'hashtags/show': { + req: TODO; + res: TODO; + }; + 'hashtags/trend': { + req: TODO; + res: TODO; + }; + 'hashtags/users': { + req: TODO; + res: TODO; + }; + 'i': { + req: NoParams; + res: User; + }; + 'i/apps': { + req: TODO; + res: TODO; + }; + 'i/authorized-apps': { + req: TODO; + res: TODO; + }; + 'i/change-password': { + req: TODO; + res: TODO; + }; + 'i/delete-account': { + req: { + password: string; + }; + res: null; + }; + 'i/export-blocking': { + req: TODO; + res: TODO; + }; + 'i/export-following': { + req: TODO; + res: TODO; + }; + 'i/export-mute': { + req: TODO; + res: TODO; + }; + 'i/export-notes': { + req: TODO; + res: TODO; + }; + 'i/export-user-lists': { + req: TODO; + res: TODO; + }; + 'i/favorites': { + req: { + limit?: number; + sinceId?: NoteFavorite['id']; + untilId?: NoteFavorite['id']; + }; + res: NoteFavorite[]; + }; + 'i/gallery/likes': { + req: TODO; + res: TODO; + }; + 'i/gallery/posts': { + req: TODO; + res: TODO; + }; + 'i/get-word-muted-notes-count': { + req: TODO; + res: TODO; + }; + 'i/import-following': { + req: TODO; + res: TODO; + }; + 'i/import-user-lists': { + req: TODO; + res: TODO; + }; + 'i/notifications': { + req: { + limit?: number; + sinceId?: Notification_2['id']; + untilId?: Notification_2['id']; + following?: boolean; + markAsRead?: boolean; + includeTypes?: Notification_2['type'][]; + excludeTypes?: Notification_2['type'][]; + }; + res: Notification_2[]; + }; + 'i/page-likes': { + req: TODO; + res: TODO; + }; + 'i/pages': { + req: TODO; + res: TODO; + }; + 'i/pin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/read-all-messaging-messages': { + req: TODO; + res: TODO; + }; + 'i/read-all-unread-notes': { + req: TODO; + res: TODO; + }; + 'i/read-announcement': { + req: TODO; + res: TODO; + }; + 'i/regenerate-token': { + req: { + password: string; + }; + res: null; + }; + 'i/registry/get-all': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/get-detail': { + req: { + key: string; + scope?: string[]; + }; + res: { + updatedAt: DateString; + value: any; + }; + }; + 'i/registry/get': { + req: { + key: string; + scope?: string[]; + }; + res: any; + }; + 'i/registry/keys-with-type': { + req: { + scope?: string[]; + }; + res: Record; + }; + 'i/registry/keys': { + req: { + scope?: string[]; + }; + res: string[]; + }; + 'i/registry/remove': { + req: { + key: string; + scope?: string[]; + }; + res: null; + }; + 'i/registry/scopes': { + req: NoParams; + res: string[][]; + }; + 'i/registry/set': { + req: { + key: string; + value: any; + scope?: string[]; + }; + res: null; + }; + 'i/revoke-token': { + req: TODO; + res: TODO; + }; + 'i/signin-history': { + req: { + limit?: number; + sinceId?: Signin['id']; + untilId?: Signin['id']; + }; + res: Signin[]; + }; + 'i/unpin': { + req: { + noteId: Note['id']; + }; + res: MeDetailed; + }; + 'i/update-email': { + req: { + password: string; + email?: string | null; + }; + res: MeDetailed; + }; + 'i/update': { + req: { + name?: string | null; + description?: string | null; + lang?: string | null; + location?: string | null; + birthday?: string | null; + avatarId?: DriveFile['id'] | null; + bannerId?: DriveFile['id'] | null; + fields?: { + name: string; + value: string; + }[]; + isLocked?: boolean; + isExplorable?: boolean; + hideOnlineStatus?: boolean; + carefulBot?: boolean; + autoAcceptFollowed?: boolean; + noCrawle?: boolean; + isBot?: boolean; + isCat?: boolean; + injectFeaturedNote?: boolean; + receiveAnnouncementEmail?: boolean; + alwaysMarkNsfw?: boolean; + mutedWords?: string[][]; + mutingNotificationTypes?: Notification_2['type'][]; + emailNotificationTypes?: string[]; + }; + res: MeDetailed; + }; + 'i/user-group-invites': { + req: TODO; + res: TODO; + }; + 'i/2fa/done': { + req: TODO; + res: TODO; + }; + 'i/2fa/key-done': { + req: TODO; + res: TODO; + }; + 'i/2fa/password-less': { + req: TODO; + res: TODO; + }; + 'i/2fa/register-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/register': { + req: TODO; + res: TODO; + }; + 'i/2fa/remove-key': { + req: TODO; + res: TODO; + }; + 'i/2fa/unregister': { + req: TODO; + res: TODO; + }; + 'messaging/history': { + req: { + limit?: number; + group?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + limit?: number; + sinceId?: MessagingMessage['id']; + untilId?: MessagingMessage['id']; + markAsRead?: boolean; + }; + res: MessagingMessage[]; + }; + 'messaging/messages/create': { + req: { + userId?: User['id']; + groupId?: UserGroup['id']; + text?: string; + fileId?: DriveFile['id']; + }; + res: MessagingMessage; + }; + 'messaging/messages/delete': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'messaging/messages/read': { + req: { + messageId: MessagingMessage['id']; + }; + res: null; + }; + 'meta': { + req: { + detail?: boolean; + }; + res: { + $switch: { + $cases: [ + [ + { + detail: true; + }, + DetailedInstanceMetadata + ], + [ + { + detail: false; + }, + LiteInstanceMetadata + ], + [ + { + detail: boolean; + }, + LiteInstanceMetadata | DetailedInstanceMetadata + ] + ]; + $default: LiteInstanceMetadata; + }; + }; + }; + 'miauth/gen-token': { + req: TODO; + res: TODO; + }; + 'mute/create': { + req: TODO; + res: TODO; + }; + 'mute/delete': { + req: { + userId: User['id']; + }; + res: null; + }; + 'mute/list': { + req: TODO; + res: TODO; + }; + 'my/apps': { + req: TODO; + res: TODO; + }; + 'notes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/children': { + req: { + noteId: Note['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/clips': { + req: TODO; + res: TODO; + }; + 'notes/conversation': { + req: TODO; + res: TODO; + }; + 'notes/create': { + req: { + visibility?: 'public' | 'home' | 'followers' | 'specified'; + visibleUserIds?: User['id'][]; + text?: null | string; + cw?: null | string; + viaMobile?: boolean; + localOnly?: boolean; + fileIds?: DriveFile['id'][]; + replyId?: null | Note['id']; + renoteId?: null | Note['id']; + channelId?: null | Channel['id']; + poll?: null | { + choices: string[]; + multiple?: boolean; + expiresAt?: null | number; + expiredAfter?: null | number; + }; + }; + res: { + createdNote: Note; + }; + }; + 'notes/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/create': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/favorites/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/featured': { + req: TODO; + res: Note[]; + }; + 'notes/global-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/hybrid-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/local-timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/mentions': { + req: { + following?: boolean; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + }; + res: Note[]; + }; + 'notes/polls/recommendation': { + req: TODO; + res: TODO; + }; + 'notes/polls/vote': { + req: { + noteId: Note['id']; + choice: number; + }; + res: null; + }; + 'notes/reactions': { + req: { + noteId: Note['id']; + type?: string | null; + limit?: number; + }; + res: NoteReaction[]; + }; + 'notes/reactions/create': { + req: { + noteId: Note['id']; + reaction: string; + }; + res: null; + }; + 'notes/reactions/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/renotes': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/replies': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + noteId: Note['id']; + }; + res: Note[]; + }; + 'notes/search-by-tag': { + req: TODO; + res: TODO; + }; + 'notes/search': { + req: TODO; + res: TODO; + }; + 'notes/show': { + req: { + noteId: Note['id']; + }; + res: Note; + }; + 'notes/state': { + req: TODO; + res: TODO; + }; + 'notes/timeline': { + req: { + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/unrenote': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notes/user-list-timeline': { + req: { + listId: UserList['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'notes/watching/create': { + req: TODO; + res: TODO; + }; + 'notes/watching/delete': { + req: { + noteId: Note['id']; + }; + res: null; + }; + 'notifications/create': { + req: { + body: string; + header?: string | null; + icon?: string | null; + }; + res: null; + }; + 'notifications/mark-all-as-read': { + req: NoParams; + res: null; + }; + 'notifications/read': { + req: { + notificationId: Notification_2['id']; + }; + res: null; + }; + 'page-push': { + req: { + pageId: Page['id']; + event: string; + var?: any; + }; + res: null; + }; + 'pages/create': { + req: TODO; + res: Page; + }; + 'pages/delete': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/featured': { + req: NoParams; + res: Page[]; + }; + 'pages/like': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/show': { + req: { + pageId?: Page['id']; + name?: string; + username?: string; + }; + res: Page; + }; + 'pages/unlike': { + req: { + pageId: Page['id']; + }; + res: null; + }; + 'pages/update': { + req: TODO; + res: null; + }; + 'ping': { + req: NoParams; + res: { + pong: number; + }; + }; + 'pinned-users': { + req: TODO; + res: TODO; + }; + 'promo/read': { + req: TODO; + res: TODO; + }; + 'request-reset-password': { + req: { + username: string; + email: string; + }; + res: null; + }; + 'reset-password': { + req: { + token: string; + password: string; + }; + res: null; + }; + 'room/show': { + req: TODO; + res: TODO; + }; + 'room/update': { + req: TODO; + res: TODO; + }; + 'stats': { + req: NoParams; + res: Stats; + }; + 'server-info': { + req: NoParams; + res: ServerInfo; + }; + 'sw/register': { + req: TODO; + res: TODO; + }; + 'username/available': { + req: { + username: string; + }; + res: { + available: boolean; + }; + }; + 'users': { + req: { + limit?: number; + offset?: number; + sort?: UserSorting; + origin?: OriginType; + }; + res: User[]; + }; + 'users/clips': { + req: TODO; + res: TODO; + }; + 'users/followers': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFollowerPopulated[]; + }; + 'users/following': { + req: { + userId?: User['id']; + username?: User['username']; + host?: User['host'] | null; + limit?: number; + sinceId?: Following['id']; + untilId?: Following['id']; + }; + res: FollowingFolloweePopulated[]; + }; + 'users/gallery/posts': { + req: TODO; + res: TODO; + }; + 'users/get-frequently-replied-users': { + req: TODO; + res: TODO; + }; + 'users/groups/create': { + req: TODO; + res: TODO; + }; + 'users/groups/delete': { + req: { + groupId: UserGroup['id']; + }; + res: null; + }; + 'users/groups/invitations/accept': { + req: TODO; + res: TODO; + }; + 'users/groups/invitations/reject': { + req: TODO; + res: TODO; + }; + 'users/groups/invite': { + req: TODO; + res: TODO; + }; + 'users/groups/joined': { + req: TODO; + res: TODO; + }; + 'users/groups/owned': { + req: TODO; + res: TODO; + }; + 'users/groups/pull': { + req: TODO; + res: TODO; + }; + 'users/groups/show': { + req: TODO; + res: TODO; + }; + 'users/groups/transfer': { + req: TODO; + res: TODO; + }; + 'users/groups/update': { + req: TODO; + res: TODO; + }; + 'users/lists/create': { + req: { + name: string; + }; + res: UserList; + }; + 'users/lists/delete': { + req: { + listId: UserList['id']; + }; + res: null; + }; + 'users/lists/list': { + req: NoParams; + res: UserList[]; + }; + 'users/lists/pull': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/push': { + req: { + listId: UserList['id']; + userId: User['id']; + }; + res: null; + }; + 'users/lists/show': { + req: { + listId: UserList['id']; + }; + res: UserList; + }; + 'users/lists/update': { + req: { + listId: UserList['id']; + name: string; + }; + res: UserList; + }; + 'users/notes': { + req: { + userId: User['id']; + limit?: number; + sinceId?: Note['id']; + untilId?: Note['id']; + sinceDate?: number; + untilDate?: number; + }; + res: Note[]; + }; + 'users/pages': { + req: TODO; + res: TODO; + }; + 'users/recommendation': { + req: TODO; + res: TODO; + }; + 'users/relation': { + req: TODO; + res: TODO; + }; + 'users/report-abuse': { + req: TODO; + res: TODO; + }; + 'users/search-by-username-and-host': { + req: TODO; + res: TODO; + }; + 'users/search': { + req: TODO; + res: TODO; + }; + 'users/show': { + req: ShowUserReq | { + userIds: User['id'][]; + }; + res: { + $switch: { + $cases: [ + [ + { + userIds: User['id'][]; + }, + UserDetailed[] + ] + ]; + $default: UserDetailed; + }; + }; + }; + 'users/stats': { + req: TODO; + res: TODO; + }; +}; + +declare namespace entities { + export { + ID, + DateString, + User, + UserLite, + UserDetailed, + UserGroup, + UserList, + MeDetailed, + DriveFile, + DriveFolder, + GalleryPost, + Note, + NoteReaction, + Notification_2 as Notification, + MessagingMessage, + CustomEmoji, + LiteInstanceMetadata, + DetailedInstanceMetadata, + InstanceMetadata, + ServerInfo, + Stats, + Page, + PageEvent, + Announcement, + Antenna, + App, + AuthSession, + Ad, + Clip, + NoteFavorite, + FollowRequest, + Channel, + Following, + FollowingFolloweePopulated, + FollowingFollowerPopulated, + Blocking, + Instance, + Signin, + UserSorting, + OriginType + } +} +export { entities } + +// @public (undocumented) +type FetchLike = (input: string, init?: { + method?: string; + body?: string; + credentials?: RequestCredentials; + cache?: RequestCache; +}) => Promise<{ + status: number; + json(): Promise; +}>; + +// @public (undocumented) +type Following = { + id: ID; + createdAt: DateString; + followerId: User['id']; + followeeId: User['id']; +}; + +// @public (undocumented) +type FollowingFolloweePopulated = Following & { + followee: UserDetailed; +}; + +// @public (undocumented) +type FollowingFollowerPopulated = Following & { + follower: UserDetailed; +}; + +// @public (undocumented) +type FollowRequest = { + id: ID; + follower: User; + followee: User; +}; + +// @public (undocumented) +type GalleryPost = TODO_2; + +// @public (undocumented) +type ID = string; + +// @public (undocumented) +type Instance = { + id: ID; + caughtAt: DateString; + host: string; + usersCount: number; + notesCount: number; + followingCount: number; + followersCount: number; + driveUsage: number; + driveFiles: number; + latestRequestSentAt: DateString | null; + latestStatus: number | null; + latestRequestReceivedAt: DateString | null; + lastCommunicatedAt: DateString; + isNotResponding: boolean; + isSuspended: boolean; + softwareName: string | null; + softwareVersion: string | null; + openRegistrations: boolean | null; + name: string | null; + description: string | null; + maintainerName: string | null; + maintainerEmail: string | null; + iconUrl: string | null; + faviconUrl: string | null; + themeColor: string | null; + infoUpdatedAt: DateString | null; +}; + +// @public (undocumented) +type InstanceMetadata = LiteInstanceMetadata | DetailedInstanceMetadata; + +// @public (undocumented) +function isAPIError(reason: any): reason is APIError; + +// @public (undocumented) +type LiteInstanceMetadata = { + maintainerName: string | null; + maintainerEmail: string | null; + version: string; + name: string | null; + uri: string; + description: string | null; + tosUrl: string | null; + disableRegistration: boolean; + disableLocalTimeline: boolean; + disableGlobalTimeline: boolean; + driveCapacityPerLocalUserMb: number; + driveCapacityPerRemoteUserMb: number; + enableHcaptcha: boolean; + hcaptchaSiteKey: string | null; + enableRecaptcha: boolean; + recaptchaSiteKey: string | null; + swPublickey: string | null; + maxNoteTextLength: number; + enableEmail: boolean; + enableTwitterIntegration: boolean; + enableGithubIntegration: boolean; + enableDiscordIntegration: boolean; + enableServiceWorker: boolean; + emojis: CustomEmoji[]; + ads: { + id: ID; + ratio: number; + place: string; + url: string; + imageUrl: string; + }[]; +}; + +// @public (undocumented) +type MeDetailed = UserDetailed & { + avatarId: DriveFile['id']; + bannerId: DriveFile['id']; + autoAcceptFollowed: boolean; + noCrawle: boolean; + isExplorable: boolean; + hideOnlineStatus: boolean; + mutedWords: string[][]; + [other: string]: any; +}; + +// @public (undocumented) +type MessagingMessage = { + id: ID; + createdAt: DateString; + file: DriveFile | null; + fileId: DriveFile['id'] | null; + isRead: boolean; + reads: User['id'][]; + text: string | null; + user: User; + userId: User['id']; + groupId: string; +}; + +// @public (undocumented) +type Note = { + id: ID; + createdAt: DateString; + text: string | null; + cw: string | null; + user: User; + userId: User['id']; + reply?: Note; + replyId: Note['id']; + renote?: Note; + renoteId: Note['id']; + files: DriveFile[]; + fileIds: DriveFile['id'][]; + visibility: 'public' | 'home' | 'followers' | 'specified'; + myReaction?: string; + reactions: Record; + poll?: { + expiresAt: DateString | null; + multiple: boolean; + choices: { + isVoted: boolean; + text: string; + votes: number; + }[]; + }; + emojis: { + name: string; + url: string; + }[]; +}; + +// @public (undocumented) +type NoteFavorite = { + id: ID; + createdAt: DateString; + noteId: Note['id']; + note: Note; +}; + +// @public (undocumented) +type NoteReaction = { + id: ID; + createdAt: DateString; + user: UserLite; + type: string; +}; + +// @public (undocumented) +type Notification_2 = { + id: ID; + createdAt: DateString; + isRead: boolean; +} & ({ + type: 'reaction'; + reaction: string; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'reply'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'renote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'quote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'mention'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'pollVote'; + user: User; + userId: User['id']; + note: Note; +} | { + type: 'follow'; + user: User; + userId: User['id']; +} | { + type: 'followRequestAccepted'; + user: User; + userId: User['id']; +} | { + type: 'receiveFollowRequest'; + user: User; + userId: User['id']; +} | { + type: 'groupInvited'; +} | { + type: 'app'; + body: string; + icon: string; +}); + +// @public (undocumented) +type OriginType = 'combined' | 'local' | 'remote'; + +// @public (undocumented) +type Page = { + id: ID; + createdAt: DateString; + updatedAt: DateString; + userId: User['id']; + user: User; + content: Record[]; + variables: Record[]; + title: string; + name: string; + summary: string | null; + hideTitleWhenPinned: boolean; + alignCenter: boolean; + font: string; + script: string; + eyeCatchingImageId: DriveFile['id'] | null; + eyeCatchingImage: DriveFile | null; + attachedFiles: any; + likedCount: number; + isLiked?: boolean; +}; + +// @public (undocumented) +type PageEvent = { + pageId: Page['id']; + event: string; + var: any; + userId: User['id']; + user: User; +}; + +// @public (undocumented) +type ServerInfo = { + machine: string; + cpu: { + model: string; + cores: number; + }; + mem: { + total: number; + }; + fs: { + total: number; + used: number; + }; +}; + +// @public (undocumented) +type Signin = { + id: ID; + createdAt: DateString; + ip: string; + headers: Record; + success: boolean; +}; + +// @public (undocumented) +type Stats = { + notesCount: number; + originalNotesCount: number; + usersCount: number; + originalUsersCount: number; + instances: number; + driveUsageLocal: number; + driveUsageRemote: number; +}; + +// Warning: (ae-forgotten-export) The symbol "StreamEvents" needs to be exported by the entry point index.d.ts +// +// @public (undocumented) +export class Stream extends EventEmitter { + constructor(origin: string, user: { + token: string; + } | null, options?: { + WebSocket?: any; + }); + // (undocumented) + close(): void; + // Warning: (ae-forgotten-export) The symbol "NonSharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + disconnectToChannel(connection: NonSharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "SharedConnection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnection(connection: SharedConnection): void; + // Warning: (ae-forgotten-export) The symbol "Pool" needs to be exported by the entry point index.d.ts + // + // (undocumented) + removeSharedConnectionPool(pool: Pool): void; + // (undocumented) + send(typeOrPayload: any, payload?: any): void; + // (undocumented) + state: 'initializing' | 'reconnecting' | 'connected'; + // Warning: (ae-forgotten-export) The symbol "Channels" needs to be exported by the entry point index.d.ts + // Warning: (ae-forgotten-export) The symbol "Connection" needs to be exported by the entry point index.d.ts + // + // (undocumented) + useChannel(channel: C, params?: Channels[C]['params'], name?: string): Connection; +} + +// @public (undocumented) +type User = UserLite | UserDetailed; + +// @public (undocumented) +type UserDetailed = UserLite & { + isLocked: boolean; + pinnedNotes: Note[]; +}; + +// @public (undocumented) +type UserGroup = TODO_2; + +// @public (undocumented) +type UserList = { + id: ID; + createdAt: DateString; + name: string; + userIds: User['id'][]; +}; + +// @public (undocumented) +type UserLite = { + id: ID; + username: string; + host: string | null; + name: string; + onlineStatus: 'online' | 'active' | 'offline' | 'unknown'; + avatarUrl: string; + avatarBlurhash: string; + emojis: { + name: string; + url: string; + }[]; +}; + +// @public (undocumented) +type UserSorting = '+follower' | '-follower' | '+createdAt' | '-createdAt' | '+updatedAt' | '-updatedAt'; + +// Warnings were encountered during analysis: +// +// src/api.types.ts:16:32 - (ae-forgotten-export) The symbol "TODO" needs to be exported by the entry point index.d.ts +// src/api.types.ts:18:25 - (ae-forgotten-export) The symbol "NoParams" needs to be exported by the entry point index.d.ts +// src/api.types.ts:595:18 - (ae-forgotten-export) The symbol "ShowUserReq" needs to be exported by the entry point index.d.ts + +// (No @packageDocumentation comment for this package) + +``` diff --git a/package-lock.json b/package-lock.json index 73c5a18e6..c52174546 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,6 +13,7 @@ "reconnecting-websocket": "^4.4.0" }, "devDependencies": { + "@microsoft/api-extractor": "^7.18.4", "@types/jest": "^26.0.23", "@types/node": "16.0.0", "@typescript-eslint/eslint-plugin": "4.28.5", @@ -1155,6 +1156,98 @@ "node": ">= 10.14.2" } }, + "node_modules/@microsoft/api-extractor": { + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.18.4.tgz", + "integrity": "sha512-Wx45VuIAu09Pk9Qwzt0I57OX31BaWO2r6+mfSXqYFsJjYTqwUkdFh92G1GKYgvuR9oF/ai7w10wrFpx5WZYbGg==", + "dev": true, + "dependencies": { + "@microsoft/api-extractor-model": "7.13.4", + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.39.1", + "@rushstack/rig-package": "0.2.13", + "@rushstack/ts-command-line": "4.8.1", + "colors": "~1.2.1", + "lodash": "~4.17.15", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "source-map": "~0.6.1", + "typescript": "~4.3.5" + }, + "bin": { + "api-extractor": "bin/api-extractor" + } + }, + "node_modules/@microsoft/api-extractor-model": { + "version": "7.13.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.13.4.tgz", + "integrity": "sha512-NYaR3hJinh089/Gkee8fvmEFf9zKkoUvNxgkqUlKBCDXH2+Ou4tNDuL8G6zjhKBPicHkp2VcL8l7q9H6txUkjQ==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.39.1" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@microsoft/api-extractor/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "node_modules/@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "dependencies": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + } + }, + "node_modules/@microsoft/tsdoc-config/node_modules/resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "dependencies": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, "node_modules/@nodelib/fs.scandir": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", @@ -1190,6 +1283,90 @@ "node": ">= 8" } }, + "node_modules/@rushstack/node-core-library": { + "version": "3.39.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.39.1.tgz", + "integrity": "sha512-HHgMEHZTXQ3NjpQzWd5+fSt2Eod9yFwj6qBPbaeaNtDNkOL8wbLoxVimQNtcH0Qhn4wxF5u2NTDNFsxf2yd1jw==", + "dev": true, + "dependencies": { + "@types/node": "10.17.13", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~3.18.3" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/@types/node": { + "version": "10.17.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz", + "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==", + "dev": true + }, + "node_modules/@rushstack/node-core-library/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@rushstack/node-core-library/node_modules/semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "dependencies": { + "lru-cache": "^6.0.0" + }, + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@rushstack/rig-package": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.13.tgz", + "integrity": "sha512-qQMAFKvfb2ooaWU9DrGIK9d8QfyHy/HiuITJbWenlKgzcDXQvQgEduk57YF4Y7LLasDJ5ZzLaaXwlfX8qCRe5Q==", + "dev": true, + "dependencies": { + "resolve": "~1.17.0", + "strip-json-comments": "~3.1.1" + } + }, + "node_modules/@rushstack/rig-package/node_modules/resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "dependencies": { + "path-parse": "^1.0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/@rushstack/ts-command-line": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.8.1.tgz", + "integrity": "sha512-rmxvYdCNRbyRs+DYAPye3g6lkCkWHleqO40K8UPvUAzFqEuj6+YCVssBiOmrUDCoM5gaegSNT0wFDYhz24DWtw==", + "dev": true, + "dependencies": { + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "colors": "~1.2.1", + "string-argv": "~0.3.1" + } + }, "node_modules/@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -1251,6 +1428,12 @@ "tsserver": "typescript/bin/tsserver" } }, + "node_modules/@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true + }, "node_modules/@types/babel__core": { "version": "7.1.14", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", @@ -2110,6 +2293,15 @@ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "dev": true }, + "node_modules/colors": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "dev": true, + "engines": { + "node": ">=0.1.90" + } + }, "node_modules/combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -2122,6 +2314,13 @@ "node": ">= 0.8" } }, + "node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -3038,6 +3237,20 @@ "node": ">= 6" } }, + "node_modules/fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "dependencies": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + }, + "engines": { + "node": ">=6 <7 || >=8" + } + }, "node_modules/fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3318,6 +3531,15 @@ "node": ">=4" } }, + "node_modules/import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true, + "engines": { + "node": ">=8" + } + }, "node_modules/import-local": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", @@ -5165,6 +5387,12 @@ "url": "https://github.com/chalk/supports-color?sponsor=1" } }, + "node_modules/jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -5275,6 +5503,15 @@ "node": ">=6" } }, + "node_modules/jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, "node_modules/kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -5345,6 +5582,18 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "node_modules/lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "node_modules/lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, "node_modules/lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -6383,6 +6632,15 @@ "node": ">=10" } }, + "node_modules/string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true, + "engines": { + "node": ">=0.6.19" + } + }, "node_modules/string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -6576,6 +6834,12 @@ "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", "dev": true }, + "node_modules/timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, "node_modules/tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -6886,6 +7150,15 @@ "spdx-expression-parse": "^3.0.0" } }, + "node_modules/validator": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-8.2.0.tgz", + "integrity": "sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA==", + "dev": true, + "engines": { + "node": ">= 0.10" + } + }, "node_modules/w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -7096,6 +7369,23 @@ "engines": { "node": ">=6" } + }, + "node_modules/z-schema": { + "version": "3.18.4", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz", + "integrity": "sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw==", + "dev": true, + "dependencies": { + "lodash.get": "^4.0.0", + "lodash.isequal": "^4.0.0", + "validator": "^8.0.0" + }, + "bin": { + "z-schema": "bin/z-schema" + }, + "optionalDependencies": { + "commander": "^2.7.1" + } } }, "dependencies": { @@ -8002,6 +8292,87 @@ "chalk": "^4.0.0" } }, + "@microsoft/api-extractor": { + "version": "7.18.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.18.4.tgz", + "integrity": "sha512-Wx45VuIAu09Pk9Qwzt0I57OX31BaWO2r6+mfSXqYFsJjYTqwUkdFh92G1GKYgvuR9oF/ai7w10wrFpx5WZYbGg==", + "dev": true, + "requires": { + "@microsoft/api-extractor-model": "7.13.4", + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.39.1", + "@rushstack/rig-package": "0.2.13", + "@rushstack/ts-command-line": "4.8.1", + "colors": "~1.2.1", + "lodash": "~4.17.15", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "source-map": "~0.6.1", + "typescript": "~4.3.5" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@microsoft/api-extractor-model": { + "version": "7.13.4", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.13.4.tgz", + "integrity": "sha512-NYaR3hJinh089/Gkee8fvmEFf9zKkoUvNxgkqUlKBCDXH2+Ou4tNDuL8G6zjhKBPicHkp2VcL8l7q9H6txUkjQ==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "@microsoft/tsdoc-config": "~0.15.2", + "@rushstack/node-core-library": "3.39.1" + } + }, + "@microsoft/tsdoc": { + "version": "0.13.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.13.2.tgz", + "integrity": "sha512-WrHvO8PDL8wd8T2+zBGKrMwVL5IyzR3ryWUsl0PXgEV0QHup4mTLi0QcATefGI6Gx9Anu7vthPyyyLpY0EpiQg==", + "dev": true + }, + "@microsoft/tsdoc-config": { + "version": "0.15.2", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.15.2.tgz", + "integrity": "sha512-mK19b2wJHSdNf8znXSMYVShAHktVr/ib0Ck2FA3lsVBSEhSI/TfXT7DJQkAYgcztTuwazGcg58ZjYdk0hTCVrA==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.13.2", + "ajv": "~6.12.6", + "jju": "~1.4.0", + "resolve": "~1.19.0" + }, + "dependencies": { + "resolve": { + "version": "1.19.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.19.0.tgz", + "integrity": "sha512-rArEXAgsBG4UgRGcynxWIWKFvh/XZCcS8UJdHhwy91zwAvCZIbcs+vAbflgBnNjYMs/i/i+/Ux6IZhML1yPvxg==", + "dev": true, + "requires": { + "is-core-module": "^2.1.0", + "path-parse": "^1.0.6" + } + } + } + }, "@nodelib/fs.scandir": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.4.tgz", @@ -8028,6 +8399,82 @@ "fastq": "^1.6.0" } }, + "@rushstack/node-core-library": { + "version": "3.39.1", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.39.1.tgz", + "integrity": "sha512-HHgMEHZTXQ3NjpQzWd5+fSt2Eod9yFwj6qBPbaeaNtDNkOL8wbLoxVimQNtcH0Qhn4wxF5u2NTDNFsxf2yd1jw==", + "dev": true, + "requires": { + "@types/node": "10.17.13", + "colors": "~1.2.1", + "fs-extra": "~7.0.1", + "import-lazy": "~4.0.0", + "jju": "~1.4.0", + "resolve": "~1.17.0", + "semver": "~7.3.0", + "timsort": "~0.3.0", + "z-schema": "~3.18.3" + }, + "dependencies": { + "@types/node": { + "version": "10.17.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz", + "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==", + "dev": true + }, + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + }, + "semver": { + "version": "7.3.5", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.5.tgz", + "integrity": "sha512-PoeGJYh8HK4BTO/a9Tf6ZG3veo/A7ZVsYrSA6J8ny9nb3B1VrpkuN+z9OE5wfE5p6H4LchYZsegiQgbJD94ZFQ==", + "dev": true, + "requires": { + "lru-cache": "^6.0.0" + } + } + } + }, + "@rushstack/rig-package": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/@rushstack/rig-package/-/rig-package-0.2.13.tgz", + "integrity": "sha512-qQMAFKvfb2ooaWU9DrGIK9d8QfyHy/HiuITJbWenlKgzcDXQvQgEduk57YF4Y7LLasDJ5ZzLaaXwlfX8qCRe5Q==", + "dev": true, + "requires": { + "resolve": "~1.17.0", + "strip-json-comments": "~3.1.1" + }, + "dependencies": { + "resolve": { + "version": "1.17.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, + "@rushstack/ts-command-line": { + "version": "4.8.1", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.8.1.tgz", + "integrity": "sha512-rmxvYdCNRbyRs+DYAPye3g6lkCkWHleqO40K8UPvUAzFqEuj6+YCVssBiOmrUDCoM5gaegSNT0wFDYhz24DWtw==", + "dev": true, + "requires": { + "@types/argparse": "1.0.38", + "argparse": "~1.0.9", + "colors": "~1.2.1", + "string-argv": "~0.3.1" + } + }, "@sinonjs/commons": { "version": "1.8.3", "resolved": "https://registry.npmjs.org/@sinonjs/commons/-/commons-1.8.3.tgz", @@ -8082,6 +8529,12 @@ "integrity": "sha512-o5nx5an9JK+SUN/UiMmVwG3Eg+SsGrtdMtrw82bpZetMO2PkXBERgsf5KxsuPw3qm576z1R/SEUQRb1KaKGlOQ==", "dev": true }, + "@types/argparse": { + "version": "1.0.38", + "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", + "dev": true + }, "@types/babel__core": { "version": "7.1.14", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.14.tgz", @@ -8733,6 +9186,12 @@ "integrity": "sha512-MKGMzyfeuutC/ZJ1cba9NqcNpfeqMUcYmyF1ZFY6/Cn7CNSAKx6a+s48sqLqyAiZuaP2TcqMhoo+dlwFnVxT9w==", "dev": true }, + "colors": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", + "dev": true + }, "combined-stream": { "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", @@ -8742,6 +9201,13 @@ "delayed-stream": "~1.0.0" } }, + "commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", + "dev": true, + "optional": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -9443,6 +9909,17 @@ "mime-types": "^2.1.12" } }, + "fs-extra": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "jsonfile": "^4.0.0", + "universalify": "^0.1.0" + } + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -9646,6 +10123,12 @@ } } }, + "import-lazy": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", + "dev": true + }, "import-local": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", @@ -11140,6 +11623,12 @@ } } }, + "jju": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/jju/-/jju-1.4.0.tgz", + "integrity": "sha1-o6vicYryQaKykE+EpiWXDzia4yo=", + "dev": true + }, "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -11224,6 +11713,15 @@ "minimist": "^1.2.5" } }, + "jsonfile": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", + "integrity": "sha1-h3Gq4HmbZAdrdmQPygWPnBDjPss=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.6" + } + }, "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", @@ -11279,6 +11777,18 @@ "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", "dev": true }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.isequal": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz", + "integrity": "sha1-QVxEePK8wwEgwizhDtMib30+GOA=", + "dev": true + }, "lodash.merge": { "version": "4.6.2", "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", @@ -12050,6 +12560,12 @@ "escape-string-regexp": "^2.0.0" } }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-length": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/string-length/-/string-length-4.0.2.tgz", @@ -12199,6 +12715,12 @@ "integrity": "sha512-8hmiGIJMDlwjg7dlJ4yKGLK8EsYqKgPWbG3b4wjJddKNwc7N7Dpn08Df4szr/sZdMVeOstrdYSsqzX6BYbcB+w==", "dev": true }, + "timsort": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/timsort/-/timsort-0.3.0.tgz", + "integrity": "sha1-QFQRqOfmM5/mTbmiNN4R3DHgK9Q=", + "dev": true + }, "tmpl": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/tmpl/-/tmpl-1.0.4.tgz", @@ -12418,6 +12940,12 @@ "spdx-expression-parse": "^3.0.0" } }, + "validator": { + "version": "8.2.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-8.2.0.tgz", + "integrity": "sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA==", + "dev": true + }, "w3c-hr-time": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/w3c-hr-time/-/w3c-hr-time-1.0.2.tgz", @@ -12578,6 +13106,18 @@ "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true + }, + "z-schema": { + "version": "3.18.4", + "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz", + "integrity": "sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw==", + "dev": true, + "requires": { + "commander": "^2.7.1", + "lodash.get": "^4.0.0", + "lodash.isequal": "^4.0.0", + "validator": "^8.0.0" + } } } } diff --git a/package.json b/package.json index 157124c14..bcf582edf 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ "build": "npm run tsc", "tsc": "tsc", "tsd": "tsd", + "api": "npx api-extractor run --local --verbose", + "api-prod": "npx api-extractor run --verbose", "lint": "eslint . --ext .js,.jsx,.ts,.tsx", "jest": "jest --coverage --detectOpenHandles", "test": "npm run jest && npm run tsd" @@ -17,6 +19,7 @@ "url": "git+https://github.com/misskey-dev/misskey.js.git" }, "devDependencies": { + "@microsoft/api-extractor": "^7.18.4", "@types/jest": "^26.0.23", "@types/node": "16.0.0", "@typescript-eslint/eslint-plugin": "4.28.5", diff --git a/src/index.ts b/src/index.ts index 8370d786b..f90616b47 100644 --- a/src/index.ts +++ b/src/index.ts @@ -8,5 +8,9 @@ export { Acct }; -export * as api from './api'; -export * as entities from './entities'; +// api extractor not supported yet +//export * as api from './api'; +//export * as entities from './entities'; +import * as api from './api'; +import * as entities from './entities'; +export { api, entities }; diff --git a/tsconfig.json b/tsconfig.json index e01a2935f..a03a24262 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,8 +1,11 @@ { + "$schema": "http://json.schemastore.org/tsconfig", "compilerOptions": { "target": "es2020", "module": "commonjs", "declaration": true, + "declarationMap": true, + "sourceMap": true, "outDir": "./built/", "removeComments": true, "strict": true, @@ -10,13 +13,13 @@ "strictNullChecks": true, "experimentalDecorators": true, "noImplicitReturns": true, - "esModuleInterop": true, + "esModuleInterop": true }, "include": [ - "src/**/*", + "src/**/*" ], "exclude": [ "node_modules", - "test/**/*", + "test/**/*" ] }