Stabilize logging, correlation IDs, service-account Jira auth, and direct approver reminder DMs while splitting the monolith into focused modules with Compose-based deployment. Co-authored-by: Cursor <cursoragent@cursor.com>
21 lines
533 B
JavaScript
21 lines
533 B
JavaScript
import { Version3Client } from 'jira.js';
|
|
|
|
export function createJiraClient(config) {
|
|
const jira = config.jiraCloud;
|
|
const clientConfig = { host: jira.host };
|
|
|
|
if (jira.authType === 'bearer') {
|
|
clientConfig.authentication = {
|
|
oauth2: { accessToken: jira.token },
|
|
};
|
|
} else {
|
|
clientConfig.authentication = {
|
|
basic: {
|
|
email: jira.email,
|
|
apiToken: jira.token,
|
|
},
|
|
};
|
|
}
|
|
|
|
return new Version3Client(clientConfig);
|
|
}
|