talkyzap-wapp-api 1.0.0
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.
- package/CHANGELOG.md +486 -0
- package/LICENSE +190 -0
- package/README.md +143 -0
- package/dist/assert/assertChat.d.ts +27 -0
- package/dist/assert/assertColor.d.ts +35 -0
- package/dist/assert/assertIsBusiness.d.ts +20 -0
- package/dist/assert/assertProduct.d.ts +22 -0
- package/dist/assert/assertWid.d.ts +28 -0
- package/dist/assert/index.d.ts +20 -0
- package/dist/blocklist/events/eventTypes.d.ts +18 -0
- package/dist/blocklist/events/index.d.ts +16 -0
- package/dist/blocklist/events/registerSyncedEvent.d.ts +16 -0
- package/dist/blocklist/functions/all.d.ts +17 -0
- package/dist/blocklist/functions/blockContact.d.ts +18 -0
- package/dist/blocklist/functions/index.d.ts +19 -0
- package/dist/blocklist/functions/isBlocked.d.ts +17 -0
- package/dist/blocklist/functions/unblockContact.d.ts +18 -0
- package/dist/blocklist/index.d.ts +17 -0
- package/dist/blocklist/types.d.ts +20 -0
- package/dist/call/events/eventTypes.d.ts +56 -0
- package/dist/call/events/index.d.ts +16 -0
- package/dist/call/events/registerIncomingCallEvent.d.ts +16 -0
- package/dist/call/functions/accept.d.ts +38 -0
- package/dist/call/functions/end.d.ts +36 -0
- package/dist/call/functions/index.d.ts +19 -0
- package/dist/call/functions/offer.d.ts +33 -0
- package/dist/call/functions/parseRelayResponse.d.ts +31 -0
- package/dist/call/functions/prepareDestination.d.ts +17 -0
- package/dist/call/functions/reject.d.ts +36 -0
- package/dist/call/index.d.ts +17 -0
- package/dist/catalog/functions/addProductImage.d.ts +28 -0
- package/dist/catalog/functions/changeProductImage.d.ts +28 -0
- package/dist/catalog/functions/createCollection.d.ts +26 -0
- package/dist/catalog/functions/createProduct.d.ts +47 -0
- package/dist/catalog/functions/deleteCollection.d.ts +26 -0
- package/dist/catalog/functions/deleteProduct.d.ts +30 -0
- package/dist/catalog/functions/editCollection.d.ts +32 -0
- package/dist/catalog/functions/editProduct.d.ts +37 -0
- package/dist/catalog/functions/getCollections.d.ts +31 -0
- package/dist/catalog/functions/getMyCatalog.d.ts +27 -0
- package/dist/catalog/functions/getProductById.d.ts +28 -0
- package/dist/catalog/functions/getProducts.d.ts +27 -0
- package/dist/catalog/functions/index.d.ts +30 -0
- package/dist/catalog/functions/removeProductImage.d.ts +29 -0
- package/dist/catalog/functions/setProductVisibility.d.ts +30 -0
- package/dist/catalog/functions/updateCartEnabled.d.ts +30 -0
- package/dist/catalog/index.d.ts +16 -0
- package/dist/chat/defaultSendMessageOptions.d.ts +19 -0
- package/dist/chat/events/eventTypes.d.ts +183 -0
- package/dist/chat/events/index.d.ts +25 -0
- package/dist/chat/events/registerAckMessageEvent.d.ts +16 -0
- package/dist/chat/events/registerActiveChatEvent.d.ts +16 -0
- package/dist/chat/events/registerEditedMessageEvent.d.ts +16 -0
- package/dist/chat/events/registerLabelEvent.d.ts +16 -0
- package/dist/chat/events/registerLiveLocationUpdateEvent.d.ts +16 -0
- package/dist/chat/events/registerNewMessageEvent.d.ts +16 -0
- package/dist/chat/events/registerPollEvent.d.ts +16 -0
- package/dist/chat/events/registerPresenceChange.d.ts +16 -0
- package/dist/chat/events/registerReactionsEvent.d.ts +16 -0
- package/dist/chat/events/registerRevokeMessageEvent.d.ts +16 -0
- package/dist/chat/functions/archive.d.ts +54 -0
- package/dist/chat/functions/canMarkPlayed.d.ts +27 -0
- package/dist/chat/functions/canMute.d.ts +27 -0
- package/dist/chat/functions/canReply.d.ts +27 -0
- package/dist/chat/functions/clear.d.ts +26 -0
- package/dist/chat/functions/delete.d.ts +26 -0
- package/dist/chat/functions/deleteMessage.d.ts +48 -0
- package/dist/chat/functions/downloadMedia.d.ts +29 -0
- package/dist/chat/functions/editMessage.d.ts +30 -0
- package/dist/chat/functions/find.d.ts +24 -0
- package/dist/chat/functions/forwardMessage.d.ts +32 -0
- package/dist/chat/functions/generateMessageID.d.ts +22 -0
- package/dist/chat/functions/get.d.ts +22 -0
- package/dist/chat/functions/getActiveChat.d.ts +30 -0
- package/dist/chat/functions/getLastSeen.d.ts +25 -0
- package/dist/chat/functions/getMessageACK.d.ts +60 -0
- package/dist/chat/functions/getMessageById.d.ts +33 -0
- package/dist/chat/functions/getMessages.d.ts +86 -0
- package/dist/chat/functions/getPlatformFromMessage.d.ts +34 -0
- package/dist/chat/functions/getQuotedMsg.d.ts +22 -0
- package/dist/chat/functions/getQuotedMsgKey.d.ts +22 -0
- package/dist/chat/functions/getReactions.d.ts +48 -0
- package/dist/chat/functions/getVotes.d.ts +33 -0
- package/dist/chat/functions/index.d.ts +69 -0
- package/dist/chat/functions/keepMessage.d.ts +30 -0
- package/dist/chat/functions/list.d.ts +62 -0
- package/dist/chat/functions/markIsComposing.d.ts +31 -0
- package/dist/chat/functions/markIsPaused.d.ts +27 -0
- package/dist/chat/functions/markIsRead.d.ts +30 -0
- package/dist/chat/functions/markIsRecording.d.ts +31 -0
- package/dist/chat/functions/markIsUnread.d.ts +29 -0
- package/dist/chat/functions/markPlayed.d.ts +27 -0
- package/dist/chat/functions/mute.d.ts +45 -0
- package/dist/chat/functions/openChatAt.d.ts +27 -0
- package/dist/chat/functions/openChatBottom.d.ts +27 -0
- package/dist/chat/functions/openChatFromUnread.d.ts +27 -0
- package/dist/chat/functions/pin.d.ts +54 -0
- package/dist/chat/functions/pinMsg.d.ts +60 -0
- package/dist/chat/functions/prepareAudioWaveform.d.ts +26 -0
- package/dist/chat/functions/prepareLinkPreview.d.ts +53 -0
- package/dist/chat/functions/prepareMessageButtons.d.ts +52 -0
- package/dist/chat/functions/prepareRawMessage.d.ts +23 -0
- package/dist/chat/functions/requestPhoneNumber.d.ts +28 -0
- package/dist/chat/functions/sendCreatePollMessage.d.ts +49 -0
- package/dist/chat/functions/sendFileMessage.d.ts +181 -0
- package/dist/chat/functions/sendGroupInviteMessage.d.ts +56 -0
- package/dist/chat/functions/sendListMessage.d.ts +57 -0
- package/dist/chat/functions/sendLocationMessage.d.ts +100 -0
- package/dist/chat/functions/sendOrderMessage.d.ts +57 -0
- package/dist/chat/functions/sendRawMessage.d.ts +22 -0
- package/dist/chat/functions/sendReactionToMessage.d.ts +36 -0
- package/dist/chat/functions/sendScheduledCallMessage.d.ts +40 -0
- package/dist/chat/functions/sendTextMessage.d.ts +54 -0
- package/dist/chat/functions/sendVCardContactMessage.d.ts +47 -0
- package/dist/chat/functions/starMessage.d.ts +47 -0
- package/dist/chat/functions/unmute.d.ts +27 -0
- package/dist/chat/index.d.ts +20 -0
- package/dist/chat/patch.d.ts +16 -0
- package/dist/chat/types.d.ts +116 -0
- package/dist/community/functions/addSubgroups.d.ts +33 -0
- package/dist/community/functions/create.d.ts +27 -0
- package/dist/community/functions/deactivate.d.ts +27 -0
- package/dist/community/functions/demoteParticipants.d.ts +27 -0
- package/dist/community/functions/getParticipants.d.ts +27 -0
- package/dist/community/functions/index.d.ts +22 -0
- package/dist/community/functions/promoteParticipants.d.ts +27 -0
- package/dist/community/functions/removeSubgroups.d.ts +33 -0
- package/dist/community/index.d.ts +16 -0
- package/dist/config/Config.d.ts +74 -0
- package/dist/config/defaultConfig.d.ts +17 -0
- package/dist/config/eventTypes.d.ts +25 -0
- package/dist/config/index.d.ts +23 -0
- package/dist/conn/events/eventTypes.d.ts +92 -0
- package/dist/conn/events/index.d.ts +25 -0
- package/dist/conn/events/registerAuthCodeChangeEvent.d.ts +16 -0
- package/dist/conn/events/registerAuthenticatedEvent.d.ts +16 -0
- package/dist/conn/events/registerLogoutEvent.d.ts +16 -0
- package/dist/conn/events/registerMainInit.d.ts +16 -0
- package/dist/conn/events/registerMainLoadedEvent.d.ts +16 -0
- package/dist/conn/events/registerMainReadyEvent.d.ts +16 -0
- package/dist/conn/events/registerNeedsUpdateEvent.d.ts +16 -0
- package/dist/conn/events/registerOnlineEvent.d.ts +16 -0
- package/dist/conn/events/registerQRCodeIdleEvent.d.ts +16 -0
- package/dist/conn/events/registerRequireAuthEvent.d.ts +16 -0
- package/dist/conn/functions/genLinkDeviceCodeForPhoneNumber.d.ts +30 -0
- package/dist/conn/functions/getAuthCode.d.ts +28 -0
- package/dist/conn/functions/getHistorySyncProgress.d.ts +32 -0
- package/dist/conn/functions/getMyDeviceId.d.ts +26 -0
- package/dist/conn/functions/getMyUserId.d.ts +26 -0
- package/dist/conn/functions/getPlatform.d.ts +25 -0
- package/dist/conn/functions/index.d.ts +37 -0
- package/dist/conn/functions/isAuthenticated.d.ts +16 -0
- package/dist/conn/functions/isIdle.d.ts +16 -0
- package/dist/conn/functions/isMainInit.d.ts +24 -0
- package/dist/conn/functions/isMainLoaded.d.ts +24 -0
- package/dist/conn/functions/isMainReady.d.ts +24 -0
- package/dist/conn/functions/isMultiDevice.d.ts +16 -0
- package/dist/conn/functions/isOnline.d.ts +24 -0
- package/dist/conn/functions/isRegistered.d.ts +24 -0
- package/dist/conn/functions/joinWebBeta.d.ts +29 -0
- package/dist/conn/functions/logout.d.ts +16 -0
- package/dist/conn/functions/markAvailable.d.ts +33 -0
- package/dist/conn/functions/needsUpdate.d.ts +24 -0
- package/dist/conn/functions/refreshQR.d.ts +28 -0
- package/dist/conn/functions/setKeepAlive.d.ts +28 -0
- package/dist/conn/functions/setLimit.d.ts +65 -0
- package/dist/conn/functions/setMultiDevice.d.ts +23 -0
- package/dist/conn/index.d.ts +19 -0
- package/dist/conn/patch.d.ts +16 -0
- package/dist/conn/types.d.ts +31 -0
- package/dist/contact/functions/get.d.ts +27 -0
- package/dist/contact/functions/getBusinessProfile.d.ts +27 -0
- package/dist/contact/functions/getCommonGroups.d.ts +27 -0
- package/dist/contact/functions/getProfilePictureUrl.d.ts +27 -0
- package/dist/contact/functions/getStatus.d.ts +27 -0
- package/dist/contact/functions/index.d.ts +22 -0
- package/dist/contact/functions/list.d.ts +44 -0
- package/dist/contact/functions/queryExists.d.ts +47 -0
- package/dist/contact/index.d.ts +17 -0
- package/dist/contact/patch.d.ts +16 -0
- package/dist/deviceName.d.ts +16 -0
- package/dist/enums.d.ts +23 -0
- package/dist/eventEmitter/eventEmitter.d.ts +172 -0
- package/dist/eventEmitter/eventTypes.d.ts +34 -0
- package/dist/eventEmitter/index.d.ts +195 -0
- package/dist/group/events/eventTypes.d.ts +53 -0
- package/dist/group/events/index.d.ts +16 -0
- package/dist/group/events/registerParticipantsChangedEvent.d.ts +16 -0
- package/dist/group/functions/addParticipants.d.ts +59 -0
- package/dist/group/functions/approve.d.ts +30 -0
- package/dist/group/functions/canAdd.d.ts +28 -0
- package/dist/group/functions/canDemote.d.ts +28 -0
- package/dist/group/functions/canPromote.d.ts +28 -0
- package/dist/group/functions/canRemove.d.ts +28 -0
- package/dist/group/functions/create.d.ts +59 -0
- package/dist/group/functions/demoteParticipants.d.ts +29 -0
- package/dist/group/functions/ensureGroup.d.ts +17 -0
- package/dist/group/functions/ensureGroupAndParticipants.d.ts +20 -0
- package/dist/group/functions/getAllGroups.d.ts +26 -0
- package/dist/group/functions/getGroupInfoFromInviteCode.d.ts +51 -0
- package/dist/group/functions/getGroupSizeLimit.d.ts +27 -0
- package/dist/group/functions/getInviteCode.d.ts +28 -0
- package/dist/group/functions/getMembershipRequests.d.ts +33 -0
- package/dist/group/functions/getParticipants.d.ts +27 -0
- package/dist/group/functions/iAmAdmin.d.ts +17 -0
- package/dist/group/functions/iAmMember.d.ts +17 -0
- package/dist/group/functions/iAmRestrictedMember.d.ts +17 -0
- package/dist/group/functions/iAmSuperAdmin.d.ts +17 -0
- package/dist/group/functions/index.d.ts +46 -0
- package/dist/group/functions/join.d.ts +28 -0
- package/dist/group/functions/leave.d.ts +27 -0
- package/dist/group/functions/promoteParticipants.d.ts +31 -0
- package/dist/group/functions/reject.d.ts +30 -0
- package/dist/group/functions/removeIcon.d.ts +27 -0
- package/dist/group/functions/removeParticipants.d.ts +31 -0
- package/dist/group/functions/revokeInviteCode.d.ts +28 -0
- package/dist/group/functions/setDescription.d.ts +27 -0
- package/dist/group/functions/setIcon.d.ts +33 -0
- package/dist/group/functions/setProperty.d.ts +54 -0
- package/dist/group/functions/setSubject.d.ts +27 -0
- package/dist/group/index.d.ts +17 -0
- package/dist/gtag/Tracker.d.ts +52 -0
- package/dist/gtag/index.d.ts +18 -0
- package/dist/index.d.ts +42 -0
- package/dist/labels/functions/addNewLabel.d.ts +36 -0
- package/dist/labels/functions/addOrRemoveLabels.d.ts +31 -0
- package/dist/labels/functions/colorIsInLabelPalette.d.ts +26 -0
- package/dist/labels/functions/deleteAllLabels.d.ts +17 -0
- package/dist/labels/functions/deleteLabel.d.ts +21 -0
- package/dist/labels/functions/editLabel.d.ts +37 -0
- package/dist/labels/functions/getAllLabels.d.ts +17 -0
- package/dist/labels/functions/getLabelById.d.ts +17 -0
- package/dist/labels/functions/getLabelColorPalette.d.ts +19 -0
- package/dist/labels/functions/getNewLabelColor.d.ts +19 -0
- package/dist/labels/functions/index.d.ts +25 -0
- package/dist/labels/index.d.ts +17 -0
- package/dist/labels/types.d.ts +23 -0
- package/dist/newsletter/functions/create.d.ts +42 -0
- package/dist/newsletter/functions/destroy.d.ts +26 -0
- package/dist/newsletter/functions/edit.d.ts +58 -0
- package/dist/newsletter/functions/ensureNewsletter.d.ts +17 -0
- package/dist/newsletter/functions/index.d.ts +19 -0
- package/dist/newsletter/functions/mute.d.ts +33 -0
- package/dist/newsletter/index.d.ts +16 -0
- package/dist/order/events/eventTypes.d.ts +34 -0
- package/dist/order/events/index.d.ts +16 -0
- package/dist/order/events/registerUpdateOrderEvent.d.ts +16 -0
- package/dist/order/functions/get.d.ts +27 -0
- package/dist/order/functions/index.d.ts +16 -0
- package/dist/order/index.d.ts +17 -0
- package/dist/profile/functions/editBusinessProfile.d.ts +177 -0
- package/dist/profile/functions/getMyProfileName.d.ts +26 -0
- package/dist/profile/functions/getMyStatus.d.ts +26 -0
- package/dist/profile/functions/index.d.ts +23 -0
- package/dist/profile/functions/isBusiness.d.ts +25 -0
- package/dist/profile/functions/removeMyProfilePicture.d.ts +26 -0
- package/dist/profile/functions/setMyProfileName.d.ts +26 -0
- package/dist/profile/functions/setMyProfilePicture.d.ts +32 -0
- package/dist/profile/functions/setMyStatus.d.ts +26 -0
- package/dist/profile/index.d.ts +16 -0
- package/dist/status/defaultSendStatusOptions.d.ts +19 -0
- package/dist/status/events/eventTypes.d.ts +18 -0
- package/dist/status/events/index.d.ts +16 -0
- package/dist/status/events/registerSyncedEvent.d.ts +16 -0
- package/dist/status/functions/get.d.ts +17 -0
- package/dist/status/functions/getMyStatus.d.ts +17 -0
- package/dist/status/functions/index.d.ts +23 -0
- package/dist/status/functions/postSendStatus.d.ts +17 -0
- package/dist/status/functions/sendImageStatus.d.ts +26 -0
- package/dist/status/functions/sendRawStatus.d.ts +22 -0
- package/dist/status/functions/sendReadStatus.d.ts +25 -0
- package/dist/status/functions/sendTextStatus.d.ts +31 -0
- package/dist/status/functions/sendVideoStatus.d.ts +26 -0
- package/dist/status/functions/updateParticipants.d.ts +32 -0
- package/dist/status/index.d.ts +19 -0
- package/dist/status/patch.d.ts +16 -0
- package/dist/types.d.ts +18 -0
- package/dist/util/blobToArrayBuffer.d.ts +16 -0
- package/dist/util/blobToBase64.d.ts +16 -0
- package/dist/util/convertToFile.d.ts +16 -0
- package/dist/util/createWid.d.ts +19 -0
- package/dist/util/downloadImage.d.ts +20 -0
- package/dist/util/errors.d.ts +21 -0
- package/dist/util/fetchDataFromPNG.d.ts +16 -0
- package/dist/util/generateOrderUniqueId.d.ts +16 -0
- package/dist/util/getVideoInfoFromBuffer.d.ts +25 -0
- package/dist/util/index.d.ts +28 -0
- package/dist/util/isBase64.d.ts +16 -0
- package/dist/util/linkPreview.d.ts +41 -0
- package/dist/util/resizeImage.d.ts +17 -0
- package/dist/util/types.d.ts +42 -0
- package/dist/util/wrapFunction.d.ts +20 -0
- package/dist/webpack/eventTypes.d.ts +20 -0
- package/dist/webpack/index.d.ts +93 -0
- package/dist/whatsapp/collections/AggReactionsCollection.d.ts +24 -0
- package/dist/whatsapp/collections/BaseCollection.d.ts +47 -0
- package/dist/whatsapp/collections/BlocklistCollection.d.ts +25 -0
- package/dist/whatsapp/collections/BusinessCategoriesResultCollection.d.ts +24 -0
- package/dist/whatsapp/collections/BusinessProfileCollection.d.ts +27 -0
- package/dist/whatsapp/collections/ButtonCollection.d.ts +22 -0
- package/dist/whatsapp/collections/CallCollection.d.ts +30 -0
- package/dist/whatsapp/collections/CartCollection.d.ts +27 -0
- package/dist/whatsapp/collections/CartItemCollection.d.ts +23 -0
- package/dist/whatsapp/collections/CatalogCollection.d.ts +35 -0
- package/dist/whatsapp/collections/ChatCollection.d.ts +35 -0
- package/dist/whatsapp/collections/ChatstateCollection.d.ts +23 -0
- package/dist/whatsapp/collections/Collection.d.ts +67 -0
- package/dist/whatsapp/collections/ContactCollection.d.ts +37 -0
- package/dist/whatsapp/collections/EmojiVariantCollection.d.ts +27 -0
- package/dist/whatsapp/collections/GroupMetadataCollection.d.ts +24 -0
- package/dist/whatsapp/collections/LabelCollection.d.ts +40 -0
- package/dist/whatsapp/collections/LabelItemCollection.d.ts +23 -0
- package/dist/whatsapp/collections/MsgCollection.d.ts +46 -0
- package/dist/whatsapp/collections/MsgInfoCollection.d.ts +26 -0
- package/dist/whatsapp/collections/MsgInfoParticipantCollection.d.ts +24 -0
- package/dist/whatsapp/collections/MuteCollection.d.ts +33 -0
- package/dist/whatsapp/collections/OrderCollection.d.ts +28 -0
- package/dist/whatsapp/collections/OrderItemCollection.d.ts +23 -0
- package/dist/whatsapp/collections/ParticipantCollection.d.ts +38 -0
- package/dist/whatsapp/collections/PinInChatCollection.d.ts +29 -0
- package/dist/whatsapp/collections/PresenceCollection.d.ts +25 -0
- package/dist/whatsapp/collections/ProductCollCollection.d.ts +27 -0
- package/dist/whatsapp/collections/ProductCollection.d.ts +26 -0
- package/dist/whatsapp/collections/ProductImageCollection.d.ts +23 -0
- package/dist/whatsapp/collections/ProductMessageListCollection.d.ts +23 -0
- package/dist/whatsapp/collections/ProfilePicThumbCollection.d.ts +29 -0
- package/dist/whatsapp/collections/QuickReplyCollection.d.ts +35 -0
- package/dist/whatsapp/collections/ReactionsCollection.d.ts +32 -0
- package/dist/whatsapp/collections/ReactionsSendersCollection.d.ts +24 -0
- package/dist/whatsapp/collections/RecentEmojiCollection.d.ts +29 -0
- package/dist/whatsapp/collections/RecentStickerCollection.d.ts +28 -0
- package/dist/whatsapp/collections/StarredMsgCollection.d.ts +29 -0
- package/dist/whatsapp/collections/StatusCollection.d.ts +25 -0
- package/dist/whatsapp/collections/StatusV3Collection.d.ts +35 -0
- package/dist/whatsapp/collections/StickerCollection.d.ts +24 -0
- package/dist/whatsapp/collections/StickerPackCollection.d.ts +35 -0
- package/dist/whatsapp/collections/StickerSearchCollection.d.ts +29 -0
- package/dist/whatsapp/collections/TemplateButtonCollection.d.ts +24 -0
- package/dist/whatsapp/collections/index.d.ts +61 -0
- package/dist/whatsapp/contants/DROP_ATTR.d.ts +19 -0
- package/dist/whatsapp/contants/SANITIZED_VERSION_STR.d.ts +19 -0
- package/dist/whatsapp/contants/index.d.ts +17 -0
- package/dist/whatsapp/enums/ACK.d.ts +55 -0
- package/dist/whatsapp/enums/CALL_STATES.d.ts +34 -0
- package/dist/whatsapp/enums/GROUP_SETTING_TYPE.d.ts +25 -0
- package/dist/whatsapp/enums/KIC_ENTRY_POINT_TYP.d.ts +26 -0
- package/dist/whatsapp/enums/LogoutReason.d.ts +30 -0
- package/dist/whatsapp/enums/MSG_TYPE.d.ts +60 -0
- package/dist/whatsapp/enums/OUTWARD_TYPES.d.ts +27 -0
- package/dist/whatsapp/enums/PIN_STATE.d.ts +22 -0
- package/dist/whatsapp/enums/SOCKET_STATE.d.ts +42 -0
- package/dist/whatsapp/enums/SendMsgResult.d.ts +27 -0
- package/dist/whatsapp/enums/index.d.ts +24 -0
- package/dist/whatsapp/exportModule.d.ts +58 -0
- package/dist/whatsapp/functions/GROUP_JID.d.ts +21 -0
- package/dist/whatsapp/functions/addAndSendMessageEdit.d.ts +20 -0
- package/dist/whatsapp/functions/addAndSendMsgToChat.d.ts +22 -0
- package/dist/whatsapp/functions/addToLabelCollection.d.ts +22 -0
- package/dist/whatsapp/functions/blockContact.d.ts +30 -0
- package/dist/whatsapp/functions/calculateFilehashFromBlob.d.ts +19 -0
- package/dist/whatsapp/functions/canEditMsg.d.ts +20 -0
- package/dist/whatsapp/functions/canReplyMsg.d.ts +20 -0
- package/dist/whatsapp/functions/changeOptInStatusForExternalWebBeta.d.ts +19 -0
- package/dist/whatsapp/functions/collections.d.ts +37 -0
- package/dist/whatsapp/functions/colorIndexToHex.d.ts +20 -0
- package/dist/whatsapp/functions/contactFunctions.d.ts +140 -0
- package/dist/whatsapp/functions/createFanoutMsgStanza.d.ts +24 -0
- package/dist/whatsapp/functions/createGroup.d.ts +28 -0
- package/dist/whatsapp/functions/createMsgProtobuf.d.ts +25 -0
- package/dist/whatsapp/functions/createNewsletterQuery.d.ts +23 -0
- package/dist/whatsapp/functions/createOrUpdateReactions.d.ts +29 -0
- package/dist/whatsapp/functions/currencyForCountryShortcode.d.ts +19 -0
- package/dist/whatsapp/functions/deleteNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/editBusinessProfile.d.ts +20 -0
- package/dist/whatsapp/functions/editNewsletterMetadataAction.d.ts +28 -0
- package/dist/whatsapp/functions/encodeMaybeMediaType.d.ts +19 -0
- package/dist/whatsapp/functions/encryptAndSendGroupMsg.d.ts +22 -0
- package/dist/whatsapp/functions/encryptAndSendMsg.d.ts +34 -0
- package/dist/whatsapp/functions/encryptAndSendSenderKeyMsg.d.ts +34 -0
- package/dist/whatsapp/functions/encryptMsgProtobuf.d.ts +23 -0
- package/dist/whatsapp/functions/fetchLinkPreview.d.ts +48 -0
- package/dist/whatsapp/functions/findChat.d.ts +22 -0
- package/dist/whatsapp/functions/findCommonGroups.d.ts +21 -0
- package/dist/whatsapp/functions/findFirstWebLink.d.ts +21 -0
- package/dist/whatsapp/functions/forwardMessagesToChats.d.ts +20 -0
- package/dist/whatsapp/functions/frontendFireAndForget.d.ts +19 -0
- package/dist/whatsapp/functions/genLinkDeviceCodeForPhoneNumber.d.ts +19 -0
- package/dist/whatsapp/functions/genMinimalLinkPreview.d.ts +22 -0
- package/dist/whatsapp/functions/generateVideoThumbsAndDuration.d.ts +34 -0
- package/dist/whatsapp/functions/getABPropConfigValue.d.ts +21 -0
- package/dist/whatsapp/functions/getAsMms.d.ts +20 -0
- package/dist/whatsapp/functions/getCommunityParticipants.d.ts +20 -0
- package/dist/whatsapp/functions/getCountryShortcodeByPhone.d.ts +19 -0
- package/dist/whatsapp/functions/getCurrentLid.d.ts +21 -0
- package/dist/whatsapp/functions/getEphemeralFields.d.ts +24 -0
- package/dist/whatsapp/functions/getFanOutList.d.ts +24 -0
- package/dist/whatsapp/functions/getGroupSenderKeyList.d.ts +30 -0
- package/dist/whatsapp/functions/getGroupSizeLimit.d.ts +19 -0
- package/dist/whatsapp/functions/getHistorySyncProgress.d.ts +20 -0
- package/dist/whatsapp/functions/getMembershipApprovalRequests.d.ts +19 -0
- package/dist/whatsapp/functions/getNextLabelId.d.ts +18 -0
- package/dist/whatsapp/functions/getNumChatsPinned.d.ts +21 -0
- package/dist/whatsapp/functions/getOrderInfo.d.ts +20 -0
- package/dist/whatsapp/functions/getParticipants.d.ts +29 -0
- package/dist/whatsapp/functions/getPushname.d.ts +19 -0
- package/dist/whatsapp/functions/getQuotedMsgObj.d.ts +20 -0
- package/dist/whatsapp/functions/getReactions.d.ts +37 -0
- package/dist/whatsapp/functions/getSearchContext.d.ts +28 -0
- package/dist/whatsapp/functions/getVotes.d.ts +22 -0
- package/dist/whatsapp/functions/getWhatsAppWebExternalBetaJoinedIdb.d.ts +21 -0
- package/dist/whatsapp/functions/groupParticipants.d.ts +42 -0
- package/dist/whatsapp/functions/handleAck.d.ts +65 -0
- package/dist/whatsapp/functions/handleSingleMsg.d.ts +21 -0
- package/dist/whatsapp/functions/index.d.ts +134 -0
- package/dist/whatsapp/functions/initializeAltDeviceLinking.d.ts +19 -0
- package/dist/whatsapp/functions/isAnimatedWebp.d.ts +19 -0
- package/dist/whatsapp/functions/isAuthenticated.d.ts +27 -0
- package/dist/whatsapp/functions/isLegitErrorStack.d.ts +19 -0
- package/dist/whatsapp/functions/isRegistered.d.ts +19 -0
- package/dist/whatsapp/functions/isUnreadTypeMsg.d.ts +20 -0
- package/dist/whatsapp/functions/joinGroupViaInvite.d.ts +22 -0
- package/dist/whatsapp/functions/keepMessage.d.ts +23 -0
- package/dist/whatsapp/functions/labelAddAction.d.ts +20 -0
- package/dist/whatsapp/functions/markSeen.d.ts +34 -0
- package/dist/whatsapp/functions/mediaTypeFromProtobuf.d.ts +23 -0
- package/dist/whatsapp/functions/membershipApprovalRequestAction.d.ts +22 -0
- package/dist/whatsapp/functions/msgDataFromMsgModel.d.ts +19 -0
- package/dist/whatsapp/functions/msgFindQuery.d.ts +28 -0
- package/dist/whatsapp/functions/muteNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/processRawAudioVideo.d.ts +28 -0
- package/dist/whatsapp/functions/processRawMedia.d.ts +26 -0
- package/dist/whatsapp/functions/processRawSticker.d.ts +26 -0
- package/dist/whatsapp/functions/productVisibilitySet.d.ts +21 -0
- package/dist/whatsapp/functions/products.d.ts +43 -0
- package/dist/whatsapp/functions/profilePic.d.ts +36 -0
- package/dist/whatsapp/functions/queryAllGroups.d.ts +42 -0
- package/dist/whatsapp/functions/queryGroupInviteCode.d.ts +22 -0
- package/dist/whatsapp/functions/queryNewsletterMetadataByJid.d.ts +32 -0
- package/dist/whatsapp/functions/randomHex.d.ts +20 -0
- package/dist/whatsapp/functions/randomId.d.ts +22 -0
- package/dist/whatsapp/functions/resetGroupInviteCode.d.ts +22 -0
- package/dist/whatsapp/functions/sendClear.d.ts +21 -0
- package/dist/whatsapp/functions/sendCreateCommunity.d.ts +44 -0
- package/dist/whatsapp/functions/sendCreateGroup.d.ts +32 -0
- package/dist/whatsapp/functions/sendDelete.d.ts +21 -0
- package/dist/whatsapp/functions/sendExitGroup.d.ts +21 -0
- package/dist/whatsapp/functions/sendGroupParticipants.d.ts +50 -0
- package/dist/whatsapp/functions/sendJoinGroupViaInvite.d.ts +20 -0
- package/dist/whatsapp/functions/sendNewsletterMessageJob.d.ts +28 -0
- package/dist/whatsapp/functions/sendPinInChatMsg.d.ts +25 -0
- package/dist/whatsapp/functions/sendQueryExists.d.ts +36 -0
- package/dist/whatsapp/functions/sendQueryGroupInvite.d.ts +46 -0
- package/dist/whatsapp/functions/sendQueryGroupInviteCode.d.ts +18 -0
- package/dist/whatsapp/functions/sendReactionToMsg.d.ts +21 -0
- package/dist/whatsapp/functions/sendRevokeGroupInviteCode.d.ts +20 -0
- package/dist/whatsapp/functions/sendTextMsgToChat.d.ts +20 -0
- package/dist/whatsapp/functions/setArchive.d.ts +31 -0
- package/dist/whatsapp/functions/setGroup.d.ts +29 -0
- package/dist/whatsapp/functions/setPin.d.ts +23 -0
- package/dist/whatsapp/functions/setPushname.d.ts +19 -0
- package/dist/whatsapp/functions/status.d.ts +31 -0
- package/dist/whatsapp/functions/syncABPropsTask.d.ts +19 -0
- package/dist/whatsapp/functions/typeAttributeFromProtobuf.d.ts +22 -0
- package/dist/whatsapp/functions/unixTime.d.ts +23 -0
- package/dist/whatsapp/functions/unmuteNewsletter.d.ts +19 -0
- package/dist/whatsapp/functions/updateCartEnabled.d.ts +19 -0
- package/dist/whatsapp/functions/updateDBForGroupAction.d.ts +50 -0
- package/dist/whatsapp/functions/updateNewsletterMsgRecord.d.ts +20 -0
- package/dist/whatsapp/functions/updateParticipants.d.ts +27 -0
- package/dist/whatsapp/functions/uploadMedia.d.ts +19 -0
- package/dist/whatsapp/functions/uploadProductImage.d.ts +20 -0
- package/dist/whatsapp/functions/uploadThumbnail.d.ts +38 -0
- package/dist/whatsapp/functions/upsertVotes.d.ts +29 -0
- package/dist/whatsapp/index.d.ts +25 -0
- package/dist/whatsapp/misc/Base64.d.ts +27 -0
- package/dist/whatsapp/misc/Browser.d.ts +34 -0
- package/dist/whatsapp/misc/ChatPresence.d.ts +28 -0
- package/dist/whatsapp/misc/Cmd.d.ts +159 -0
- package/dist/whatsapp/misc/Conn.d.ts +20 -0
- package/dist/whatsapp/misc/Constants.d.ts +48 -0
- package/dist/whatsapp/misc/EventEmitter.d.ts +107 -0
- package/dist/whatsapp/misc/ImageUtils.d.ts +26 -0
- package/dist/whatsapp/misc/IsOfficialClient.d.ts +21 -0
- package/dist/whatsapp/misc/MediaBlobCache.d.ts +34 -0
- package/dist/whatsapp/misc/MediaEntry.d.ts +37 -0
- package/dist/whatsapp/misc/MediaObject.d.ts +67 -0
- package/dist/whatsapp/misc/MediaObjectUtil.d.ts +22 -0
- package/dist/whatsapp/misc/MediaPrep.d.ts +48 -0
- package/dist/whatsapp/misc/MediaUtils.d.ts +24 -0
- package/dist/whatsapp/misc/MsgKey.d.ts +47 -0
- package/dist/whatsapp/misc/MsgLoadState.d.ts +36 -0
- package/dist/whatsapp/misc/NetworkStatus.d.ts +20 -0
- package/dist/whatsapp/misc/OpaqueData.d.ts +43 -0
- package/dist/whatsapp/misc/ProductCatalogSession.d.ts +27 -0
- package/dist/whatsapp/misc/ServerProps.d.ts +20 -0
- package/dist/whatsapp/misc/Socket.d.ts +20 -0
- package/dist/whatsapp/misc/Stream.d.ts +20 -0
- package/dist/whatsapp/misc/UserPrefs.d.ts +39 -0
- package/dist/whatsapp/misc/VCard.d.ts +29 -0
- package/dist/whatsapp/misc/Wid.d.ts +68 -0
- package/dist/whatsapp/misc/WidFactory.d.ts +33 -0
- package/dist/whatsapp/misc/index.d.ts +42 -0
- package/dist/whatsapp/models/AggReactionsModel.d.ts +41 -0
- package/dist/whatsapp/models/AttachMediaModel.d.ts +73 -0
- package/dist/whatsapp/models/BlocklistModel.d.ts +41 -0
- package/dist/whatsapp/models/BusinessCategoriesResultModel.d.ts +41 -0
- package/dist/whatsapp/models/BusinessProfileModel.d.ts +54 -0
- package/dist/whatsapp/models/CallModel.d.ts +53 -0
- package/dist/whatsapp/models/CallParticipantModel.d.ts +50 -0
- package/dist/whatsapp/models/CartItemModel.d.ts +43 -0
- package/dist/whatsapp/models/CartModel.d.ts +44 -0
- package/dist/whatsapp/models/CatalogModel.d.ts +53 -0
- package/dist/whatsapp/models/ChatModel.d.ts +201 -0
- package/dist/whatsapp/models/ChatPreferenceModel.d.ts +43 -0
- package/dist/whatsapp/models/ChatstateModel.d.ts +44 -0
- package/dist/whatsapp/models/ConnModel.d.ts +72 -0
- package/dist/whatsapp/models/ContactModel.d.ts +230 -0
- package/dist/whatsapp/models/ConversionTupleModel.d.ts +45 -0
- package/dist/whatsapp/models/EmojiVariantModel.d.ts +37 -0
- package/dist/whatsapp/models/GroupMetadataModel.d.ts +101 -0
- package/dist/whatsapp/models/HistorySyncProgressModel.d.ts +40 -0
- package/dist/whatsapp/models/LabelItemModel.d.ts +39 -0
- package/dist/whatsapp/models/LabelModel.d.ts +41 -0
- package/dist/whatsapp/models/MediaDataModel.d.ts +82 -0
- package/dist/whatsapp/models/Model.d.ts +63 -0
- package/dist/whatsapp/models/ModelChatBase.d.ts +45 -0
- package/dist/whatsapp/models/MsgButtonReplyMsgModel.d.ts +39 -0
- package/dist/whatsapp/models/MsgInfoModel.d.ts +52 -0
- package/dist/whatsapp/models/MsgInfoParticipantModel.d.ts +41 -0
- package/dist/whatsapp/models/MsgModel.d.ts +392 -0
- package/dist/whatsapp/models/MuteModel.d.ts +54 -0
- package/dist/whatsapp/models/NetworkStatusModel.d.ts +43 -0
- package/dist/whatsapp/models/OrderItemModel.d.ts +47 -0
- package/dist/whatsapp/models/OrderModel.d.ts +48 -0
- package/dist/whatsapp/models/ParticipantModel.d.ts +42 -0
- package/dist/whatsapp/models/PinInChatModel.d.ts +50 -0
- package/dist/whatsapp/models/PresenceModel.d.ts +53 -0
- package/dist/whatsapp/models/ProductCollModel.d.ts +45 -0
- package/dist/whatsapp/models/ProductImageModel.d.ts +45 -0
- package/dist/whatsapp/models/ProductMessageListModel.d.ts +52 -0
- package/dist/whatsapp/models/ProductModel.d.ts +69 -0
- package/dist/whatsapp/models/ProfilePicThumbModel.d.ts +55 -0
- package/dist/whatsapp/models/QuickReplyModel.d.ts +45 -0
- package/dist/whatsapp/models/ReactionsModel.d.ts +49 -0
- package/dist/whatsapp/models/ReactionsSendersModel.d.ts +49 -0
- package/dist/whatsapp/models/RecentEmojiModel.d.ts +33 -0
- package/dist/whatsapp/models/RecentStickerModel.d.ts +39 -0
- package/dist/whatsapp/models/ReplyButtonModel.d.ts +38 -0
- package/dist/whatsapp/models/ServerPropsModel.d.ts +40 -0
- package/dist/whatsapp/models/SocketModel.d.ts +116 -0
- package/dist/whatsapp/models/StatusModel.d.ts +41 -0
- package/dist/whatsapp/models/StatusV3Model.d.ts +63 -0
- package/dist/whatsapp/models/StickerModel.d.ts +56 -0
- package/dist/whatsapp/models/StickerPackModel.d.ts +56 -0
- package/dist/whatsapp/models/StreamModel.d.ts +65 -0
- package/dist/whatsapp/models/TemplateButtonModel.d.ts +42 -0
- package/dist/whatsapp/models/UnreadMentionModel.d.ts +37 -0
- package/dist/whatsapp/models/index.d.ts +70 -0
- package/dist/whatsapp/multidevice/adv.d.ts +32 -0
- package/dist/whatsapp/multidevice/index.d.ts +18 -0
- package/dist/whatsapp/multidevice/waNoiseInfo.d.ts +33 -0
- package/dist/whatsapp/multidevice/waSignalStore.d.ts +76 -0
- package/dist/whatsapp/stores.d.ts +128 -0
- package/dist/whatsapp/websocket/WapNode.d.ts +29 -0
- package/dist/whatsapp/websocket/ensureE2ESessions.d.ts +20 -0
- package/dist/whatsapp/websocket/generateId.d.ts +19 -0
- package/dist/whatsapp/websocket/index.d.ts +23 -0
- package/dist/whatsapp/websocket/sendSmaxStanza.d.ts +20 -0
- package/dist/whatsapp/websocket/smax.d.ts +22 -0
- package/dist/whatsapp/websocket/startWebComms.d.ts +19 -0
- package/dist/whatsapp/websocket/stopComms.d.ts +20 -0
- package/dist/whatsapp/websocket/wap.d.ts +22 -0
- package/dist/wppconnect-wa.js +2 -0
- package/dist/wppconnect-wa.js.LICENSE.txt +90 -0
- package/package.json +91 -0
- package/playwright.config.ts +39 -0
- package/storageState.json +4 -0
- package/tests/check-auth.ts +39 -0
- package/tests/global.d.ts +24 -0
- package/tests/prepare.ts +40 -0
- package/tests/tsconfig.json +7 -0
- package/tests/wpp-test.ts +78 -0
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2023 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import type { AudioMessageOptions } from './sendFileMessage';
|
|
17
|
+
/**
|
|
18
|
+
* Prepare waveform form message audio file
|
|
19
|
+
*
|
|
20
|
+
* @category Message
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function prepareAudioWaveform(options: AudioMessageOptions, file: File): Promise<undefined | {
|
|
24
|
+
duration: number;
|
|
25
|
+
waveform: Uint8Array;
|
|
26
|
+
}>;
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { RawMessage } from '..';
|
|
17
|
+
export interface LinkPreviewOptions {
|
|
18
|
+
/**
|
|
19
|
+
* Send text message with link preview
|
|
20
|
+
*
|
|
21
|
+
* @default true
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* // Automatic detection
|
|
26
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8');
|
|
27
|
+
*
|
|
28
|
+
* // Overriding the title and description
|
|
29
|
+
* WPP.chat.sendTextMessage('[number]@c.us', 'See https://www.youtube.com/watch?v=v1PBptSDIh8', {
|
|
30
|
+
* linkPreview: {
|
|
31
|
+
* title: 'Another text',
|
|
32
|
+
* description: 'Another description'
|
|
33
|
+
* }
|
|
34
|
+
* });
|
|
35
|
+
* ```
|
|
36
|
+
*/
|
|
37
|
+
linkPreview?: boolean | {
|
|
38
|
+
title?: string;
|
|
39
|
+
description?: string;
|
|
40
|
+
canonicalUrl?: string;
|
|
41
|
+
matchedText?: string;
|
|
42
|
+
richPreviewType?: number;
|
|
43
|
+
thumbnail?: string;
|
|
44
|
+
doNotPlayInline: boolean;
|
|
45
|
+
};
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Prepare a message for link preview
|
|
49
|
+
*
|
|
50
|
+
* @category Message
|
|
51
|
+
* @internal
|
|
52
|
+
*/
|
|
53
|
+
export declare function prepareLinkPreview<T extends RawMessage>(message: T, options: LinkPreviewOptions): Promise<T>;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { RawMessage } from '..';
|
|
17
|
+
export type MessageButtonsTypes = {
|
|
18
|
+
id: string;
|
|
19
|
+
text: string;
|
|
20
|
+
} | {
|
|
21
|
+
phoneNumber: string;
|
|
22
|
+
text: string;
|
|
23
|
+
} | {
|
|
24
|
+
url: string;
|
|
25
|
+
text: string;
|
|
26
|
+
};
|
|
27
|
+
export interface MessageButtonsOptions {
|
|
28
|
+
/**
|
|
29
|
+
* List of buttons, with at least 1 option and a maximum of 3
|
|
30
|
+
*/
|
|
31
|
+
buttons?: Array<MessageButtonsTypes>;
|
|
32
|
+
/**
|
|
33
|
+
* Title for buttons, only for text message
|
|
34
|
+
*/
|
|
35
|
+
title?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Set to use template buttons instead of reply buttons.
|
|
38
|
+
* @default: undefined - auto detect
|
|
39
|
+
*/
|
|
40
|
+
useTemplateButtons?: boolean | null;
|
|
41
|
+
/**
|
|
42
|
+
* Footer text for buttons
|
|
43
|
+
*/
|
|
44
|
+
footer?: string;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Prepare a message for buttons
|
|
48
|
+
*
|
|
49
|
+
* @category Message
|
|
50
|
+
* @internal
|
|
51
|
+
*/
|
|
52
|
+
export declare function prepareMessageButtons<T extends RawMessage>(message: T, options: MessageButtonsOptions): T;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { ChatModel } from '../../whatsapp';
|
|
17
|
+
import { RawMessage, SendMessageOptions } from '..';
|
|
18
|
+
/**
|
|
19
|
+
* Prepare a raw message
|
|
20
|
+
* @category Message
|
|
21
|
+
* @internal
|
|
22
|
+
*/
|
|
23
|
+
export declare function prepareRawMessage<T extends RawMessage>(chat: ChatModel, message: T, options?: SendMessageOptions): Promise<T>;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2022 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
/**
|
|
18
|
+
* Request the real phone number for a LID chat ([number]@lid)
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```javascript
|
|
22
|
+
* // Request
|
|
23
|
+
* WPP.chat.requestPhoneNumber('[number]@lid');
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @category Message
|
|
27
|
+
*/
|
|
28
|
+
export declare function requestPhoneNumber(chatId: any, options?: SendMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
export interface PoolMessageOptions extends SendMessageOptions {
|
|
18
|
+
selectableCount?: number;
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Send a create poll message
|
|
22
|
+
*
|
|
23
|
+
* Note: This only works for groups
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* ```javascript
|
|
27
|
+
* // Single pool
|
|
28
|
+
* WPP.chat.sendCreatePollMessage(
|
|
29
|
+
* '[number]@g.us',
|
|
30
|
+
* 'A poll name',
|
|
31
|
+
* ['Option 1', 'Option 2', 'Option 3']
|
|
32
|
+
* );
|
|
33
|
+
* ```
|
|
34
|
+
* // Selectable Count
|
|
35
|
+
* ```javascript
|
|
36
|
+
* // Single pool
|
|
37
|
+
* WPP.chat.sendCreatePollMessage(
|
|
38
|
+
* '[number]@g.us',
|
|
39
|
+
* 'A poll name',
|
|
40
|
+
* ['Option 1', 'Option 2', 'Option 3'],
|
|
41
|
+
* {
|
|
42
|
+
* selectableCount: 1,
|
|
43
|
+
* }
|
|
44
|
+
* );
|
|
45
|
+
* ```
|
|
46
|
+
*
|
|
47
|
+
* @category Message
|
|
48
|
+
*/
|
|
49
|
+
export declare function sendCreatePollMessage(chatId: any, name: string, choices: string[], options?: PoolMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,181 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
import { MessageButtonsOptions } from '.';
|
|
18
|
+
export interface FileMessageOptions extends SendMessageOptions {
|
|
19
|
+
type?: string;
|
|
20
|
+
caption?: string;
|
|
21
|
+
footer?: string;
|
|
22
|
+
filename?: string;
|
|
23
|
+
mimetype?: string;
|
|
24
|
+
}
|
|
25
|
+
export interface AutoDetectMessageOptions extends FileMessageOptions {
|
|
26
|
+
type: 'auto-detect';
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Send an audio message as a PTT, like a recorded message
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```javascript
|
|
33
|
+
* // PTT audio
|
|
34
|
+
* WPP.chat.sendFileMessage(
|
|
35
|
+
* '[number]@c.us',
|
|
36
|
+
* 'data:audio/mp3;base64,<a long base64 file...>',
|
|
37
|
+
* {
|
|
38
|
+
* type: 'audio',
|
|
39
|
+
* isPtt: true // false for common audio
|
|
40
|
+
* }
|
|
41
|
+
* );
|
|
42
|
+
* ```
|
|
43
|
+
*/
|
|
44
|
+
export interface AudioMessageOptions extends FileMessageOptions {
|
|
45
|
+
type: 'audio';
|
|
46
|
+
isPtt?: boolean;
|
|
47
|
+
/**
|
|
48
|
+
* Send an audio message as a PTT with waveform
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```javascript
|
|
52
|
+
* // Enable waveform
|
|
53
|
+
* WPP.chat.sendFileMessage(
|
|
54
|
+
* '[number]@c.us',
|
|
55
|
+
* 'data:audio/mp3;base64,<a long base64 file...>',
|
|
56
|
+
* {
|
|
57
|
+
* type: 'audio',
|
|
58
|
+
* isPtt: true,
|
|
59
|
+
* waveform: true // false to disable
|
|
60
|
+
* }
|
|
61
|
+
* );
|
|
62
|
+
* // Disable waveform
|
|
63
|
+
* WPP.chat.sendFileMessage(
|
|
64
|
+
* '[number]@c.us',
|
|
65
|
+
* 'data:audio/mp3;base64,<a long base64 file...>',
|
|
66
|
+
* {
|
|
67
|
+
* type: 'audio',
|
|
68
|
+
* isPtt: true,
|
|
69
|
+
* waveform: false
|
|
70
|
+
* }
|
|
71
|
+
* );
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
waveform?: boolean;
|
|
75
|
+
}
|
|
76
|
+
export interface DocumentMessageOptions extends FileMessageOptions, MessageButtonsOptions {
|
|
77
|
+
type: 'document';
|
|
78
|
+
}
|
|
79
|
+
export interface ImageMessageOptions extends FileMessageOptions, MessageButtonsOptions {
|
|
80
|
+
type: 'image';
|
|
81
|
+
isViewOnce?: boolean;
|
|
82
|
+
}
|
|
83
|
+
export interface StickerMessageOptions extends FileMessageOptions {
|
|
84
|
+
type: 'sticker';
|
|
85
|
+
}
|
|
86
|
+
export interface VideoMessageOptions extends FileMessageOptions, MessageButtonsOptions {
|
|
87
|
+
type: 'video';
|
|
88
|
+
isGif?: boolean;
|
|
89
|
+
isPtv?: boolean;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Send a file message, that can be an audio, document, image, sticker or video
|
|
93
|
+
*
|
|
94
|
+
* @example
|
|
95
|
+
* ```javascript
|
|
96
|
+
* // Single document
|
|
97
|
+
* WPP.chat.sendFileMessage(
|
|
98
|
+
* '[number]@c.us',
|
|
99
|
+
* 'data:application/msword;base64,<a long base64 file...>',
|
|
100
|
+
* {
|
|
101
|
+
* type: 'document',
|
|
102
|
+
* caption: 'My document', // Optional
|
|
103
|
+
* filename: 'myfile.doc', // Optional
|
|
104
|
+
* mimetype: 'application/msword' // Optional
|
|
105
|
+
* }
|
|
106
|
+
* );
|
|
107
|
+
*
|
|
108
|
+
* // Image with view once
|
|
109
|
+
* WPP.chat.sendFileMessage(
|
|
110
|
+
* '[number]@c.us',
|
|
111
|
+
* 'data:image/jpeg;base64,<a long base64 file...>',
|
|
112
|
+
* {
|
|
113
|
+
* type: 'image',
|
|
114
|
+
* caption: 'My image', // Optional
|
|
115
|
+
* isViewOnce: true
|
|
116
|
+
* }
|
|
117
|
+
* );
|
|
118
|
+
*
|
|
119
|
+
* // PTT audio
|
|
120
|
+
* WPP.chat.sendFileMessage(
|
|
121
|
+
* '[number]@c.us',
|
|
122
|
+
* 'data:audio/mp3;base64,<a long base64 file...>',
|
|
123
|
+
* {
|
|
124
|
+
* type: 'audio',
|
|
125
|
+
* isPtt: true // false for common audio
|
|
126
|
+
* }
|
|
127
|
+
* );
|
|
128
|
+
*
|
|
129
|
+
* // Image with view buttons
|
|
130
|
+
* WPP.chat.sendFileMessage(
|
|
131
|
+
* '[number]@c.us',
|
|
132
|
+
* 'data:image/jpeg;base64,<a long base64 file...>',
|
|
133
|
+
* {
|
|
134
|
+
* type: 'image',
|
|
135
|
+
* caption: 'My image'
|
|
136
|
+
* buttons: [
|
|
137
|
+
* {
|
|
138
|
+
* id: 'your custom id 1',
|
|
139
|
+
* text: 'Some text'
|
|
140
|
+
* },
|
|
141
|
+
* {
|
|
142
|
+
* id: 'another id 2',
|
|
143
|
+
* text: 'Another text'
|
|
144
|
+
* }
|
|
145
|
+
* ],
|
|
146
|
+
* footer: 'Footer text' // Optional
|
|
147
|
+
* }
|
|
148
|
+
* );
|
|
149
|
+
*
|
|
150
|
+
* // Image as Sticker
|
|
151
|
+
* WPP.chat.sendFileMessage(
|
|
152
|
+
* '[number]@c.us',
|
|
153
|
+
* 'data:image/png;base64,<a long base64 file...>',
|
|
154
|
+
* {
|
|
155
|
+
* type: 'sticker'
|
|
156
|
+
* }
|
|
157
|
+
* );
|
|
158
|
+
*
|
|
159
|
+
* // A simple video
|
|
160
|
+
* WPP.chat.sendFileMessage(
|
|
161
|
+
* '[number]@c.us',
|
|
162
|
+
* 'data:application/msword;base64,<a long base64 file...>',
|
|
163
|
+
* {
|
|
164
|
+
* type: 'video',
|
|
165
|
+
* }
|
|
166
|
+
* );
|
|
167
|
+
*
|
|
168
|
+
* // A PTV Video (micro video)
|
|
169
|
+
* WPP.chat.sendFileMessage(
|
|
170
|
+
* '[number]@c.us',
|
|
171
|
+
* 'data:application/msword;base64,<a long base64 file...>',
|
|
172
|
+
* {
|
|
173
|
+
* type: 'video',
|
|
174
|
+
* isPtv: true,
|
|
175
|
+
* }
|
|
176
|
+
* );
|
|
177
|
+
* ```
|
|
178
|
+
* @category Message
|
|
179
|
+
* @return {SendMessageReturn} The result
|
|
180
|
+
*/
|
|
181
|
+
export declare function sendFileMessage(chatId: any, content: string | Blob | File, options: AutoDetectMessageOptions | AudioMessageOptions | DocumentMessageOptions | ImageMessageOptions | VideoMessageOptions | StickerMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Wid } from '../../whatsapp';
|
|
17
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
18
|
+
export interface GroupInviteMessage extends SendMessageOptions {
|
|
19
|
+
jpegThumbnail?: string;
|
|
20
|
+
inviteCode: string;
|
|
21
|
+
inviteCodeExpiration?: number;
|
|
22
|
+
groupId: string | Wid;
|
|
23
|
+
groupName?: string;
|
|
24
|
+
caption?: string;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Send a group invite message
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```javascript
|
|
31
|
+
* WPP.chat.sendGroupInviteMessage(
|
|
32
|
+
* '[number]@c.us',
|
|
33
|
+
* {
|
|
34
|
+
* inviteCode: '123',
|
|
35
|
+
* groupId: '789@g.us'
|
|
36
|
+
* }
|
|
37
|
+
* );
|
|
38
|
+
*
|
|
39
|
+
* // After a invite
|
|
40
|
+
* const result = await WPP.group.addParticipants('789@g.us', '123@c.us');
|
|
41
|
+
* const participant = result['123@c.us'];
|
|
42
|
+
* if (participant.invite_code) {
|
|
43
|
+
* WPP.chat.sendGroupInviteMessage(
|
|
44
|
+
* '123@c.us',
|
|
45
|
+
* {
|
|
46
|
+
* inviteCode: participant.invite_code,
|
|
47
|
+
* inviteCodeExpiration: participant.invite_code_exp,
|
|
48
|
+
* groupId: '789@g.us'
|
|
49
|
+
* }
|
|
50
|
+
* );
|
|
51
|
+
* }
|
|
52
|
+
* ```
|
|
53
|
+
*
|
|
54
|
+
* @category Message
|
|
55
|
+
*/
|
|
56
|
+
export declare function sendGroupInviteMessage(chatId: any, options: GroupInviteMessage): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
export interface ListMessageOptions extends SendMessageOptions {
|
|
18
|
+
buttonText: string;
|
|
19
|
+
description: string;
|
|
20
|
+
title?: string;
|
|
21
|
+
footer?: string;
|
|
22
|
+
sections: Array<{
|
|
23
|
+
title: string;
|
|
24
|
+
rows: Array<{
|
|
25
|
+
rowId: string;
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
}>;
|
|
29
|
+
}>;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Send a list message
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```javascript
|
|
36
|
+
* WPP.chat.sendListMessage('[number]@c.us', {
|
|
37
|
+
* buttonText: 'Click Me!', //required
|
|
38
|
+
* description: "Hello it's list message", //required
|
|
39
|
+
* title: 'Hello user', //optional
|
|
40
|
+
* footer: 'Click and choose one', //optional
|
|
41
|
+
* sections: [{
|
|
42
|
+
* title: 'Section 1',
|
|
43
|
+
* rows: [{
|
|
44
|
+
* rowId: 'rowid1',
|
|
45
|
+
* title: 'Row 1',
|
|
46
|
+
* description: "Hello it's description 1",
|
|
47
|
+
* },{
|
|
48
|
+
* rowId: 'rowid2',
|
|
49
|
+
* title: 'Row 2',
|
|
50
|
+
* description: "Hello it's description 2",
|
|
51
|
+
* }]
|
|
52
|
+
* }]
|
|
53
|
+
* });
|
|
54
|
+
* ```
|
|
55
|
+
* @category Message
|
|
56
|
+
*/
|
|
57
|
+
export declare function sendListMessage(chatId: any, options: ListMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
import { MessageButtonsOptions } from './prepareMessageButtons';
|
|
18
|
+
export interface LocationMessageOptions extends SendMessageOptions, MessageButtonsOptions {
|
|
19
|
+
/**
|
|
20
|
+
* latitude in degrees
|
|
21
|
+
*/
|
|
22
|
+
lat: number | string;
|
|
23
|
+
/**
|
|
24
|
+
* longitude in degrees
|
|
25
|
+
*/
|
|
26
|
+
lng: number | string;
|
|
27
|
+
/**
|
|
28
|
+
* The full address of place
|
|
29
|
+
*/
|
|
30
|
+
address?: string;
|
|
31
|
+
/**
|
|
32
|
+
* Name of the place
|
|
33
|
+
*/
|
|
34
|
+
name?: string;
|
|
35
|
+
/**
|
|
36
|
+
* URL to open when click on the address/name
|
|
37
|
+
*/
|
|
38
|
+
url?: string;
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Send a location message
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```javascript
|
|
45
|
+
* // full example
|
|
46
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
47
|
+
* lat: -22.95201,
|
|
48
|
+
* lng: -43.2102601,
|
|
49
|
+
* name: 'Cristo Rendentor', // optional
|
|
50
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ', // optional
|
|
51
|
+
* url: 'https://santuariocristoredentor.com.br/' // optional
|
|
52
|
+
* });
|
|
53
|
+
*
|
|
54
|
+
* // minimal
|
|
55
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
56
|
+
* lat: -22.95201,
|
|
57
|
+
* lng: -43.2102601,
|
|
58
|
+
* });
|
|
59
|
+
*
|
|
60
|
+
* // name and address
|
|
61
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
62
|
+
* lat: -22.95201,
|
|
63
|
+
* lng: -43.2102601,
|
|
64
|
+
* name: 'Cristo Rendentor',
|
|
65
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ'
|
|
66
|
+
* });
|
|
67
|
+
*
|
|
68
|
+
* // with buttons
|
|
69
|
+
* WPP.chat.sendLocationMessage('[number]@c.us', {
|
|
70
|
+
* lat: -22.95201,
|
|
71
|
+
* lng: -43.2102601,
|
|
72
|
+
* name: 'Cristo Rendentor',
|
|
73
|
+
* address: 'Parque Nacional da Tijuca - Alto da Boa Vista, Rio de Janeiro - RJ',
|
|
74
|
+
* buttons: [
|
|
75
|
+
* {
|
|
76
|
+
* url: 'https://example.test/',
|
|
77
|
+
* text: 'URL example'
|
|
78
|
+
* },
|
|
79
|
+
* {
|
|
80
|
+
* phoneNumber: '+55 12 3456 7777',
|
|
81
|
+
* text: 'Phone Number'
|
|
82
|
+
* },
|
|
83
|
+
* {
|
|
84
|
+
* id: 'id1',
|
|
85
|
+
* text: 'First'
|
|
86
|
+
* },
|
|
87
|
+
* {
|
|
88
|
+
* id: 'id2',
|
|
89
|
+
* text: 'Second'
|
|
90
|
+
* },
|
|
91
|
+
* {
|
|
92
|
+
* id: 'other',
|
|
93
|
+
* text: 'Other'
|
|
94
|
+
* }
|
|
95
|
+
* ],
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
98
|
+
* @category Message
|
|
99
|
+
*/
|
|
100
|
+
export declare function sendLocationMessage(chatId: any, options: LocationMessageOptions): Promise<SendMessageReturn>;
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { SendMessageOptions, SendMessageReturn } from '..';
|
|
17
|
+
export interface OrderItems {
|
|
18
|
+
type: 'product' | 'custom';
|
|
19
|
+
id?: number[] | string[];
|
|
20
|
+
name?: string;
|
|
21
|
+
price?: number;
|
|
22
|
+
qnt?: number;
|
|
23
|
+
}
|
|
24
|
+
export interface OrderMessageOptions extends SendMessageOptions {
|
|
25
|
+
notes?: string;
|
|
26
|
+
discount?: number;
|
|
27
|
+
tax?: number;
|
|
28
|
+
shipping?: number;
|
|
29
|
+
offset?: number;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Send a order message
|
|
33
|
+
* To send (prices, tax, shipping or discount), for example: USD 12.90, send them without dots or commas, like: 12900
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```javascript
|
|
37
|
+
* // Send Order with a product
|
|
38
|
+
* WPP.chat.sendOrderMessage('[number]@c.us', [
|
|
39
|
+
* { type: 'product', id: '67689897878', qnt: 2 },
|
|
40
|
+
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
41
|
+
* ]
|
|
42
|
+
*
|
|
43
|
+
* // Send Order with a custom item
|
|
44
|
+
* WPP.chat.sendOrderMessage('[number]@c.us', [
|
|
45
|
+
* { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
|
|
46
|
+
* ]
|
|
47
|
+
*
|
|
48
|
+
* // Send Order with custom options
|
|
49
|
+
* WPP.chat.sendOrderMessage('[number]@c.us', [
|
|
50
|
+
* { type: 'product', id: '37878774457', qnt: 1 },
|
|
51
|
+
* { type: 'custom', name: 'Item de cost test', price: 120000, qnt: 2 },
|
|
52
|
+
* ],
|
|
53
|
+
* { tax: 10000, shipping: 4000, discount: 10000 }
|
|
54
|
+
* ```
|
|
55
|
+
* @category Message
|
|
56
|
+
*/
|
|
57
|
+
export declare function sendOrderMessage(chatId: any, items: OrderItems[], options?: OrderMessageOptions): Promise<SendMessageReturn>;
|