diff --git a/.github/workflows/code_review_infra.yaml b/.github/workflows/code_review_infra.yaml index 307dfffdc0..ca3b1375f3 100644 --- a/.github/workflows/code_review_infra.yaml +++ b/.github/workflows/code_review_infra.yaml @@ -34,6 +34,9 @@ jobs: - name: Compile Cloudfront Functions run: npm run compile -w cloudfront-functions + - name: Build Cognito Functions + run: npm run build -w cognito-functions + - name: Configure AWS Credentials uses: ./.github/actions/configure-aws-credentials with: diff --git a/.github/workflows/deploy_infra.yml b/.github/workflows/deploy_infra.yml index 6913779433..31b8be7220 100644 --- a/.github/workflows/deploy_infra.yml +++ b/.github/workflows/deploy_infra.yml @@ -51,6 +51,9 @@ jobs: - name: Compile Cloudfront Functions run: npm run compile -w cloudfront-functions + - name: Build Cognito Functions + run: npm run build -w cognito-functions + - name: Configure AWS Credentials uses: ./.github/actions/configure-aws-credentials with: diff --git a/.infrastructure/.terraform.lock.hcl b/.infrastructure/.terraform.lock.hcl index db484b2da6..ee641955a9 100644 --- a/.infrastructure/.terraform.lock.hcl +++ b/.infrastructure/.terraform.lock.hcl @@ -24,6 +24,66 @@ provider "registry.terraform.io/hashicorp/aws" { ] } +provider "registry.terraform.io/hashicorp/external" { + version = "2.3.1" + constraints = ">= 1.0.0" + hashes = [ + "h1:9rJggijNdRdFk//ViQPGZdK0xu9XU/9qBDijNsZJMg0=", + "zh:001e2886dc81fc98cf17cf34c0d53cb2dae1e869464792576e11b0f34ee92f54", + "zh:2eeac58dd75b1abdf91945ac4284c9ccb2bfb17fa9bdb5f5d408148ff553b3ee", + "zh:2fc39079ba61411a737df2908942e6970cb67ed2f4fb19090cd44ce2082903dd", + "zh:472a71c624952cff7aa98a7b967f6c7bb53153dbd2b8f356ceb286e6743bb4e2", + "zh:4cff06d31272aac8bc35e9b7faec42cf4554cbcbae1092eaab6ab7f643c215d9", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:7ed16ccd2049fa089616b98c0bd57219f407958f318f3c697843e2397ddf70df", + "zh:842696362c92bf2645eb85c739410fd51376be6c488733efae44f4ce688da50e", + "zh:8985129f2eccfd7f1841ce06f3bf2bbede6352ec9e9f926fbaa6b1a05313b326", + "zh:a5f0602d8ec991a5411ef42f872aa90f6347e93886ce67905c53cfea37278e05", + "zh:bf4ab82cbe5256dcef16949973bf6aa1a98c2c73a98d6a44ee7bc40809d002b8", + "zh:e70770be62aa70198fa899526d671643ff99eecf265bf1a50e798fc3480bd417", + ] +} + +provider "registry.terraform.io/hashicorp/local" { + version = "2.4.0" + constraints = ">= 1.0.0" + hashes = [ + "h1:Bs7LAkV/iQTLv72j+cTMrvx2U3KyXrcVHaGbdns1NcE=", + "zh:53604cd29cb92538668fe09565c739358dc53ca56f9f11312b9d7de81e48fab9", + "zh:66a46e9c508716a1c98efbf793092f03d50049fa4a83cd6b2251e9a06aca2acf", + "zh:70a6f6a852dd83768d0778ce9817d81d4b3f073fab8fa570bff92dcb0824f732", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:82a803f2f484c8b766e2e9c32343e9c89b91997b9f8d2697f9f3837f62926b35", + "zh:9708a4e40d6cc4b8afd1352e5186e6e1502f6ae599867c120967aebe9d90ed04", + "zh:973f65ce0d67c585f4ec250c1e634c9b22d9c4288b484ee2a871d7fa1e317406", + "zh:c8fa0f98f9316e4cfef082aa9b785ba16e36ff754d6aba8b456dab9500e671c6", + "zh:cfa5342a5f5188b20db246c73ac823918c189468e1382cb3c48a9c0c08fc5bf7", + "zh:e0e2b477c7e899c63b06b38cd8684a893d834d6d0b5e9b033cedc06dd7ffe9e2", + "zh:f62d7d05ea1ee566f732505200ab38d94315a4add27947a60afa29860822d3fc", + "zh:fa7ce69dde358e172bd719014ad637634bbdabc49363104f4fca759b4b73f2ce", + ] +} + +provider "registry.terraform.io/hashicorp/null" { + version = "3.2.1" + constraints = ">= 2.0.0" + hashes = [ + "h1:tSj1mL6OQ8ILGqR2mDu7OYYYWf+hoir0pf9KAQ8IzO8=", + "zh:58ed64389620cc7b82f01332e27723856422820cfd302e304b5f6c3436fb9840", + "zh:62a5cc82c3b2ddef7ef3a6f2fedb7b9b3deff4ab7b414938b08e51d6e8be87cb", + "zh:63cff4de03af983175a7e37e52d4bd89d990be256b16b5c7f919aff5ad485aa5", + "zh:74cb22c6700e48486b7cabefa10b33b801dfcab56f1a6ac9b6624531f3d36ea3", + "zh:78d5eefdd9e494defcb3c68d282b8f96630502cac21d1ea161f53cfe9bb483b3", + "zh:79e553aff77f1cfa9012a2218b8238dd672ea5e1b2924775ac9ac24d2a75c238", + "zh:a1e06ddda0b5ac48f7e7c7d59e1ab5a4073bbcf876c73c0299e4610ed53859dc", + "zh:c37a97090f1a82222925d45d84483b2aa702ef7ab66532af6cbcfb567818b970", + "zh:e4453fbebf90c53ca3323a92e7ca0f9961427d2f0ce0d2b65523cc04d5d999c2", + "zh:e80a746921946d8b6761e77305b752ad188da60688cfd2059322875d363be5f5", + "zh:fbdb892d9822ed0e4cb60f2fedbdbb556e4da0d88d3b942ae963ed6ff091e48f", + "zh:fca01a623d90d0cad0843102f9b8b9fe0d3ff8244593bd817f126582b52dd694", + ] +} + provider "registry.terraform.io/hashicorp/random" { version = "3.5.1" hashes = [ diff --git a/.infrastructure/55_cognito.tf b/.infrastructure/55_cognito.tf index 17e7f32a56..eef01b458e 100644 --- a/.infrastructure/55_cognito.tf +++ b/.infrastructure/55_cognito.tf @@ -1,3 +1,27 @@ +module "cognito_custom_message_function" { + source = "terraform-aws-modules/lambda/aws" + + function_name = "cognito_custom_message" + description = "Cognito custom message" + handler = "main.customMessageHandler" + runtime = "nodejs18.x" + + create_package = false + local_existing_package = "../apps/cognito-functions/out/cognito-functions.zip" + create_current_version_allowed_triggers = false + + environment_variables = { + DOMAIN = var.dns_domain_name + } + + allowed_triggers = { + cognito_devportal = { + principal = "cognito-idp.amazonaws.com" + source_arn = aws_cognito_user_pool.devportal.arn + } + } +} + resource "aws_cognito_user_pool" "devportal" { name = "devportalpool" deletion_protection = "ACTIVE" @@ -36,6 +60,14 @@ resource "aws_cognito_user_pool" "devportal" { source_arn = module.ses_developer_pagopa_it.ses_domain_identity_arn } + verification_message_template { + default_email_option = "CONFIRM_WITH_CODE" + } + + lambda_config { + custom_message = module.cognito_custom_message_function.lambda_function_arn + } + # Custom attributes cannot be required. # Terraform cannot update or delete an attribute. # Terraform can add a new attribute as update in-place. diff --git a/apps/cognito-functions/.eslintrc.json b/apps/cognito-functions/.eslintrc.json new file mode 100644 index 0000000000..027a424614 --- /dev/null +++ b/apps/cognito-functions/.eslintrc.json @@ -0,0 +1,6 @@ +{ + "root": true, + "extends": [ + "custom" + ] +} diff --git a/apps/cognito-functions/.gitignore b/apps/cognito-functions/.gitignore new file mode 100644 index 0000000000..37c39223b6 --- /dev/null +++ b/apps/cognito-functions/.gitignore @@ -0,0 +1,218 @@ +# Created by https://www.toptal.com/developers/gitignore/api/node,macos,windows,linux +# Edit at https://www.toptal.com/developers/gitignore?templates=node,macos,windows,linux + +### Linux ### +*~ + +# temporary files which can be created if a process still has a handle open of a deleted file +.fuse_hidden* + +# KDE directory preferences +.directory + +# Linux trash folder which might appear on any partition or disk +.Trash-* + +# .nfs files are created when an open file is removed but is still being accessed +.nfs* + +### macOS ### +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +### macOS Patch ### +# iCloud generated files +*.icloud + +### Node ### +# Logs +logs +*.log +npm-debug.log* +yarn-debug.log* +yarn-error.log* +lerna-debug.log* +.pnpm-debug.log* + +# Diagnostic reports (https://nodejs.org/api/report.html) +report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json + +# Runtime data +pids +*.pid +*.seed +*.pid.lock + +# Directory for instrumented libs generated by jscoverage/JSCover +lib-cov + +# Coverage directory used by tools like istanbul +coverage +*.lcov + +# nyc test coverage +.nyc_output + +# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files) +.grunt + +# Bower dependency directory (https://bower.io/) +bower_components + +# node-waf configuration +.lock-wscript + +# Compiled binary addons (https://nodejs.org/api/addons.html) +build/Release + +# Dependency directories +node_modules/ +jspm_packages/ + +# Snowpack dependency directory (https://snowpack.dev/) +web_modules/ + +# TypeScript cache +*.tsbuildinfo + +# Optional npm cache directory +.npm + +# Optional eslint cache +.eslintcache + +# Optional stylelint cache +.stylelintcache + +# Microbundle cache +.rpt2_cache/ +.rts2_cache_cjs/ +.rts2_cache_es/ +.rts2_cache_umd/ + +# Optional REPL history +.node_repl_history + +# Output of 'npm pack' +*.tgz + +# Yarn Integrity file +.yarn-integrity + +# dotenv environment variable files +.env +.env.development.local +.env.test.local +.env.production.local +.env.local + +# parcel-bundler cache (https://parceljs.org/) +.cache +.parcel-cache + +# Next.js build output +.next +out + +# Nuxt.js build / generate output +.nuxt +dist + +# Gatsby files +.cache/ +# Comment in the public line in if your project uses Gatsby and not Next.js +# https://nextjs.org/blog/next-9-1#public-directory-support +# public + +# vuepress build output +.vuepress/dist + +# vuepress v2.x temp and cache directory +.temp + +# Docusaurus cache and generated files +.docusaurus + +# Serverless directories +.serverless/ + +# FuseBox cache +.fusebox/ + +# DynamoDB Local files +.dynamodb/ + +# TernJS port file +.tern-port + +# Stores VSCode versions used for testing VSCode extensions +.vscode-test + +# yarn v2 +.yarn/cache +.yarn/unplugged +.yarn/build-state.yml +.yarn/install-state.gz +.pnp.* + +### Node Patch ### +# Serverless Webpack directories +.webpack/ + +# Optional stylelint cache + +# SvelteKit build / generate output +.svelte-kit + +### Windows ### +# Windows thumbnail cache files +Thumbs.db +Thumbs.db:encryptable +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# End of https://www.toptal.com/developers/gitignore/api/node,macos,windows,linux diff --git a/apps/cognito-functions/jest.config.js b/apps/cognito-functions/jest.config.js new file mode 100644 index 0000000000..97092dfc54 --- /dev/null +++ b/apps/cognito-functions/jest.config.js @@ -0,0 +1,17 @@ +/** @type {import('jest').Config} */ +const config = { + roots: ['/src'], + testMatch: ['**/__tests__/**/*.+(ts)'], + moduleFileExtensions: ['ts', 'js'], + transform: { + '^.+\\.(ts)$': 'ts-jest', + }, + coverageThreshold: { + global: { + branches: 70, + lines: 70, + }, + }, +}; + +module.exports = config; diff --git a/apps/cognito-functions/package.json b/apps/cognito-functions/package.json new file mode 100644 index 0000000000..c7a7f0c5f1 --- /dev/null +++ b/apps/cognito-functions/package.json @@ -0,0 +1,28 @@ +{ + "name": "cognito-functions", + "version": "0.0.0", + "private": true, + "scripts": { + "clean": "shx rm -rf dist/ out/", + "compile": "npm run clean && tsc", + "build": "npm run compile && esbuild dist/main.js --bundle --platform=node --outfile=out/main.js", + "postbuild": "cd out && zip -r cognito-functions.zip .", + "lint": "eslint src", + "test": "npm run compile && jest -i" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.125", + "esbuild": "^0.19.5", + "eslint": "^8.40.0", + "eslint-config-custom": "*", + "jest": "^29.5.0", + "shx": "^0.3.4", + "ts-jest": "^29.1.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.2" + }, + "dependencies": { + "fp-ts": "^2.16.1", + "io-ts": "^2.2.20" + } +} diff --git a/apps/cognito-functions/src/__tests__/custom-message-handler.test.ts b/apps/cognito-functions/src/__tests__/custom-message-handler.test.ts new file mode 100644 index 0000000000..58108a0073 --- /dev/null +++ b/apps/cognito-functions/src/__tests__/custom-message-handler.test.ts @@ -0,0 +1,41 @@ +import { CustomMessageTriggerEvent } from 'aws-lambda'; +import { emailTemplate, makeHandler } from '../custom-message-handler'; + +const event: CustomMessageTriggerEvent = { + version: 'aVersion', + region: 'eu-south-1', + userPoolId: 'aUserPoolId', + triggerSource: 'CustomMessage_SignUp', + userName: 'aUserName', + callerContext: { + awsSdkVersion: 'anAwsSdkVersion', + clientId: 'aClientId', + }, + request: { + userAttributes: { + sub: 'user-identity', + }, + codeParameter: '####', + linkParameter: 'aLinkParameter', + usernameParameter: null, + }, + response: { + smsMessage: null, + emailMessage: null, + emailSubject: null, + }, +}; + +describe('Handler', () => { + it('should reply with verification link', async () => { + const env = { + domain: 'thedomain.org', + }; + const { response } = await makeHandler(env)(event); + const { userAttributes, codeParameter } = event.request; + const expected = emailTemplate( + `https://${env.domain}/auth/confirmation?username=${userAttributes['sub']}&code=${codeParameter}` + ); + expect(response.emailMessage).toStrictEqual(expected); + }); +}); diff --git a/apps/cognito-functions/src/custom-message-handler.ts b/apps/cognito-functions/src/custom-message-handler.ts new file mode 100644 index 0000000000..7783f684ca --- /dev/null +++ b/apps/cognito-functions/src/custom-message-handler.ts @@ -0,0 +1,34 @@ +import * as t from 'io-ts'; +import { CustomMessageTriggerEvent } from 'aws-lambda'; + +export const CustomMessageEnv = t.type({ + domain: t.string, +}); +export type CustomMessageEnv = t.TypeOf; + +export const emailTemplate = (href: string) => ` +Ciao, +
+Grazie per aver creato un account sul DevPortal! +Non ti resta che confermarci la validità di questa e-mail. +
+Verifica e-mail +
+Il bottone non funziona? Puoi usare il seguente link: ${href} +`; + +export const makeHandler = + (env: CustomMessageEnv) => async (event: CustomMessageTriggerEvent) => { + const username = event.request.userAttributes['sub']; + + if (event.triggerSource === 'CustomMessage_SignUp') { + const { codeParameter } = event.request; + const href = `https://${env.domain}/auth/confirmation?username=${username}&code=${codeParameter}`; + const emailMessage = emailTemplate(href); + const emailSubject = 'Verifica la tua e-mail per PagoPA DevPortal'; + const response = { ...event.response, emailMessage, emailSubject }; + return { ...event, response }; + } else { + return event; + } + }; diff --git a/apps/cognito-functions/src/main.ts b/apps/cognito-functions/src/main.ts new file mode 100644 index 0000000000..a676fd6ba0 --- /dev/null +++ b/apps/cognito-functions/src/main.ts @@ -0,0 +1,15 @@ +import { pipe } from 'fp-ts/lib/function'; +import * as E from 'fp-ts/lib/Either'; +import * as PR from 'io-ts/PathReporter'; +import * as customMessage from './custom-message-handler'; + +export const customMessageHandler = pipe( + { domain: process.env.DOMAIN }, + customMessage.CustomMessageEnv.decode, + E.fold((errors) => { + // eslint-disable-next-line functional/no-expression-statements + console.log(PR.failure(errors).join('\n')); + // eslint-disable-next-line functional/no-throw-statements + throw new Error(); + }, customMessage.makeHandler) +); diff --git a/apps/cognito-functions/src/send-email-handler.ts b/apps/cognito-functions/src/send-email-handler.ts new file mode 100644 index 0000000000..b7bc6b5b79 --- /dev/null +++ b/apps/cognito-functions/src/send-email-handler.ts @@ -0,0 +1,8 @@ +import { PostConfirmationConfirmSignUpTriggerEvent } from 'aws-lambda'; + +export const handler = async ( + event: PostConfirmationConfirmSignUpTriggerEvent +) => { + // eslint-disable-next-line functional/no-expression-statements + console.log('Event', JSON.stringify(event, null, 2)); +}; diff --git a/apps/cognito-functions/tsconfig.json b/apps/cognito-functions/tsconfig.json new file mode 100644 index 0000000000..4d038fb132 --- /dev/null +++ b/apps/cognito-functions/tsconfig.json @@ -0,0 +1,12 @@ +{ + "extends": "../../tsconfig.json", + "compilerOptions": { + "target": "es5", + "sourceMap": false, + "declaration": false, + "rootDir": "src", + "outDir": "dist" + }, + "include": ["src"], + "exclude": ["src/__tests__"] +} diff --git a/package-lock.json b/package-lock.json index 541c138ce4..12de7c3b96 100644 --- a/package-lock.json +++ b/package-lock.json @@ -29,6 +29,413 @@ "typescript": "^5.0.2" } }, + "apps/cognito-functions": { + "version": "0.0.0", + "dependencies": { + "fp-ts": "^2.16.1", + "io-ts": "^2.2.20" + }, + "devDependencies": { + "@types/aws-lambda": "^8.10.125", + "esbuild": "^0.19.5", + "eslint": "^8.40.0", + "eslint-config-custom": "*", + "jest": "^29.5.0", + "shx": "^0.3.4", + "ts-jest": "^29.1.0", + "ts-node": "^10.9.1", + "typescript": "^5.0.2" + } + }, + "apps/cognito-functions/node_modules/@esbuild/android-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.19.5.tgz", + "integrity": "sha512-bhvbzWFF3CwMs5tbjf3ObfGqbl/17ict2/uwOSfr3wmxDE6VdS2GqY/FuzIPe0q0bdhj65zQsvqfArI9MY6+AA==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/android-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm64/-/android-arm64-0.19.5.tgz", + "integrity": "sha512-5d1OkoJxnYQfmC+Zd8NBFjkhyCNYwM4n9ODrycTFY6Jk1IGiZ+tjVJDDSwDt77nK+tfpGP4T50iMtVi4dEGzhQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/android-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/android-x64/-/android-x64-0.19.5.tgz", + "integrity": "sha512-9t+28jHGL7uBdkBjL90QFxe7DVA+KGqWlHCF8ChTKyaKO//VLuoBricQCgwhOjA1/qOczsw843Fy4cbs4H3DVA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/darwin-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-arm64/-/darwin-arm64-0.19.5.tgz", + "integrity": "sha512-mvXGcKqqIqyKoxq26qEDPHJuBYUA5KizJncKOAf9eJQez+L9O+KfvNFu6nl7SCZ/gFb2QPaRqqmG0doSWlgkqw==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/darwin-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/darwin-x64/-/darwin-x64-0.19.5.tgz", + "integrity": "sha512-Ly8cn6fGLNet19s0X4unjcniX24I0RqjPv+kurpXabZYSXGM4Pwpmf85WHJN3lAgB8GSth7s5A0r856S+4DyiA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/freebsd-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-arm64/-/freebsd-arm64-0.19.5.tgz", + "integrity": "sha512-GGDNnPWTmWE+DMchq1W8Sd0mUkL+APvJg3b11klSGUDvRXh70JqLAO56tubmq1s2cgpVCSKYywEiKBfju8JztQ==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/freebsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/freebsd-x64/-/freebsd-x64-0.19.5.tgz", + "integrity": "sha512-1CCwDHnSSoA0HNwdfoNY0jLfJpd7ygaLAp5EHFos3VWJCRX9DMwWODf96s9TSse39Br7oOTLryRVmBoFwXbuuQ==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "freebsd" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-arm": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm/-/linux-arm-0.19.5.tgz", + "integrity": "sha512-lrWXLY/vJBzCPC51QN0HM71uWgIEpGSjSZZADQhq7DKhPcI6NH1IdzjfHkDQws2oNpJKpR13kv7/pFHBbDQDwQ==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-arm64/-/linux-arm64-0.19.5.tgz", + "integrity": "sha512-o3vYippBmSrjjQUCEEiTZ2l+4yC0pVJD/Dl57WfPwwlvFkrxoSO7rmBZFii6kQB3Wrn/6GwJUPLU5t52eq2meA==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ia32/-/linux-ia32-0.19.5.tgz", + "integrity": "sha512-MkjHXS03AXAkNp1KKkhSKPOCYztRtK+KXDNkBa6P78F8Bw0ynknCSClO/ztGszILZtyO/lVKpa7MolbBZ6oJtQ==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-loong64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.19.5.tgz", + "integrity": "sha512-42GwZMm5oYOD/JHqHska3Jg0r+XFb/fdZRX+WjADm3nLWLcIsN27YKtqxzQmGNJgu0AyXg4HtcSK9HuOk3v1Dw==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-mips64el": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-mips64el/-/linux-mips64el-0.19.5.tgz", + "integrity": "sha512-kcjndCSMitUuPJobWCnwQ9lLjiLZUR3QLQmlgaBfMX23UEa7ZOrtufnRds+6WZtIS9HdTXqND4yH8NLoVVIkcg==", + "cpu": [ + "mips64el" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-ppc64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-ppc64/-/linux-ppc64-0.19.5.tgz", + "integrity": "sha512-yJAxJfHVm0ZbsiljbtFFP1BQKLc8kUF6+17tjQ78QjqjAQDnhULWiTA6u0FCDmYT1oOKS9PzZ2z0aBI+Mcyj7Q==", + "cpu": [ + "ppc64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-riscv64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-riscv64/-/linux-riscv64-0.19.5.tgz", + "integrity": "sha512-5u8cIR/t3gaD6ad3wNt1MNRstAZO+aNyBxu2We8X31bA8XUNyamTVQwLDA1SLoPCUehNCymhBhK3Qim1433Zag==", + "cpu": [ + "riscv64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-s390x": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-s390x/-/linux-s390x-0.19.5.tgz", + "integrity": "sha512-Z6JrMyEw/EmZBD/OFEFpb+gao9xJ59ATsoTNlj39jVBbXqoZm4Xntu6wVmGPB/OATi1uk/DB+yeDPv2E8PqZGw==", + "cpu": [ + "s390x" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/linux-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/linux-x64/-/linux-x64-0.19.5.tgz", + "integrity": "sha512-psagl+2RlK1z8zWZOmVdImisMtrUxvwereIdyJTmtmHahJTKb64pAcqoPlx6CewPdvGvUKe2Jw+0Z/0qhSbG1A==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/netbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/netbsd-x64/-/netbsd-x64-0.19.5.tgz", + "integrity": "sha512-kL2l+xScnAy/E/3119OggX8SrWyBEcqAh8aOY1gr4gPvw76la2GlD4Ymf832UCVbmuWeTf2adkZDK+h0Z/fB4g==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "netbsd" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/openbsd-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/openbsd-x64/-/openbsd-x64-0.19.5.tgz", + "integrity": "sha512-sPOfhtzFufQfTBgRnE1DIJjzsXukKSvZxloZbkJDG383q0awVAq600pc1nfqBcl0ice/WN9p4qLc39WhBShRTA==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "openbsd" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/sunos-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/sunos-x64/-/sunos-x64-0.19.5.tgz", + "integrity": "sha512-dGZkBXaafuKLpDSjKcB0ax0FL36YXCvJNnztjKV+6CO82tTYVDSH2lifitJ29jxRMoUhgkg9a+VA/B03WK5lcg==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "sunos" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/win32-arm64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-arm64/-/win32-arm64-0.19.5.tgz", + "integrity": "sha512-dWVjD9y03ilhdRQ6Xig1NWNgfLtf2o/STKTS+eZuF90fI2BhbwD6WlaiCGKptlqXlURVB5AUOxUj09LuwKGDTg==", + "cpu": [ + "arm64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/win32-ia32": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-ia32/-/win32-ia32-0.19.5.tgz", + "integrity": "sha512-4liggWIA4oDgUxqpZwrDhmEfAH4d0iljanDOK7AnVU89T6CzHon/ony8C5LeOdfgx60x5cnQJFZwEydVlYx4iw==", + "cpu": [ + "ia32" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/@esbuild/win32-x64": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/@esbuild/win32-x64/-/win32-x64-0.19.5.tgz", + "integrity": "sha512-czTrygUsB/jlM8qEW5MD8bgYU2Xg14lo6kBDXW6HdxKjh8M5PzETGiSHaz9MtbXBYDloHNUAUW2tMiKW4KM9Mw==", + "cpu": [ + "x64" + ], + "dev": true, + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=12" + } + }, + "apps/cognito-functions/node_modules/esbuild": { + "version": "0.19.5", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.19.5.tgz", + "integrity": "sha512-bUxalY7b1g8vNhQKdB24QDmHeY4V4tw/s6Ak5z+jJX9laP5MoQseTOMemAr0gxssjNcH0MCViG8ONI2kksvfFQ==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.19.5", + "@esbuild/android-arm64": "0.19.5", + "@esbuild/android-x64": "0.19.5", + "@esbuild/darwin-arm64": "0.19.5", + "@esbuild/darwin-x64": "0.19.5", + "@esbuild/freebsd-arm64": "0.19.5", + "@esbuild/freebsd-x64": "0.19.5", + "@esbuild/linux-arm": "0.19.5", + "@esbuild/linux-arm64": "0.19.5", + "@esbuild/linux-ia32": "0.19.5", + "@esbuild/linux-loong64": "0.19.5", + "@esbuild/linux-mips64el": "0.19.5", + "@esbuild/linux-ppc64": "0.19.5", + "@esbuild/linux-riscv64": "0.19.5", + "@esbuild/linux-s390x": "0.19.5", + "@esbuild/linux-x64": "0.19.5", + "@esbuild/netbsd-x64": "0.19.5", + "@esbuild/openbsd-x64": "0.19.5", + "@esbuild/sunos-x64": "0.19.5", + "@esbuild/win32-arm64": "0.19.5", + "@esbuild/win32-ia32": "0.19.5", + "@esbuild/win32-x64": "0.19.5" + } + }, "apps/nextjs-website": { "version": "0.1.0", "dependencies": { @@ -14556,6 +14963,12 @@ "dev": true, "license": "MIT" }, + "node_modules/@types/aws-lambda": { + "version": "8.10.125", + "resolved": "https://registry.npmjs.org/@types/aws-lambda/-/aws-lambda-8.10.125.tgz", + "integrity": "sha512-Vqw/WMlV4O1fJT6capim01v7VLDZkcX1n6Yhb52E7IfnMqYbNfwHfyDV8rRN42NLBtdDvfaqcCqs2K0fr5ljZw==", + "dev": true + }, "node_modules/@types/babel__core": { "version": "7.20.0", "dev": true, @@ -17782,6 +18195,10 @@ "resolved": "https://registry.npmjs.org/codemirror/-/codemirror-5.65.15.tgz", "integrity": "sha512-YC4EHbbwQeubZzxLl5G4nlbLc1T21QTrKGaOal/Pkm9dVDMZXMH7+ieSPEOZCtO9I68i8/oteJKOxzHC2zR+0g==" }, + "node_modules/cognito-functions": { + "resolved": "apps/cognito-functions", + "link": true + }, "node_modules/collect-v8-coverage": { "version": "1.0.1", "dev": true, @@ -21455,8 +21872,9 @@ } }, "node_modules/fp-ts": { - "version": "2.13.1", - "license": "MIT" + "version": "2.16.1", + "resolved": "https://registry.npmjs.org/fp-ts/-/fp-ts-2.16.1.tgz", + "integrity": "sha512-by7U5W8dkIzcvDofUcO42yl9JbnHTEDBrzu3pt5fKT+Z4Oy85I21K80EYJYdjQGC2qum4Vo55Ag57iiIK4FYuA==" }, "node_modules/fractional-indexing": { "version": "3.2.0",