Skip to content

Commit

Permalink
chore(deps): update yarn and vulnerable deps
Browse files Browse the repository at this point in the history
  • Loading branch information
awlayton committed May 13, 2024
1 parent 659c531 commit 5ccfb9b
Show file tree
Hide file tree
Showing 27 changed files with 3,337 additions and 3,566 deletions.
28 changes: 16 additions & 12 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@ overrides:
ecmaVersion: 2020
project: './**/tsconfig.*'
rules:
prettier/prettier: off
'@typescript-eslint/naming-convention':
[
error,
Expand Down Expand Up @@ -91,19 +92,22 @@ overrides:
},
]
'@typescript-eslint/consistent-type-definitions': [warn, interface]
"unicorn/prevent-abbreviations": [
"error",
{
"allowList": {
"prod": true,
"dev": true,
"doc": true,
"docs": true,
"copyProdData": true,
}
}
]
'unicorn/prevent-abbreviations':
[
'error',
{
'allowList':
{
'prod': true,
'dev': true,
'doc': true,
'docs': true,
'copyProdData': true,
},
},
]
rules:
prettier/prettier: off
notice/notice:
- error
- template: |
Expand Down
2 changes: 1 addition & 1 deletion .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
"**/.yarn": true,
"**/.pnp.*": true
},
"prettier.prettierPath": ".yarn/sdks/prettier/index.js",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.tsdk": ".yarn/sdks/typescript/lib",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.nodePath": ".yarn/sdks",
Expand Down
593 changes: 297 additions & 296 deletions .yarn/releases/yarn-4.1.1.cjs → .yarn/releases/yarn-4.2.2.cjs

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion .yarnrc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ packageExtensions:
"#ansi-styles": "npm:[email protected]"
"#supports-color": "npm:[email protected]"

yarnPath: .yarn/releases/yarn-4.1.1.cjs
yarnPath: .yarn/releases/yarn-4.2.2.cjs
97 changes: 49 additions & 48 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -44,24 +44,24 @@
]
},
"dependencies": {
"@oada/client": "^5.0.0",
"@oada/client": "^5.1.0",
"@oada/jobs": "^4.5.1",
"@oada/list-lib": "4.2.6",
"@oada/poll": "^1.0.4",
"@oada/types": "^3.4.6",
"@oada/types": "^3.5.3",
"@overleaf/o-error": "^3.4.0",
"@types/json-pointer": "^1.0.31",
"axios": "^1.6.0",
"@types/json-pointer": "^1.0.34",
"axios": "^1.6.8",
"bluebird": "^3.7.2",
"convict": "^6.2.4",
"convict-format-with-moment": "^6.2.0",
"convict-format-with-validator": "^6.2.0",
"cron": "^2.4.3",
"cron": "^2.4.4",
"csvjson": "^5.1.0",
"date-fns": "^2.29.3",
"date-fns": "^2.30.0",
"debug": "^4.3.4",
"dotenv": "^16.0.2",
"es-main": "^1.2.0",
"dotenv": "^16.4.5",
"es-main": "^1.3.0",
"form-data": "^4.0.0",
"fuse.js": "^6.6.2",
"js-sha256": "^0.9.0",
Expand All @@ -71,60 +71,61 @@
"ksuid": "^3.0.0",
"lodash": "^4.17.21",
"md5": "^2.3.0",
"moment": "^2.29.4",
"moment": "^2.30.1",
"mssql": "^8.1.4",
"serialize-error": "^11.0.0",
"serialize-error": "^11.0.3",
"sha256": "^0.2.0",
"tslib": "^2.4.0",
"xlsx": "^0.18.5"
"tslib": "^2.6.2",
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.2/xlsx-0.20.2.tgz"
},
"devDependencies": {
"@ava/typescript": "^3.0.1",
"@tsconfig/node16": "^1.0.3",
"@types/bluebird": "^3.5.38",
"@types/convict": "^6.1.1",
"@types/convict-format-with-validator": "^6.0.2",
"@types/cron": "^2.0.0",
"@types/debug": "^4.1.7",
"@types/lodash": "^4.14.185",
"@types/md5": "^2.3.2",
"@types/mssql": "^8.1.1",
"@types/node": "^16.11.62",
"@typescript-eslint/eslint-plugin": "^5.38.1",
"@typescript-eslint/parser": "^5.38.1",
"@yarnpkg/sdks": "^3.0.0-rc.21",
"ava": "^4.3.3",
"@ava/typescript": "^5.0.0",
"@tsconfig/node16": "^16.1.3",
"@types/bluebird": "^3.5.42",
"@types/convict": "^6.1.6",
"@types/convict-format-with-validator": "^6.0.5",
"@types/cron": "^2.4.0",
"@types/debug": "^4.1.12",
"@types/lodash": "^4.17.1",
"@types/md5": "^2.3.5",
"@types/mssql": "^8.1.2",
"@types/node": "^20.12.11",
"@typescript-eslint/eslint-plugin": "^7.9.0",
"@typescript-eslint/parser": "^7.9.0",
"@yarnpkg/sdks": "^3.1.2",
"ava": "^6.1.3",
"bluebird": "^3.7.2",
"c8": "^7.12.0",
"chai": "^4.3.6",
"chai-as-promised": "^7.1.1",
"eslint": "^8.24.0",
"eslint-config-prettier": "^8.5.0",
"eslint-config-xo": "^0.42.0",
"eslint-config-xo-typescript": "^0.53.0",
"eslint-formatter-pretty": "^4.1.0",
"eslint-import-resolver-node": "^0.3.6",
"eslint-plugin-array-func": "^3.1.7",
"c8": "^7.14.0",
"chai": "^4.4.1",
"chai-as-promised": "^7.1.2",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-config-xo": "^0.45.0",
"eslint-config-xo-typescript": "^4.0.0",
"eslint-formatter-pretty": "^6.0.1",
"eslint-import-resolver-node": "^0.3.9",
"eslint-plugin-array-func": "^3.1.8",
"eslint-plugin-ava": "^13.2.0",
"eslint-plugin-escompat": "^3.4.0",
"eslint-plugin-eslint-comments": "^3.2.0",
"eslint-plugin-filenames": "^1.3.2",
"eslint-plugin-github": "^4.3.7",
"eslint-plugin-github": "^4.10.2",
"eslint-plugin-i18n-text": "^1.0.1",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-import": "^2.29.1",
"eslint-plugin-no-constructor-bind": "^2.0.4",
"eslint-plugin-no-only-tests": "^3.0.0",
"eslint-plugin-no-only-tests": "^3.1.0",
"eslint-plugin-no-secrets": "^0.8.9",
"eslint-plugin-node": "^11.1.0",
"eslint-plugin-notice": "^0.9.10",
"eslint-plugin-optimize-regex": "^1.2.1",
"eslint-plugin-prettier": "^4.2.1",
"eslint-plugin-promise": "^6.0.1",
"eslint-plugin-regexp": "^1.9.0",
"eslint-plugin-security": "^1.5.0",
"eslint-plugin-prettier": "^5.1.3",
"eslint-plugin-promise": "^6.1.1",
"eslint-plugin-regexp": "^1.15.0",
"eslint-plugin-security": "^1.7.1",
"eslint-plugin-sonarjs": "^0.15.0",
"eslint-plugin-unicorn": "^43.0.2",
"prettier": "^2.7.1",
"typescript": "4.8.2"
"eslint-plugin-unicorn": "^53.0.0",
"prettier": "^3.2.5",
"typescript": "5.4.5"
},
"packageManager": "yarn@4.1.1"
"packageManager": "yarn@4.2.2"
}
10 changes: 5 additions & 5 deletions src/assessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ const CO_ID = config.get('foodlogiq.community.owner.id');
const CO_NAME = config.get('foodlogiq.community.owner.name');
const ASSESSMENT_TEMPLATE_ID = config.get('foodlogiq.assessment-template.id');
const ASSESSMENT_TEMPLATE_NAME = config.get(
'foodlogiq.assessment-template.name'
'foodlogiq.assessment-template.name',
);
const COMMUNITY_ID = config.get('foodlogiq.community.id');
const COMMUNITY_NAME = config.get('foodlogiq.community.name');
Expand Down Expand Up @@ -119,7 +119,7 @@ interface AnswerContent {
export async function spawnAssessment(
bid: string,
bname: string,
content: AssessmentContent
content: AssessmentContent,
) {
const {
general,
Expand Down Expand Up @@ -221,7 +221,7 @@ export async function spawnAssessment(
ASSESSMENT_BODY.state = 'Submitted';
const response = await updateAssessment(
PATH_TO_UPDATE_ASSESSMENT,
ASSESSMENT_BODY
ASSESSMENT_BODY,
);
return response || result;
} // SpawnAssessment
Expand All @@ -235,11 +235,11 @@ export async function spawnAssessment(
export async function linkAssessmentToDocument(
bid: string,
assessment: JsonObject,
document: JsonObject
document: JsonObject,
) {
const PATH_LINK_ASSESSMENT = `${FL_DOMAIN}/v2/businesses/${CO_ID}/links/assessment/${assessment._id}`;
trace(
`Creating FL Link from assessment [${assessment._id}] to document [${document._id}]`
`Creating FL Link from assessment [${assessment._id}] to document [${document._id}]`,
);

return axios({
Expand Down
26 changes: 13 additions & 13 deletions src/checkAssessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,9 @@ export function checkAssessment(assessment: FlAssessment) {
}

return res;
})
)
)
}),
),
),
)
.flat(5)
.some(Boolean);
Expand All @@ -76,13 +76,13 @@ const checkAssessments = new Map(
subsection.questions.map((question) => {
const umbrellaIndex = _.findIndex(
question.productEvaluationOptions.columns,
['name', 'Umbrella Coverage']
['name', 'Umbrella Coverage'],
);
const { _id } =
question.productEvaluationOptions.columns[umbrellaIndex]!;
const umbrella = _.findIndex(
question.productEvaluationOptions.answerRows[0]!.answers,
['column', _id]
['column', _id],
);
return question.productEvaluationOptions.columns.map((column) => {
let value;
Expand All @@ -98,7 +98,7 @@ const checkAssessments = new Map(
) {
const answerIndex = _.findIndex(
question.productEvaluationOptions.answerRows[0]!.answers,
['column', column._id]
['column', column._id],
);
const value =
question?.productEvaluationOptions?.answerRows?.[0]
Expand All @@ -122,7 +122,7 @@ const checkAssessments = new Map(
value + umbCov
}. This does not meet the required coverage (${requirement})`;
info(
`Assessment violation for id [${assessment._id}: ${reason}`
`Assessment violation for id [${assessment._id}: ${reason}`,
);
reasons.push(reason);
}
Expand All @@ -138,34 +138,34 @@ const checkAssessments = new Map(
if (column.type === 'numeric') {
const reason = `${column.name}(${value}; plus umbrella ${umbCov}) did not meet the requirement (${requirement})`;
info(
`Assessment violation for id [${assessment._id}: ${reason}`
`Assessment violation for id [${assessment._id}: ${reason}`,
);
reasons.push(reason);
} else if (column.type === 'bool') {
const answerIndex = _.findIndex(
question.productEvaluationOptions.answerRows[0]!.answers,
['column', column._id]
['column', column._id],
);
const value =
question?.productEvaluationOptions?.answerRows?.[0]
?.answers?.[answerIndex]?.answerBool;
const reason = `${column.name}(${value}) did not meet the requirement (${column.acceptanceValueBool})`;
info(
`Assessment violation for id [${assessment._id}: ${reason}`
`Assessment violation for id [${assessment._id}: ${reason}`,
);
reasons.push(reason);
}
}

return column.statisticsCommon.percentWithinTolerance < 100;
});
})
)
}),
),
);
const thing = failed.flat(5);
return { failed: thing.some(Boolean), reasons };
},
})
}),
);

export default checkAssessment;
16 changes: 8 additions & 8 deletions src/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ convict.addFormat(url);
convict.addFormat(duration);

const config = convict({
service: {
'service': {
name: {
doc: 'Name of the service; used by jobs lib; helps configuring tests separately',
default: 'fl-sync',
Expand All @@ -39,7 +39,7 @@ const config = convict({
env: 'TP_MANAGER_SERVICE',
arg: 'tp_manager_service',
},
services: {
'services': {
mirrorWatch: {
doc: 'Enable/disable mirrorWatch subservice',
format: Boolean,
Expand Down Expand Up @@ -83,21 +83,21 @@ const config = convict({
arg: 'watchConfigService',
},
},
skipQueueOnStartup: {
'skipQueueOnStartup': {
doc: 'Skip existing jobs queue on startup; useful for debugging',
default: false,
format: Boolean,
env: 'SKIP_JOBS_QUEUE_STARTUP',
arg: 'skipQueueOnStartup',
},
delay: {
'delay': {
doc: 'amount to delay between pages of documents',
default: 0,
format: Number,
env: 'DELAY',
arg: 'delay',
},
trellis: {
'trellis': {
domain: {
doc: 'OADA API domain',
format: String,
Expand Down Expand Up @@ -279,7 +279,7 @@ const config = convict({
env: 'FL_FORCE_WRITE',
},
},
incidents: {
'incidents': {
interval: {
doc: 'polling interval',
format: Number,
Expand Down Expand Up @@ -329,7 +329,7 @@ const config = convict({
env: 'INCIDENTS_PORT',
},
},
slack: {
'slack': {
posturl: {
format: 'url',
// Use a real slack webhook URL
Expand All @@ -338,7 +338,7 @@ const config = convict({
arg: 'slack-webhook',
},
},
timeouts: {
'timeouts': {
mirrorWatch: {
doc: 'Timeout duration for mirror handler jobs',
format: 'duration',
Expand Down
Loading

0 comments on commit 5ccfb9b

Please sign in to comment.