Skip to content
This repository has been archived by the owner on Apr 13, 2023. It is now read-only.

Commit

Permalink
feat: bump search version to 3.9.2 (#524)
Browse files Browse the repository at this point in the history
* feat: bump search version to 3.9.2 (#520)

* feat: bump search version to 3.9.2
* dependabot fix
* Integ tests update
  • Loading branch information
Bingjiling authored Dec 13, 2021
1 parent c6f1217 commit 2e3ee80
Show file tree
Hide file tree
Showing 6 changed files with 64 additions and 59 deletions.
6 changes: 5 additions & 1 deletion auditLogMover/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,11 @@
"glob-parent": "^5.1.2",
"ws": "^7.4.6",
"trim-newlines": "^3.0.1",
"normalize-url": "^4.5.1"
"normalize-url": "^4.5.1",
"path-parse": "^1.0.7",
"set-value": "^4.0.1",
"ansi-regex": "^5.0.1",
"json-schema": "^0.4.0"
},
"scripts": {
"lint": "eslint . --ext .ts,.tsx",
Expand Down
50 changes: 19 additions & 31 deletions auditLogMover/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2172,22 +2172,7 @@ ansi-escapes@^4.2.1, ansi-escapes@^4.3.1:
dependencies:
type-fest "^0.21.3"

ansi-regex@^2.0.0, ansi-regex@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=

ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=

ansi-regex@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==

ansi-regex@^5.0.0, ansi-regex@^5.0.1:
ansi-regex@^2.0.0, ansi-regex@^2.1.1, ansi-regex@^3.0.0, ansi-regex@^4.1.0, ansi-regex@^5.0.0, ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
Expand Down Expand Up @@ -5989,7 +5974,7 @@ is-plain-obj@^1.0.0:
resolved "https://registry.yarnpkg.com/is-plain-obj/-/is-plain-obj-1.1.0.tgz#71a50c8429dfca773c92a390a4a03b39fcd51d3e"
integrity sha1-caUMhCnfync8kqOQpKA7OfzVHT4=

is-plain-object@^2.0.3, is-plain-object@^2.0.4:
is-plain-object@^2.0.4:
version "2.0.4"
resolved "https://registry.yarnpkg.com/is-plain-object/-/is-plain-object-2.0.4.tgz#2c163b3fafb1b606d9d17928f05c2a1c38e07677"
integrity sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==
Expand All @@ -6001,6 +5986,11 @@ is-potential-custom-element-name@^1.0.1:
resolved "https://registry.yarnpkg.com/is-potential-custom-element-name/-/is-potential-custom-element-name-1.0.1.tgz#171ed6f19e3ac554394edf78caa05784a45bebb5"
integrity sha512-bCYeRA2rVibKZd+s2625gGnGF/t7DSqDs4dP7CrLA1m7jKWz6pps0LpYLJN8Q64HtmPKJ1hrN3nzPNKFEKOUiQ==

is-primitive@^3.0.1:
version "3.0.1"
resolved "https://registry.yarnpkg.com/is-primitive/-/is-primitive-3.0.1.tgz#98c4db1abff185485a657fc2905052b940524d05"
integrity sha512-GljRxhWvlCNRfZyORiH77FwdFwGcMO620o37EOYC0ORWdq+WYNVqW0w2Juzew4M+L81l6/QS3t5gkkihyRqv9w==

is-promise@^2.2.2:
version "2.2.2"
resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1"
Expand Down Expand Up @@ -6675,10 +6665,10 @@ json-schema-traverse@^1.0.0:
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==

json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
json-schema@0.2.3, json-schema@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5"
integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==

json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
Expand Down Expand Up @@ -8002,7 +7992,7 @@ path-loader@^1.0.10:
native-promise-only "^0.8.1"
superagent "^3.8.3"

path-parse@^1.0.6:
path-parse@^1.0.6, path-parse@^1.0.7:
version "1.0.7"
resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735"
integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==
Expand Down Expand Up @@ -9166,15 +9156,13 @@ set-immediate-shim@~1.0.1:
resolved "https://registry.yarnpkg.com/set-immediate-shim/-/set-immediate-shim-1.0.1.tgz#4b2b1b27eb808a9f8dcc481a58e5e56f599f3f61"
integrity sha1-SysbJ+uAip+NzEgaWOXlb1mfP2E=

set-value@^2.0.0, set-value@^2.0.1:
version "2.0.1"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-2.0.1.tgz#a18d40530e6f07de4228c7defe4227af8cad005b"
integrity sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==
set-value@^2.0.0, set-value@^2.0.1, set-value@^4.0.1:
version "4.1.0"
resolved "https://registry.yarnpkg.com/set-value/-/set-value-4.1.0.tgz#aa433662d87081b75ad88a4743bd450f044e7d09"
integrity sha512-zTEg4HL0RwVrqcWs3ztF+x1vkxfm0lP+MQQFPiMJTKVceBwEV0A569Ou8l9IYQG8jOZdMVI1hGsc0tmeD2o/Lw==
dependencies:
extend-shallow "^2.0.1"
is-extendable "^0.1.1"
is-plain-object "^2.0.3"
split-string "^3.0.1"
is-plain-object "^2.0.4"
is-primitive "^3.0.1"

setimmediate@^1.0.4:
version "1.0.5"
Expand Down Expand Up @@ -9480,7 +9468,7 @@ spdx-license-ids@^3.0.0:
resolved "https://registry.yarnpkg.com/spdx-license-ids/-/spdx-license-ids-3.0.10.tgz#0d9becccde7003d6c658d487dd48a32f0bf3014b"
integrity sha512-oie3/+gKf7QtpitB0LYLETe+k8SifzsX4KixvpOsbI6S0kRiRQ5MKOio8eMSAKQ17N06+wdEOXRiId+zOxo0hA==

split-string@^3.0.1, split-string@^3.0.2:
split-string@^3.0.2:
version "3.1.0"
resolved "https://registry.yarnpkg.com/split-string/-/split-string-3.1.0.tgz#7cb09dda3a86585705c64b39a6466038682e8fe2"
integrity sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==
Expand Down
26 changes: 25 additions & 1 deletion integration-tests/search.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import {
waitForResourceToBeSearchable,
getResourcesFromBundleResponse,
randomChainedParamBundle,
randomString,
} from './utils';

jest.setTimeout(600 * 1000);
Expand Down Expand Up @@ -69,7 +70,7 @@ describe('search', () => {
p({ 'organization.name': resources.Organization.name }),
p({ 'general-practitioner:PractitionerRole.organization.name': resources.Organization.name }),
p({ 'general-practitioner:PractitionerRole.practitioner.family': resources.Practitioner.name[0].family }),
p({ 'general-practitioner:PractitionerRole.location.organization.name': resources.Location.name }),
p({ 'general-practitioner:PractitionerRole.location.organization.name': resources.Organization.name }),
// Verify that chained parameters are combined with 'OR'
p({
'organization.name': resources.Organization.name,
Expand All @@ -83,6 +84,25 @@ describe('search', () => {
// eslint-disable-next-line no-await-in-loop
await expectResourceToBePartOfSearchResults(client, testParams, testPatient);
}

const randomStr = randomString();
const testsParamsThatDoNotMatch = [
p({ 'organization.name': randomStr }),
p({ 'general-practitioner:PractitionerRole.organization.name': randomStr }),
p({ 'general-practitioner:PractitionerRole.practitioner.family': randomStr }),
p({ 'general-practitioner:PractitionerRole.location.organization.name': randomStr }),
// Verify that chained parameters are combined with 'OR'
p({
'organization.name': randomStr,
'general-practitioner:PractitionerRole.practitioner.family': 'random-family-name-that-no-one-has',
}),
];

// eslint-disable-next-line no-restricted-syntax
for (const testParams of testsParamsThatDoNotMatch) {
// eslint-disable-next-line no-await-in-loop
await expectResourceToNotBePartOfSearchResults(client, testParams, testPatient);
}
});

test('search for invalid chained parameters', async () => {
Expand Down Expand Up @@ -364,6 +384,7 @@ describe('search', () => {
p({ identifier: 'someCode' }),
p({ identifier: 'http://fwoa-integ-tests.com|' }),
p({ identifier: 'somepatient@fwoa-mail.com' }),
p({ active: true }),
];
// eslint-disable-next-line no-restricted-syntax
for (const testParams of testsParamsThatMatch) {
Expand All @@ -381,6 +402,9 @@ describe('search', () => {
p({ identifier: 'someOtherPatient@fwoa-mail.com' }),
p({ identifier: 'somepatient' }),
p({ identifier: 'fwoa-mail.com' }),
p({ identifier: 'http' }),
p({ identifier: 'someOtherPatient@fwoa' }),
p({ active: false }),
];

// eslint-disable-next-line no-restricted-syntax
Expand Down
2 changes: 2 additions & 0 deletions integration-tests/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -411,6 +411,8 @@ export const expectResourceToNotBePartOfSearchResults = async (

export const aFewMinutesAgoAsDate = () => new Date(Date.now() - 1000 * 60 * 10).toJSON();

export const randomString = () => new Chance().string();

export const expectResourceToBeInBundle = (resource: any, bundle: any) => {
expect(bundle).toMatchObject({
resourceType: 'Bundle',
Expand Down
6 changes: 4 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@
"fhir-works-on-aws-interface": "11.2.0",
"fhir-works-on-aws-persistence-ddb": "3.9.0",
"fhir-works-on-aws-routing": "6.3.0",
"fhir-works-on-aws-search-es": "3.8.0",
"fhir-works-on-aws-search-es": "3.9.2",
"serverless-http": "^2.7.0",
"yargs": "^16.2.0"
},
Expand Down Expand Up @@ -95,7 +95,9 @@
"normalize-url": "^4.5.1",
"path-parse": "^1.0.7",
"set-value": "^4.0.1",
"@types/express-serve-static-core": "^4.17.21"
"@types/express-serve-static-core": "^4.17.21",
"ansi-regex": "^5.0.1",
"json-schema": "^0.4.0"
},
"jest": {
"moduleFileExtensions": [
Expand Down
33 changes: 9 additions & 24 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -2592,22 +2592,7 @@ ansi-escapes@^4.2.1, ansi-escapes@^4.3.1:
dependencies:
type-fest "^0.21.3"

ansi-regex@^2.0.0, ansi-regex@^2.1.1:
version "2.1.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df"
integrity sha1-w7M6te42DYbg5ijwRorn7yfWVN8=

ansi-regex@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.0.tgz#ed0317c322064f79466c02966bddb605ab37d998"
integrity sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=

ansi-regex@^4.1.0:
version "4.1.0"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.0.tgz#8b9f8f08cf1acb843756a839ca8c7e3168c51997"
integrity sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==

ansi-regex@^5.0.0, ansi-regex@^5.0.1:
ansi-regex@^2.0.0, ansi-regex@^2.1.1, ansi-regex@^3.0.0, ansi-regex@^4.1.0, ansi-regex@^5.0.0, ansi-regex@^5.0.1:
version "5.0.1"
resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304"
integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==
Expand Down Expand Up @@ -5603,10 +5588,10 @@ fhir-works-on-aws-routing@6.3.0:
serverless-http "^2.3.1"
uuid "^3.4.0"

fhir-works-on-aws-search-es@3.8.0:
version "3.8.0"
resolved "https://registry.yarnpkg.com/fhir-works-on-aws-search-es/-/fhir-works-on-aws-search-es-3.8.0.tgz#042b1c7462acc8815b18a4d020477f56a6c9bd80"
integrity sha512-KarL+3cdmxswcd/SyTKyUq/QoOJORuLy+8jGSKhk9+ee30W8fWSAc436fy+OXgXeQj5QfRfOcFuNC9T4IZk5mQ==
fhir-works-on-aws-search-es@3.9.2:
version "3.9.2"
resolved "https://registry.yarnpkg.com/fhir-works-on-aws-search-es/-/fhir-works-on-aws-search-es-3.9.2.tgz#be1f478dfce01a170f9619b08d6c1dcbf6ed2d9d"
integrity sha512-xgl9pLQ+miCPNSJmcZzTCzClvRe3rU1oaFKWsOgRKmu8l68VdLUAjgXc8AaG0FP5l/izfzkT/NpFVU6VSWv71g==
dependencies:
"@elastic/elasticsearch" "7.13"
aws-elasticsearch-connector "^8.2.0"
Expand Down Expand Up @@ -7687,10 +7672,10 @@ json-schema-traverse@^1.0.0:
resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-1.0.0.tgz#ae7bcb3656ab77a73ba5c49bf654f38e6b6860e2"
integrity sha512-NM8/P9n3XjXhIZn1lLhkFaACTOURQXjWhV4BA/RnOv8xvgqtqpAX9IO4mRQxSx1Rlo4tqzeqb0sOlruaOy3dug==

json-schema@0.2.3:
version "0.2.3"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.2.3.tgz#b480c892e59a2f05954ce727bd3f2a4e882f9e13"
integrity sha1-tIDIkuWaLwWVTOcnvT8qTogvnhM=
json-schema@0.2.3, json-schema@^0.4.0:
version "0.4.0"
resolved "https://registry.yarnpkg.com/json-schema/-/json-schema-0.4.0.tgz#f7de4cf6efab838ebaeb3236474cbba5a1930ab5"
integrity sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==

json-stable-stringify-without-jsonify@^1.0.1:
version "1.0.1"
Expand Down

0 comments on commit 2e3ee80

Please sign in to comment.