diff --git a/.github/workflows/jsonrpc-client-npm-package.yml b/.github/workflows/jsonrpc-client-npm-package.yml index 294a3c014..709ac43eb 100644 --- a/.github/workflows/jsonrpc-client-npm-package.yml +++ b/.github/workflows/jsonrpc-client-npm-package.yml @@ -46,7 +46,7 @@ jobs: shell: bash run: | cd deltachat-jsonrpc/typescript - npm run build:tsc + npm run build npm pack . ls -lah mv $(find deltachat-jsonrpc-client-*) $DELTACHAT_JSONRPC_TAR_GZ diff --git a/CHANGELOG.md b/CHANGELOG.md index f48cb3afb..f3d360afa 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -10,6 +10,7 @@ - Small speedup #3780 - Log the reason when the message cannot be sent to the chat #3810 - Add IMAP server ID line to the context info only when it is known #3814 +- Remove autogenerated typescript files #3815 ### API-Changes - Add Python API to send reactions #3762 diff --git a/deltachat-jsonrpc/typescript/.gitignore b/deltachat-jsonrpc/typescript/.gitignore index ca2372bc1..52ed46aee 100644 --- a/deltachat-jsonrpc/typescript/.gitignore +++ b/deltachat-jsonrpc/typescript/.gitignore @@ -6,3 +6,4 @@ yarn.lock package-lock.json docs accounts +generated diff --git a/deltachat-jsonrpc/typescript/generated/client.ts b/deltachat-jsonrpc/typescript/generated/client.ts deleted file mode 100644 index bb207be81..000000000 --- a/deltachat-jsonrpc/typescript/generated/client.ts +++ /dev/null @@ -1,948 +0,0 @@ -// AUTO-GENERATED by yerpc-derive - -import * as T from "./types.js" -import * as RPC from "./jsonrpc.js" - -type RequestMethod = (method: string, params?: RPC.Params) => Promise; -type NotificationMethod = (method: string, params?: RPC.Params) => void; - -interface Transport { - request: RequestMethod, - notification: NotificationMethod -} - -export class RawClient { - constructor(private _transport: Transport) {} - - /** - * Check if an email address is valid. - */ - public checkEmailValidity(email: string): Promise { - return (this._transport.request('check_email_validity', [email] as RPC.Params)) as Promise; - } - - /** - * Get general system info. - */ - public getSystemInfo(): Promise> { - return (this._transport.request('get_system_info', [] as RPC.Params)) as Promise>; - } - - - public addAccount(): Promise { - return (this._transport.request('add_account', [] as RPC.Params)) as Promise; - } - - - public removeAccount(accountId: T.U32): Promise { - return (this._transport.request('remove_account', [accountId] as RPC.Params)) as Promise; - } - - - public getAllAccountIds(): Promise<(T.U32)[]> { - return (this._transport.request('get_all_account_ids', [] as RPC.Params)) as Promise<(T.U32)[]>; - } - - /** - * Select account id for internally selected state. - * TODO: Likely this is deprecated as all methods take an account id now. - */ - public selectAccount(id: T.U32): Promise { - return (this._transport.request('select_account', [id] as RPC.Params)) as Promise; - } - - /** - * Get the selected account id of the internal state.. - * TODO: Likely this is deprecated as all methods take an account id now. - */ - public getSelectedAccountId(): Promise<(T.U32|null)> { - return (this._transport.request('get_selected_account_id', [] as RPC.Params)) as Promise<(T.U32|null)>; - } - - /** - * Get a list of all configured accounts. - */ - public getAllAccounts(): Promise<(T.Account)[]> { - return (this._transport.request('get_all_accounts', [] as RPC.Params)) as Promise<(T.Account)[]>; - } - - - public startIoForAllAccounts(): Promise { - return (this._transport.request('start_io_for_all_accounts', [] as RPC.Params)) as Promise; - } - - - public stopIoForAllAccounts(): Promise { - return (this._transport.request('stop_io_for_all_accounts', [] as RPC.Params)) as Promise; - } - - - public startIo(id: T.U32): Promise { - return (this._transport.request('start_io', [id] as RPC.Params)) as Promise; - } - - - public stopIo(id: T.U32): Promise { - return (this._transport.request('stop_io', [id] as RPC.Params)) as Promise; - } - - /** - * Get top-level info for an account. - */ - public getAccountInfo(accountId: T.U32): Promise { - return (this._transport.request('get_account_info', [accountId] as RPC.Params)) as Promise; - } - - /** - * Get the combined filesize of an account in bytes - */ - public getAccountFileSize(accountId: T.U32): Promise { - return (this._transport.request('get_account_file_size', [accountId] as RPC.Params)) as Promise; - } - - /** - * Returns provider for the given domain. - * - * This function looks up domain in offline database. - * - * For compatibility, email address can be passed to this function - * instead of the domain. - */ - public getProviderInfo(accountId: T.U32, email: string): Promise<(T.ProviderInfo|null)> { - return (this._transport.request('get_provider_info', [accountId, email] as RPC.Params)) as Promise<(T.ProviderInfo|null)>; - } - - /** - * Checks if the context is already configured. - */ - public isConfigured(accountId: T.U32): Promise { - return (this._transport.request('is_configured', [accountId] as RPC.Params)) as Promise; - } - - /** - * Get system info for an account. - */ - public getInfo(accountId: T.U32): Promise> { - return (this._transport.request('get_info', [accountId] as RPC.Params)) as Promise>; - } - - - public setConfig(accountId: T.U32, key: string, value: (string|null)): Promise { - return (this._transport.request('set_config', [accountId, key, value] as RPC.Params)) as Promise; - } - - - public batchSetConfig(accountId: T.U32, config: Record): Promise { - return (this._transport.request('batch_set_config', [accountId, config] as RPC.Params)) as Promise; - } - - /** - * Set configuration values from a QR code. (technically from the URI that is stored in the qrcode) - * Before this function is called, `checkQr()` should confirm the type of the - * QR code is `account` or `webrtcInstance`. - * - * Internally, the function will call dc_set_config() with the appropriate keys, - */ - public setConfigFromQr(accountId: T.U32, qrContent: string): Promise { - return (this._transport.request('set_config_from_qr', [accountId, qrContent] as RPC.Params)) as Promise; - } - - - public checkQr(accountId: T.U32, qrContent: string): Promise { - return (this._transport.request('check_qr', [accountId, qrContent] as RPC.Params)) as Promise; - } - - - public getConfig(accountId: T.U32, key: string): Promise<(string|null)> { - return (this._transport.request('get_config', [accountId, key] as RPC.Params)) as Promise<(string|null)>; - } - - - public batchGetConfig(accountId: T.U32, keys: (string)[]): Promise> { - return (this._transport.request('batch_get_config', [accountId, keys] as RPC.Params)) as Promise>; - } - - - public setStockStrings(strings: Record): Promise { - return (this._transport.request('set_stock_strings', [strings] as RPC.Params)) as Promise; - } - - /** - * Configures this account with the currently set parameters. - * Setup the credential config before calling this. - */ - public configure(accountId: T.U32): Promise { - return (this._transport.request('configure', [accountId] as RPC.Params)) as Promise; - } - - /** - * Signal an ongoing process to stop. - */ - public stopOngoingProcess(accountId: T.U32): Promise { - return (this._transport.request('stop_ongoing_process', [accountId] as RPC.Params)) as Promise; - } - - - public exportSelfKeys(accountId: T.U32, path: string, passphrase: (string|null)): Promise { - return (this._transport.request('export_self_keys', [accountId, path, passphrase] as RPC.Params)) as Promise; - } - - - public importSelfKeys(accountId: T.U32, path: string, passphrase: (string|null)): Promise { - return (this._transport.request('import_self_keys', [accountId, path, passphrase] as RPC.Params)) as Promise; - } - - /** - * Returns the message IDs of all _fresh_ messages of any chat. - * Typically used for implementing notification summaries - * or badge counters e.g. on the app icon. - * The list is already sorted and starts with the most recent fresh message. - * - * Messages belonging to muted chats or to the contact requests are not returned; - * these messages should not be notified - * and also badge counters should not include these messages. - * - * To get the number of fresh messages for a single chat, muted or not, - * use `get_fresh_msg_cnt()`. - */ - public getFreshMsgs(accountId: T.U32): Promise<(T.U32)[]> { - return (this._transport.request('get_fresh_msgs', [accountId] as RPC.Params)) as Promise<(T.U32)[]>; - } - - /** - * Get the number of _fresh_ messages in a chat. - * Typically used to implement a badge with a number in the chatlist. - * - * If the specified chat is muted, - * the UI should show the badge counter "less obtrusive", - * e.g. using "gray" instead of "red" color. - */ - public getFreshMsgCnt(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('get_fresh_msg_cnt', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Estimate the number of messages that will be deleted - * by the set_config()-options `delete_device_after` or `delete_server_after`. - * This is typically used to show the estimated impact to the user - * before actually enabling deletion of old messages. - */ - public estimateAutoDeletionCount(accountId: T.U32, fromServer: boolean, seconds: T.I64): Promise { - return (this._transport.request('estimate_auto_deletion_count', [accountId, fromServer, seconds] as RPC.Params)) as Promise; - } - - - public initiateAutocryptKeyTransfer(accountId: T.U32): Promise { - return (this._transport.request('initiate_autocrypt_key_transfer', [accountId] as RPC.Params)) as Promise; - } - - - public continueAutocryptKeyTransfer(accountId: T.U32, messageId: T.U32, setupCode: string): Promise { - return (this._transport.request('continue_autocrypt_key_transfer', [accountId, messageId, setupCode] as RPC.Params)) as Promise; - } - - - public getChatlistEntries(accountId: T.U32, listFlags: (T.U32|null), queryString: (string|null), queryContactId: (T.U32|null)): Promise<(T.ChatListEntry)[]> { - return (this._transport.request('get_chatlist_entries', [accountId, listFlags, queryString, queryContactId] as RPC.Params)) as Promise<(T.ChatListEntry)[]>; - } - - - public getChatlistItemsByEntries(accountId: T.U32, entries: (T.ChatListEntry)[]): Promise> { - return (this._transport.request('get_chatlist_items_by_entries', [accountId, entries] as RPC.Params)) as Promise>; - } - - - public getFullChatById(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('get_full_chat_by_id', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * get basic info about a chat, - * use chatlist_get_full_chat_by_id() instead if you need more information - */ - public getBasicChatInfo(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('get_basic_chat_info', [accountId, chatId] as RPC.Params)) as Promise; - } - - - public acceptChat(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('accept_chat', [accountId, chatId] as RPC.Params)) as Promise; - } - - - public blockChat(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('block_chat', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Delete a chat. - * - * Messages are deleted from the device and the chat database entry is deleted. - * After that, the event #DC_EVENT_MSGS_CHANGED is posted. - * - * Things that are _not done_ implicitly: - * - * - Messages are **not deleted from the server**. - * - The chat or the contact is **not blocked**, so new messages from the user/the group may appear as a contact request - * and the user may create the chat again. - * - **Groups are not left** - this would - * be unexpected as (1) deleting a normal chat also does not prevent new mails - * from arriving, (2) leaving a group requires sending a message to - * all group members - especially for groups not used for a longer time, this is - * really unexpected when deletion results in contacting all members again, - * (3) only leaving groups is also a valid usecase. - * - * To leave a chat explicitly, use leave_group() - */ - public deleteChat(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('delete_chat', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Get encryption info for a chat. - * Get a multi-line encryption info, containing encryption preferences of all members. - * Can be used to find out why messages sent to group are not encrypted. - * - * returns Multi-line text - */ - public getChatEncryptionInfo(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('get_chat_encryption_info', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Get QR code (text and SVG) that will offer an Setup-Contact or Verified-Group invitation. - * The QR code is compatible to the OPENPGP4FPR format - * so that a basic fingerprint comparison also works e.g. with OpenKeychain. - * - * The scanning device will pass the scanned content to `checkQr()` then; - * if `checkQr()` returns `askVerifyContact` or `askVerifyGroup` - * an out-of-band-verification can be joined using `secure_join()` - * - * chat_id: If set to a group-chat-id, - * the Verified-Group-Invite protocol is offered in the QR code; - * works for protected groups as well as for normal groups. - * If not set, the Setup-Contact protocol is offered in the QR code. - * See https://countermitm.readthedocs.io/en/latest/new.html - * for details about both protocols. - * - * return format: `[code, svg]` - */ - public getChatSecurejoinQrCodeSvg(accountId: T.U32, chatId: (T.U32|null)): Promise<[string,string]> { - return (this._transport.request('get_chat_securejoin_qr_code_svg', [accountId, chatId] as RPC.Params)) as Promise<[string,string]>; - } - - /** - * Continue a Setup-Contact or Verified-Group-Invite protocol - * started on another device with `get_chat_securejoin_qr_code_svg()`. - * This function is typically called when `check_qr()` returns - * type=AskVerifyContact or type=AskVerifyGroup. - * - * The function returns immediately and the handshake runs in background, - * sending and receiving several messages. - * During the handshake, info messages are added to the chat, - * showing progress, success or errors. - * - * Subsequent calls of `secure_join()` will abort previous, unfinished handshakes. - * - * See https://countermitm.readthedocs.io/en/latest/new.html - * for details about both protocols. - * - * **qr**: The text of the scanned QR code. Typically, the same string as given - * to `check_qr()`. - * - * **returns**: The chat ID of the joined chat, the UI may redirect to the this chat. - * A returned chat ID does not guarantee that the chat is protected or the belonging contact is verified. - * - */ - public secureJoin(accountId: T.U32, qr: string): Promise { - return (this._transport.request('secure_join', [accountId, qr] as RPC.Params)) as Promise; - } - - - public leaveGroup(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('leave_group', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Remove a member from a group. - * - * If the group is already _promoted_ (any message was sent to the group), - * all group members are informed by a special status message that is sent automatically by this function. - * - * Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent. - */ - public removeContactFromChat(accountId: T.U32, chatId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('remove_contact_from_chat', [accountId, chatId, contactId] as RPC.Params)) as Promise; - } - - /** - * Add a member to a group. - * - * If the group is already _promoted_ (any message was sent to the group), - * all group members are informed by a special status message that is sent automatically by this function. - * - * If the group has group protection enabled, only verified contacts can be added to the group. - * - * Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent. - */ - public addContactToChat(accountId: T.U32, chatId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('add_contact_to_chat', [accountId, chatId, contactId] as RPC.Params)) as Promise; - } - - /** - * Get the contact IDs belonging to a chat. - * - * - for normal chats, the function always returns exactly one contact, - * DC_CONTACT_ID_SELF is returned only for SELF-chats. - * - * - for group chats all members are returned, DC_CONTACT_ID_SELF is returned - * explicitly as it may happen that oneself gets removed from a still existing - * group - * - * - for broadcasts, all recipients are returned, DC_CONTACT_ID_SELF is not included - * - * - for mailing lists, the behavior is not documented currently, we will decide on that later. - * for now, the UI should not show the list for mailing lists. - * (we do not know all members and there is not always a global mailing list address, - * so we could return only SELF or the known members; this is not decided yet) - */ - public getChatContacts(accountId: T.U32, chatId: T.U32): Promise<(T.U32)[]> { - return (this._transport.request('get_chat_contacts', [accountId, chatId] as RPC.Params)) as Promise<(T.U32)[]>; - } - - /** - * Create a new group chat. - * - * After creation, - * the group has one member with the ID DC_CONTACT_ID_SELF - * and is in _unpromoted_ state. - * This means, you can add or remove members, change the name, - * the group image and so on without messages being sent to all group members. - * - * This changes as soon as the first message is sent to the group members - * and the group becomes _promoted_. - * After that, all changes are synced with all group members - * by sending status message. - * - * To check, if a chat is still unpromoted, you can look at the `is_unpromoted` property of `BasicChat` or `FullChat`. - * This may be useful if you want to show some help for just created groups. - * - * @param protect If set to 1 the function creates group with protection initially enabled. - * Only verified members are allowed in these groups - * and end-to-end-encryption is always enabled. - */ - public createGroupChat(accountId: T.U32, name: string, protect: boolean): Promise { - return (this._transport.request('create_group_chat', [accountId, name, protect] as RPC.Params)) as Promise; - } - - /** - * Create a new broadcast list. - * - * Broadcast lists are similar to groups on the sending device, - * however, recipients get the messages in normal one-to-one chats - * and will not be aware of other members. - * - * Replies to broadcasts go only to the sender - * and not to all broadcast recipients. - * Moreover, replies will not appear in the broadcast list - * but in the one-to-one chat with the person answering. - * - * The name and the image of the broadcast list is set automatically - * and is visible to the sender only. - * Not asking for these data allows more focused creation - * and we bypass the question who will get which data. - * Also, many users will have at most one broadcast list - * so, a generic name and image is sufficient at the first place. - * - * Later on, however, the name can be changed using dc_set_chat_name(). - * The image cannot be changed to have a unique, recognizable icon in the chat lists. - * All in all, this is also what other messengers are doing here. - */ - public createBroadcastList(accountId: T.U32): Promise { - return (this._transport.request('create_broadcast_list', [accountId] as RPC.Params)) as Promise; - } - - /** - * Set group name. - * - * If the group is already _promoted_ (any message was sent to the group), - * all group members are informed by a special status message that is sent automatically by this function. - * - * Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent. - */ - public setChatName(accountId: T.U32, chatId: T.U32, newName: string): Promise { - return (this._transport.request('set_chat_name', [accountId, chatId, newName] as RPC.Params)) as Promise; - } - - /** - * Set group profile image. - * - * If the group is already _promoted_ (any message was sent to the group), - * all group members are informed by a special status message that is sent automatically by this function. - * - * Sends out #DC_EVENT_CHAT_MODIFIED and #DC_EVENT_MSGS_CHANGED if a status message was sent. - * - * To find out the profile image of a chat, use dc_chat_get_profile_image() - * - * @param image_path Full path of the image to use as the group image. The image will immediately be copied to the - * `blobdir`; the original image will not be needed anymore. - * If you pass null here, the group image is deleted (for promoted groups, all members are informed about - * this change anyway). - */ - public setChatProfileImage(accountId: T.U32, chatId: T.U32, imagePath: (string|null)): Promise { - return (this._transport.request('set_chat_profile_image', [accountId, chatId, imagePath] as RPC.Params)) as Promise; - } - - - public setChatVisibility(accountId: T.U32, chatId: T.U32, visibility: T.ChatVisibility): Promise { - return (this._transport.request('set_chat_visibility', [accountId, chatId, visibility] as RPC.Params)) as Promise; - } - - - public setChatEphemeralTimer(accountId: T.U32, chatId: T.U32, timer: T.U32): Promise { - return (this._transport.request('set_chat_ephemeral_timer', [accountId, chatId, timer] as RPC.Params)) as Promise; - } - - - public getChatEphemeralTimer(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('get_chat_ephemeral_timer', [accountId, chatId] as RPC.Params)) as Promise; - } - - - public addDeviceMessage(accountId: T.U32, label: string, text: string): Promise { - return (this._transport.request('add_device_message', [accountId, label, text] as RPC.Params)) as Promise; - } - - /** - * Mark all messages in a chat as _noticed_. - * _Noticed_ messages are no longer _fresh_ and do not count as being unseen - * but are still waiting for being marked as "seen" using markseen_msgs() - * (IMAP/MDNs is not done for noticed messages). - * - * Calling this function usually results in the event #DC_EVENT_MSGS_NOTICED. - * See also markseen_msgs(). - */ - public marknoticedChat(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('marknoticed_chat', [accountId, chatId] as RPC.Params)) as Promise; - } - - - public getFirstUnreadMessageOfChat(accountId: T.U32, chatId: T.U32): Promise<(T.U32|null)> { - return (this._transport.request('get_first_unread_message_of_chat', [accountId, chatId] as RPC.Params)) as Promise<(T.U32|null)>; - } - - /** - * Set mute duration of a chat. - * - * The UI can then call is_chat_muted() when receiving a new message - * to decide whether it should trigger an notification. - * - * Muted chats should not sound or vibrate - * and should not show a visual notification in the system area. - * Moreover, muted chats should be excluded from global badge counter - * (get_fresh_msgs() skips muted chats therefore) - * and the in-app, per-chat badge counter should use a less obtrusive color. - * - * Sends out #DC_EVENT_CHAT_MODIFIED. - */ - public setChatMuteDuration(accountId: T.U32, chatId: T.U32, duration: T.MuteDuration): Promise { - return (this._transport.request('set_chat_mute_duration', [accountId, chatId, duration] as RPC.Params)) as Promise; - } - - /** - * Check whether the chat is currently muted (can be changed by set_chat_mute_duration()). - * - * This is available as a standalone function outside of fullchat, because it might be only needed for notification - */ - public isChatMuted(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('is_chat_muted', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Mark messages as presented to the user. - * Typically, UIs call this function on scrolling through the message list, - * when the messages are presented at least for a little moment. - * The concrete action depends on the type of the chat and on the users settings - * (dc_msgs_presented() may be a better name therefore, but well. :) - * - * - For normal chats, the IMAP state is updated, MDN is sent - * (if set_config()-options `mdns_enabled` is set) - * and the internal state is changed to @ref DC_STATE_IN_SEEN to reflect these actions. - * - * - For contact requests, no IMAP or MDNs is done - * and the internal state is not changed therefore. - * See also marknoticed_chat(). - * - * Moreover, timer is started for incoming ephemeral messages. - * This also happens for contact requests chats. - * - * One #DC_EVENT_MSGS_NOTICED event is emitted per modified chat. - */ - public markseenMsgs(accountId: T.U32, msgIds: (T.U32)[]): Promise { - return (this._transport.request('markseen_msgs', [accountId, msgIds] as RPC.Params)) as Promise; - } - - - public getMessageIds(accountId: T.U32, chatId: T.U32, flags: T.U32): Promise<(T.U32)[]> { - return (this._transport.request('get_message_ids', [accountId, chatId, flags] as RPC.Params)) as Promise<(T.U32)[]>; - } - - - public getMessageListItems(accountId: T.U32, chatId: T.U32, flags: T.U32): Promise<(T.MessageListItem)[]> { - return (this._transport.request('get_message_list_items', [accountId, chatId, flags] as RPC.Params)) as Promise<(T.MessageListItem)[]>; - } - - - public getMessage(accountId: T.U32, messageId: T.U32): Promise { - return (this._transport.request('get_message', [accountId, messageId] as RPC.Params)) as Promise; - } - - - public getMessageHtml(accountId: T.U32, messageId: T.U32): Promise<(string|null)> { - return (this._transport.request('get_message_html', [accountId, messageId] as RPC.Params)) as Promise<(string|null)>; - } - - - public getMessages(accountId: T.U32, messageIds: (T.U32)[]): Promise> { - return (this._transport.request('get_messages', [accountId, messageIds] as RPC.Params)) as Promise>; - } - - /** - * Fetch info desktop needs for creating a notification for a message - */ - public getMessageNotificationInfo(accountId: T.U32, messageId: T.U32): Promise { - return (this._transport.request('get_message_notification_info', [accountId, messageId] as RPC.Params)) as Promise; - } - - /** - * Delete messages. The messages are deleted on the current device and - * on the IMAP server. - */ - public deleteMessages(accountId: T.U32, messageIds: (T.U32)[]): Promise { - return (this._transport.request('delete_messages', [accountId, messageIds] as RPC.Params)) as Promise; - } - - /** - * Get an informational text for a single message. The text is multiline and may - * contain e.g. the raw text of the message. - * - * The max. text returned is typically longer (about 100000 characters) than the - * max. text returned by dc_msg_get_text() (about 30000 characters). - */ - public getMessageInfo(accountId: T.U32, messageId: T.U32): Promise { - return (this._transport.request('get_message_info', [accountId, messageId] as RPC.Params)) as Promise; - } - - /** - * Asks the core to start downloading a message fully. - * This function is typically called when the user hits the "Download" button - * that is shown by the UI in case `download_state` is `'Available'` or `'Failure'` - * - * On success, the @ref DC_MSG "view type of the message" may change - * or the message may be replaced completely by one or more messages with other message IDs. - * That may happen e.g. in cases where the message was encrypted - * and the type could not be determined without fully downloading. - * Downloaded content can be accessed as usual after download. - * - * To reflect these changes a @ref DC_EVENT_MSGS_CHANGED event will be emitted. - */ - public downloadFullMessage(accountId: T.U32, messageId: T.U32): Promise { - return (this._transport.request('download_full_message', [accountId, messageId] as RPC.Params)) as Promise; - } - - /** - * Search messages containing the given query string. - * Searching can be done globally (chat_id=0) or in a specified chat only (chat_id set). - * - * Global chat results are typically displayed using dc_msg_get_summary(), chat - * search results may just hilite the corresponding messages and present a - * prev/next button. - * - * For global search, result is limited to 1000 messages, - * this allows incremental search done fast. - * So, when getting exactly 1000 results, the result may be truncated; - * the UIs may display sth. as "1000+ messages found" in this case. - * Chat search (if a chat_id is set) is not limited. - */ - public searchMessages(accountId: T.U32, query: string, chatId: (T.U32|null)): Promise<(T.U32)[]> { - return (this._transport.request('search_messages', [accountId, query, chatId] as RPC.Params)) as Promise<(T.U32)[]>; - } - - - public messageIdsToSearchResults(accountId: T.U32, messageIds: (T.U32)[]): Promise> { - return (this._transport.request('message_ids_to_search_results', [accountId, messageIds] as RPC.Params)) as Promise>; - } - - /** - * Get a single contact options by ID. - */ - public getContact(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('get_contact', [accountId, contactId] as RPC.Params)) as Promise; - } - - /** - * Add a single contact as a result of an explicit user action. - * - * Returns contact id of the created or existing contact - */ - public createContact(accountId: T.U32, email: string, name: (string|null)): Promise { - return (this._transport.request('create_contact', [accountId, email, name] as RPC.Params)) as Promise; - } - - /** - * Returns contact id of the created or existing DM chat with that contact - */ - public createChatByContactId(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('create_chat_by_contact_id', [accountId, contactId] as RPC.Params)) as Promise; - } - - - public blockContact(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('block_contact', [accountId, contactId] as RPC.Params)) as Promise; - } - - - public unblockContact(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('unblock_contact', [accountId, contactId] as RPC.Params)) as Promise; - } - - - public getBlockedContacts(accountId: T.U32): Promise<(T.Contact)[]> { - return (this._transport.request('get_blocked_contacts', [accountId] as RPC.Params)) as Promise<(T.Contact)[]>; - } - - - public getContactIds(accountId: T.U32, listFlags: T.U32, query: (string|null)): Promise<(T.U32)[]> { - return (this._transport.request('get_contact_ids', [accountId, listFlags, query] as RPC.Params)) as Promise<(T.U32)[]>; - } - - /** - * Get a list of contacts. - * (formerly called getContacts2 in desktop) - */ - public getContacts(accountId: T.U32, listFlags: T.U32, query: (string|null)): Promise<(T.Contact)[]> { - return (this._transport.request('get_contacts', [accountId, listFlags, query] as RPC.Params)) as Promise<(T.Contact)[]>; - } - - - public getContactsByIds(accountId: T.U32, ids: (T.U32)[]): Promise> { - return (this._transport.request('get_contacts_by_ids', [accountId, ids] as RPC.Params)) as Promise>; - } - - - public deleteContact(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('delete_contact', [accountId, contactId] as RPC.Params)) as Promise; - } - - - public changeContactName(accountId: T.U32, contactId: T.U32, name: string): Promise { - return (this._transport.request('change_contact_name', [accountId, contactId, name] as RPC.Params)) as Promise; - } - - /** - * Get encryption info for a contact. - * Get a multi-line encryption info, containing your fingerprint and the - * fingerprint of the contact, used e.g. to compare the fingerprints for a simple out-of-band verification. - */ - public getContactEncryptionInfo(accountId: T.U32, contactId: T.U32): Promise { - return (this._transport.request('get_contact_encryption_info', [accountId, contactId] as RPC.Params)) as Promise; - } - - /** - * Check if an e-mail address belongs to a known and unblocked contact. - * To get a list of all known and unblocked contacts, use contacts_get_contacts(). - * - * To validate an e-mail address independently of the contact database - * use check_email_validity(). - */ - public lookupContactIdByAddr(accountId: T.U32, addr: string): Promise<(T.U32|null)> { - return (this._transport.request('lookup_contact_id_by_addr', [accountId, addr] as RPC.Params)) as Promise<(T.U32|null)>; - } - - /** - * Returns all message IDs of the given types in a chat. - * Typically used to show a gallery. - * - * The list is already sorted and starts with the oldest message. - * Clients should not try to re-sort the list as this would be an expensive action - * and would result in inconsistencies between clients. - * - * Setting `chat_id` to `None` (`null` in typescript) means get messages with media - * from any chat of the currently used account. - */ - public getChatMedia(accountId: T.U32, chatId: (T.U32|null), messageType: T.Viewtype, orMessageType2: (T.Viewtype|null), orMessageType3: (T.Viewtype|null)): Promise<(T.U32)[]> { - return (this._transport.request('get_chat_media', [accountId, chatId, messageType, orMessageType2, orMessageType3] as RPC.Params)) as Promise<(T.U32)[]>; - } - - /** - * Search next/previous message based on a given message and a list of types. - * Typically used to implement the "next" and "previous" buttons - * in a gallery or in a media player. - * - * one combined call for getting chat::get_next_media for both directions - * the manual chat::get_next_media in only one direction is not exposed by the jsonrpc yet - */ - public getNeighboringChatMedia(accountId: T.U32, msgId: T.U32, messageType: T.Viewtype, orMessageType2: (T.Viewtype|null), orMessageType3: (T.Viewtype|null)): Promise<[(T.U32|null),(T.U32|null)]> { - return (this._transport.request('get_neighboring_chat_media', [accountId, msgId, messageType, orMessageType2, orMessageType3] as RPC.Params)) as Promise<[(T.U32|null),(T.U32|null)]>; - } - - - public exportBackup(accountId: T.U32, destination: string, passphrase: (string|null)): Promise { - return (this._transport.request('export_backup', [accountId, destination, passphrase] as RPC.Params)) as Promise; - } - - - public importBackup(accountId: T.U32, path: string, passphrase: (string|null)): Promise { - return (this._transport.request('import_backup', [accountId, path, passphrase] as RPC.Params)) as Promise; - } - - /** - * Indicate that the network likely has come back. - * or just that the network conditions might have changed - */ - public maybeNetwork(): Promise { - return (this._transport.request('maybe_network', [] as RPC.Params)) as Promise; - } - - /** - * Get the current connectivity, i.e. whether the device is connected to the IMAP server. - * One of: - * - DC_CONNECTIVITY_NOT_CONNECTED (1000-1999): Show e.g. the string "Not connected" or a red dot - * - DC_CONNECTIVITY_CONNECTING (2000-2999): Show e.g. the string "Connecting…" or a yellow dot - * - DC_CONNECTIVITY_WORKING (3000-3999): Show e.g. the string "Getting new messages" or a spinning wheel - * - DC_CONNECTIVITY_CONNECTED (>=4000): Show e.g. the string "Connected" or a green dot - * - * We don't use exact values but ranges here so that we can split up - * states into multiple states in the future. - * - * Meant as a rough overview that can be shown - * e.g. in the title of the main screen. - * - * If the connectivity changes, a #DC_EVENT_CONNECTIVITY_CHANGED will be emitted. - */ - public getConnectivity(accountId: T.U32): Promise { - return (this._transport.request('get_connectivity', [accountId] as RPC.Params)) as Promise; - } - - /** - * Get an overview of the current connectivity, and possibly more statistics. - * Meant to give the user more insight about the current status than - * the basic connectivity info returned by get_connectivity(); show this - * e.g., if the user taps on said basic connectivity info. - * - * If this page changes, a #DC_EVENT_CONNECTIVITY_CHANGED will be emitted. - * - * This comes as an HTML from the core so that we can easily improve it - * and the improvement instantly reaches all UIs. - */ - public getConnectivityHtml(accountId: T.U32): Promise { - return (this._transport.request('get_connectivity_html', [accountId] as RPC.Params)) as Promise; - } - - - public getLocations(accountId: T.U32, chatId: (T.U32|null), contactId: (T.U32|null), timestampBegin: T.I64, timestampEnd: T.I64): Promise<(T.Location)[]> { - return (this._transport.request('get_locations', [accountId, chatId, contactId, timestampBegin, timestampEnd] as RPC.Params)) as Promise<(T.Location)[]>; - } - - - public sendWebxdcStatusUpdate(accountId: T.U32, instanceMsgId: T.U32, updateStr: string, description: string): Promise { - return (this._transport.request('send_webxdc_status_update', [accountId, instanceMsgId, updateStr, description] as RPC.Params)) as Promise; - } - - - public getWebxdcStatusUpdates(accountId: T.U32, instanceMsgId: T.U32, lastKnownSerial: T.U32): Promise { - return (this._transport.request('get_webxdc_status_updates', [accountId, instanceMsgId, lastKnownSerial] as RPC.Params)) as Promise; - } - - /** - * Get info from a webxdc message - */ - public getWebxdcInfo(accountId: T.U32, instanceMsgId: T.U32): Promise { - return (this._transport.request('get_webxdc_info', [accountId, instanceMsgId] as RPC.Params)) as Promise; - } - - /** - * Forward messages to another chat. - * - * All types of messages can be forwarded, - * however, they will be flagged as such (dc_msg_is_forwarded() is set). - * - * Original sender, info-state and webxdc updates are not forwarded on purpose. - */ - public forwardMessages(accountId: T.U32, messageIds: (T.U32)[], chatId: T.U32): Promise { - return (this._transport.request('forward_messages', [accountId, messageIds, chatId] as RPC.Params)) as Promise; - } - - - public sendSticker(accountId: T.U32, chatId: T.U32, stickerPath: string): Promise { - return (this._transport.request('send_sticker', [accountId, chatId, stickerPath] as RPC.Params)) as Promise; - } - - /** - * Send a reaction to message. - * - * Reaction is a string of emojis separated by spaces. Reaction to a - * single message can be sent multiple times. The last reaction - * received overrides all previously received reactions. It is - * possible to remove all reactions by sending an empty string. - */ - public sendReaction(accountId: T.U32, messageId: T.U32, reaction: (string)[]): Promise { - return (this._transport.request('send_reaction', [accountId, messageId, reaction] as RPC.Params)) as Promise; - } - - - public removeDraft(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('remove_draft', [accountId, chatId] as RPC.Params)) as Promise; - } - - /** - * Get draft for a chat, if any. - */ - public getDraft(accountId: T.U32, chatId: T.U32): Promise<(T.Message|null)> { - return (this._transport.request('get_draft', [accountId, chatId] as RPC.Params)) as Promise<(T.Message|null)>; - } - - - public sendVideochatInvitation(accountId: T.U32, chatId: T.U32): Promise { - return (this._transport.request('send_videochat_invitation', [accountId, chatId] as RPC.Params)) as Promise; - } - - - public miscGetStickerFolder(accountId: T.U32): Promise { - return (this._transport.request('misc_get_sticker_folder', [accountId] as RPC.Params)) as Promise; - } - - /** - * save a sticker to a collection/folder in the account's sticker folder - */ - public miscSaveSticker(accountId: T.U32, msgId: T.U32, collection: string): Promise { - return (this._transport.request('misc_save_sticker', [accountId, msgId, collection] as RPC.Params)) as Promise; - } - - /** - * for desktop, get stickers from stickers folder, - * grouped by the collection/folder they are in. - */ - public miscGetStickers(accountId: T.U32): Promise> { - return (this._transport.request('misc_get_stickers', [accountId] as RPC.Params)) as Promise>; - } - - /** - * Returns the messageid of the sent message - */ - public miscSendTextMessage(accountId: T.U32, chatId: T.U32, text: string): Promise { - return (this._transport.request('misc_send_text_message', [accountId, chatId, text] as RPC.Params)) as Promise; - } - - - public miscSendMsg(accountId: T.U32, chatId: T.U32, text: (string|null), file: (string|null), location: ([T.F64,T.F64]|null), quotedMessageId: (T.U32|null)): Promise<[T.U32,T.Message]> { - return (this._transport.request('misc_send_msg', [accountId, chatId, text, file, location, quotedMessageId] as RPC.Params)) as Promise<[T.U32,T.Message]>; - } - - - public miscSetDraft(accountId: T.U32, chatId: T.U32, text: (string|null), file: (string|null), quotedMessageId: (T.U32|null)): Promise { - return (this._transport.request('misc_set_draft', [accountId, chatId, text, file, quotedMessageId] as RPC.Params)) as Promise; - } - - -} diff --git a/deltachat-jsonrpc/typescript/generated/constants.ts b/deltachat-jsonrpc/typescript/generated/constants.ts deleted file mode 100644 index ea0ba57dc..000000000 --- a/deltachat-jsonrpc/typescript/generated/constants.ts +++ /dev/null @@ -1,199 +0,0 @@ -// Generated! - -export enum C { - DC_CERTCK_ACCEPT_INVALID_CERTIFICATES = 3, - DC_CERTCK_AUTO = 0, - DC_CERTCK_STRICT = 1, - DC_CHAT_ID_ALLDONE_HINT = 7, - DC_CHAT_ID_ARCHIVED_LINK = 6, - DC_CHAT_ID_LAST_SPECIAL = 9, - DC_CHAT_ID_TRASH = 3, - DC_CHAT_TYPE_BROADCAST = 160, - DC_CHAT_TYPE_GROUP = 120, - DC_CHAT_TYPE_MAILINGLIST = 140, - DC_CHAT_TYPE_SINGLE = 100, - DC_CHAT_TYPE_UNDEFINED = 0, - DC_CONNECTIVITY_CONNECTED = 4000, - DC_CONNECTIVITY_CONNECTING = 2000, - DC_CONNECTIVITY_NOT_CONNECTED = 1000, - DC_CONNECTIVITY_WORKING = 3000, - DC_CONTACT_ID_DEVICE = 5, - DC_CONTACT_ID_INFO = 2, - DC_CONTACT_ID_LAST_SPECIAL = 9, - DC_CONTACT_ID_SELF = 1, - DC_GCL_ADD_ALLDONE_HINT = 4, - DC_GCL_ADD_SELF = 2, - DC_GCL_ARCHIVED_ONLY = 1, - DC_GCL_FOR_FORWARDING = 8, - DC_GCL_NO_SPECIALS = 2, - DC_GCL_VERIFIED_ONLY = 1, - DC_GCM_ADDDAYMARKER = 1, - DC_GCM_INFO_ONLY = 2, - DC_KEY_GEN_DEFAULT = 0, - DC_KEY_GEN_ED25519 = 2, - DC_KEY_GEN_RSA2048 = 1, - DC_LP_AUTH_NORMAL = 4, - DC_LP_AUTH_OAUTH2 = 2, - DC_MEDIA_QUALITY_BALANCED = 0, - DC_MEDIA_QUALITY_WORSE = 1, - DC_MSG_ID_DAYMARKER = 9, - DC_MSG_ID_LAST_SPECIAL = 9, - DC_MSG_ID_MARKER1 = 1, - DC_PROVIDER_STATUS_BROKEN = 3, - DC_PROVIDER_STATUS_OK = 1, - DC_PROVIDER_STATUS_PREPARATION = 2, - DC_SHOW_EMAILS_ACCEPTED_CONTACTS = 1, - DC_SHOW_EMAILS_ALL = 2, - DC_SHOW_EMAILS_OFF = 0, - DC_SOCKET_AUTO = 0, - DC_SOCKET_PLAIN = 3, - DC_SOCKET_SSL = 1, - DC_SOCKET_STARTTLS = 2, - DC_STATE_IN_FRESH = 10, - DC_STATE_IN_NOTICED = 13, - DC_STATE_IN_SEEN = 16, - DC_STATE_OUT_DELIVERED = 26, - DC_STATE_OUT_DRAFT = 19, - DC_STATE_OUT_FAILED = 24, - DC_STATE_OUT_MDN_RCVD = 28, - DC_STATE_OUT_PENDING = 20, - DC_STATE_OUT_PREPARING = 18, - DC_STATE_UNDEFINED = 0, - DC_STR_AC_SETUP_MSG_BODY = 43, - DC_STR_AC_SETUP_MSG_SUBJECT = 42, - DC_STR_ADD_MEMBER_BY_OTHER = 129, - DC_STR_ADD_MEMBER_BY_YOU = 128, - DC_STR_AEAP_ADDR_CHANGED = 122, - DC_STR_AEAP_EXPLANATION_AND_LINK = 123, - DC_STR_ARCHIVEDCHATS = 40, - DC_STR_AUDIO = 11, - DC_STR_BAD_TIME_MSG_BODY = 85, - DC_STR_BROADCAST_LIST = 115, - DC_STR_CANNOT_LOGIN = 60, - DC_STR_CANTDECRYPT_MSG_BODY = 29, - DC_STR_CONFIGURATION_FAILED = 84, - DC_STR_CONNECTED = 107, - DC_STR_CONNTECTING = 108, - DC_STR_CONTACT_NOT_VERIFIED = 36, - DC_STR_CONTACT_SETUP_CHANGED = 37, - DC_STR_CONTACT_VERIFIED = 35, - DC_STR_DEVICE_MESSAGES = 68, - DC_STR_DEVICE_MESSAGES_HINT = 70, - DC_STR_DOWNLOAD_AVAILABILITY = 100, - DC_STR_DRAFT = 3, - DC_STR_E2E_AVAILABLE = 25, - DC_STR_E2E_PREFERRED = 34, - DC_STR_ENCRYPTEDMSG = 24, - DC_STR_ENCR_NONE = 28, - DC_STR_ENCR_TRANSP = 27, - DC_STR_EPHEMERAL_DAY = 79, - DC_STR_EPHEMERAL_DAYS = 95, - DC_STR_EPHEMERAL_DISABLED = 75, - DC_STR_EPHEMERAL_FOUR_WEEKS = 81, - DC_STR_EPHEMERAL_HOUR = 78, - DC_STR_EPHEMERAL_HOURS = 94, - DC_STR_EPHEMERAL_MINUTE = 77, - DC_STR_EPHEMERAL_MINUTES = 93, - DC_STR_EPHEMERAL_SECONDS = 76, - DC_STR_EPHEMERAL_TIMER_1_DAY_BY_OTHER = 147, - DC_STR_EPHEMERAL_TIMER_1_DAY_BY_YOU = 146, - DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_OTHER = 145, - DC_STR_EPHEMERAL_TIMER_1_HOUR_BY_YOU = 144, - DC_STR_EPHEMERAL_TIMER_1_MINUTE_BY_OTHER = 143, - DC_STR_EPHEMERAL_TIMER_1_MINUTE_BY_YOU = 142, - DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_OTHER = 149, - DC_STR_EPHEMERAL_TIMER_1_WEEK_BY_YOU = 148, - DC_STR_EPHEMERAL_TIMER_DAYS_BY_OTHER = 155, - DC_STR_EPHEMERAL_TIMER_DAYS_BY_YOU = 154, - DC_STR_EPHEMERAL_TIMER_DISABLED_BY_OTHER = 139, - DC_STR_EPHEMERAL_TIMER_DISABLED_BY_YOU = 138, - DC_STR_EPHEMERAL_TIMER_HOURS_BY_OTHER = 153, - DC_STR_EPHEMERAL_TIMER_HOURS_BY_YOU = 152, - DC_STR_EPHEMERAL_TIMER_MINUTES_BY_OTHER = 151, - DC_STR_EPHEMERAL_TIMER_MINUTES_BY_YOU = 150, - DC_STR_EPHEMERAL_TIMER_SECONDS_BY_OTHER = 141, - DC_STR_EPHEMERAL_TIMER_SECONDS_BY_YOU = 140, - DC_STR_EPHEMERAL_TIMER_WEEKS_BY_OTHER = 157, - DC_STR_EPHEMERAL_TIMER_WEEKS_BY_YOU = 156, - DC_STR_EPHEMERAL_WEEK = 80, - DC_STR_EPHEMERAL_WEEKS = 96, - DC_STR_ERROR = 112, - DC_STR_ERROR_NO_NETWORK = 87, - DC_STR_FAILED_SENDING_TO = 74, - DC_STR_FILE = 12, - DC_STR_FINGERPRINTS = 30, - DC_STR_FORWARDED = 97, - DC_STR_GIF = 23, - DC_STR_GROUP_IMAGE_CHANGED_BY_OTHER = 127, - DC_STR_GROUP_IMAGE_CHANGED_BY_YOU = 126, - DC_STR_GROUP_IMAGE_DELETED_BY_OTHER = 135, - DC_STR_GROUP_IMAGE_DELETED_BY_YOU = 134, - DC_STR_GROUP_LEFT_BY_OTHER = 133, - DC_STR_GROUP_LEFT_BY_YOU = 132, - DC_STR_GROUP_NAME_CHANGED_BY_OTHER = 125, - DC_STR_GROUP_NAME_CHANGED_BY_YOU = 124, - DC_STR_IMAGE = 9, - DC_STR_INCOMING_MESSAGES = 103, - DC_STR_LAST_MSG_SENT_SUCCESSFULLY = 111, - DC_STR_LOCATION = 66, - DC_STR_LOCATION_ENABLED_BY_OTHER = 137, - DC_STR_LOCATION_ENABLED_BY_YOU = 136, - DC_STR_MESSAGES = 114, - DC_STR_MSGACTIONBYME = 63, - DC_STR_MSGACTIONBYUSER = 62, - DC_STR_MSGADDMEMBER = 17, - DC_STR_MSGDELMEMBER = 18, - DC_STR_MSGGROUPLEFT = 19, - DC_STR_MSGGRPIMGCHANGED = 16, - DC_STR_MSGGRPIMGDELETED = 33, - DC_STR_MSGGRPNAME = 15, - DC_STR_MSGLOCATIONDISABLED = 65, - DC_STR_MSGLOCATIONENABLED = 64, - DC_STR_NOMESSAGES = 1, - DC_STR_NOT_CONNECTED = 121, - DC_STR_NOT_SUPPORTED_BY_PROVIDER = 113, - DC_STR_ONE_MOMENT = 106, - DC_STR_OUTGOING_MESSAGES = 104, - DC_STR_PARTIAL_DOWNLOAD_MSG_BODY = 99, - DC_STR_PART_OF_TOTAL_USED = 116, - DC_STR_PROTECTION_DISABLED = 89, - DC_STR_PROTECTION_DISABLED_BY_OTHER = 161, - DC_STR_PROTECTION_DISABLED_BY_YOU = 160, - DC_STR_PROTECTION_ENABLED = 88, - DC_STR_PROTECTION_ENABLED_BY_OTHER = 159, - DC_STR_PROTECTION_ENABLED_BY_YOU = 158, - DC_STR_QUOTA_EXCEEDING_MSG_BODY = 98, - DC_STR_READRCPT = 31, - DC_STR_READRCPT_MAILBODY = 32, - DC_STR_REMOVE_MEMBER_BY_OTHER = 131, - DC_STR_REMOVE_MEMBER_BY_YOU = 130, - DC_STR_REPLY_NOUN = 90, - DC_STR_SAVED_MESSAGES = 69, - DC_STR_SECURE_JOIN_GROUP_QR_DESC = 120, - DC_STR_SECURE_JOIN_REPLIES = 118, - DC_STR_SECURE_JOIN_STARTED = 117, - DC_STR_SELF = 2, - DC_STR_SELF_DELETED_MSG_BODY = 91, - DC_STR_SENDING = 110, - DC_STR_SERVER_TURNED_OFF = 92, - DC_STR_SETUP_CONTACT_QR_DESC = 119, - DC_STR_STICKER = 67, - DC_STR_STORAGE_ON_DOMAIN = 105, - DC_STR_SUBJECT_FOR_NEW_CONTACT = 73, - DC_STR_SYNC_MSG_BODY = 102, - DC_STR_SYNC_MSG_SUBJECT = 101, - DC_STR_UNKNOWN_SENDER_FOR_CHAT = 72, - DC_STR_UPDATE_REMINDER_MSG_BODY = 86, - DC_STR_UPDATING = 109, - DC_STR_VIDEO = 10, - DC_STR_VIDEOCHAT_INVITATION = 82, - DC_STR_VIDEOCHAT_INVITE_MSG_BODY = 83, - DC_STR_VOICEMESSAGE = 7, - DC_STR_WELCOME_MESSAGE = 71, - DC_TEXT1_DRAFT = 1, - DC_TEXT1_SELF = 3, - DC_TEXT1_USERNAME = 2, - DC_VIDEOCHATTYPE_BASICWEBRTC = 1, - DC_VIDEOCHATTYPE_JITSI = 2, - DC_VIDEOCHATTYPE_UNKNOWN = 0, -} diff --git a/deltachat-jsonrpc/typescript/generated/events.ts b/deltachat-jsonrpc/typescript/generated/events.ts deleted file mode 100644 index 39c0b60ef..000000000 --- a/deltachat-jsonrpc/typescript/generated/events.ts +++ /dev/null @@ -1,214 +0,0 @@ -// AUTO-GENERATED by typescript-type-def - -export type U32=number; -export type Usize=number; -export type Event=(({ -/** - * The library-user may write an informational string to the log. - * - * This event should *not* be reported to the end-user using a popup or something like - * that. - */ -"type":"Info";}&{"msg":string;})|({ -/** - * Emitted when SMTP connection is established and login was successful. - */ -"type":"SmtpConnected";}&{"msg":string;})|({ -/** - * Emitted when IMAP connection is established and login was successful. - */ -"type":"ImapConnected";}&{"msg":string;})|({ -/** - * Emitted when a message was successfully sent to the SMTP server. - */ -"type":"SmtpMessageSent";}&{"msg":string;})|({ -/** - * Emitted when an IMAP message has been marked as deleted - */ -"type":"ImapMessageDeleted";}&{"msg":string;})|({ -/** - * Emitted when an IMAP message has been moved - */ -"type":"ImapMessageMoved";}&{"msg":string;})|({ -/** - * Emitted when an new file in the $BLOBDIR was created - */ -"type":"NewBlobFile";}&{"file":string;})|({ -/** - * Emitted when an file in the $BLOBDIR was deleted - */ -"type":"DeletedBlobFile";}&{"file":string;})|({ -/** - * The library-user should write a warning string to the log. - * - * This event should *not* be reported to the end-user using a popup or something like - * that. - */ -"type":"Warning";}&{"msg":string;})|({ -/** - * The library-user should report an error to the end-user. - * - * As most things are asynchronous, things may go wrong at any time and the user - * should not be disturbed by a dialog or so. Instead, use a bubble or so. - * - * However, for ongoing processes (eg. configure()) - * or for functions that are expected to fail (eg. autocryptContinueKeyTransfer()) - * it might be better to delay showing these events until the function has really - * failed (returned false). It should be sufficient to report only the *last* error - * in a messasge box then. - */ -"type":"Error";}&{"msg":string;})|({ -/** - * An action cannot be performed because the user is not in the group. - * Reported eg. after a call to - * setChatName(), setChatProfileImage(), - * addContactToChat(), removeContactFromChat(), - * and messages sending functions. - */ -"type":"ErrorSelfNotInGroup";}&{"msg":string;})|({ -/** - * Messages or chats changed. One or more messages or chats changed for various - * reasons in the database: - * - Messages sent, received or removed - * - Chats created, deleted or archived - * - A draft has been set - * - * `chatId` is set if only a single chat is affected by the changes, otherwise 0. - * `msgId` is set if only a single message is affected by the changes, otherwise 0. - */ -"type":"MsgsChanged";}&{"chatId":U32;"msgId":U32;})|({ -/** - * Reactions for the message changed. - */ -"type":"ReactionsChanged";}&{"chatId":U32;"msgId":U32;"contactId":U32;})|({ -/** - * There is a fresh message. Typically, the user will show an notification - * when receiving this message. - * - * There is no extra #DC_EVENT_MSGS_CHANGED event send together with this event. - */ -"type":"IncomingMsg";}&{"chatId":U32;"msgId":U32;})|({ -/** - * Downloading a bunch of messages just finished. This is an experimental - * event to allow the UI to only show one notification per message bunch, - * instead of cluttering the user with many notifications. - * - * msg_ids contains the message ids. - */ -"type":"IncomingMsgBunch";}&{"msgIds":(U32)[];})|({ -/** - * Messages were seen or noticed. - * chat id is always set. - */ -"type":"MsgsNoticed";}&{"chatId":U32;})|({ -/** - * A single message is sent successfully. State changed from DC_STATE_OUT_PENDING to - * DC_STATE_OUT_DELIVERED, see `Message.state`. - */ -"type":"MsgDelivered";}&{"chatId":U32;"msgId":U32;})|({ -/** - * A single message could not be sent. State changed from DC_STATE_OUT_PENDING or DC_STATE_OUT_DELIVERED to - * DC_STATE_OUT_FAILED, see `Message.state`. - */ -"type":"MsgFailed";}&{"chatId":U32;"msgId":U32;})|({ -/** - * A single message is read by the receiver. State changed from DC_STATE_OUT_DELIVERED to - * DC_STATE_OUT_MDN_RCVD, see `Message.state`. - */ -"type":"MsgRead";}&{"chatId":U32;"msgId":U32;})|({ -/** - * Chat changed. The name or the image of a chat group was changed or members were added or removed. - * Or the verify state of a chat has changed. - * See setChatName(), setChatProfileImage(), addContactToChat() - * and removeContactFromChat(). - * - * This event does not include ephemeral timer modification, which - * is a separate event. - */ -"type":"ChatModified";}&{"chatId":U32;})|({ -/** - * Chat ephemeral timer changed. - */ -"type":"ChatEphemeralTimerModified";}&{"chatId":U32;"timer":U32;})|({ -/** - * Contact(s) created, renamed, blocked or deleted. - * - * @param data1 (int) If set, this is the contact_id of an added contact that should be selected. - */ -"type":"ContactsChanged";}&{"contactId":(U32|null);})|({ -/** - * Location of one or more contact has changed. - * - * @param data1 (u32) contact_id of the contact for which the location has changed. - * If the locations of several contacts have been changed, - * this parameter is set to `None`. - */ -"type":"LocationChanged";}&{"contactId":(U32|null);})|({ -/** - * Inform about the configuration progress started by configure(). - */ -"type":"ConfigureProgress";}&{ -/** - * Progress. - * - * 0=error, 1-999=progress in permille, 1000=success and done - */ -"progress":Usize; -/** - * Progress comment or error, something to display to the user. - */ -"comment":(string|null);})|({ -/** - * Inform about the import/export progress started by imex(). - * - * @param data1 (usize) 0=error, 1-999=progress in permille, 1000=success and done - * @param data2 0 - */ -"type":"ImexProgress";}&{"progress":Usize;})|({ -/** - * A file has been exported. A file has been written by imex(). - * This event may be sent multiple times by a single call to imex(). - * - * A typical purpose for a handler of this event may be to make the file public to some system - * services. - * - * @param data2 0 - */ -"type":"ImexFileWritten";}&{"path":string;})|({ -/** - * Progress information of a secure-join handshake from the view of the inviter - * (Alice, the person who shows the QR code). - * - * These events are typically sent after a joiner has scanned the QR code - * generated by getChatSecurejoinQrCodeSvg(). - * - * @param data1 (int) ID of the contact that wants to join. - * @param data2 (int) Progress as: - * 300=vg-/vc-request received, typically shown as "bob@addr joins". - * 600=vg-/vc-request-with-auth received, vg-member-added/vc-contact-confirm sent, typically shown as "bob@addr verified". - * 800=vg-member-added-received received, shown as "bob@addr securely joined GROUP", only sent for the verified-group-protocol. - * 1000=Protocol finished for this contact. - */ -"type":"SecurejoinInviterProgress";}&{"contactId":U32;"progress":Usize;})|({ -/** - * Progress information of a secure-join handshake from the view of the joiner - * (Bob, the person who scans the QR code). - * The events are typically sent while secureJoin(), which - * may take some time, is executed. - * @param data1 (int) ID of the inviting contact. - * @param data2 (int) Progress as: - * 400=vg-/vc-request-with-auth sent, typically shown as "alice@addr verified, introducing myself." - * (Bob has verified alice and waits until Alice does the same for him) - */ -"type":"SecurejoinJoinerProgress";}&{"contactId":U32;"progress":Usize;})|{ -/** - * The connectivity to the server changed. - * This means that you should refresh the connectivity view - * and possibly the connectivtiy HTML; see getConnectivity() and - * getConnectivityHtml() for details. - */ -"type":"ConnectivityChanged";}|{"type":"SelfavatarChanged";}|({"type":"WebxdcStatusUpdate";}&{"msgId":U32;"statusUpdateSerial":U32;})|({ -/** - * Inform that a message containing a webxdc instance has been deleted - */ -"type":"WebxdcInstanceDeleted";}&{"msgId":U32;})); diff --git a/deltachat-jsonrpc/typescript/generated/jsonrpc.ts b/deltachat-jsonrpc/typescript/generated/jsonrpc.ts deleted file mode 100644 index 0c5a51e82..000000000 --- a/deltachat-jsonrpc/typescript/generated/jsonrpc.ts +++ /dev/null @@ -1,10 +0,0 @@ -// AUTO-GENERATED by typescript-type-def - -export type JSONValue=(null|boolean|number|string|(JSONValue)[]|{[key:string]:JSONValue;}); -export type Params=((JSONValue)[]|Record); -export type U32=number; -export type Request={"jsonrpc":"2.0";"method":string;"params"?:Params;"id"?:U32;}; -export type I32=number; -export type Error={"code":I32;"message":string;"data"?:JSONValue;}; -export type Response={"jsonrpc":"2.0";"id":(U32|null);"result"?:JSONValue;"error"?:Error;}; -export type Message=(Request|Response); diff --git a/deltachat-jsonrpc/typescript/generated/types.ts b/deltachat-jsonrpc/typescript/generated/types.ts deleted file mode 100644 index e3a3055a2..000000000 --- a/deltachat-jsonrpc/typescript/generated/types.ts +++ /dev/null @@ -1,198 +0,0 @@ -// AUTO-GENERATED by typescript-type-def - -export type U32=number; -export type Account=(({"type":"Configured";}&{"id":U32;"displayName":(string|null);"addr":(string|null);"profileImage":(string|null);"color":string;})|({"type":"Unconfigured";}&{"id":U32;})); -export type U64=number; -export type ProviderInfo={"beforeLoginHint":string;"overviewPage":string;"status":U32;}; -export type Qr=(({"type":"askVerifyContact";}&{"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"askVerifyGroup";}&{"grpname":string;"grpid":string;"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"fprOk";}&{"contact_id":U32;})|({"type":"fprMismatch";}&{"contact_id":(U32|null);})|({"type":"fprWithoutAddr";}&{"fingerprint":string;})|({"type":"account";}&{"domain":string;})|({"type":"webrtcInstance";}&{"domain":string;"instance_pattern":string;})|({"type":"addr";}&{"contact_id":U32;"draft":(string|null);})|({"type":"url";}&{"url":string;})|({"type":"text";}&{"text":string;})|({"type":"withdrawVerifyContact";}&{"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"withdrawVerifyGroup";}&{"grpname":string;"grpid":string;"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"reviveVerifyContact";}&{"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"reviveVerifyGroup";}&{"grpname":string;"grpid":string;"contact_id":U32;"fingerprint":string;"invitenumber":string;"authcode":string;})|({"type":"login";}&{"address":string;})); -export type Usize=number; -export type I64=number; -export type ChatListEntry=[U32,U32]; -export type ChatListItemFetchResult=(({"type":"ChatListItem";}&{"id":U32;"name":string;"avatarPath":(string|null);"color":string;"lastUpdated":(I64|null);"summaryText1":string;"summaryText2":string;"summaryStatus":U32;"isProtected":boolean;"isGroup":boolean;"freshMessageCounter":Usize;"isSelfTalk":boolean;"isDeviceTalk":boolean;"isSendingLocation":boolean;"isSelfInGroup":boolean;"isArchived":boolean;"isPinned":boolean;"isMuted":boolean;"isContactRequest":boolean; -/** - * true when chat is a broadcastlist - */ -"isBroadcast":boolean; -/** - * contact id if this is a dm chat (for view profile entry in context menu) - */ -"dmChatContact":(U32|null);"wasSeenRecently":boolean;})|{"type":"ArchiveLink";}|({"type":"Error";}&{"id":U32;"error":string;})); -export type Contact={"address":string;"color":string;"authName":string;"status":string;"displayName":string;"id":U32;"name":string;"profileImage":(string|null);"nameAndAddr":string;"isBlocked":boolean;"isVerified":boolean; -/** - * the contact's last seen timestamp - */ -"lastSeen":I64;"wasSeenRecently":boolean;}; -export type FullChat={"id":U32;"name":string;"isProtected":boolean;"profileImage":(string|null);"archived":boolean;"chatType":U32;"isUnpromoted":boolean;"isSelfTalk":boolean;"contacts":(Contact)[];"contactIds":(U32)[];"color":string;"freshMessageCounter":Usize;"isContactRequest":boolean;"isDeviceChat":boolean;"selfInGroup":boolean;"isMuted":boolean;"ephemeralTimer":U32;"canSend":boolean;"wasSeenRecently":boolean;"mailingListAddress":(string|null);}; - -/** - * cheaper version of fullchat, omits: - * - contacts - * - contact_ids - * - fresh_message_counter - * - ephemeral_timer - * - self_in_group - * - was_seen_recently - * - can_send - * - * used when you only need the basic metadata of a chat like type, name, profile picture - */ -export type BasicChat= -/** - * cheaper version of fullchat, omits: - * - contacts - * - contact_ids - * - fresh_message_counter - * - ephemeral_timer - * - self_in_group - * - was_seen_recently - * - can_send - * - * used when you only need the basic metadata of a chat like type, name, profile picture - */ -{"id":U32;"name":string;"isProtected":boolean;"profileImage":(string|null);"archived":boolean;"chatType":U32;"isUnpromoted":boolean;"isSelfTalk":boolean;"color":string;"isContactRequest":boolean;"isDeviceChat":boolean;"isMuted":boolean;}; -export type ChatVisibility=("Normal"|"Archived"|"Pinned"); -export type MuteDuration=("NotMuted"|"Forever"|{"Until":I64;}); -export type MessageListItem=(({"kind":"message";}&{"msg_id":U32;})|({ -/** - * Day marker, separating messages that correspond to different - * days according to local time. - */ -"kind":"dayMarker";}&{ -/** - * Marker timestamp, for day markers, in unix milliseconds - */ -"timestamp":I64;})); -export type Viewtype=("Unknown"| -/** - * Text message. - */ -"Text"| -/** - * Image message. - * If the image is an animated GIF, the type `Viewtype.Gif` should be used. - */ -"Image"| -/** - * Animated GIF message. - */ -"Gif"| -/** - * Message containing a sticker, similar to image. - * If possible, the ui should display the image without borders in a transparent way. - * A click on a sticker will offer to install the sticker set in some future. - */ -"Sticker"| -/** - * Message containing an Audio file. - */ -"Audio"| -/** - * A voice message that was directly recorded by the user. - * For all other audio messages, the type `Viewtype.Audio` should be used. - */ -"Voice"| -/** - * Video messages. - */ -"Video"| -/** - * Message containing any file, eg. a PDF. - */ -"File"| -/** - * Message is an invitation to a videochat. - */ -"VideochatInvitation"| -/** - * Message is an webxdc instance. - */ -"Webxdc"); -export type MessageQuote=(({"kind":"JustText";}&{"text":string;})|({"kind":"WithMessage";}&{"text":string;"messageId":U32;"authorDisplayName":string;"authorDisplayColor":string;"overrideSenderName":(string|null);"image":(string|null);"isForwarded":boolean;"viewType":Viewtype;})); -export type SystemMessageType=("Unknown"|"GroupNameChanged"|"GroupImageChanged"|"MemberAddedToGroup"|"MemberRemovedFromGroup"|"AutocryptSetupMessage"|"SecurejoinMessage"|"LocationStreamingEnabled"|"LocationOnly"| -/** - * Chat ephemeral message timer is changed. - */ -"EphemeralTimerChanged"|"ChatProtectionEnabled"|"ChatProtectionDisabled"| -/** - * Self-sent-message that contains only json used for multi-device-sync; - * if possible, we attach that to other messages as for locations. - */ -"MultiDeviceSync"|"WebxdcStatusUpdate"| -/** - * Webxdc info added with `info` set in `send_webxdc_status_update()`. - */ -"WebxdcInfoMessage"); -export type I32=number; -export type WebxdcMessageInfo={ -/** - * The name of the app. - * - * Defaults to the filename if not set in the manifest. - */ -"name":string; -/** - * App icon file name. - * Defaults to an standard icon if nothing is set in the manifest. - * - * To get the file, use dc_msg_get_webxdc_blob(). (not yet in jsonrpc, use rust api or cffi for it) - * - * App icons should should be square, - * the implementations will add round corners etc. as needed. - */ -"icon":string; -/** - * if the Webxdc represents a document, then this is the name of the document - */ -"document":(string|null); -/** - * short string describing the state of the app, - * sth. as "2 votes", "Highscore: 123", - * can be changed by the apps - */ -"summary":(string|null); -/** - * URL where the source code of the Webxdc and other information can be found; - * defaults to an empty string. - * Implementations may offer an menu or a button to open this URL. - */ -"sourceCodeUrl":(string|null); -/** - * True if full internet access should be granted to the app. - */ -"internetAccess":boolean;}; -export type DownloadState=("Done"|"Available"|"Failure"|"InProgress"); - -/** - * Structure representing all reactions to a particular message. - */ -export type Reactions= -/** - * Structure representing all reactions to a particular message. - */ -{ -/** - * Map from a contact to it's reaction to message. - */ -"reactionsByContact":Record; -/** - * Unique reactions and their count - */ -"reactions":Record;}; -export type Message={"id":U32;"chatId":U32;"fromId":U32;"quote":(MessageQuote|null);"parentId":(U32|null);"text":(string|null);"hasLocation":boolean;"hasHtml":boolean;"viewType":Viewtype;"state":U32;"timestamp":I64;"sortTimestamp":I64;"receivedTimestamp":I64;"hasDeviatingTimestamp":boolean;"subject":string;"showPadlock":boolean;"isSetupmessage":boolean;"isInfo":boolean;"isForwarded":boolean; -/** - * when is_info is true this describes what type of system message it is - */ -"systemMessageType":SystemMessageType;"duration":I32;"dimensionsHeight":I32;"dimensionsWidth":I32;"videochatType":(U32|null);"videochatUrl":(string|null);"overrideSenderName":(string|null);"sender":Contact;"setupCodeBegin":(string|null);"file":(string|null);"fileMime":(string|null);"fileBytes":U64;"fileName":(string|null);"webxdcInfo":(WebxdcMessageInfo|null);"downloadState":DownloadState;"reactions":(Reactions|null);}; -export type MessageNotificationInfo={"id":U32;"chatId":U32;"accountId":U32;"image":(string|null);"imageMimeType":(string|null);"chatName":string;"chatProfileImage":(string|null); -/** - * also known as summary_text1 - */ -"summaryPrefix":(string|null); -/** - * also known as summary_text2 - */ -"summaryText":string;}; -export type MessageSearchResult={"id":U32;"authorProfileImage":(string|null);"authorName":string;"authorColor":string;"chatName":(string|null);"message":string;"timestamp":I64;}; -export type F64=number; -export type Location={"locationId":U32;"isIndependent":boolean;"latitude":F64;"longitude":F64;"accuracy":F64;"timestamp":I64;"contactId":U32;"msgId":U32;"chatId":U32;"marker":(string|null);}; -export type __AllTyps=[string,boolean,Record,U32,U32,null,(U32)[],U32,null,(U32|null),(Account)[],null,null,U32,null,U32,null,U32,Account,U32,U64,U32,string,(ProviderInfo|null),U32,boolean,U32,Record,U32,string,(string|null),null,U32,Record,null,U32,string,null,U32,string,Qr,U32,string,(string|null),U32,(string)[],Record,Record,null,U32,null,U32,null,U32,string,(string|null),null,U32,string,(string|null),null,U32,(U32)[],U32,U32,Usize,U32,boolean,I64,Usize,U32,string,U32,U32,string,null,U32,(U32|null),(string|null),(U32|null),(ChatListEntry)[],U32,(ChatListEntry)[],Record,U32,U32,FullChat,U32,U32,BasicChat,U32,U32,null,U32,U32,null,U32,U32,null,U32,U32,string,U32,(U32|null),[string,string],U32,string,U32,U32,U32,null,U32,U32,U32,null,U32,U32,U32,null,U32,U32,(U32)[],U32,string,boolean,U32,U32,U32,U32,U32,string,null,U32,U32,(string|null),null,U32,U32,ChatVisibility,null,U32,U32,U32,null,U32,U32,U32,U32,string,string,U32,U32,U32,null,U32,U32,(U32|null),U32,U32,MuteDuration,null,U32,U32,boolean,U32,(U32)[],null,U32,U32,U32,(U32)[],U32,U32,U32,(MessageListItem)[],U32,U32,Message,U32,U32,(string|null),U32,(U32)[],Record,U32,U32,MessageNotificationInfo,U32,(U32)[],null,U32,U32,string,U32,U32,null,U32,string,(U32|null),(U32)[],U32,(U32)[],Record,U32,U32,Contact,U32,string,(string|null),U32,U32,U32,U32,U32,U32,null,U32,U32,null,U32,(Contact)[],U32,U32,(string|null),(U32)[],U32,U32,(string|null),(Contact)[],U32,(U32)[],Record,U32,U32,boolean,U32,U32,string,null,U32,U32,string,U32,string,(U32|null),U32,(U32|null),Viewtype,(Viewtype|null),(Viewtype|null),(U32)[],U32,U32,Viewtype,(Viewtype|null),(Viewtype|null),[(U32|null),(U32|null)],U32,string,(string|null),null,U32,string,(string|null),null,null,U32,U32,U32,string,U32,(U32|null),(U32|null),I64,I64,(Location)[],U32,U32,string,string,null,U32,U32,U32,string,U32,U32,WebxdcMessageInfo,U32,(U32)[],U32,null,U32,U32,string,U32,U32,U32,(string)[],U32,U32,U32,null,U32,U32,(Message|null),U32,U32,U32,U32,string,U32,U32,string,null,U32,Record,U32,U32,string,U32,U32,U32,(string|null),(string|null),([F64,F64]|null),(U32|null),[U32,Message],U32,U32,(string|null),(string|null),(U32|null),null];