From 43d9149c8a79b39c89495f3a110e2f3d99293c5b Mon Sep 17 00:00:00 2001 From: syuilo Date: Thu, 11 Nov 2021 22:49:16 +0900 Subject: [PATCH] add consts --- CHANGELOG.md | 3 +++ etc/misskey-js.api.md | 12 ++++++++++++ src/{permissions.ts => consts.ts} | 8 ++++++++ src/index.ts | 9 +++++++-- 4 files changed, 30 insertions(+), 2 deletions(-) rename src/{permissions.ts => consts.ts} (59%) diff --git a/CHANGELOG.md b/CHANGELOG.md index 1c8fe7687..013332ee9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +# 0.0.10 +- add consts + # 0.0.9 - add list of api permission - Update Note type diff --git a/etc/misskey-js.api.md b/etc/misskey-js.api.md index 79a27d12c..72b9dcf92 100644 --- a/etc/misskey-js.api.md +++ b/etc/misskey-js.api.md @@ -2046,6 +2046,9 @@ type FetchLike = (input: string, init?: { json(): Promise; }>; +// @public (undocumented) +export const ffVisibility: readonly ["public", "followers", "private"]; + // @public (undocumented) type Following = { id: ID; @@ -2177,6 +2180,9 @@ type MessagingMessage = { groupId: UserGroup['id'] | null; }; +// @public (undocumented) +export const mutedNoteReasons: readonly ["word", "manual", "spam", "other"]; + // @public (undocumented) type Note = { id: ID; @@ -2232,6 +2238,9 @@ type NoteReaction = { type: string; }; +// @public (undocumented) +export const noteVisibilities: readonly ["public", "home", "followers", "specified"]; + // @public (undocumented) type Notification_2 = { id: ID; @@ -2292,6 +2301,9 @@ type Notification_2 = { icon?: string | null; }); +// @public (undocumented) +export const notificationTypes: readonly ["follow", "mention", "reply", "renote", "quote", "reaction", "pollVote", "receiveFollowRequest", "followRequestAccepted", "groupInvited", "app"]; + // @public (undocumented) type OriginType = 'combined' | 'local' | 'remote'; diff --git a/src/permissions.ts b/src/consts.ts similarity index 59% rename from src/permissions.ts rename to src/consts.ts index c7e4b9e5d..ac2053b17 100644 --- a/src/permissions.ts +++ b/src/consts.ts @@ -1,3 +1,11 @@ +export const notificationTypes = ['follow', 'mention', 'reply', 'renote', 'quote', 'reaction', 'pollVote', 'receiveFollowRequest', 'followRequestAccepted', 'groupInvited', 'app'] as const; + +export const noteVisibilities = ['public', 'home', 'followers', 'specified'] as const; + +export const mutedNoteReasons = ['word', 'manual', 'spam', 'other'] as const; + +export const ffVisibility = ['public', 'followers', 'private'] as const; + export const permissions = [ 'read:account', 'write:account', diff --git a/src/index.ts b/src/index.ts index 13f232313..60748ebe0 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,15 +1,20 @@ import { Endpoints } from './api.types'; import Stream from './streaming'; import { Acct } from './acct'; -import { permissions } from './permissions'; +import * as consts from './consts'; export { Endpoints, Stream, Acct, - permissions, }; +export const permissions = consts.permissions; +export const notificationTypes = consts.notificationTypes; +export const noteVisibilities = consts.noteVisibilities; +export const mutedNoteReasons = consts.mutedNoteReasons; +export const ffVisibility = consts.ffVisibility; + // api extractor not supported yet //export * as api from './api'; //export * as entities from './entities';