Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .talismanrc
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fileignoreconfig:
- filename: test/unit/mock/execution-mock.js
checksum: 89d239d37c9d8d0cdb6ac61553a7d2e2d9115a10207f7c0b387c3565c9cb6564
- filename: package-lock.json
checksum: 954f61bb34c87fa8a1cf6935cccd774a4a776001f2513f9fe977e76d29fd3b31
checksum: a858212afa05186f2b39958b6608610cb150324acca7e9efc0f3d76fde347375
- filename: docdash-template/fixtures/documents/probe.js
checksum: e841ecf889d0e82367c53c48ee0b3be8bd68d7babf4777a87ced769f29686ac4
- filename: docdash-template/.travis.yml
Expand Down
6 changes: 5 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# Changelog
## [v1.2.8](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.9) (2024-08-04)

## [v1.3.0](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.3.0) (2024-08-11)
- Enh: Add search function to query apps by names

## [v1.2.9](https://github.com/contentstack/contentstack-marketplace-sdk/tree/v1.2.9) (2024-08-04)
- Fix: Fixed the Linting issues
- Updated all the dependency to the latest version
- Added Pre-commit hook to run the snyk and talismand scans
Expand Down
39 changes: 39 additions & 0 deletions lib/marketplace/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,6 +90,45 @@ export function Marketplace (http, data) {
this.urlPath = '/manifests'
this.findAllApps = fetchAll(http, AppCollection, this.params)

/**
* @description Search installed apps
* @memberof Marketplace
* @func searchInstalledApps
* @param {String} search - Search term
* @param {Object} queryParams - Additional query parameters
* @returns {Promise<ContentstackCollection<App>>}
*
* @example
* import * as contentstack from '@contentstack/marketplace'
* const client = contentstack.client({ authtoken: 'TOKEN'})
*
* client.marketplace('organization_uid').searchApps('search_term')
* .then((collection) => console.log(collection))
*
*/
this.searchApps = async (search, queryParams = {}) => {
try {
if (!search) {
throw new Error("Search parameter is required");
}

const headers = {
headers: { ...cloneDeep(this.params) },
params: {
search,
...cloneDeep(queryParams),
},
};
const response = await http.get(this.urlPath, headers);
if (response.data) {
return response.data;
} else {
throw error(response);
}
} catch (err) {
throw error(err);
}
};
/**
* @description To get the apps list of authorized apps for the particular organization
* @memberof Marketplace
Expand Down
Loading
Loading