Skip to content

Commit

Permalink
Merge pull request #2273 from cozy/release/1.37.0-3
Browse files Browse the repository at this point in the history
Merge into 1.37.0 already merged features
  • Loading branch information
JF-Cozy authored Oct 25, 2021
2 parents 3ffd437 + 8876e2f commit a483f09
Show file tree
Hide file tree
Showing 4 changed files with 141 additions and 68 deletions.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

* Move / Refactor / Split `CategoriesHeader` component
* Split bundle into 3 chunks: main, vendor and cozy-bar
* Update Cozy App Publish (Fix travis icon on mattermost publish announcement)

# 1.36.0

Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@
"commitlint-config-cozy": "0.4.0",
"copy-webpack-plugin": "5.0.4",
"cozy-ach": "1.22.0",
"cozy-app-publish": "0.22.3",
"cozy-app-publish": "0.27.2",
"cozy-jobs-cli": "1.9.13",
"dummy-json": "2.0.0",
"duplicate-package-checker-webpack-plugin": "3.0.0",
Expand Down
71 changes: 56 additions & 15 deletions src/targets/services/konnectorAlerts.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,16 +70,35 @@ const fetchRegistryInfo = memoize(
)

const createTriggerAt = async (client, date) => {
await client.save({
_type: TRIGGER_DOCTYPE,
type: '@at',
arguments: date.toISOString(),
worker: 'service',
message: {
name: 'konnectorAlerts',
slug: 'banks'
}
})
logger(
'info',
`Try to create new @at trigger for konnectorAlerts service at ${
date.toISOString().split('T')[0]
}...`
)
try {
await client.save({
_type: TRIGGER_DOCTYPE,
type: '@at',
arguments: date.toISOString(),
worker: 'service',
message: {
name: 'konnectorAlerts',
slug: 'banks'
}
})
logger(
'info',
`⭐ Created: new @at trigger for konnectorAlerts service at ${
date.toISOString().split('T')[0]
}`
)
} catch (error) {
logger(
'error',
`❗ Error when creating new @at trigger for konnectorAlerts service: ${error.message}`
)
}
}

export const containerForTesting = {
Expand Down Expand Up @@ -301,14 +320,36 @@ const main = async ({ client }) => {
return
}

logger('info', 'Executing job notifications service...')
const triggerId = process.env.COZY_TRIGGER_ID
const jobId = process.env.COZY_JOB_ID.split('/').pop()

logger(
'info',
`Executing job notifications service by trigger: ${triggerId}, job: ${jobId}...`
)

const serviceTrigger = triggerId
? (await client.query(Q(TRIGGER_DOCTYPE).getById(triggerId))).data
: undefined

const serviceTrigger = process.env.COZY_TRIGGER_ID
? (await client.query(
Q(TRIGGER_DOCTYPE).getById(process.env.COZY_TRIGGER_ID)
)).data
const serviceJob = jobId
? (await client.query(Q(JOBS_DOCTYPE).getById(jobId))).data
: undefined

// Used to execute a script on maif instance
// that force the execution of this service
// TODO should be removed after executing the script
if (serviceJob?.message?.forceIgnoredErrors) {
flag(
'banks.konnector-alerts.ignored-errors',
serviceJob.message.forceIgnoredErrors
)
logger(
'info',
`Forced flag banks.konnector-alerts.ignored-errors to: ${serviceJob.message.forceIgnoredErrors}`
)
}

await sendTriggerNotifications(client, serviceTrigger)
await destroyObsoleteTrigger(client, serviceTrigger)
}
Expand Down
135 changes: 83 additions & 52 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -3864,6 +3864,11 @@ chownr@^1.0.1, chownr@^1.1.1:
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.2.tgz#a18f1e0b269c8a6a5d3c86eb298beb14c3dd7bf6"
integrity sha512-GkfeAQh+QNy3wquu9oIZr6SS5x7wGdSgNQvD10X3r+AZr1Oys22HW8kAmDMvNg2+Dm0TeGaEuO8gFwdBXxwO8A==

chownr@^1.1.4:
version "1.1.4"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.1.4.tgz#6fc9d7b42d32a583596337666e7d08084da2cc6b"
integrity sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==

chownr@~1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/chownr/-/chownr-1.0.1.tgz#e2a75042a9551908bebd25b8523d5f9769d79181"
Expand Down Expand Up @@ -4690,20 +4695,20 @@ [email protected]:
server-destroy "^1.0.1"
timezone "^1.0.22"

cozy-app-publish@0.22.3:
version "0.22.3"
resolved "https://registry.yarnpkg.com/cozy-app-publish/-/cozy-app-publish-0.22.3.tgz#4c45d1c3e2d36e4c00707633b1f68ea69b811725"
integrity sha512-zLxz0A/sbICa22Ti1Kp//v4zkZg3UIJoDrdfLYrZkFtTO+igL2Q4IqGUjCNCjjm3KsRcdk6aeh1i2fs6fmuZlw==
cozy-app-publish@0.27.2:
version "0.27.2"
resolved "https://registry.yarnpkg.com/cozy-app-publish/-/cozy-app-publish-0.27.2.tgz#5b81565733821bd74f7768b22e08343e58061817"
integrity sha512-mWoEsnhq6OsJMyIMR2uTnlU00Wvinpgsa+NJGHqcJ0nApaKOAek/5rZWrPZlrl91iskK5iL75Mie/GctVyvrbA==
dependencies:
argparse "^1.0.10"
chalk "2.4.2"
cross-spawn "6.0.5"
fs-extra "7.0.1"
lodash "4.17.15"
node-fetch "2.6.0"
prompt "1.0.0"
request "2.88.0"
tar "4.4.13"
chalk "^2.4.2"
cross-spawn "^6.0.5"
fs-extra "^7.0.1"
lodash "^4.17.19"
node-fetch "^2.6.1"
prompt "^1.0.0"
request "^2.88.0"
tar "^4.4.13"

[email protected]:
version "2.1.0"
Expand Down Expand Up @@ -7876,7 +7881,7 @@ from2@^2.1.0:
inherits "^2.0.1"
readable-stream "^2.0.0"

[email protected]:
[email protected], fs-extra@^7.0.1:
version "7.0.1"
resolved "https://registry.yarnpkg.com/fs-extra/-/fs-extra-7.0.1.tgz#4f189c44aa123b895f722804f55ea23eadc348e9"
integrity sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==
Expand All @@ -7892,6 +7897,13 @@ fs-minipass@^1.2.5:
dependencies:
minipass "^2.2.1"

fs-minipass@^1.2.7:
version "1.2.7"
resolved "https://registry.yarnpkg.com/fs-minipass/-/fs-minipass-1.2.7.tgz#ccff8570841e7fe4265693da88936c55aed7f7c7"
integrity sha512-GWSSJGFy4e9GUeCcbIkED+bgAoFyj7XF1mV8rma3QW4NIqX9Kyx79N/PF61H5udOV3aY1IaMLs6pGbH71nlCTA==
dependencies:
minipass "^2.6.0"

fs-readdir-recursive@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz#e32fc030a2ccee44a6b5371308da54be0b397d27"
Expand Down Expand Up @@ -8477,7 +8489,7 @@ har-validator@~2.0.6:
is-my-json-valid "^2.12.4"
pinkie-promise "^2.0.0"

har-validator@~5.1.0, har-validator@~5.1.3:
har-validator@~5.1.3:
version "5.1.5"
resolved "https://registry.yarnpkg.com/har-validator/-/har-validator-5.1.5.tgz#1f0803b9f8cb20c0fa13822df1ecddb36bde1efd"
integrity sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==
Expand Down Expand Up @@ -12282,7 +12294,7 @@ minimist@~0.0.1:
resolved "https://registry.yarnpkg.com/minimist/-/minimist-0.0.8.tgz#857fcabfc3397d2625b8228262e86aa7a011b05d"
integrity sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=

minipass@^2.2.1, minipass@^2.8.6:
minipass@^2.2.1, minipass@^2.6.0, minipass@^2.8.6, minipass@^2.9.0:
version "2.9.0"
resolved "https://registry.yarnpkg.com/minipass/-/minipass-2.9.0.tgz#e713762e7d3e32fed803115cf93e04bca9fcc9a6"
integrity sha512-wxfUjg9WebH+CUDX/CdbRlh5SmfZiy/hpkxaRI16Y9W56Pa75sWgd/rvFilSgrauD9NyFymP/+JFV3KwzIsJeg==
Expand All @@ -12297,6 +12309,13 @@ minizlib@^1.2.1:
dependencies:
minipass "^2.2.1"

minizlib@^1.3.3:
version "1.3.3"
resolved "https://registry.yarnpkg.com/minizlib/-/minizlib-1.3.3.tgz#2290de96818a34c29551c8a8d301216bd65a861d"
integrity sha512-6ZYMOEnmVsdCeTJVE0W9ZD+pVnE8h9Hma/iOwwRDsdQoePpoX56/8B6z3P9VNwppJuBKNRuFDRNRqRWexT9G9Q==
dependencies:
minipass "^2.9.0"

mississippi@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/mississippi/-/mississippi-2.0.0.tgz#3442a508fafc28500486feea99409676e4ee5a6f"
Expand Down Expand Up @@ -12682,7 +12701,7 @@ [email protected]:
mjml-validator "4.3.0"
mjml-wrapper "4.3.1"

[email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@~0.5.0, mkdirp@~0.5.1, mkdirp@~0.5.x:
[email protected], "mkdirp@>=0.5 0", mkdirp@^0.5.0, mkdirp@^0.5.1, mkdirp@^0.5.3, mkdirp@^0.5.5, mkdirp@~0.5.0, mkdirp@~0.5.1, mkdirp@~0.5.x:
version "0.5.5"
resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.5.tgz#d91cefd62d1436ca0f41620e251288d420099def"
integrity sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==
Expand Down Expand Up @@ -15102,6 +15121,17 @@ [email protected]:
utile "0.3.x"
winston "2.1.x"

prompt@^1.0.0:
version "1.2.0"
resolved "https://registry.yarnpkg.com/prompt/-/prompt-1.2.0.tgz#5d8f1d9011766bac07abde510dbf4338d87b4f02"
integrity sha512-iGerYRpRUg5ZyC+FJ/25G5PUKuWAGRjW1uOlhX7Pi3O5YygdK6R+KEaBjRbHSkU5vfS5PZCltSPZdDtUYwRCZA==
dependencies:
async "~0.9.0"
colors "^1.1.2"
read "1.0.x"
revalidator "0.1.x"
winston "2.x"

prompts@^2.0.1:
version "2.1.0"
resolved "https://registry.yarnpkg.com/prompts/-/prompts-2.1.0.tgz#bf90bc71f6065d255ea2bdc0fe6520485c1b45db"
Expand Down Expand Up @@ -15173,7 +15203,7 @@ pseudomap@^1.0.1, pseudomap@^1.0.2:
resolved "https://registry.yarnpkg.com/pseudomap/-/pseudomap-1.0.2.tgz#f052a28da70e618917ef0a8ac34c1ae5a68286b3"
integrity sha1-8FKijacOYYkX7wqKw0wa5aaChrM=

psl@^1.1.24, psl@^1.1.28:
psl@^1.1.28:
version "1.2.0"
resolved "https://registry.yarnpkg.com/psl/-/psl-1.2.0.tgz#df12b5b1b3a30f51c329eacbdef98f3a6e136dc6"
integrity sha512-GEn74ZffufCmkDDLNcl3uuyF/aSD6exEyh1v/ZSdAomB82t6G9hzJVRx0jBmLDW+VfZqks3aScmMw9DszwUalA==
Expand Down Expand Up @@ -16488,32 +16518,6 @@ [email protected], "request@>=2.9.0 <2.82.0":
tunnel-agent "~0.4.1"
uuid "^3.0.0"

[email protected]:
version "2.88.0"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.0.tgz#9c2fca4f7d35b592efe57c7f0a55e81052124fef"
integrity sha512-NAqBSrijGLZdM0WZNsInLJpkJokL72XYjUpnB0iwsRgxh7dB6COrHnTBNwN0E+lHDAJzu7kLAkDeY08z2/A0hg==
dependencies:
aws-sign2 "~0.7.0"
aws4 "^1.8.0"
caseless "~0.12.0"
combined-stream "~1.0.6"
extend "~3.0.2"
forever-agent "~0.6.1"
form-data "~2.3.2"
har-validator "~5.1.0"
http-signature "~1.2.0"
is-typedarray "~1.0.0"
isstream "~0.1.2"
json-stringify-safe "~5.0.1"
mime-types "~2.1.19"
oauth-sign "~0.9.0"
performance-now "^2.1.0"
qs "~6.5.2"
safe-buffer "^5.1.2"
tough-cookie "~2.4.3"
tunnel-agent "^0.6.0"
uuid "^3.3.2"

request@^2.40.0, request@^2.74.0, request@^2.78.0, request@^2.87.0, request@^2.88.0, request@^2.88.2:
version "2.88.2"
resolved "https://registry.yarnpkg.com/request/-/request-2.88.2.tgz#d73c918731cb5a87da047e207234146f664d12b3"
Expand Down Expand Up @@ -16861,6 +16865,11 @@ [email protected], safe-buffer@>=5.1.0, safe-buffer@^5.0.1, safe-buffer@^5.1.0,
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d"
integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==

safe-buffer@^5.2.1:
version "5.2.1"
resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.1.tgz#1eaf9fa9bdb1fdd4ec75f58f9cdb4e6b7827eec6"
integrity sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==

safe-regex@^1.1.0:
version "1.1.0"
resolved "https://registry.yarnpkg.com/safe-regex/-/safe-regex-1.1.0.tgz#40a3669f3b077d1e943d44629e157dd48023bf2e"
Expand Down Expand Up @@ -18136,7 +18145,7 @@ [email protected], tar@^2.0.0, tar@~2.2.1:
fstream "^1.0.2"
inherits "2"

tar@4.4.13, tar@^4:
tar@^4:
version "4.4.13"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.13.tgz#43b364bc52888d555298637b10d60790254ab525"
integrity sha512-w2VwSrBoHa5BsSyH+KxEqeQBAllHhccyMFVHtGtdMpF4W7IRWfZjFiQceJPChOeTsSDVUpER2T8FA93pr0L+QA==
Expand All @@ -18149,6 +18158,19 @@ [email protected], tar@^4:
safe-buffer "^5.1.2"
yallist "^3.0.3"

tar@^4.4.13:
version "4.4.19"
resolved "https://registry.yarnpkg.com/tar/-/tar-4.4.19.tgz#2e4d7263df26f2b914dee10c825ab132123742f3"
integrity sha512-a20gEsvHnWe0ygBY8JbxoM4w3SJdhc7ZAuxkLqh+nvNQN2IOt0B5lLgM490X5Hl8FF0dl0tOf2ewFYAlIFgzVA==
dependencies:
chownr "^1.1.4"
fs-minipass "^1.2.7"
minipass "^2.9.0"
minizlib "^1.3.3"
mkdirp "^0.5.5"
safe-buffer "^5.2.1"
yallist "^3.1.1"

temp@~0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/temp/-/temp-0.4.0.tgz#671ad63d57be0fe9d7294664b3fc400636678a60"
Expand Down Expand Up @@ -18502,14 +18524,6 @@ tough-cookie@~2.3.0:
dependencies:
punycode "^1.4.1"

tough-cookie@~2.4.3:
version "2.4.3"
resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781"
integrity sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==
dependencies:
psl "^1.1.24"
punycode "^1.4.1"

tr46@^1.0.1:
version "1.0.1"
resolved "https://registry.yarnpkg.com/tr46/-/tr46-1.0.1.tgz#a8b13fd6bfd2489519674ccde55ba3693b706d09"
Expand Down Expand Up @@ -19584,6 +19598,18 @@ [email protected]:
pkginfo "0.3.x"
stack-trace "0.0.x"

[email protected]:
version "2.4.5"
resolved "https://registry.yarnpkg.com/winston/-/winston-2.4.5.tgz#f2e431d56154c4ea765545fc1003bd340c95b59a"
integrity sha512-TWoamHt5yYvsMarGlGEQE59SbJHqGsZV8/lwC+iCcGeAe0vUaOh+Lv6SYM17ouzC/a/LB1/hz/7sxFBtlu1l4A==
dependencies:
async "~1.0.0"
colors "1.0.x"
cycle "1.0.x"
eyes "0.1.x"
isstream "0.1.x"
stack-trace "0.0.x"

word-wrap@^1.2.3:
version "1.2.3"
resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c"
Expand Down Expand Up @@ -19818,6 +19844,11 @@ yallist@^3.0.0, yallist@^3.0.2, yallist@^3.0.3:
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.0.3.tgz#b4b049e314be545e3ce802236d6cd22cd91c3de9"
integrity sha512-S+Zk8DEWE6oKpV+vI3qWkaK+jSbIK86pCwe2IF/xwIpQ8jEuxpw9NyaGjmp9+BoJv5FV2piqCDcoCtStppiq2A==

yallist@^3.1.1:
version "3.1.1"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd"
integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==

yallist@^4.0.0:
version "4.0.0"
resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72"
Expand Down

0 comments on commit a483f09

Please sign in to comment.