mixi2-js 1.4.1 → 1.5.1

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 CHANGED
@@ -14,9 +14,11 @@
14
14
  [![JSR Score](https://jsr.io/badges/@otoneko1102/mixi2-js/score)](https://jsr.io/@otoneko1102/mixi2-js)
15
15
  [![License](https://img.shields.io/github/license/otoneko1102/mixi2-js?color=blue)](LICENSE)
16
16
  [![Node.js](https://img.shields.io/node/v/mixi2-js?color=339933&logo=nodedotjs&logoColor=white)](package.json)
17
- [![TypeScript](https://img.shields.io/badge/TypeScript-5.9-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
18
- [![Build](https://img.shields.io/github/actions/workflow/status/otoneko1102/mixi2-js/publish.yml?label=build&logo=github)](https://github.com/otoneko1102/mixi2-js/actions)
19
- [![Vite+](https://img.shields.io/badge/Vite%2B-enabled-646CFF?logo=vite&logoColor=white)](vite.config.ts)
17
+ [![TypeScript](https://img.shields.io/badge/TypeScript-6.0-3178C6?logo=typescript&logoColor=white)](https://www.typescriptlang.org/)
18
+ [![Build](https://img.shields.io/github/actions/workflow/status/otoneko1102/mixi2-js/publish.yml?label=build&logo=github)](https://github.com/otnc/mixi2-js/actions)
19
+ [![Prettier](https://img.shields.io/badge/Prettier-latest-F7B93E?logo=prettier&logoColor=white)](https://prettier.io/)
20
+ [![ESLint](https://img.shields.io/badge/ESLint-latest-4B32C3?logo=eslint&logoColor=white)](https://eslint.org/)
21
+ [![tsdown](https://img.shields.io/badge/tsdown-0.21.10-orange)](https://tsdown.dev/)
20
22
 
21
23
  <div align="center">
22
24
 
@@ -28,13 +30,18 @@ mixi2 の [Application API](https://developer.mixi.social/docs) を利用する
28
30
 
29
31
  [公式 Go SDK](https://github.com/mixigroup/mixi2-application-sdk-go) および [公式 API 仕様](https://github.com/mixigroup/mixi2-api) に基づいて作成されています。
30
32
 
31
- > [!Note]
33
+ > [!Note]
34
+ >
32
35
  > **これは MIXI 社公式のプロダクトではありません。コミュニティメンバーによるオープンソースプロジェクトです。**
33
36
 
34
37
  ---
35
38
 
36
39
  ## インストール
37
40
 
41
+ > [!Warning]
42
+ >
43
+ > **mixi2-js v1.5.0 より、Node.js v20.19.0 未満はサポートされなくなりました。** Node.js v18 系では動作しません。Node.js v20.19.0 以上をご使用ください。
44
+
38
45
  ```bash
39
46
  npm install mixi2-js
40
47
 
@@ -97,7 +104,7 @@ ESM・CommonJS の両方に対応しています。TypeScript の型定義 (`.d.
97
104
 
98
105
  ### 貢献者
99
106
 
100
- <a href="https://github.com/otoneko1102/mixi2-js/graphs/contributors">
107
+ <a href="https://github.com/otnc/mixi2-js/graphs/contributors">
101
108
  <img src="https://contrib.rocks/image?repo=otoneko1102/mixi2-js" alt="Made with contrib.rocks" />
102
109
  </a>
103
110
 
@@ -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
- CHAT_MESSAGE_RECEIVED = 4
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
- DIRECT_MESSAGE_RECEIVED = 8
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
- //#endregion
253
- //#region src/event.d.ts
254
- interface EventHandler {
255
- handle(event: Event): void | Promise<void>;
345
+ interface GetStampsResponse {
346
+ officialStampSets: OfficialStampSet[];
347
+ communityStampSets: CommunityStampSet[];
256
348
  }
257
- //#endregion
258
- //#region src/auth.d.ts
259
- interface Authenticator {
260
- getAccessToken(): Promise<string>;
349
+ interface GetCommunitiesRequest {
350
+ communityIdList: string[];
261
351
  }
262
- interface AuthenticatorOptions {
263
- clientId: string;
264
- clientSecret: string;
265
- tokenUrl: string;
352
+ interface GetCommunityTimelineRequest {
353
+ communityId: string;
354
+ untilCursor?: string;
355
+ sinceCursor?: string;
266
356
  }
267
- declare class OAuth2Authenticator implements Authenticator {
268
- private readonly clientId;
269
- private readonly clientSecret;
270
- private readonly tokenUrl;
271
- private accessToken;
272
- private expiresAt;
273
- private refreshPromise;
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
- getStamps(request?: GetStampsRequest): Promise<OfficialStampSet[]>;
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
- export { PostCreatedEvent as A, SendChatMessageRequest as B, MediaUploadType as C, PingEvent as D, OfficialStampSet as E, PostMediaType as F, UserVisibility as G, User as H, PostMediaVideo as I, PostPublishingType as L, PostMaskType as M, PostMedia as N, Post as O, PostMediaImage as P, PostStamp as R, MediaUploadStatus as S, OfficialStamp as T, UserAccessLevel as U, StampSetType as V, UserAvatar as W, LanguageCode as _, OAuth2Authenticator as a, MediaStamp as b, ChatMessageReceivedEvent as c, EventReason as d, EventType as f, InitiatePostMediaUploadResponse as g, InitiatePostMediaUploadRequest as h, AuthenticatorOptions as i, PostMask as j, PostAccessLevel as k, CreatePostRequest as l, GetStampsRequest as m, ClientOptions as n, EventHandler as o, GetPostMediaStatusResponse as p, Authenticator as r, ChatMessage as s, Client as t, Event as u, Media as v, MediaVideo as w, MediaType as x, MediaImage as y, PostVisibility as z };
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
- CHAT_MESSAGE_RECEIVED = 4
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
- DIRECT_MESSAGE_RECEIVED = 8
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
- //#endregion
253
- //#region src/event.d.ts
254
- interface EventHandler {
255
- handle(event: Event): void | Promise<void>;
345
+ interface GetStampsResponse {
346
+ officialStampSets: OfficialStampSet[];
347
+ communityStampSets: CommunityStampSet[];
256
348
  }
257
- //#endregion
258
- //#region src/auth.d.ts
259
- interface Authenticator {
260
- getAccessToken(): Promise<string>;
349
+ interface GetCommunitiesRequest {
350
+ communityIdList: string[];
261
351
  }
262
- interface AuthenticatorOptions {
263
- clientId: string;
264
- clientSecret: string;
265
- tokenUrl: string;
352
+ interface GetCommunityTimelineRequest {
353
+ communityId: string;
354
+ untilCursor?: string;
355
+ sinceCursor?: string;
266
356
  }
267
- declare class OAuth2Authenticator implements Authenticator {
268
- private readonly clientId;
269
- private readonly clientSecret;
270
- private readonly tokenUrl;
271
- private accessToken;
272
- private expiresAt;
273
- private refreshPromise;
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
- getStamps(request?: GetStampsRequest): Promise<OfficialStampSet[]>;
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
- export { PostCreatedEvent as A, SendChatMessageRequest as B, MediaUploadType as C, PingEvent as D, OfficialStampSet as E, PostMediaType as F, UserVisibility as G, User as H, PostMediaVideo as I, PostPublishingType as L, PostMaskType as M, PostMedia as N, Post as O, PostMediaImage as P, PostStamp as R, MediaUploadStatus as S, OfficialStamp as T, UserAccessLevel as U, StampSetType as V, UserAvatar as W, LanguageCode as _, OAuth2Authenticator as a, MediaStamp as b, ChatMessageReceivedEvent as c, EventReason as d, EventType as f, InitiatePostMediaUploadResponse as g, InitiatePostMediaUploadRequest as h, AuthenticatorOptions as i, PostMask as j, PostAccessLevel as k, CreatePostRequest as l, GetStampsRequest as m, ClientOptions as n, EventHandler as o, GetPostMediaStatusResponse as p, Authenticator as r, ChatMessage as s, Client as t, Event as u, Media as v, MediaVideo as w, MediaType as x, MediaImage as y, PostVisibility as z };
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 };