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