-
-
Notifications
You must be signed in to change notification settings - Fork 147
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: Exported Collection and Model for Notes
- Loading branch information
1 parent
97cda76
commit 009d9a8
Showing
5 changed files
with
144 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
/*! | ||
* Copyright 2024 WPPConnect Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { exportModule } from '../exportModule'; | ||
import { NoteModel } from '../models'; | ||
import { Collection } from './Collection'; | ||
|
||
/** @whatsapp WAWebNoteCollection | ||
*/ | ||
export declare class NoteCollection extends Collection<NoteModel> { | ||
static model: NoteModel; | ||
maybeGetNoteByChatJid(a?: any): any; | ||
hasCachedQueryForChatJid(e?: any): any; | ||
updateCollectionFromDB(a?: any, b?: any): any; | ||
purgeNotesByChatJid(a?: any): any; | ||
} | ||
exportModule( | ||
exports, | ||
{ NoteCollection: ['NoteCollection.constructor'] }, | ||
(m) => m.NoteCollection | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
/*! | ||
* Copyright 2024 WPPConnect Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { exportModule } from '../exportModule'; | ||
import { NoteModel } from '../models'; | ||
|
||
/** @whatsapp WAWebNoteAction | ||
*/ | ||
export declare function addOrEditNoteAction( | ||
attrs: { | ||
actionType: 'edit' | 'add'; | ||
chatJid: string; | ||
content: string; | ||
createdAt: number; | ||
id: string; | ||
noteType: 'unstructured'; | ||
}, | ||
b: boolean | ||
): Promise<any>; | ||
|
||
export declare function retrieveOnlyNoteForChatJid( | ||
jid: string | ||
): Promise<null | NoteModel>; | ||
|
||
exportModule( | ||
exports, | ||
{ | ||
addOrEditNoteAction: 'addOrEditNoteAction', | ||
retrieveOnlyNoteForChatJid: 'retrieveOnlyNoteForChatJid', | ||
}, | ||
(m) => m.addOrEditNoteAction && m.retrieveOnlyNoteForChatJid | ||
); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
/*! | ||
* Copyright 2024 WPPConnect Team | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
|
||
import { NoteCollection } from '../collections'; | ||
import { exportProxyModel } from '../exportModule'; | ||
import { | ||
Model, | ||
ModelOptions, | ||
ModelPropertiesContructor, | ||
ModelProxy, | ||
} from './Model'; | ||
|
||
interface Props { | ||
id?: any; | ||
type?: string; | ||
chatJid: string; | ||
content: string; | ||
createdAt?: number; | ||
modifiedAt?: number; | ||
} | ||
|
||
interface Session { | ||
stale?: any; | ||
} | ||
|
||
interface Derived {} | ||
|
||
export declare interface NoteModel | ||
extends ModelProxy<Props, Session, Derived> {} | ||
|
||
/** @whatsapp 86761 | ||
*/ | ||
export declare class NoteModel extends Model<NoteCollection> { | ||
constructor( | ||
proterties?: ModelPropertiesContructor<NoteModel>, | ||
options?: ModelOptions | ||
); | ||
triggerItemCollectionUpdate(): any; | ||
getCollection(): NoteCollection; | ||
} | ||
|
||
exportProxyModel(exports, 'NoteModel'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters