mixi2-js 1.2.1 → 1.3.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 +16 -13
- package/dist/client-C90Zd_yq.d.cts +303 -0
- package/dist/client-DPeVTCYr.d.mts +303 -0
- package/dist/helpers/index.cjs +305 -207
- package/dist/helpers/index.d.cts +150 -65
- package/dist/helpers/index.d.mts +207 -0
- package/dist/helpers/index.mjs +304 -0
- package/dist/index.cjs +542 -750
- package/dist/index.d.cts +41 -37
- package/dist/index.d.mts +50 -0
- package/dist/index.mjs +559 -0
- package/dist/types-BrJ83qtL.mjs +92 -0
- package/dist/types-D9t_NdQ0.cjs +175 -0
- package/package.json +43 -51
- package/dist/chunk-4NKIICB5.js +0 -107
- package/dist/client-iXbbRxc-.d.cts +0 -296
- package/dist/client-iXbbRxc-.d.ts +0 -296
- package/dist/helpers/index.d.ts +0 -122
- package/dist/helpers/index.js +0 -186
- package/dist/index.d.ts +0 -46
- package/dist/index.js +0 -680
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
interface Authenticator {
|
|
2
|
-
getAccessToken(): Promise<string>;
|
|
3
|
-
}
|
|
4
|
-
interface AuthenticatorOptions {
|
|
5
|
-
clientId: string;
|
|
6
|
-
clientSecret: string;
|
|
7
|
-
tokenUrl: string;
|
|
8
|
-
}
|
|
9
|
-
declare class OAuth2Authenticator implements Authenticator {
|
|
10
|
-
private readonly clientId;
|
|
11
|
-
private readonly clientSecret;
|
|
12
|
-
private readonly tokenUrl;
|
|
13
|
-
private accessToken;
|
|
14
|
-
private expiresAt;
|
|
15
|
-
private refreshPromise;
|
|
16
|
-
constructor(options: AuthenticatorOptions);
|
|
17
|
-
getAccessToken(): Promise<string>;
|
|
18
|
-
private refreshToken;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare enum EventType {
|
|
22
|
-
UNSPECIFIED = 0,
|
|
23
|
-
PING = 1,
|
|
24
|
-
POST_CREATED = 2,
|
|
25
|
-
CHAT_MESSAGE_RECEIVED = 4
|
|
26
|
-
}
|
|
27
|
-
declare enum EventReason {
|
|
28
|
-
UNSPECIFIED = 0,
|
|
29
|
-
PING = 1,
|
|
30
|
-
POST_REPLY = 2,
|
|
31
|
-
POST_MENTIONED = 3,
|
|
32
|
-
POST_QUOTED = 4,
|
|
33
|
-
DIRECT_MESSAGE_RECEIVED = 8
|
|
34
|
-
}
|
|
35
|
-
declare enum MediaType {
|
|
36
|
-
UNSPECIFIED = 0,
|
|
37
|
-
IMAGE = 1,
|
|
38
|
-
VIDEO = 2
|
|
39
|
-
}
|
|
40
|
-
declare enum PostMediaType {
|
|
41
|
-
UNSPECIFIED = 0,
|
|
42
|
-
IMAGE = 1,
|
|
43
|
-
VIDEO = 2
|
|
44
|
-
}
|
|
45
|
-
declare enum PostVisibility {
|
|
46
|
-
UNSPECIFIED = 0,
|
|
47
|
-
VISIBLE = 1,
|
|
48
|
-
INVISIBLE = 2
|
|
49
|
-
}
|
|
50
|
-
declare enum PostAccessLevel {
|
|
51
|
-
UNSPECIFIED = 0,
|
|
52
|
-
PUBLIC = 1,
|
|
53
|
-
PRIVATE = 2
|
|
54
|
-
}
|
|
55
|
-
declare enum PostMaskType {
|
|
56
|
-
UNSPECIFIED = 0,
|
|
57
|
-
SENSITIVE = 1,
|
|
58
|
-
SPOILER = 2
|
|
59
|
-
}
|
|
60
|
-
declare enum PostPublishingType {
|
|
61
|
-
UNSPECIFIED = 0,
|
|
62
|
-
NOT_PUBLISHING = 1
|
|
63
|
-
}
|
|
64
|
-
declare enum UserVisibility {
|
|
65
|
-
UNSPECIFIED = 0,
|
|
66
|
-
VISIBLE = 1,
|
|
67
|
-
INVISIBLE = 2
|
|
68
|
-
}
|
|
69
|
-
declare enum UserAccessLevel {
|
|
70
|
-
UNSPECIFIED = 0,
|
|
71
|
-
PUBLIC = 1,
|
|
72
|
-
PRIVATE = 2
|
|
73
|
-
}
|
|
74
|
-
declare enum LanguageCode {
|
|
75
|
-
UNSPECIFIED = 0,
|
|
76
|
-
JP = 1,
|
|
77
|
-
EN = 2
|
|
78
|
-
}
|
|
79
|
-
declare enum StampSetType {
|
|
80
|
-
UNSPECIFIED = 0,
|
|
81
|
-
DEFAULT = 1,
|
|
82
|
-
SEASONAL = 2
|
|
83
|
-
}
|
|
84
|
-
declare enum MediaUploadType {
|
|
85
|
-
UNSPECIFIED = 0,
|
|
86
|
-
IMAGE = 1,
|
|
87
|
-
VIDEO = 2
|
|
88
|
-
}
|
|
89
|
-
declare enum MediaUploadStatus {
|
|
90
|
-
UNSPECIFIED = 0,
|
|
91
|
-
UPLOAD_PENDING = 1,
|
|
92
|
-
PROCESSING = 2,
|
|
93
|
-
COMPLETED = 3,
|
|
94
|
-
FAILED = 4
|
|
95
|
-
}
|
|
96
|
-
interface UserAvatar {
|
|
97
|
-
largeImageUrl: string;
|
|
98
|
-
largeImageMimeType: string;
|
|
99
|
-
largeImageHeight: number;
|
|
100
|
-
largeImageWidth: number;
|
|
101
|
-
smallImageUrl: string;
|
|
102
|
-
smallImageMimeType: string;
|
|
103
|
-
smallImageHeight: number;
|
|
104
|
-
smallImageWidth: number;
|
|
105
|
-
}
|
|
106
|
-
interface User {
|
|
107
|
-
userId: string;
|
|
108
|
-
isDisabled: boolean;
|
|
109
|
-
name: string;
|
|
110
|
-
displayName: string;
|
|
111
|
-
profile: string;
|
|
112
|
-
userAvatar: UserAvatar | null;
|
|
113
|
-
visibility: UserVisibility;
|
|
114
|
-
accessLevel: UserAccessLevel;
|
|
115
|
-
}
|
|
116
|
-
interface MediaImage {
|
|
117
|
-
largeImageUrl: string;
|
|
118
|
-
largeImageMimeType: string;
|
|
119
|
-
largeImageHeight: number;
|
|
120
|
-
largeImageWidth: number;
|
|
121
|
-
smallImageUrl: string;
|
|
122
|
-
smallImageMimeType: string;
|
|
123
|
-
smallImageHeight: number;
|
|
124
|
-
smallImageWidth: number;
|
|
125
|
-
}
|
|
126
|
-
interface MediaVideo {
|
|
127
|
-
videoUrl: string;
|
|
128
|
-
videoMimeType: string;
|
|
129
|
-
videoHeight: number;
|
|
130
|
-
videoWidth: number;
|
|
131
|
-
previewImageUrl: string;
|
|
132
|
-
previewImageMimeType: string;
|
|
133
|
-
previewImageHeight: number;
|
|
134
|
-
previewImageWidth: number;
|
|
135
|
-
duration: number;
|
|
136
|
-
}
|
|
137
|
-
interface MediaStamp {
|
|
138
|
-
url: string;
|
|
139
|
-
mimeType: string;
|
|
140
|
-
height: number;
|
|
141
|
-
width: number;
|
|
142
|
-
}
|
|
143
|
-
interface Media {
|
|
144
|
-
mediaType: MediaType;
|
|
145
|
-
image?: MediaImage;
|
|
146
|
-
video?: MediaVideo;
|
|
147
|
-
}
|
|
148
|
-
interface PostMediaImage {
|
|
149
|
-
largeImageUrl: string;
|
|
150
|
-
largeImageMimeType: string;
|
|
151
|
-
largeImageHeight: number;
|
|
152
|
-
largeImageWidth: number;
|
|
153
|
-
smallImageUrl: string;
|
|
154
|
-
smallImageMimeType: string;
|
|
155
|
-
smallImageHeight: number;
|
|
156
|
-
smallImageWidth: number;
|
|
157
|
-
}
|
|
158
|
-
interface PostMediaVideo {
|
|
159
|
-
videoUrl: string;
|
|
160
|
-
videoMimeType: string;
|
|
161
|
-
videoHeight: number;
|
|
162
|
-
videoWidth: number;
|
|
163
|
-
previewImageUrl: string;
|
|
164
|
-
previewImageMimeType: string;
|
|
165
|
-
previewImageHeight: number;
|
|
166
|
-
previewImageWidth: number;
|
|
167
|
-
duration: number;
|
|
168
|
-
}
|
|
169
|
-
interface PostMedia {
|
|
170
|
-
mediaType: PostMediaType;
|
|
171
|
-
image?: PostMediaImage;
|
|
172
|
-
video?: PostMediaVideo;
|
|
173
|
-
}
|
|
174
|
-
interface PostMask {
|
|
175
|
-
maskType: PostMaskType;
|
|
176
|
-
caption: string;
|
|
177
|
-
}
|
|
178
|
-
interface PostStamp {
|
|
179
|
-
stamp: MediaStamp | null;
|
|
180
|
-
count: number;
|
|
181
|
-
}
|
|
182
|
-
interface Post {
|
|
183
|
-
postId: string;
|
|
184
|
-
isDeleted: boolean;
|
|
185
|
-
creatorId: string;
|
|
186
|
-
text: string;
|
|
187
|
-
createdAt: Date | null;
|
|
188
|
-
postMediaList: PostMedia[];
|
|
189
|
-
inReplyToPostId?: string;
|
|
190
|
-
postMask?: PostMask;
|
|
191
|
-
visibility: PostVisibility;
|
|
192
|
-
accessLevel: PostAccessLevel;
|
|
193
|
-
stamps: PostStamp[];
|
|
194
|
-
readerStampId?: string;
|
|
195
|
-
}
|
|
196
|
-
interface ChatMessage {
|
|
197
|
-
roomId: string;
|
|
198
|
-
messageId: string;
|
|
199
|
-
creatorId: string;
|
|
200
|
-
text: string;
|
|
201
|
-
createdAt: Date | null;
|
|
202
|
-
mediaList: Media[];
|
|
203
|
-
postId?: string;
|
|
204
|
-
}
|
|
205
|
-
interface OfficialStamp {
|
|
206
|
-
stampId: string;
|
|
207
|
-
index: number;
|
|
208
|
-
searchTags: string[];
|
|
209
|
-
url: string;
|
|
210
|
-
}
|
|
211
|
-
interface OfficialStampSet {
|
|
212
|
-
name: string;
|
|
213
|
-
spriteUrl: string;
|
|
214
|
-
stamps: OfficialStamp[];
|
|
215
|
-
stampSetId: string;
|
|
216
|
-
startAt?: Date;
|
|
217
|
-
endAt?: Date;
|
|
218
|
-
stampSetType: StampSetType;
|
|
219
|
-
}
|
|
220
|
-
interface PingEvent {
|
|
221
|
-
}
|
|
222
|
-
interface PostCreatedEvent {
|
|
223
|
-
eventReasonList: EventReason[];
|
|
224
|
-
post: Post | null;
|
|
225
|
-
issuer: User | null;
|
|
226
|
-
}
|
|
227
|
-
interface ChatMessageReceivedEvent {
|
|
228
|
-
eventReasonList: EventReason[];
|
|
229
|
-
message: ChatMessage | null;
|
|
230
|
-
issuer: User | null;
|
|
231
|
-
}
|
|
232
|
-
interface Event {
|
|
233
|
-
eventId: string;
|
|
234
|
-
eventType: EventType;
|
|
235
|
-
pingEvent?: PingEvent;
|
|
236
|
-
postCreatedEvent?: PostCreatedEvent;
|
|
237
|
-
chatMessageReceivedEvent?: ChatMessageReceivedEvent;
|
|
238
|
-
}
|
|
239
|
-
interface CreatePostRequest {
|
|
240
|
-
text: string;
|
|
241
|
-
inReplyToPostId?: string;
|
|
242
|
-
quotedPostId?: string;
|
|
243
|
-
mediaIdList?: string[];
|
|
244
|
-
postMask?: PostMask;
|
|
245
|
-
publishingType?: PostPublishingType;
|
|
246
|
-
}
|
|
247
|
-
interface InitiatePostMediaUploadRequest {
|
|
248
|
-
contentType: string;
|
|
249
|
-
dataSize: number;
|
|
250
|
-
mediaType: MediaUploadType;
|
|
251
|
-
description?: string;
|
|
252
|
-
}
|
|
253
|
-
interface InitiatePostMediaUploadResponse {
|
|
254
|
-
mediaId: string;
|
|
255
|
-
uploadUrl: string;
|
|
256
|
-
}
|
|
257
|
-
interface GetPostMediaStatusResponse {
|
|
258
|
-
status: MediaUploadStatus;
|
|
259
|
-
}
|
|
260
|
-
interface SendChatMessageRequest {
|
|
261
|
-
roomId: string;
|
|
262
|
-
text?: string;
|
|
263
|
-
mediaId?: string;
|
|
264
|
-
}
|
|
265
|
-
interface GetStampsRequest {
|
|
266
|
-
officialStampLanguage?: LanguageCode;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
interface EventHandler {
|
|
270
|
-
handle(event: Event): void | Promise<void>;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
interface ClientOptions {
|
|
274
|
-
apiAddress: string;
|
|
275
|
-
authenticator: Authenticator;
|
|
276
|
-
authKey?: string;
|
|
277
|
-
}
|
|
278
|
-
declare class Client {
|
|
279
|
-
private readonly grpcClient;
|
|
280
|
-
private readonly authenticator;
|
|
281
|
-
private readonly authKey?;
|
|
282
|
-
constructor(options: ClientOptions);
|
|
283
|
-
private getMetadata;
|
|
284
|
-
private call;
|
|
285
|
-
getUsers(userIdList: string[]): Promise<User[]>;
|
|
286
|
-
getPosts(postIdList: string[]): Promise<Post[]>;
|
|
287
|
-
createPost(request: CreatePostRequest): Promise<Post>;
|
|
288
|
-
initiatePostMediaUpload(request: InitiatePostMediaUploadRequest): Promise<InitiatePostMediaUploadResponse>;
|
|
289
|
-
getPostMediaStatus(mediaId: string): Promise<GetPostMediaStatusResponse>;
|
|
290
|
-
sendChatMessage(request: SendChatMessageRequest): Promise<ChatMessage>;
|
|
291
|
-
getStamps(request?: GetStampsRequest): Promise<OfficialStampSet[]>;
|
|
292
|
-
addStampToPost(postId: string, stampId: string): Promise<Post>;
|
|
293
|
-
close(): void;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export { type Authenticator as A, type PostMediaVideo as B, type ChatMessage as C, PostPublishingType as D, type EventHandler as E, type PostStamp as F, type GetPostMediaStatusResponse as G, PostVisibility as H, type InitiatePostMediaUploadRequest as I, StampSetType as J, UserAccessLevel as K, LanguageCode as L, type Media as M, type UserAvatar as N, OAuth2Authenticator as O, type PingEvent as P, UserVisibility as Q, type SendChatMessageRequest as S, type User as U, type AuthenticatorOptions as a, type ChatMessageReceivedEvent as b, Client as c, type ClientOptions as d, type CreatePostRequest as e, type Event as f, EventReason as g, EventType as h, type GetStampsRequest as i, type InitiatePostMediaUploadResponse as j, type MediaImage as k, type MediaStamp as l, MediaType as m, MediaUploadStatus as n, MediaUploadType as o, type MediaVideo as p, type OfficialStamp as q, type OfficialStampSet as r, type Post as s, PostAccessLevel as t, type PostCreatedEvent as u, type PostMask as v, PostMaskType as w, type PostMedia as x, type PostMediaImage as y, PostMediaType as z };
|
|
@@ -1,296 +0,0 @@
|
|
|
1
|
-
interface Authenticator {
|
|
2
|
-
getAccessToken(): Promise<string>;
|
|
3
|
-
}
|
|
4
|
-
interface AuthenticatorOptions {
|
|
5
|
-
clientId: string;
|
|
6
|
-
clientSecret: string;
|
|
7
|
-
tokenUrl: string;
|
|
8
|
-
}
|
|
9
|
-
declare class OAuth2Authenticator implements Authenticator {
|
|
10
|
-
private readonly clientId;
|
|
11
|
-
private readonly clientSecret;
|
|
12
|
-
private readonly tokenUrl;
|
|
13
|
-
private accessToken;
|
|
14
|
-
private expiresAt;
|
|
15
|
-
private refreshPromise;
|
|
16
|
-
constructor(options: AuthenticatorOptions);
|
|
17
|
-
getAccessToken(): Promise<string>;
|
|
18
|
-
private refreshToken;
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
declare enum EventType {
|
|
22
|
-
UNSPECIFIED = 0,
|
|
23
|
-
PING = 1,
|
|
24
|
-
POST_CREATED = 2,
|
|
25
|
-
CHAT_MESSAGE_RECEIVED = 4
|
|
26
|
-
}
|
|
27
|
-
declare enum EventReason {
|
|
28
|
-
UNSPECIFIED = 0,
|
|
29
|
-
PING = 1,
|
|
30
|
-
POST_REPLY = 2,
|
|
31
|
-
POST_MENTIONED = 3,
|
|
32
|
-
POST_QUOTED = 4,
|
|
33
|
-
DIRECT_MESSAGE_RECEIVED = 8
|
|
34
|
-
}
|
|
35
|
-
declare enum MediaType {
|
|
36
|
-
UNSPECIFIED = 0,
|
|
37
|
-
IMAGE = 1,
|
|
38
|
-
VIDEO = 2
|
|
39
|
-
}
|
|
40
|
-
declare enum PostMediaType {
|
|
41
|
-
UNSPECIFIED = 0,
|
|
42
|
-
IMAGE = 1,
|
|
43
|
-
VIDEO = 2
|
|
44
|
-
}
|
|
45
|
-
declare enum PostVisibility {
|
|
46
|
-
UNSPECIFIED = 0,
|
|
47
|
-
VISIBLE = 1,
|
|
48
|
-
INVISIBLE = 2
|
|
49
|
-
}
|
|
50
|
-
declare enum PostAccessLevel {
|
|
51
|
-
UNSPECIFIED = 0,
|
|
52
|
-
PUBLIC = 1,
|
|
53
|
-
PRIVATE = 2
|
|
54
|
-
}
|
|
55
|
-
declare enum PostMaskType {
|
|
56
|
-
UNSPECIFIED = 0,
|
|
57
|
-
SENSITIVE = 1,
|
|
58
|
-
SPOILER = 2
|
|
59
|
-
}
|
|
60
|
-
declare enum PostPublishingType {
|
|
61
|
-
UNSPECIFIED = 0,
|
|
62
|
-
NOT_PUBLISHING = 1
|
|
63
|
-
}
|
|
64
|
-
declare enum UserVisibility {
|
|
65
|
-
UNSPECIFIED = 0,
|
|
66
|
-
VISIBLE = 1,
|
|
67
|
-
INVISIBLE = 2
|
|
68
|
-
}
|
|
69
|
-
declare enum UserAccessLevel {
|
|
70
|
-
UNSPECIFIED = 0,
|
|
71
|
-
PUBLIC = 1,
|
|
72
|
-
PRIVATE = 2
|
|
73
|
-
}
|
|
74
|
-
declare enum LanguageCode {
|
|
75
|
-
UNSPECIFIED = 0,
|
|
76
|
-
JP = 1,
|
|
77
|
-
EN = 2
|
|
78
|
-
}
|
|
79
|
-
declare enum StampSetType {
|
|
80
|
-
UNSPECIFIED = 0,
|
|
81
|
-
DEFAULT = 1,
|
|
82
|
-
SEASONAL = 2
|
|
83
|
-
}
|
|
84
|
-
declare enum MediaUploadType {
|
|
85
|
-
UNSPECIFIED = 0,
|
|
86
|
-
IMAGE = 1,
|
|
87
|
-
VIDEO = 2
|
|
88
|
-
}
|
|
89
|
-
declare enum MediaUploadStatus {
|
|
90
|
-
UNSPECIFIED = 0,
|
|
91
|
-
UPLOAD_PENDING = 1,
|
|
92
|
-
PROCESSING = 2,
|
|
93
|
-
COMPLETED = 3,
|
|
94
|
-
FAILED = 4
|
|
95
|
-
}
|
|
96
|
-
interface UserAvatar {
|
|
97
|
-
largeImageUrl: string;
|
|
98
|
-
largeImageMimeType: string;
|
|
99
|
-
largeImageHeight: number;
|
|
100
|
-
largeImageWidth: number;
|
|
101
|
-
smallImageUrl: string;
|
|
102
|
-
smallImageMimeType: string;
|
|
103
|
-
smallImageHeight: number;
|
|
104
|
-
smallImageWidth: number;
|
|
105
|
-
}
|
|
106
|
-
interface User {
|
|
107
|
-
userId: string;
|
|
108
|
-
isDisabled: boolean;
|
|
109
|
-
name: string;
|
|
110
|
-
displayName: string;
|
|
111
|
-
profile: string;
|
|
112
|
-
userAvatar: UserAvatar | null;
|
|
113
|
-
visibility: UserVisibility;
|
|
114
|
-
accessLevel: UserAccessLevel;
|
|
115
|
-
}
|
|
116
|
-
interface MediaImage {
|
|
117
|
-
largeImageUrl: string;
|
|
118
|
-
largeImageMimeType: string;
|
|
119
|
-
largeImageHeight: number;
|
|
120
|
-
largeImageWidth: number;
|
|
121
|
-
smallImageUrl: string;
|
|
122
|
-
smallImageMimeType: string;
|
|
123
|
-
smallImageHeight: number;
|
|
124
|
-
smallImageWidth: number;
|
|
125
|
-
}
|
|
126
|
-
interface MediaVideo {
|
|
127
|
-
videoUrl: string;
|
|
128
|
-
videoMimeType: string;
|
|
129
|
-
videoHeight: number;
|
|
130
|
-
videoWidth: number;
|
|
131
|
-
previewImageUrl: string;
|
|
132
|
-
previewImageMimeType: string;
|
|
133
|
-
previewImageHeight: number;
|
|
134
|
-
previewImageWidth: number;
|
|
135
|
-
duration: number;
|
|
136
|
-
}
|
|
137
|
-
interface MediaStamp {
|
|
138
|
-
url: string;
|
|
139
|
-
mimeType: string;
|
|
140
|
-
height: number;
|
|
141
|
-
width: number;
|
|
142
|
-
}
|
|
143
|
-
interface Media {
|
|
144
|
-
mediaType: MediaType;
|
|
145
|
-
image?: MediaImage;
|
|
146
|
-
video?: MediaVideo;
|
|
147
|
-
}
|
|
148
|
-
interface PostMediaImage {
|
|
149
|
-
largeImageUrl: string;
|
|
150
|
-
largeImageMimeType: string;
|
|
151
|
-
largeImageHeight: number;
|
|
152
|
-
largeImageWidth: number;
|
|
153
|
-
smallImageUrl: string;
|
|
154
|
-
smallImageMimeType: string;
|
|
155
|
-
smallImageHeight: number;
|
|
156
|
-
smallImageWidth: number;
|
|
157
|
-
}
|
|
158
|
-
interface PostMediaVideo {
|
|
159
|
-
videoUrl: string;
|
|
160
|
-
videoMimeType: string;
|
|
161
|
-
videoHeight: number;
|
|
162
|
-
videoWidth: number;
|
|
163
|
-
previewImageUrl: string;
|
|
164
|
-
previewImageMimeType: string;
|
|
165
|
-
previewImageHeight: number;
|
|
166
|
-
previewImageWidth: number;
|
|
167
|
-
duration: number;
|
|
168
|
-
}
|
|
169
|
-
interface PostMedia {
|
|
170
|
-
mediaType: PostMediaType;
|
|
171
|
-
image?: PostMediaImage;
|
|
172
|
-
video?: PostMediaVideo;
|
|
173
|
-
}
|
|
174
|
-
interface PostMask {
|
|
175
|
-
maskType: PostMaskType;
|
|
176
|
-
caption: string;
|
|
177
|
-
}
|
|
178
|
-
interface PostStamp {
|
|
179
|
-
stamp: MediaStamp | null;
|
|
180
|
-
count: number;
|
|
181
|
-
}
|
|
182
|
-
interface Post {
|
|
183
|
-
postId: string;
|
|
184
|
-
isDeleted: boolean;
|
|
185
|
-
creatorId: string;
|
|
186
|
-
text: string;
|
|
187
|
-
createdAt: Date | null;
|
|
188
|
-
postMediaList: PostMedia[];
|
|
189
|
-
inReplyToPostId?: string;
|
|
190
|
-
postMask?: PostMask;
|
|
191
|
-
visibility: PostVisibility;
|
|
192
|
-
accessLevel: PostAccessLevel;
|
|
193
|
-
stamps: PostStamp[];
|
|
194
|
-
readerStampId?: string;
|
|
195
|
-
}
|
|
196
|
-
interface ChatMessage {
|
|
197
|
-
roomId: string;
|
|
198
|
-
messageId: string;
|
|
199
|
-
creatorId: string;
|
|
200
|
-
text: string;
|
|
201
|
-
createdAt: Date | null;
|
|
202
|
-
mediaList: Media[];
|
|
203
|
-
postId?: string;
|
|
204
|
-
}
|
|
205
|
-
interface OfficialStamp {
|
|
206
|
-
stampId: string;
|
|
207
|
-
index: number;
|
|
208
|
-
searchTags: string[];
|
|
209
|
-
url: string;
|
|
210
|
-
}
|
|
211
|
-
interface OfficialStampSet {
|
|
212
|
-
name: string;
|
|
213
|
-
spriteUrl: string;
|
|
214
|
-
stamps: OfficialStamp[];
|
|
215
|
-
stampSetId: string;
|
|
216
|
-
startAt?: Date;
|
|
217
|
-
endAt?: Date;
|
|
218
|
-
stampSetType: StampSetType;
|
|
219
|
-
}
|
|
220
|
-
interface PingEvent {
|
|
221
|
-
}
|
|
222
|
-
interface PostCreatedEvent {
|
|
223
|
-
eventReasonList: EventReason[];
|
|
224
|
-
post: Post | null;
|
|
225
|
-
issuer: User | null;
|
|
226
|
-
}
|
|
227
|
-
interface ChatMessageReceivedEvent {
|
|
228
|
-
eventReasonList: EventReason[];
|
|
229
|
-
message: ChatMessage | null;
|
|
230
|
-
issuer: User | null;
|
|
231
|
-
}
|
|
232
|
-
interface Event {
|
|
233
|
-
eventId: string;
|
|
234
|
-
eventType: EventType;
|
|
235
|
-
pingEvent?: PingEvent;
|
|
236
|
-
postCreatedEvent?: PostCreatedEvent;
|
|
237
|
-
chatMessageReceivedEvent?: ChatMessageReceivedEvent;
|
|
238
|
-
}
|
|
239
|
-
interface CreatePostRequest {
|
|
240
|
-
text: string;
|
|
241
|
-
inReplyToPostId?: string;
|
|
242
|
-
quotedPostId?: string;
|
|
243
|
-
mediaIdList?: string[];
|
|
244
|
-
postMask?: PostMask;
|
|
245
|
-
publishingType?: PostPublishingType;
|
|
246
|
-
}
|
|
247
|
-
interface InitiatePostMediaUploadRequest {
|
|
248
|
-
contentType: string;
|
|
249
|
-
dataSize: number;
|
|
250
|
-
mediaType: MediaUploadType;
|
|
251
|
-
description?: string;
|
|
252
|
-
}
|
|
253
|
-
interface InitiatePostMediaUploadResponse {
|
|
254
|
-
mediaId: string;
|
|
255
|
-
uploadUrl: string;
|
|
256
|
-
}
|
|
257
|
-
interface GetPostMediaStatusResponse {
|
|
258
|
-
status: MediaUploadStatus;
|
|
259
|
-
}
|
|
260
|
-
interface SendChatMessageRequest {
|
|
261
|
-
roomId: string;
|
|
262
|
-
text?: string;
|
|
263
|
-
mediaId?: string;
|
|
264
|
-
}
|
|
265
|
-
interface GetStampsRequest {
|
|
266
|
-
officialStampLanguage?: LanguageCode;
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
interface EventHandler {
|
|
270
|
-
handle(event: Event): void | Promise<void>;
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
interface ClientOptions {
|
|
274
|
-
apiAddress: string;
|
|
275
|
-
authenticator: Authenticator;
|
|
276
|
-
authKey?: string;
|
|
277
|
-
}
|
|
278
|
-
declare class Client {
|
|
279
|
-
private readonly grpcClient;
|
|
280
|
-
private readonly authenticator;
|
|
281
|
-
private readonly authKey?;
|
|
282
|
-
constructor(options: ClientOptions);
|
|
283
|
-
private getMetadata;
|
|
284
|
-
private call;
|
|
285
|
-
getUsers(userIdList: string[]): Promise<User[]>;
|
|
286
|
-
getPosts(postIdList: string[]): Promise<Post[]>;
|
|
287
|
-
createPost(request: CreatePostRequest): Promise<Post>;
|
|
288
|
-
initiatePostMediaUpload(request: InitiatePostMediaUploadRequest): Promise<InitiatePostMediaUploadResponse>;
|
|
289
|
-
getPostMediaStatus(mediaId: string): Promise<GetPostMediaStatusResponse>;
|
|
290
|
-
sendChatMessage(request: SendChatMessageRequest): Promise<ChatMessage>;
|
|
291
|
-
getStamps(request?: GetStampsRequest): Promise<OfficialStampSet[]>;
|
|
292
|
-
addStampToPost(postId: string, stampId: string): Promise<Post>;
|
|
293
|
-
close(): void;
|
|
294
|
-
}
|
|
295
|
-
|
|
296
|
-
export { type Authenticator as A, type PostMediaVideo as B, type ChatMessage as C, PostPublishingType as D, type EventHandler as E, type PostStamp as F, type GetPostMediaStatusResponse as G, PostVisibility as H, type InitiatePostMediaUploadRequest as I, StampSetType as J, UserAccessLevel as K, LanguageCode as L, type Media as M, type UserAvatar as N, OAuth2Authenticator as O, type PingEvent as P, UserVisibility as Q, type SendChatMessageRequest as S, type User as U, type AuthenticatorOptions as a, type ChatMessageReceivedEvent as b, Client as c, type ClientOptions as d, type CreatePostRequest as e, type Event as f, EventReason as g, EventType as h, type GetStampsRequest as i, type InitiatePostMediaUploadResponse as j, type MediaImage as k, type MediaStamp as l, MediaType as m, MediaUploadStatus as n, MediaUploadType as o, type MediaVideo as p, type OfficialStamp as q, type OfficialStampSet as r, type Post as s, PostAccessLevel as t, type PostCreatedEvent as u, type PostMask as v, PostMaskType as w, type PostMedia as x, type PostMediaImage as y, PostMediaType as z };
|
package/dist/helpers/index.d.ts
DELETED
|
@@ -1,122 +0,0 @@
|
|
|
1
|
-
import { E as EventHandler, h as EventType, f as Event, c as Client, I as InitiatePostMediaUploadRequest, v as PostMask, D as PostPublishingType, e as CreatePostRequest, g as EventReason } from '../client-iXbbRxc-.js';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* アクセストークン取得用のエンドポイント URL です。
|
|
5
|
-
*/
|
|
6
|
-
declare const tokenUrl: string;
|
|
7
|
-
/**
|
|
8
|
-
* API サーバーアドレスです。
|
|
9
|
-
*/
|
|
10
|
-
declare const apiAddress: string;
|
|
11
|
-
/**
|
|
12
|
-
* gRPC ストリーミング接続用のサーバーアドレスです。
|
|
13
|
-
*/
|
|
14
|
-
declare const streamAddress: string;
|
|
15
|
-
|
|
16
|
-
type EventListener = (event: Event) => void | Promise<void>;
|
|
17
|
-
/**
|
|
18
|
-
* イベントタイプ別にハンドラを登録できる EventHandler 実装。
|
|
19
|
-
* StreamWatcher.watch() や WebhookServer に直接渡して使用できる。
|
|
20
|
-
*/
|
|
21
|
-
declare class EventRouter implements EventHandler {
|
|
22
|
-
private readonly listeners;
|
|
23
|
-
/**
|
|
24
|
-
* 指定したイベントタイプのハンドラを登録する。
|
|
25
|
-
* 同じイベントタイプに複数のハンドラを登録可能(登録順に実行)。
|
|
26
|
-
*/
|
|
27
|
-
on(eventType: EventType, listener: EventListener): this;
|
|
28
|
-
/**
|
|
29
|
-
* 指定したイベントタイプのハンドラを削除する。
|
|
30
|
-
* listener を省略した場合、そのイベントタイプのすべてのハンドラを削除する。
|
|
31
|
-
*/
|
|
32
|
-
off(eventType: EventType, listener?: EventListener): this;
|
|
33
|
-
/**
|
|
34
|
-
* EventHandler.handle() の実装。
|
|
35
|
-
* 登録されたリスナーに対してイベントをルーティングする。
|
|
36
|
-
*/
|
|
37
|
-
handle(event: Event): Promise<void>;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
interface MediaUploaderOptions {
|
|
41
|
-
/** ポーリング間隔(ミリ秒)。デフォルト: 1000 */
|
|
42
|
-
pollInterval?: number;
|
|
43
|
-
/** タイムアウト(ミリ秒)。デフォルト: 60000 */
|
|
44
|
-
timeout?: number;
|
|
45
|
-
}
|
|
46
|
-
interface UploadedMedia {
|
|
47
|
-
mediaId: string;
|
|
48
|
-
uploadUrl: string;
|
|
49
|
-
}
|
|
50
|
-
/**
|
|
51
|
-
* メディアアップロードの開始 → データ送信 → 処理完了待機を簡略化するヘルパー。
|
|
52
|
-
*
|
|
53
|
-
* 通常は initiatePostMediaUpload → HTTP POST → getPostMediaStatus のポーリングが必要だが、
|
|
54
|
-
* このクラスで waitForReady() を呼ぶだけで完了まで待機できる。
|
|
55
|
-
*/
|
|
56
|
-
declare class MediaUploader {
|
|
57
|
-
private readonly client;
|
|
58
|
-
private readonly pollInterval;
|
|
59
|
-
private readonly timeout;
|
|
60
|
-
constructor(client: Client, options?: MediaUploaderOptions);
|
|
61
|
-
/**
|
|
62
|
-
* メディアアップロードを開始し、uploadUrl と mediaId を返す。
|
|
63
|
-
*/
|
|
64
|
-
initiate(request: InitiatePostMediaUploadRequest): Promise<UploadedMedia>;
|
|
65
|
-
/**
|
|
66
|
-
* メディアの処理が完了するまでポーリングして待機する。
|
|
67
|
-
* 完了時に mediaId を返す。失敗時はエラーをスローする。
|
|
68
|
-
*/
|
|
69
|
-
waitForReady(mediaId: string): Promise<string>;
|
|
70
|
-
}
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* ポスト作成リクエストをメソッドチェーンで組み立てるビルダー。
|
|
74
|
-
*
|
|
75
|
-
* @example
|
|
76
|
-
* const request = new PostBuilder('Hello mixi2!')
|
|
77
|
-
* .reply('post-id')
|
|
78
|
-
* .media(['media-id-1'])
|
|
79
|
-
* .sensitive()
|
|
80
|
-
* .build();
|
|
81
|
-
*/
|
|
82
|
-
declare class PostBuilder {
|
|
83
|
-
private readonly request;
|
|
84
|
-
constructor(text: string);
|
|
85
|
-
/** 返信先ポスト ID を設定する。 */
|
|
86
|
-
reply(postId: string): this;
|
|
87
|
-
/** 引用対象ポスト ID を設定する。 */
|
|
88
|
-
quote(postId: string): this;
|
|
89
|
-
/** 添付メディア ID を設定する(最大 4 件)。 */
|
|
90
|
-
media(mediaIdList: string[]): this;
|
|
91
|
-
/** センシティブマスクを設定する。 */
|
|
92
|
-
sensitive(caption?: string): this;
|
|
93
|
-
/** ネタバレマスクを設定する。 */
|
|
94
|
-
spoiler(caption?: string): this;
|
|
95
|
-
/** カスタムマスクを設定する。 */
|
|
96
|
-
mask(postMask: PostMask): this;
|
|
97
|
-
/** 配信設定を設定する。 */
|
|
98
|
-
publishing(type: PostPublishingType): this;
|
|
99
|
-
/** CreatePostRequest オブジェクトを構築する。 */
|
|
100
|
-
build(): CreatePostRequest;
|
|
101
|
-
}
|
|
102
|
-
|
|
103
|
-
/**
|
|
104
|
-
* EventReason に基づいてイベントをフィルタリングするミドルウェア。
|
|
105
|
-
* 指定した理由に一致するイベントのみを内部のハンドラに渡す。
|
|
106
|
-
*
|
|
107
|
-
* @example
|
|
108
|
-
* const filter = new ReasonFilter(innerHandler, [
|
|
109
|
-
* EventReason.POST_REPLY,
|
|
110
|
-
* EventReason.POST_MENTIONED,
|
|
111
|
-
* ]);
|
|
112
|
-
* await watcher.watch(filter);
|
|
113
|
-
*/
|
|
114
|
-
declare class ReasonFilter implements EventHandler {
|
|
115
|
-
private readonly inner;
|
|
116
|
-
private readonly allowedReasons;
|
|
117
|
-
constructor(handler: EventHandler, reasons: EventReason[]);
|
|
118
|
-
handle(event: Event): Promise<void>;
|
|
119
|
-
private getReasons;
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
export { EventRouter, MediaUploader, type MediaUploaderOptions, PostBuilder, ReasonFilter, type UploadedMedia, apiAddress, streamAddress, tokenUrl };
|