Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

build: merge release 4.40.0 into master #492

Merged
merged 18 commits into from
Oct 20, 2020
Merged

build: merge release 4.40.0 into master #492

merged 18 commits into from
Oct 20, 2020

Conversation

tshuli
Copy link
Contributor

@tshuli tshuli commented Oct 20, 2020

No description provided.

mantariksh and others added 18 commits October 8, 2020 16:41
chore: merge v4.39.0 back into develop
* refactor: move mail files into service module

* test: fix mock paths

Co-authored-by: Antariksh Mahajan <antarikshmahajan@gmail.com>
* fix(deps): run npm audit fix

* fix(deps-dev): upgrade mockpass to 2.5.4

* fix(deps-dev): upgrade mockpass to 2.5.5
* chore: lint error for unused vars

* chore: remove unused vars
)

Bumps [eslint-config-prettier](https://github.com/prettier/eslint-config-prettier) from 6.11.0 to 6.12.0.
- [Release notes](https://github.com/prettier/eslint-config-prettier/releases)
- [Changelog](https://github.com/prettier/eslint-config-prettier/blob/master/CHANGELOG.md)
- [Commits](prettier/eslint-config-prettier@v6.11.0...v6.12.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [sinon](https://github.com/sinonjs/sinon) from 9.0.3 to 9.2.0.
- [Release notes](https://github.com/sinonjs/sinon/releases)
- [Changelog](https://github.com/sinonjs/sinon/blob/master/CHANGELOG.md)
- [Commits](sinonjs/sinon@v9.0.3...v9.2.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@types/jest](https://github.com/DefinitelyTyped/DefinitelyTyped/tree/HEAD/types/jest) from 26.0.9 to 26.0.14.
- [Release notes](https://github.com/DefinitelyTyped/DefinitelyTyped/releases)
- [Commits](https://github.com/DefinitelyTyped/DefinitelyTyped/commits/HEAD/types/jest)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
…ntations for section, short text & long text fields (#409)

Email submission validators are crucial for preventing spoof submissions, and need to be migrated to TypeScript as part of push towards type safety. The existing implementation is problematic to port over however, due to

* Type consistency
* Misuse of the Inheritance pattern
* Lack of Codebase clarity

Solution

* Composition over Inheritance - Encourage code reuse in order to compose larger validation functions from smaller ones. For example, Table validation can be composed from Text and Number validator functions.

* Scaffolding for further migration - Perform full submission validation for all form field responses, instead of throwing an exception on a short-circuit basis upon encountering the first error that occurs. The hope is to use functional programming utilities so that all responses can be evaluated in order to obtain as much information as possible before rejecting a submission.

Changes:

* refactor: convert field-validation/index.ts and associated tests to typescript
* refactor(field-validators): textFieldValidatorConstructor sectionValidatorConstructor
* fix: only non-empty answers to be validated
* refactor: delete AnswerNotAllowedValidator, TextValidator, unused PlaceholderValidator
* refactor(ValidationOptions): Extract common validation options enum from short/long text fields, and use it in textValidator

Addresses #7
Bumps [aws-sdk](https://github.com/aws/aws-sdk-js) from 2.763.0 to 2.770.0.
- [Release notes](https://github.com/aws/aws-sdk-js/releases)
- [Changelog](https://github.com/aws/aws-sdk-js/blob/master/CHANGELOG.md)
- [Commits](aws/aws-sdk-js@v2.763.0...v2.770.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Bumps [@sentry/integrations](https://github.com/getsentry/sentry-javascript) from 5.24.2 to 5.25.0.
- [Release notes](https://github.com/getsentry/sentry-javascript/releases)
- [Changelog](https://github.com/getsentry/sentry-javascript/blob/master/CHANGELOG.md)
- [Commits](getsentry/sentry-javascript@5.24.2...5.25.0)

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
#371)

* lint: add lint ordering rule for `test` root import

* refactor(User): move user tests to __test__ directory

* refactor: move generateOtp to utils/hash and rename to hashData

* refactor(UserService): write neverthrown variant for createContactOtp

* test(SmsService): rewrite tests with TypeScript

* refactor(SmsService): write neverthrown sendAdminContactOtp

* feat: add standard typing for mapRouteError controller utils

* refactor(UserCtl): use new ResultAsync fns in handleContactSendOtp

* feat(SmsService): update JsDoc comments

* refactor(UserRoutes): inline celebrate rules

* refactor(hashUtil): add neverthrown compareData function

* refactor(UserService): rewrite neverthrown verifyContactOtp fn

* feat(User): remove MalformedOtpError

It has now been replaced by ApplicationError

* refactor(UserService): rewrite neverthrown updateUserContact fn

* refactor(UserService): rewrite neverthrown getPopulatedUserById fn

* refactor(UserCtl): use new UserService neverthrow fns

* feat(UserUtils): return 422 for MissingUserError

* feat(UserRoutes): add route documentation

* chore: add supertest-session package and typing

* test: add express-auth helper function to get authed session

* test(AuthRoutes): use supertest-session for handling auth

* test: remove CookieStore class

* test(UserRoutes): add integration tests for GET /user

* test(UserRoutes): add integration tests for POST /user/contact/sendotp

* feat(UserRoutes): strengthen joi regex for otp in /verifyotp

* test(UserRoutes): add integration tests for /user/contact/verifyotp

Also rearrange test cases to have their error codes in ascending order for ease of perusal

* fix(UserCtl): correct invalid absolute import statement

* fix(UserUtils): correct invalid absolute import statement

* refactor(UserCtl): check errors in each step instead of at the end

* refactor(hashUtils): rename compareData to compareHash

* feat(User): return 401 status when mapping InvalidOtpError

* test(UserCtl): add more test cases for error handling

* test(SmsService): rename smsCountSpy to camelcase from UPPER_CASE

* test(AuthRoute): add note to say that request is not logged in yet

* feat(SmsService): now returns better err msg for invalid number err

* fix: fix broken tests due to resolving merge conflicts

* feat(UserCtl): convert all res.send calls to res.json calls

* test(expressAuth): add documentation and rename to createAuthedSession

* feat(UserCtl): return error as string instead of message object

* test(expressAuth): update grammar on JSDoc
…utility function (#429)

* chore: create utility function, extend Request interface globally

* refactor: use getMeta

* chore: use getMeta for limit rate logs

* chore: extend interface SessionData to include user

* refactor: rename getMeta to createReqMeta

* chore: consistently use createReqMeta for all logs

* chore: remove dangling import
* refactor: move types to dev deps

* chore: remove unused connect package

* chore: pin dedent-js

* chore: remove unused deep-diff package

* chore: remove unused glob package

* chore: remove unused mobile-detect

* refactor: move proxyquire and rimraf to dev deps

* chore: pin sortablejs

* chore: pin sortablejs to last supported for ie11
@mantariksh mantariksh merged commit 42238be into master Oct 20, 2020
@liangyuanruo liangyuanruo deleted the release-v4.40.0 branch January 14, 2021 06:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants