/// import * as PUPPET from '@juzi/wechaty-puppet'; import type { FileBoxInterface, FileBox } from 'file-box'; import { GrpcManager } from './grpc-manager.js'; import { PayloadStore } from './payload-store.js'; import type { MessageBroadcastTargets } from '@juzi/wechaty-puppet/dist/esm/src/schemas/message.js'; import type { Contact } from '@juzi/wechaty-puppet/types'; export declare type PuppetServiceOptions = PUPPET.PuppetOptions & { authority?: string; tls?: { caCert?: string; serverName?: string; /** * Huan(202108): only for compatible with old clients/servers * for disabling TLS */ disable?: boolean; }; }; declare class PuppetService extends PUPPET.Puppet { options: PuppetServiceOptions; static readonly VERSION: string; protected _payloadStore: PayloadStore; private timeoutMilliseconds; protected _grpcManager?: GrpcManager; get grpcManager(): GrpcManager; /** * UUIDify: * We need to clone a FileBox * to set uuid loader/saver with this grpc client */ protected FileBoxUuid: typeof FileBox; constructor(options?: PuppetServiceOptions); protected serializeFileBox(fileBox: FileBoxInterface): Promise; name(): string; version(): string; onStart(): Promise; onStop(): Promise; protected hookPayloadStore(): void; protected bridgeGrpcEventStream(client: GrpcManager): void; private onGrpcStreamEvent; logout(reason?: string): Promise; ding(data: string): void; /** * * Huan(202111) Issue #158 - Refactoring the 'dirty' event, dirtyPayload(), * and XXXPayloadDirty() methods logic & spec * * @see https://github.com/wechaty/puppet/issues/158 * */ dirtyPayload(type: PUPPET.types.Dirty, id: string): Promise; /** * `onDirty()` is called when the puppet emit `dirty` event. * the event listener will be registered in `start()` from the `PuppetAbstract` class */ fastDirty({ payloadType, payloadId, }: PUPPET.payloads.EventDirty): Promise; enterVerifyCode(id: string, code: string): Promise; cancelVerifyCode(id: string): Promise; refreshQRCode(): Promise; /** * * Contact * */ contactAlias(contactId: string): Promise; contactAlias(contactId: string, alias: string | null): Promise; contactPhone(contactId: string, phoneList: string[]): Promise; contactCorporationRemark(contactId: string, corporationRemark: string | null): Promise; contactDescription(contactId: string, description: string | null): Promise; contactList(): Promise; contactAvatar(contactId: string): Promise; contactAvatar(contactId: string, file: FileBoxInterface): Promise; contactRawPayload(id: string): Promise; contactRawPayloadParser(payload: PUPPET.payloads.Contact): Promise; batchContactRawPayload(contactIdList: string[]): Promise>; contactPayloadModify(contactId: string, payload: Partial): Promise; contactSelfName(name: string): Promise; contactSelfRealName(realName: string): Promise; contactSelfAka(aka: string): Promise; contactSelfQRCode(): Promise; contactSelfSignature(signature: string): Promise; contactSelfRoomAlias(roomId: string, alias: string): Promise; contactDelete(contactId: string): Promise; /** * * Conversation * */ conversationReadMark(conversationId: string, hasRead?: boolean): Promise; /** * * Message * */ messageMiniProgram(messageId: string): Promise; messageLocation(messageId: string): Promise; messageImage(messageId: string, imageType: PUPPET.types.Image): Promise; messageContact(messageId: string): Promise; messageChannel(messageId: string): Promise; messageChannelCard(messageId: string): Promise; messageCallRecord(messageId: string): Promise; messageChatHistory(messageId: string): Promise; messageSendMiniProgram(conversationId: string, miniProgramPayload: PUPPET.payloads.MiniProgram): Promise; messageSendLocation(conversationId: string, locationPayload: PUPPET.payloads.Location): Promise; messageSendChannel(conversationId: string, channelPayload: PUPPET.payloads.Channel): Promise; messageSendChannelCard(conversationId: string, channelCardPayload: PUPPET.payloads.ChannelCard): Promise; messageRecall(messageId: string): Promise; messageFile(id: string): Promise; messagePreview(id: string): Promise; messageForward(conversationId: string, messageIds: string | string[]): Promise; messageRawPayload(id: string): Promise; messageRawPayloadParser(payload: PUPPET.payloads.Message): Promise; messageSendText(conversationId: string, text: string, options?: PUPPET.types.MessageSendTextOptions): Promise; messageSendFile(conversationId: string, fileBox: FileBoxInterface): Promise; messageSendContact(conversationId: string, contactId: string): Promise; messageSendUrl(conversationId: string, urlLinkPayload: PUPPET.payloads.UrlLink): Promise; messageSendPost(conversationId: string, postPayload: PUPPET.payloads.PostClient): Promise; messageUrl(messageId: string): Promise; getMessageBroadcastTarget(): Promise; createMessageBroadcast(targets: string[], content: PUPPET.payloads.Post): Promise; getMessageBroadcastStatus(id: string): Promise<{ status: PUPPET.types.BroadcastStatus; detail: { contactId?: string | undefined; roomId?: string | undefined; status: PUPPET.types.BroadcastTargetStatus; }[]; }>; /** * * Room * */ roomRawPayload(id: string): Promise; roomRawPayloadParser(payload: PUPPET.payloads.Room): Promise; roomList(): Promise; roomDel(roomId: string, contactIds: string | string[]): Promise; roomDelV2(roomId: string, contactIds: string[]): Promise<{ successList: string[]; failList: string[]; failReasonList: string[]; }>; roomAvatar(roomId: string): Promise; roomAdd(roomId: string, contactId: string | string[], inviteOnly: boolean, quoteIds: string[]): Promise; roomAddV2(roomId: string, contactIds: string[], inviteOnly: boolean, quoteIds: string[]): Promise<{ successList: string[]; failList: string[]; failReasonList: string[]; }>; roomTopic(roomId: string): Promise; roomTopic(roomId: string, topic: string): Promise; roomRemark(roomId: string, remark: string): Promise; roomCreate(contactIdList: string[], topic: string): Promise; roomQuit(roomId: string): Promise; roomQRCode(roomId: string): Promise; roomParseDynamicQRCode(url: string): Promise; roomMemberList(roomId: string): Promise; roomMemberRawPayload(roomId: string, contactId: string): Promise; roomMemberRawPayloadParser(payload: PUPPET.payloads.RoomMember): Promise; batchRoomMemberRawPayload(roomId: string, contactIdList: string[]): Promise>; roomAnnounce(roomId: string): Promise; roomAnnounce(roomId: string, text: string): Promise; roomInvitationAccept(roomInvitationId: string): Promise; roomInvitationAcceptByQRCode(qrcode: string): Promise; roomInvitationRawPayload(id: string): Promise; roomInvitationRawPayloadParser(payload: PUPPET.payloads.RoomInvitation): Promise; roomPermission(roomId: string, permission?: Partial): Promise>; roomOwnerTransfer(roomId: string, contactId: string): Promise; roomAddAdmins(roomId: string, contactIdList: string[]): Promise; roomDelAdmins(roomId: string, contactIdList: string[]): Promise; roomDismiss(roomId: string): Promise; /** * * Friendship * */ friendshipSearchPhone(phone: string, type?: Contact): Promise; friendshipSearchHandle(handle: string, type?: Contact): Promise; friendshipRawPayload(id: string): Promise; friendshipRawPayloadParser(payload: PUPPET.payloads.Friendship): Promise; friendshipAdd(contactId: string, options: PUPPET.types.FriendshipAddOptions): Promise; friendshipAccept(friendshipId: string): Promise; /** * * Tag * */ tagContactTagAdd(tagIds: string[], contactIds: string[]): Promise; tagContactTagRemove(tagIds: string[], contactIds: string[]): Promise; tagGroupAdd(tagGroupName: string): Promise; tagGroupDelete(tagGroupId: string): Promise; tagTagAdd(tagNameList: string[], tagGroupId?: string): Promise; tagTagDelete(tagIdList: string[]): Promise; tagTagModify(tagNewInfoList: PUPPET.types.TagInfo[]): Promise; tagGroupList(): Promise; tagGroupTagList(tagGroupId?: string): Promise; tagTagList(): Promise; tagContactTagList(contactId: string): Promise; tagTagContactList(tagId: string): Promise; tagGroupPayloadPuppet(id: string): Promise; tagPayloadPuppet(tagId: string): Promise; /** * * Post & Moment Section * */ postPublish(payload: PUPPET.payloads.Post): Promise; postUnpublish(id: string): Promise; momentSignature(text?: string): Promise; momentCoverage(cover?: FileBoxInterface | undefined): Promise; postPayloadSayable(postId: string, sayableId: string): Promise; postRawPayload(id: string): Promise; postRawPayloadParser(payload: PUPPET.payloads.Post): Promise; tap(postId: string, type?: PUPPET.types.Tap, tap?: boolean): Promise; momentVisibleList(): Promise; getContactExternalUserId(contactIds: string[], serviceProviderId?: string): Promise; getRoomAntiSpamStrategyList(): Promise; getRoomAntiSpamStrategyEffectRoomList(strategyId: string): Promise; applyRoomAntiSpamStrategy(strategyId: string, roomIds: string[], active: boolean): Promise; getCorpMessageInterceptionStrategies(): Promise; healthCheckInterval?: NodeJS.Timeout; startHealthCheck(): void; stopHealthCheck(): void; private waitingForLogin; private waitingForReady; private reconnectIndicator; reset(): Promise; getMiscellaneousStoreData(): Promise<{ lastEventSeq: string | undefined; lastEventTimestamp: string | undefined; accountId: string | undefined; }>; setMiscellaneousStoreData(data: { lastEventSeq?: string; lastEventTimestamp?: string; accountId?: string; }): Promise; resetMiscellaneousStoreData(): Promise; } export { PuppetService, }; export default PuppetService; //# sourceMappingURL=puppet-service.d.ts.map