-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
publish: Add Ubuntu 24.04 cozy-stack packages
generated from commit b2d4b2f
- Loading branch information
Travis CI User
committed
Jul 19, 2024
1 parent
968c65d
commit bfdb186
Showing
13 changed files
with
762 additions
and
666 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,49 @@ | ||
import { | ||
IOCozyAccount, | ||
IOCozyTrigger, | ||
IOCozyKonnector | ||
} from 'cozy-client/types/types' | ||
|
||
export const STATUS = { | ||
OK: 0, | ||
MAINTENANCE: 2, | ||
ERROR: 3, | ||
NO_ACCOUNT: 4, | ||
LOADING: 5 | ||
} as const | ||
|
||
/** | ||
* Get accounts from triggers | ||
* @param {IOCozyAccount[]} accounts | ||
* @param {IOCozyTrigger[]} triggers | ||
* @returns {IOCozyAccount[]} | ||
*/ | ||
export const getAccountsFromTrigger = ( | ||
accounts: IOCozyAccount[], | ||
triggers: IOCozyTrigger[] | ||
): IOCozyAccount[] => { | ||
const triggerAccountIds = triggers.map(trigger => trigger.message.account) | ||
const matchingAccounts = Object.values(accounts).filter(account => | ||
triggerAccountIds.includes(account._id) | ||
) | ||
return matchingAccounts | ||
} | ||
|
||
/** | ||
* Get triggers by slug | ||
* @param {IOCozyTrigger[]} triggers | ||
* @param {IOCozyKonnector['slug']} slug | ||
* @returns {IOCozyTrigger[]} | ||
*/ | ||
export function getTriggersBySlug( | ||
triggers: IOCozyTrigger[], | ||
slug: IOCozyKonnector['slug'] | ||
): IOCozyTrigger[] { | ||
return Object.values(triggers).filter(trigger => { | ||
return ( | ||
trigger.message && | ||
trigger.message.konnector && | ||
trigger.message.konnector === slug | ||
) | ||
}) | ||
} |
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
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 |
---|---|---|
@@ -0,0 +1,9 @@ | ||
{ | ||
"categoriesWhitelist": [ | ||
"banking", | ||
"clouds", | ||
"isp", | ||
"energy", | ||
"public_service" | ||
] | ||
} |
Oops, something went wrong.