@wppconnect/wa-js 3.13.1 → 3.14.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 CHANGED
@@ -1,4 +1,4 @@
1
- ## 3.13.1 (2024-10-30)
1
+ # 3.14.0 (2024-10-30)
2
2
 
3
3
 
4
4
 
@@ -0,0 +1,26 @@
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 { NoteModel, Wid } from '../../whatsapp';
17
+ /**
18
+ * Get notes from a contact
19
+ * Only when are connected with business device
20
+ * @example
21
+ * ```javascript
22
+ * WPP.chat.getNotes('[number]@c.us', 'Text for your notes');
23
+ * ```
24
+ * @category Chat
25
+ */
26
+ export declare function getNotes(chatId: string | Wid): Promise<NoteModel | null>;
@@ -32,6 +32,7 @@ export { getLastSeen } from './getLastSeen';
32
32
  export { getMessageACK } from './getMessageACK';
33
33
  export { getMessageById } from './getMessageById';
34
34
  export { getMessages, GetMessagesOptions } from './getMessages';
35
+ export { getNotes } from './getNotes';
35
36
  export { getPlatformFromMessage } from './getPlatformFromMessage';
36
37
  export { getQuotedMsg } from './getQuotedMsg';
37
38
  export { getQuotedMsgKey } from './getQuotedMsgKey';
@@ -69,5 +70,6 @@ export { ScheduledCallMessageOptions, sendScheduledCallMessage, } from './sendSc
69
70
  export { sendTextMessage, TextMessageOptions } from './sendTextMessage';
70
71
  export { sendVCardContactMessage, VCardContact, } from './sendVCardContactMessage';
71
72
  export { setInputText } from './setInputText';
73
+ export { setNotes } from './setNotes';
72
74
  export { starMessage, StarMessageReturn } from './starMessage';
73
75
  export { unmute } from './unmute';
@@ -0,0 +1,26 @@
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 { NoteModel, Wid } from '../../whatsapp';
17
+ /**
18
+ * Set notes for a contact
19
+ * Only when are connected with business device
20
+ * @example
21
+ * ```javascript
22
+ * WPP.chat.setNotes('[number]@c.us', 'Text for your notes');
23
+ * ```
24
+ * @category Chat
25
+ */
26
+ export declare function setNotes(chatId: string | Wid, content: string): Promise<NoteModel | null>;
@@ -0,0 +1,26 @@
1
+ /*!
2
+ * Copyright 2024 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 { NoteModel } from '../models';
17
+ import { Collection } from './Collection';
18
+ /** @whatsapp WAWebNoteCollection
19
+ */
20
+ export declare class NoteCollection extends Collection<NoteModel> {
21
+ static model: NoteModel;
22
+ maybeGetNoteByChatJid(a?: any): any;
23
+ hasCachedQueryForChatJid(e?: any): any;
24
+ updateCollectionFromDB(a?: any, b?: any): any;
25
+ purgeNotesByChatJid(a?: any): any;
26
+ }
@@ -38,6 +38,7 @@ export * from './MsgCollection';
38
38
  export * from './MsgInfoCollection';
39
39
  export * from './MsgInfoParticipantCollection';
40
40
  export * from './MuteCollection';
41
+ export * from './NoteCollection';
41
42
  export * from './OrderCollection';
42
43
  export * from './OrderItemCollection';
43
44
  export * from './ParticipantCollection';
@@ -0,0 +1,27 @@
1
+ /*!
2
+ * Copyright 2024 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 { NoteModel } from '../models';
17
+ /** @whatsapp WAWebNoteAction
18
+ */
19
+ export declare function addOrEditNoteAction(attrs: {
20
+ actionType: 'edit' | 'add';
21
+ chatJid: string;
22
+ content: string;
23
+ createdAt: number;
24
+ id: string;
25
+ noteType: 'unstructured';
26
+ }, b: boolean): Promise<any>;
27
+ export declare function retrieveOnlyNoteForChatJid(jid: string): Promise<null | NoteModel>;
@@ -0,0 +1,40 @@
1
+ /*!
2
+ * Copyright 2024 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 { NoteCollection } from '../collections';
17
+ import { Model, ModelOptions, ModelPropertiesContructor, ModelProxy } from './Model';
18
+ interface Props {
19
+ id?: any;
20
+ type?: string;
21
+ chatJid: string;
22
+ content: string;
23
+ createdAt?: number;
24
+ modifiedAt?: number;
25
+ }
26
+ interface Session {
27
+ stale?: any;
28
+ }
29
+ interface Derived {
30
+ }
31
+ export declare interface NoteModel extends ModelProxy<Props, Session, Derived> {
32
+ }
33
+ /** @whatsapp 86761
34
+ */
35
+ export declare class NoteModel extends Model<NoteCollection> {
36
+ constructor(proterties?: ModelPropertiesContructor<NoteModel>, options?: ModelOptions);
37
+ triggerItemCollectionUpdate(): any;
38
+ getCollection(): NoteCollection;
39
+ }
40
+ export {};
@@ -43,6 +43,7 @@ export * from './MsgInfoParticipantModel';
43
43
  export * from './MsgModel';
44
44
  export * from './MuteModel';
45
45
  export * from './NetworkStatusModel';
46
+ export * from './NoteModel';
46
47
  export * from './OrderItemModel';
47
48
  export * from './OrderModel';
48
49
  export * from './ParticipantModel';
@@ -129,3 +129,4 @@ export declare const StickerPackStore: collections.StickerPackCollection;
129
129
  */
130
130
  export declare const StickerSearchStore: collections.StickerSearchCollection;
131
131
  export declare const PinInChatStore: collections.PinInChatCollection;
132
+ export declare const NoteStore: collections.NoteCollection;