@@ -591,9 +591,7 @@ export default class IntegrationService {
591591 try {
592592 return decryptData ( encryptedValue )
593593 } catch ( error : any ) {
594- this . options . log ?. warn (
595- `Failed to decrypt value: ${ error ?. message || error } ` ,
596- )
594+ this . options . log ?. warn ( `Failed to decrypt value: ${ error ?. message || error } ` )
597595 return encryptedValue
598596 }
599597 }
@@ -1442,9 +1440,10 @@ export default class IntegrationService {
14421440 * @param integrationData: ConfluenceIntegrationData
14431441 * @returns Object with confluenceIntegrationType and nangoPayload
14441442 */
1445- private constructNangoConnectionPayload (
1446- integrationData : ConfluenceIntegrationData ,
1447- ) : { confluenceIntegrationType : NangoIntegration ; nangoPayload : any } {
1443+ private static constructNangoConnectionPayload ( integrationData : ConfluenceIntegrationData ) : {
1444+ confluenceIntegrationType : NangoIntegration
1445+ nangoPayload : any
1446+ } {
14481447 const ATLASSIAN_CLOUD_SUFFIX = '.atlassian.net' as const
14491448 const baseUrl = integrationData . settings . url . trim ( )
14501449 const hostname = new URL ( baseUrl ) . hostname
@@ -1537,17 +1536,17 @@ export default class IntegrationService {
15371536
15381537 connectionId = existingIntegration . id
15391538 let adminConnectionId : string = existingSettings . adminConnectionId || undefined
1540- let confluenceIntegrationType : NangoIntegration = existingSettings . nangoIntegrationName
1539+ const confluenceIntegrationType : NangoIntegration = existingSettings . nangoIntegrationName
15411540 if ( changes . orgAdminApiToken || changes . orgAdminId || ! adminConnectionId ) {
15421541 adminConnectionId = await this . atlassianAdminConnect (
15431542 newSettings . orgAdminApiToken ,
15441543 newSettings . orgAdminId ,
15451544 )
15461545 }
1547-
1546+
15481547 if ( changes . url || changes . username || changes . apiToken ) {
15491548 const { confluenceIntegrationType, nangoPayload } =
1550- this . constructNangoConnectionPayload ( integrationData )
1549+ IntegrationService . constructNangoConnectionPayload ( integrationData )
15511550
15521551 connectionId = await connectNangoIntegration ( confluenceIntegrationType , nangoPayload )
15531552 }
@@ -1607,7 +1606,7 @@ export default class IntegrationService {
16071606 integrationData . settings . orgAdminId ,
16081607 )
16091608 const { confluenceIntegrationType, nangoPayload } =
1610- this . constructNangoConnectionPayload ( integrationData )
1609+ IntegrationService . constructNangoConnectionPayload ( integrationData )
16111610 this . options . log . info (
16121611 `conflunece integration type determined: ${ confluenceIntegrationType } , starting nango connection...` ,
16131612 )
@@ -2119,9 +2118,10 @@ export default class IntegrationService {
21192118 * @param integrationData: JiraIntegrationData
21202119 * @returns Object with jiraIntegrationType and nangoPayload
21212120 */
2122- private constructJiraNangoConnectionPayload (
2123- integrationData : JiraIntegrationData ,
2124- ) : { jiraIntegrationType : NangoIntegration ; nangoPayload : any } {
2121+ private static constructJiraNangoConnectionPayload ( integrationData : JiraIntegrationData ) : {
2122+ jiraIntegrationType : NangoIntegration
2123+ nangoPayload : any
2124+ } {
21252125 const ATLASSIAN_CLOUD_SUFFIX = '.atlassian.net' as const
21262126 const baseUrl = integrationData . url . trim ( )
21272127 const hostname = new URL ( baseUrl ) . hostname
@@ -2239,7 +2239,7 @@ export default class IntegrationService {
22392239 if ( credentialsChanged ) {
22402240 // credentials changed, need to create a new nango connection
22412241 const { jiraIntegrationType : newType , nangoPayload } =
2242- this . constructJiraNangoConnectionPayload ( integrationData )
2242+ IntegrationService . constructJiraNangoConnectionPayload ( integrationData )
22432243 jiraIntegrationType = newType
22442244
22452245 this . options . log . info (
@@ -2248,9 +2248,9 @@ export default class IntegrationService {
22482248 connectionId = await connectNangoIntegration ( jiraIntegrationType , nangoPayload )
22492249 }
22502250
2251- await setNangoMetadata ( jiraIntegrationType , connectionId , {
2252- projectIdsToSync : integrationData . projects . map ( ( project ) => project . toUpperCase ( ) ) ,
2253- } )
2251+ await setNangoMetadata ( jiraIntegrationType , connectionId , {
2252+ projectIdsToSync : integrationData . projects . map ( ( project ) => project . toUpperCase ( ) ) ,
2253+ } )
22542254
22552255 integration = await this . createOrUpdate (
22562256 {
@@ -2307,7 +2307,7 @@ export default class IntegrationService {
23072307 let connectionId : string
23082308 try {
23092309 const { jiraIntegrationType, nangoPayload } =
2310- this . constructJiraNangoConnectionPayload ( integrationData )
2310+ IntegrationService . constructJiraNangoConnectionPayload ( integrationData )
23112311 this . options . log . info (
23122312 `jira integration type determined: ${ jiraIntegrationType } , starting nango connection...` ,
23132313 )
0 commit comments