Merge branch 'main' of https://github.com/GSA/notifications-admin into 2481-landing-page-standalone-without-api

This commit is contained in:
Jonathan Bobel
2025-04-16 11:23:07 -04:00
8 changed files with 400 additions and 237 deletions

View File

@@ -6,6 +6,7 @@ APP_VERSION_FILE = app/version.py
GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached") GIT_BRANCH ?= $(shell git symbolic-ref --short HEAD 2> /dev/null || echo "detached")
GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "") GIT_COMMIT ?= $(shell git rev-parse HEAD 2> /dev/null || echo "")
GIT_HOOKS_PATH ?= $(shell git config --global core.hooksPath || echo "")
VIRTUALENV_ROOT := $(shell [ -z $$VIRTUAL_ENV ] && echo $$(pwd)/venv || echo $$VIRTUAL_ENV) VIRTUALENV_ROOT := $(shell [ -z $$VIRTUAL_ENV ] && echo $$(pwd)/venv || echo $$VIRTUAL_ENV)
@@ -14,7 +15,8 @@ NVMSH := $(shell [ -f "$(HOME)/.nvm/nvm.sh" ] && echo "$(HOME)/.nvm/nvm.sh" || e
## DEVELOPMENT ## DEVELOPMENT
.PHONY: bootstrap .PHONY: bootstrap
bootstrap: generate-version-file ## Set up everything to run the app bootstrap: ## Set up everything to run the app
make generate-version-file
poetry self add poetry-dotenv-plugin poetry self add poetry-dotenv-plugin
poetry lock --no-update poetry lock --no-update
poetry install --sync --no-root poetry install --sync --no-root
@@ -24,6 +26,20 @@ bootstrap: generate-version-file ## Set up everything to run the app
source $(NVMSH) && npm ci --no-audit source $(NVMSH) && npm ci --no-audit
source $(NVMSH) && npm run build source $(NVMSH) && npm run build
.PHONY: bootstrap-with-git-hooks
bootstrap-with-git-hooks: ## Sets everything up and accounts for pre-existing git hooks
make generate-version-file
poetry self add poetry-dotenv-plugin
poetry lock --no-update
poetry install --sync --no-root
poetry run playwright install --with-deps
git config --global --unset-all core.hooksPath
poetry run pre-commit install
git config --global core.hookspath "${GIT_HOOKS_PATH}"
source $(NVMSH) --no-use && nvm install && npm install
source $(NVMSH) && npm ci --no-audit
source $(NVMSH) && npm run build
.PHONY: watch-frontend .PHONY: watch-frontend
watch-frontend: ## Build frontend and watch for changes watch-frontend: ## Build frontend and watch for changes
source $(NVMSH) && npm run watch source $(NVMSH) && npm run watch

View File

@@ -608,8 +608,6 @@ def validate_phone_number(number, international=False):
try: try:
parsed = phonenumbers.parse(number, None) parsed = phonenumbers.parse(number, None)
if parsed.country_code != 1:
raise InvalidPhoneError("Invalid country code")
number = f"{parsed.country_code}{parsed.national_number}" number = f"{parsed.country_code}{parsed.national_number}"
if len(number) < 8: if len(number) < 8:
raise InvalidPhoneError("Not enough digits") raise InvalidPhoneError("Not enough digits")

168
package-lock.json generated
View File

@@ -50,7 +50,7 @@
"jest-environment-jsdom": "^29.2.2", "jest-environment-jsdom": "^29.2.2",
"jshint": "2.13.6", "jshint": "2.13.6",
"jshint-stylish": "2.2.1", "jshint-stylish": "2.2.1",
"rollup": "^4.39.0", "rollup": "^4.40.0",
"rollup-plugin-commonjs": "10.1.0", "rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0" "rollup-plugin-node-resolve": "5.2.0"
}, },
@@ -2307,9 +2307,9 @@
} }
}, },
"node_modules/@rollup/rollup-android-arm-eabi": { "node_modules/@rollup/rollup-android-arm-eabi": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm-eabi/-/rollup-android-arm-eabi-4.40.0.tgz",
"integrity": "sha512-lGVys55Qb00Wvh8DMAocp5kIcaNzEFTmGhfFd88LfaogYTRKrdxgtlO5H6S49v2Nd8R2C6wLOal0qv6/kCkOwA==", "integrity": "sha512-+Fbls/diZ0RDerhE8kyC6hjADCXA1K4yVNlH0EYfd2XjyH0UGgzaQ8MlT0pCXAThfxv3QUAczHaL+qSv1E4/Cg==",
"cpu": [ "cpu": [
"arm" "arm"
], ],
@@ -2320,9 +2320,9 @@
] ]
}, },
"node_modules/@rollup/rollup-android-arm64": { "node_modules/@rollup/rollup-android-arm64": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-android-arm64/-/rollup-android-arm64-4.40.0.tgz",
"integrity": "sha512-It9+M1zE31KWfqh/0cJLrrsCPiF72PoJjIChLX+rEcujVRCb4NLQ5QzFkzIZW8Kn8FTbvGQBY5TkKBau3S8cCQ==", "integrity": "sha512-PPA6aEEsTPRz+/4xxAmaoWDqh67N7wFbgFUJGMnanCFs0TV99M0M8QhhaSCks+n6EbQoFvLQgYOGXxlMGQe/6w==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2333,9 +2333,9 @@
] ]
}, },
"node_modules/@rollup/rollup-darwin-arm64": { "node_modules/@rollup/rollup-darwin-arm64": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-arm64/-/rollup-darwin-arm64-4.40.0.tgz",
"integrity": "sha512-lXQnhpFDOKDXiGxsU9/l8UEGGM65comrQuZ+lDcGUx+9YQ9dKpF3rSEGepyeR5AHZ0b5RgiligsBhWZfSSQh8Q==", "integrity": "sha512-GwYOcOakYHdfnjjKwqpTGgn5a6cUX7+Ra2HeNj/GdXvO2VJOOXCiYYlRFU4CubFM67EhbmzLOmACKEfvp3J1kQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2346,9 +2346,9 @@
] ]
}, },
"node_modules/@rollup/rollup-darwin-x64": { "node_modules/@rollup/rollup-darwin-x64": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-darwin-x64/-/rollup-darwin-x64-4.40.0.tgz",
"integrity": "sha512-mKXpNZLvtEbgu6WCkNij7CGycdw9cJi2k9v0noMb++Vab12GZjFgUXD69ilAbBh034Zwn95c2PNSz9xM7KYEAQ==", "integrity": "sha512-CoLEGJ+2eheqD9KBSxmma6ld01czS52Iw0e2qMZNpPDlf7Z9mj8xmMemxEucinev4LgHalDPczMyxzbq+Q+EtA==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -2359,9 +2359,9 @@
] ]
}, },
"node_modules/@rollup/rollup-freebsd-arm64": { "node_modules/@rollup/rollup-freebsd-arm64": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-arm64/-/rollup-freebsd-arm64-4.40.0.tgz",
"integrity": "sha512-jivRRlh2Lod/KvDZx2zUR+I4iBfHcu2V/BA2vasUtdtTN2Uk3jfcZczLa81ESHZHPHy4ih3T/W5rPFZ/hX7RtQ==", "integrity": "sha512-r7yGiS4HN/kibvESzmrOB/PxKMhPTlz+FcGvoUIKYoTyGd5toHp48g1uZy1o1xQvybwwpqpe010JrcGG2s5nkg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2372,9 +2372,9 @@
] ]
}, },
"node_modules/@rollup/rollup-freebsd-x64": { "node_modules/@rollup/rollup-freebsd-x64": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-freebsd-x64/-/rollup-freebsd-x64-4.40.0.tgz",
"integrity": "sha512-8RXIWvYIRK9nO+bhVz8DwLBepcptw633gv/QT4015CpJ0Ht8punmoHU/DuEd3iw9Hr8UwUV+t+VNNuZIWYeY7Q==", "integrity": "sha512-mVDxzlf0oLzV3oZOr0SMJ0lSDd3xC4CmnWJ8Val8isp9jRGl5Dq//LLDSPFrasS7pSm6m5xAcKaw3sHXhBjoRw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -2385,9 +2385,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-arm-gnueabihf": { "node_modules/@rollup/rollup-linux-arm-gnueabihf": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-gnueabihf/-/rollup-linux-arm-gnueabihf-4.40.0.tgz",
"integrity": "sha512-mz5POx5Zu58f2xAG5RaRRhp3IZDK7zXGk5sdEDj4o96HeaXhlUwmLFzNlc4hCQi5sGdR12VDgEUqVSHer0lI9g==", "integrity": "sha512-y/qUMOpJxBMy8xCXD++jeu8t7kzjlOCkoxxajL58G62PJGBZVl/Gwpm7JK9+YvlB701rcQTzjUZ1JgUoPTnoQA==",
"cpu": [ "cpu": [
"arm" "arm"
], ],
@@ -2398,9 +2398,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-arm-musleabihf": { "node_modules/@rollup/rollup-linux-arm-musleabihf": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm-musleabihf/-/rollup-linux-arm-musleabihf-4.40.0.tgz",
"integrity": "sha512-+YDwhM6gUAyakl0CD+bMFpdmwIoRDzZYaTWV3SDRBGkMU/VpIBYXXEvkEcTagw/7VVkL2vA29zU4UVy1mP0/Yw==", "integrity": "sha512-GoCsPibtVdJFPv/BOIvBKO/XmwZLwaNWdyD8TKlXuqp0veo2sHE+A/vpMQ5iSArRUz/uaoj4h5S6Pn0+PdhRjg==",
"cpu": [ "cpu": [
"arm" "arm"
], ],
@@ -2411,9 +2411,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-arm64-gnu": { "node_modules/@rollup/rollup-linux-arm64-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-gnu/-/rollup-linux-arm64-gnu-4.40.0.tgz",
"integrity": "sha512-EKf7iF7aK36eEChvlgxGnk7pdJfzfQbNvGV/+l98iiMwU23MwvmV0Ty3pJ0p5WQfm3JRHOytSIqD9LB7Bq7xdQ==", "integrity": "sha512-L5ZLphTjjAD9leJzSLI7rr8fNqJMlGDKlazW2tX4IUF9P7R5TMQPElpH82Q7eNIDQnQlAyiNVfRPfP2vM5Avvg==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2424,9 +2424,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-arm64-musl": { "node_modules/@rollup/rollup-linux-arm64-musl": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-arm64-musl/-/rollup-linux-arm64-musl-4.40.0.tgz",
"integrity": "sha512-vYanR6MtqC7Z2SNr8gzVnzUul09Wi1kZqJaek3KcIlI/wq5Xtq4ZPIZ0Mr/st/sv/NnaPwy/D4yXg5x0B3aUUA==", "integrity": "sha512-ATZvCRGCDtv1Y4gpDIXsS+wfFeFuLwVxyUBSLawjgXK2tRE6fnsQEkE4csQQYWlBlsFztRzCnBvWVfcae/1qxQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2437,9 +2437,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-loongarch64-gnu": { "node_modules/@rollup/rollup-linux-loongarch64-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-loongarch64-gnu/-/rollup-linux-loongarch64-gnu-4.40.0.tgz",
"integrity": "sha512-NMRUT40+h0FBa5fb+cpxtZoGAggRem16ocVKIv5gDB5uLDgBIwrIsXlGqYbLwW8YyO3WVTk1FkFDjMETYlDqiw==", "integrity": "sha512-wG9e2XtIhd++QugU5MD9i7OnpaVb08ji3P1y/hNbxrQ3sYEelKJOq1UJ5dXczeo6Hj2rfDEL5GdtkMSVLa/AOg==",
"cpu": [ "cpu": [
"loong64" "loong64"
], ],
@@ -2450,9 +2450,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-powerpc64le-gnu": { "node_modules/@rollup/rollup-linux-powerpc64le-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-powerpc64le-gnu/-/rollup-linux-powerpc64le-gnu-4.40.0.tgz",
"integrity": "sha512-0pCNnmxgduJ3YRt+D+kJ6Ai/r+TaePu9ZLENl+ZDV/CdVczXl95CbIiwwswu4L+K7uOIGf6tMo2vm8uadRaICQ==", "integrity": "sha512-vgXfWmj0f3jAUvC7TZSU/m/cOE558ILWDzS7jBhiCAFpY2WEBn5jqgbqvmzlMjtp8KlLcBlXVD2mkTSEQE6Ixw==",
"cpu": [ "cpu": [
"ppc64" "ppc64"
], ],
@@ -2463,9 +2463,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-riscv64-gnu": { "node_modules/@rollup/rollup-linux-riscv64-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-gnu/-/rollup-linux-riscv64-gnu-4.40.0.tgz",
"integrity": "sha512-t7j5Zhr7S4bBtksT73bO6c3Qa2AV/HqiGlj9+KB3gNF5upcVkx+HLgxTm8DK4OkzsOYqbdqbLKwvGMhylJCPhQ==", "integrity": "sha512-uJkYTugqtPZBS3Z136arevt/FsKTF/J9dEMTX/cwR7lsAW4bShzI2R0pJVw+hcBTWF4dxVckYh72Hk3/hWNKvA==",
"cpu": [ "cpu": [
"riscv64" "riscv64"
], ],
@@ -2476,9 +2476,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-riscv64-musl": { "node_modules/@rollup/rollup-linux-riscv64-musl": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-riscv64-musl/-/rollup-linux-riscv64-musl-4.40.0.tgz",
"integrity": "sha512-m6cwI86IvQ7M93MQ2RF5SP8tUjD39Y7rjb1qjHgYh28uAPVU8+k/xYWvxRO3/tBN2pZkSMa5RjnPuUIbrwVxeA==", "integrity": "sha512-rKmSj6EXQRnhSkE22+WvrqOqRtk733x3p5sWpZilhmjnkHkpeCgWsFFo0dGnUGeA+OZjRl3+VYq+HyCOEuwcxQ==",
"cpu": [ "cpu": [
"riscv64" "riscv64"
], ],
@@ -2489,9 +2489,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-s390x-gnu": { "node_modules/@rollup/rollup-linux-s390x-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-s390x-gnu/-/rollup-linux-s390x-gnu-4.40.0.tgz",
"integrity": "sha512-iRDJd2ebMunnk2rsSBYlsptCyuINvxUfGwOUldjv5M4tpa93K8tFMeYGpNk2+Nxl+OBJnBzy2/JCscGeO507kA==", "integrity": "sha512-SpnYlAfKPOoVsQqmTFJ0usx0z84bzGOS9anAC0AZ3rdSo3snecihbhFTlJZ8XMwzqAcodjFU4+/SM311dqE5Sw==",
"cpu": [ "cpu": [
"s390x" "s390x"
], ],
@@ -2502,9 +2502,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-x64-gnu": { "node_modules/@rollup/rollup-linux-x64-gnu": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-gnu/-/rollup-linux-x64-gnu-4.40.0.tgz",
"integrity": "sha512-t9jqYw27R6Lx0XKfEFe5vUeEJ5pF3SGIM6gTfONSMb7DuG6z6wfj2yjcoZxHg129veTqU7+wOhY6GX8wmf90dA==", "integrity": "sha512-RcDGMtqF9EFN8i2RYN2W+64CdHruJ5rPqrlYw+cgM3uOVPSsnAQps7cpjXe9be/yDp8UC7VLoCoKC8J3Kn2FkQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -2515,9 +2515,9 @@
] ]
}, },
"node_modules/@rollup/rollup-linux-x64-musl": { "node_modules/@rollup/rollup-linux-x64-musl": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-linux-x64-musl/-/rollup-linux-x64-musl-4.40.0.tgz",
"integrity": "sha512-ThFdkrFDP55AIsIZDKSBWEt/JcWlCzydbZHinZ0F/r1h83qbGeenCt/G/wG2O0reuENDD2tawfAj2s8VK7Bugg==", "integrity": "sha512-HZvjpiUmSNx5zFgwtQAV1GaGazT2RWvqeDi0hV+AtC8unqqDSsaFjPxfsO6qPtKRRg25SisACWnJ37Yio8ttaw==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -2528,9 +2528,9 @@
] ]
}, },
"node_modules/@rollup/rollup-win32-arm64-msvc": { "node_modules/@rollup/rollup-win32-arm64-msvc": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-arm64-msvc/-/rollup-win32-arm64-msvc-4.40.0.tgz",
"integrity": "sha512-jDrLm6yUtbOg2TYB3sBF3acUnAwsIksEYjLeHL+TJv9jg+TmTwdyjnDex27jqEMakNKf3RwwPahDIt7QXCSqRQ==", "integrity": "sha512-UtZQQI5k/b8d7d3i9AZmA/t+Q4tk3hOC0tMOMSq2GlMYOfxbesxG4mJSeDp0EHs30N9bsfwUvs3zF4v/RzOeTQ==",
"cpu": [ "cpu": [
"arm64" "arm64"
], ],
@@ -2541,9 +2541,9 @@
] ]
}, },
"node_modules/@rollup/rollup-win32-ia32-msvc": { "node_modules/@rollup/rollup-win32-ia32-msvc": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-ia32-msvc/-/rollup-win32-ia32-msvc-4.40.0.tgz",
"integrity": "sha512-6w9uMuza+LbLCVoNKL5FSLE7yvYkq9laSd09bwS0tMjkwXrmib/4KmoJcrKhLWHvw19mwU+33ndC69T7weNNjQ==", "integrity": "sha512-+m03kvI2f5syIqHXCZLPVYplP8pQch9JHyXKZ3AGMKlg8dCyr2PKHjwRLiW53LTrN/Nc3EqHOKxUxzoSPdKddA==",
"cpu": [ "cpu": [
"ia32" "ia32"
], ],
@@ -2554,9 +2554,9 @@
] ]
}, },
"node_modules/@rollup/rollup-win32-x64-msvc": { "node_modules/@rollup/rollup-win32-x64-msvc": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.39.0.tgz", "resolved": "https://registry.npmjs.org/@rollup/rollup-win32-x64-msvc/-/rollup-win32-x64-msvc-4.40.0.tgz",
"integrity": "sha512-yAkUOkIKZlK5dl7u6dg897doBgLXmUHhIINM2c+sND3DZwnrdQkkSiDh7N75Ll4mM4dxSkYfXqU9fW3lLkMFug==", "integrity": "sha512-lpPE1cLfP5oPzVjKMx10pgBmKELQnFJXHgvtHCtuJWOv8MxqdEIMNtgHgBFf7Ea2/7EuVwa9fodWUfXAlXZLZQ==",
"cpu": [ "cpu": [
"x64" "x64"
], ],
@@ -11429,9 +11429,9 @@
"license": "Unlicense" "license": "Unlicense"
}, },
"node_modules/rollup": { "node_modules/rollup": {
"version": "4.39.0", "version": "4.40.0",
"resolved": "https://registry.npmjs.org/rollup/-/rollup-4.39.0.tgz", "resolved": "https://registry.npmjs.org/rollup/-/rollup-4.40.0.tgz",
"integrity": "sha512-thI8kNc02yNvnmJp8dr3fNWJ9tCONDhp6TV35X6HkKGGs9E6q7YWCHbe5vKiTa7TAiNcFEmXKj3X/pG2b3ci0g==", "integrity": "sha512-Noe455xmA96nnqH5piFtLobsGbCij7Tu+tb3c1vYjNbTkfzGqXqQXG3wJaYXkRZuQ0vEYN4bhwg7QnIrqB5B+w==",
"license": "MIT", "license": "MIT",
"dependencies": { "dependencies": {
"@types/estree": "1.0.7" "@types/estree": "1.0.7"
@@ -11444,26 +11444,26 @@
"npm": ">=8.0.0" "npm": ">=8.0.0"
}, },
"optionalDependencies": { "optionalDependencies": {
"@rollup/rollup-android-arm-eabi": "4.39.0", "@rollup/rollup-android-arm-eabi": "4.40.0",
"@rollup/rollup-android-arm64": "4.39.0", "@rollup/rollup-android-arm64": "4.40.0",
"@rollup/rollup-darwin-arm64": "4.39.0", "@rollup/rollup-darwin-arm64": "4.40.0",
"@rollup/rollup-darwin-x64": "4.39.0", "@rollup/rollup-darwin-x64": "4.40.0",
"@rollup/rollup-freebsd-arm64": "4.39.0", "@rollup/rollup-freebsd-arm64": "4.40.0",
"@rollup/rollup-freebsd-x64": "4.39.0", "@rollup/rollup-freebsd-x64": "4.40.0",
"@rollup/rollup-linux-arm-gnueabihf": "4.39.0", "@rollup/rollup-linux-arm-gnueabihf": "4.40.0",
"@rollup/rollup-linux-arm-musleabihf": "4.39.0", "@rollup/rollup-linux-arm-musleabihf": "4.40.0",
"@rollup/rollup-linux-arm64-gnu": "4.39.0", "@rollup/rollup-linux-arm64-gnu": "4.40.0",
"@rollup/rollup-linux-arm64-musl": "4.39.0", "@rollup/rollup-linux-arm64-musl": "4.40.0",
"@rollup/rollup-linux-loongarch64-gnu": "4.39.0", "@rollup/rollup-linux-loongarch64-gnu": "4.40.0",
"@rollup/rollup-linux-powerpc64le-gnu": "4.39.0", "@rollup/rollup-linux-powerpc64le-gnu": "4.40.0",
"@rollup/rollup-linux-riscv64-gnu": "4.39.0", "@rollup/rollup-linux-riscv64-gnu": "4.40.0",
"@rollup/rollup-linux-riscv64-musl": "4.39.0", "@rollup/rollup-linux-riscv64-musl": "4.40.0",
"@rollup/rollup-linux-s390x-gnu": "4.39.0", "@rollup/rollup-linux-s390x-gnu": "4.40.0",
"@rollup/rollup-linux-x64-gnu": "4.39.0", "@rollup/rollup-linux-x64-gnu": "4.40.0",
"@rollup/rollup-linux-x64-musl": "4.39.0", "@rollup/rollup-linux-x64-musl": "4.40.0",
"@rollup/rollup-win32-arm64-msvc": "4.39.0", "@rollup/rollup-win32-arm64-msvc": "4.40.0",
"@rollup/rollup-win32-ia32-msvc": "4.39.0", "@rollup/rollup-win32-ia32-msvc": "4.40.0",
"@rollup/rollup-win32-x64-msvc": "4.39.0", "@rollup/rollup-win32-x64-msvc": "4.40.0",
"fsevents": "~2.3.2" "fsevents": "~2.3.2"
} }
}, },

View File

@@ -66,7 +66,7 @@
"jest-environment-jsdom": "^29.2.2", "jest-environment-jsdom": "^29.2.2",
"jshint": "2.13.6", "jshint": "2.13.6",
"jshint-stylish": "2.2.1", "jshint-stylish": "2.2.1",
"rollup": "^4.39.0", "rollup": "^4.40.0",
"rollup-plugin-commonjs": "10.1.0", "rollup-plugin-commonjs": "10.1.0",
"rollup-plugin-node-resolve": "5.2.0" "rollup-plugin-node-resolve": "5.2.0"
} }

260
poetry.lock generated

File diff suppressed because it is too large Load Diff

View File

@@ -50,7 +50,7 @@ geojson = "^3.1.0"
jmespath = "^1.0.1" jmespath = "^1.0.1"
numpy = "^2.2.4" numpy = "^2.2.4"
ordered-set = "^4.1.0" ordered-set = "^4.1.0"
phonenumbers = "^9.0.2" phonenumbers = "^9.0.3"
pycparser = "^2.22" pycparser = "^2.22"
python-json-logger = "^3.3.0" python-json-logger = "^3.3.0"
redis = "^5.2.1" redis = "^5.2.1"

View File

@@ -765,6 +765,10 @@ def test_bad_or_missing_data(
assert recipients.has_errors is True assert recipients.has_errors is True
# TODO in the first test where the expected result is {0,1}, the original
# expected result was {0,1,2}. Why? In restoring international capability
# for some reason +447900123 now looks legit. It may have more to do with
# formatting than the actually validity of the number, not sure.
@pytest.mark.parametrize( @pytest.mark.parametrize(
("file_contents", "rows_with_bad_recipients"), ("file_contents", "rows_with_bad_recipients"),
[ [
@@ -775,7 +779,7 @@ def test_bad_or_missing_data(
1234 1234
+447900123 +447900123
""", """,
{0, 1, 2}, {0, 1},
), ),
( (
""" """
@@ -784,7 +788,7 @@ def test_bad_or_missing_data(
+12022340104, USA +12022340104, USA
+23051234567, Mauritius +23051234567, Mauritius
""", """,
{2}, set(),
), ),
], ],
) )

View File

@@ -23,21 +23,17 @@ valid_us_phone_numbers = [
"(202) 555-0104", "(202) 555-0104",
] ]
# TODO
# International phone number tests are commented out as a result of issue #943 in notifications-admin. We are
# deliberately eliminating the ability to send to numbers outside of country code 1. These tests should
# be removed at some point when we are sure we are never going to support international numbers
valid_international_phone_numbers = [ valid_international_phone_numbers = [
# "+71234567890", # Russia "+71234567890", # Russia
# "+447123456789", # UK "+447123456789", # UK
# "+4407123456789", # UK "+4407123456789", # UK
# "+4407123 456789", # UK "+4407123 456789", # UK
# "+4407123-456-789", # UK "+4407123-456-789", # UK
# "+23051234567", # Mauritius, "+23051234567", # Mauritius,
# "+682 12345", # Cook islands "+682 12345", # Cook islands
# "+3312345678", "+3312345678",
# "+9-2345-12345-12345", # 15 digits "+9-2345-12345-12345", # 15 digits
] ]
@@ -84,7 +80,7 @@ invalid_us_phone_numbers = sum(
invalid_phone_numbers = [ invalid_phone_numbers = [
("+80233456789", "Not a valid country prefix"), ("+80233456789", "Not a valid country prefix"),
("1234567", "Not enough digits"), ("1234567", "Not enough digits"),
("+682 1234", "Invalid country code"), # Cook Islands phone numbers can be 5 digits ("+682 1234", "Not enough digits"),
("+12345 12345 12345 6", "Too many digits"), ("+12345 12345 12345 6", "Too many digits"),
] ]
@@ -155,46 +151,46 @@ def test_detect_us_phone_numbers(phone_number):
@pytest.mark.parametrize( @pytest.mark.parametrize(
("phone_number", "expected_info"), ("phone_number", "expected_info"),
[ [
# ( (
# "+4407900900123", "+4407900900123",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="44", # UK country_prefix="44", # UK
# billable_units=1, billable_units=1,
# ), ),
# ), ),
# ( (
# "+4407700900123", "+4407700900123",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="44", # Number in TV range country_prefix="44", # Number in TV range
# billable_units=1, billable_units=1,
# ), ),
# ), ),
# ( (
# "+4407700800123", "+4407700800123",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="44", # UK Crown dependency, so prefix same as UK country_prefix="44", # UK Crown dependency, so prefix same as UK
# billable_units=1, billable_units=1,
# ), ),
# ), ),
# ( # ( #
# "+20-12-1234-1234", "+20-12-1234-1234",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="20", # Egypt country_prefix="20", # Egypt
# billable_units=1, billable_units=1,
# ), ),
# ), ),
# ( (
# "+201212341234", "+201212341234",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="20", # Egypt country_prefix="20", # Egypt
# billable_units=1, billable_units=1,
# ), ),
# ), ),
( (
"+1 664-491-3434", "+1 664-491-3434",
international_phone_info( international_phone_info(
@@ -203,14 +199,14 @@ def test_detect_us_phone_numbers(phone_number):
billable_units=1, billable_units=1,
), ),
), ),
# ( (
# "+71234567890", "+71234567890",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="7", # Russia country_prefix="7", # Russia
# billable_units=1, billable_units=1,
# ), ),
# ), ),
( (
"1-202-555-0104", "1-202-555-0104",
international_phone_info( international_phone_info(
@@ -227,14 +223,14 @@ def test_detect_us_phone_numbers(phone_number):
billable_units=1, billable_units=1,
), ),
), ),
# ( (
# "+23051234567", "+23051234567",
# international_phone_info( international_phone_info(
# international=True, international=True,
# country_prefix="230", # Mauritius country_prefix="230", # Mauritius
# billable_units=1, billable_units=1,
# ), ),
# ), ),
], ],
) )
def test_get_international_info(phone_number, expected_info): def test_get_international_info(phone_number, expected_info):
@@ -287,11 +283,11 @@ def test_valid_us_phone_number_can_be_formatted_consistently(phone_number):
@pytest.mark.parametrize( @pytest.mark.parametrize(
("phone_number", "expected_formatted"), ("phone_number", "expected_formatted"),
[ [
# ("+44071234567890", "+4471234567890"), ("+44071234567890", "+4471234567890"),
("1-202-555-0104", "+12025550104"), ("1-202-555-0104", "+12025550104"),
("+12025550104", "+12025550104"), ("+12025550104", "+12025550104"),
("12025550104", "+12025550104"), ("12025550104", "+12025550104"),
# ("+23051234567", "+23051234567"), ("+23051234567", "+23051234567"),
], ],
) )
def test_valid_international_phone_number_can_be_formatted_consistently( def test_valid_international_phone_number_can_be_formatted_consistently(
@@ -362,17 +358,17 @@ def test_validates_against_guestlist_of_phone_numbers(phone_number):
) )
# @pytest.mark.parametrize( @pytest.mark.parametrize(
# "recipient_number, allowlist_number", ("recipient_number", "allowlist_number"),
# [ [
# ["+4407123-456-789", "+4407123456789"], ("+4407123-456-789", "+4407123456789"),
# ["+4407123456789", "+4407123-456-789"], ("+4407123456789", "+4407123-456-789"),
# ], ],
# ) )
# def test_validates_against_guestlist_of_international_phone_numbers( def test_validates_against_guestlist_of_international_phone_numbers(
# recipient_number, allowlist_number recipient_number, allowlist_number
# ): ):
# assert allowed_to_send_to(recipient_number, [allowlist_number]) assert allowed_to_send_to(recipient_number, [allowlist_number])
@pytest.mark.parametrize("email_address", valid_email_addresses) @pytest.mark.parametrize("email_address", valid_email_addresses)
@@ -385,16 +381,17 @@ def test_validates_against_guestlist_of_email_addresses(email_address):
@pytest.mark.parametrize( @pytest.mark.parametrize(
("phone_number", "expected_formatted"), ("phone_number", "expected_formatted"),
[ [
# ("+4407900900123", "+44 7900 900123"), # UK ("+4407900900123", "+44 7900 900123"), # UK
# ("+44(0)7900900123", "+44 7900 900123"), # UK ("+44(0)7900900123", "+44 7900 900123"), # UK
# ("+447900900123", "+44 7900 900123"), # UK ("+447900900123", "+44 7900 900123"), # UK
# TODO these should be fixed, but affect readability, not sendability
# ("+20-12-1234-1234", "+20 121 234 1234"), # Egypt # ("+20-12-1234-1234", "+20 121 234 1234"), # Egypt
# ("+201212341234", "+20 121 234 1234"), # Egypt # ("+201212341234", "+20 121 234 1234"), # Egypt
("+1 664 491-3434", "+1 664-491-3434"), # Montserrat ("+1 664 491-3434", "+1 664-491-3434"), # Montserrat
# ("+7 499 1231212", "+7 499 123-12-12"), # Moscow (Russia) ("+7 499 1231212", "+7 499 123-12-12"), # Moscow (Russia)
("1-202-555-0104", "(202) 555-0104"), # Washington DC (USA) ("1-202-555-0104", "(202) 555-0104"), # Washington DC (USA)
# ("+23051234567", "+230 5123 4567"), # Mauritius ("+23051234567", "+230 5123 4567"), # Mauritius
# ("+33(0)1 12345678", "+33 1 12 34 56 78"), # Paris (France) ("+33(0)1 12345678", "+33 1 12 34 56 78"), # Paris (France)
], ],
) )
def test_format_us_and_international_phone_numbers(phone_number, expected_formatted): def test_format_us_and_international_phone_numbers(phone_number, expected_formatted):
@@ -411,7 +408,7 @@ def test_format_us_and_international_phone_numbers(phone_number, expected_format
(None, ""), (None, ""),
("foo", "foo"), ("foo", "foo"),
("TeSt@ExAmPl3.com", "test@exampl3.com"), ("TeSt@ExAmPl3.com", "test@exampl3.com"),
# ("+4407900 900 123", "+447900900123"), ("+4407900 900 123", "+447900900123"),
("+1 800 555 5555", "+18005555555"), ("+1 800 555 5555", "+18005555555"),
], ],
) )