UNPKG

8.01 kBTypeScriptView Raw
1/// <reference types="node" />
2import { Readable } from "stream";
3import * as Types from "./types";
4import { AxiosRequestConfig } from "axios";
5declare type RequestOption = {
6 retryKey: string;
7};
8export default class Client {
9 config: Types.ClientConfig;
10 private http;
11 private requestOption;
12 constructor(config: Types.ClientConfig);
13 setRequestOptionOnce(option: Partial<RequestOption>): void;
14 private generateRequestConfig;
15 private parseHTTPResponse;
16 pushMessage(to: string, messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
17 replyMessage(replyToken: string, messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
18 multicast(to: string[], messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
19 narrowcast(messages: Types.Message | Types.Message[], recipient?: Types.ReceieptObject, filter?: {
20 demographic: Types.DemographicFilterObject;
21 }, limit?: {
22 max?: number;
23 upToRemainingQuota?: boolean;
24 }, notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
25 broadcast(messages: Types.Message | Types.Message[], notificationDisabled?: boolean): Promise<Types.MessageAPIResponseBase>;
26 getProfile(userId: string): Promise<Types.Profile>;
27 private getChatMemberProfile;
28 getGroupMemberProfile(groupId: string, userId: string): Promise<Types.Profile>;
29 getRoomMemberProfile(roomId: string, userId: string): Promise<Types.Profile>;
30 private getChatMemberIds;
31 getGroupMemberIds(groupId: string): Promise<string[]>;
32 getRoomMemberIds(roomId: string): Promise<string[]>;
33 getBotFollowersIds(): Promise<string[]>;
34 getGroupMembersCount(groupId: string): Promise<Types.MembersCountResponse>;
35 getRoomMembersCount(roomId: string): Promise<Types.MembersCountResponse>;
36 getGroupSummary(groupId: string): Promise<Types.GroupSummaryResponse>;
37 getMessageContent(messageId: string): Promise<Readable>;
38 private leaveChat;
39 leaveGroup(groupId: string): Promise<any>;
40 leaveRoom(roomId: string): Promise<any>;
41 getRichMenu(richMenuId: string): Promise<Types.RichMenuResponse>;
42 createRichMenu(richMenu: Types.RichMenu): Promise<string>;
43 deleteRichMenu(richMenuId: string): Promise<any>;
44 getRichMenuAliasList(): Promise<Types.GetRichMenuAliasListResponse>;
45 getRichMenuAlias(richMenuAliasId: string): Promise<Types.GetRichMenuAliasResponse>;
46 createRichMenuAlias(richMenuId: string, richMenuAliasId: string): Promise<{}>;
47 deleteRichMenuAlias(richMenuAliasId: string): Promise<{}>;
48 updateRichMenuAlias(richMenuAliasId: string, richMenuId: string): Promise<{}>;
49 getRichMenuIdOfUser(userId: string): Promise<string>;
50 linkRichMenuToUser(userId: string, richMenuId: string): Promise<any>;
51 unlinkRichMenuFromUser(userId: string): Promise<any>;
52 linkRichMenuToMultipleUsers(richMenuId: string, userIds: string[]): Promise<any>;
53 unlinkRichMenusFromMultipleUsers(userIds: string[]): Promise<any>;
54 getRichMenuImage(richMenuId: string): Promise<Readable>;
55 setRichMenuImage(richMenuId: string, data: Buffer | Readable, contentType?: string): Promise<any>;
56 getRichMenuList(): Promise<Array<Types.RichMenuResponse>>;
57 setDefaultRichMenu(richMenuId: string): Promise<{}>;
58 getDefaultRichMenuId(): Promise<string>;
59 deleteDefaultRichMenu(): Promise<{}>;
60 getLinkToken(userId: string): Promise<string>;
61 getNumberOfSentReplyMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
62 getNumberOfSentPushMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
63 getNumberOfSentMulticastMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
64 getNarrowcastProgress(requestId: string): Promise<Types.NarrowcastProgressResponse>;
65 getTargetLimitForAdditionalMessages(): Promise<Types.TargetLimitForAdditionalMessages>;
66 getNumberOfMessagesSentThisMonth(): Promise<Types.NumberOfMessagesSentThisMonth>;
67 getNumberOfSentBroadcastMessages(date: string): Promise<Types.NumberOfMessagesSentResponse>;
68 getNumberOfMessageDeliveries(date: string): Promise<Types.NumberOfMessageDeliveriesResponse>;
69 getNumberOfFollowers(date: string): Promise<Types.NumberOfFollowersResponse>;
70 getFriendDemographics(): Promise<Types.FriendDemographics>;
71 getUserInteractionStatistics(requestId: string): Promise<Types.UserInteractionStatistics>;
72 createUploadAudienceGroup(uploadAudienceGroup: {
73 description: string;
74 isIfaAudience?: boolean;
75 audiences?: {
76 id: string;
77 }[];
78 uploadDescription?: string;
79 }): Promise<{
80 audienceGroupId: number;
81 type: string;
82 description: string;
83 created: number;
84 }>;
85 createUploadAudienceGroupByFile(uploadAudienceGroup: {
86 description: string;
87 isIfaAudience?: boolean;
88 uploadDescription?: string;
89 file: Buffer | Readable;
90 }): Promise<{
91 audienceGroupId: number;
92 type: "UPLOAD";
93 description: string;
94 created: number;
95 }>;
96 updateUploadAudienceGroup(uploadAudienceGroup: {
97 audienceGroupId: number;
98 description?: string;
99 uploadDescription?: string;
100 audiences: {
101 id: string;
102 }[];
103 }, httpConfig?: Partial<AxiosRequestConfig>): Promise<{}>;
104 updateUploadAudienceGroupByFile(uploadAudienceGroup: {
105 audienceGroupId: number;
106 uploadDescription?: string;
107 file: Buffer | Readable;
108 }, httpConfig?: Partial<AxiosRequestConfig>): Promise<{}>;
109 createClickAudienceGroup(clickAudienceGroup: {
110 description: string;
111 requestId: string;
112 clickUrl?: string;
113 }): Promise<{
114 audienceGroupId: number;
115 type: string;
116 created: number;
117 } & {
118 description: string;
119 requestId: string;
120 clickUrl?: string;
121 }>;
122 createImpAudienceGroup(impAudienceGroup: {
123 requestId: string;
124 description: string;
125 }): Promise<{
126 audienceGroupId: number;
127 type: string;
128 created: number;
129 } & {
130 requestId: string;
131 description: string;
132 }>;
133 setDescriptionAudienceGroup(description: string, audienceGroupId: string): Promise<{}>;
134 deleteAudienceGroup(audienceGroupId: string): Promise<{}>;
135 getAudienceGroup(audienceGroupId: string): Promise<Types.AudienceGroup>;
136 getAudienceGroups(page: number, description?: string, status?: Types.AudienceGroupStatus, size?: number, createRoute?: Types.AudienceGroupCreateRoute, includesExternalPublicGroups?: boolean): Promise<{
137 audienceGroups: Types.AudienceGroups;
138 hasNextPage: boolean;
139 totalCount: number;
140 readWriteAudienceGroupTotalCount: number;
141 page: number;
142 size: number;
143 }>;
144 getAudienceGroupAuthorityLevel(): Promise<{
145 authorityLevel: Types.AudienceGroupAuthorityLevel;
146 }>;
147 changeAudienceGroupAuthorityLevel(authorityLevel: Types.AudienceGroupAuthorityLevel): Promise<{}>;
148 getBotInfo(): Promise<Types.BotInfoResponse>;
149 setWebhookEndpointUrl(endpoint: string): Promise<{}>;
150 getWebhookEndpointInfo(): Promise<Types.WebhookEndpointInfoResponse>;
151 testWebhookEndpoint(endpoint?: string): Promise<Types.TestWebhookEndpointResponse>;
152}
153export declare class OAuth {
154 private http;
155 constructor();
156 issueAccessToken(client_id: string, client_secret: string): Promise<Types.ChannelAccessToken>;
157 revokeAccessToken(access_token: string): Promise<{}>;
158 issueChannelAccessTokenV2_1(client_assertion: string): Promise<Types.ChannelAccessToken>;
159 getChannelAccessTokenKeyIdsV2_1(client_assertion: string): Promise<{
160 key_ids: string[];
161 }>;
162 revokeChannelAccessTokenV2_1(client_id: string, client_secret: string, access_token: string): Promise<{}>;
163}
164export {};