-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from searchunify/feat/oops
The JavaScript SDK has been updated to include the Oops feature, which will help improve maintainability. This feature provides a more efficient way of handling errors, allowing developers to easily debug and resolve issues. Additionally, the Oops feature also allows developers to quickly identify and rectify any potential issues, leading to improved product reliability.
- Loading branch information
Showing
35 changed files
with
6,805 additions
and
1,381 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,3 @@ | ||
{ | ||
"extends": "./node_modules/easy-linter/index.js" | ||
} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,7 @@ | ||
const APIs = require('./src/core'); | ||
const validations = require('./src/validations'); | ||
const { startClient } = require('./src/core/client/start-client'); | ||
|
||
/** | ||
* @class Searchunify | ||
* @summary Initilize SearchUnify SDK. | ||
* @param {Object} instance SearchUnify Instance URL. | ||
* @param {Object} timeout APIs Request Timeout (Default 60000ms). | ||
* @author Mohan Rana | ||
*/ | ||
|
||
function Searchunify(clientProps) { | ||
try { | ||
const isValid = validations.client.initilize(clientProps); | ||
if (isValid.error) throw new Error(isValid.error.message); | ||
startClient(isValid.value); | ||
|
||
return { | ||
oauth: APIs.oauth2, | ||
analytics: APIs.analytics, | ||
content: APIs.content, | ||
search: APIs.search | ||
}; | ||
} catch (error) { | ||
throw new Error(error); | ||
} | ||
} | ||
const { SearchUnifyRestClient } = require('./src/core/su-rest-client'); | ||
const { SearchUnifyPluginClient } = require('./src/su-plugins/su-plugin-client'); | ||
|
||
module.exports = { | ||
Searchunify | ||
} | ||
SearchUnifyRestClient, | ||
SearchUnifyPluginClient | ||
}; |
Oops, something went wrong.