-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
#35: create webapisync option in cert utils #36
base: main
Are you sure you want to change the base?
Conversation
also renamed files based on their use i.e. dd restore file is restore-utils/data-dictionary and web api sync util will be restore-util/web-api-core
@mohit-s96 This needs to be updated with the changes from #34 - which no longer deletes reports but overwrites/archives them instead. |
Since this package would be used in AWS/Cert API, we don't want to exit the node process. Thus we could just return in case of an error.
try { | ||
const { id: reportId = null } = | ||
( | ||
await axios.post( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
TODO: We should be using the Fetch API for everything at this point.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can write the Auth part as a one-liner
const getBearerTokenAuthHeader = (token = '') => (token?.length ? { Authorization: `Bearer ${token}` } : {});
headers = {
...headers,
...getOAuth2BearerTokenHeader(authInfo)
};
Then call Fetch API like so:
const response = await fetch(requestUri, { headers });
closes #35
Example CLI command:
Also fixes the lookup metadata issue.
cc: @darnjo