Skip to content

Commit

Permalink
feat: Added WPP.catalog.getMyCatalog function
Browse files Browse the repository at this point in the history
  • Loading branch information
edgardmessias committed Jun 12, 2022
1 parent 1114bc8 commit 7922931
Show file tree
Hide file tree
Showing 4 changed files with 67 additions and 0 deletions.
32 changes: 32 additions & 0 deletions src/catalog/functions/getMyCatalog.ts
@@ -0,0 +1,32 @@
/*!
* Copyright 2021 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 { CatalogStore, UserPrefs } from '../../whatsapp';

/**
* Get your current catalog
*
* @example
* ```javascript
* // Get your current catalog
* const myCatalog = await WPP.catalog.getMyCatalog();
* ```
*
* @return Your current catalog
*/
export async function getMyCatalog() {
return CatalogStore.get(UserPrefs.getMeUser());
}
17 changes: 17 additions & 0 deletions src/catalog/functions/index.ts
@@ -0,0 +1,17 @@
/*!
* Copyright 2021 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.
*/

export { getMyCatalog } from './getMyCatalog';
17 changes: 17 additions & 0 deletions src/catalog/index.ts
@@ -0,0 +1,17 @@
/*!
* Copyright 2021 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.
*/

export * from './functions';
1 change: 1 addition & 0 deletions src/index.ts
Expand Up @@ -29,6 +29,7 @@ export { config } from './config';

export * as blocklist from './blocklist';
export * as call from './call';
export * as catalog from './catalog';
export * as chat from './chat';
export * as conn from './conn';
export * as contact from './contact';
Expand Down

0 comments on commit 7922931

Please sign in to comment.