diff --git a/.github/workflows/database-tests.yml b/.github/workflows/database-tests.yml new file mode 100644 index 00000000..375e879b --- /dev/null +++ b/.github/workflows/database-tests.yml @@ -0,0 +1,44 @@ +name: 'ci +on: + pull_request: + +jobs: + build: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: supabase/setup-cli@v1 + with: + version: latest + - uses: actions/setup-node@v4 + with: + node-version: '20' + - run: | + OUTPUT=$(supabase start) + + NEXT_PUBLIC_SUPABASE_URL=$(echo "$OUTPUT" | awk -F': ' '/API URL/ {print $2}') + NEXT_PUBLIC_SUPABASE_ANON_KEY=$(echo "$OUTPUT" | awk -F': ' '/anon key/ {print $2}') + SUPABASE_SERVICE_ROLE_KEY=$(echo "$OUTPUT" | awk -F': ' '/service_role key/ {print $2}') + + echo "NEXT_PUBLIC_SUPABASE_URL=$NEXT_PUBLIC_SUPABASE_URL" >> ./frontend/.env + echo "NEXT_PUBLIC_SUPABASE_ANON_KEY=$NEXT_PUBLIC_SUPABASE_ANON_KEY" >> ./frontend/.env + echo "SUPABASE_SERVICE_ROLE_KEY=$SUPABASE_SERVICE_ROLE_KEY" >> ./frontend/.env + - run: supabase db lint + - run: supabase test db + - run: | + echo "NEXT_PUBLIC_LOGFLARE_CLIENT_TOKEN=123" >> ./frontend/.env + echo "NEXT_PUBLIC_LOGFLARE_API_TOKEN=123" >> ./frontend/.env + echo "NEXT_PUBLIC_TURNSTILE_SITE_KEY=1x00000000000000000000AA" >> ./frontend/.env + echo "TURNSTILE_SECRET_KEY=123" >> ./frontend/.env + - run: npm ci + working-directory: ./frontend + - run: npm run build + working-directory: ./frontend + - run: | + nohup npm start -- --port 3000 > next.log 2>&1 & + working-directory: ./frontend + - run: npx --yes wait-on http://localhost:3000 + - run: npm ci + working-directory: ./e2e + - run: npm run test:e2e + working-directory: ./e2e diff --git a/.gitignore b/.gitignore index 34857c23..a2b5f718 100644 --- a/.gitignore +++ b/.gitignore @@ -50,6 +50,5 @@ jspm_packages backend/apl_config_gend.yml backend/users_id.csv -supabase **.DS_Store diff --git a/backend/backend/load_fixtures.py b/backend/backend/load_fixtures.py new file mode 100644 index 00000000..7e08905c --- /dev/null +++ b/backend/backend/load_fixtures.py @@ -0,0 +1,70 @@ +import argparse +from datetime import datetime + +from backend.enums.question_type import QuestionType +from backend.logger import Logger +from loguru import logger +from backend.utils.consts import REGEX_JS, REGEX_TO_DESCRIPTION +from backend.utils.utils_datetime import convert_to_timezone +from backend.utils.utils_file import read_yaml_file +from backend.utils.utils_supabase import init_supabase +from backend.validate_config import ( + DEFAULT_PARAMS, + MANDATORY_PARAMS, + OPTIONAL_PARAMS, + QUESTION_TYPES_DB_TABLE, + run_structure_checks, +) + + + +def add_test_user(supabase): + users = [dict(mail="u@example.com", role=1), dict(mail="a@example.com", role=2)] + password = "123456" + + for user in users: + try: + res_user = supabase.auth.sign_up({"email": user["mail"], "password": password}) + user_id = res_user.user.id + supabase.table("application_table").insert({"userid": user_id}).execute() + supabase.table("user_profiles_table").insert( + {"userid": user_id, "userrole": user["role"], "isactive": True} + ).execute() + except Exception as e: + logger.error(f"Error creating user {user['mail']}: {e}") + + print("Done") + +def load_fixtures(config_file_path: str, env_file_path: str): + supabase = init_supabase(env_file_path) + + add_test_user(supabase) + + + +def parse_args() -> argparse.Namespace: + parser = argparse.ArgumentParser( + description="Script to setup the supabase database using the config file" + ) + parser.add_argument( + "--config", + help="Path to the yaml config file", + type=str, + default="backend/apl_config_gend_all_phases.yml", + dest="config_file_path", + required=False, + ) + parser.add_argument( + "--env_file", + help="Path to the .env file", + type=str, + default=None, + dest="env_file_path", + required=False, + ) + return parser.parse_args() + + +if __name__ == "__main__": + args = parse_args() + load_fixtures(**vars(args)) \ No newline at end of file diff --git a/backend/backend/sql/bucket_policies.sql b/backend/backend/sql/bucket_policies.sql index 4ed1b904..abd95365 100644 --- a/backend/backend/sql/bucket_policies.sql +++ b/backend/backend/sql/bucket_policies.sql @@ -4,10 +4,10 @@ CREATE POLICY "all_cmds" ON "storage"."objects" AS PERMISSIVE FOR ALL TO authenticated USING (((auth.uid() = owner))) -WITH CHECK (((auth.uid() = owner))) +WITH CHECK (((auth.uid() = owner))); CREATE POLICY "all_cmds" ON "storage"."buckets" AS PERMISSIVE FOR ALL TO authenticated USING (((auth.uid() = owner))) -WITH CHECK (((auth.uid() = owner))) \ No newline at end of file +WITH CHECK (((auth.uid() = owner))); \ No newline at end of file diff --git a/e2e/cypress.config.js b/e2e/cypress.config.js new file mode 100644 index 00000000..97f47c41 --- /dev/null +++ b/e2e/cypress.config.js @@ -0,0 +1,9 @@ +const { defineConfig } = require("cypress"); + +module.exports = defineConfig({ + e2e: { + setupNodeEvents(on, config) { + // implement node event listeners here + }, + }, +}); diff --git a/e2e/cypress/e2e/registration.cy.js b/e2e/cypress/e2e/registration.cy.js new file mode 100644 index 00000000..62746e0a --- /dev/null +++ b/e2e/cypress/e2e/registration.cy.js @@ -0,0 +1,19 @@ +describe('registration', () => { + it('passes', () => { + cy.visit('http://localhost:3000') + cy.url().should('contain', 'login') + + cy.contains('button', 'Registrieren').click() + + const password = 'Password1!' + + cy.get("#email").type("test@example.com") + cy.get("#password").type(password) + cy.get("#confirm-password").type(password) + cy.get('#confirm-legal').check() + + cy.get('.apl-button-expanded').click() + + cy.contains('Wir haben dir eine Email geschickt!') + }) +}) \ No newline at end of file diff --git a/e2e/cypress/fixtures/example.json b/e2e/cypress/fixtures/example.json new file mode 100644 index 00000000..02e42543 --- /dev/null +++ b/e2e/cypress/fixtures/example.json @@ -0,0 +1,5 @@ +{ + "name": "Using fixtures to represent data", + "email": "hello@cypress.io", + "body": "Fixtures are a great way to mock data for responses to routes" +} diff --git a/e2e/cypress/support/commands.js b/e2e/cypress/support/commands.js new file mode 100644 index 00000000..66ea16ef --- /dev/null +++ b/e2e/cypress/support/commands.js @@ -0,0 +1,25 @@ +// *********************************************** +// This example commands.js shows you how to +// create various custom commands and overwrite +// existing commands. +// +// For more comprehensive examples of custom +// commands please read more here: +// https://on.cypress.io/custom-commands +// *********************************************** +// +// +// -- This is a parent command -- +// Cypress.Commands.add('login', (email, password) => { ... }) +// +// +// -- This is a child command -- +// Cypress.Commands.add('drag', { prevSubject: 'element'}, (subject, options) => { ... }) +// +// +// -- This is a dual command -- +// Cypress.Commands.add('dismiss', { prevSubject: 'optional'}, (subject, options) => { ... }) +// +// +// -- This will overwrite an existing command -- +// Cypress.Commands.overwrite('visit', (originalFn, url, options) => { ... }) \ No newline at end of file diff --git a/e2e/cypress/support/e2e.js b/e2e/cypress/support/e2e.js new file mode 100644 index 00000000..3eaffffa --- /dev/null +++ b/e2e/cypress/support/e2e.js @@ -0,0 +1,17 @@ +// *********************************************************** +// This example support/e2e.js is processed and +// loaded automatically before your test files. +// +// This is a great place to put global configuration and +// behavior that modifies Cypress. +// +// You can change the location of this file or turn off +// automatically serving support files with the +// 'supportFile' configuration option. +// +// You can read more here: +// https://on.cypress.io/configuration +// *********************************************************** + +// Import commands.js using ES2015 syntax: +import './commands' \ No newline at end of file diff --git a/e2e/package-lock.json b/e2e/package-lock.json new file mode 100644 index 00000000..fad02192 --- /dev/null +++ b/e2e/package-lock.json @@ -0,0 +1,2192 @@ +{ + "name": "e2e", + "version": "1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "e2e", + "version": "1.0.0", + "license": "ISC", + "devDependencies": { + "cypress": "^14.3.3" + } + }, + "node_modules/@cypress/request": { + "version": "3.0.8", + "resolved": "https://registry.npmjs.org/@cypress/request/-/request-3.0.8.tgz", + "integrity": "sha512-h0NFgh1mJmm1nr4jCwkGHwKneVYKghUyWe6TMNrk0B9zsjAJxpg8C4/+BAcmLgCPa1vj1V8rNUaILl+zYRUWBQ==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~4.0.0", + "http-signature": "~1.4.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "performance-now": "^2.1.0", + "qs": "6.14.0", + "safe-buffer": "^5.1.2", + "tough-cookie": "^5.0.0", + "tunnel-agent": "^0.6.0", + "uuid": "^8.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@cypress/xvfb": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@cypress/xvfb/-/xvfb-1.2.4.tgz", + "integrity": "sha512-skbBzPggOVYCbnGgV+0dmBdW/s77ZkAOXIC1knS8NagwDjBrNC1LuXtQJeiN6l+m7lzmHtaoUw/ctJKdqkG57Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "debug": "^3.1.0", + "lodash.once": "^4.1.1" + } + }, + "node_modules/@cypress/xvfb/node_modules/debug": { + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.7.tgz", + "integrity": "sha512-CFjzYYAi4ThfiQvizrFQevTTXHtnCqWfe7x1AhgEscTz6ZbLbfoLRLPugTQyBth6f8ZERVUSyWHFD/7Wu4t1XQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.1" + } + }, + "node_modules/@types/node": { + "version": "22.15.17", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.15.17.tgz", + "integrity": "sha512-wIX2aSZL5FE+MR0JlvF87BNVrtFWf6AE6rxSE9X7OwnVvoyCQjpzSRJ+M87se/4QCkCiebQAqrJ0y6fwIyi7nw==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "undici-types": "~6.21.0" + } + }, + "node_modules/@types/sinonjs__fake-timers": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@types/sinonjs__fake-timers/-/sinonjs__fake-timers-8.1.1.tgz", + "integrity": "sha512-0kSuKjAS0TrGLJ0M/+8MaFkGsQhZpB6pxOmvS3K8FYI72K//YmdfoW9X2qPsAKh1mkwxGD5zib9s1FIFed6E8g==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/sizzle": { + "version": "2.3.9", + "resolved": "https://registry.npmjs.org/@types/sizzle/-/sizzle-2.3.9.tgz", + "integrity": "sha512-xzLEyKB50yqCUPUJkIsrVvoWNfFUbIZI+RspLWt8u+tIW/BetMBZtgV2LY/2o+tYH8dRvQ+eoPf3NdhQCcLE2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "dev": true, + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-colors": { + "version": "4.1.3", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", + "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/arch": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/arch/-/arch-2.2.0.tgz", + "integrity": "sha512-Of/R0wqp83cgHozfIYLbBMnej79U/SVGOOyuB3VVFv1NRM/PSFMK12x9KVtiYzJqmnU5WR2qp0Z5rHb7sWGnFQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/async": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", + "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", + "dev": true, + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true, + "license": "MIT" + }, + "node_modules/at-least-node": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/at-least-node/-/at-least-node-1.0.0.tgz", + "integrity": "sha512-+q/t7Ekv1EDY2l6Gda6LLiX14rU9TV20Wa3ofeQmwPFZbOMo9DXrLbOjFaaclkXKWidIaopwAObQDqwWtGUjqg==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">= 4.0.0" + } + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.2.tgz", + "integrity": "sha512-lHe62zvbTB5eEABUVi/AwVh0ZKY9rMMDhmm+eeyuuUQbQ3+J+fONVQOZyj+DdrvD4BY33uYniyRJ4UJIaSKAfw==", + "dev": true, + "license": "MIT" + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/blob-util": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/blob-util/-/blob-util-2.0.2.tgz", + "integrity": "sha512-T7JQa+zsXXEa6/8ZhHcQEW1UFfVM49Ts65uBkFL6fz2QmrElqmbajIDJvuA0tEhRe5eIjpV9ZF+0RfZR9voJFQ==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/cachedir": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/cachedir/-/cachedir-2.4.0.tgz", + "integrity": "sha512-9EtFOZR8g22CL7BWjJ9BUx1+A/djkofnyW3aOXZORNW2kxoUpx2h+uN2cOqwPmFhnpVmxg+KW2OjOSgChTEvsQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/call-bind-apply-helpers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/call-bind-apply-helpers/-/call-bind-apply-helpers-1.0.2.tgz", + "integrity": "sha512-Sp1ablJ0ivDkSzjcaJdxEunN5/XvksFJ2sMBFfq6x0ryhQV/2b/KwFe21cMpmHtPOSij8K99/wSfoEuTObmuMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/call-bound": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/call-bound/-/call-bound-1.0.4.tgz", + "integrity": "sha512-+ys997U96po4Kx/ABpBCqhA9EuxJaQWDQg7295H4hBphv3IZg0boBKuwYpt4YXp6MZ5AmZQnU/tyMTlRpaSejg==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "get-intrinsic": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "dev": true, + "license": "Apache-2.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/chalk/node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/check-more-types": { + "version": "2.24.0", + "resolved": "https://registry.npmjs.org/check-more-types/-/check-more-types-2.24.0.tgz", + "integrity": "sha512-Pj779qHxV2tuapviy1bSZNEL1maXr13bPYpsvSDB68HlYcYuhlDrmGd63i0JHMCLKzc7rUSNIrpdJlhVlNwrxA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/ci-info": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-4.2.0.tgz", + "integrity": "sha512-cYY9mypksY8NRqgDB1XD1RiJL338v/551niynFTGkZOO2LHuB2OmOYxDIe/ttN9AHwrqdum1360G3ald0W9kCg==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/sibiraj-s" + } + ], + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "license": "MIT", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-table3": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/cli-table3/-/cli-table3-0.6.1.tgz", + "integrity": "sha512-w0q/enDHhPLq44ovMGdQeeDLvwxwavsJX7oQGYt/LrBlYsyaxyDnp6z3QzFut/6kLLKnlcUVJLrpB7KBfgG/RA==", + "dev": true, + "license": "MIT", + "dependencies": { + "string-width": "^4.2.0" + }, + "engines": { + "node": "10.* || >= 12.*" + }, + "optionalDependencies": { + "colors": "1.4.0" + } + }, + "node_modules/cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "license": "MIT", + "dependencies": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true, + "license": "MIT" + }, + "node_modules/colorette": { + "version": "2.0.20", + "resolved": "https://registry.npmjs.org/colorette/-/colorette-2.0.20.tgz", + "integrity": "sha512-IfEDxwoWIjkeXL1eXcDiow4UbKjhLdq6/EuSVR9GMN7KVH3r9gQ83e73hsz1Nd1T3ijd5xv1wcWRYO+D6kCI2w==", + "dev": true, + "license": "MIT" + }, + "node_modules/colors": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", + "dev": true, + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.1.90" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commander": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.2.1.tgz", + "integrity": "sha512-U7VdrJFnJgo4xjrHpTzu0yrHPGImdsmD95ZlgYSEajAn2JKzDhDTPG9kBTefmObL2w/ngeZnilk+OV9CG3d7UA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 6" + } + }, + "node_modules/common-tags": { + "version": "1.8.2", + "resolved": "https://registry.npmjs.org/common-tags/-/common-tags-1.8.2.tgz", + "integrity": "sha512-gk/Z852D2Wtb//0I+kRFNKKE9dIIVirjoqPoA1wJU+XePVXZfGeBpk45+A1rKO4Q43prqWBNY/MiIeRLbPWUaA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "dev": true, + "license": "MIT" + }, + "node_modules/cross-spawn": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.6.tgz", + "integrity": "sha512-uV2QOWP2nWzsy2aMp8aRibhi9dlzF5Hgh5SHaB9OiTGEyDTiJJyx0uy51QXdyWbtAHNua4XJzUKca3OzKUd3vA==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/cypress": { + "version": "14.3.3", + "resolved": "https://registry.npmjs.org/cypress/-/cypress-14.3.3.tgz", + "integrity": "sha512-1Rz7zc9iqLww6BysaESqUhtIuaFHS7nL3wREovAKYsNhLTfX3TbcBWHWgEz70YimH2NkSOsm4oIcJJ9HYHOlew==", + "dev": true, + "hasInstallScript": true, + "license": "MIT", + "dependencies": { + "@cypress/request": "^3.0.8", + "@cypress/xvfb": "^1.2.4", + "@types/sinonjs__fake-timers": "8.1.1", + "@types/sizzle": "^2.3.2", + "arch": "^2.2.0", + "blob-util": "^2.0.2", + "bluebird": "^3.7.2", + "buffer": "^5.7.1", + "cachedir": "^2.3.0", + "chalk": "^4.1.0", + "check-more-types": "^2.24.0", + "ci-info": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-table3": "0.6.1", + "commander": "^6.2.1", + "common-tags": "^1.8.0", + "dayjs": "^1.10.4", + "debug": "^4.3.4", + "enquirer": "^2.3.6", + "eventemitter2": "6.4.7", + "execa": "4.1.0", + "executable": "^4.1.1", + "extract-zip": "2.0.1", + "figures": "^3.2.0", + "fs-extra": "^9.1.0", + "getos": "^3.2.1", + "is-installed-globally": "~0.4.0", + "lazy-ass": "^1.6.0", + "listr2": "^3.8.3", + "lodash": "^4.17.21", + "log-symbols": "^4.0.0", + "minimist": "^1.2.8", + "ospath": "^1.2.2", + "pretty-bytes": "^5.6.0", + "process": "^0.11.10", + "proxy-from-env": "1.0.0", + "request-progress": "^3.0.0", + "semver": "^7.7.1", + "supports-color": "^8.1.1", + "tmp": "~0.2.3", + "tree-kill": "1.2.2", + "untildify": "^4.0.0", + "yauzl": "^2.10.0" + }, + "bin": { + "cypress": "bin/cypress" + }, + "engines": { + "node": "^18.0.0 || ^20.0.0 || >=22.0.0" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/dayjs": { + "version": "1.11.13", + "resolved": "https://registry.npmjs.org/dayjs/-/dayjs-1.11.13.tgz", + "integrity": "sha512-oaMBel6gjolK862uaPQOVTA7q3TZhuSvuMQAAglQDOWYO9A91IrAOUJEyKVlqJlHE0vq5p5UXxzdPfMH/x6xNg==", + "dev": true, + "license": "MIT" + }, + "node_modules/debug": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.4.0.tgz", + "integrity": "sha512-6WTZ/IxCY/T6BALoZHaE4ctp9xm+Z5kY/pzYaCHRFeyVhojxlrm+46y68HA6hr0TcwEssoxNiDEUJQjfPZ/RYA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ms": "^2.1.3" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/dunder-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/dunder-proto/-/dunder-proto-1.0.1.tgz", + "integrity": "sha512-KIN/nDJBQRcXw0MLVhZE9iQHmG68qAVIBg9CqmUYjmQIhgij9U5MFvrqkUL5FbtyyzZuOeOt0zdeRe4UY7ct+A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.1", + "es-errors": "^1.3.0", + "gopd": "^1.2.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "dev": true, + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true, + "license": "MIT" + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/enquirer": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.4.1.tgz", + "integrity": "sha512-rRqJg/6gd538VHvR3PSrdRBb/1Vy2YfzHqzvbhGIQpDRKIa4FgV/54b5Q1xYSxOOwKvjXweS26E0Q+nAMwp2pQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-colors": "^4.1.1", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8.6" + } + }, + "node_modules/es-define-property": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.1.tgz", + "integrity": "sha512-e3nRfgfUZ4rNGL232gUgX06QNyyez04KdjFrF+LTRoOXmrOgFKDg4BCdsjW8EnT69eqdYGmRpJwiPVYNrCaW3g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-object-atoms": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/es-object-atoms/-/es-object-atoms-1.1.1.tgz", + "integrity": "sha512-FGgH2h8zKNim9ljj7dankFPcICIK9Cp5bm+c2gQSYePhpaG5+esrLODihIorn+Pe6FGJzWhXQotPv73jTaldXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-set-tostringtag": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/es-set-tostringtag/-/es-set-tostringtag-2.1.0.tgz", + "integrity": "sha512-j6vWzfrGVfyXxge+O0x5sh6cvxAog0a/4Rdd2K36zCMV5eJ+/+tOAngRO8cODMNWbVRdVlmGZQL2YS3yR8bIUA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.6", + "has-tostringtag": "^1.0.2", + "hasown": "^2.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/eventemitter2": { + "version": "6.4.7", + "resolved": "https://registry.npmjs.org/eventemitter2/-/eventemitter2-6.4.7.tgz", + "integrity": "sha512-tYUSVOGeQPKt/eC1ABfhHy5Xd96N3oIijJvN3O9+TsC28T5V9yX9oEfEK5faP0EFSNVOG97qtAS68GBrQB2hDg==", + "dev": true, + "license": "MIT" + }, + "node_modules/execa": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.1.0.tgz", + "integrity": "sha512-j5W0//W7f8UxAn8hXVnwG8tLwdiUy4FJLcSupCg6maBYZDpyBvTApK7KyuI4bKj8KOh1r2YH+6ucuYtJv1bTZA==", + "dev": true, + "license": "MIT", + "dependencies": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sindresorhus/execa?sponsor=1" + } + }, + "node_modules/executable": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/executable/-/executable-4.1.1.tgz", + "integrity": "sha512-8iA79xD3uAch729dUG8xaaBBFGaEa0wdD2VkYLFHwlqosEj/jT66AzcreRDSgV7ehnNLBW2WR5jIXwGKjVdTLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "pify": "^2.2.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "dev": true, + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "dev": true, + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "license": "MIT", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.2.tgz", + "integrity": "sha512-hGfm/slu0ZabnNt4oaRZ6uREyfCj6P4fT/n6A1rGV+Z0VdGXjfOhVUpkn6qVQONHGIFwmveGXyDs75+nr6FM8w==", + "dev": true, + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "es-set-tostringtag": "^2.1.0", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/fs-extra": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-9.1.0.tgz", + "integrity": "sha512-hcg3ZmepS30/7BSFqRvoo3DOMQu7IjqxO5nCDt+zM9XWjb33Wg7ziNT+Qvqbuc3+gWpzO02JubVyk2G4Zvo1OQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "at-least-node": "^1.0.0", + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-intrinsic": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.3.0.tgz", + "integrity": "sha512-9fSjSaos/fRIVIp+xSJlE6lfwhES7LNtKaCBIamHsjr2na1BiABJPo0mOjjz8GJDURarmCPGqaiVg5mfjb98CQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bind-apply-helpers": "^1.0.2", + "es-define-property": "^1.0.1", + "es-errors": "^1.3.0", + "es-object-atoms": "^1.1.1", + "function-bind": "^1.1.2", + "get-proto": "^1.0.1", + "gopd": "^1.2.0", + "has-symbols": "^1.1.0", + "hasown": "^2.0.2", + "math-intrinsics": "^1.1.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-proto": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/get-proto/-/get-proto-1.0.1.tgz", + "integrity": "sha512-sTSfBjoXBp89JvIKIefqw7U2CCebsc74kiY6awiGogKtoSGbgjYE/G/+l9sF3MWFPNc9IcoOC4ODfKHfxFmp0g==", + "dev": true, + "license": "MIT", + "dependencies": { + "dunder-proto": "^1.0.1", + "es-object-atoms": "^1.0.0" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/getos": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/getos/-/getos-3.2.1.tgz", + "integrity": "sha512-U56CfOK17OKgTVqozZjUKNdkfEv6jk5WISBJ8SHoagjE6L69zOwl3Z+O8myjY9MEW3i2HPWQBt/LTbCgcC973Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "async": "^3.2.0" + } + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/global-dirs": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-3.0.1.tgz", + "integrity": "sha512-NBcGGFbBA9s1VzD41QXDG+3++t9Mn5t1FpLdhESY6oKY4gYTFpX4wO3sqGUa0Srjtbfj3szX0RnemmrVRUdULA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ini": "2.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/gopd": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.2.0.tgz", + "integrity": "sha512-ZUKRh6/kUFoAiTAtTYPZJ3hw9wNxx+BIBOijnlG9PnrJsCcSjs1wyyD6vJpaYtgnzDrKYRSqf3OO6Rfa93xsRg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-symbols": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.1.0.tgz", + "integrity": "sha512-1cDNdwJ2Jaohmb3sg4OmKaMBwuC48sYni5HUw2DvsC8LjGTLK9h+eb1X6RyuOHe4hT0ULCW68iomhjUoKUqlPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-tostringtag": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", + "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-symbols": "^1.0.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/http-signature": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.4.0.tgz", + "integrity": "sha512-G5akfn7eKbpDN+8nPS/cb57YeA1jLTVxjpCj7tmm3QKPdyDy7T+qSC40e9ptydSWvkwjSXw1VbkpyEm39ukeAg==", + "dev": true, + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^2.0.2", + "sshpk": "^1.18.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true, + "license": "Apache-2.0", + "engines": { + "node": ">=8.12.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ini": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ini/-/ini-2.0.0.tgz", + "integrity": "sha512-7PnF4oN3CvZF23ADhA5wRaYEQpJ8qygSkbtTXWBeXWXmEVRXK+1ITciHWwHhsjv1TmW0MgacIv6hEi5pX5NQdA==", + "dev": true, + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-installed-globally": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.4.0.tgz", + "integrity": "sha512-iwGqO3J21aaSkC7jWnHP/difazwS7SFeIqxv6wEtLU8Y5KlzFTjyqcSIT0d8s4+dDhKytsk9PJZ2BkS5eZwQRQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "global-dirs": "^3.0.0", + "is-path-inside": "^3.0.2" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-path-inside": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-3.0.3.tgz", + "integrity": "sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "dev": true, + "license": "MIT" + }, + "node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "dev": true, + "license": "ISC" + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "dev": true, + "license": "MIT" + }, + "node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "dev": true, + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "dev": true, + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "dev": true, + "license": "ISC" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsprim": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-2.0.2.tgz", + "integrity": "sha512-gqXddjPqQ6G40VdnI6T6yObEC+pDNvyP95wdQhkWkg7crHH3km5qP1FsOXEkzEQwnz6gz5qGTn1c2Y52wP3OyQ==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + } + }, + "node_modules/lazy-ass": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/lazy-ass/-/lazy-ass-1.6.0.tgz", + "integrity": "sha512-cc8oEVoctTvsFZ/Oje/kGnHbpWHYBe8IAJe4C0QNc3t8uM/0Y8+erSz/7Y1ALuXTEZTMvxXwO6YbX1ey3ujiZw==", + "dev": true, + "license": "MIT", + "engines": { + "node": "> 0.8" + } + }, + "node_modules/listr2": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.14.0.tgz", + "integrity": "sha512-TyWI8G99GX9GjE54cJ+RrNMcIFBfwMPxc3XTFiAYGN4s10hWROGtOg7+O6u6LE3mNkyld7RSLE6nrKBvTfcs3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "cli-truncate": "^2.1.0", + "colorette": "^2.0.16", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rfdc": "^1.3.0", + "rxjs": "^7.5.1", + "through": "^2.3.8", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "enquirer": ">= 2.3.0 < 3" + }, + "peerDependenciesMeta": { + "enquirer": { + "optional": true + } + } + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "dev": true, + "license": "MIT" + }, + "node_modules/lodash.once": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.once/-/lodash.once-4.1.1.tgz", + "integrity": "sha512-Sb487aTOCr9drQVL8pIxOzVhafOjZN9UU54hiN8PU3uAiSV7lx1yYNpbNmex2PK6dSJoNTSJUUswT651yww3Mg==", + "dev": true, + "license": "MIT" + }, + "node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dev": true, + "license": "MIT", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/log-update/node_modules/slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/slice-ansi?sponsor=1" + } + }, + "node_modules/log-update/node_modules/wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/math-intrinsics": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/math-intrinsics/-/math-intrinsics-1.1.0.tgz", + "integrity": "sha512-/IXtbwEk5HTPyEwyKX6hGkYXxM9nbj64B+ilVJnC/R6B0pH5G4V3b0pVbL7DBj4tkhBAppbQUlf6F6Xl9LHu1g==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true, + "license": "MIT" + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "dev": true, + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "dev": true, + "license": "MIT" + }, + "node_modules/npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "license": "MIT", + "dependencies": { + "path-key": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/object-inspect": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.4.tgz", + "integrity": "sha512-W67iLl4J2EXEGTbfeHCffrjDfitvLANg0UlX3wFUUSTx92KXRFegMHUVgSqE+wvhAbi4WqjGg9czysTV2Epbew==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "dev": true, + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "license": "MIT", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ospath": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/ospath/-/ospath-1.2.2.tgz", + "integrity": "sha512-o6E5qJV5zkAbIDNhGSIlyOhScKXgQrSRMilfph0clDfM0nEnBOlKlH4sWDmG95BW/CvwNz0vmm7dJVtU2KlMiA==", + "dev": true, + "license": "MIT" + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "dev": true, + "license": "MIT" + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "dev": true, + "license": "MIT" + }, + "node_modules/pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha512-udgsAY+fTnvv7kI7aaxbqwWNb0AHiB0qBO89PZKPkoTmGOgdbrHDKD+0B2X4uTfJ/FT1R09r9gTsjUjNJotuog==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/pretty-bytes": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.6.0.tgz", + "integrity": "sha512-FFw039TmrBqFK8ma/7OL3sDz/VytdtJr044/QUJtH0wK9lb9jLq9tJyIxUwtQJHwar2BqtiA4iCWSwo9JLkzFg==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/proxy-from-env": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.0.0.tgz", + "integrity": "sha512-F2JHgJQ1iqwnHDcQjVBsq3n/uoaFL+iPW/eAeL7kVxy/2RrWaN4WroKjjvbsoRtv0ftelNyC01bjRhn/bhcf4A==", + "dev": true, + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.2.tgz", + "integrity": "sha512-tUPXtzlGM8FE3P0ZL6DVs/3P58k9nk8/jZeQCurTJylQA8qFYzHFfhBJkuqyE0FifOsQ0uKWekiZ5g8wtr28cw==", + "dev": true, + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/qs": { + "version": "6.14.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.14.0.tgz", + "integrity": "sha512-YWWTjgABSKcvs/nWBi9PycY/JiPJqOD4JA6o9Sej2AtvSGarXxKC3OQSk4pAarbdQlKAh5D4FCQkJNkW+GAn3w==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.1.0" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/request-progress": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/request-progress/-/request-progress-3.0.0.tgz", + "integrity": "sha512-MnWzEHHaxHO2iWiQuHrUPBi/1WeBf5PkxQqNyNvLl9VAYSdXkP8tQ3pBSeCPD+yw0v0Aq1zosWLz0BdeXpWwZg==", + "dev": true, + "license": "MIT", + "dependencies": { + "throttleit": "^1.0.0" + } + }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "license": "MIT", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "dev": true, + "license": "MIT" + }, + "node_modules/rxjs": { + "version": "7.8.2", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.8.2.tgz", + "integrity": "sha512-dhKf903U/PQZY6boNNtAGdWbG85WAbjT/1xYoZIC7FAY0yWapOBQVsVrDl58W86//e1VpMNBtRV4MaXfdMySFA==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "tslib": "^2.1.0" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "dev": true, + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "dev": true, + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.7.1", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.7.1.tgz", + "integrity": "sha512-hlq8tAfn0m/61p4BVRcPzIGr6LKiMwo4VM6dGi6pt4qcRkmNzTcWq6eCEjEh+qXjkMDvPlOFFSGwQjoEa6gyMA==", + "dev": true, + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "license": "MIT", + "dependencies": { + "shebang-regex": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/side-channel": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.1.0.tgz", + "integrity": "sha512-ZX99e6tRweoUXqR+VBrslhda51Nh5MTQwou5tnUDgbtyM0dBgmhEDtWGP/xbKn6hqfPRHujUNwz5fy/wbbhnpw==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3", + "side-channel-list": "^1.0.0", + "side-channel-map": "^1.0.1", + "side-channel-weakmap": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-list": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/side-channel-list/-/side-channel-list-1.0.0.tgz", + "integrity": "sha512-FCLHtRD/gnpCiCHEiJLOwdmFP+wzCmDEkc9y7NsYxeF4u7Btsn1ZuwgwJGxImImHicJArLP4R0yX4c2KCrMrTA==", + "dev": true, + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-map": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/side-channel-map/-/side-channel-map-1.0.1.tgz", + "integrity": "sha512-VCjCNfgMsby3tTdo02nbjtM/ewra6jPHmpThenkTYh8pG9ucZ/1P8So4u4FGBek/BjpOVsDCMoLA/iuBKIFXRA==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/side-channel-weakmap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/side-channel-weakmap/-/side-channel-weakmap-1.0.2.tgz", + "integrity": "sha512-WPS/HvHQTYnHisLo9McqBHOJk2FkHO/tlpvldyrnem4aeQp4hai3gythswg6p01oSoTl58rcpiFAjF2br2Ak2A==", + "dev": true, + "license": "MIT", + "dependencies": { + "call-bound": "^1.0.2", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.5", + "object-inspect": "^1.13.3", + "side-channel-map": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "dev": true, + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/supports-color": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", + "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/supports-color?sponsor=1" + } + }, + "node_modules/throttleit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/throttleit/-/throttleit-1.0.1.tgz", + "integrity": "sha512-vDZpf9Chs9mAdfY046mcPt8fg5QSZr37hEH4TXYBnDF+izxgrbRGUAAaBvIk/fJm9aOFCGFd1EsNg5AZCbnQCQ==", + "dev": true, + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "dev": true, + "license": "MIT" + }, + "node_modules/tldts": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts/-/tldts-6.1.86.tgz", + "integrity": "sha512-WMi/OQ2axVTf/ykqCQgXiIct+mSQDFdH2fkwhPwgEwvJ1kSzZRiinb0zF2Xb8u4+OqPChmyI6MEu4EezNJz+FQ==", + "dev": true, + "license": "MIT", + "dependencies": { + "tldts-core": "^6.1.86" + }, + "bin": { + "tldts": "bin/cli.js" + } + }, + "node_modules/tldts-core": { + "version": "6.1.86", + "resolved": "https://registry.npmjs.org/tldts-core/-/tldts-core-6.1.86.tgz", + "integrity": "sha512-Je6p7pkk+KMzMv2XXKmAE3McmolOQFdxkKw0R8EYNr7sELW46JqnNeTX8ybPiQgvg1ymCoF8LXs5fzFaZvJPTA==", + "dev": true, + "license": "MIT" + }, + "node_modules/tmp": { + "version": "0.2.3", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", + "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=14.14" + } + }, + "node_modules/tough-cookie": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-5.1.2.tgz", + "integrity": "sha512-FVDYdxtnj0G6Qm/DhNPSb8Ju59ULcup3tuJxkFb5K8Bv2pUXILbf0xZWU8PX8Ov19OXljbUyveOFwRMwkXzO+A==", + "dev": true, + "license": "BSD-3-Clause", + "dependencies": { + "tldts": "^6.1.32" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/tree-kill": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/tree-kill/-/tree-kill-1.2.2.tgz", + "integrity": "sha512-L0Orpi8qGpRG//Nd+H90vFB+3iHnue1zSSGmNOOCh1GLJ7rUKVwV2HvijphGQS2UmhUZewS9VgvxYIdgr+fG1A==", + "dev": true, + "license": "MIT", + "bin": { + "tree-kill": "cli.js" + } + }, + "node_modules/tslib": { + "version": "2.8.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.8.1.tgz", + "integrity": "sha512-oJFu94HQb+KVduSUQL7wnpmqnfmLsOA/nAh6b6EH0wCEoK0/mPeXU6c3wKDV83MkOuHPRHtSXKKU99IBazS/2w==", + "dev": true, + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "dev": true, + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "dev": true, + "license": "Unlicense" + }, + "node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "dev": true, + "license": "(MIT OR CC0-1.0)", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/undici-types": { + "version": "6.21.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz", + "integrity": "sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ==", + "dev": true, + "license": "MIT", + "optional": true + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/untildify": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", + "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", + "dev": true, + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "dev": true, + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "dev": true, + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "license": "ISC", + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "dev": true, + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "dev": true, + "license": "ISC" + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "dev": true, + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + } + } +} diff --git a/e2e/package.json b/e2e/package.json new file mode 100644 index 00000000..e775143b --- /dev/null +++ b/e2e/package.json @@ -0,0 +1,17 @@ +{ + "name": "e2e", + "version": "1.0.0", + "main": "index.js", + "scripts": { + "reset:db:local": "supabase db reset --workdir ../", + "pretest:e2e:local": "npm run reset:db:local", + "test:e2e:local": "npm run test:e2e", + "test:e2e": "cypress run" + }, + "author": "", + "license": "ISC", + "description": "", + "devDependencies": { + "cypress": "^14.3.3" + } +} diff --git a/shell.nix b/shell.nix new file mode 100644 index 00000000..17aced9a --- /dev/null +++ b/shell.nix @@ -0,0 +1,9 @@ +{ pkgs ? import {} }: + +pkgs.mkShell { + buildInputs = [ + pkgs.nodejs_20 + pkgs.supabase-cli + pkgs.poetry + ]; +} \ No newline at end of file diff --git a/supabase/.gitignore b/supabase/.gitignore new file mode 100644 index 00000000..ad9264f0 --- /dev/null +++ b/supabase/.gitignore @@ -0,0 +1,8 @@ +# Supabase +.branches +.temp + +# dotenvx +.env.keys +.env.local +.env.*.local diff --git a/supabase/config.toml b/supabase/config.toml new file mode 100644 index 00000000..6f5c1f39 --- /dev/null +++ b/supabase/config.toml @@ -0,0 +1,312 @@ +# For detailed configuration reference documentation, visit: +# https://supabase.com/docs/guides/local-development/cli/config +# A string used to distinguish different Supabase projects on the same host. Defaults to the +# working directory name when running `supabase init`. +project_id = "application-platform" + +[api] +enabled = true +# Port to use for the API URL. +port = 54321 +# Schemas to expose in your API. Tables, views and stored procedures in this schema will get API +# endpoints. `public` and `graphql_public` schemas are included by default. +schemas = ["public", "graphql_public"] +# Extra schemas to add to the search_path of every request. +extra_search_path = ["public", "extensions"] +# The maximum number of rows returns from a view, table, or stored procedure. Limits payload size +# for accidental or malicious requests. +max_rows = 1000 + +[api.tls] +# Enable HTTPS endpoints locally using a self-signed certificate. +enabled = false + +[db] +# Port to use for the local database URL. +port = 54322 +# Port used by db diff command to initialize the shadow database. +shadow_port = 54320 +# The database major version to use. This has to be the same as your remote database's. Run `SHOW +# server_version;` on the remote database to check. +major_version = 15 + +[db.pooler] +enabled = false +# Port to use for the local connection pooler. +port = 54329 +# Specifies when a server connection can be reused by other clients. +# Configure one of the supported pooler modes: `transaction`, `session`. +pool_mode = "transaction" +# How many server connections to allow per user/database pair. +default_pool_size = 20 +# Maximum number of client connections allowed. +max_client_conn = 100 + +# [db.vault] +# secret_key = "env(SECRET_VALUE)" + +[db.migrations] +# Specifies an ordered list of schema files that describe your database. +# Supports glob patterns relative to supabase directory: "./schemas/*.sql" +schema_paths = [ + "../backend/backend/sql/init_db.sql", + "../backend/backend/sql/functions.sql", + "../backend/backend/sql/add_cascade_delete.sql", + ] + +[db.seed] +# If enabled, seeds the database after migrations during a db reset. +enabled = true +# Specifies an ordered list of seed files to load during db reset. +# Supports glob patterns relative to supabase directory: "./seeds/*.sql" +sql_paths = ["./seed.sql"] + +[realtime] +enabled = true +# Bind realtime via either IPv4 or IPv6. (default: IPv4) +# ip_version = "IPv6" +# The maximum length in bytes of HTTP request headers. (default: 4096) +# max_header_length = 4096 + +[studio] +enabled = true +# Port to use for Supabase Studio. +port = 54323 +# External URL of the API server that frontend connects to. +api_url = "http://127.0.0.1" +# OpenAI API Key to use for Supabase AI in the Supabase Studio. +openai_api_key = "env(OPENAI_API_KEY)" + +# Email testing server. Emails sent with the local dev setup are not actually sent - rather, they +# are monitored, and you can view the emails that would have been sent from the web interface. +[inbucket] +enabled = true +# Port to use for the email testing server web interface. +port = 54324 +# Uncomment to expose additional ports for testing user applications that send emails. +# smtp_port = 54325 +# pop3_port = 54326 +# admin_email = "admin@email.com" +# sender_name = "Admin" + +[storage] +enabled = true +# The maximum file size allowed (e.g. "5MB", "500KB"). +file_size_limit = "50MiB" + +# Image transformation API is available to Supabase Pro plan. +# [storage.image_transformation] +# enabled = true + +# Uncomment to configure local storage buckets +# [storage.buckets.images] +# public = false +# file_size_limit = "50MiB" +# allowed_mime_types = ["image/png", "image/jpeg"] +# objects_path = "./images" + +[auth] +enabled = true +# The base URL of your website. Used as an allow-list for redirects and for constructing URLs used +# in emails. +site_url = "http://127.0.0.1:3000" +# A list of *exact* URLs that auth providers are permitted to redirect to post authentication. +additional_redirect_urls = ["https://127.0.0.1:3000"] +# How long tokens are valid for, in seconds. Defaults to 3600 (1 hour), maximum 604,800 (1 week). +jwt_expiry = 3600 +# If disabled, the refresh token will never expire. +enable_refresh_token_rotation = true +# Allows refresh tokens to be reused after expiry, up to the specified interval in seconds. +# Requires enable_refresh_token_rotation = true. +refresh_token_reuse_interval = 10 +# Allow/disallow new user signups to your project. +enable_signup = true +# Allow/disallow anonymous sign-ins to your project. +enable_anonymous_sign_ins = false +# Allow/disallow testing manual linking of accounts +enable_manual_linking = false +# Passwords shorter than this value will be rejected as weak. Minimum 6, recommended 8 or more. +minimum_password_length = 6 +# Passwords that do not meet the following requirements will be rejected as weak. Supported values +# are: `letters_digits`, `lower_upper_letters_digits`, `lower_upper_letters_digits_symbols` +password_requirements = "" + +[auth.rate_limit] +# Number of emails that can be sent per hour. Requires auth.email.smtp to be enabled. +email_sent = 2 +# Number of SMS messages that can be sent per hour. Requires auth.sms to be enabled. +sms_sent = 30 +# Number of anonymous sign-ins that can be made per hour per IP address. Requires enable_anonymous_sign_ins = true. +anonymous_users = 30 +# Number of sessions that can be refreshed in a 5 minute interval per IP address. +token_refresh = 150 +# Number of sign up and sign-in requests that can be made in a 5 minute interval per IP address (excludes anonymous users). +sign_in_sign_ups = 30 +# Number of OTP / Magic link verifications that can be made in a 5 minute interval per IP address. +token_verifications = 30 + +# Configure one of the supported captcha providers: `hcaptcha`, `turnstile`. +# [auth.captcha] +# enabled = true +# provider = "hcaptcha" +# secret = "" + +[auth.email] +# Allow/disallow new user signups via email to your project. +enable_signup = true +# If enabled, a user will be required to confirm any email change on both the old, and new email +# addresses. If disabled, only the new email is required to confirm. +double_confirm_changes = true +# If enabled, users need to confirm their email address before signing in. +enable_confirmations = false +# If enabled, users will need to reauthenticate or have logged in recently to change their password. +secure_password_change = false +# Controls the minimum amount of time that must pass before sending another signup confirmation or password reset email. +max_frequency = "1s" +# Number of characters used in the email OTP. +otp_length = 6 +# Number of seconds before the email OTP expires (defaults to 1 hour). +otp_expiry = 3600 + +# Use a production-ready SMTP server +# [auth.email.smtp] +# enabled = true +# host = "smtp.sendgrid.net" +# port = 587 +# user = "apikey" +# pass = "env(SENDGRID_API_KEY)" +# admin_email = "admin@email.com" +# sender_name = "Admin" + +# Uncomment to customize email template +# [auth.email.template.invite] +# subject = "You have been invited" +# content_path = "./supabase/templates/invite.html" + +[auth.sms] +# Allow/disallow new user signups via SMS to your project. +enable_signup = false +# If enabled, users need to confirm their phone number before signing in. +enable_confirmations = false +# Template for sending OTP to users +template = "Your code is {{ .Code }}" +# Controls the minimum amount of time that must pass before sending another sms otp. +max_frequency = "5s" + +# Use pre-defined map of phone number to OTP for testing. +# [auth.sms.test_otp] +# 4152127777 = "123456" + +# Configure logged in session timeouts. +# [auth.sessions] +# Force log out after the specified duration. +# timebox = "24h" +# Force log out if the user has been inactive longer than the specified duration. +# inactivity_timeout = "8h" + +# This hook runs before a token is issued and allows you to add additional claims based on the authentication method used. +# [auth.hook.custom_access_token] +# enabled = true +# uri = "pg-functions:////" + +# Configure one of the supported SMS providers: `twilio`, `twilio_verify`, `messagebird`, `textlocal`, `vonage`. +[auth.sms.twilio] +enabled = false +account_sid = "" +message_service_sid = "" +# DO NOT commit your Twilio auth token to git. Use environment variable substitution instead: +auth_token = "env(SUPABASE_AUTH_SMS_TWILIO_AUTH_TOKEN)" + +# Multi-factor-authentication is available to Supabase Pro plan. +[auth.mfa] +# Control how many MFA factors can be enrolled at once per user. +max_enrolled_factors = 10 + +# Control MFA via App Authenticator (TOTP) +[auth.mfa.totp] +enroll_enabled = false +verify_enabled = false + +# Configure MFA via Phone Messaging +[auth.mfa.phone] +enroll_enabled = false +verify_enabled = false +otp_length = 6 +template = "Your code is {{ .Code }}" +max_frequency = "5s" + +# Configure MFA via WebAuthn +# [auth.mfa.web_authn] +# enroll_enabled = true +# verify_enabled = true + +# Use an external OAuth provider. The full list of providers are: `apple`, `azure`, `bitbucket`, +# `discord`, `facebook`, `github`, `gitlab`, `google`, `keycloak`, `linkedin_oidc`, `notion`, `twitch`, +# `twitter`, `slack`, `spotify`, `workos`, `zoom`. +[auth.external.apple] +enabled = false +client_id = "" +# DO NOT commit your OAuth provider secret to git. Use environment variable substitution instead: +secret = "env(SUPABASE_AUTH_EXTERNAL_APPLE_SECRET)" +# Overrides the default auth redirectUrl. +redirect_uri = "" +# Overrides the default auth provider URL. Used to support self-hosted gitlab, single-tenant Azure, +# or any other third-party OIDC providers. +url = "" +# If enabled, the nonce check will be skipped. Required for local sign in with Google auth. +skip_nonce_check = false + +# Use Firebase Auth as a third-party provider alongside Supabase Auth. +[auth.third_party.firebase] +enabled = false +# project_id = "my-firebase-project" + +# Use Auth0 as a third-party provider alongside Supabase Auth. +[auth.third_party.auth0] +enabled = false +# tenant = "my-auth0-tenant" +# tenant_region = "us" + +# Use AWS Cognito (Amplify) as a third-party provider alongside Supabase Auth. +[auth.third_party.aws_cognito] +enabled = false +# user_pool_id = "my-user-pool-id" +# user_pool_region = "us-east-1" + +# Use Clerk as a third-party provider alongside Supabase Auth. +[auth.third_party.clerk] +enabled = false +# Obtain from https://clerk.com/setup/supabase +# domain = "example.clerk.accounts.dev" + +[edge_runtime] +enabled = true +# Configure one of the supported request policies: `oneshot`, `per_worker`. +# Use `oneshot` for hot reload, or `per_worker` for load testing. +policy = "oneshot" +# Port to attach the Chrome inspector for debugging edge functions. +inspector_port = 8083 +# The Deno major version to use. +deno_version = 1 + +# [edge_runtime.secrets] +# secret_key = "env(SECRET_VALUE)" + +[analytics] +enabled = true +port = 54327 +# Configure one of the supported backends: `postgres`, `bigquery`. +backend = "postgres" + +# Experimental features may be deprecated any time +[experimental] +# Configures Postgres storage engine to use OrioleDB (S3) +orioledb_version = "" +# Configures S3 bucket URL, eg. .s3-.amazonaws.com +s3_host = "env(S3_HOST)" +# Configures S3 bucket region, eg. us-east-1 +s3_region = "env(S3_REGION)" +# Configures AWS_ACCESS_KEY_ID for S3 bucket +s3_access_key = "env(S3_ACCESS_KEY)" +# Configures AWS_SECRET_ACCESS_KEY for S3 bucket +s3_secret_key = "env(S3_SECRET_KEY)" diff --git a/supabase/migrations/20250501134254_init.sql b/supabase/migrations/20250501134254_init.sql new file mode 100644 index 00000000..1fe765a5 --- /dev/null +++ b/supabase/migrations/20250501134254_init.sql @@ -0,0 +1,3749 @@ +create sequence "public"."user_roles_table_userroleid_seq"; + +create table "public"."answer_table" ( + "answerid" uuid not null default uuid_generate_v4(), + "questionid" uuid not null, + "applicationid" uuid not null, + "created" timestamp with time zone not null, + "lastupdated" timestamp with time zone not null +); + + +alter table "public"."answer_table" enable row level security; + +create table "public"."application_table" ( + "applicationid" uuid not null default uuid_generate_v4(), + "userid" uuid not null +); + + +alter table "public"."application_table" enable row level security; + +create table "public"."checkbox_answer_table" ( + "answerid" uuid not null, + "checked" boolean not null +); + + +alter table "public"."checkbox_answer_table" enable row level security; + +create table "public"."checkbox_question_table" ( + "questionid" uuid not null default uuid_generate_v4() +); + + +alter table "public"."checkbox_question_table" enable row level security; + +create table "public"."conditional_answer_table" ( + "answerid" uuid not null, + "selectedchoice" text not null +); + + +alter table "public"."conditional_answer_table" enable row level security; + +create table "public"."conditional_question_choice_table" ( + "choiceid" uuid not null default uuid_generate_v4(), + "questionid" uuid not null, + "choicevalue" text not null +); + + +alter table "public"."conditional_question_choice_table" enable row level security; + +create table "public"."conditional_question_table" ( + "questionid" uuid not null default uuid_generate_v4() +); + + +alter table "public"."conditional_question_table" enable row level security; + +create table "public"."date_picker_answer_table" ( + "answerid" uuid not null, + "pickeddate" date not null +); + + +alter table "public"."date_picker_answer_table" enable row level security; + +create table "public"."date_picker_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "mindate" date not null, + "maxdate" date not null +); + + +alter table "public"."date_picker_question_table" enable row level security; + +create table "public"."datetime_picker_answer_table" ( + "answerid" uuid not null, + "pickeddatetime" timestamp with time zone not null +); + + +alter table "public"."datetime_picker_answer_table" enable row level security; + +create table "public"."datetime_picker_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "mindatetime" timestamp with time zone not null, + "maxdatetime" timestamp with time zone not null +); + + +alter table "public"."datetime_picker_question_table" enable row level security; + +create table "public"."dropdown_answer_table" ( + "answerid" uuid not null, + "selectedoptions" text not null +); + + +alter table "public"."dropdown_answer_table" enable row level security; + +create table "public"."dropdown_question_option_table" ( + "optionid" uuid not null default uuid_generate_v4(), + "questionid" uuid not null, + "optiontext" text not null +); + + +alter table "public"."dropdown_question_option_table" enable row level security; + +create table "public"."dropdown_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "minanswers" integer not null, + "maxanswers" integer not null, + "userinput" boolean not null +); + + +alter table "public"."dropdown_question_table" enable row level security; + +create table "public"."image_upload_answer_table" ( + "answerid" uuid not null, + "imagename" text not null +); + + +alter table "public"."image_upload_answer_table" enable row level security; + +create table "public"."image_upload_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "maxfilesizeinmb" numeric not null +); + + +alter table "public"."image_upload_question_table" enable row level security; + +create table "public"."long_text_answer_table" ( + "answerid" uuid not null, + "answertext" text not null +); + + +alter table "public"."long_text_answer_table" enable row level security; + +create table "public"."long_text_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "maxtextlength" integer not null +); + + +alter table "public"."long_text_question_table" enable row level security; + +create table "public"."multiple_choice_answer_table" ( + "answerid" uuid not null, + "selectedchoice" text not null +); + + +alter table "public"."multiple_choice_answer_table" enable row level security; + +create table "public"."multiple_choice_question_choice_table" ( + "choiceid" uuid not null default uuid_generate_v4(), + "questionid" uuid not null, + "choicetext" text not null +); + + +alter table "public"."multiple_choice_question_choice_table" enable row level security; + +create table "public"."multiple_choice_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "minanswers" integer not null, + "maxanswers" integer not null, + "userinput" boolean not null +); + + +alter table "public"."multiple_choice_question_table" enable row level security; + +create table "public"."number_picker_answer_table" ( + "answerid" uuid not null, + "pickednumber" integer not null +); + + +alter table "public"."number_picker_answer_table" enable row level security; + +create table "public"."number_picker_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "minnumber" integer not null, + "maxnumber" integer not null +); + + +alter table "public"."number_picker_question_table" enable row level security; + +create table "public"."pdf_upload_answer_table" ( + "answerid" uuid not null, + "pdfname" text not null +); + + +alter table "public"."pdf_upload_answer_table" enable row level security; + +create table "public"."pdf_upload_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "maxfilesizeinmb" numeric not null +); + + +alter table "public"."pdf_upload_question_table" enable row level security; + +create table "public"."phase_assignment_table" ( + "assignment_id" uuid not null default uuid_generate_v4(), + "phase_id" uuid not null, + "user_role_1_id" uuid not null, + "user_role_2_id" uuid not null +); + + +alter table "public"."phase_assignment_table" enable row level security; + +create table "public"."phase_outcome_table" ( + "outcome_id" uuid not null default uuid_generate_v4(), + "phase_id" uuid not null, + "user_id" uuid not null, + "outcome" boolean not null, + "reviewed_by" uuid not null, + "review_date" timestamp with time zone not null default now() +); + + +alter table "public"."phase_outcome_table" enable row level security; + +create table "public"."phase_table" ( + "phaseid" uuid not null default uuid_generate_v4(), + "phasename" text not null, + "phaselabel" text not null, + "phaseorder" integer not null, + "startdate" timestamp with time zone not null, + "enddate" timestamp with time zone not null, + "sectionsenabled" boolean not null, + "finished_evaluation" timestamp with time zone +); + + +alter table "public"."phase_table" enable row level security; + +create table "public"."question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "questiontype" text not null, + "questionorder" integer not null, + "phaseid" uuid not null, + "mandatory" boolean not null, + "questiontext" text not null, + "questionnote" text, + "preinformationbox" text, + "postinformationbox" text, + "depends_on" uuid, + "sectionid" uuid +); + + +alter table "public"."question_table" enable row level security; + +create table "public"."sections_table" ( + "sectionid" uuid not null default uuid_generate_v4(), + "sectionname" text not null, + "sectiondescription" text not null, + "sectionorder" integer not null, + "phaseid" uuid not null +); + + +alter table "public"."sections_table" enable row level security; + +create table "public"."short_text_answer_table" ( + "answerid" uuid not null, + "answertext" text not null +); + + +alter table "public"."short_text_answer_table" enable row level security; + +create table "public"."short_text_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "maxtextlength" integer not null, + "formattingregex" text, + "formattingdescription" text +); + + +alter table "public"."short_text_question_table" enable row level security; + +create table "public"."user_profiles_table" ( + "userid" uuid not null, + "userrole" integer not null, + "isactive" boolean default true +); + + +alter table "public"."user_profiles_table" enable row level security; + +create table "public"."user_roles_table" ( + "userroleid" integer not null default nextval('user_roles_table_userroleid_seq'::regclass), + "userrolename" character varying(50) not null +); + + +alter table "public"."user_roles_table" enable row level security; + +create table "public"."video_upload_answer_table" ( + "answerid" uuid not null, + "videoname" text not null +); + + +alter table "public"."video_upload_answer_table" enable row level security; + +create table "public"."video_upload_question_table" ( + "questionid" uuid not null default uuid_generate_v4(), + "maxfilesizeinmb" numeric not null +); + + +alter table "public"."video_upload_question_table" enable row level security; + +alter sequence "public"."user_roles_table_userroleid_seq" owned by "public"."user_roles_table"."userroleid"; + +CREATE UNIQUE INDEX answer_table_pkey ON public.answer_table USING btree (answerid); + +CREATE UNIQUE INDEX application_table_pkey ON public.application_table USING btree (applicationid); + +CREATE UNIQUE INDEX checkbox_answer_table_pkey ON public.checkbox_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX checkbox_question_table_pkey ON public.checkbox_question_table USING btree (questionid); + +CREATE UNIQUE INDEX conditional_answer_table_pkey ON public.conditional_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX conditional_question_choice_table_pkey ON public.conditional_question_choice_table USING btree (choiceid); + +CREATE UNIQUE INDEX conditional_question_table_pkey ON public.conditional_question_table USING btree (questionid); + +CREATE UNIQUE INDEX date_picker_answer_table_pkey ON public.date_picker_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX date_picker_question_table_pkey ON public.date_picker_question_table USING btree (questionid); + +CREATE UNIQUE INDEX datetime_picker_answer_table_pkey ON public.datetime_picker_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX datetime_picker_question_table_pkey ON public.datetime_picker_question_table USING btree (questionid); + +CREATE UNIQUE INDEX dropdown_answer_table_pkey ON public.dropdown_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX dropdown_question_option_table_pkey ON public.dropdown_question_option_table USING btree (optionid); + +CREATE UNIQUE INDEX dropdown_question_table_pkey ON public.dropdown_question_table USING btree (questionid); + +CREATE UNIQUE INDEX image_upload_answer_table_pkey ON public.image_upload_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX image_upload_question_table_pkey ON public.image_upload_question_table USING btree (questionid); + +CREATE UNIQUE INDEX long_text_answer_table_pkey ON public.long_text_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX long_text_question_table_pkey ON public.long_text_question_table USING btree (questionid); + +CREATE UNIQUE INDEX multiple_choice_answer_table_pkey ON public.multiple_choice_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX multiple_choice_question_choice_table_pkey ON public.multiple_choice_question_choice_table USING btree (choiceid); + +CREATE UNIQUE INDEX multiple_choice_question_table_pkey ON public.multiple_choice_question_table USING btree (questionid); + +CREATE UNIQUE INDEX number_picker_answer_table_pkey ON public.number_picker_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX number_picker_question_table_pkey ON public.number_picker_question_table USING btree (questionid); + +CREATE UNIQUE INDEX pdf_upload_answer_table_pkey ON public.pdf_upload_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX pdf_upload_question_table_pkey ON public.pdf_upload_question_table USING btree (questionid); + +CREATE UNIQUE INDEX phase_assignment_table_pkey ON public.phase_assignment_table USING btree (assignment_id); + +CREATE UNIQUE INDEX phase_outcome_table_pkey ON public.phase_outcome_table USING btree (outcome_id); + +CREATE UNIQUE INDEX phase_table_pkey ON public.phase_table USING btree (phaseid); + +CREATE UNIQUE INDEX question_table_pkey ON public.question_table USING btree (questionid); + +CREATE UNIQUE INDEX sections_table_pkey ON public.sections_table USING btree (sectionid); + +CREATE UNIQUE INDEX short_text_answer_table_pkey ON public.short_text_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX short_text_question_table_pkey ON public.short_text_question_table USING btree (questionid); + +CREATE UNIQUE INDEX user_profiles_table_pkey ON public.user_profiles_table USING btree (userid); + +CREATE UNIQUE INDEX user_roles_table_pkey ON public.user_roles_table USING btree (userroleid); + +CREATE UNIQUE INDEX user_roles_table_userrolename_key ON public.user_roles_table USING btree (userrolename); + +CREATE UNIQUE INDEX video_upload_answer_table_pkey ON public.video_upload_answer_table USING btree (answerid); + +CREATE UNIQUE INDEX video_upload_question_table_pkey ON public.video_upload_question_table USING btree (questionid); + +alter table "public"."answer_table" add constraint "answer_table_pkey" PRIMARY KEY using index "answer_table_pkey"; + +alter table "public"."application_table" add constraint "application_table_pkey" PRIMARY KEY using index "application_table_pkey"; + +alter table "public"."checkbox_answer_table" add constraint "checkbox_answer_table_pkey" PRIMARY KEY using index "checkbox_answer_table_pkey"; + +alter table "public"."checkbox_question_table" add constraint "checkbox_question_table_pkey" PRIMARY KEY using index "checkbox_question_table_pkey"; + +alter table "public"."conditional_answer_table" add constraint "conditional_answer_table_pkey" PRIMARY KEY using index "conditional_answer_table_pkey"; + +alter table "public"."conditional_question_choice_table" add constraint "conditional_question_choice_table_pkey" PRIMARY KEY using index "conditional_question_choice_table_pkey"; + +alter table "public"."conditional_question_table" add constraint "conditional_question_table_pkey" PRIMARY KEY using index "conditional_question_table_pkey"; + +alter table "public"."date_picker_answer_table" add constraint "date_picker_answer_table_pkey" PRIMARY KEY using index "date_picker_answer_table_pkey"; + +alter table "public"."date_picker_question_table" add constraint "date_picker_question_table_pkey" PRIMARY KEY using index "date_picker_question_table_pkey"; + +alter table "public"."datetime_picker_answer_table" add constraint "datetime_picker_answer_table_pkey" PRIMARY KEY using index "datetime_picker_answer_table_pkey"; + +alter table "public"."datetime_picker_question_table" add constraint "datetime_picker_question_table_pkey" PRIMARY KEY using index "datetime_picker_question_table_pkey"; + +alter table "public"."dropdown_answer_table" add constraint "dropdown_answer_table_pkey" PRIMARY KEY using index "dropdown_answer_table_pkey"; + +alter table "public"."dropdown_question_option_table" add constraint "dropdown_question_option_table_pkey" PRIMARY KEY using index "dropdown_question_option_table_pkey"; + +alter table "public"."dropdown_question_table" add constraint "dropdown_question_table_pkey" PRIMARY KEY using index "dropdown_question_table_pkey"; + +alter table "public"."image_upload_answer_table" add constraint "image_upload_answer_table_pkey" PRIMARY KEY using index "image_upload_answer_table_pkey"; + +alter table "public"."image_upload_question_table" add constraint "image_upload_question_table_pkey" PRIMARY KEY using index "image_upload_question_table_pkey"; + +alter table "public"."long_text_answer_table" add constraint "long_text_answer_table_pkey" PRIMARY KEY using index "long_text_answer_table_pkey"; + +alter table "public"."long_text_question_table" add constraint "long_text_question_table_pkey" PRIMARY KEY using index "long_text_question_table_pkey"; + +alter table "public"."multiple_choice_answer_table" add constraint "multiple_choice_answer_table_pkey" PRIMARY KEY using index "multiple_choice_answer_table_pkey"; + +alter table "public"."multiple_choice_question_choice_table" add constraint "multiple_choice_question_choice_table_pkey" PRIMARY KEY using index "multiple_choice_question_choice_table_pkey"; + +alter table "public"."multiple_choice_question_table" add constraint "multiple_choice_question_table_pkey" PRIMARY KEY using index "multiple_choice_question_table_pkey"; + +alter table "public"."number_picker_answer_table" add constraint "number_picker_answer_table_pkey" PRIMARY KEY using index "number_picker_answer_table_pkey"; + +alter table "public"."number_picker_question_table" add constraint "number_picker_question_table_pkey" PRIMARY KEY using index "number_picker_question_table_pkey"; + +alter table "public"."pdf_upload_answer_table" add constraint "pdf_upload_answer_table_pkey" PRIMARY KEY using index "pdf_upload_answer_table_pkey"; + +alter table "public"."pdf_upload_question_table" add constraint "pdf_upload_question_table_pkey" PRIMARY KEY using index "pdf_upload_question_table_pkey"; + +alter table "public"."phase_assignment_table" add constraint "phase_assignment_table_pkey" PRIMARY KEY using index "phase_assignment_table_pkey"; + +alter table "public"."phase_outcome_table" add constraint "phase_outcome_table_pkey" PRIMARY KEY using index "phase_outcome_table_pkey"; + +alter table "public"."phase_table" add constraint "phase_table_pkey" PRIMARY KEY using index "phase_table_pkey"; + +alter table "public"."question_table" add constraint "question_table_pkey" PRIMARY KEY using index "question_table_pkey"; + +alter table "public"."sections_table" add constraint "sections_table_pkey" PRIMARY KEY using index "sections_table_pkey"; + +alter table "public"."short_text_answer_table" add constraint "short_text_answer_table_pkey" PRIMARY KEY using index "short_text_answer_table_pkey"; + +alter table "public"."short_text_question_table" add constraint "short_text_question_table_pkey" PRIMARY KEY using index "short_text_question_table_pkey"; + +alter table "public"."user_profiles_table" add constraint "user_profiles_table_pkey" PRIMARY KEY using index "user_profiles_table_pkey"; + +alter table "public"."user_roles_table" add constraint "user_roles_table_pkey" PRIMARY KEY using index "user_roles_table_pkey"; + +alter table "public"."video_upload_answer_table" add constraint "video_upload_answer_table_pkey" PRIMARY KEY using index "video_upload_answer_table_pkey"; + +alter table "public"."video_upload_question_table" add constraint "video_upload_question_table_pkey" PRIMARY KEY using index "video_upload_question_table_pkey"; + +alter table "public"."answer_table" add constraint "answer_table_applicationid_fkey" FOREIGN KEY (applicationid) REFERENCES application_table(applicationid) ON DELETE CASCADE not valid; + +alter table "public"."answer_table" validate constraint "answer_table_applicationid_fkey"; + +alter table "public"."answer_table" add constraint "answer_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."answer_table" validate constraint "answer_table_questionid_fkey"; + +alter table "public"."application_table" add constraint "application_table_userid_fkey" FOREIGN KEY (userid) REFERENCES auth.users(id) ON DELETE CASCADE not valid; + +alter table "public"."application_table" validate constraint "application_table_userid_fkey"; + +alter table "public"."checkbox_answer_table" add constraint "checkbox_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."checkbox_answer_table" validate constraint "checkbox_answer_table_answerid_fkey"; + +alter table "public"."checkbox_question_table" add constraint "checkbox_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."checkbox_question_table" validate constraint "checkbox_question_table_questionid_fkey"; + +alter table "public"."conditional_answer_table" add constraint "conditional_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."conditional_answer_table" validate constraint "conditional_answer_table_answerid_fkey"; + +alter table "public"."conditional_question_choice_table" add constraint "conditional_question_choice_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES conditional_question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."conditional_question_choice_table" validate constraint "conditional_question_choice_table_questionid_fkey"; + +alter table "public"."conditional_question_table" add constraint "conditional_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."conditional_question_table" validate constraint "conditional_question_table_questionid_fkey"; + +alter table "public"."date_picker_answer_table" add constraint "date_picker_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."date_picker_answer_table" validate constraint "date_picker_answer_table_answerid_fkey"; + +alter table "public"."date_picker_question_table" add constraint "date_picker_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."date_picker_question_table" validate constraint "date_picker_question_table_questionid_fkey"; + +alter table "public"."datetime_picker_answer_table" add constraint "datetime_picker_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."datetime_picker_answer_table" validate constraint "datetime_picker_answer_table_answerid_fkey"; + +alter table "public"."datetime_picker_question_table" add constraint "datetime_picker_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."datetime_picker_question_table" validate constraint "datetime_picker_question_table_questionid_fkey"; + +alter table "public"."dropdown_answer_table" add constraint "dropdown_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."dropdown_answer_table" validate constraint "dropdown_answer_table_answerid_fkey"; + +alter table "public"."dropdown_question_option_table" add constraint "dropdown_question_option_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES dropdown_question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."dropdown_question_option_table" validate constraint "dropdown_question_option_table_questionid_fkey"; + +alter table "public"."dropdown_question_table" add constraint "dropdown_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."dropdown_question_table" validate constraint "dropdown_question_table_questionid_fkey"; + +alter table "public"."image_upload_answer_table" add constraint "image_upload_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."image_upload_answer_table" validate constraint "image_upload_answer_table_answerid_fkey"; + +alter table "public"."image_upload_question_table" add constraint "image_upload_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."image_upload_question_table" validate constraint "image_upload_question_table_questionid_fkey"; + +alter table "public"."long_text_answer_table" add constraint "long_text_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."long_text_answer_table" validate constraint "long_text_answer_table_answerid_fkey"; + +alter table "public"."long_text_question_table" add constraint "long_text_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."long_text_question_table" validate constraint "long_text_question_table_questionid_fkey"; + +alter table "public"."multiple_choice_answer_table" add constraint "multiple_choice_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."multiple_choice_answer_table" validate constraint "multiple_choice_answer_table_answerid_fkey"; + +alter table "public"."multiple_choice_question_choice_table" add constraint "multiple_choice_question_choice_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES multiple_choice_question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."multiple_choice_question_choice_table" validate constraint "multiple_choice_question_choice_table_questionid_fkey"; + +alter table "public"."multiple_choice_question_table" add constraint "multiple_choice_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."multiple_choice_question_table" validate constraint "multiple_choice_question_table_questionid_fkey"; + +alter table "public"."number_picker_answer_table" add constraint "number_picker_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."number_picker_answer_table" validate constraint "number_picker_answer_table_answerid_fkey"; + +alter table "public"."number_picker_question_table" add constraint "number_picker_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."number_picker_question_table" validate constraint "number_picker_question_table_questionid_fkey"; + +alter table "public"."pdf_upload_answer_table" add constraint "pdf_upload_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."pdf_upload_answer_table" validate constraint "pdf_upload_answer_table_answerid_fkey"; + +alter table "public"."pdf_upload_question_table" add constraint "pdf_upload_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."pdf_upload_question_table" validate constraint "pdf_upload_question_table_questionid_fkey"; + +alter table "public"."phase_assignment_table" add constraint "phase_assignment_table_check" CHECK ((user_role_1_id <> user_role_2_id)) not valid; + +alter table "public"."phase_assignment_table" validate constraint "phase_assignment_table_check"; + +alter table "public"."phase_assignment_table" add constraint "phase_assignment_table_phase_id_fkey" FOREIGN KEY (phase_id) REFERENCES phase_table(phaseid) not valid; + +alter table "public"."phase_assignment_table" validate constraint "phase_assignment_table_phase_id_fkey"; + +alter table "public"."phase_assignment_table" add constraint "phase_assignment_table_user_role_1_id_fkey" FOREIGN KEY (user_role_1_id) REFERENCES user_profiles_table(userid) not valid; + +alter table "public"."phase_assignment_table" validate constraint "phase_assignment_table_user_role_1_id_fkey"; + +alter table "public"."phase_assignment_table" add constraint "phase_assignment_table_user_role_2_id_fkey" FOREIGN KEY (user_role_2_id) REFERENCES user_profiles_table(userid) not valid; + +alter table "public"."phase_assignment_table" validate constraint "phase_assignment_table_user_role_2_id_fkey"; + +alter table "public"."phase_outcome_table" add constraint "phase_outcome_table_phase_id_fkey" FOREIGN KEY (phase_id) REFERENCES phase_table(phaseid) not valid; + +alter table "public"."phase_outcome_table" validate constraint "phase_outcome_table_phase_id_fkey"; + +alter table "public"."phase_outcome_table" add constraint "phase_outcome_table_reviewed_by_fkey" FOREIGN KEY (reviewed_by) REFERENCES user_profiles_table(userid) not valid; + +alter table "public"."phase_outcome_table" validate constraint "phase_outcome_table_reviewed_by_fkey"; + +alter table "public"."phase_outcome_table" add constraint "phase_outcome_table_user_id_fkey" FOREIGN KEY (user_id) REFERENCES user_profiles_table(userid) not valid; + +alter table "public"."phase_outcome_table" validate constraint "phase_outcome_table_user_id_fkey"; + +alter table "public"."question_table" add constraint "question_table_phaseid_fkey" FOREIGN KEY (phaseid) REFERENCES phase_table(phaseid) ON DELETE CASCADE not valid; + +alter table "public"."question_table" validate constraint "question_table_phaseid_fkey"; + +alter table "public"."question_table" add constraint "question_table_sectionid_fkey" FOREIGN KEY (sectionid) REFERENCES sections_table(sectionid) not valid; + +alter table "public"."question_table" validate constraint "question_table_sectionid_fkey"; + +alter table "public"."sections_table" add constraint "sections_table_phaseid_fkey" FOREIGN KEY (phaseid) REFERENCES phase_table(phaseid) ON DELETE CASCADE not valid; + +alter table "public"."sections_table" validate constraint "sections_table_phaseid_fkey"; + +alter table "public"."short_text_answer_table" add constraint "short_text_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."short_text_answer_table" validate constraint "short_text_answer_table_answerid_fkey"; + +alter table "public"."short_text_question_table" add constraint "short_text_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."short_text_question_table" validate constraint "short_text_question_table_questionid_fkey"; + +alter table "public"."user_profiles_table" add constraint "user_profiles_table_userid_fkey" FOREIGN KEY (userid) REFERENCES auth.users(id) ON DELETE CASCADE not valid; + +alter table "public"."user_profiles_table" validate constraint "user_profiles_table_userid_fkey"; + +alter table "public"."user_roles_table" add constraint "user_roles_table_userrolename_key" UNIQUE using index "user_roles_table_userrolename_key"; + +alter table "public"."video_upload_answer_table" add constraint "video_upload_answer_table_answerid_fkey" FOREIGN KEY (answerid) REFERENCES answer_table(answerid) ON DELETE CASCADE not valid; + +alter table "public"."video_upload_answer_table" validate constraint "video_upload_answer_table_answerid_fkey"; + +alter table "public"."video_upload_question_table" add constraint "video_upload_question_table_questionid_fkey" FOREIGN KEY (questionid) REFERENCES question_table(questionid) ON DELETE CASCADE not valid; + +alter table "public"."video_upload_question_table" validate constraint "video_upload_question_table_questionid_fkey"; + +set check_function_bodies = off; + +CREATE OR REPLACE FUNCTION public.fetch_checkbox_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, checked boolean) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.checked + FROM CHECKBOX_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_conditional_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, selectedchoice text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.selectedchoice + FROM CONDITIONAL_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_date_picker_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, pickeddate date) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.pickeddate + FROM DATE_PICKER_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_datetime_picker_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, pickeddatetime timestamp with time zone) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.pickeddatetime + FROM DATETIME_PICKER_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_dropdown_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, selectedoptions text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.selectedoptions + FROM DROPDOWN_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_image_upload_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, imagename text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.imagename + FROM IMAGE_UPLOAD_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_long_text_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, answertext text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.answertext + FROM LONG_TEXT_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_multiple_choice_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, selectedchoice text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.selectedchoice + FROM MULTIPLE_CHOICE_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_number_picker_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, pickednumber integer) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.pickednumber + FROM NUMBER_PICKER_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_pdf_upload_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, pdfname text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.pdfname + FROM PDF_UPLOAD_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_short_text_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, answertext text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.answertext + FROM SHORT_TEXT_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +CREATE OR REPLACE FUNCTION public.fetch_video_upload_answer_table(question_id uuid, user_id uuid) + RETURNS TABLE(answerid uuid, videoname text) + LANGUAGE plpgsql + STABLE +AS $function$ +BEGIN + RETURN QUERY + SELECT t.answerid, t.videoname + FROM VIDEO_UPLOAD_ANSWER_TABLE t + INNER JOIN answer_table a ON t.answerid = a.answerid + INNER JOIN application_table app ON a.applicationid = app.applicationid + WHERE a.questionid = question_id AND app.userid = user_id; +END; +$function$ +; + +grant delete on table "public"."answer_table" to "anon"; + +grant insert on table "public"."answer_table" to "anon"; + +grant references on table "public"."answer_table" to "anon"; + +grant select on table "public"."answer_table" to "anon"; + +grant trigger on table "public"."answer_table" to "anon"; + +grant truncate on table "public"."answer_table" to "anon"; + +grant update on table "public"."answer_table" to "anon"; + +grant delete on table "public"."answer_table" to "authenticated"; + +grant insert on table "public"."answer_table" to "authenticated"; + +grant references on table "public"."answer_table" to "authenticated"; + +grant select on table "public"."answer_table" to "authenticated"; + +grant trigger on table "public"."answer_table" to "authenticated"; + +grant truncate on table "public"."answer_table" to "authenticated"; + +grant update on table "public"."answer_table" to "authenticated"; + +grant delete on table "public"."answer_table" to "service_role"; + +grant insert on table "public"."answer_table" to "service_role"; + +grant references on table "public"."answer_table" to "service_role"; + +grant select on table "public"."answer_table" to "service_role"; + +grant trigger on table "public"."answer_table" to "service_role"; + +grant truncate on table "public"."answer_table" to "service_role"; + +grant update on table "public"."answer_table" to "service_role"; + +grant delete on table "public"."application_table" to "anon"; + +grant insert on table "public"."application_table" to "anon"; + +grant references on table "public"."application_table" to "anon"; + +grant select on table "public"."application_table" to "anon"; + +grant trigger on table "public"."application_table" to "anon"; + +grant truncate on table "public"."application_table" to "anon"; + +grant update on table "public"."application_table" to "anon"; + +grant delete on table "public"."application_table" to "authenticated"; + +grant insert on table "public"."application_table" to "authenticated"; + +grant references on table "public"."application_table" to "authenticated"; + +grant select on table "public"."application_table" to "authenticated"; + +grant trigger on table "public"."application_table" to "authenticated"; + +grant truncate on table "public"."application_table" to "authenticated"; + +grant update on table "public"."application_table" to "authenticated"; + +grant delete on table "public"."application_table" to "service_role"; + +grant insert on table "public"."application_table" to "service_role"; + +grant references on table "public"."application_table" to "service_role"; + +grant select on table "public"."application_table" to "service_role"; + +grant trigger on table "public"."application_table" to "service_role"; + +grant truncate on table "public"."application_table" to "service_role"; + +grant update on table "public"."application_table" to "service_role"; + +grant delete on table "public"."checkbox_answer_table" to "anon"; + +grant insert on table "public"."checkbox_answer_table" to "anon"; + +grant references on table "public"."checkbox_answer_table" to "anon"; + +grant select on table "public"."checkbox_answer_table" to "anon"; + +grant trigger on table "public"."checkbox_answer_table" to "anon"; + +grant truncate on table "public"."checkbox_answer_table" to "anon"; + +grant update on table "public"."checkbox_answer_table" to "anon"; + +grant delete on table "public"."checkbox_answer_table" to "authenticated"; + +grant insert on table "public"."checkbox_answer_table" to "authenticated"; + +grant references on table "public"."checkbox_answer_table" to "authenticated"; + +grant select on table "public"."checkbox_answer_table" to "authenticated"; + +grant trigger on table "public"."checkbox_answer_table" to "authenticated"; + +grant truncate on table "public"."checkbox_answer_table" to "authenticated"; + +grant update on table "public"."checkbox_answer_table" to "authenticated"; + +grant delete on table "public"."checkbox_answer_table" to "service_role"; + +grant insert on table "public"."checkbox_answer_table" to "service_role"; + +grant references on table "public"."checkbox_answer_table" to "service_role"; + +grant select on table "public"."checkbox_answer_table" to "service_role"; + +grant trigger on table "public"."checkbox_answer_table" to "service_role"; + +grant truncate on table "public"."checkbox_answer_table" to "service_role"; + +grant update on table "public"."checkbox_answer_table" to "service_role"; + +grant delete on table "public"."checkbox_question_table" to "anon"; + +grant insert on table "public"."checkbox_question_table" to "anon"; + +grant references on table "public"."checkbox_question_table" to "anon"; + +grant select on table "public"."checkbox_question_table" to "anon"; + +grant trigger on table "public"."checkbox_question_table" to "anon"; + +grant truncate on table "public"."checkbox_question_table" to "anon"; + +grant update on table "public"."checkbox_question_table" to "anon"; + +grant delete on table "public"."checkbox_question_table" to "authenticated"; + +grant insert on table "public"."checkbox_question_table" to "authenticated"; + +grant references on table "public"."checkbox_question_table" to "authenticated"; + +grant select on table "public"."checkbox_question_table" to "authenticated"; + +grant trigger on table "public"."checkbox_question_table" to "authenticated"; + +grant truncate on table "public"."checkbox_question_table" to "authenticated"; + +grant update on table "public"."checkbox_question_table" to "authenticated"; + +grant delete on table "public"."checkbox_question_table" to "service_role"; + +grant insert on table "public"."checkbox_question_table" to "service_role"; + +grant references on table "public"."checkbox_question_table" to "service_role"; + +grant select on table "public"."checkbox_question_table" to "service_role"; + +grant trigger on table "public"."checkbox_question_table" to "service_role"; + +grant truncate on table "public"."checkbox_question_table" to "service_role"; + +grant update on table "public"."checkbox_question_table" to "service_role"; + +grant delete on table "public"."conditional_answer_table" to "anon"; + +grant insert on table "public"."conditional_answer_table" to "anon"; + +grant references on table "public"."conditional_answer_table" to "anon"; + +grant select on table "public"."conditional_answer_table" to "anon"; + +grant trigger on table "public"."conditional_answer_table" to "anon"; + +grant truncate on table "public"."conditional_answer_table" to "anon"; + +grant update on table "public"."conditional_answer_table" to "anon"; + +grant delete on table "public"."conditional_answer_table" to "authenticated"; + +grant insert on table "public"."conditional_answer_table" to "authenticated"; + +grant references on table "public"."conditional_answer_table" to "authenticated"; + +grant select on table "public"."conditional_answer_table" to "authenticated"; + +grant trigger on table "public"."conditional_answer_table" to "authenticated"; + +grant truncate on table "public"."conditional_answer_table" to "authenticated"; + +grant update on table "public"."conditional_answer_table" to "authenticated"; + +grant delete on table "public"."conditional_answer_table" to "service_role"; + +grant insert on table "public"."conditional_answer_table" to "service_role"; + +grant references on table "public"."conditional_answer_table" to "service_role"; + +grant select on table "public"."conditional_answer_table" to "service_role"; + +grant trigger on table "public"."conditional_answer_table" to "service_role"; + +grant truncate on table "public"."conditional_answer_table" to "service_role"; + +grant update on table "public"."conditional_answer_table" to "service_role"; + +grant delete on table "public"."conditional_question_choice_table" to "anon"; + +grant insert on table "public"."conditional_question_choice_table" to "anon"; + +grant references on table "public"."conditional_question_choice_table" to "anon"; + +grant select on table "public"."conditional_question_choice_table" to "anon"; + +grant trigger on table "public"."conditional_question_choice_table" to "anon"; + +grant truncate on table "public"."conditional_question_choice_table" to "anon"; + +grant update on table "public"."conditional_question_choice_table" to "anon"; + +grant delete on table "public"."conditional_question_choice_table" to "authenticated"; + +grant insert on table "public"."conditional_question_choice_table" to "authenticated"; + +grant references on table "public"."conditional_question_choice_table" to "authenticated"; + +grant select on table "public"."conditional_question_choice_table" to "authenticated"; + +grant trigger on table "public"."conditional_question_choice_table" to "authenticated"; + +grant truncate on table "public"."conditional_question_choice_table" to "authenticated"; + +grant update on table "public"."conditional_question_choice_table" to "authenticated"; + +grant delete on table "public"."conditional_question_choice_table" to "service_role"; + +grant insert on table "public"."conditional_question_choice_table" to "service_role"; + +grant references on table "public"."conditional_question_choice_table" to "service_role"; + +grant select on table "public"."conditional_question_choice_table" to "service_role"; + +grant trigger on table "public"."conditional_question_choice_table" to "service_role"; + +grant truncate on table "public"."conditional_question_choice_table" to "service_role"; + +grant update on table "public"."conditional_question_choice_table" to "service_role"; + +grant delete on table "public"."conditional_question_table" to "anon"; + +grant insert on table "public"."conditional_question_table" to "anon"; + +grant references on table "public"."conditional_question_table" to "anon"; + +grant select on table "public"."conditional_question_table" to "anon"; + +grant trigger on table "public"."conditional_question_table" to "anon"; + +grant truncate on table "public"."conditional_question_table" to "anon"; + +grant update on table "public"."conditional_question_table" to "anon"; + +grant delete on table "public"."conditional_question_table" to "authenticated"; + +grant insert on table "public"."conditional_question_table" to "authenticated"; + +grant references on table "public"."conditional_question_table" to "authenticated"; + +grant select on table "public"."conditional_question_table" to "authenticated"; + +grant trigger on table "public"."conditional_question_table" to "authenticated"; + +grant truncate on table "public"."conditional_question_table" to "authenticated"; + +grant update on table "public"."conditional_question_table" to "authenticated"; + +grant delete on table "public"."conditional_question_table" to "service_role"; + +grant insert on table "public"."conditional_question_table" to "service_role"; + +grant references on table "public"."conditional_question_table" to "service_role"; + +grant select on table "public"."conditional_question_table" to "service_role"; + +grant trigger on table "public"."conditional_question_table" to "service_role"; + +grant truncate on table "public"."conditional_question_table" to "service_role"; + +grant update on table "public"."conditional_question_table" to "service_role"; + +grant delete on table "public"."date_picker_answer_table" to "anon"; + +grant insert on table "public"."date_picker_answer_table" to "anon"; + +grant references on table "public"."date_picker_answer_table" to "anon"; + +grant select on table "public"."date_picker_answer_table" to "anon"; + +grant trigger on table "public"."date_picker_answer_table" to "anon"; + +grant truncate on table "public"."date_picker_answer_table" to "anon"; + +grant update on table "public"."date_picker_answer_table" to "anon"; + +grant delete on table "public"."date_picker_answer_table" to "authenticated"; + +grant insert on table "public"."date_picker_answer_table" to "authenticated"; + +grant references on table "public"."date_picker_answer_table" to "authenticated"; + +grant select on table "public"."date_picker_answer_table" to "authenticated"; + +grant trigger on table "public"."date_picker_answer_table" to "authenticated"; + +grant truncate on table "public"."date_picker_answer_table" to "authenticated"; + +grant update on table "public"."date_picker_answer_table" to "authenticated"; + +grant delete on table "public"."date_picker_answer_table" to "service_role"; + +grant insert on table "public"."date_picker_answer_table" to "service_role"; + +grant references on table "public"."date_picker_answer_table" to "service_role"; + +grant select on table "public"."date_picker_answer_table" to "service_role"; + +grant trigger on table "public"."date_picker_answer_table" to "service_role"; + +grant truncate on table "public"."date_picker_answer_table" to "service_role"; + +grant update on table "public"."date_picker_answer_table" to "service_role"; + +grant delete on table "public"."date_picker_question_table" to "anon"; + +grant insert on table "public"."date_picker_question_table" to "anon"; + +grant references on table "public"."date_picker_question_table" to "anon"; + +grant select on table "public"."date_picker_question_table" to "anon"; + +grant trigger on table "public"."date_picker_question_table" to "anon"; + +grant truncate on table "public"."date_picker_question_table" to "anon"; + +grant update on table "public"."date_picker_question_table" to "anon"; + +grant delete on table "public"."date_picker_question_table" to "authenticated"; + +grant insert on table "public"."date_picker_question_table" to "authenticated"; + +grant references on table "public"."date_picker_question_table" to "authenticated"; + +grant select on table "public"."date_picker_question_table" to "authenticated"; + +grant trigger on table "public"."date_picker_question_table" to "authenticated"; + +grant truncate on table "public"."date_picker_question_table" to "authenticated"; + +grant update on table "public"."date_picker_question_table" to "authenticated"; + +grant delete on table "public"."date_picker_question_table" to "service_role"; + +grant insert on table "public"."date_picker_question_table" to "service_role"; + +grant references on table "public"."date_picker_question_table" to "service_role"; + +grant select on table "public"."date_picker_question_table" to "service_role"; + +grant trigger on table "public"."date_picker_question_table" to "service_role"; + +grant truncate on table "public"."date_picker_question_table" to "service_role"; + +grant update on table "public"."date_picker_question_table" to "service_role"; + +grant delete on table "public"."datetime_picker_answer_table" to "anon"; + +grant insert on table "public"."datetime_picker_answer_table" to "anon"; + +grant references on table "public"."datetime_picker_answer_table" to "anon"; + +grant select on table "public"."datetime_picker_answer_table" to "anon"; + +grant trigger on table "public"."datetime_picker_answer_table" to "anon"; + +grant truncate on table "public"."datetime_picker_answer_table" to "anon"; + +grant update on table "public"."datetime_picker_answer_table" to "anon"; + +grant delete on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant insert on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant references on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant select on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant trigger on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant truncate on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant update on table "public"."datetime_picker_answer_table" to "authenticated"; + +grant delete on table "public"."datetime_picker_answer_table" to "service_role"; + +grant insert on table "public"."datetime_picker_answer_table" to "service_role"; + +grant references on table "public"."datetime_picker_answer_table" to "service_role"; + +grant select on table "public"."datetime_picker_answer_table" to "service_role"; + +grant trigger on table "public"."datetime_picker_answer_table" to "service_role"; + +grant truncate on table "public"."datetime_picker_answer_table" to "service_role"; + +grant update on table "public"."datetime_picker_answer_table" to "service_role"; + +grant delete on table "public"."datetime_picker_question_table" to "anon"; + +grant insert on table "public"."datetime_picker_question_table" to "anon"; + +grant references on table "public"."datetime_picker_question_table" to "anon"; + +grant select on table "public"."datetime_picker_question_table" to "anon"; + +grant trigger on table "public"."datetime_picker_question_table" to "anon"; + +grant truncate on table "public"."datetime_picker_question_table" to "anon"; + +grant update on table "public"."datetime_picker_question_table" to "anon"; + +grant delete on table "public"."datetime_picker_question_table" to "authenticated"; + +grant insert on table "public"."datetime_picker_question_table" to "authenticated"; + +grant references on table "public"."datetime_picker_question_table" to "authenticated"; + +grant select on table "public"."datetime_picker_question_table" to "authenticated"; + +grant trigger on table "public"."datetime_picker_question_table" to "authenticated"; + +grant truncate on table "public"."datetime_picker_question_table" to "authenticated"; + +grant update on table "public"."datetime_picker_question_table" to "authenticated"; + +grant delete on table "public"."datetime_picker_question_table" to "service_role"; + +grant insert on table "public"."datetime_picker_question_table" to "service_role"; + +grant references on table "public"."datetime_picker_question_table" to "service_role"; + +grant select on table "public"."datetime_picker_question_table" to "service_role"; + +grant trigger on table "public"."datetime_picker_question_table" to "service_role"; + +grant truncate on table "public"."datetime_picker_question_table" to "service_role"; + +grant update on table "public"."datetime_picker_question_table" to "service_role"; + +grant delete on table "public"."dropdown_answer_table" to "anon"; + +grant insert on table "public"."dropdown_answer_table" to "anon"; + +grant references on table "public"."dropdown_answer_table" to "anon"; + +grant select on table "public"."dropdown_answer_table" to "anon"; + +grant trigger on table "public"."dropdown_answer_table" to "anon"; + +grant truncate on table "public"."dropdown_answer_table" to "anon"; + +grant update on table "public"."dropdown_answer_table" to "anon"; + +grant delete on table "public"."dropdown_answer_table" to "authenticated"; + +grant insert on table "public"."dropdown_answer_table" to "authenticated"; + +grant references on table "public"."dropdown_answer_table" to "authenticated"; + +grant select on table "public"."dropdown_answer_table" to "authenticated"; + +grant trigger on table "public"."dropdown_answer_table" to "authenticated"; + +grant truncate on table "public"."dropdown_answer_table" to "authenticated"; + +grant update on table "public"."dropdown_answer_table" to "authenticated"; + +grant delete on table "public"."dropdown_answer_table" to "service_role"; + +grant insert on table "public"."dropdown_answer_table" to "service_role"; + +grant references on table "public"."dropdown_answer_table" to "service_role"; + +grant select on table "public"."dropdown_answer_table" to "service_role"; + +grant trigger on table "public"."dropdown_answer_table" to "service_role"; + +grant truncate on table "public"."dropdown_answer_table" to "service_role"; + +grant update on table "public"."dropdown_answer_table" to "service_role"; + +grant delete on table "public"."dropdown_question_option_table" to "anon"; + +grant insert on table "public"."dropdown_question_option_table" to "anon"; + +grant references on table "public"."dropdown_question_option_table" to "anon"; + +grant select on table "public"."dropdown_question_option_table" to "anon"; + +grant trigger on table "public"."dropdown_question_option_table" to "anon"; + +grant truncate on table "public"."dropdown_question_option_table" to "anon"; + +grant update on table "public"."dropdown_question_option_table" to "anon"; + +grant delete on table "public"."dropdown_question_option_table" to "authenticated"; + +grant insert on table "public"."dropdown_question_option_table" to "authenticated"; + +grant references on table "public"."dropdown_question_option_table" to "authenticated"; + +grant select on table "public"."dropdown_question_option_table" to "authenticated"; + +grant trigger on table "public"."dropdown_question_option_table" to "authenticated"; + +grant truncate on table "public"."dropdown_question_option_table" to "authenticated"; + +grant update on table "public"."dropdown_question_option_table" to "authenticated"; + +grant delete on table "public"."dropdown_question_option_table" to "service_role"; + +grant insert on table "public"."dropdown_question_option_table" to "service_role"; + +grant references on table "public"."dropdown_question_option_table" to "service_role"; + +grant select on table "public"."dropdown_question_option_table" to "service_role"; + +grant trigger on table "public"."dropdown_question_option_table" to "service_role"; + +grant truncate on table "public"."dropdown_question_option_table" to "service_role"; + +grant update on table "public"."dropdown_question_option_table" to "service_role"; + +grant delete on table "public"."dropdown_question_table" to "anon"; + +grant insert on table "public"."dropdown_question_table" to "anon"; + +grant references on table "public"."dropdown_question_table" to "anon"; + +grant select on table "public"."dropdown_question_table" to "anon"; + +grant trigger on table "public"."dropdown_question_table" to "anon"; + +grant truncate on table "public"."dropdown_question_table" to "anon"; + +grant update on table "public"."dropdown_question_table" to "anon"; + +grant delete on table "public"."dropdown_question_table" to "authenticated"; + +grant insert on table "public"."dropdown_question_table" to "authenticated"; + +grant references on table "public"."dropdown_question_table" to "authenticated"; + +grant select on table "public"."dropdown_question_table" to "authenticated"; + +grant trigger on table "public"."dropdown_question_table" to "authenticated"; + +grant truncate on table "public"."dropdown_question_table" to "authenticated"; + +grant update on table "public"."dropdown_question_table" to "authenticated"; + +grant delete on table "public"."dropdown_question_table" to "service_role"; + +grant insert on table "public"."dropdown_question_table" to "service_role"; + +grant references on table "public"."dropdown_question_table" to "service_role"; + +grant select on table "public"."dropdown_question_table" to "service_role"; + +grant trigger on table "public"."dropdown_question_table" to "service_role"; + +grant truncate on table "public"."dropdown_question_table" to "service_role"; + +grant update on table "public"."dropdown_question_table" to "service_role"; + +grant delete on table "public"."image_upload_answer_table" to "anon"; + +grant insert on table "public"."image_upload_answer_table" to "anon"; + +grant references on table "public"."image_upload_answer_table" to "anon"; + +grant select on table "public"."image_upload_answer_table" to "anon"; + +grant trigger on table "public"."image_upload_answer_table" to "anon"; + +grant truncate on table "public"."image_upload_answer_table" to "anon"; + +grant update on table "public"."image_upload_answer_table" to "anon"; + +grant delete on table "public"."image_upload_answer_table" to "authenticated"; + +grant insert on table "public"."image_upload_answer_table" to "authenticated"; + +grant references on table "public"."image_upload_answer_table" to "authenticated"; + +grant select on table "public"."image_upload_answer_table" to "authenticated"; + +grant trigger on table "public"."image_upload_answer_table" to "authenticated"; + +grant truncate on table "public"."image_upload_answer_table" to "authenticated"; + +grant update on table "public"."image_upload_answer_table" to "authenticated"; + +grant delete on table "public"."image_upload_answer_table" to "service_role"; + +grant insert on table "public"."image_upload_answer_table" to "service_role"; + +grant references on table "public"."image_upload_answer_table" to "service_role"; + +grant select on table "public"."image_upload_answer_table" to "service_role"; + +grant trigger on table "public"."image_upload_answer_table" to "service_role"; + +grant truncate on table "public"."image_upload_answer_table" to "service_role"; + +grant update on table "public"."image_upload_answer_table" to "service_role"; + +grant delete on table "public"."image_upload_question_table" to "anon"; + +grant insert on table "public"."image_upload_question_table" to "anon"; + +grant references on table "public"."image_upload_question_table" to "anon"; + +grant select on table "public"."image_upload_question_table" to "anon"; + +grant trigger on table "public"."image_upload_question_table" to "anon"; + +grant truncate on table "public"."image_upload_question_table" to "anon"; + +grant update on table "public"."image_upload_question_table" to "anon"; + +grant delete on table "public"."image_upload_question_table" to "authenticated"; + +grant insert on table "public"."image_upload_question_table" to "authenticated"; + +grant references on table "public"."image_upload_question_table" to "authenticated"; + +grant select on table "public"."image_upload_question_table" to "authenticated"; + +grant trigger on table "public"."image_upload_question_table" to "authenticated"; + +grant truncate on table "public"."image_upload_question_table" to "authenticated"; + +grant update on table "public"."image_upload_question_table" to "authenticated"; + +grant delete on table "public"."image_upload_question_table" to "service_role"; + +grant insert on table "public"."image_upload_question_table" to "service_role"; + +grant references on table "public"."image_upload_question_table" to "service_role"; + +grant select on table "public"."image_upload_question_table" to "service_role"; + +grant trigger on table "public"."image_upload_question_table" to "service_role"; + +grant truncate on table "public"."image_upload_question_table" to "service_role"; + +grant update on table "public"."image_upload_question_table" to "service_role"; + +grant delete on table "public"."long_text_answer_table" to "anon"; + +grant insert on table "public"."long_text_answer_table" to "anon"; + +grant references on table "public"."long_text_answer_table" to "anon"; + +grant select on table "public"."long_text_answer_table" to "anon"; + +grant trigger on table "public"."long_text_answer_table" to "anon"; + +grant truncate on table "public"."long_text_answer_table" to "anon"; + +grant update on table "public"."long_text_answer_table" to "anon"; + +grant delete on table "public"."long_text_answer_table" to "authenticated"; + +grant insert on table "public"."long_text_answer_table" to "authenticated"; + +grant references on table "public"."long_text_answer_table" to "authenticated"; + +grant select on table "public"."long_text_answer_table" to "authenticated"; + +grant trigger on table "public"."long_text_answer_table" to "authenticated"; + +grant truncate on table "public"."long_text_answer_table" to "authenticated"; + +grant update on table "public"."long_text_answer_table" to "authenticated"; + +grant delete on table "public"."long_text_answer_table" to "service_role"; + +grant insert on table "public"."long_text_answer_table" to "service_role"; + +grant references on table "public"."long_text_answer_table" to "service_role"; + +grant select on table "public"."long_text_answer_table" to "service_role"; + +grant trigger on table "public"."long_text_answer_table" to "service_role"; + +grant truncate on table "public"."long_text_answer_table" to "service_role"; + +grant update on table "public"."long_text_answer_table" to "service_role"; + +grant delete on table "public"."long_text_question_table" to "anon"; + +grant insert on table "public"."long_text_question_table" to "anon"; + +grant references on table "public"."long_text_question_table" to "anon"; + +grant select on table "public"."long_text_question_table" to "anon"; + +grant trigger on table "public"."long_text_question_table" to "anon"; + +grant truncate on table "public"."long_text_question_table" to "anon"; + +grant update on table "public"."long_text_question_table" to "anon"; + +grant delete on table "public"."long_text_question_table" to "authenticated"; + +grant insert on table "public"."long_text_question_table" to "authenticated"; + +grant references on table "public"."long_text_question_table" to "authenticated"; + +grant select on table "public"."long_text_question_table" to "authenticated"; + +grant trigger on table "public"."long_text_question_table" to "authenticated"; + +grant truncate on table "public"."long_text_question_table" to "authenticated"; + +grant update on table "public"."long_text_question_table" to "authenticated"; + +grant delete on table "public"."long_text_question_table" to "service_role"; + +grant insert on table "public"."long_text_question_table" to "service_role"; + +grant references on table "public"."long_text_question_table" to "service_role"; + +grant select on table "public"."long_text_question_table" to "service_role"; + +grant trigger on table "public"."long_text_question_table" to "service_role"; + +grant truncate on table "public"."long_text_question_table" to "service_role"; + +grant update on table "public"."long_text_question_table" to "service_role"; + +grant delete on table "public"."multiple_choice_answer_table" to "anon"; + +grant insert on table "public"."multiple_choice_answer_table" to "anon"; + +grant references on table "public"."multiple_choice_answer_table" to "anon"; + +grant select on table "public"."multiple_choice_answer_table" to "anon"; + +grant trigger on table "public"."multiple_choice_answer_table" to "anon"; + +grant truncate on table "public"."multiple_choice_answer_table" to "anon"; + +grant update on table "public"."multiple_choice_answer_table" to "anon"; + +grant delete on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant insert on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant references on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant select on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant trigger on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant truncate on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant update on table "public"."multiple_choice_answer_table" to "authenticated"; + +grant delete on table "public"."multiple_choice_answer_table" to "service_role"; + +grant insert on table "public"."multiple_choice_answer_table" to "service_role"; + +grant references on table "public"."multiple_choice_answer_table" to "service_role"; + +grant select on table "public"."multiple_choice_answer_table" to "service_role"; + +grant trigger on table "public"."multiple_choice_answer_table" to "service_role"; + +grant truncate on table "public"."multiple_choice_answer_table" to "service_role"; + +grant update on table "public"."multiple_choice_answer_table" to "service_role"; + +grant delete on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant insert on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant references on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant select on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant trigger on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant truncate on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant update on table "public"."multiple_choice_question_choice_table" to "anon"; + +grant delete on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant insert on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant references on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant select on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant trigger on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant truncate on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant update on table "public"."multiple_choice_question_choice_table" to "authenticated"; + +grant delete on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant insert on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant references on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant select on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant trigger on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant truncate on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant update on table "public"."multiple_choice_question_choice_table" to "service_role"; + +grant delete on table "public"."multiple_choice_question_table" to "anon"; + +grant insert on table "public"."multiple_choice_question_table" to "anon"; + +grant references on table "public"."multiple_choice_question_table" to "anon"; + +grant select on table "public"."multiple_choice_question_table" to "anon"; + +grant trigger on table "public"."multiple_choice_question_table" to "anon"; + +grant truncate on table "public"."multiple_choice_question_table" to "anon"; + +grant update on table "public"."multiple_choice_question_table" to "anon"; + +grant delete on table "public"."multiple_choice_question_table" to "authenticated"; + +grant insert on table "public"."multiple_choice_question_table" to "authenticated"; + +grant references on table "public"."multiple_choice_question_table" to "authenticated"; + +grant select on table "public"."multiple_choice_question_table" to "authenticated"; + +grant trigger on table "public"."multiple_choice_question_table" to "authenticated"; + +grant truncate on table "public"."multiple_choice_question_table" to "authenticated"; + +grant update on table "public"."multiple_choice_question_table" to "authenticated"; + +grant delete on table "public"."multiple_choice_question_table" to "service_role"; + +grant insert on table "public"."multiple_choice_question_table" to "service_role"; + +grant references on table "public"."multiple_choice_question_table" to "service_role"; + +grant select on table "public"."multiple_choice_question_table" to "service_role"; + +grant trigger on table "public"."multiple_choice_question_table" to "service_role"; + +grant truncate on table "public"."multiple_choice_question_table" to "service_role"; + +grant update on table "public"."multiple_choice_question_table" to "service_role"; + +grant delete on table "public"."number_picker_answer_table" to "anon"; + +grant insert on table "public"."number_picker_answer_table" to "anon"; + +grant references on table "public"."number_picker_answer_table" to "anon"; + +grant select on table "public"."number_picker_answer_table" to "anon"; + +grant trigger on table "public"."number_picker_answer_table" to "anon"; + +grant truncate on table "public"."number_picker_answer_table" to "anon"; + +grant update on table "public"."number_picker_answer_table" to "anon"; + +grant delete on table "public"."number_picker_answer_table" to "authenticated"; + +grant insert on table "public"."number_picker_answer_table" to "authenticated"; + +grant references on table "public"."number_picker_answer_table" to "authenticated"; + +grant select on table "public"."number_picker_answer_table" to "authenticated"; + +grant trigger on table "public"."number_picker_answer_table" to "authenticated"; + +grant truncate on table "public"."number_picker_answer_table" to "authenticated"; + +grant update on table "public"."number_picker_answer_table" to "authenticated"; + +grant delete on table "public"."number_picker_answer_table" to "service_role"; + +grant insert on table "public"."number_picker_answer_table" to "service_role"; + +grant references on table "public"."number_picker_answer_table" to "service_role"; + +grant select on table "public"."number_picker_answer_table" to "service_role"; + +grant trigger on table "public"."number_picker_answer_table" to "service_role"; + +grant truncate on table "public"."number_picker_answer_table" to "service_role"; + +grant update on table "public"."number_picker_answer_table" to "service_role"; + +grant delete on table "public"."number_picker_question_table" to "anon"; + +grant insert on table "public"."number_picker_question_table" to "anon"; + +grant references on table "public"."number_picker_question_table" to "anon"; + +grant select on table "public"."number_picker_question_table" to "anon"; + +grant trigger on table "public"."number_picker_question_table" to "anon"; + +grant truncate on table "public"."number_picker_question_table" to "anon"; + +grant update on table "public"."number_picker_question_table" to "anon"; + +grant delete on table "public"."number_picker_question_table" to "authenticated"; + +grant insert on table "public"."number_picker_question_table" to "authenticated"; + +grant references on table "public"."number_picker_question_table" to "authenticated"; + +grant select on table "public"."number_picker_question_table" to "authenticated"; + +grant trigger on table "public"."number_picker_question_table" to "authenticated"; + +grant truncate on table "public"."number_picker_question_table" to "authenticated"; + +grant update on table "public"."number_picker_question_table" to "authenticated"; + +grant delete on table "public"."number_picker_question_table" to "service_role"; + +grant insert on table "public"."number_picker_question_table" to "service_role"; + +grant references on table "public"."number_picker_question_table" to "service_role"; + +grant select on table "public"."number_picker_question_table" to "service_role"; + +grant trigger on table "public"."number_picker_question_table" to "service_role"; + +grant truncate on table "public"."number_picker_question_table" to "service_role"; + +grant update on table "public"."number_picker_question_table" to "service_role"; + +grant delete on table "public"."pdf_upload_answer_table" to "anon"; + +grant insert on table "public"."pdf_upload_answer_table" to "anon"; + +grant references on table "public"."pdf_upload_answer_table" to "anon"; + +grant select on table "public"."pdf_upload_answer_table" to "anon"; + +grant trigger on table "public"."pdf_upload_answer_table" to "anon"; + +grant truncate on table "public"."pdf_upload_answer_table" to "anon"; + +grant update on table "public"."pdf_upload_answer_table" to "anon"; + +grant delete on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant insert on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant references on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant select on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant trigger on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant truncate on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant update on table "public"."pdf_upload_answer_table" to "authenticated"; + +grant delete on table "public"."pdf_upload_answer_table" to "service_role"; + +grant insert on table "public"."pdf_upload_answer_table" to "service_role"; + +grant references on table "public"."pdf_upload_answer_table" to "service_role"; + +grant select on table "public"."pdf_upload_answer_table" to "service_role"; + +grant trigger on table "public"."pdf_upload_answer_table" to "service_role"; + +grant truncate on table "public"."pdf_upload_answer_table" to "service_role"; + +grant update on table "public"."pdf_upload_answer_table" to "service_role"; + +grant delete on table "public"."pdf_upload_question_table" to "anon"; + +grant insert on table "public"."pdf_upload_question_table" to "anon"; + +grant references on table "public"."pdf_upload_question_table" to "anon"; + +grant select on table "public"."pdf_upload_question_table" to "anon"; + +grant trigger on table "public"."pdf_upload_question_table" to "anon"; + +grant truncate on table "public"."pdf_upload_question_table" to "anon"; + +grant update on table "public"."pdf_upload_question_table" to "anon"; + +grant delete on table "public"."pdf_upload_question_table" to "authenticated"; + +grant insert on table "public"."pdf_upload_question_table" to "authenticated"; + +grant references on table "public"."pdf_upload_question_table" to "authenticated"; + +grant select on table "public"."pdf_upload_question_table" to "authenticated"; + +grant trigger on table "public"."pdf_upload_question_table" to "authenticated"; + +grant truncate on table "public"."pdf_upload_question_table" to "authenticated"; + +grant update on table "public"."pdf_upload_question_table" to "authenticated"; + +grant delete on table "public"."pdf_upload_question_table" to "service_role"; + +grant insert on table "public"."pdf_upload_question_table" to "service_role"; + +grant references on table "public"."pdf_upload_question_table" to "service_role"; + +grant select on table "public"."pdf_upload_question_table" to "service_role"; + +grant trigger on table "public"."pdf_upload_question_table" to "service_role"; + +grant truncate on table "public"."pdf_upload_question_table" to "service_role"; + +grant update on table "public"."pdf_upload_question_table" to "service_role"; + +grant delete on table "public"."phase_assignment_table" to "anon"; + +grant insert on table "public"."phase_assignment_table" to "anon"; + +grant references on table "public"."phase_assignment_table" to "anon"; + +grant select on table "public"."phase_assignment_table" to "anon"; + +grant trigger on table "public"."phase_assignment_table" to "anon"; + +grant truncate on table "public"."phase_assignment_table" to "anon"; + +grant update on table "public"."phase_assignment_table" to "anon"; + +grant delete on table "public"."phase_assignment_table" to "authenticated"; + +grant insert on table "public"."phase_assignment_table" to "authenticated"; + +grant references on table "public"."phase_assignment_table" to "authenticated"; + +grant select on table "public"."phase_assignment_table" to "authenticated"; + +grant trigger on table "public"."phase_assignment_table" to "authenticated"; + +grant truncate on table "public"."phase_assignment_table" to "authenticated"; + +grant update on table "public"."phase_assignment_table" to "authenticated"; + +grant delete on table "public"."phase_assignment_table" to "service_role"; + +grant insert on table "public"."phase_assignment_table" to "service_role"; + +grant references on table "public"."phase_assignment_table" to "service_role"; + +grant select on table "public"."phase_assignment_table" to "service_role"; + +grant trigger on table "public"."phase_assignment_table" to "service_role"; + +grant truncate on table "public"."phase_assignment_table" to "service_role"; + +grant update on table "public"."phase_assignment_table" to "service_role"; + +grant delete on table "public"."phase_outcome_table" to "anon"; + +grant insert on table "public"."phase_outcome_table" to "anon"; + +grant references on table "public"."phase_outcome_table" to "anon"; + +grant select on table "public"."phase_outcome_table" to "anon"; + +grant trigger on table "public"."phase_outcome_table" to "anon"; + +grant truncate on table "public"."phase_outcome_table" to "anon"; + +grant update on table "public"."phase_outcome_table" to "anon"; + +grant delete on table "public"."phase_outcome_table" to "authenticated"; + +grant insert on table "public"."phase_outcome_table" to "authenticated"; + +grant references on table "public"."phase_outcome_table" to "authenticated"; + +grant select on table "public"."phase_outcome_table" to "authenticated"; + +grant trigger on table "public"."phase_outcome_table" to "authenticated"; + +grant truncate on table "public"."phase_outcome_table" to "authenticated"; + +grant update on table "public"."phase_outcome_table" to "authenticated"; + +grant delete on table "public"."phase_outcome_table" to "service_role"; + +grant insert on table "public"."phase_outcome_table" to "service_role"; + +grant references on table "public"."phase_outcome_table" to "service_role"; + +grant select on table "public"."phase_outcome_table" to "service_role"; + +grant trigger on table "public"."phase_outcome_table" to "service_role"; + +grant truncate on table "public"."phase_outcome_table" to "service_role"; + +grant update on table "public"."phase_outcome_table" to "service_role"; + +grant delete on table "public"."phase_table" to "anon"; + +grant insert on table "public"."phase_table" to "anon"; + +grant references on table "public"."phase_table" to "anon"; + +grant select on table "public"."phase_table" to "anon"; + +grant trigger on table "public"."phase_table" to "anon"; + +grant truncate on table "public"."phase_table" to "anon"; + +grant update on table "public"."phase_table" to "anon"; + +grant delete on table "public"."phase_table" to "authenticated"; + +grant insert on table "public"."phase_table" to "authenticated"; + +grant references on table "public"."phase_table" to "authenticated"; + +grant select on table "public"."phase_table" to "authenticated"; + +grant trigger on table "public"."phase_table" to "authenticated"; + +grant truncate on table "public"."phase_table" to "authenticated"; + +grant update on table "public"."phase_table" to "authenticated"; + +grant delete on table "public"."phase_table" to "service_role"; + +grant insert on table "public"."phase_table" to "service_role"; + +grant references on table "public"."phase_table" to "service_role"; + +grant select on table "public"."phase_table" to "service_role"; + +grant trigger on table "public"."phase_table" to "service_role"; + +grant truncate on table "public"."phase_table" to "service_role"; + +grant update on table "public"."phase_table" to "service_role"; + +grant delete on table "public"."question_table" to "anon"; + +grant insert on table "public"."question_table" to "anon"; + +grant references on table "public"."question_table" to "anon"; + +grant select on table "public"."question_table" to "anon"; + +grant trigger on table "public"."question_table" to "anon"; + +grant truncate on table "public"."question_table" to "anon"; + +grant update on table "public"."question_table" to "anon"; + +grant delete on table "public"."question_table" to "authenticated"; + +grant insert on table "public"."question_table" to "authenticated"; + +grant references on table "public"."question_table" to "authenticated"; + +grant select on table "public"."question_table" to "authenticated"; + +grant trigger on table "public"."question_table" to "authenticated"; + +grant truncate on table "public"."question_table" to "authenticated"; + +grant update on table "public"."question_table" to "authenticated"; + +grant delete on table "public"."question_table" to "service_role"; + +grant insert on table "public"."question_table" to "service_role"; + +grant references on table "public"."question_table" to "service_role"; + +grant select on table "public"."question_table" to "service_role"; + +grant trigger on table "public"."question_table" to "service_role"; + +grant truncate on table "public"."question_table" to "service_role"; + +grant update on table "public"."question_table" to "service_role"; + +grant delete on table "public"."sections_table" to "anon"; + +grant insert on table "public"."sections_table" to "anon"; + +grant references on table "public"."sections_table" to "anon"; + +grant select on table "public"."sections_table" to "anon"; + +grant trigger on table "public"."sections_table" to "anon"; + +grant truncate on table "public"."sections_table" to "anon"; + +grant update on table "public"."sections_table" to "anon"; + +grant delete on table "public"."sections_table" to "authenticated"; + +grant insert on table "public"."sections_table" to "authenticated"; + +grant references on table "public"."sections_table" to "authenticated"; + +grant select on table "public"."sections_table" to "authenticated"; + +grant trigger on table "public"."sections_table" to "authenticated"; + +grant truncate on table "public"."sections_table" to "authenticated"; + +grant update on table "public"."sections_table" to "authenticated"; + +grant delete on table "public"."sections_table" to "service_role"; + +grant insert on table "public"."sections_table" to "service_role"; + +grant references on table "public"."sections_table" to "service_role"; + +grant select on table "public"."sections_table" to "service_role"; + +grant trigger on table "public"."sections_table" to "service_role"; + +grant truncate on table "public"."sections_table" to "service_role"; + +grant update on table "public"."sections_table" to "service_role"; + +grant delete on table "public"."short_text_answer_table" to "anon"; + +grant insert on table "public"."short_text_answer_table" to "anon"; + +grant references on table "public"."short_text_answer_table" to "anon"; + +grant select on table "public"."short_text_answer_table" to "anon"; + +grant trigger on table "public"."short_text_answer_table" to "anon"; + +grant truncate on table "public"."short_text_answer_table" to "anon"; + +grant update on table "public"."short_text_answer_table" to "anon"; + +grant delete on table "public"."short_text_answer_table" to "authenticated"; + +grant insert on table "public"."short_text_answer_table" to "authenticated"; + +grant references on table "public"."short_text_answer_table" to "authenticated"; + +grant select on table "public"."short_text_answer_table" to "authenticated"; + +grant trigger on table "public"."short_text_answer_table" to "authenticated"; + +grant truncate on table "public"."short_text_answer_table" to "authenticated"; + +grant update on table "public"."short_text_answer_table" to "authenticated"; + +grant delete on table "public"."short_text_answer_table" to "service_role"; + +grant insert on table "public"."short_text_answer_table" to "service_role"; + +grant references on table "public"."short_text_answer_table" to "service_role"; + +grant select on table "public"."short_text_answer_table" to "service_role"; + +grant trigger on table "public"."short_text_answer_table" to "service_role"; + +grant truncate on table "public"."short_text_answer_table" to "service_role"; + +grant update on table "public"."short_text_answer_table" to "service_role"; + +grant delete on table "public"."short_text_question_table" to "anon"; + +grant insert on table "public"."short_text_question_table" to "anon"; + +grant references on table "public"."short_text_question_table" to "anon"; + +grant select on table "public"."short_text_question_table" to "anon"; + +grant trigger on table "public"."short_text_question_table" to "anon"; + +grant truncate on table "public"."short_text_question_table" to "anon"; + +grant update on table "public"."short_text_question_table" to "anon"; + +grant delete on table "public"."short_text_question_table" to "authenticated"; + +grant insert on table "public"."short_text_question_table" to "authenticated"; + +grant references on table "public"."short_text_question_table" to "authenticated"; + +grant select on table "public"."short_text_question_table" to "authenticated"; + +grant trigger on table "public"."short_text_question_table" to "authenticated"; + +grant truncate on table "public"."short_text_question_table" to "authenticated"; + +grant update on table "public"."short_text_question_table" to "authenticated"; + +grant delete on table "public"."short_text_question_table" to "service_role"; + +grant insert on table "public"."short_text_question_table" to "service_role"; + +grant references on table "public"."short_text_question_table" to "service_role"; + +grant select on table "public"."short_text_question_table" to "service_role"; + +grant trigger on table "public"."short_text_question_table" to "service_role"; + +grant truncate on table "public"."short_text_question_table" to "service_role"; + +grant update on table "public"."short_text_question_table" to "service_role"; + +grant delete on table "public"."user_profiles_table" to "anon"; + +grant insert on table "public"."user_profiles_table" to "anon"; + +grant references on table "public"."user_profiles_table" to "anon"; + +grant select on table "public"."user_profiles_table" to "anon"; + +grant trigger on table "public"."user_profiles_table" to "anon"; + +grant truncate on table "public"."user_profiles_table" to "anon"; + +grant update on table "public"."user_profiles_table" to "anon"; + +grant delete on table "public"."user_profiles_table" to "authenticated"; + +grant insert on table "public"."user_profiles_table" to "authenticated"; + +grant references on table "public"."user_profiles_table" to "authenticated"; + +grant select on table "public"."user_profiles_table" to "authenticated"; + +grant trigger on table "public"."user_profiles_table" to "authenticated"; + +grant truncate on table "public"."user_profiles_table" to "authenticated"; + +grant update on table "public"."user_profiles_table" to "authenticated"; + +grant delete on table "public"."user_profiles_table" to "service_role"; + +grant insert on table "public"."user_profiles_table" to "service_role"; + +grant references on table "public"."user_profiles_table" to "service_role"; + +grant select on table "public"."user_profiles_table" to "service_role"; + +grant trigger on table "public"."user_profiles_table" to "service_role"; + +grant truncate on table "public"."user_profiles_table" to "service_role"; + +grant update on table "public"."user_profiles_table" to "service_role"; + +grant delete on table "public"."user_roles_table" to "anon"; + +grant insert on table "public"."user_roles_table" to "anon"; + +grant references on table "public"."user_roles_table" to "anon"; + +grant select on table "public"."user_roles_table" to "anon"; + +grant trigger on table "public"."user_roles_table" to "anon"; + +grant truncate on table "public"."user_roles_table" to "anon"; + +grant update on table "public"."user_roles_table" to "anon"; + +grant delete on table "public"."user_roles_table" to "authenticated"; + +grant insert on table "public"."user_roles_table" to "authenticated"; + +grant references on table "public"."user_roles_table" to "authenticated"; + +grant select on table "public"."user_roles_table" to "authenticated"; + +grant trigger on table "public"."user_roles_table" to "authenticated"; + +grant truncate on table "public"."user_roles_table" to "authenticated"; + +grant update on table "public"."user_roles_table" to "authenticated"; + +grant delete on table "public"."user_roles_table" to "service_role"; + +grant insert on table "public"."user_roles_table" to "service_role"; + +grant references on table "public"."user_roles_table" to "service_role"; + +grant select on table "public"."user_roles_table" to "service_role"; + +grant trigger on table "public"."user_roles_table" to "service_role"; + +grant truncate on table "public"."user_roles_table" to "service_role"; + +grant update on table "public"."user_roles_table" to "service_role"; + +grant delete on table "public"."video_upload_answer_table" to "anon"; + +grant insert on table "public"."video_upload_answer_table" to "anon"; + +grant references on table "public"."video_upload_answer_table" to "anon"; + +grant select on table "public"."video_upload_answer_table" to "anon"; + +grant trigger on table "public"."video_upload_answer_table" to "anon"; + +grant truncate on table "public"."video_upload_answer_table" to "anon"; + +grant update on table "public"."video_upload_answer_table" to "anon"; + +grant delete on table "public"."video_upload_answer_table" to "authenticated"; + +grant insert on table "public"."video_upload_answer_table" to "authenticated"; + +grant references on table "public"."video_upload_answer_table" to "authenticated"; + +grant select on table "public"."video_upload_answer_table" to "authenticated"; + +grant trigger on table "public"."video_upload_answer_table" to "authenticated"; + +grant truncate on table "public"."video_upload_answer_table" to "authenticated"; + +grant update on table "public"."video_upload_answer_table" to "authenticated"; + +grant delete on table "public"."video_upload_answer_table" to "service_role"; + +grant insert on table "public"."video_upload_answer_table" to "service_role"; + +grant references on table "public"."video_upload_answer_table" to "service_role"; + +grant select on table "public"."video_upload_answer_table" to "service_role"; + +grant trigger on table "public"."video_upload_answer_table" to "service_role"; + +grant truncate on table "public"."video_upload_answer_table" to "service_role"; + +grant update on table "public"."video_upload_answer_table" to "service_role"; + +grant delete on table "public"."video_upload_question_table" to "anon"; + +grant insert on table "public"."video_upload_question_table" to "anon"; + +grant references on table "public"."video_upload_question_table" to "anon"; + +grant select on table "public"."video_upload_question_table" to "anon"; + +grant trigger on table "public"."video_upload_question_table" to "anon"; + +grant truncate on table "public"."video_upload_question_table" to "anon"; + +grant update on table "public"."video_upload_question_table" to "anon"; + +grant delete on table "public"."video_upload_question_table" to "authenticated"; + +grant insert on table "public"."video_upload_question_table" to "authenticated"; + +grant references on table "public"."video_upload_question_table" to "authenticated"; + +grant select on table "public"."video_upload_question_table" to "authenticated"; + +grant trigger on table "public"."video_upload_question_table" to "authenticated"; + +grant truncate on table "public"."video_upload_question_table" to "authenticated"; + +grant update on table "public"."video_upload_question_table" to "authenticated"; + +grant delete on table "public"."video_upload_question_table" to "service_role"; + +grant insert on table "public"."video_upload_question_table" to "service_role"; + +grant references on table "public"."video_upload_question_table" to "service_role"; + +grant select on table "public"."video_upload_question_table" to "service_role"; + +grant trigger on table "public"."video_upload_question_table" to "service_role"; + +grant truncate on table "public"."video_upload_question_table" to "service_role"; + +grant update on table "public"."video_upload_question_table" to "service_role"; + +create policy "admin_cmd_answer_table" +on "public"."answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_answer" +on "public"."answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM application_table + WHERE ((application_table.applicationid = answer_table.applicationid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_answer" +on "public"."answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM application_table + WHERE ((application_table.applicationid = answer_table.applicationid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_answer" +on "public"."answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM application_table + WHERE ((application_table.applicationid = answer_table.applicationid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_answer_table" +on "public"."answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN question_table qt ON ((answer_table.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + JOIN application_table at ON ((answer_table.applicationid = at.applicationid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.userid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_answer" +on "public"."answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM application_table + WHERE ((application_table.applicationid = answer_table.applicationid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_application_table" +on "public"."application_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_application" +on "public"."application_table" +as permissive +for delete +to public +using ((userid = auth.uid())); + + +create policy "insert_application" +on "public"."application_table" +as permissive +for insert +to public +with check ((userid = auth.uid())); + + +create policy "select_application" +on "public"."application_table" +as permissive +for select +to public +using ((userid = auth.uid())); + + +create policy "select_reviewer_application_table" +on "public"."application_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "update_application" +on "public"."application_table" +as permissive +for update +to public +with check ((userid = auth.uid())); + + +create policy "delete_checkbox_answer" +on "public"."checkbox_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = checkbox_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_checkbox_answer" +on "public"."checkbox_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = checkbox_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_checkbox_answer" +on "public"."checkbox_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = checkbox_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "update_checkbox_answer" +on "public"."checkbox_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = checkbox_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_policy" +on "public"."checkbox_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "delete_conditional_answer" +on "public"."conditional_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = conditional_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_conditional_answer" +on "public"."conditional_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = conditional_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_conditional_answer" +on "public"."conditional_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = conditional_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "update_conditional_answer" +on "public"."conditional_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = conditional_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "conditional_question_choice_table" +on "public"."conditional_question_choice_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."conditional_question_choice_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_conditional_question_choice_table" +on "public"."conditional_question_choice_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_date_picker_answer_table" +on "public"."date_picker_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_date_picker_answer" +on "public"."date_picker_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = date_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_date_picker_answer" +on "public"."date_picker_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = date_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_date_picker_answer" +on "public"."date_picker_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = date_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_date_picker_answer_table" +on "public"."date_picker_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((date_picker_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_date_picker_answer" +on "public"."date_picker_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = date_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_date_picker_question_table" +on "public"."date_picker_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."date_picker_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_date_picker_question_table" +on "public"."date_picker_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_datetime_picker_answer_table" +on "public"."datetime_picker_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_datetime_picker_answer" +on "public"."datetime_picker_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = datetime_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_datetime_picker_answer" +on "public"."datetime_picker_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = datetime_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_datetime_picker_answer" +on "public"."datetime_picker_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = datetime_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_datetime_picker_answer_table" +on "public"."datetime_picker_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((datetime_picker_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_datetime_picker_answer" +on "public"."datetime_picker_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = datetime_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_datetime_picker_question_table" +on "public"."datetime_picker_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."datetime_picker_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_datetime_picker_question_table" +on "public"."datetime_picker_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_dropdown_answer_table" +on "public"."dropdown_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_dropdown_answer" +on "public"."dropdown_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = dropdown_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_dropdown_answer" +on "public"."dropdown_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = dropdown_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_dropdown_answer" +on "public"."dropdown_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = dropdown_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_dropdown_answer_table" +on "public"."dropdown_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((dropdown_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_dropdown_answer" +on "public"."dropdown_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = dropdown_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_dropdown_question_option_table" +on "public"."dropdown_question_option_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."dropdown_question_option_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_dropdown_question_option_table" +on "public"."dropdown_question_option_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_dropdown_question_table" +on "public"."dropdown_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."dropdown_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_dropdown_question_table" +on "public"."dropdown_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_image_upload_answer_table" +on "public"."image_upload_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_image_upload_answer" +on "public"."image_upload_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = image_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_image_upload_answer" +on "public"."image_upload_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = image_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_image_upload_answer" +on "public"."image_upload_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = image_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_image_upload_answer_table" +on "public"."image_upload_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((image_upload_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_image_upload_answer" +on "public"."image_upload_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = image_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_image_upload_question_table" +on "public"."image_upload_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."image_upload_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_image_upload_question_table" +on "public"."image_upload_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_long_text_answer_table" +on "public"."long_text_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_long_text_answer" +on "public"."long_text_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = long_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_long_text_answer" +on "public"."long_text_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = long_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_long_text_answer" +on "public"."long_text_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = long_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_long_text_answer_table" +on "public"."long_text_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((long_text_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_long_text_answer" +on "public"."long_text_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = long_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_long_text_question_table" +on "public"."long_text_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."long_text_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_long_text_question_table" +on "public"."long_text_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_multiple_choice_answer_table" +on "public"."multiple_choice_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_multiple_choice_answer" +on "public"."multiple_choice_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = multiple_choice_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_multiple_choice_answer" +on "public"."multiple_choice_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = multiple_choice_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_multiple_choice_answer" +on "public"."multiple_choice_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = multiple_choice_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_multiple_choice_answer_table" +on "public"."multiple_choice_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((multiple_choice_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_multiple_choice_answer" +on "public"."multiple_choice_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = multiple_choice_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_multiple_choice_question_choice_table" +on "public"."multiple_choice_question_choice_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."multiple_choice_question_choice_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_multiple_choice_question_choice_table" +on "public"."multiple_choice_question_choice_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_multiple_choice_question_table" +on "public"."multiple_choice_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."multiple_choice_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_multiple_choice_question_table" +on "public"."multiple_choice_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_number_picker_answer_table" +on "public"."number_picker_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_number_picker_answer" +on "public"."number_picker_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = number_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_number_picker_answer" +on "public"."number_picker_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = number_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_number_picker_answer" +on "public"."number_picker_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = number_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_number_picker_answer_table" +on "public"."number_picker_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((number_picker_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_number_picker_answer" +on "public"."number_picker_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = number_picker_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_number_picker_question_table" +on "public"."number_picker_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."number_picker_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_number_picker_question_table" +on "public"."number_picker_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_pdf_upload_answer_table" +on "public"."pdf_upload_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_pdf_upload_answer" +on "public"."pdf_upload_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = pdf_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_pdf_upload_answer" +on "public"."pdf_upload_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = pdf_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_pdf_upload_answer" +on "public"."pdf_upload_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = pdf_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_pdf_upload_answer_table" +on "public"."pdf_upload_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((pdf_upload_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "update_pdf_upload_answer" +on "public"."pdf_upload_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = pdf_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_pdf_upload_question_table" +on "public"."pdf_upload_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."pdf_upload_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_pdf_upload_question_table" +on "public"."pdf_upload_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "select_policy" +on "public"."phase_outcome_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "admin_cmd_phase_table" +on "public"."phase_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."phase_table" +as permissive +for select +to public +using (true); + + +create policy "admin_cmd_question_table" +on "public"."question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_question_table" +on "public"."question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "select_policy" +on "public"."sections_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "admin_cmd_short_text_answer_table" +on "public"."short_text_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_short_text_answer" +on "public"."short_text_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = short_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_short_text_answer" +on "public"."short_text_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = short_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_short_text_answer_table" +on "public"."short_text_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((short_text_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "select_short_text_answer" +on "public"."short_text_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = short_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "update_short_text_answer" +on "public"."short_text_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = short_text_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_short_text_question_table" +on "public"."short_text_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."short_text_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_short_text_question_table" +on "public"."short_text_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "delete_profile" +on "public"."user_profiles_table" +as permissive +for delete +to public +using ((userid = auth.uid())); + + +create policy "insert_profile" +on "public"."user_profiles_table" +as permissive +for insert +to public +with check ((userid = auth.uid())); + + +create policy "select_profile" +on "public"."user_profiles_table" +as permissive +for select +to public +using ((userid = auth.uid())); + + +create policy "update_profile" +on "public"."user_profiles_table" +as permissive +for update +to public +with check ((userid = auth.uid())); + + +create policy "admin_cmd_user_roles_table" +on "public"."user_roles_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."user_roles_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_user_roles_table" +on "public"."user_roles_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + +create policy "admin_cmd_video_upload_answer_table" +on "public"."video_upload_answer_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "delete_video_upload_answer" +on "public"."video_upload_answer_table" +as permissive +for delete +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = video_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "insert_video_upload_answer" +on "public"."video_upload_answer_table" +as permissive +for insert +to authenticated +with check ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = video_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "select_reviewer_video_upload_answer_table" +on "public"."video_upload_answer_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM ((((user_profiles_table up + JOIN phase_assignment_table pat ON ((up.userid = pat.user_role_2_id))) + JOIN answer_table at ON ((video_upload_answer_table.answerid = at.answerid))) + JOIN question_table qt ON ((at.questionid = qt.questionid))) + JOIN phase_table pt ON ((qt.phaseid = pt.phaseid))) + WHERE ((up.userid = auth.uid()) AND (up.userrole = 2) AND (pt.phaseid = pat.phase_id) AND (EXISTS ( SELECT 1 + FROM user_profiles_table up1 + WHERE ((up1.userid = at.applicationid) AND (up1.userrole = 1) AND (pat.user_role_1_id = up1.userid)))))))); + + +create policy "select_video_upload_answer" +on "public"."video_upload_answer_table" +as permissive +for select +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = video_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "update_video_upload_answer" +on "public"."video_upload_answer_table" +as permissive +for update +to authenticated +using ((EXISTS ( SELECT 1 + FROM (answer_table + JOIN application_table ON ((application_table.applicationid = answer_table.applicationid))) + WHERE ((answer_table.answerid = video_upload_answer_table.answerid) AND (application_table.userid = auth.uid()))))); + + +create policy "admin_cmd_video_upload_question_table" +on "public"."video_upload_question_table" +as permissive +for all +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 3))))); + + +create policy "select_policy" +on "public"."video_upload_question_table" +as permissive +for select +to public +using ((auth.uid() IS NOT NULL)); + + +create policy "select_reviewer_video_upload_question_table" +on "public"."video_upload_question_table" +as permissive +for select +to public +using ((EXISTS ( SELECT 1 + FROM user_profiles_table + WHERE ((user_profiles_table.userid = auth.uid()) AND (user_profiles_table.userrole = 2))))); + + + diff --git a/supabase/migrations/20250524095918_add-storage-policies.sql b/supabase/migrations/20250524095918_add-storage-policies.sql new file mode 100644 index 00000000..cb3cd6ae --- /dev/null +++ b/supabase/migrations/20250524095918_add-storage-policies.sql @@ -0,0 +1,19 @@ +create policy "all_cmds" +on "storage"."buckets" +as permissive +for all +to authenticated +using ((auth.uid() = owner)) +with check ((auth.uid() = owner)); + + +create policy "all_cmds" +on "storage"."objects" +as permissive +for all +to authenticated +using ((auth.uid() = owner)) +with check ((auth.uid() = owner)); + + + diff --git a/supabase/seed.sql b/supabase/seed.sql new file mode 100644 index 00000000..5650862a --- /dev/null +++ b/supabase/seed.sql @@ -0,0 +1 @@ +INSERT INTO "user_roles_table" (userroleid, userrolename) VALUES (1, 'applicant'), (2, 'reviewer'), (3, 'admin'); \ No newline at end of file diff --git a/supabase/tests/database/hello_world.test.sql b/supabase/tests/database/hello_world.test.sql new file mode 100644 index 00000000..3148178e --- /dev/null +++ b/supabase/tests/database/hello_world.test.sql @@ -0,0 +1,12 @@ +begin; +select plan(1); + +SELECT has_column( + 'auth', + 'users', + 'id', + 'id should exist' +); + +select * from finish(); +rollback;