mixi2-js 1.4.1 → 1.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -4
- package/dist/{client-DK9LqeiF.d.cts → event-CgwQm1Mk.d.cts} +148 -26
- package/dist/{client-GWUs7tD3.d.mts → event-LyIxrXkO.d.mts} +148 -26
- package/dist/helpers/index.cjs +212 -5
- package/dist/helpers/index.d.cts +135 -2
- package/dist/helpers/index.d.mts +135 -2
- package/dist/helpers/index.mjs +208 -6
- package/dist/index.cjs +109 -13
- package/dist/index.d.cts +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +102 -9
- package/dist/{types-BrJ83qtL.mjs → types-DxrdxgSg.mjs} +35 -1
- package/dist/{types-D9t_NdQ0.cjs → types-cAD9ShMV.cjs} +52 -0
- package/package.json +21 -16
- package/proto/social/mixi/application/const/v1/application_requirement.proto +18 -0
- package/proto/social/mixi/application/const/v1/community_access_level.proto +9 -0
- package/proto/social/mixi/application/const/v1/community_visibility.proto +9 -0
- package/proto/social/mixi/application/const/v1/event_type.proto +7 -0
- package/proto/social/mixi/application/model/v1/application.proto +11 -0
- package/proto/social/mixi/application/model/v1/community.proto +20 -0
- package/proto/social/mixi/application/model/v1/event.proto +15 -0
- package/proto/social/mixi/application/model/v1/post.proto +1 -0
- package/proto/social/mixi/application/model/v1/stamp.proto +11 -0
- package/proto/social/mixi/application/service/application_api/v1/service.proto +178 -0
package/README.md
CHANGED
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
[](https://jsr.io/@otoneko1102/mixi2-js)
|
|
15
15
|
[](LICENSE)
|
|
16
16
|
[](package.json)
|
|
17
|
-
[](https://github.com/
|
|
17
|
+
[](https://www.typescriptlang.org/)
|
|
18
|
+
[](https://github.com/otnc/mixi2-js/actions)
|
|
19
19
|
[](vite.config.ts)
|
|
20
20
|
|
|
21
21
|
<div align="center">
|
|
@@ -28,13 +28,18 @@ mixi2 の [Application API](https://developer.mixi.social/docs) を利用する
|
|
|
28
28
|
|
|
29
29
|
[公式 Go SDK](https://github.com/mixigroup/mixi2-application-sdk-go) および [公式 API 仕様](https://github.com/mixigroup/mixi2-api) に基づいて作成されています。
|
|
30
30
|
|
|
31
|
-
> [!Note]
|
|
31
|
+
> [!Note]
|
|
32
|
+
>
|
|
32
33
|
> **これは MIXI 社公式のプロダクトではありません。コミュニティメンバーによるオープンソースプロジェクトです。**
|
|
33
34
|
|
|
34
35
|
---
|
|
35
36
|
|
|
36
37
|
## インストール
|
|
37
38
|
|
|
39
|
+
> [!Warning]
|
|
40
|
+
>
|
|
41
|
+
> **mixi2-js v1.5.0 より、Node.js v20.19.0 未満はサポートされなくなりました。** Node.js v18 系では動作しません。Node.js v20.19.0 以上をご使用ください。
|
|
42
|
+
|
|
38
43
|
```bash
|
|
39
44
|
npm install mixi2-js
|
|
40
45
|
|
|
@@ -97,7 +102,7 @@ ESM・CommonJS の両方に対応しています。TypeScript の型定義 (`.d.
|
|
|
97
102
|
|
|
98
103
|
### 貢献者
|
|
99
104
|
|
|
100
|
-
<a href="https://github.com/
|
|
105
|
+
<a href="https://github.com/otnc/mixi2-js/graphs/contributors">
|
|
101
106
|
<img src="https://contrib.rocks/image?repo=otoneko1102/mixi2-js" alt="Made with contrib.rocks" />
|
|
102
107
|
</a>
|
|
103
108
|
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
//#region src/auth.d.ts
|
|
2
|
+
interface Authenticator {
|
|
3
|
+
getAccessToken(): Promise<string>;
|
|
4
|
+
}
|
|
5
|
+
interface AuthenticatorOptions {
|
|
6
|
+
clientId: string;
|
|
7
|
+
clientSecret: string;
|
|
8
|
+
tokenUrl: string;
|
|
9
|
+
}
|
|
10
|
+
declare class OAuth2Authenticator implements Authenticator {
|
|
11
|
+
private readonly clientId;
|
|
12
|
+
private readonly clientSecret;
|
|
13
|
+
private readonly tokenUrl;
|
|
14
|
+
private accessToken;
|
|
15
|
+
private expiresAt;
|
|
16
|
+
private refreshPromise;
|
|
17
|
+
constructor(options: AuthenticatorOptions);
|
|
18
|
+
getAccessToken(): Promise<string>;
|
|
19
|
+
private refreshToken;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
1
22
|
//#region src/types.d.ts
|
|
2
23
|
declare enum EventType {
|
|
3
24
|
UNSPECIFIED = 0,
|
|
4
25
|
PING = 1,
|
|
5
26
|
POST_CREATED = 2,
|
|
6
|
-
|
|
27
|
+
COMMUNITY_MEMBER_CHANGED = 3,
|
|
28
|
+
CHAT_MESSAGE_RECEIVED = 4,
|
|
29
|
+
COMMUNITY_PLUGIN_MANAGED = 5
|
|
7
30
|
}
|
|
8
31
|
declare enum EventReason {
|
|
9
32
|
UNSPECIFIED = 0,
|
|
@@ -11,7 +34,12 @@ declare enum EventReason {
|
|
|
11
34
|
POST_REPLY = 2,
|
|
12
35
|
POST_MENTIONED = 3,
|
|
13
36
|
POST_QUOTED = 4,
|
|
14
|
-
|
|
37
|
+
POST_COMMUNITY = 5,
|
|
38
|
+
COMMUNITY_MEMBER_JOINED = 6,
|
|
39
|
+
COMMUNITY_MEMBER_LEFT = 7,
|
|
40
|
+
DIRECT_MESSAGE_RECEIVED = 8,
|
|
41
|
+
COMMUNITY_PLUGIN_INSTALLED = 9,
|
|
42
|
+
COMMUNITY_PLUGIN_UNINSTALLED = 10
|
|
15
43
|
}
|
|
16
44
|
declare enum MediaType {
|
|
17
45
|
UNSPECIFIED = 0,
|
|
@@ -74,6 +102,30 @@ declare enum MediaUploadStatus {
|
|
|
74
102
|
COMPLETED = 3,
|
|
75
103
|
FAILED = 4
|
|
76
104
|
}
|
|
105
|
+
declare enum CommunityVisibility {
|
|
106
|
+
UNSPECIFIED = 0,
|
|
107
|
+
VISIBLE = 1,
|
|
108
|
+
INVISIBLE = 2
|
|
109
|
+
}
|
|
110
|
+
declare enum CommunityAccessLevel {
|
|
111
|
+
UNSPECIFIED = 0,
|
|
112
|
+
PUBLIC = 1,
|
|
113
|
+
APPROVAL_REQUIRED = 2
|
|
114
|
+
}
|
|
115
|
+
declare enum ApplicationRequirement {
|
|
116
|
+
UNSPECIFIED = 0,
|
|
117
|
+
PERMISSION_COMMUNITY_POST_READ = 1,
|
|
118
|
+
PERMISSION_COMMUNITY_POST_CREATE = 2,
|
|
119
|
+
PERMISSION_COMMUNITY_POST_RESTRICT = 3,
|
|
120
|
+
PERMISSION_COMMUNITY_MEMBER_LIST_READ = 4,
|
|
121
|
+
EVENT_REACTION_REPLY = 5,
|
|
122
|
+
EVENT_REACTION_MENTION = 6,
|
|
123
|
+
EVENT_COMMUNITY_POST_CREATED = 7,
|
|
124
|
+
EVENT_COMMUNITY_MEMBER_JOINED = 8,
|
|
125
|
+
EVENT_DIRECT_MESSAGE_RECEIVED = 9,
|
|
126
|
+
PERMISSION_COMMUNITY_POST_STAMP_CREATE = 10,
|
|
127
|
+
PERMISSION_COMMUNITY_MEMBER_DIRECT_MESSAGE_CREATE = 11
|
|
128
|
+
}
|
|
77
129
|
interface UserAvatar {
|
|
78
130
|
largeImageUrl: string;
|
|
79
131
|
largeImageMimeType: string;
|
|
@@ -169,6 +221,7 @@ interface Post {
|
|
|
169
221
|
postMediaList: PostMedia[];
|
|
170
222
|
inReplyToPostId?: string;
|
|
171
223
|
postMask?: PostMask;
|
|
224
|
+
communityId?: string;
|
|
172
225
|
visibility: PostVisibility;
|
|
173
226
|
accessLevel: PostAccessLevel;
|
|
174
227
|
stamps: PostStamp[];
|
|
@@ -198,28 +251,67 @@ interface OfficialStampSet {
|
|
|
198
251
|
endAt?: Date;
|
|
199
252
|
stampSetType: StampSetType;
|
|
200
253
|
}
|
|
254
|
+
interface CommunityStamp {
|
|
255
|
+
stampId: string;
|
|
256
|
+
url: string;
|
|
257
|
+
searchTags: string[];
|
|
258
|
+
}
|
|
259
|
+
interface CommunityStampSet {
|
|
260
|
+
communityId: string;
|
|
261
|
+
stamps: CommunityStamp[];
|
|
262
|
+
}
|
|
263
|
+
interface Community {
|
|
264
|
+
communityId: string;
|
|
265
|
+
name: string;
|
|
266
|
+
purpose: string;
|
|
267
|
+
isArchived: boolean;
|
|
268
|
+
visibility: CommunityVisibility;
|
|
269
|
+
accessLevel: CommunityAccessLevel;
|
|
270
|
+
}
|
|
271
|
+
interface CommunityUsingApplication {
|
|
272
|
+
community: Community | null;
|
|
273
|
+
applicationVersionId: string;
|
|
274
|
+
}
|
|
275
|
+
interface ApplicationVersion {
|
|
276
|
+
applicationVersionId: string;
|
|
277
|
+
applicationId: string;
|
|
278
|
+
requirements: ApplicationRequirement[];
|
|
279
|
+
}
|
|
201
280
|
interface PingEvent {}
|
|
202
281
|
interface PostCreatedEvent {
|
|
203
282
|
eventReasonList: EventReason[];
|
|
204
283
|
post: Post | null;
|
|
205
284
|
issuer: User | null;
|
|
285
|
+
postedCommunity?: Community | null;
|
|
286
|
+
}
|
|
287
|
+
interface CommunityMemberChangedEvent {
|
|
288
|
+
eventReasonList: EventReason[];
|
|
289
|
+
member: User | null;
|
|
290
|
+
community: Community | null;
|
|
206
291
|
}
|
|
207
292
|
interface ChatMessageReceivedEvent {
|
|
208
293
|
eventReasonList: EventReason[];
|
|
209
294
|
message: ChatMessage | null;
|
|
210
295
|
issuer: User | null;
|
|
211
296
|
}
|
|
297
|
+
interface CommunityPluginManagedEvent {
|
|
298
|
+
eventReasonList: EventReason[];
|
|
299
|
+
community: Community | null;
|
|
300
|
+
}
|
|
212
301
|
interface Event {
|
|
213
302
|
eventId: string;
|
|
214
303
|
eventType: EventType;
|
|
215
304
|
pingEvent?: PingEvent;
|
|
216
305
|
postCreatedEvent?: PostCreatedEvent;
|
|
306
|
+
communityMemberChangedEvent?: CommunityMemberChangedEvent;
|
|
217
307
|
chatMessageReceivedEvent?: ChatMessageReceivedEvent;
|
|
308
|
+
communityPluginManagedEvent?: CommunityPluginManagedEvent;
|
|
218
309
|
}
|
|
219
310
|
interface CreatePostRequest {
|
|
220
311
|
text: string;
|
|
221
312
|
inReplyToPostId?: string;
|
|
222
313
|
quotedPostId?: string;
|
|
314
|
+
communityId?: string;
|
|
223
315
|
mediaIdList?: string[];
|
|
224
316
|
postMask?: PostMask;
|
|
225
317
|
publishingType?: PostPublishingType;
|
|
@@ -248,33 +340,52 @@ type SendChatMessageRequest = {
|
|
|
248
340
|
};
|
|
249
341
|
interface GetStampsRequest {
|
|
250
342
|
officialStampLanguage?: LanguageCode;
|
|
343
|
+
communityIds?: string[];
|
|
251
344
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
handle(event: Event): void | Promise<void>;
|
|
345
|
+
interface GetStampsResponse {
|
|
346
|
+
officialStampSets: OfficialStampSet[];
|
|
347
|
+
communityStampSets: CommunityStampSet[];
|
|
256
348
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
interface Authenticator {
|
|
260
|
-
getAccessToken(): Promise<string>;
|
|
349
|
+
interface GetCommunitiesRequest {
|
|
350
|
+
communityIdList: string[];
|
|
261
351
|
}
|
|
262
|
-
interface
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
352
|
+
interface GetCommunityTimelineRequest {
|
|
353
|
+
communityId: string;
|
|
354
|
+
untilCursor?: string;
|
|
355
|
+
sinceCursor?: string;
|
|
266
356
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
constructor(options: AuthenticatorOptions);
|
|
275
|
-
getAccessToken(): Promise<string>;
|
|
276
|
-
private refreshToken;
|
|
357
|
+
interface GetCommunityMemberListRequest {
|
|
358
|
+
communityId: string;
|
|
359
|
+
paginationCursor?: string;
|
|
360
|
+
}
|
|
361
|
+
interface GetCommunityMemberListResponse {
|
|
362
|
+
members: User[];
|
|
363
|
+
nextPaginationCursor?: string;
|
|
277
364
|
}
|
|
365
|
+
interface RestrictCommunityPostRequest {
|
|
366
|
+
postId: string;
|
|
367
|
+
}
|
|
368
|
+
interface GetCommunitiesUsingApplicationRequest {
|
|
369
|
+
cursor?: string;
|
|
370
|
+
}
|
|
371
|
+
interface GetCommunitiesUsingApplicationResponse {
|
|
372
|
+
communitiesUsingApplication: CommunityUsingApplication[];
|
|
373
|
+
applicationVersions: ApplicationVersion[];
|
|
374
|
+
nextCursor?: string;
|
|
375
|
+
}
|
|
376
|
+
type SendDirectMessageToCommunityMemberRequest = {
|
|
377
|
+
receiverId: string;
|
|
378
|
+
communityId: string;
|
|
379
|
+
text: string;
|
|
380
|
+
mediaIds?: string[];
|
|
381
|
+
postId?: string;
|
|
382
|
+
} | {
|
|
383
|
+
receiverId: string;
|
|
384
|
+
communityId: string;
|
|
385
|
+
text?: string;
|
|
386
|
+
mediaIds: string[];
|
|
387
|
+
postId?: string;
|
|
388
|
+
};
|
|
278
389
|
//#endregion
|
|
279
390
|
//#region src/client.d.ts
|
|
280
391
|
interface ClientOptions {
|
|
@@ -292,14 +403,25 @@ declare class Client {
|
|
|
292
403
|
private call;
|
|
293
404
|
getUsers(userIdList: string[]): Promise<User[]>;
|
|
294
405
|
getPosts(postIdList: string[]): Promise<Post[]>;
|
|
406
|
+
getCommunities(communityIdList: string[]): Promise<Community[]>;
|
|
295
407
|
createPost(request: CreatePostRequest): Promise<Post>;
|
|
296
408
|
deletePost(postId: string): Promise<boolean>;
|
|
297
409
|
initiatePostMediaUpload(request: InitiatePostMediaUploadRequest): Promise<InitiatePostMediaUploadResponse>;
|
|
298
410
|
getPostMediaStatus(mediaId: string): Promise<GetPostMediaStatusResponse>;
|
|
299
411
|
sendChatMessage(request: SendChatMessageRequest): Promise<ChatMessage>;
|
|
300
|
-
|
|
412
|
+
getCommunityTimeline(request: GetCommunityTimelineRequest): Promise<Post[]>;
|
|
413
|
+
getCommunityMemberList(request: GetCommunityMemberListRequest): Promise<GetCommunityMemberListResponse>;
|
|
414
|
+
restrictCommunityPost(request: RestrictCommunityPostRequest): Promise<void>;
|
|
415
|
+
getCommunitiesUsingApplication(request?: GetCommunitiesUsingApplicationRequest): Promise<GetCommunitiesUsingApplicationResponse>;
|
|
416
|
+
getStamps(request?: GetStampsRequest): Promise<GetStampsResponse>;
|
|
417
|
+
sendDirectMessageToCommunityMember(request: SendDirectMessageToCommunityMemberRequest): Promise<ChatMessage>;
|
|
301
418
|
addStampToPost(postId: string, stampId: string): Promise<Post>;
|
|
302
419
|
close(): void;
|
|
303
420
|
}
|
|
304
421
|
//#endregion
|
|
305
|
-
|
|
422
|
+
//#region src/event.d.ts
|
|
423
|
+
interface EventHandler {
|
|
424
|
+
handle(event: Event): void | Promise<void>;
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
export { PostVisibility as $, InitiatePostMediaUploadResponse as A, OfficialStampSet as B, GetCommunityMemberListRequest as C, GetStampsRequest as D, GetPostMediaStatusResponse as E, MediaType as F, PostMask as G, Post as H, MediaUploadStatus as I, PostMediaImage as J, PostMaskType as K, MediaUploadType as L, Media as M, MediaImage as N, GetStampsResponse as O, MediaStamp as P, PostStamp as Q, MediaVideo as R, GetCommunitiesUsingApplicationResponse as S, GetCommunityTimelineRequest as T, PostAccessLevel as U, PingEvent as V, PostCreatedEvent as W, PostMediaVideo as X, PostMediaType as Y, PostPublishingType as Z, Event as _, ApplicationVersion as a, UserAccessLevel as at, GetCommunitiesRequest as b, Community as c, Authenticator as ct, CommunityPluginManagedEvent as d, RestrictCommunityPostRequest as et, CommunityStamp as f, CreatePostRequest as g, CommunityVisibility as h, ApplicationRequirement as i, User as it, LanguageCode as j, InitiatePostMediaUploadRequest as k, CommunityAccessLevel as l, AuthenticatorOptions as lt, CommunityUsingApplication as m, Client as n, SendDirectMessageToCommunityMemberRequest as nt, ChatMessage as o, UserAvatar as ot, CommunityStampSet as p, PostMedia as q, ClientOptions as r, StampSetType as rt, ChatMessageReceivedEvent as s, UserVisibility as st, EventHandler as t, SendChatMessageRequest as tt, CommunityMemberChangedEvent as u, OAuth2Authenticator as ut, EventReason as v, GetCommunityMemberListResponse as w, GetCommunitiesUsingApplicationRequest as x, EventType as y, OfficialStamp as z };
|
|
@@ -1,9 +1,32 @@
|
|
|
1
|
+
//#region src/auth.d.ts
|
|
2
|
+
interface Authenticator {
|
|
3
|
+
getAccessToken(): Promise<string>;
|
|
4
|
+
}
|
|
5
|
+
interface AuthenticatorOptions {
|
|
6
|
+
clientId: string;
|
|
7
|
+
clientSecret: string;
|
|
8
|
+
tokenUrl: string;
|
|
9
|
+
}
|
|
10
|
+
declare class OAuth2Authenticator implements Authenticator {
|
|
11
|
+
private readonly clientId;
|
|
12
|
+
private readonly clientSecret;
|
|
13
|
+
private readonly tokenUrl;
|
|
14
|
+
private accessToken;
|
|
15
|
+
private expiresAt;
|
|
16
|
+
private refreshPromise;
|
|
17
|
+
constructor(options: AuthenticatorOptions);
|
|
18
|
+
getAccessToken(): Promise<string>;
|
|
19
|
+
private refreshToken;
|
|
20
|
+
}
|
|
21
|
+
//#endregion
|
|
1
22
|
//#region src/types.d.ts
|
|
2
23
|
declare enum EventType {
|
|
3
24
|
UNSPECIFIED = 0,
|
|
4
25
|
PING = 1,
|
|
5
26
|
POST_CREATED = 2,
|
|
6
|
-
|
|
27
|
+
COMMUNITY_MEMBER_CHANGED = 3,
|
|
28
|
+
CHAT_MESSAGE_RECEIVED = 4,
|
|
29
|
+
COMMUNITY_PLUGIN_MANAGED = 5
|
|
7
30
|
}
|
|
8
31
|
declare enum EventReason {
|
|
9
32
|
UNSPECIFIED = 0,
|
|
@@ -11,7 +34,12 @@ declare enum EventReason {
|
|
|
11
34
|
POST_REPLY = 2,
|
|
12
35
|
POST_MENTIONED = 3,
|
|
13
36
|
POST_QUOTED = 4,
|
|
14
|
-
|
|
37
|
+
POST_COMMUNITY = 5,
|
|
38
|
+
COMMUNITY_MEMBER_JOINED = 6,
|
|
39
|
+
COMMUNITY_MEMBER_LEFT = 7,
|
|
40
|
+
DIRECT_MESSAGE_RECEIVED = 8,
|
|
41
|
+
COMMUNITY_PLUGIN_INSTALLED = 9,
|
|
42
|
+
COMMUNITY_PLUGIN_UNINSTALLED = 10
|
|
15
43
|
}
|
|
16
44
|
declare enum MediaType {
|
|
17
45
|
UNSPECIFIED = 0,
|
|
@@ -74,6 +102,30 @@ declare enum MediaUploadStatus {
|
|
|
74
102
|
COMPLETED = 3,
|
|
75
103
|
FAILED = 4
|
|
76
104
|
}
|
|
105
|
+
declare enum CommunityVisibility {
|
|
106
|
+
UNSPECIFIED = 0,
|
|
107
|
+
VISIBLE = 1,
|
|
108
|
+
INVISIBLE = 2
|
|
109
|
+
}
|
|
110
|
+
declare enum CommunityAccessLevel {
|
|
111
|
+
UNSPECIFIED = 0,
|
|
112
|
+
PUBLIC = 1,
|
|
113
|
+
APPROVAL_REQUIRED = 2
|
|
114
|
+
}
|
|
115
|
+
declare enum ApplicationRequirement {
|
|
116
|
+
UNSPECIFIED = 0,
|
|
117
|
+
PERMISSION_COMMUNITY_POST_READ = 1,
|
|
118
|
+
PERMISSION_COMMUNITY_POST_CREATE = 2,
|
|
119
|
+
PERMISSION_COMMUNITY_POST_RESTRICT = 3,
|
|
120
|
+
PERMISSION_COMMUNITY_MEMBER_LIST_READ = 4,
|
|
121
|
+
EVENT_REACTION_REPLY = 5,
|
|
122
|
+
EVENT_REACTION_MENTION = 6,
|
|
123
|
+
EVENT_COMMUNITY_POST_CREATED = 7,
|
|
124
|
+
EVENT_COMMUNITY_MEMBER_JOINED = 8,
|
|
125
|
+
EVENT_DIRECT_MESSAGE_RECEIVED = 9,
|
|
126
|
+
PERMISSION_COMMUNITY_POST_STAMP_CREATE = 10,
|
|
127
|
+
PERMISSION_COMMUNITY_MEMBER_DIRECT_MESSAGE_CREATE = 11
|
|
128
|
+
}
|
|
77
129
|
interface UserAvatar {
|
|
78
130
|
largeImageUrl: string;
|
|
79
131
|
largeImageMimeType: string;
|
|
@@ -169,6 +221,7 @@ interface Post {
|
|
|
169
221
|
postMediaList: PostMedia[];
|
|
170
222
|
inReplyToPostId?: string;
|
|
171
223
|
postMask?: PostMask;
|
|
224
|
+
communityId?: string;
|
|
172
225
|
visibility: PostVisibility;
|
|
173
226
|
accessLevel: PostAccessLevel;
|
|
174
227
|
stamps: PostStamp[];
|
|
@@ -198,28 +251,67 @@ interface OfficialStampSet {
|
|
|
198
251
|
endAt?: Date;
|
|
199
252
|
stampSetType: StampSetType;
|
|
200
253
|
}
|
|
254
|
+
interface CommunityStamp {
|
|
255
|
+
stampId: string;
|
|
256
|
+
url: string;
|
|
257
|
+
searchTags: string[];
|
|
258
|
+
}
|
|
259
|
+
interface CommunityStampSet {
|
|
260
|
+
communityId: string;
|
|
261
|
+
stamps: CommunityStamp[];
|
|
262
|
+
}
|
|
263
|
+
interface Community {
|
|
264
|
+
communityId: string;
|
|
265
|
+
name: string;
|
|
266
|
+
purpose: string;
|
|
267
|
+
isArchived: boolean;
|
|
268
|
+
visibility: CommunityVisibility;
|
|
269
|
+
accessLevel: CommunityAccessLevel;
|
|
270
|
+
}
|
|
271
|
+
interface CommunityUsingApplication {
|
|
272
|
+
community: Community | null;
|
|
273
|
+
applicationVersionId: string;
|
|
274
|
+
}
|
|
275
|
+
interface ApplicationVersion {
|
|
276
|
+
applicationVersionId: string;
|
|
277
|
+
applicationId: string;
|
|
278
|
+
requirements: ApplicationRequirement[];
|
|
279
|
+
}
|
|
201
280
|
interface PingEvent {}
|
|
202
281
|
interface PostCreatedEvent {
|
|
203
282
|
eventReasonList: EventReason[];
|
|
204
283
|
post: Post | null;
|
|
205
284
|
issuer: User | null;
|
|
285
|
+
postedCommunity?: Community | null;
|
|
286
|
+
}
|
|
287
|
+
interface CommunityMemberChangedEvent {
|
|
288
|
+
eventReasonList: EventReason[];
|
|
289
|
+
member: User | null;
|
|
290
|
+
community: Community | null;
|
|
206
291
|
}
|
|
207
292
|
interface ChatMessageReceivedEvent {
|
|
208
293
|
eventReasonList: EventReason[];
|
|
209
294
|
message: ChatMessage | null;
|
|
210
295
|
issuer: User | null;
|
|
211
296
|
}
|
|
297
|
+
interface CommunityPluginManagedEvent {
|
|
298
|
+
eventReasonList: EventReason[];
|
|
299
|
+
community: Community | null;
|
|
300
|
+
}
|
|
212
301
|
interface Event {
|
|
213
302
|
eventId: string;
|
|
214
303
|
eventType: EventType;
|
|
215
304
|
pingEvent?: PingEvent;
|
|
216
305
|
postCreatedEvent?: PostCreatedEvent;
|
|
306
|
+
communityMemberChangedEvent?: CommunityMemberChangedEvent;
|
|
217
307
|
chatMessageReceivedEvent?: ChatMessageReceivedEvent;
|
|
308
|
+
communityPluginManagedEvent?: CommunityPluginManagedEvent;
|
|
218
309
|
}
|
|
219
310
|
interface CreatePostRequest {
|
|
220
311
|
text: string;
|
|
221
312
|
inReplyToPostId?: string;
|
|
222
313
|
quotedPostId?: string;
|
|
314
|
+
communityId?: string;
|
|
223
315
|
mediaIdList?: string[];
|
|
224
316
|
postMask?: PostMask;
|
|
225
317
|
publishingType?: PostPublishingType;
|
|
@@ -248,33 +340,52 @@ type SendChatMessageRequest = {
|
|
|
248
340
|
};
|
|
249
341
|
interface GetStampsRequest {
|
|
250
342
|
officialStampLanguage?: LanguageCode;
|
|
343
|
+
communityIds?: string[];
|
|
251
344
|
}
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
handle(event: Event): void | Promise<void>;
|
|
345
|
+
interface GetStampsResponse {
|
|
346
|
+
officialStampSets: OfficialStampSet[];
|
|
347
|
+
communityStampSets: CommunityStampSet[];
|
|
256
348
|
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
interface Authenticator {
|
|
260
|
-
getAccessToken(): Promise<string>;
|
|
349
|
+
interface GetCommunitiesRequest {
|
|
350
|
+
communityIdList: string[];
|
|
261
351
|
}
|
|
262
|
-
interface
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
352
|
+
interface GetCommunityTimelineRequest {
|
|
353
|
+
communityId: string;
|
|
354
|
+
untilCursor?: string;
|
|
355
|
+
sinceCursor?: string;
|
|
266
356
|
}
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
constructor(options: AuthenticatorOptions);
|
|
275
|
-
getAccessToken(): Promise<string>;
|
|
276
|
-
private refreshToken;
|
|
357
|
+
interface GetCommunityMemberListRequest {
|
|
358
|
+
communityId: string;
|
|
359
|
+
paginationCursor?: string;
|
|
360
|
+
}
|
|
361
|
+
interface GetCommunityMemberListResponse {
|
|
362
|
+
members: User[];
|
|
363
|
+
nextPaginationCursor?: string;
|
|
277
364
|
}
|
|
365
|
+
interface RestrictCommunityPostRequest {
|
|
366
|
+
postId: string;
|
|
367
|
+
}
|
|
368
|
+
interface GetCommunitiesUsingApplicationRequest {
|
|
369
|
+
cursor?: string;
|
|
370
|
+
}
|
|
371
|
+
interface GetCommunitiesUsingApplicationResponse {
|
|
372
|
+
communitiesUsingApplication: CommunityUsingApplication[];
|
|
373
|
+
applicationVersions: ApplicationVersion[];
|
|
374
|
+
nextCursor?: string;
|
|
375
|
+
}
|
|
376
|
+
type SendDirectMessageToCommunityMemberRequest = {
|
|
377
|
+
receiverId: string;
|
|
378
|
+
communityId: string;
|
|
379
|
+
text: string;
|
|
380
|
+
mediaIds?: string[];
|
|
381
|
+
postId?: string;
|
|
382
|
+
} | {
|
|
383
|
+
receiverId: string;
|
|
384
|
+
communityId: string;
|
|
385
|
+
text?: string;
|
|
386
|
+
mediaIds: string[];
|
|
387
|
+
postId?: string;
|
|
388
|
+
};
|
|
278
389
|
//#endregion
|
|
279
390
|
//#region src/client.d.ts
|
|
280
391
|
interface ClientOptions {
|
|
@@ -292,14 +403,25 @@ declare class Client {
|
|
|
292
403
|
private call;
|
|
293
404
|
getUsers(userIdList: string[]): Promise<User[]>;
|
|
294
405
|
getPosts(postIdList: string[]): Promise<Post[]>;
|
|
406
|
+
getCommunities(communityIdList: string[]): Promise<Community[]>;
|
|
295
407
|
createPost(request: CreatePostRequest): Promise<Post>;
|
|
296
408
|
deletePost(postId: string): Promise<boolean>;
|
|
297
409
|
initiatePostMediaUpload(request: InitiatePostMediaUploadRequest): Promise<InitiatePostMediaUploadResponse>;
|
|
298
410
|
getPostMediaStatus(mediaId: string): Promise<GetPostMediaStatusResponse>;
|
|
299
411
|
sendChatMessage(request: SendChatMessageRequest): Promise<ChatMessage>;
|
|
300
|
-
|
|
412
|
+
getCommunityTimeline(request: GetCommunityTimelineRequest): Promise<Post[]>;
|
|
413
|
+
getCommunityMemberList(request: GetCommunityMemberListRequest): Promise<GetCommunityMemberListResponse>;
|
|
414
|
+
restrictCommunityPost(request: RestrictCommunityPostRequest): Promise<void>;
|
|
415
|
+
getCommunitiesUsingApplication(request?: GetCommunitiesUsingApplicationRequest): Promise<GetCommunitiesUsingApplicationResponse>;
|
|
416
|
+
getStamps(request?: GetStampsRequest): Promise<GetStampsResponse>;
|
|
417
|
+
sendDirectMessageToCommunityMember(request: SendDirectMessageToCommunityMemberRequest): Promise<ChatMessage>;
|
|
301
418
|
addStampToPost(postId: string, stampId: string): Promise<Post>;
|
|
302
419
|
close(): void;
|
|
303
420
|
}
|
|
304
421
|
//#endregion
|
|
305
|
-
|
|
422
|
+
//#region src/event.d.ts
|
|
423
|
+
interface EventHandler {
|
|
424
|
+
handle(event: Event): void | Promise<void>;
|
|
425
|
+
}
|
|
426
|
+
//#endregion
|
|
427
|
+
export { PostVisibility as $, InitiatePostMediaUploadResponse as A, OfficialStampSet as B, GetCommunityMemberListRequest as C, GetStampsRequest as D, GetPostMediaStatusResponse as E, MediaType as F, PostMask as G, Post as H, MediaUploadStatus as I, PostMediaImage as J, PostMaskType as K, MediaUploadType as L, Media as M, MediaImage as N, GetStampsResponse as O, MediaStamp as P, PostStamp as Q, MediaVideo as R, GetCommunitiesUsingApplicationResponse as S, GetCommunityTimelineRequest as T, PostAccessLevel as U, PingEvent as V, PostCreatedEvent as W, PostMediaVideo as X, PostMediaType as Y, PostPublishingType as Z, Event as _, ApplicationVersion as a, UserAccessLevel as at, GetCommunitiesRequest as b, Community as c, Authenticator as ct, CommunityPluginManagedEvent as d, RestrictCommunityPostRequest as et, CommunityStamp as f, CreatePostRequest as g, CommunityVisibility as h, ApplicationRequirement as i, User as it, LanguageCode as j, InitiatePostMediaUploadRequest as k, CommunityAccessLevel as l, AuthenticatorOptions as lt, CommunityUsingApplication as m, Client as n, SendDirectMessageToCommunityMemberRequest as nt, ChatMessage as o, UserAvatar as ot, CommunityStampSet as p, PostMedia as q, ClientOptions as r, StampSetType as rt, ChatMessageReceivedEvent as s, UserVisibility as st, EventHandler as t, SendChatMessageRequest as tt, CommunityMemberChangedEvent as u, OAuth2Authenticator as ut, EventReason as v, GetCommunityMemberListResponse as w, GetCommunitiesUsingApplicationRequest as x, EventType as y, OfficialStamp as z };
|