UNPKG

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