@wppconnect/wa-js 4.0.2-alpha.0 → 4.1.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 +3 -1
- package/README.md +2 -2
- package/changelog.config.cjs +43 -0
- package/dist/blocklist/functions/all.d.ts +2 -3
- package/dist/blocklist/functions/blockContact.d.ts +3 -12
- package/dist/blocklist/functions/index.d.ts +4 -4
- package/dist/blocklist/functions/isBlocked.d.ts +3 -9
- package/dist/blocklist/functions/unblockContact.d.ts +3 -12
- package/dist/blocklist/types.d.ts +20 -0
- package/dist/call/events/registerIncomingCallEvent.d.ts +0 -15
- package/dist/call/functions/accept.d.ts +6 -13
- package/dist/call/functions/enableCallInterface.d.ts +2 -3
- package/dist/call/functions/end.d.ts +4 -11
- package/dist/call/functions/index.d.ts +6 -6
- package/dist/call/functions/offer.d.ts +8 -13
- package/dist/call/functions/parseRelayResponse.d.ts +2 -9
- package/dist/call/functions/prepareDestination.d.ts +2 -10
- package/dist/call/functions/reject.d.ts +4 -11
- package/dist/cart/functions/add.d.ts +5 -29
- package/dist/cart/functions/clear.d.ts +2 -19
- package/dist/cart/functions/get.d.ts +5 -12
- package/dist/cart/functions/getThumbFromCart.d.ts +2 -19
- package/dist/cart/functions/index.d.ts +7 -7
- package/dist/cart/functions/remove.d.ts +2 -23
- package/dist/cart/functions/submit.d.ts +3 -40
- package/dist/cart/functions/update.d.ts +4 -25
- package/dist/catalog/functions/addProductImage.d.ts +6 -15
- package/dist/catalog/functions/changeProductImage.d.ts +6 -15
- package/dist/catalog/functions/createCollection.d.ts +5 -16
- package/dist/catalog/functions/createProduct.d.ts +25 -25
- package/dist/catalog/functions/deleteCollection.d.ts +5 -12
- package/dist/catalog/functions/deleteProduct.d.ts +9 -17
- package/dist/catalog/functions/editCollection.d.ts +10 -19
- package/dist/catalog/functions/editProduct.d.ts +15 -23
- package/dist/catalog/functions/getCollections.d.ts +3 -12
- package/dist/catalog/functions/getMyCatalog.d.ts +2 -4
- package/dist/catalog/functions/getProductById.d.ts +14 -24
- package/dist/catalog/functions/getProducts.d.ts +6 -16
- package/dist/catalog/functions/index.d.ts +16 -16
- package/dist/catalog/functions/removeProductImage.d.ts +7 -16
- package/dist/catalog/functions/setProductVisibility.d.ts +9 -18
- package/dist/catalog/functions/updateCartEnabled.d.ts +9 -16
- package/dist/chat/functions/archive.d.ts +20 -15
- package/dist/chat/functions/canMarkPlayed.d.ts +4 -9
- package/dist/chat/functions/canMute.d.ts +3 -9
- package/dist/chat/functions/canReply.d.ts +4 -9
- package/dist/chat/functions/clear.d.ts +5 -13
- package/dist/chat/functions/closeChat.d.ts +2 -3
- package/dist/chat/functions/delete.d.ts +4 -10
- package/dist/chat/functions/{deleteMessages.d.ts → deleteMessage.d.ts} +6 -15
- package/dist/chat/functions/downloadMedia.d.ts +3 -10
- package/dist/chat/functions/editMessage.d.ts +6 -33
- package/dist/chat/functions/find.d.ts +2 -9
- package/dist/chat/functions/forwardMessage.d.ts +7 -14
- package/dist/chat/functions/forwardMessages.d.ts +8 -15
- package/dist/chat/functions/generateMessageID.d.ts +2 -9
- package/dist/chat/functions/get.d.ts +2 -9
- package/dist/chat/functions/getActiveChat.d.ts +2 -4
- package/dist/chat/functions/getLastSeen.d.ts +2 -8
- package/dist/chat/functions/getMessageACK.d.ts +11 -18
- package/dist/chat/functions/getMessageById.d.ts +10 -12
- package/dist/chat/functions/getMessages.d.ts +53 -33
- package/dist/chat/functions/getNotes.d.ts +3 -10
- package/dist/chat/functions/getPlatformFromMessage.d.ts +3 -8
- package/dist/chat/functions/getQuotedMsg.d.ts +2 -9
- package/dist/chat/functions/getQuotedMsgKey.d.ts +2 -9
- package/dist/chat/functions/getReactions.d.ts +10 -17
- package/dist/chat/functions/getUnreadChats.d.ts +1 -8
- package/dist/chat/functions/getVotes.d.ts +10 -17
- package/dist/chat/functions/index.d.ts +65 -66
- package/dist/chat/functions/keepMessage.d.ts +4 -12
- package/dist/chat/functions/list.d.ts +33 -33
- package/dist/chat/functions/markIsComposing.d.ts +2 -9
- package/dist/chat/functions/markIsPaused.d.ts +2 -8
- package/dist/chat/functions/markIsRead.d.ts +5 -10
- package/dist/chat/functions/markIsRecording.d.ts +2 -9
- package/dist/chat/functions/markIsUnread.d.ts +4 -8
- package/dist/chat/functions/markPlayed.d.ts +4 -9
- package/dist/chat/functions/mute.d.ts +9 -13
- package/dist/chat/functions/openChatAt.d.ts +3 -11
- package/dist/chat/functions/openChatBottom.d.ts +2 -9
- package/dist/chat/functions/openChatFromUnread.d.ts +2 -9
- package/dist/chat/functions/pin.d.ts +20 -18
- package/dist/chat/functions/pinMsg.d.ts +11 -16
- package/dist/chat/functions/prepareAudioWaveform.d.ts +5 -30
- package/dist/chat/functions/prepareLinkPreview.d.ts +31 -31
- package/dist/chat/functions/prepareMessageButtons.d.ts +1 -41
- package/dist/chat/functions/prepareRawMessage.d.ts +3 -22
- package/dist/chat/functions/replyToButtonMessage.d.ts +1 -12
- package/dist/chat/functions/requestPhoneNumber.d.ts +3 -10
- package/dist/chat/functions/sendCatalogMessage.d.ts +12 -34
- package/dist/chat/functions/sendChargeMessage.d.ts +25 -65
- package/dist/chat/functions/sendCreatePollMessage.d.ts +18 -35
- package/dist/chat/functions/sendEventMessage.d.ts +22 -62
- package/dist/chat/functions/sendFileMessage.d.ts +2 -10
- package/dist/chat/functions/sendGroupInviteMessage.d.ts +16 -39
- package/dist/chat/functions/sendListMessage.d.ts +17 -50
- package/dist/chat/functions/sendLocationMessage.d.ts +48 -52
- package/dist/chat/functions/sendPixKeyMessage.d.ts +10 -26
- package/dist/chat/functions/sendRawMessage.d.ts +2 -22
- package/dist/chat/functions/sendReactionToMessage.d.ts +7 -13
- package/dist/chat/functions/sendScheduledCallMessage.d.ts +6 -17
- package/dist/chat/functions/sendTextMessage.d.ts +28 -11
- package/dist/chat/functions/sendVCardContactMessage.d.ts +19 -44
- package/dist/chat/functions/setChatList.d.ts +2 -10
- package/dist/chat/functions/setInputText.d.ts +3 -10
- package/dist/chat/functions/setNotes.d.ts +2 -10
- package/dist/chat/functions/starMessage.d.ts +16 -13
- package/dist/chat/functions/unmute.d.ts +2 -8
- package/dist/chat/types.d.ts +101 -13
- package/dist/community/functions/addSubgroups.d.ts +11 -21
- package/dist/community/functions/create.d.ts +4 -16
- package/dist/community/functions/deactivate.d.ts +4 -10
- package/dist/community/functions/demoteParticipants.d.ts +4 -14
- package/dist/community/functions/getAnnouncementGroup.d.ts +3 -11
- package/dist/community/functions/getParticipants.d.ts +3 -9
- package/dist/community/functions/getSubgroups.d.ts +3 -11
- package/dist/community/functions/index.d.ts +9 -9
- package/dist/community/functions/promoteParticipants.d.ts +4 -14
- package/dist/community/functions/removeSubgroups.d.ts +10 -20
- package/dist/conn/events/eventTypes.d.ts +16 -0
- package/dist/conn/events/index.d.ts +1 -0
- package/dist/conn/events/registerBackendEventBusEvents.d.ts +16 -0
- package/dist/conn/functions/changeEnviromentDevice.d.ts +2 -3
- package/dist/conn/functions/genLinkDeviceCodeForPhoneNumber.d.ts +4 -12
- package/dist/conn/functions/getABProps.d.ts +6 -15
- package/dist/conn/functions/getAuthCode.d.ts +2 -3
- package/dist/conn/functions/getAutoDownloadSettings.d.ts +6 -7
- package/dist/conn/functions/getBuildConstants.d.ts +8 -21
- package/dist/conn/functions/getHistorySyncProgress.d.ts +4 -4
- package/dist/conn/functions/getMigrationState.d.ts +4 -4
- package/dist/conn/functions/getMyDeviceId.d.ts +2 -3
- package/dist/conn/functions/getMyUserId.d.ts +2 -3
- package/dist/conn/functions/getMyUserLid.d.ts +2 -3
- package/dist/conn/functions/getMyUserWid.d.ts +2 -3
- package/dist/conn/functions/getPlatform.d.ts +2 -3
- package/dist/conn/functions/getStreamData.d.ts +3 -3
- package/dist/conn/functions/getTheme.d.ts +1 -2
- package/dist/conn/functions/index.d.ts +33 -33
- package/dist/conn/functions/isAuthenticated.d.ts +2 -3
- package/dist/conn/functions/isIdle.d.ts +2 -3
- package/dist/conn/functions/isMainInit.d.ts +2 -3
- package/dist/conn/functions/isMainLoaded.d.ts +2 -3
- package/dist/conn/functions/isMainReady.d.ts +2 -3
- package/dist/conn/functions/isMultiDevice.d.ts +2 -3
- package/dist/conn/functions/isOnline.d.ts +2 -3
- package/dist/conn/functions/isRegistered.d.ts +2 -3
- package/dist/conn/functions/joinWebBeta.d.ts +4 -11
- package/dist/conn/functions/logout.d.ts +2 -3
- package/dist/conn/functions/markAvailable.d.ts +4 -12
- package/dist/conn/functions/needsUpdate.d.ts +2 -3
- package/dist/conn/functions/refreshQR.d.ts +2 -3
- package/dist/conn/functions/setAutoDownloadSettings.d.ts +19 -11
- package/dist/conn/functions/setKeepAlive.d.ts +4 -11
- package/dist/conn/functions/setLimit.d.ts +38 -28
- package/dist/conn/functions/setMultiDevice.d.ts +4 -11
- package/dist/conn/functions/setTheme.d.ts +7 -14
- package/dist/contact/functions/get.d.ts +7 -12
- package/dist/contact/functions/getBusinessProfile.d.ts +5 -12
- package/dist/contact/functions/getCommonGroups.d.ts +3 -10
- package/dist/contact/functions/getPnLidEntry.d.ts +5 -10
- package/dist/contact/functions/getProfilePictureUrl.d.ts +5 -12
- package/dist/contact/functions/getStatus.d.ts +4 -10
- package/dist/contact/functions/index.d.ts +19 -14
- package/dist/contact/functions/list.d.ts +11 -15
- package/dist/contact/functions/queryExists.d.ts +5 -42
- package/dist/contact/functions/queryUsernameExists.d.ts +61 -0
- package/dist/contact/functions/queryWidExists.d.ts +51 -0
- package/dist/contact/functions/remove.d.ts +4 -11
- package/dist/contact/functions/reportContact.d.ts +14 -16
- package/dist/contact/functions/save.d.ts +11 -18
- package/dist/contact/functions/subscribePresence.d.ts +4 -11
- package/dist/contact/functions/unsubscribePresence.d.ts +3 -11
- package/dist/eventEmitter/eventTypes.d.ts +3 -3
- package/dist/eventEmitter/index.d.ts +41 -41
- package/dist/group/functions/addParticipants.d.ts +12 -19
- package/dist/group/functions/approve.d.ts +6 -14
- package/dist/group/functions/canAdd.d.ts +4 -10
- package/dist/group/functions/canDemote.d.ts +4 -11
- package/dist/group/functions/canPromote.d.ts +4 -11
- package/dist/group/functions/canRemove.d.ts +4 -11
- package/dist/group/functions/create.d.ts +14 -23
- package/dist/group/functions/demoteParticipants.d.ts +5 -12
- package/dist/group/functions/ensureGroup.d.ts +3 -11
- package/dist/group/functions/ensureGroupAndParticipants.d.ts +5 -14
- package/dist/group/functions/getAllGroups.d.ts +2 -4
- package/dist/group/functions/getGroupInfoFromInviteCode.d.ts +35 -10
- package/dist/group/functions/getGroupSizeLimit.d.ts +2 -3
- package/dist/group/functions/getInviteCode.d.ts +4 -10
- package/dist/group/functions/getMembershipRequests.d.ts +9 -16
- package/dist/group/functions/getParticipants.d.ts +4 -11
- package/dist/group/functions/getPastParticipants.d.ts +4 -11
- package/dist/group/functions/iAmAdmin.d.ts +3 -9
- package/dist/group/functions/iAmMember.d.ts +3 -9
- package/dist/group/functions/iAmRestrictedMember.d.ts +3 -9
- package/dist/group/functions/iAmSuperAdmin.d.ts +3 -9
- package/dist/group/functions/index.d.ts +32 -32
- package/dist/group/functions/join.d.ts +5 -12
- package/dist/group/functions/leave.d.ts +4 -10
- package/dist/group/functions/promoteParticipants.d.ts +5 -12
- package/dist/group/functions/reject.d.ts +6 -14
- package/dist/group/functions/removeIcon.d.ts +4 -10
- package/dist/group/functions/removeParticipants.d.ts +5 -12
- package/dist/group/functions/revokeInviteCode.d.ts +4 -10
- package/dist/group/functions/setDescription.d.ts +4 -11
- package/dist/group/functions/setIcon.d.ts +10 -17
- package/dist/group/functions/setProperty.d.ts +11 -19
- package/dist/group/functions/setSubject.d.ts +4 -11
- package/dist/index.d.ts +8 -8
- package/dist/indexdb/functions/getMessagesFromRowId.d.ts +13 -9
- package/dist/indexdb/functions/index.d.ts +1 -1
- package/dist/labels/functions/addNewLabel.d.ts +13 -14
- package/dist/labels/functions/addOrRemoveLabels.d.ts +11 -20
- package/dist/labels/functions/colorIsInLabelPalette.d.ts +5 -11
- package/dist/labels/functions/deleteAllLabels.d.ts +2 -14
- package/dist/labels/functions/deleteLabel.d.ts +3 -9
- package/dist/labels/functions/editLabel.d.ts +13 -15
- package/dist/labels/functions/getAllLabels.d.ts +2 -14
- package/dist/labels/functions/getLabelById.d.ts +2 -9
- package/dist/labels/functions/getLabelColorPalette.d.ts +2 -11
- package/dist/labels/functions/getNewLabelColor.d.ts +3 -12
- package/dist/labels/functions/index.d.ts +11 -11
- package/dist/loader/blacklist.d.ts +28 -0
- package/dist/{webpack → loader}/eventTypes.d.ts +4 -4
- package/dist/{webpack → loader}/index.d.ts +14 -9
- package/dist/newsletter/functions/create.d.ts +11 -16
- package/dist/newsletter/functions/destroy.d.ts +3 -10
- package/dist/newsletter/functions/edit.d.ts +16 -25
- package/dist/newsletter/functions/ensureNewsletter.d.ts +3 -8
- package/dist/newsletter/functions/follow.d.ts +2 -9
- package/dist/newsletter/functions/getSubscribers.d.ts +3 -10
- package/dist/newsletter/functions/index.d.ts +9 -9
- package/dist/newsletter/functions/mute.d.ts +4 -12
- package/dist/newsletter/functions/search.d.ts +12 -18
- package/dist/newsletter/functions/unfollow.d.ts +2 -9
- package/dist/order/functions/accept.d.ts +10 -9
- package/dist/order/functions/decline.d.ts +12 -10
- package/dist/order/functions/get.d.ts +5 -12
- package/dist/order/functions/index.d.ts +5 -5
- package/dist/order/functions/update.d.ts +3 -16
- package/dist/privacy/functions/get.d.ts +3 -14
- package/dist/privacy/functions/getDisallowedList.d.ts +13 -20
- package/dist/privacy/functions/index.d.ts +9 -9
- package/dist/privacy/functions/prepareDisallowedList.d.ts +6 -18
- package/dist/privacy/functions/setAbout.d.ts +6 -39
- package/dist/privacy/functions/setAddGroup.d.ts +6 -37
- package/dist/privacy/functions/setLastSeen.d.ts +6 -39
- package/dist/privacy/functions/setOnline.d.ts +3 -22
- package/dist/privacy/functions/setProfilePic.d.ts +6 -39
- package/dist/privacy/functions/setReadReceipts.d.ts +3 -22
- package/dist/privacy/functions/setStatus.d.ts +4 -31
- package/dist/profile/functions/editBusinessProfile.d.ts +4 -21
- package/dist/profile/functions/getMyProfileName.d.ts +2 -3
- package/dist/profile/functions/getMyProfilePicture.d.ts +2 -3
- package/dist/profile/functions/getMyStatus.d.ts +2 -3
- package/dist/profile/functions/index.d.ts +9 -9
- package/dist/profile/functions/isBusiness.d.ts +3 -4
- package/dist/profile/functions/removeMyProfilePicture.d.ts +2 -3
- package/dist/profile/functions/setMyProfileName.d.ts +3 -10
- package/dist/profile/functions/setMyProfilePicture.d.ts +9 -16
- package/dist/profile/functions/setMyStatus.d.ts +3 -10
- package/dist/status/defaultSendStatusOptions.d.ts +19 -0
- package/dist/status/functions/get.d.ts +3 -18
- package/dist/status/functions/getMyStatus.d.ts +2 -3
- package/dist/status/functions/index.d.ts +10 -10
- package/dist/status/functions/postSendStatus.d.ts +2 -9
- package/dist/status/functions/remove.d.ts +3 -17
- package/dist/status/functions/sendImageStatus.d.ts +5 -14
- package/dist/status/functions/sendRawStatus.d.ts +8 -12
- package/dist/status/functions/sendReadStatus.d.ts +4 -11
- package/dist/status/functions/sendTextStatus.d.ts +8 -16
- package/dist/status/functions/sendVideoStatus.d.ts +5 -14
- package/dist/status/functions/updateParticipants.d.ts +9 -11
- package/dist/status/index.d.ts +1 -0
- package/dist/types.d.ts +0 -20
- package/dist/whatsapp/exportModule.d.ts +2 -2
- package/dist/whatsapp/functions/deleteContactAction.d.ts +23 -3
- package/dist/whatsapp/functions/index.d.ts +1 -0
- package/dist/whatsapp/functions/sendQueryExists.d.ts +2 -1
- package/dist/whatsapp/functions/sendQueryUsernameExists.d.ts +36 -0
- package/dist/whatsapp/functions/setArchive.d.ts +9 -0
- package/dist/whatsapp/misc/BackendEventBus.d.ts +55 -0
- package/dist/whatsapp/misc/DBCreateLidPnMappings.d.ts +1 -0
- package/dist/whatsapp/misc/USyncQuery.d.ts +46 -15
- package/dist/whatsapp/misc/index.d.ts +1 -0
- package/dist/wppconnect-wa.js +1 -1
- package/dist/wppconnect-wa.js.LICENSE.txt +1 -1
- package/eslint.config.mjs +14 -0
- package/package.json +6 -9
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,25 +13,24 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
export type LabelsAddNewLabelOutput = Label;
|
|
16
|
+
export interface NewLabelOptions {
|
|
17
|
+
/**
|
|
18
|
+
* If it's decimal, send it as a number. If it's hexadecimal, send it as a string.
|
|
19
|
+
* If labelColor is omitted, the color will be generated automatically
|
|
20
|
+
*/
|
|
21
|
+
labelColor?: string | number;
|
|
22
|
+
}
|
|
24
23
|
/**
|
|
25
24
|
* Add a new label
|
|
26
25
|
* Use await WPP.labels.getLabelColorPalette() to get the list of available colors
|
|
27
26
|
* @example
|
|
28
27
|
* ```javascript
|
|
29
|
-
* await WPP.labels.addNewLabel(
|
|
28
|
+
* await WPP.labels.addNewLabel(`Name of label`);
|
|
30
29
|
* //or
|
|
31
|
-
* await WPP.labels.addNewLabel(
|
|
30
|
+
* await WPP.labels.addNewLabel(`Name of label`, { labelColor: '#dfaef0' });
|
|
31
|
+
* ```
|
|
32
32
|
* //or with color index
|
|
33
|
-
* await WPP.labels.addNewLabel(
|
|
33
|
+
* await WPP.labels.addNewLabel(`Name of label`, { labelColor: 16 });
|
|
34
34
|
* ```
|
|
35
35
|
*/
|
|
36
|
-
export declare function addNewLabel(
|
|
37
|
-
export {};
|
|
36
|
+
export declare function addNewLabel(labelName: string, options?: NewLabelOptions): Promise<import("..").Label>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,28 +13,19 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
type: z.ZodEnum<{
|
|
22
|
-
add: "add";
|
|
23
|
-
remove: "remove";
|
|
24
|
-
}>;
|
|
25
|
-
}, z.core.$strip>>;
|
|
26
|
-
}, z.core.$strip>;
|
|
27
|
-
export type LabelsAddOrRemoveLabelsInput = z.infer<typeof labelsAddOrRemoveLabelsSchema>;
|
|
28
|
-
export type LabelsAddOrRemoveLabelsOutput = any;
|
|
16
|
+
import { Wid } from '../../whatsapp';
|
|
17
|
+
export interface AddOrRemoveLabelsOptions {
|
|
18
|
+
labelId: string;
|
|
19
|
+
type: 'add' | 'remove';
|
|
20
|
+
}
|
|
29
21
|
/**
|
|
30
22
|
* Add or remove label from chats
|
|
31
23
|
* @example
|
|
32
24
|
* ```javascript
|
|
33
|
-
* await WPP.labels.addOrRemoveLabels(
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
25
|
+
* await WPP.labels.addOrRemoveLabels(
|
|
26
|
+
* ['[number]@c.us','[number]@c.us'],
|
|
27
|
+
* [{labelId:'76', type:'add'},{labelId:'75', type:'remove'}]
|
|
28
|
+
* )
|
|
37
29
|
* ```
|
|
38
30
|
*/
|
|
39
|
-
export declare function addOrRemoveLabels(
|
|
40
|
-
export {};
|
|
31
|
+
export declare function addOrRemoveLabels(chatIds: string | Wid | (string | Wid)[], options: AddOrRemoveLabelsOptions | AddOrRemoveLabelsOptions[]): Promise<any>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,20 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { z } from 'zod';
|
|
17
|
-
declare const labelsColorIsInLabelPaletteSchema: z.ZodObject<{
|
|
18
|
-
color: z.ZodUnion<readonly [z.ZodString, z.ZodNumber]>;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type LabelsColorIsInLabelPaletteInput = z.infer<typeof labelsColorIsInLabelPaletteSchema>;
|
|
21
|
-
export type LabelsColorIsInLabelPaletteOutput = boolean;
|
|
22
16
|
/**
|
|
23
17
|
* Check if color is in label palette
|
|
18
|
+
* @param color If it's decimal, send it as a number. If it's hexadecimal, send it as a string
|
|
24
19
|
* @example
|
|
25
20
|
* ```javascript
|
|
26
|
-
* await WPP.labels.colorIsInLabelPalette(
|
|
21
|
+
* await WPP.labels.colorIsInLabelPalette('#ffd429');
|
|
27
22
|
* //or
|
|
28
|
-
* await WPP.labels.colorIsInLabelPalette(
|
|
23
|
+
* await WPP.labels.colorIsInLabelPalette(4284794111);
|
|
29
24
|
* ```
|
|
30
25
|
*/
|
|
31
|
-
export declare function colorIsInLabelPalette(
|
|
32
|
-
export {};
|
|
26
|
+
export declare function colorIsInLabelPalette(color: string | number): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,16 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { DeleteLabelReturn } from '.';
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
* Delete all labels
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```javascript
|
|
23
|
-
* const deleted = await WPP.labels.deleteAllLabels();
|
|
24
|
-
* console.log(deleted);
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @category Labels
|
|
28
|
-
*/
|
|
29
|
-
export declare function deleteAllLabels(): Promise<LabelsDeleteAllLabelsOutput>;
|
|
17
|
+
export declare function deleteAllLabels(): Promise<DeleteLabelReturn[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,15 +13,9 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { z } from 'zod';
|
|
17
16
|
export interface DeleteLabelReturn {
|
|
18
17
|
id: string;
|
|
19
18
|
deleteLabelResult: any;
|
|
20
19
|
}
|
|
21
|
-
declare
|
|
22
|
-
|
|
23
|
-
}, z.core.$strip>;
|
|
24
|
-
export type LabelsDeleteLabelInput = z.infer<typeof labelsDeleteLabelSchema>;
|
|
25
|
-
export type LabelsDeleteLabelOutput = DeleteLabelReturn[];
|
|
26
|
-
export declare function deleteLabel(params: LabelsDeleteLabelInput): Promise<LabelsDeleteLabelOutput>;
|
|
27
|
-
export {};
|
|
20
|
+
export declare function deleteLabel(id: string): Promise<DeleteLabelReturn>;
|
|
21
|
+
export declare function deleteLabel(ids: string[]): Promise<DeleteLabelReturn[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2024 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,27 +13,25 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
labelColor
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
export type LabelsEditLabelOutput = Label;
|
|
16
|
+
export interface EditLabelOptions {
|
|
17
|
+
/**
|
|
18
|
+
* If it's decimal, send it as a number. If it's hexadecimal, send it as a string.
|
|
19
|
+
* If labelColor is omitted, the color will be generated automatically
|
|
20
|
+
*/
|
|
21
|
+
labelColor?: string | number;
|
|
22
|
+
name?: string;
|
|
23
|
+
}
|
|
25
24
|
/**
|
|
26
25
|
* Edit a label
|
|
27
26
|
* For get a new color, use await WPP.labels.getLabelColorPalette() to get the list of available colors
|
|
28
27
|
* @example
|
|
29
28
|
* ```javascript
|
|
30
|
-
* await WPP.labels.editLabel(
|
|
29
|
+
* await WPP.labels.editLabel(`Name of label`);
|
|
31
30
|
* //or
|
|
32
|
-
* await WPP.labels.editLabel(
|
|
31
|
+
* await WPP.labels.editLabel(`Name of label`, { labelColor: '#dfaef0' });
|
|
33
32
|
* ```
|
|
34
33
|
* //or with color index
|
|
35
|
-
* await WPP.labels.editLabel(
|
|
34
|
+
* await WPP.labels.editLabel(`Name of label`, { labelColor: 16 });
|
|
36
35
|
* ```
|
|
37
36
|
*/
|
|
38
|
-
export declare function editLabel(
|
|
39
|
-
export {};
|
|
37
|
+
export declare function editLabel(id: string, options?: EditLabelOptions): Promise<import("..").Label>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -14,16 +14,4 @@
|
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
16
|
import { Label } from '..';
|
|
17
|
-
export
|
|
18
|
-
/**
|
|
19
|
-
* Get all labels
|
|
20
|
-
*
|
|
21
|
-
* @example
|
|
22
|
-
* ```javascript
|
|
23
|
-
* const labels = await WPP.labels.getAllLabels();
|
|
24
|
-
* console.log(labels);
|
|
25
|
-
* ```
|
|
26
|
-
*
|
|
27
|
-
* @category Labels
|
|
28
|
-
*/
|
|
29
|
-
export declare function getAllLabels(): Promise<LabelsGetAllLabelsOutput>;
|
|
17
|
+
export declare function getAllLabels(): Promise<Label[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2022 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,12 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { z } from 'zod';
|
|
17
16
|
import { Label } from '..';
|
|
18
|
-
declare
|
|
19
|
-
labelId: z.ZodString;
|
|
20
|
-
}, z.core.$strip>;
|
|
21
|
-
export type LabelsGetLabelByIdInput = z.infer<typeof labelsGetLabelByIdSchema>;
|
|
22
|
-
export type LabelsGetLabelByIdOutput = Label;
|
|
23
|
-
export declare function getLabelById(params: LabelsGetLabelByIdInput): Promise<LabelsGetLabelByIdOutput>;
|
|
24
|
-
export {};
|
|
17
|
+
export declare function getLabelById(labelId: string): Promise<Label>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,16 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export type LabelsGetLabelColorPaletteOutput = string[];
|
|
17
16
|
/**
|
|
18
17
|
* Returns an array of color palette in hex code
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```javascript
|
|
22
|
-
* const palette = await WPP.labels.getLabelColorPalette();
|
|
23
|
-
* console.log(palette);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @category Labels
|
|
27
18
|
*/
|
|
28
|
-
export declare function getLabelColorPalette(): Promise<
|
|
19
|
+
export declare function getLabelColorPalette(): Promise<string[]>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,16 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export type LabelsGetNewLabelColorOutput = number;
|
|
17
16
|
/**
|
|
18
|
-
* Return the color
|
|
19
|
-
*
|
|
20
|
-
* @example
|
|
21
|
-
* ```javascript
|
|
22
|
-
* const color = await WPP.labels.getNewLabelColor();
|
|
23
|
-
* console.log(color);
|
|
24
|
-
* ```
|
|
25
|
-
*
|
|
26
|
-
* @category Labels
|
|
17
|
+
* Return the color of the next label in positive decimal
|
|
27
18
|
*/
|
|
28
|
-
export declare function getNewLabelColor(): Promise<
|
|
19
|
+
export declare function getNewLabelColor(): Promise<number>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,13 +13,13 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export { addNewLabel
|
|
17
|
-
export { addOrRemoveLabels,
|
|
18
|
-
export { colorIsInLabelPalette
|
|
19
|
-
export { deleteAllLabels
|
|
20
|
-
export { deleteLabel, DeleteLabelReturn
|
|
21
|
-
export { editLabel
|
|
22
|
-
export { getAllLabels
|
|
23
|
-
export { getLabelById
|
|
24
|
-
export { getLabelColorPalette
|
|
25
|
-
export { getNewLabelColor
|
|
16
|
+
export { addNewLabel } from './addNewLabel';
|
|
17
|
+
export { addOrRemoveLabels, AddOrRemoveLabelsOptions, } from './addOrRemoveLabels';
|
|
18
|
+
export { colorIsInLabelPalette } from './colorIsInLabelPalette';
|
|
19
|
+
export { deleteAllLabels } from './deleteAllLabels';
|
|
20
|
+
export { deleteLabel, DeleteLabelReturn } from './deleteLabel';
|
|
21
|
+
export { editLabel } from './editLabel';
|
|
22
|
+
export { getAllLabels } from './getAllLabels';
|
|
23
|
+
export { getLabelById } from './getLabelById';
|
|
24
|
+
export { getLabelColorPalette } from './getLabelColorPalette';
|
|
25
|
+
export { getNewLabelColor } from './getNewLabelColor';
|
|
@@ -0,0 +1,28 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* Module IDs in WhatsApp's Meta loader that must be skipped when
|
|
18
|
+
* enumerating modules. They throw or otherwise misbehave when required.
|
|
19
|
+
*
|
|
20
|
+
* Each entry should be annotated with the WA version where it was added.
|
|
21
|
+
*/
|
|
22
|
+
export declare const META_MODULE_ID_BLACKLIST: ReadonlySet<string>;
|
|
23
|
+
/**
|
|
24
|
+
* Property names handled by `exportModule()` whose absence is acceptable
|
|
25
|
+
* (e.g., they only resolve after device is connected, or were renamed in a
|
|
26
|
+
* specific WA version). When missing, no error is reported.
|
|
27
|
+
*/
|
|
28
|
+
export declare const IGNORE_FAIL_MODULES: ReadonlySet<string>;
|
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
export interface
|
|
17
|
-
'
|
|
18
|
-
'
|
|
19
|
-
'
|
|
16
|
+
export interface LoaderEvents {
|
|
17
|
+
'loader.injected': void;
|
|
18
|
+
'loader.ready': void;
|
|
19
|
+
'loader.full_ready': void;
|
|
20
20
|
}
|
|
@@ -22,11 +22,11 @@ export declare let loaderType: 'meta' | 'unknown' | 'webpack';
|
|
|
22
22
|
*/
|
|
23
23
|
export declare let isInjected: boolean;
|
|
24
24
|
/**
|
|
25
|
-
* Is setted true when the main
|
|
25
|
+
* Is setted true when the main loader modules are fully loaded
|
|
26
26
|
*/
|
|
27
27
|
export declare let isReady: boolean;
|
|
28
28
|
/**
|
|
29
|
-
* Is setted true when the all
|
|
29
|
+
* Is setted true when the all loader modules are fully loaded
|
|
30
30
|
*/
|
|
31
31
|
export declare let isFullReady: boolean;
|
|
32
32
|
export declare function onInjected(listener: () => void, delay?: number): void;
|
|
@@ -38,7 +38,7 @@ export declare const __debug: () => {
|
|
|
38
38
|
[key: string]: any;
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
|
-
export declare let
|
|
41
|
+
export declare let moduleRequire: (<T = any>(moduleId: string) => T) & {
|
|
42
42
|
/**
|
|
43
43
|
* module list
|
|
44
44
|
*/
|
|
@@ -62,21 +62,26 @@ export declare const fallbackModules: {
|
|
|
62
62
|
};
|
|
63
63
|
export declare function injectLoader(): void;
|
|
64
64
|
export declare function moduleSource(moduleId: string): any;
|
|
65
|
-
export declare function isReactComponent(moduleId: string): boolean
|
|
65
|
+
export declare function isReactComponent(moduleId: string): boolean;
|
|
66
66
|
/**
|
|
67
|
-
* Return the
|
|
67
|
+
* Return the module id from a search function
|
|
68
68
|
* @param condition Function for compare the modules
|
|
69
69
|
* @param reverse Search in reverse order
|
|
70
|
+
* @param hint Optional name-token or regex to narrow the candidate set
|
|
71
|
+
* (e.g. "MsgCollection" or /^WAWebMsg/). When provided,
|
|
72
|
+
* matching modules are tried first; on miss we fall back to a
|
|
73
|
+
* full scan.
|
|
70
74
|
*/
|
|
71
|
-
export declare function searchId(condition: SearchModuleCondition, reverse?: boolean): string | null;
|
|
75
|
+
export declare function searchId(condition: SearchModuleCondition, reverse?: boolean, hint?: string | RegExp): string | null;
|
|
72
76
|
/**
|
|
73
|
-
* Return the
|
|
77
|
+
* Return the module from a search function
|
|
74
78
|
* @param condition Function for compare the modules
|
|
75
79
|
* @param reverse Search in reverse order
|
|
80
|
+
* @param hint Optional name-token or regex to narrow the candidate set.
|
|
76
81
|
*/
|
|
77
|
-
export declare function search<T = any>(condition: SearchModuleCondition, reverse?: boolean): T | null;
|
|
82
|
+
export declare function search<T = any>(condition: SearchModuleCondition, reverse?: boolean, hint?: string | RegExp): T | null;
|
|
78
83
|
/**
|
|
79
|
-
* Return the
|
|
84
|
+
* Return the module from a search function
|
|
80
85
|
* @param condition Function for compare the modules
|
|
81
86
|
* @param reverse Search in reverse order
|
|
82
87
|
*/
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,14 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
declare const newsletterCreateSchema: z.ZodObject<{
|
|
18
|
-
name: z.ZodString;
|
|
19
|
-
description: z.ZodOptional<z.ZodString>;
|
|
20
|
-
picture: z.ZodOptional<z.ZodString>;
|
|
21
|
-
}, z.core.$strip>;
|
|
22
|
-
export type NewsletterCreateInput = z.infer<typeof newsletterCreateSchema>;
|
|
23
|
-
export type NewsletterCreateOutput = {
|
|
16
|
+
export interface ResultCreateNewsletter {
|
|
24
17
|
idJid: string;
|
|
25
18
|
inviteCode: string;
|
|
26
19
|
inviteLink: string;
|
|
@@ -29,19 +22,21 @@ export type NewsletterCreateOutput = {
|
|
|
29
22
|
subscribersCount: number;
|
|
30
23
|
description: string | null;
|
|
31
24
|
timestamp: number;
|
|
32
|
-
}
|
|
25
|
+
}
|
|
33
26
|
/**
|
|
34
27
|
* Create a newsletter
|
|
35
28
|
*
|
|
36
29
|
* @example
|
|
37
30
|
* ```javascript
|
|
38
|
-
*
|
|
39
|
-
*
|
|
40
|
-
*
|
|
41
|
-
*
|
|
31
|
+
* // To edit name
|
|
32
|
+
* WPP.newsletter.create('Name for your newsletter', {
|
|
33
|
+
* description: 'Description for that',
|
|
34
|
+
* picture: '<base64_string',
|
|
42
35
|
* });
|
|
43
36
|
* ```
|
|
44
37
|
* @category Newsletter
|
|
45
38
|
*/
|
|
46
|
-
export declare function create(
|
|
47
|
-
|
|
39
|
+
export declare function create(name: string, opts: {
|
|
40
|
+
description?: string;
|
|
41
|
+
picture?: string;
|
|
42
|
+
}): Promise<ResultCreateNewsletter>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,21 +13,14 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { z } from 'zod';
|
|
17
|
-
declare const newsletterDestroySchema: z.ZodObject<{
|
|
18
|
-
newsletterId: z.ZodString;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type NewsletterDestroyInput = z.infer<typeof newsletterDestroySchema>;
|
|
21
|
-
export type NewsletterDestroyOutput = boolean;
|
|
22
16
|
/**
|
|
23
17
|
* Delete a newsletter
|
|
24
18
|
*
|
|
25
19
|
* @example
|
|
26
20
|
* ```javascript
|
|
27
|
-
* const code = WPP.newsletter.destroy(
|
|
21
|
+
* const code = WPP.newsletter.destroy('[newsletter-id]@newsletter');
|
|
28
22
|
* ```
|
|
29
23
|
*
|
|
30
24
|
* @category Newsletter
|
|
31
25
|
*/
|
|
32
|
-
export declare function destroy(
|
|
33
|
-
export {};
|
|
26
|
+
export declare function destroy(id: string): Promise<boolean>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2023 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,15 +13,7 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
|
|
17
|
-
declare const newsletterEditSchema: z.ZodObject<{
|
|
18
|
-
newsletterId: z.ZodString;
|
|
19
|
-
name: z.ZodOptional<z.ZodString>;
|
|
20
|
-
description: z.ZodOptional<z.ZodString>;
|
|
21
|
-
picture: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
22
|
-
}, z.core.$strip>;
|
|
23
|
-
export type NewsletterEditInput = z.infer<typeof newsletterEditSchema>;
|
|
24
|
-
export type NewsletterEditOutput = {
|
|
16
|
+
export interface ResultCreateNewsletter {
|
|
25
17
|
idJid: string;
|
|
26
18
|
inviteCode: string;
|
|
27
19
|
inviteLink: string;
|
|
@@ -30,38 +22,37 @@ export type NewsletterEditOutput = {
|
|
|
30
22
|
subscribersCount: number;
|
|
31
23
|
description: string | null;
|
|
32
24
|
timestamp: number;
|
|
33
|
-
}
|
|
25
|
+
}
|
|
34
26
|
/**
|
|
35
27
|
* Edit the newsletter data
|
|
36
28
|
*
|
|
37
29
|
* @example
|
|
38
30
|
* ```javascript
|
|
39
31
|
* // To edit name
|
|
40
|
-
* const code = WPP.newsletter.edit({
|
|
41
|
-
*
|
|
42
|
-
* name: 'New Name'
|
|
32
|
+
* const code = WPP.newsletter.edit('[newsletter-id]@newsletter', {
|
|
33
|
+
* name: 'New Name'
|
|
43
34
|
* });
|
|
44
35
|
*
|
|
45
36
|
* // To edit description
|
|
46
|
-
* const code = WPP.newsletter.edit({
|
|
47
|
-
*
|
|
48
|
-
* description: 'New description'
|
|
37
|
+
* const code = WPP.newsletter.edit('[newsletter-id]@newsletter', {
|
|
38
|
+
* description: 'New description'
|
|
49
39
|
* });
|
|
50
40
|
*
|
|
51
41
|
* // To change picture
|
|
52
|
-
* const code = WPP.newsletter.edit({
|
|
53
|
-
*
|
|
54
|
-
* picture: '<base64_image>'
|
|
42
|
+
* const code = WPP.newsletter.edit('[newsletter-id]@newsletter', {
|
|
43
|
+
* picture: '<base64_image>'
|
|
55
44
|
* });
|
|
56
45
|
*
|
|
57
46
|
* // To remove picture
|
|
58
|
-
* const code = WPP.newsletter.edit({
|
|
59
|
-
*
|
|
60
|
-
* picture: null
|
|
47
|
+
* const code = WPP.newsletter.edit('[newsletter-id]@newsletter', {
|
|
48
|
+
* picture: null
|
|
61
49
|
* });
|
|
62
50
|
* ```
|
|
63
51
|
*
|
|
64
52
|
* @category Newsletter
|
|
65
53
|
*/
|
|
66
|
-
export declare function edit(
|
|
67
|
-
|
|
54
|
+
export declare function edit(newsletterId: string, opts: {
|
|
55
|
+
name?: string;
|
|
56
|
+
description?: string;
|
|
57
|
+
picture?: string;
|
|
58
|
+
}): Promise<ResultCreateNewsletter>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/*!
|
|
2
|
-
* Copyright
|
|
2
|
+
* Copyright 2021 WPPConnect Team
|
|
3
3
|
*
|
|
4
4
|
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
5
|
* you may not use this file except in compliance with the License.
|
|
@@ -13,10 +13,5 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import
|
|
17
|
-
declare
|
|
18
|
-
newsletterId: z.ZodString;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type NewsletterEnsureNewsletterInput = z.infer<typeof newsletterEnsureNewsletterSchema>;
|
|
21
|
-
export declare function ensureNewsletter(params: NewsletterEnsureNewsletterInput): Promise<import("../../whatsapp").ChatModel>;
|
|
22
|
-
export {};
|
|
16
|
+
import { Wid } from '../../whatsapp';
|
|
17
|
+
export declare function ensureNewsletter(newsletterId: string | Wid): Promise<import("../../whatsapp").ChatModel>;
|
|
@@ -13,22 +13,15 @@
|
|
|
13
13
|
* See the License for the specific language governing permissions and
|
|
14
14
|
* limitations under the License.
|
|
15
15
|
*/
|
|
16
|
-
import { z } from 'zod';
|
|
17
|
-
declare const newsletterFollowSchema: z.ZodObject<{
|
|
18
|
-
newsletterId: z.ZodString;
|
|
19
|
-
}, z.core.$strip>;
|
|
20
|
-
export type NewsletterFollowInput = z.infer<typeof newsletterFollowSchema>;
|
|
21
|
-
export type NewsletterFollowOutput = boolean;
|
|
22
16
|
/**
|
|
23
17
|
* Follow/subscribe to a newsletter
|
|
24
18
|
*
|
|
25
19
|
* @example
|
|
26
20
|
* ```javascript
|
|
27
21
|
* // Follow a newsletter
|
|
28
|
-
* const success = await WPP.newsletter.follow(
|
|
22
|
+
* const success = await WPP.newsletter.follow('120363xxxxx@newsletter');
|
|
29
23
|
* ```
|
|
30
24
|
*
|
|
31
25
|
* @category Newsletter
|
|
32
26
|
*/
|
|
33
|
-
export declare function follow(
|
|
34
|
-
export {};
|
|
27
|
+
export declare function follow(id: string): Promise<boolean>;
|