signal-sdk 0.0.6 → 0.0.8

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.
@@ -1,135 +0,0 @@
1
- import { Message, Contact, GroupUpdateOptions, SendMessageOptions, ContactUpdateOptions, AccountConfiguration, Device, ReceiptType, StickerPack, IdentityKey, LinkingOptions, LinkingResult, MessageRequestResponseType, SendResponse, GroupInfo, RemoveContactOptions, UserStatusResult, PaymentNotificationData, StickerPackManifest, StickerPackUploadResult, RateLimitChallengeResult, ChangeNumberSession, UploadProgress } from './interfaces';
2
- import { EventEmitter } from 'events';
3
- export declare class SignalCli extends EventEmitter {
4
- private signalCliPath;
5
- private account?;
6
- private cliProcess;
7
- private requestPromises;
8
- constructor(accountOrPath?: string, account?: string);
9
- connect(): Promise<void>;
10
- disconnect(): void;
11
- gracefulShutdown(): Promise<void>;
12
- private handleRpcResponse;
13
- private handleStderrData;
14
- private sendJsonRpcRequest;
15
- private isGroupId;
16
- register(number: string, voice?: boolean, captcha?: string): Promise<void>;
17
- verify(number: string, token: string, pin?: string): Promise<void>;
18
- sendMessage(recipient: string, message: string, options?: Omit<SendMessageOptions, 'message'>): Promise<SendResponse>;
19
- sendReaction(recipient: string, targetAuthor: string, targetTimestamp: number, emoji: string, remove?: boolean): Promise<SendResponse>;
20
- sendTyping(recipient: string, stop?: boolean): Promise<void>;
21
- remoteDeleteMessage(recipient: string, targetTimestamp: number): Promise<void>;
22
- updateContact(number: string, name: string, options?: Omit<ContactUpdateOptions, 'name'>): Promise<void>;
23
- block(recipients: string[], groupId?: string): Promise<void>;
24
- unblock(recipients: string[], groupId?: string): Promise<void>;
25
- quitGroup(groupId: string): Promise<void>;
26
- joinGroup(uri: string): Promise<void>;
27
- updateProfile(name: string, about?: string, aboutEmoji?: string, avatar?: string): Promise<void>;
28
- sendReceipt(recipient: string, targetTimestamp: number, type?: ReceiptType): Promise<void>;
29
- listStickerPacks(): Promise<StickerPack[]>;
30
- addStickerPack(packId: string, packKey: string): Promise<void>;
31
- unregister(): Promise<void>;
32
- deleteLocalAccountData(): Promise<void>;
33
- updateAccountConfiguration(config: AccountConfiguration): Promise<void>;
34
- removeDevice(deviceId: number): Promise<void>;
35
- setPin(pin: string): Promise<void>;
36
- removePin(): Promise<void>;
37
- listIdentities(number?: string): Promise<IdentityKey[]>;
38
- trustIdentity(number: string, safetyNumber: string, verified?: boolean): Promise<void>;
39
- link(deviceName?: string): Promise<string>;
40
- /**
41
- * Link a new device to an existing Signal account with QR code support.
42
- * This method provides a complete device linking solution with QR code generation.
43
- *
44
- * @param options - Linking options including device name and QR code output preferences
45
- * @returns Promise resolving to LinkingResult with QR code data and linking status
46
- */
47
- deviceLink(options?: LinkingOptions): Promise<LinkingResult>;
48
- /**
49
- * Display ASCII QR code in console.
50
- * Uses qrcode-terminal which is included as a dependency.
51
- */
52
- private displayQRCode;
53
- addDevice(uri: string, deviceName?: string): Promise<void>;
54
- sendSyncRequest(): Promise<void>;
55
- sendMessageRequestResponse(recipient: string, response: MessageRequestResponseType): Promise<void>;
56
- getVersion(): Promise<any>;
57
- createGroup(name: string, members: string[]): Promise<GroupInfo>;
58
- updateGroup(groupId: string, options: GroupUpdateOptions): Promise<void>;
59
- listGroups(): Promise<GroupInfo[]>;
60
- listContacts(): Promise<Contact[]>;
61
- listDevices(): Promise<Device[]>;
62
- listAccounts(): Promise<string[]>;
63
- /**
64
- * @deprecated Use `connect` and listen for `message` events instead.
65
- * This method now provides a compatibility layer by connecting and buffering messages.
66
- */
67
- receiveMessages(): Promise<Message[]>;
68
- /**
69
- * @deprecated Use `connect` instead.
70
- * This method now calls connect() for backward compatibility.
71
- */
72
- startDaemon(): void;
73
- /**
74
- * @deprecated Use `gracefulShutdown` or `disconnect` instead.
75
- * This method now calls gracefulShutdown() for backward compatibility.
76
- */
77
- stopDaemon(): void;
78
- /**
79
- * Remove a contact from the contact list.
80
- * @param number - The phone number of the contact to remove
81
- * @param options - Options for how to remove the contact
82
- */
83
- removeContact(number: string, options?: RemoveContactOptions): Promise<void>;
84
- /**
85
- * Check if phone numbers are registered with Signal.
86
- * @param numbers - Array of phone numbers to check
87
- * @param usernames - Optional array of usernames to check
88
- * @returns Array of user status results
89
- */
90
- getUserStatus(numbers?: string[], usernames?: string[]): Promise<UserStatusResult[]>;
91
- /**
92
- * Send a payment notification to a recipient.
93
- * @param recipient - Phone number or group ID to send the notification to
94
- * @param paymentData - Payment notification data including receipt
95
- * @returns Send response with timestamp and other details
96
- */
97
- sendPaymentNotification(recipient: string, paymentData: PaymentNotificationData): Promise<SendResponse>;
98
- /**
99
- * Upload a custom sticker pack to Signal.
100
- * @param manifest - Sticker pack manifest information
101
- * @returns Upload result with pack ID and key
102
- */
103
- uploadStickerPack(manifest: StickerPackManifest): Promise<StickerPackUploadResult>;
104
- /**
105
- * Submit a rate limit challenge to lift rate limiting.
106
- * @param challenge - Challenge token from the proof required error
107
- * @param captcha - Captcha token from solved captcha
108
- * @returns Challenge result indicating success/failure
109
- */
110
- submitRateLimitChallenge(challenge: string, captcha: string): Promise<RateLimitChallengeResult>;
111
- /**
112
- * Start the process of changing phone number.
113
- * @param newNumber - The new phone number to change to
114
- * @param voice - Whether to use voice verification instead of SMS
115
- * @param captcha - Captcha token if required
116
- * @returns Change number session information
117
- */
118
- startChangeNumber(newNumber: string, voice?: boolean, captcha?: string): Promise<ChangeNumberSession>;
119
- /**
120
- * Finish the phone number change process with verification code.
121
- * @param verificationCode - The verification code received via SMS/voice
122
- * @param pin - Registration lock PIN if enabled
123
- */
124
- finishChangeNumber(verificationCode: string, pin?: string): Promise<void>;
125
- /**
126
- * Enhanced send message with progress callback support.
127
- * @param recipient - Phone number or group ID
128
- * @param message - Message text
129
- * @param options - Send options including progress callback
130
- * @returns Send response
131
- */
132
- sendMessageWithProgress(recipient: string, message: string, options?: SendMessageOptions & {
133
- onProgress?: (progress: UploadProgress) => void;
134
- }): Promise<SendResponse>;
135
- }