From bb2833e05e7af8c87547db8096d61a4cf3891030 Mon Sep 17 00:00:00 2001 From: Mike Sears Date: Fri, 26 Jan 2024 15:12:21 -0800 Subject: [PATCH 1/4] updated database docker config, created new database tables, and inserted data --- docker-compose.yml | 11 +- migrations/sql/V1.1.0__CE-39.sql | 253 +++++++++++++++++++++++++++++++ 2 files changed, 260 insertions(+), 4 deletions(-) create mode 100644 migrations/sql/V1.1.0__CE-39.sql diff --git a/docker-compose.yml b/docker-compose.yml index dd4fef3b..e707b3c2 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,16 +26,19 @@ services: ports: ["5433:5432"] migrations: - image: flyway/flyway:9-alpine - container_name: migrations - command: info migrate info + image: flyway/flyway:9.22-alpine + container_name: case-management-migrations + command: + - info + - migrate + - -outOfOrder=true volumes: ["./migrations/sql:/flyway/sql:ro"] environment: FLYWAY_URL: jdbc:postgresql://database:5432/postgres FLYWAY_USER: *POSTGRES_USER FLYWAY_PASSWORD: *POSTGRES_PASSWORD FLYWAY_BASELINE_ON_MIGRATE: true - FLYWAY_DEFAULT_SCHEMA: USERS + FLYWAY_DEFAULT_SCHEMA: public depends_on: database: condition: service_healthy diff --git a/migrations/sql/V1.1.0__CE-39.sql b/migrations/sql/V1.1.0__CE-39.sql new file mode 100644 index 00000000..817b7de9 --- /dev/null +++ b/migrations/sql/V1.1.0__CE-39.sql @@ -0,0 +1,253 @@ +-- +-- CREATE TABLE sex_code +-- +CREATE TABLE + public.sex_code ( + sex_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_sexcode" PRIMARY KEY (sex_code) + ); + +-- +-- CREATE TABLE age_code +-- +CREATE TABLE + public.age_code ( + age_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_agecode" PRIMARY KEY (age_code) + ); + +-- +-- CREATE TABLE threat_level_code +-- +CREATE TABLE + public.threat_level_code ( + threat_level_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_thrtlvlcd" PRIMARY KEY (threat_level_code) + ); + +-- +-- CREATE TABLE conflict_history_code +-- +CREATE TABLE + public.conflict_history_code ( + conflict_history_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_cnfthistcd" PRIMARY KEY (conflict_history_code) + ); + +-- +-- CREATE TABLE ear_code +-- +CREATE TABLE + public.ear_code ( + ear_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_earcode" PRIMARY KEY (ear_code) + ); + +-- +-- CREATE TABLE drug_code +-- +CREATE TABLE + public.drug_code ( + drug_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_drugcode" PRIMARY KEY (drug_code) + ); + +-- +-- CREATE TABLE drug_method_code +-- +CREATE TABLE + public.drug_method_code ( + drug_method_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_drgmethdcd" PRIMARY KEY (drug_method_code) + ); + +-- +-- CREATE TABLE drug_remaining_outcome_code +-- +CREATE TABLE + public.drug_remaining_outcome_code ( + drug_remaining_outcome_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_drgrmotccd" PRIMARY KEY (drug_remaining_outcome_code) + ); + +-- +-- CREATE TABLE hwcr_outcome_code +-- +CREATE TABLE + public.hwcr_outcome_code ( + hwcr_outcome_code varchar(10) NOT NULL, + short_description varchar(50) NOT NULL, + long_description varchar(250) NULL, + display_order int4 NOT NULL, + active_ind bool NOT NULL, + create_user_id varchar(32) NOT NULL, + create_user_guid uuid NULL, + create_timestamp timestamp NOT NULL, + update_user_id varchar(32) NOT NULL, + update_user_guid uuid NULL, + update_timestamp timestamp NOT NULL, + CONSTRAINT "PK_hwcrotcmcd" PRIMARY KEY (hwcr_outcome_code) + ); + +-- +-- INSERT INTO sex_code +-- +insert into sex_code (sex_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('M', 'Male', 'Male', 1, true, user, null, now(), user, null, now()), + ('F', 'Female', 'Female', 2, true, user, null, now(), user, null, now()), + ('U', 'Unknown', 'Unknown', 3, true, user, null, now(), user, null, now()); + + +-- +-- INSERT INTO age_code +-- +insert into age_code (age_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('ADLT', 'Adult', 'Adult', 1, true, user, null, now(), user, null, now()), + ('YRLN', 'Yearling', 'Yearling', 2, true, user, null, now(), user, null, now()), + ('YOFY', 'Young of the year', 'Young of the year', 3, true, user, null, now(), user, null, now()), + ('UNKN', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO threat_level_code +-- +insert into threat_level_code (threat_level_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('1', 'Category 1', 'Category 1', 1, true, user, null, now(), user, null, now()), + ('2', 'Category 2', 'Category 2', 2, true, user, null, now(), user, null, now()), + ('3', 'Category 3', 'Category 3', 3, true, user, null, now(), user, null, now()), + ('U', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO conflict_history_code +-- +insert into conflict_history_code (conflict_history_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('L', 'Low', 'Low', 1, true, user, null, now(), user, null, now()), + ('M', 'Medium', 'Medium', 2, true, user, null, now(), user, null, now()), + ('H', 'High', 'High', 3, true, user, null, now(), user, null, now()), + ('U', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO ear_code +-- +insert into ear_code (ear_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('L', 'Left', 'Left', 1, true, user, null, now(), user, null, now()), + ('R', 'Right', 'Right', 2, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO drug_code +-- +insert into drug_code (drug_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('ATPMZ', 'Atipamezole', 'Atipamezole', 1, true, user, null, now(), user, null, now()), + ('BAMII', 'BAM II', 'Butorphanol Azaperone Medetomidine', 2, true, user, null, now(), user, null, now()), + ('MDTMD', 'Medetomidine', 'Medetomidine', 3, true, user, null, now(), user, null, now()), + ('NLTRX', 'Naltrexone', 'Naltrexone', 4, true, user, null, now(), user, null, now()), + ('ZLTIL', 'Zoletil', 'Zoletil', 5, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO drug_method_code +-- +insert into drug_method_code (drug_method_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('DART', 'Dart', 'Dart', 1, true, user, null, now(), user, null, now()), + ('HINJ', 'Hand injection', 'Hand injection', 2, true, user, null, now(), user, null, now()), + ('PSRG', 'Pole syringe', 'Pole syringe', 3, true, user, null, now(), user, null, now()); + +-- +-- INSERT INTO drug_remaining_outcome_code +-- +insert into drug_remaining_outcome_code (drug_remaining_outcome_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('DISC', 'Male', 'Male', 1, true, user, null, now(), user, null, now()), + ('STOR', 'Female', 'Female', 2, true, user, null, now(), user, null, now()), + ('RDIS', 'Unknown', 'Unknown', 3, true, user, null, now(), user, null, now()); + + +-- +-- INSERT INTO hwcr_outcome_code +-- +insert into hwcr_outcome_code (hwcr_outcome_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) +values('DEADONARR', 'Dead on arrival', '', 1, true, user, null, now(), user, null, now()), + ('DESTRYCOS', 'Destroyed by COS', '', 2, true, user, null, now(), user, null, now()), + ('DESTRYOTH', 'Destroyed by other', '', 3, true, user, null, now(), user, null, now()), + ('GONEONARR', 'Gone on arrival', '', 4, true, user, null, now(), user, null, now()), + ('REFRTOBIO', 'Referred to biologist', '', 5, true, user, null, now(), user, null, now()), + ('SHRTRELOC', 'Short-distance relocation', '', 6, true, user, null, now(), user, null, now()), + ('TRANSLCTD', 'Translocated', '', 7, true, user, null, now(), user, null, now()), + ('TRANSREHB', 'Transfer to rehab', '', 8, true, user, null, now(), user, null, now()); \ No newline at end of file From 186e2cce069fd67992ffe648869df71ad4ac6956 Mon Sep 17 00:00:00 2001 From: Mike Sears Date: Fri, 26 Jan 2024 15:16:51 -0800 Subject: [PATCH 2/4] undo undo --- docker-compose.yml | 11 +- migrations/sql/V1.1.0__CE-39.sql | 253 ------------------------------- 2 files changed, 4 insertions(+), 260 deletions(-) delete mode 100644 migrations/sql/V1.1.0__CE-39.sql diff --git a/docker-compose.yml b/docker-compose.yml index e707b3c2..dd4fef3b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -26,19 +26,16 @@ services: ports: ["5433:5432"] migrations: - image: flyway/flyway:9.22-alpine - container_name: case-management-migrations - command: - - info - - migrate - - -outOfOrder=true + image: flyway/flyway:9-alpine + container_name: migrations + command: info migrate info volumes: ["./migrations/sql:/flyway/sql:ro"] environment: FLYWAY_URL: jdbc:postgresql://database:5432/postgres FLYWAY_USER: *POSTGRES_USER FLYWAY_PASSWORD: *POSTGRES_PASSWORD FLYWAY_BASELINE_ON_MIGRATE: true - FLYWAY_DEFAULT_SCHEMA: public + FLYWAY_DEFAULT_SCHEMA: USERS depends_on: database: condition: service_healthy diff --git a/migrations/sql/V1.1.0__CE-39.sql b/migrations/sql/V1.1.0__CE-39.sql deleted file mode 100644 index 817b7de9..00000000 --- a/migrations/sql/V1.1.0__CE-39.sql +++ /dev/null @@ -1,253 +0,0 @@ --- --- CREATE TABLE sex_code --- -CREATE TABLE - public.sex_code ( - sex_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_sexcode" PRIMARY KEY (sex_code) - ); - --- --- CREATE TABLE age_code --- -CREATE TABLE - public.age_code ( - age_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_agecode" PRIMARY KEY (age_code) - ); - --- --- CREATE TABLE threat_level_code --- -CREATE TABLE - public.threat_level_code ( - threat_level_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_thrtlvlcd" PRIMARY KEY (threat_level_code) - ); - --- --- CREATE TABLE conflict_history_code --- -CREATE TABLE - public.conflict_history_code ( - conflict_history_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_cnfthistcd" PRIMARY KEY (conflict_history_code) - ); - --- --- CREATE TABLE ear_code --- -CREATE TABLE - public.ear_code ( - ear_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_earcode" PRIMARY KEY (ear_code) - ); - --- --- CREATE TABLE drug_code --- -CREATE TABLE - public.drug_code ( - drug_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_drugcode" PRIMARY KEY (drug_code) - ); - --- --- CREATE TABLE drug_method_code --- -CREATE TABLE - public.drug_method_code ( - drug_method_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_drgmethdcd" PRIMARY KEY (drug_method_code) - ); - --- --- CREATE TABLE drug_remaining_outcome_code --- -CREATE TABLE - public.drug_remaining_outcome_code ( - drug_remaining_outcome_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_drgrmotccd" PRIMARY KEY (drug_remaining_outcome_code) - ); - --- --- CREATE TABLE hwcr_outcome_code --- -CREATE TABLE - public.hwcr_outcome_code ( - hwcr_outcome_code varchar(10) NOT NULL, - short_description varchar(50) NOT NULL, - long_description varchar(250) NULL, - display_order int4 NOT NULL, - active_ind bool NOT NULL, - create_user_id varchar(32) NOT NULL, - create_user_guid uuid NULL, - create_timestamp timestamp NOT NULL, - update_user_id varchar(32) NOT NULL, - update_user_guid uuid NULL, - update_timestamp timestamp NOT NULL, - CONSTRAINT "PK_hwcrotcmcd" PRIMARY KEY (hwcr_outcome_code) - ); - --- --- INSERT INTO sex_code --- -insert into sex_code (sex_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('M', 'Male', 'Male', 1, true, user, null, now(), user, null, now()), - ('F', 'Female', 'Female', 2, true, user, null, now(), user, null, now()), - ('U', 'Unknown', 'Unknown', 3, true, user, null, now(), user, null, now()); - - --- --- INSERT INTO age_code --- -insert into age_code (age_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('ADLT', 'Adult', 'Adult', 1, true, user, null, now(), user, null, now()), - ('YRLN', 'Yearling', 'Yearling', 2, true, user, null, now(), user, null, now()), - ('YOFY', 'Young of the year', 'Young of the year', 3, true, user, null, now(), user, null, now()), - ('UNKN', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); - --- --- INSERT INTO threat_level_code --- -insert into threat_level_code (threat_level_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('1', 'Category 1', 'Category 1', 1, true, user, null, now(), user, null, now()), - ('2', 'Category 2', 'Category 2', 2, true, user, null, now(), user, null, now()), - ('3', 'Category 3', 'Category 3', 3, true, user, null, now(), user, null, now()), - ('U', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); - --- --- INSERT INTO conflict_history_code --- -insert into conflict_history_code (conflict_history_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('L', 'Low', 'Low', 1, true, user, null, now(), user, null, now()), - ('M', 'Medium', 'Medium', 2, true, user, null, now(), user, null, now()), - ('H', 'High', 'High', 3, true, user, null, now(), user, null, now()), - ('U', 'Unknown', 'Unknown', 4, true, user, null, now(), user, null, now()); - --- --- INSERT INTO ear_code --- -insert into ear_code (ear_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('L', 'Left', 'Left', 1, true, user, null, now(), user, null, now()), - ('R', 'Right', 'Right', 2, true, user, null, now(), user, null, now()); - --- --- INSERT INTO drug_code --- -insert into drug_code (drug_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('ATPMZ', 'Atipamezole', 'Atipamezole', 1, true, user, null, now(), user, null, now()), - ('BAMII', 'BAM II', 'Butorphanol Azaperone Medetomidine', 2, true, user, null, now(), user, null, now()), - ('MDTMD', 'Medetomidine', 'Medetomidine', 3, true, user, null, now(), user, null, now()), - ('NLTRX', 'Naltrexone', 'Naltrexone', 4, true, user, null, now(), user, null, now()), - ('ZLTIL', 'Zoletil', 'Zoletil', 5, true, user, null, now(), user, null, now()); - --- --- INSERT INTO drug_method_code --- -insert into drug_method_code (drug_method_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('DART', 'Dart', 'Dart', 1, true, user, null, now(), user, null, now()), - ('HINJ', 'Hand injection', 'Hand injection', 2, true, user, null, now(), user, null, now()), - ('PSRG', 'Pole syringe', 'Pole syringe', 3, true, user, null, now(), user, null, now()); - --- --- INSERT INTO drug_remaining_outcome_code --- -insert into drug_remaining_outcome_code (drug_remaining_outcome_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('DISC', 'Male', 'Male', 1, true, user, null, now(), user, null, now()), - ('STOR', 'Female', 'Female', 2, true, user, null, now(), user, null, now()), - ('RDIS', 'Unknown', 'Unknown', 3, true, user, null, now(), user, null, now()); - - --- --- INSERT INTO hwcr_outcome_code --- -insert into hwcr_outcome_code (hwcr_outcome_code, short_description, long_description, display_order, active_ind, create_user_id, create_user_guid, create_timestamp, update_user_id, update_user_guid, update_timestamp) -values('DEADONARR', 'Dead on arrival', '', 1, true, user, null, now(), user, null, now()), - ('DESTRYCOS', 'Destroyed by COS', '', 2, true, user, null, now(), user, null, now()), - ('DESTRYOTH', 'Destroyed by other', '', 3, true, user, null, now(), user, null, now()), - ('GONEONARR', 'Gone on arrival', '', 4, true, user, null, now(), user, null, now()), - ('REFRTOBIO', 'Referred to biologist', '', 5, true, user, null, now(), user, null, now()), - ('SHRTRELOC', 'Short-distance relocation', '', 6, true, user, null, now(), user, null, now()), - ('TRANSLCTD', 'Translocated', '', 7, true, user, null, now(), user, null, now()), - ('TRANSREHB', 'Transfer to rehab', '', 8, true, user, null, now(), user, null, now()); \ No newline at end of file From f8b5c8384a2936086ca0d1e9d64c50bb46ec0571 Mon Sep 17 00:00:00 2001 From: Barrett Falk Date: Mon, 29 Jan 2024 09:03:46 -0800 Subject: [PATCH 3/4] feat: Port updates - removing previous changes in main (#25) --- backend/Dockerfile | 4 +- backend/package-lock.json | 450 ++-------------------------------- backend/package.json | 8 +- backend/src/app.controller.ts | 8 +- backend/src/app.module.ts | 14 +- backend/src/main.ts | 2 +- docker-compose.yml | 23 +- frontend/Dockerfile | 25 -- 8 files changed, 33 insertions(+), 501 deletions(-) delete mode 100644 frontend/Dockerfile diff --git a/backend/Dockerfile b/backend/Dockerfile index 5c2b9819..a1108a50 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -20,8 +20,8 @@ COPY --from=build /app/node_modules ./node_modules COPY --from=build /app/dist ./dist # Ports, health check and non-root user -EXPOSE 3002 -HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3002/api || exit 1 +EXPOSE 3000 +HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3000/api || exit 1 USER app # Start up command with 50MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. diff --git a/backend/package-lock.json b/backend/package-lock.json index a53de9e7..4ae99454 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -1,12 +1,11 @@ { - "name": "app", + "name": "backend", "lockfileVersion": 3, "requires": true, "packages": { "": { "license": "Apache-2.0", "dependencies": { - "@apollo/server": "^4.10.0", "@nestjs/cli": "^10.1.16", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.0.0", @@ -17,7 +16,6 @@ "@nestjs/testing": "^10.0.0", "@nestjs/typeorm": "^10.0.0", "dotenv": "^16.0.1", - "graphql": "^16.8.1", "helmet": "^7.0.0", "nest-winston": "^1.9.4", "pg": "^8.11.3", @@ -185,247 +183,6 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, - "node_modules/@apollo/cache-control-types": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz", - "integrity": "sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==", - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/protobufjs": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", - "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/long": "^4.0.0", - "long": "^4.0.0" - }, - "bin": { - "apollo-pbjs": "bin/pbjs", - "apollo-pbts": "bin/pbts" - } - }, - "node_modules/@apollo/server": { - "version": "4.10.0", - "resolved": "https://registry.npmjs.org/@apollo/server/-/server-4.10.0.tgz", - "integrity": "sha512-pLx//lZ/pvUfWL9G8Np8+y3ujc0pYc8U7dwD6ztt9FAw8NmCPzPaDzlXLBAjGU6WnkqVBOnz8b3dOwRNjLYSUA==", - "dependencies": { - "@apollo/cache-control-types": "^1.0.3", - "@apollo/server-gateway-interface": "^1.1.1", - "@apollo/usage-reporting-protobuf": "^4.1.1", - "@apollo/utils.createhash": "^2.0.0", - "@apollo/utils.fetcher": "^2.0.0", - "@apollo/utils.isnodelike": "^2.0.0", - "@apollo/utils.keyvaluecache": "^2.1.0", - "@apollo/utils.logger": "^2.0.0", - "@apollo/utils.usagereporting": "^2.1.0", - "@apollo/utils.withrequired": "^2.0.0", - "@graphql-tools/schema": "^9.0.0", - "@josephg/resolvable": "^1.0.0", - "@types/express": "^4.17.13", - "@types/express-serve-static-core": "^4.17.30", - "@types/node-fetch": "^2.6.1", - "async-retry": "^1.2.1", - "cors": "^2.8.5", - "express": "^4.17.1", - "loglevel": "^1.6.8", - "lru-cache": "^7.10.1", - "negotiator": "^0.6.3", - "node-abort-controller": "^3.1.1", - "node-fetch": "^2.6.7", - "uuid": "^9.0.0", - "whatwg-mimetype": "^3.0.0" - }, - "engines": { - "node": ">=14.16.0" - }, - "peerDependencies": { - "graphql": "^16.6.0" - } - }, - "node_modules/@apollo/server-gateway-interface": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/@apollo/server-gateway-interface/-/server-gateway-interface-1.1.1.tgz", - "integrity": "sha512-pGwCl/po6+rxRmDMFgozKQo2pbsSwE91TpsDBAOgf74CRDPXHHtM88wbwjab0wMMZh95QfR45GGyDIdhY24bkQ==", - "dependencies": { - "@apollo/usage-reporting-protobuf": "^4.1.1", - "@apollo/utils.fetcher": "^2.0.0", - "@apollo/utils.keyvaluecache": "^2.1.0", - "@apollo/utils.logger": "^2.0.0" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/server/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@apollo/usage-reporting-protobuf": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", - "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", - "dependencies": { - "@apollo/protobufjs": "1.2.7" - } - }, - "node_modules/@apollo/utils.createhash": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.createhash/-/utils.createhash-2.0.1.tgz", - "integrity": "sha512-fQO4/ZOP8LcXWvMNhKiee+2KuKyqIcfHrICA+M4lj/h/Lh1H10ICcUtk6N/chnEo5HXu0yejg64wshdaiFitJg==", - "dependencies": { - "@apollo/utils.isnodelike": "^2.0.1", - "sha.js": "^2.4.11" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@apollo/utils.dropunuseddefinitions": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-2.0.1.tgz", - "integrity": "sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==", - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.fetcher": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.fetcher/-/utils.fetcher-2.0.1.tgz", - "integrity": "sha512-jvvon885hEyWXd4H6zpWeN3tl88QcWnHp5gWF5OPF34uhvoR+DFqcNxs9vrRaBBSY3qda3Qe0bdud7tz2zGx1A==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@apollo/utils.isnodelike": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.isnodelike/-/utils.isnodelike-2.0.1.tgz", - "integrity": "sha512-w41XyepR+jBEuVpoRM715N2ZD0xMD413UiJx8w5xnAZD2ZkSJnMJBoIzauK83kJpSgNuR6ywbV29jG9NmxjK0Q==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@apollo/utils.keyvaluecache": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-2.1.1.tgz", - "integrity": "sha512-qVo5PvUUMD8oB9oYvq4ViCjYAMWnZ5zZwEjNF37L2m1u528x5mueMlU+Cr1UinupCgdB78g+egA1G98rbJ03Vw==", - "dependencies": { - "@apollo/utils.logger": "^2.0.1", - "lru-cache": "^7.14.1" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/@apollo/utils.keyvaluecache/node_modules/lru-cache": { - "version": "7.18.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", - "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", - "engines": { - "node": ">=12" - } - }, - "node_modules/@apollo/utils.logger": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-2.0.1.tgz", - "integrity": "sha512-YuplwLHaHf1oviidB7MxnCXAdHp3IqYV8n0momZ3JfLniae92eYqMIx+j5qJFX6WKJPs6q7bczmV4lXIsTu5Pg==", - "engines": { - "node": ">=14" - } - }, - "node_modules/@apollo/utils.printwithreducedwhitespace": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-2.0.1.tgz", - "integrity": "sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==", - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.removealiases": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-2.0.1.tgz", - "integrity": "sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==", - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.sortast": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-2.0.1.tgz", - "integrity": "sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==", - "dependencies": { - "lodash.sortby": "^4.7.0" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.stripsensitiveliterals": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-2.0.1.tgz", - "integrity": "sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==", - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.usagereporting": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-2.1.0.tgz", - "integrity": "sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==", - "dependencies": { - "@apollo/usage-reporting-protobuf": "^4.1.0", - "@apollo/utils.dropunuseddefinitions": "^2.0.1", - "@apollo/utils.printwithreducedwhitespace": "^2.0.1", - "@apollo/utils.removealiases": "2.0.1", - "@apollo/utils.sortast": "^2.0.1", - "@apollo/utils.stripsensitiveliterals": "^2.0.1" - }, - "engines": { - "node": ">=14" - }, - "peerDependencies": { - "graphql": "14.x || 15.x || 16.x" - } - }, - "node_modules/@apollo/utils.withrequired": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/@apollo/utils.withrequired/-/utils.withrequired-2.0.1.tgz", - "integrity": "sha512-YBDiuAX9i1lLc6GeTy1m7DGLFn/gMnvXqlalOIMjM7DeOgIacEjjfwPqb0M1CQ2v11HhR15d1NmxJoRCfrNqcA==", - "engines": { - "node": ">=14" - } - }, "node_modules/@babel/code-frame": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", @@ -1188,52 +945,6 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, - "node_modules/@graphql-tools/merge": { - "version": "8.4.2", - "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", - "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", - "dependencies": { - "@graphql-tools/utils": "^9.2.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-tools/schema": { - "version": "9.0.19", - "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", - "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", - "dependencies": { - "@graphql-tools/merge": "^8.4.1", - "@graphql-tools/utils": "^9.2.1", - "tslib": "^2.4.0", - "value-or-promise": "^1.0.12" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-tools/utils": { - "version": "9.2.1", - "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", - "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", - "dependencies": { - "@graphql-typed-document-node/core": "^3.1.1", - "tslib": "^2.4.0" - }, - "peerDependencies": { - "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, - "node_modules/@graphql-typed-document-node/core": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", - "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", - "peerDependencies": { - "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" - } - }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -1762,11 +1473,6 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, - "node_modules/@josephg/resolvable": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", - "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" - }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -2250,60 +1956,6 @@ "url": "https://opencollective.com/unts" } }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -2402,6 +2054,7 @@ "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", + "dev": true, "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -2411,6 +2064,7 @@ "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", + "dev": true, "dependencies": { "@types/node": "*" } @@ -2448,6 +2102,7 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", + "dev": true, "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -2459,6 +2114,7 @@ "version": "4.17.41", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", + "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2478,7 +2134,8 @@ "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", + "dev": true }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -2525,15 +2182,11 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, - "node_modules/@types/long": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", - "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" - }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", + "dev": true }, "node_modules/@types/node": { "version": "20.10.3", @@ -2543,24 +2196,17 @@ "undici-types": "~5.26.4" } }, - "node_modules/@types/node-fetch": { - "version": "2.6.10", - "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.10.tgz", - "integrity": "sha512-PPpPK6F9ALFTn59Ka3BaL+qGuipRfxNE8qVgkp0bVixeiR2c2/L+IVOiBdu9JhhT22sWnQEp6YyHGI2b2+CMcA==", - "dependencies": { - "@types/node": "*", - "form-data": "^4.0.0" - } - }, "node_modules/@types/qs": { "version": "6.9.10", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", - "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", + "dev": true }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", + "dev": true }, "node_modules/@types/semver": { "version": "7.5.6", @@ -2572,6 +2218,7 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", + "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -2581,6 +2228,7 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", + "dev": true, "dependencies": { "@types/http-errors": "*", "@types/mime": "*", @@ -3282,18 +2930,11 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, - "node_modules/async-retry": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", - "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", - "dependencies": { - "retry": "0.13.1" - } - }, "node_modules/asynckit": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", - "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "dev": true }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -4133,6 +3774,7 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -4594,6 +4236,7 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "dev": true, "engines": { "node": ">=0.4.0" } @@ -5924,6 +5567,7 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -6259,14 +5903,6 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, - "node_modules/graphql": { - "version": "16.8.1", - "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", - "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", - "engines": { - "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" - } - }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -8124,11 +7760,6 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, - "node_modules/lodash.sortby": { - "version": "4.7.0", - "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", - "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" - }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -8361,23 +7992,6 @@ "node": ">=0.1.90" } }, - "node_modules/loglevel": { - "version": "1.8.1", - "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.8.1.tgz", - "integrity": "sha512-tCRIJM51SHjAayKwC+QAg8hT8vg6z7GSgLJKGvzuPb1Wc+hLzqtuVLxp6/HzSPOozuK+8ErAhy7U/sVzw8Dgfg==", - "engines": { - "node": ">= 0.6.0" - }, - "funding": { - "type": "tidelift", - "url": "https://tidelift.com/funding/github/npm/loglevel" - } - }, - "node_modules/long": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", - "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" - }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -9699,14 +9313,6 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, - "node_modules/retry": { - "version": "0.13.1", - "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", - "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", - "engines": { - "node": ">= 4" - } - }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", @@ -11385,14 +10991,6 @@ "node": ">=10.12.0" } }, - "node_modules/value-or-promise": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", - "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", - "engines": { - "node": ">=12" - } - }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -11517,14 +11115,6 @@ "node": ">=4.0" } }, - "node_modules/whatwg-mimetype": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", - "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", - "engines": { - "node": ">=12" - } - }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", diff --git a/backend/package.json b/backend/package.json index a254c2bf..8365a024 100644 --- a/backend/package.json +++ b/backend/package.json @@ -21,7 +21,6 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { - "@apollo/server": "^4.10.0", "@nestjs/cli": "^10.1.16", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.0.0", @@ -32,16 +31,15 @@ "@nestjs/testing": "^10.0.0", "@nestjs/typeorm": "^10.0.0", "dotenv": "^16.0.1", - "graphql": "^16.8.1", - "helmet": "^7.0.0", - "nest-winston": "^1.9.4", "pg": "^8.11.3", "reflect-metadata": "^0.1.13", "rimraf": "^5.0.0", "rxjs": "^7.8.0", "swagger-ui-express": "^5.0.0", "typeorm": "^0.3.17", - "winston": "^3.11.0" + "winston": "^3.11.0", + "nest-winston": "^1.9.4", + "helmet": "^7.0.0" }, "devDependencies": { "@types/express": "^4.17.15", diff --git a/backend/src/app.controller.ts b/backend/src/app.controller.ts index f1a0e53f..cce879ee 100644 --- a/backend/src/app.controller.ts +++ b/backend/src/app.controller.ts @@ -1,16 +1,12 @@ import { Controller, Get } from '@nestjs/common'; import { AppService } from './app.service'; -@Controller({ - path: "", - version: "1", -}) +@Controller() export class AppController { constructor(private readonly appService: AppService) {} - @Get('/get-hello') + @Get() getHello(): string { - console.log("in get-hello"); return this.appService.getHello(); } } diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index eb46c317..ec261baf 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -7,26 +7,16 @@ import {AppService} from "./app.service"; import {UsersModule} from "./users/users.module"; import { HTTPLoggerMiddleware } from './middleware/req.res.logger'; -console.log("Var check - POSTGRESQL_HOST", process.env.POSTGRESQL_HOST); -console.log("Var check - POSTGRESQL_DATABASE", process.env.POSTGRESQL_DATABASE); -console.log("Var check - POSTGRESQL_USER", process.env.POSTGRESQL_USER); -console.log("Var check - POSTGRESQL_ENABLE_LOGGING", process.env.POSTGRESQL_ENABLE_LOGGING); -if (process.env.POSTGRESQL_PASSWORD != null) { - console.log("Var check - POSTGRESQL_PASSWORD present", process.env.POSTGRESQL_PASSWORD); -} else { - console.log("Var check - POSTGRESQL_PASSWORD not present", process.env.POSTGRESQL_PASSWORD); -} - @Module({ imports: [ ConfigModule.forRoot(), TypeOrmModule.forRoot({ type: "postgres", - host: process.env.POSTGRES_HOST || "database", + host: process.env.POSTGRES_HOST || "127.0.0.1", port: 5432, database: process.env.POSTGRES_DATABASE || "postgres", username: process.env.POSTGRES_USER || "postgres", - password: process.env.POSTGRES_PASSWORD || "default", // helps in UT and e2e testing + password: process.env.POSTGRES_PASSWORD || "postgres", // helps in UT and e2e testing // entities: [User], autoLoadEntities: true, // Auto load all entities regiestered by typeorm forFeature method. schema: "users", diff --git a/backend/src/main.ts b/backend/src/main.ts index 981ee9ad..900459c5 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -4,7 +4,7 @@ import {Logger} from "@nestjs/common"; const logger = new Logger('NestApplication'); bootstrap().then(async (app: NestExpressApplication) => { - await app.listen(3002); + await app.listen(3000); logger.log(`Listening on ${await app.getUrl()}`); }).catch(err=>{ logger.error(err); diff --git a/docker-compose.yml b/docker-compose.yml index dd4fef3b..e8f3159d 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ x-postgres-vars: &postgres-vars services: database: image: postgres:15 - container_name: case-management-database + container_name: database environment: <<: *postgres-vars healthcheck: @@ -41,7 +41,7 @@ services: condition: service_healthy backend: - container_name: case-management-backend + container_name: backend entrypoint: sh -c "npm i && npm run start:dev" environment: <<: *postgres-vars @@ -50,25 +50,8 @@ services: ports: ["3002:3000"] volumes: ["./backend:/app", "/app/node_modules"] healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3002/api"] + test: ["CMD", "curl", "-f", "http://localhost:3000/api"] working_dir: "/app" depends_on: migrations: condition: service_started - - caddy: - container_name: caddy - profiles: ["caddy"] - build: ./frontend - environment: - NODE_ENV: development - PORT: 3000 - BACKEND_URL: http://backend:3002 - LOG_LEVEL: info - ports: ["3005:3000"] - volumes: ["./frontend/Caddyfile:/etc/caddy/Caddyfile"] - healthcheck: - test: ["CMD", "curl", "-f", "http://localhost:3000"] - depends_on: - backend: - condition: service_healthy diff --git a/frontend/Dockerfile b/frontend/Dockerfile deleted file mode 100644 index 0d7645ab..00000000 --- a/frontend/Dockerfile +++ /dev/null @@ -1,25 +0,0 @@ -# Build static files -# Node Bullseye has npm -FROM node:20.10.0-bullseye-slim AS build - -# Install packages, build and keep only prod packages -WORKDIR /app -COPY *.json *.ts index.html ./ -COPY ./src ./src -RUN npm ci --ignore-scripts --no-update-notifier --omit=dev && \ - npm run build - -# Deploy container -# Caddy serves static files -FROM caddy:2.7.5-alpine -RUN apk add --no-cache ca-certificates - -# Copy static files and run formatting -COPY --from=build /app/dist /srv -COPY Caddyfile /etc/caddy/Caddyfile -RUN caddy fmt --overwrite /etc/caddy/Caddyfile - -# Ports, health check and non-root user -EXPOSE 3000 3002 -HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3002/health -USER 1001 From cc407f949ad2c4705cdde7045aa9a1ef458824b1 Mon Sep 17 00:00:00 2001 From: Barrett Falk Date: Tue, 30 Jan 2024 12:56:18 -0800 Subject: [PATCH 4/4] feat: ce-376 GraphQL (#26) --- .github/workflows/scheduled.yml | 4 +- backend/.gitignore | 3 + backend/Dockerfile | 24 +- backend/package-lock.json | 1755 +++++++++++++++-- backend/package.json | 17 +- backend/prisma/schema.prisma | 20 + backend/schema.gql | 22 + backend/src/app.module.ts | 23 +- backend/src/app.ts | 8 +- backend/src/main.ts | 5 +- backend/src/models/user.model.ts | 14 + backend/src/prisma/prisma.module.ts | 8 + backend/src/prisma/prisma.service.ts | 14 + backend/src/users/dto/create-user.input.ts | 11 + backend/src/users/entities/users.entity.ts | 28 - backend/src/users/users.controller.spec.ts | 174 -- backend/src/users/users.controller.ts | 64 - backend/src/users/users.module.ts | 14 +- backend/src/users/users.resolver.ts | 21 + backend/src/users/users.service.spec.ts | 258 +-- backend/src/users/users.service.ts | 118 +- .../nr-compliance-enforcement-cm/values.yaml | 6 +- docker-compose.yml | 12 +- migrations/sql/V1.0.0__init.sql | 10 +- migrations/sql/V1.0.1__alter_user_seq.sql | 2 +- 25 files changed, 1901 insertions(+), 734 deletions(-) create mode 100644 backend/.gitignore create mode 100644 backend/prisma/schema.prisma create mode 100644 backend/schema.gql create mode 100644 backend/src/models/user.model.ts create mode 100644 backend/src/prisma/prisma.module.ts create mode 100644 backend/src/prisma/prisma.service.ts create mode 100644 backend/src/users/dto/create-user.input.ts delete mode 100644 backend/src/users/entities/users.entity.ts delete mode 100644 backend/src/users/users.controller.spec.ts delete mode 100644 backend/src/users/users.controller.ts create mode 100644 backend/src/users/users.resolver.ts diff --git a/.github/workflows/scheduled.yml b/.github/workflows/scheduled.yml index 014c9af0..309c27df 100644 --- a/.github/workflows/scheduled.yml +++ b/.github/workflows/scheduled.yml @@ -57,7 +57,7 @@ jobs: env: FLYWAY_VALIDATE_MIGRATION_NAMING: true FLYWAY_LOCATIONS: filesystem:./migrations - FLYWAY_DEFAULT_SCHEMA: "users" + FLYWAY_DEFAULT_SCHEMA: "case_management" - name: Create Output Folder run: | @@ -65,7 +65,7 @@ jobs: chmod a+rwx -R output - name: Run Schemaspy - run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:6.2.4 -t pgsql -db default -host 127.0.0.1 -port 5432 -u default -p default -schemas users + run: docker run --network host -v "$PWD/output:/output" schemaspy/schemaspy:6.2.4 -t pgsql -db default -host 127.0.0.1 -port 5432 -u default -p default -schemas case_management - name: Deploy to Pages uses: JamesIves/github-pages-deploy-action@v4 with: diff --git a/backend/.gitignore b/backend/.gitignore new file mode 100644 index 00000000..11ddd8db --- /dev/null +++ b/backend/.gitignore @@ -0,0 +1,3 @@ +node_modules +# Keep environment variables out of version control +.env diff --git a/backend/Dockerfile b/backend/Dockerfile index a1108a50..f4351447 100644 --- a/backend/Dockerfile +++ b/backend/Dockerfile @@ -1,13 +1,29 @@ # Build static files # Node Bullseye has npm -FROM node:20.10.0-bullseye-slim AS build +FROM node:20.11.0-bullseye-slim AS buildWithDevDeps # Install packages, build and keep only prod packages WORKDIR /app COPY *.json ./ COPY ./src ./src -RUN npm ci --ignore-scripts --no-update-notifier --omit=dev && \ - npm run build +COPY ./prisma ./prisma +RUN npm ci --ignore-scripts --no-update-notifier +RUN npm run prisma-generate +FROM node:20.11.0-bullseye-slim AS build + +# Install packages, build and keep only prod packages +WORKDIR /app +COPY *.json ./ +COPY ./src ./src +COPY ./prisma ./prisma +RUN npm ci --ignore-scripts --no-update-notifier --omit=dev + +# COPY over few dependencies from buildWithDevDeps +COPY --from=buildWithDevDeps /app/node_modules/@prisma ./node_modules/@prisma +COPY --from=buildWithDevDeps /app/node_modules/.prisma ./node_modules/.prisma +COPY --from=buildWithDevDeps /app/node_modules/prisma ./node_modules/prisma + +RUN npm run build # Deploy container # Distroless has node, but not npm @@ -22,7 +38,7 @@ COPY --from=build /app/dist ./dist # Ports, health check and non-root user EXPOSE 3000 HEALTHCHECK --interval=30s --timeout=3s CMD curl -f http://localhost/:3000/api || exit 1 -USER app +USER nonroot # Start up command with 50MB of heap size, each application needs to determine what is the best value. DONT use default as it is 4GB. CMD ["--max-old-space-size=50", "/app/dist/main"] diff --git a/backend/package-lock.json b/backend/package-lock.json index 4ae99454..0ec19661 100644 --- a/backend/package-lock.json +++ b/backend/package-lock.json @@ -6,24 +6,32 @@ "": { "license": "Apache-2.0", "dependencies": { + "@apollo/server": "^4.10.0", + "@nestjs/apollo": "^12.0.11", "@nestjs/cli": "^10.1.16", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.0.0", "@nestjs/core": "^10.0.0", + "@nestjs/graphql": "^12.0.11", "@nestjs/platform-express": "^10.0.0", "@nestjs/schematics": "^10.0.0", "@nestjs/swagger": "^7.0.3", "@nestjs/testing": "^10.0.0", "@nestjs/typeorm": "^10.0.0", + "@prisma/client": "^5.8.1", + "apollo-server-express": "^3.13.0", "dotenv": "^16.0.1", + "graphql": "^16.8.1", + "graphql-ws": "^5.14.3", "helmet": "^7.0.0", "nest-winston": "^1.9.4", + "nestjs-prisma": "^0.22.0", "pg": "^8.11.3", + "prisma": "^5.8.1", "reflect-metadata": "^0.1.13", "rimraf": "^5.0.0", "rxjs": "^7.8.0", "swagger-ui-express": "^5.0.0", - "typeorm": "^0.3.17", "winston": "^3.11.0" }, "devDependencies": { @@ -183,6 +191,282 @@ "url": "https://github.com/chalk/wrap-ansi?sponsor=1" } }, + "node_modules/@apollo/cache-control-types": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@apollo/cache-control-types/-/cache-control-types-1.0.3.tgz", + "integrity": "sha512-F17/vCp7QVwom9eG7ToauIKdAxpSoadsJnqIfyryLFSkLSOEqu+eC5Z3N8OXcUVStuOMcNHlyraRsA6rRICu4g==", + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/protobufjs": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.7.tgz", + "integrity": "sha512-Lahx5zntHPZia35myYDBRuF58tlwPskwHc5CWBZC/4bMKB6siTBWwtMrkqXcsNwQiFSzSx5hKdRPUmemrEp3Gg==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "long": "^4.0.0" + }, + "bin": { + "apollo-pbjs": "bin/pbjs", + "apollo-pbts": "bin/pbts" + } + }, + "node_modules/@apollo/server": { + "version": "4.10.0", + "resolved": "https://registry.npmjs.org/@apollo/server/-/server-4.10.0.tgz", + "integrity": "sha512-pLx//lZ/pvUfWL9G8Np8+y3ujc0pYc8U7dwD6ztt9FAw8NmCPzPaDzlXLBAjGU6WnkqVBOnz8b3dOwRNjLYSUA==", + "dependencies": { + "@apollo/cache-control-types": "^1.0.3", + "@apollo/server-gateway-interface": "^1.1.1", + "@apollo/usage-reporting-protobuf": "^4.1.1", + "@apollo/utils.createhash": "^2.0.0", + "@apollo/utils.fetcher": "^2.0.0", + "@apollo/utils.isnodelike": "^2.0.0", + "@apollo/utils.keyvaluecache": "^2.1.0", + "@apollo/utils.logger": "^2.0.0", + "@apollo/utils.usagereporting": "^2.1.0", + "@apollo/utils.withrequired": "^2.0.0", + "@graphql-tools/schema": "^9.0.0", + "@josephg/resolvable": "^1.0.0", + "@types/express": "^4.17.13", + "@types/express-serve-static-core": "^4.17.30", + "@types/node-fetch": "^2.6.1", + "async-retry": "^1.2.1", + "cors": "^2.8.5", + "express": "^4.17.1", + "loglevel": "^1.6.8", + "lru-cache": "^7.10.1", + "negotiator": "^0.6.3", + "node-abort-controller": "^3.1.1", + "node-fetch": "^2.6.7", + "uuid": "^9.0.0", + "whatwg-mimetype": "^3.0.0" + }, + "engines": { + "node": ">=14.16.0" + }, + "peerDependencies": { + "graphql": "^16.6.0" + } + }, + "node_modules/@apollo/server-gateway-interface": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@apollo/server-gateway-interface/-/server-gateway-interface-1.1.1.tgz", + "integrity": "sha512-pGwCl/po6+rxRmDMFgozKQo2pbsSwE91TpsDBAOgf74CRDPXHHtM88wbwjab0wMMZh95QfR45GGyDIdhY24bkQ==", + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.1.1", + "@apollo/utils.fetcher": "^2.0.0", + "@apollo/utils.keyvaluecache": "^2.1.0", + "@apollo/utils.logger": "^2.0.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/server-plugin-landing-page-graphql-playground": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@apollo/server-plugin-landing-page-graphql-playground/-/server-plugin-landing-page-graphql-playground-4.0.0.tgz", + "integrity": "sha512-PBDtKI/chJ+hHeoJUUH9Kuqu58txQl00vUGuxqiC9XcReulIg7RjsyD0G1u3drX4V709bxkL5S0nTeXfRHD0qA==", + "deprecated": "The use of GraphQL Playground in Apollo Server was supported in previous versions, but this is no longer the case as of December 31, 2022. This package exists for v4 migration purposes only. We do not intend to resolve security issues or other bugs with this package if they arise, so please migrate away from this to [Apollo Server's default Explorer](https://www.apollographql.com/docs/apollo-server/api/plugin/landing-pages) as soon as possible.", + "dependencies": { + "@apollographql/graphql-playground-html": "1.6.29" + }, + "engines": { + "node": ">=14.0" + }, + "peerDependencies": { + "@apollo/server": "^4.0.0" + } + }, + "node_modules/@apollo/server/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/@apollo/usage-reporting-protobuf": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/@apollo/usage-reporting-protobuf/-/usage-reporting-protobuf-4.1.1.tgz", + "integrity": "sha512-u40dIUePHaSKVshcedO7Wp+mPiZsaU6xjv9J+VyxpoU/zL6Jle+9zWeG98tr/+SZ0nZ4OXhrbb8SNr0rAPpIDA==", + "dependencies": { + "@apollo/protobufjs": "1.2.7" + } + }, + "node_modules/@apollo/utils.createhash": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.createhash/-/utils.createhash-2.0.1.tgz", + "integrity": "sha512-fQO4/ZOP8LcXWvMNhKiee+2KuKyqIcfHrICA+M4lj/h/Lh1H10ICcUtk6N/chnEo5HXu0yejg64wshdaiFitJg==", + "dependencies": { + "@apollo/utils.isnodelike": "^2.0.1", + "sha.js": "^2.4.11" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.dropunuseddefinitions": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-2.0.1.tgz", + "integrity": "sha512-EsPIBqsSt2BwDsv8Wu76LK5R1KtsVkNoO4b0M5aK0hx+dGg9xJXuqlr7Fo34Dl+y83jmzn+UvEW+t1/GP2melA==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.fetcher": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.fetcher/-/utils.fetcher-2.0.1.tgz", + "integrity": "sha512-jvvon885hEyWXd4H6zpWeN3tl88QcWnHp5gWF5OPF34uhvoR+DFqcNxs9vrRaBBSY3qda3Qe0bdud7tz2zGx1A==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.isnodelike": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.isnodelike/-/utils.isnodelike-2.0.1.tgz", + "integrity": "sha512-w41XyepR+jBEuVpoRM715N2ZD0xMD413UiJx8w5xnAZD2ZkSJnMJBoIzauK83kJpSgNuR6ywbV29jG9NmxjK0Q==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.keyvaluecache": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-2.1.1.tgz", + "integrity": "sha512-qVo5PvUUMD8oB9oYvq4ViCjYAMWnZ5zZwEjNF37L2m1u528x5mueMlU+Cr1UinupCgdB78g+egA1G98rbJ03Vw==", + "dependencies": { + "@apollo/utils.logger": "^2.0.1", + "lru-cache": "^7.14.1" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.keyvaluecache/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "engines": { + "node": ">=12" + } + }, + "node_modules/@apollo/utils.logger": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-2.0.1.tgz", + "integrity": "sha512-YuplwLHaHf1oviidB7MxnCXAdHp3IqYV8n0momZ3JfLniae92eYqMIx+j5qJFX6WKJPs6q7bczmV4lXIsTu5Pg==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollo/utils.printwithreducedwhitespace": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-2.0.1.tgz", + "integrity": "sha512-9M4LUXV/fQBh8vZWlLvb/HyyhjJ77/I5ZKu+NBWV/BmYGyRmoEP9EVAy7LCVoY3t8BDcyCAGfxJaLFCSuQkPUg==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.removealiases": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-2.0.1.tgz", + "integrity": "sha512-0joRc2HBO4u594Op1nev+mUF6yRnxoUH64xw8x3bX7n8QBDYdeYgY4tF0vJReTy+zdn2xv6fMsquATSgC722FA==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.sortast": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-2.0.1.tgz", + "integrity": "sha512-eciIavsWpJ09za1pn37wpsCGrQNXUhM0TktnZmHwO+Zy9O4fu/WdB4+5BvVhFiZYOXvfjzJUcc+hsIV8RUOtMw==", + "dependencies": { + "lodash.sortby": "^4.7.0" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.stripsensitiveliterals": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-2.0.1.tgz", + "integrity": "sha512-QJs7HtzXS/JIPMKWimFnUMK7VjkGQTzqD9bKD1h3iuPAqLsxd0mUNVbkYOPTsDhUKgcvUOfOqOJWYohAKMvcSA==", + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.usagereporting": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-2.1.0.tgz", + "integrity": "sha512-LPSlBrn+S17oBy5eWkrRSGb98sWmnEzo3DPTZgp8IQc8sJe0prDgDuppGq4NeQlpoqEHz0hQeYHAOA0Z3aQsxQ==", + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.1.0", + "@apollo/utils.dropunuseddefinitions": "^2.0.1", + "@apollo/utils.printwithreducedwhitespace": "^2.0.1", + "@apollo/utils.removealiases": "2.0.1", + "@apollo/utils.sortast": "^2.0.1", + "@apollo/utils.stripsensitiveliterals": "^2.0.1" + }, + "engines": { + "node": ">=14" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/@apollo/utils.withrequired": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.withrequired/-/utils.withrequired-2.0.1.tgz", + "integrity": "sha512-YBDiuAX9i1lLc6GeTy1m7DGLFn/gMnvXqlalOIMjM7DeOgIacEjjfwPqb0M1CQ2v11HhR15d1NmxJoRCfrNqcA==", + "engines": { + "node": ">=14" + } + }, + "node_modules/@apollographql/apollo-tools": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/@apollographql/apollo-tools/-/apollo-tools-0.5.4.tgz", + "integrity": "sha512-shM3q7rUbNyXVVRkQJQseXv6bnYM3BUma/eZhwXR4xsuM+bqWnJKvW7SAfRjP7LuSCocrexa5AXhjjawNHrIlw==", + "engines": { + "node": ">=8", + "npm": ">=6" + }, + "peerDependencies": { + "graphql": "^14.2.1 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/@apollographql/graphql-playground-html": { + "version": "1.6.29", + "resolved": "https://registry.npmjs.org/@apollographql/graphql-playground-html/-/graphql-playground-html-1.6.29.tgz", + "integrity": "sha512-xCcXpoz52rI4ksJSdOCxeOCn2DLocxwHf9dVT/Q90Pte1LX+LY+91SFtJF3KXVHH8kEin+g1KKCQPKBjZJfWNA==", + "dependencies": { + "xss": "^1.0.8" + } + }, "node_modules/@babel/code-frame": { "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.23.5.tgz", @@ -755,6 +1039,7 @@ "version": "7.23.5", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.23.5.tgz", "integrity": "sha512-NdUTHcPe4C99WxPub+K9l9tK5/lV4UXIoaHSYgzco9BCyjKAAwzdBI+wWtYqHt7LJdbo74ZjRPJgzVweq1sz0w==", + "peer": true, "dependencies": { "regenerator-runtime": "^0.14.0" }, @@ -945,6 +1230,66 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@graphql-tools/merge": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.4.2.tgz", + "integrity": "sha512-XbrHAaj8yDuINph+sAfuq3QCZ/tKblrTLOpirK0+CAgNlZUCHs0Fa+xtMUURgwCVThLle1AF7svJCxFizygLsw==", + "dependencies": { + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/mock": { + "version": "8.7.20", + "resolved": "https://registry.npmjs.org/@graphql-tools/mock/-/mock-8.7.20.tgz", + "integrity": "sha512-ljcHSJWjC/ZyzpXd5cfNhPI7YljRVvabKHPzKjEs5ElxWu2cdlLGvyNYepApXDsM/OJG/2xuhGM+9GWu5gEAPQ==", + "dependencies": { + "@graphql-tools/schema": "^9.0.18", + "@graphql-tools/utils": "^9.2.1", + "fast-json-stable-stringify": "^2.1.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/schema": { + "version": "9.0.19", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-9.0.19.tgz", + "integrity": "sha512-oBRPoNBtCkk0zbUsyP4GaIzCt8C0aCI4ycIRUL67KK5pOHljKLBBtGT+Jr6hkzA74C8Gco8bpZPe7aWFjiaK2w==", + "dependencies": { + "@graphql-tools/merge": "^8.4.1", + "@graphql-tools/utils": "^9.2.1", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-tools/utils": { + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-9.2.1.tgz", + "integrity": "sha512-WUw506Ql6xzmOORlriNrD6Ugx+HjVgYxt9KCXD9mHAak+eaXSwuGGPyE60hy9xaDEoXKBsG7SkG69ybitaVl6A==", + "dependencies": { + "@graphql-typed-document-node/core": "^3.1.1", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@graphql-typed-document-node/core": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/@graphql-typed-document-node/core/-/core-3.2.0.tgz", + "integrity": "sha512-mB9oAsNCm9aM3/SOv4YtBMqZbYj10R7dkq8byBqxGY/ncFwhf2oQzMV+LCRlWoDSEBJ3COiR1yeDvMtsoOsuFQ==", + "peerDependencies": { + "graphql": "^0.8.0 || ^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, "node_modules/@humanwhocodes/config-array": { "version": "0.11.13", "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.11.13.tgz", @@ -1473,6 +1818,11 @@ "node": "^14.15.0 || ^16.10.0 || >=18.0.0" } }, + "node_modules/@josephg/resolvable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@josephg/resolvable/-/resolvable-1.0.1.tgz", + "integrity": "sha512-CtzORUwWTTOTqfVtHaKRJ0I1kNQd1bpn3sUh8I3nJDVY+5/M/Oe1DnEWzPQvqq/xPIIkzzzIP7mfCoAjFRvDhg==" + }, "node_modules/@jridgewell/gen-mapping": { "version": "0.3.3", "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz", @@ -1533,6 +1883,38 @@ "node": ">=8" } }, + "node_modules/@nestjs/apollo": { + "version": "12.0.11", + "resolved": "https://registry.npmjs.org/@nestjs/apollo/-/apollo-12.0.11.tgz", + "integrity": "sha512-E8kBOyGBZ8Zx4qMLnK3+ECZgmLKqNHyYbtkOi0fXWr8ackosLMkRqGgtDVffXRlVA3eo6G3RgnL0Qyu3VvfD5A==", + "dependencies": { + "@apollo/server-plugin-landing-page-graphql-playground": "4.0.0", + "iterall": "1.3.0", + "lodash.omit": "4.5.0", + "tslib": "2.6.2" + }, + "peerDependencies": { + "@apollo/gateway": "^2.0.0", + "@apollo/server": "^4.3.2", + "@apollo/subgraph": "^2.0.0", + "@as-integrations/fastify": "^1.3.0 || ^2.0.0", + "@nestjs/common": "^9.3.8 || ^10.0.0", + "@nestjs/core": "^9.3.8 || ^10.0.0", + "@nestjs/graphql": "^12.0.0", + "graphql": "^16.6.0" + }, + "peerDependenciesMeta": { + "@apollo/gateway": { + "optional": true + }, + "@apollo/subgraph": { + "optional": true + }, + "@as-integrations/fastify": { + "optional": true + } + } + }, "node_modules/@nestjs/cli": { "version": "10.2.1", "resolved": "https://registry.npmjs.org/@nestjs/cli/-/cli-10.2.1.tgz", @@ -1737,83 +2119,111 @@ } } }, - "node_modules/@nestjs/mapped-types": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.3.tgz", - "integrity": "sha512-40Zdqg98lqoF0+7ThWIZFStxgzisK6GG22+1ABO4kZiGF/Tu2FE+DYLw+Q9D94vcFWizJ+MSjNN4ns9r6hIGxw==", + "node_modules/@nestjs/graphql": { + "version": "12.0.11", + "resolved": "https://registry.npmjs.org/@nestjs/graphql/-/graphql-12.0.11.tgz", + "integrity": "sha512-iCyVs9+utCQt9ehMhUjQcEdjRN/MrcTBINd7P44O1fzGENuWMbt1Z8RCoZbeGi5iVPBY63HgYik+BnnICqmxZw==", + "dependencies": { + "@graphql-tools/merge": "9.0.0", + "@graphql-tools/schema": "10.0.0", + "@graphql-tools/utils": "10.0.8", + "@nestjs/mapped-types": "2.0.2", + "chokidar": "3.5.3", + "fast-glob": "3.3.2", + "graphql-tag": "2.12.6", + "graphql-ws": "5.14.2", + "lodash": "4.17.21", + "normalize-path": "3.0.0", + "subscriptions-transport-ws": "0.11.0", + "tslib": "2.6.2", + "uuid": "9.0.1", + "ws": "8.14.2" + }, "peerDependencies": { - "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", - "class-transformer": "^0.4.0 || ^0.5.0", - "class-validator": "^0.13.0 || ^0.14.0", - "reflect-metadata": "^0.1.12" + "@apollo/subgraph": "^2.0.0", + "@nestjs/common": "^9.3.8 || ^10.0.0", + "@nestjs/core": "^9.3.8 || ^10.0.0", + "class-transformer": "*", + "class-validator": "*", + "graphql": "^16.6.0", + "reflect-metadata": "^0.1.13", + "ts-morph": "^16.0.0 || ^17.0.0 || ^18.0.0 || ^19.0.0 || ^20.0.0" }, "peerDependenciesMeta": { + "@apollo/subgraph": { + "optional": true + }, "class-transformer": { "optional": true }, "class-validator": { "optional": true + }, + "ts-morph": { + "optional": true } } }, - "node_modules/@nestjs/platform-express": { - "version": "10.2.10", - "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.2.10.tgz", - "integrity": "sha512-U4KDgtMjH8TqEvt0RzC/POP8ABvL9bYoCScvlGtFSKgVGaMLBKkZ4+jHtbQx6qItYSlBBRUuz/dveMZCObfrkQ==", + "node_modules/@nestjs/graphql/node_modules/@graphql-tools/merge": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-9.0.0.tgz", + "integrity": "sha512-J7/xqjkGTTwOJmaJQJ2C+VDBDOWJL3lKrHJN4yMaRLAJH3PosB7GiPRaSDZdErs0+F77sH2MKs2haMMkywzx7Q==", "dependencies": { - "body-parser": "1.20.2", - "cors": "2.8.5", - "express": "4.18.2", - "multer": "1.4.4-lts.1", - "tslib": "2.6.2" + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0" }, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/nest" + "engines": { + "node": ">=16.0.0" }, "peerDependencies": { - "@nestjs/common": "^10.0.0", - "@nestjs/core": "^10.0.0" + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@nestjs/schematics": { - "version": "10.0.3", - "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-10.0.3.tgz", - "integrity": "sha512-2BRujK0GqGQ7j1Zpz+obVfskDnnOeVKt5aXoSaVngKo8Oczy8uYCY+R547TQB+Kf35epdfFER2pVnQrX3/It5A==", + "node_modules/@nestjs/graphql/node_modules/@graphql-tools/schema": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-10.0.0.tgz", + "integrity": "sha512-kf3qOXMFcMs2f/S8Y3A8fm/2w+GaHAkfr3Gnhh2LOug/JgpY/ywgFVxO3jOeSpSEdoYcDKLcXVjMigNbY4AdQg==", "dependencies": { - "@angular-devkit/core": "16.2.8", - "@angular-devkit/schematics": "16.2.8", - "comment-json": "4.2.3", - "jsonc-parser": "3.2.0", - "pluralize": "8.0.0" + "@graphql-tools/merge": "^9.0.0", + "@graphql-tools/utils": "^10.0.0", + "tslib": "^2.4.0", + "value-or-promise": "^1.0.12" + }, + "engines": { + "node": ">=16.0.0" }, "peerDependencies": { - "typescript": ">=4.8.2" + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" } }, - "node_modules/@nestjs/swagger": { - "version": "7.1.16", - "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.16.tgz", - "integrity": "sha512-f9KBk/BX9MUKPTj7tQNYJ124wV/jP5W2lwWHLGwe/4qQXixuDOo39zP55HIJ44LE7S04B7BOeUOo9GBJD/vRcw==", + "node_modules/@nestjs/graphql/node_modules/@graphql-tools/utils": { + "version": "10.0.8", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-10.0.8.tgz", + "integrity": "sha512-yjyA8ycSa1WRlJqyX/aLqXeE5DvF/H02+zXMUFnCzIDrj0UvLMUrxhmVFnMK0Q2n3bh4uuTeY3621m5za9ovXw==", "dependencies": { - "@nestjs/mapped-types": "2.0.3", - "js-yaml": "4.1.0", - "lodash": "4.17.21", - "path-to-regexp": "3.2.0", - "swagger-ui-dist": "5.9.1" + "@graphql-typed-document-node/core": "^3.1.1", + "cross-inspect": "1.0.0", + "dset": "^3.1.2", + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" }, "peerDependencies": { - "@fastify/static": "^6.0.0", - "@nestjs/common": "^9.0.0 || ^10.0.0", - "@nestjs/core": "^9.0.0 || ^10.0.0", - "class-transformer": "*", - "class-validator": "*", + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/@nestjs/graphql/node_modules/@nestjs/mapped-types": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.2.tgz", + "integrity": "sha512-V0izw6tWs6fTp9+KiiPUbGHWALy563Frn8X6Bm87ANLRuE46iuBMD5acKBDP5lKL/75QFvrzSJT7HkCbB0jTpg==", + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0", "reflect-metadata": "^0.1.12" }, "peerDependenciesMeta": { - "@fastify/static": { - "optional": true - }, "class-transformer": { "optional": true }, @@ -1822,8 +2232,116 @@ } } }, - "node_modules/@nestjs/testing": { - "version": "10.2.10", + "node_modules/@nestjs/graphql/node_modules/graphql-ws": { + "version": "5.14.2", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.2.tgz", + "integrity": "sha512-LycmCwhZ+Op2GlHz4BZDsUYHKRiiUz+3r9wbhBATMETNlORQJAaFlAgTFoeRh6xQoQegwYwIylVD1Qns9/DA3w==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": ">=0.11 <=16" + } + }, + "node_modules/@nestjs/graphql/node_modules/uuid": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-9.0.1.tgz", + "integrity": "sha512-b+1eJOlsR9K8HJpow9Ok3fiWOWSIcIzXodvv0rQjVoOVNpWMpxf1wZNpt4y9h10odCNrqnYp1OBzRktckBe3sA==", + "funding": [ + "https://github.com/sponsors/broofa", + "https://github.com/sponsors/ctavan" + ], + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/@nestjs/mapped-types": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/mapped-types/-/mapped-types-2.0.3.tgz", + "integrity": "sha512-40Zdqg98lqoF0+7ThWIZFStxgzisK6GG22+1ABO4kZiGF/Tu2FE+DYLw+Q9D94vcFWizJ+MSjNN4ns9r6hIGxw==", + "peerDependencies": { + "@nestjs/common": "^8.0.0 || ^9.0.0 || ^10.0.0", + "class-transformer": "^0.4.0 || ^0.5.0", + "class-validator": "^0.13.0 || ^0.14.0", + "reflect-metadata": "^0.1.12" + }, + "peerDependenciesMeta": { + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/platform-express": { + "version": "10.2.10", + "resolved": "https://registry.npmjs.org/@nestjs/platform-express/-/platform-express-10.2.10.tgz", + "integrity": "sha512-U4KDgtMjH8TqEvt0RzC/POP8ABvL9bYoCScvlGtFSKgVGaMLBKkZ4+jHtbQx6qItYSlBBRUuz/dveMZCObfrkQ==", + "dependencies": { + "body-parser": "1.20.2", + "cors": "2.8.5", + "express": "4.18.2", + "multer": "1.4.4-lts.1", + "tslib": "2.6.2" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/nest" + }, + "peerDependencies": { + "@nestjs/common": "^10.0.0", + "@nestjs/core": "^10.0.0" + } + }, + "node_modules/@nestjs/schematics": { + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/@nestjs/schematics/-/schematics-10.0.3.tgz", + "integrity": "sha512-2BRujK0GqGQ7j1Zpz+obVfskDnnOeVKt5aXoSaVngKo8Oczy8uYCY+R547TQB+Kf35epdfFER2pVnQrX3/It5A==", + "dependencies": { + "@angular-devkit/core": "16.2.8", + "@angular-devkit/schematics": "16.2.8", + "comment-json": "4.2.3", + "jsonc-parser": "3.2.0", + "pluralize": "8.0.0" + }, + "peerDependencies": { + "typescript": ">=4.8.2" + } + }, + "node_modules/@nestjs/swagger": { + "version": "7.1.16", + "resolved": "https://registry.npmjs.org/@nestjs/swagger/-/swagger-7.1.16.tgz", + "integrity": "sha512-f9KBk/BX9MUKPTj7tQNYJ124wV/jP5W2lwWHLGwe/4qQXixuDOo39zP55HIJ44LE7S04B7BOeUOo9GBJD/vRcw==", + "dependencies": { + "@nestjs/mapped-types": "2.0.3", + "js-yaml": "4.1.0", + "lodash": "4.17.21", + "path-to-regexp": "3.2.0", + "swagger-ui-dist": "5.9.1" + }, + "peerDependencies": { + "@fastify/static": "^6.0.0", + "@nestjs/common": "^9.0.0 || ^10.0.0", + "@nestjs/core": "^9.0.0 || ^10.0.0", + "class-transformer": "*", + "class-validator": "*", + "reflect-metadata": "^0.1.12" + }, + "peerDependenciesMeta": { + "@fastify/static": { + "optional": true + }, + "class-transformer": { + "optional": true + }, + "class-validator": { + "optional": true + } + } + }, + "node_modules/@nestjs/testing": { + "version": "10.2.10", "resolved": "https://registry.npmjs.org/@nestjs/testing/-/testing-10.2.10.tgz", "integrity": "sha512-IVLUnPz/+fkBtPATYfqTIP+phN9yjkXejmj+JyhmcfPJZpxBmD1i9VSMqa4u54l37j0xkGPscQ0IXpbhqMYUKw==", "dependencies": { @@ -1879,7 +2397,6 @@ "version": "2.1.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz", "integrity": "sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "2.0.5", "run-parallel": "^1.1.9" @@ -1892,7 +2409,6 @@ "version": "2.0.5", "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz", "integrity": "sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A==", - "dev": true, "engines": { "node": ">= 8" } @@ -1901,7 +2417,6 @@ "version": "1.2.8", "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz", "integrity": "sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg==", - "dev": true, "dependencies": { "@nodelib/fs.scandir": "2.1.5", "fastq": "^1.6.0" @@ -1956,6 +2471,227 @@ "url": "https://opencollective.com/unts" } }, + "node_modules/@prisma/client": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@prisma/client/-/client-5.8.1.tgz", + "integrity": "sha512-xQtMPfbIwLlbm0VVIVQY2yqQVOxPwRQhvIp7Z3m2900g1bu/zRHKhYZJQWELqmjl6d8YwBy0K2NvMqh47v1ubw==", + "hasInstallScript": true, + "engines": { + "node": ">=16.13" + }, + "peerDependencies": { + "prisma": "*" + }, + "peerDependenciesMeta": { + "prisma": { + "optional": true + } + } + }, + "node_modules/@prisma/debug": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@prisma/debug/-/debug-5.8.1.tgz", + "integrity": "sha512-tjuw7eA0Us3T42jx9AmAgL58rzwzpFGYc3R7Y4Ip75EBYrKMBA1YihuWMcBC92ILmjlQ/u3p8VxcIE0hr+fZfg==" + }, + "node_modules/@prisma/engines": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@prisma/engines/-/engines-5.8.1.tgz", + "integrity": "sha512-TJgYLRrZr56uhqcXO4GmP5be+zjCIHtLDK20Cnfg+o9d905hsN065QOL+3Z0zQAy6YD31Ol4u2kzSfRmbJv/uA==", + "hasInstallScript": true, + "dependencies": { + "@prisma/debug": "5.8.1", + "@prisma/engines-version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "@prisma/fetch-engine": "5.8.1", + "@prisma/get-platform": "5.8.1" + } + }, + "node_modules/@prisma/engines-version": { + "version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "resolved": "https://registry.npmjs.org/@prisma/engines-version/-/engines-version-5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2.tgz", + "integrity": "sha512-f5C3JM3l9yhGr3cr4FMqWloFaSCpNpMi58Om22rjD2DOz3owci2mFdFXMgnAGazFPKrCbbEhcxdsRfspEYRoFQ==" + }, + "node_modules/@prisma/fetch-engine": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@prisma/fetch-engine/-/fetch-engine-5.8.1.tgz", + "integrity": "sha512-+bgjjoSFa6uYEbAPlklfoVSStOEfcpheOjoBoNsNNSQdSzcwE2nM4Q0prun0+P8/0sCHo18JZ9xqa8gObvgOUw==", + "dependencies": { + "@prisma/debug": "5.8.1", + "@prisma/engines-version": "5.8.1-1.78caf6feeaed953168c64e15a249c3e9a033ebe2", + "@prisma/get-platform": "5.8.1" + } + }, + "node_modules/@prisma/get-platform": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@prisma/get-platform/-/get-platform-5.8.1.tgz", + "integrity": "sha512-wnA+6HTFcY+tkykMokix9GiAkaauPC5W/gg0O5JB0J8tCTNWrqpnQ7AsaGRfkYUbeOIioh6woDjQrGTTRf1Zag==", + "dependencies": { + "@prisma/debug": "5.8.1" + } + }, + "node_modules/@protobufjs/aspromise": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", + "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" + }, + "node_modules/@protobufjs/base64": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", + "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" + }, + "node_modules/@protobufjs/codegen": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", + "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" + }, + "node_modules/@protobufjs/eventemitter": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", + "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" + }, + "node_modules/@protobufjs/fetch": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", + "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", + "dependencies": { + "@protobufjs/aspromise": "^1.1.1", + "@protobufjs/inquire": "^1.1.0" + } + }, + "node_modules/@protobufjs/float": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", + "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" + }, + "node_modules/@protobufjs/inquire": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", + "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" + }, + "node_modules/@protobufjs/path": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", + "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" + }, + "node_modules/@protobufjs/pool": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", + "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" + }, + "node_modules/@protobufjs/utf8": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", + "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" + }, + "node_modules/@schematics/angular": { + "version": "13.3.11", + "resolved": "https://registry.npmjs.org/@schematics/angular/-/angular-13.3.11.tgz", + "integrity": "sha512-imKBnKYEse0SBVELZO/753nkpt3eEgpjrYkB+AFWF9YfO/4RGnYXDHoH8CFkzxPH9QQCgNrmsVFNiYGS+P/S1A==", + "dependencies": { + "@angular-devkit/core": "13.3.11", + "@angular-devkit/schematics": "13.3.11", + "jsonc-parser": "3.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@schematics/angular/node_modules/@angular-devkit/core": { + "version": "13.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.11.tgz", + "integrity": "sha512-rfqoLMRYhlz0wzKlHx7FfyIyQq8dKTsmbCoIVU1cEIH0gyTMVY7PbVzwRRcO6xp5waY+0hA+0Brriujpuhkm4w==", + "dependencies": { + "ajv": "8.9.0", + "ajv-formats": "2.1.1", + "fast-json-stable-stringify": "2.1.0", + "magic-string": "0.25.7", + "rxjs": "6.6.7", + "source-map": "0.7.3" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/@schematics/angular/node_modules/@angular-devkit/schematics": { + "version": "13.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.11.tgz", + "integrity": "sha512-ben+EGXpCrClnIVAAnEQmhQdKmnnqFhMp5BqMxgOslSYBAmCutLA6rBu5vsc8kZcGian1wt+lueF7G1Uk5cGBg==", + "dependencies": { + "@angular-devkit/core": "13.3.11", + "jsonc-parser": "3.0.0", + "magic-string": "0.25.7", + "ora": "5.4.1", + "rxjs": "6.6.7" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/@schematics/angular/node_modules/ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/@schematics/angular/node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" + }, + "node_modules/@schematics/angular/node_modules/magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dependencies": { + "sourcemap-codec": "^1.4.4" + } + }, + "node_modules/@schematics/angular/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/@schematics/angular/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/@schematics/angular/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/@sinclair/typebox": { "version": "0.27.8", "resolved": "https://registry.npmjs.org/@sinclair/typebox/-/typebox-0.27.8.tgz", @@ -1983,7 +2719,8 @@ "node_modules/@sqltools/formatter": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/@sqltools/formatter/-/formatter-1.2.5.tgz", - "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==" + "integrity": "sha512-Uy0+khmZqUrUGm5dmMqVlnvufZRSK0FbYzVgp0UMstm+F5+W2/jnEEQyc9vo1ZR/E5ZI/B1WjjoTqBqwJL6Krw==", + "peer": true }, "node_modules/@tsconfig/node10": { "version": "1.0.9", @@ -2009,6 +2746,14 @@ "integrity": "sha512-vxhUy4J8lyeyinH7Azl1pdd43GJhZH/tP2weN8TntQblOY+A0XbT8DJk1/oCPuOOyg/Ja757rG0CgHcWC8OfMA==", "devOptional": true }, + "node_modules/@types/accepts": { + "version": "1.3.7", + "resolved": "https://registry.npmjs.org/@types/accepts/-/accepts-1.3.7.tgz", + "integrity": "sha512-Pay9fq2lM2wXPWbteBsRAGiWH2hig4ZE2asK+mm7kUzlxRTfL961rj89I6zV/E3PcIkDqyuBEcMxFT7rccugeQ==", + "dependencies": { + "@types/node": "*" + } + }, "node_modules/@types/babel__core": { "version": "7.20.5", "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.20.5.tgz", @@ -2054,7 +2799,6 @@ "version": "1.19.5", "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.5.tgz", "integrity": "sha512-fB3Zu92ucau0iQ0JMCFQE7b/dv8Ot07NI3KaZIkIUNXq82k4eBAqUaneXfleGY9JWskeS9y+u0nXMyspcuQrCg==", - "dev": true, "dependencies": { "@types/connect": "*", "@types/node": "*" @@ -2064,7 +2808,6 @@ "version": "3.4.38", "resolved": "https://registry.npmjs.org/@types/connect/-/connect-3.4.38.tgz", "integrity": "sha512-K6uROf1LD88uDQqJCktA4yzL1YYAK6NgfsI0v/mTgyPKWsX1CnJ0XPSDhViejru1GcRkLWb8RlzFYJRqGUbaug==", - "dev": true, "dependencies": { "@types/node": "*" } @@ -2075,6 +2818,11 @@ "integrity": "sha512-he+DHOWReW0nghN24E1WUqM0efK4kI9oTqDm6XmK8ZPe2djZ90BSNdGnIyCLzCPw7/pogPlGbzI2wHGGmi4O/Q==", "dev": true }, + "node_modules/@types/cors": { + "version": "2.8.12", + "resolved": "https://registry.npmjs.org/@types/cors/-/cors-2.8.12.tgz", + "integrity": "sha512-vt+kDhq/M2ayberEtJcIN/hxXy1Pk+59g2FV/ZQceeaTyCtCucjL2Q7FXlFjtWn4n15KCr1NE2lNNFhp0lEThw==" + }, "node_modules/@types/eslint": { "version": "8.44.8", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.8.tgz", @@ -2102,7 +2850,6 @@ "version": "4.17.21", "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.21.tgz", "integrity": "sha512-ejlPM315qwLpaQlQDTjPdsUFSc6ZsP4AN6AlWnogPjQ7CVi7PYF3YVz+CY3jE2pwYf7E/7HlDAN0rV2GxTG0HQ==", - "dev": true, "dependencies": { "@types/body-parser": "*", "@types/express-serve-static-core": "^4.17.33", @@ -2114,7 +2861,6 @@ "version": "4.17.41", "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.41.tgz", "integrity": "sha512-OaJ7XLaelTgrvlZD8/aa0vvvxZdUmlCn6MtWeB7TkiKW70BQLc9XEPpDLPdbo52ZhXUCrznlWdCHWxJWtdyajA==", - "dev": true, "dependencies": { "@types/node": "*", "@types/qs": "*", @@ -2134,8 +2880,7 @@ "node_modules/@types/http-errors": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/@types/http-errors/-/http-errors-2.0.4.tgz", - "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==", - "dev": true + "integrity": "sha512-D0CFMMtydbJAegzOyHjtiKPLlvnm3iTZyZRSZoLq2mRhDdmLfIWOCYPfQJ4cu2erKghU++QvjcUjp/5h7hESpA==" }, "node_modules/@types/istanbul-lib-coverage": { "version": "2.0.6", @@ -2182,11 +2927,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/long": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/@types/long/-/long-4.0.2.tgz", + "integrity": "sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA==" + }, "node_modules/@types/mime": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/@types/mime/-/mime-1.3.5.tgz", - "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==", - "dev": true + "integrity": "sha512-/pyBZWSLD2n0dcHE3hq8s8ZvcETHtEuF+3E7XVt0Ig2nvsVQXdghHVcEkIWjy9A0wKfTn97a/PSDYohKIlnP/w==" }, "node_modules/@types/node": { "version": "20.10.3", @@ -2196,17 +2945,24 @@ "undici-types": "~5.26.4" } }, + "node_modules/@types/node-fetch": { + "version": "2.6.11", + "resolved": "https://registry.npmjs.org/@types/node-fetch/-/node-fetch-2.6.11.tgz", + "integrity": "sha512-24xFj9R5+rfQJLRyM56qh+wnVSYhyXC2tkoBndtY0U+vubqNsYXGjufB2nn8Q6gt0LrARwL6UBtMCSVCwl4B1g==", + "dependencies": { + "@types/node": "*", + "form-data": "^4.0.0" + } + }, "node_modules/@types/qs": { "version": "6.9.10", "resolved": "https://registry.npmjs.org/@types/qs/-/qs-6.9.10.tgz", - "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==", - "dev": true + "integrity": "sha512-3Gnx08Ns1sEoCrWssEgTSJs/rsT2vhGP+Ja9cnnk9k4ALxinORlQneLXFeFKOTJMOeZUFD1s7w+w2AphTpvzZw==" }, "node_modules/@types/range-parser": { "version": "1.2.7", "resolved": "https://registry.npmjs.org/@types/range-parser/-/range-parser-1.2.7.tgz", - "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==", - "dev": true + "integrity": "sha512-hKormJbkJqzQGhziax5PItDUTMAM9uE2XXQmM37dyd4hVM+5aVl7oVxMVUiVQn2oCQFN/LKCZdvSM0pFRqbSmQ==" }, "node_modules/@types/semver": { "version": "7.5.6", @@ -2218,7 +2974,6 @@ "version": "0.17.4", "resolved": "https://registry.npmjs.org/@types/send/-/send-0.17.4.tgz", "integrity": "sha512-x2EM6TJOybec7c52BX0ZspPodMsQUd5L6PRwOunVyVUhXiBSKf3AezDL8Dgvgt5o0UfKNfuA0eMLr2wLT4AiBA==", - "dev": true, "dependencies": { "@types/mime": "^1", "@types/node": "*" @@ -2228,7 +2983,6 @@ "version": "1.15.5", "resolved": "https://registry.npmjs.org/@types/serve-static/-/serve-static-1.15.5.tgz", "integrity": "sha512-PDRk21MnK70hja/YF8AHfC7yIsiQHn1rcXx7ijCFBX/k+XQJhQT/gw3xekXKJvx+5SXaMMS8oqQy09Mzvz2TuQ==", - "dev": true, "dependencies": { "@types/http-errors": "*", "@types/mime": "*", @@ -2718,60 +3472,466 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/ansi-escapes/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==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" + "node_modules/ansi-escapes/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==", + "engines": { + "node": ">=10" + }, + "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==", + "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==", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/any-promise": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", + "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==", + "peer": true + }, + "node_modules/anymatch": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", + "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "dependencies": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/apollo-datasource": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/apollo-datasource/-/apollo-datasource-3.3.2.tgz", + "integrity": "sha512-L5TiS8E2Hn/Yz7SSnWIVbZw0ZfEIXZCa5VUiVxD9P53JvSrf4aStvsFDlGWPvpIdCR+aly2CfoB79B9/JjKFqg==", + "deprecated": "The `apollo-datasource` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "dependencies": { + "@apollo/utils.keyvaluecache": "^1.0.1", + "apollo-server-env": "^4.2.1" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/apollo-datasource/node_modules/@apollo/utils.keyvaluecache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz", + "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==", + "dependencies": { + "@apollo/utils.logger": "^1.0.0", + "lru-cache": "7.10.1 - 7.13.1" + } + }, + "node_modules/apollo-datasource/node_modules/@apollo/utils.logger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", + "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==" + }, + "node_modules/apollo-datasource/node_modules/lru-cache": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", + "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/apollo-reporting-protobuf": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/apollo-reporting-protobuf/-/apollo-reporting-protobuf-3.4.0.tgz", + "integrity": "sha512-h0u3EbC/9RpihWOmcSsvTW2O6RXVaD/mPEjfrPkxRPTEPWqncsgOoRJw+wih4OqfH3PvTJvoEIf4LwKrUaqWog==", + "deprecated": "The `apollo-reporting-protobuf` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/usage-reporting-protobuf` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "dependencies": { + "@apollo/protobufjs": "1.2.6" + } + }, + "node_modules/apollo-reporting-protobuf/node_modules/@apollo/protobufjs": { + "version": "1.2.6", + "resolved": "https://registry.npmjs.org/@apollo/protobufjs/-/protobufjs-1.2.6.tgz", + "integrity": "sha512-Wqo1oSHNUj/jxmsVp4iR3I480p6qdqHikn38lKrFhfzcDJ7lwd7Ck7cHRl4JE81tWNArl77xhnG/OkZhxKBYOw==", + "hasInstallScript": true, + "dependencies": { + "@protobufjs/aspromise": "^1.1.2", + "@protobufjs/base64": "^1.1.2", + "@protobufjs/codegen": "^2.0.4", + "@protobufjs/eventemitter": "^1.1.0", + "@protobufjs/fetch": "^1.1.0", + "@protobufjs/float": "^1.0.2", + "@protobufjs/inquire": "^1.1.0", + "@protobufjs/path": "^1.1.2", + "@protobufjs/pool": "^1.1.0", + "@protobufjs/utf8": "^1.1.0", + "@types/long": "^4.0.0", + "@types/node": "^10.1.0", + "long": "^4.0.0" + }, + "bin": { + "apollo-pbjs": "bin/pbjs", + "apollo-pbts": "bin/pbts" + } + }, + "node_modules/apollo-reporting-protobuf/node_modules/@types/node": { + "version": "10.17.60", + "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.60.tgz", + "integrity": "sha512-F0KIgDJfy2nA3zMLmWGKxcH2ZVEtCZXHHdOQs2gSaQ27+lNeEfGxzkIw90aXswATX7AZ33tahPbzy6KAfUreVw==" + }, + "node_modules/apollo-server-core": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-core/-/apollo-server-core-3.13.0.tgz", + "integrity": "sha512-v/g6DR6KuHn9DYSdtQijz8dLOkP78I5JSVJzPkARhDbhpH74QNwrQ2PP2URAPPEDJ2EeZNQDX8PvbYkAKqg+kg==", + "dependencies": { + "@apollo/utils.keyvaluecache": "^1.0.1", + "@apollo/utils.logger": "^1.0.0", + "@apollo/utils.usagereporting": "^1.0.0", + "@apollographql/apollo-tools": "^0.5.3", + "@apollographql/graphql-playground-html": "1.6.29", + "@graphql-tools/mock": "^8.1.2", + "@graphql-tools/schema": "^8.0.0", + "@josephg/resolvable": "^1.0.0", + "apollo-datasource": "^3.3.2", + "apollo-reporting-protobuf": "^3.4.0", + "apollo-server-env": "^4.2.1", + "apollo-server-errors": "^3.3.1", + "apollo-server-plugin-base": "^3.7.2", + "apollo-server-types": "^3.8.0", + "async-retry": "^1.2.1", + "fast-json-stable-stringify": "^2.1.0", + "graphql-tag": "^2.11.0", + "loglevel": "^1.6.8", + "lru-cache": "^6.0.0", + "node-abort-controller": "^3.0.1", + "sha.js": "^2.4.11", + "uuid": "^9.0.0", + "whatwg-mimetype": "^3.0.0" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.dropunuseddefinitions": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.dropunuseddefinitions/-/utils.dropunuseddefinitions-1.1.0.tgz", + "integrity": "sha512-jU1XjMr6ec9pPoL+BFWzEPW7VHHulVdGKMkPAMiCigpVIT11VmCbnij0bWob8uS3ODJ65tZLYKAh/55vLw2rbg==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.keyvaluecache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz", + "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==", + "dependencies": { + "@apollo/utils.logger": "^1.0.0", + "lru-cache": "7.10.1 - 7.13.1" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.keyvaluecache/node_modules/lru-cache": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", + "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", + "engines": { + "node": ">=12" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.logger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", + "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==" + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.printwithreducedwhitespace": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.printwithreducedwhitespace/-/utils.printwithreducedwhitespace-1.1.0.tgz", + "integrity": "sha512-GfFSkAv3n1toDZ4V6u2d7L4xMwLA+lv+6hqXicMN9KELSJ9yy9RzuEXaX73c/Ry+GzRsBy/fdSUGayGqdHfT2Q==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.removealiases": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.removealiases/-/utils.removealiases-1.0.0.tgz", + "integrity": "sha512-6cM8sEOJW2LaGjL/0vHV0GtRaSekrPQR4DiywaApQlL9EdROASZU5PsQibe2MWeZCOhNrPRuHh4wDMwPsWTn8A==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.sortast": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.sortast/-/utils.sortast-1.1.0.tgz", + "integrity": "sha512-VPlTsmUnOwzPK5yGZENN069y6uUHgeiSlpEhRnLFYwYNoJHsuJq2vXVwIaSmts015WTPa2fpz1inkLYByeuRQA==", + "dependencies": { + "lodash.sortby": "^4.7.0" + }, + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.stripsensitiveliterals": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/@apollo/utils.stripsensitiveliterals/-/utils.stripsensitiveliterals-1.2.0.tgz", + "integrity": "sha512-E41rDUzkz/cdikM5147d8nfCFVKovXxKBcjvLEQ7bjZm/cg9zEcXvS6vFY8ugTubI3fn6zoqo0CyU8zT+BGP9w==", + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@apollo/utils.usagereporting": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.usagereporting/-/utils.usagereporting-1.0.1.tgz", + "integrity": "sha512-6dk+0hZlnDbahDBB2mP/PZ5ybrtCJdLMbeNJD+TJpKyZmSY6bA3SjI8Cr2EM9QA+AdziywuWg+SgbWUF3/zQqQ==", + "dependencies": { + "@apollo/usage-reporting-protobuf": "^4.0.0", + "@apollo/utils.dropunuseddefinitions": "^1.1.0", + "@apollo/utils.printwithreducedwhitespace": "^1.1.0", + "@apollo/utils.removealiases": "1.0.0", + "@apollo/utils.sortast": "^1.1.0", + "@apollo/utils.stripsensitiveliterals": "^1.2.0" + }, + "engines": { + "node": ">=12.13.0" + }, + "peerDependencies": { + "graphql": "14.x || 15.x || 16.x" + } + }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/merge": { + "version": "8.3.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/merge/-/merge-8.3.1.tgz", + "integrity": "sha512-BMm99mqdNZbEYeTPK3it9r9S6rsZsQKtlqJsSBknAclXq2pGEfOxjcIZi+kBSkHZKPKCRrYDd5vY0+rUmIHVLg==", + "dependencies": { + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/schema": { + "version": "8.5.1", + "resolved": "https://registry.npmjs.org/@graphql-tools/schema/-/schema-8.5.1.tgz", + "integrity": "sha512-0Esilsh0P/qYcB5DKQpiKeQs/jevzIadNTaT0jeWklPMwNbT7yMX4EqZany7mbeRRlSRwMzNzL5olyFdffHBZg==", + "dependencies": { + "@graphql-tools/merge": "8.3.1", + "@graphql-tools/utils": "8.9.0", + "tslib": "^2.4.0", + "value-or-promise": "1.0.11" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/@graphql-tools/utils": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/@graphql-tools/utils/-/utils-8.9.0.tgz", + "integrity": "sha512-pjJIWH0XOVnYGXCqej8g/u/tsfV4LvLlj0eATKQu5zwnxd/TiTHq7Cg313qUPTFFHZ3PP5wJ15chYVtLDwaymg==", + "dependencies": { + "tslib": "^2.4.0" + }, + "peerDependencies": { + "graphql": "^14.0.0 || ^15.0.0 || ^16.0.0 || ^17.0.0" + } + }, + "node_modules/apollo-server-core/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/apollo-server-core/node_modules/value-or-promise": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.11.tgz", + "integrity": "sha512-41BrgH+dIbCFXClcSapVs5M6GkENd3gQOJpEfPDNa71LsUGMXDL0jMWpI/Rh7WhX+Aalfz2TTS3Zt5pUsbnhLg==", + "engines": { + "node": ">=12" + } + }, + "node_modules/apollo-server-core/node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + }, + "node_modules/apollo-server-env": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/apollo-server-env/-/apollo-server-env-4.2.1.tgz", + "integrity": "sha512-vm/7c7ld+zFMxibzqZ7SSa5tBENc4B0uye9LTfjJwGoQFY5xsUPH5FpO5j0bMUDZ8YYNbrF9SNtzc5Cngcr90g==", + "deprecated": "The `apollo-server-env` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/utils.fetcher` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "dependencies": { + "node-fetch": "^2.6.7" + }, + "engines": { + "node": ">=12.0" + } + }, + "node_modules/apollo-server-errors": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/apollo-server-errors/-/apollo-server-errors-3.3.1.tgz", + "integrity": "sha512-xnZJ5QWs6FixHICXHxUfm+ZWqqxrNuPlQ+kj5m6RtEgIpekOPssH/SD9gf2B4HuWV0QozorrygwZnux8POvyPA==", + "deprecated": "The `apollo-server-errors` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" + } + }, + "node_modules/apollo-server-express": { + "version": "3.13.0", + "resolved": "https://registry.npmjs.org/apollo-server-express/-/apollo-server-express-3.13.0.tgz", + "integrity": "sha512-iSxICNbDUyebOuM8EKb3xOrpIwOQgKxGbR2diSr4HP3IW8T3njKFOoMce50vr+moOCe1ev8BnLcw9SNbuUtf7g==", + "dependencies": { + "@types/accepts": "^1.3.5", + "@types/body-parser": "1.19.2", + "@types/cors": "2.8.12", + "@types/express": "4.17.14", + "@types/express-serve-static-core": "4.17.31", + "accepts": "^1.3.5", + "apollo-server-core": "^3.13.0", + "apollo-server-types": "^3.8.0", + "body-parser": "^1.19.0", + "cors": "^2.8.5", + "parseurl": "^1.3.3" + }, + "engines": { + "node": ">=12.0" + }, + "peerDependencies": { + "express": "^4.17.1", + "graphql": "^15.3.0 || ^16.0.0" + } + }, + "node_modules/apollo-server-express/node_modules/@types/body-parser": { + "version": "1.19.2", + "resolved": "https://registry.npmjs.org/@types/body-parser/-/body-parser-1.19.2.tgz", + "integrity": "sha512-ALYone6pm6QmwZoAgeyNksccT9Q4AWZQ6PvfwR37GT6r6FWUPguq6sUmNGSMV2Wr761oQoBxwGGa6DR5o1DC9g==", + "dependencies": { + "@types/connect": "*", + "@types/node": "*" + } + }, + "node_modules/apollo-server-express/node_modules/@types/express": { + "version": "4.17.14", + "resolved": "https://registry.npmjs.org/@types/express/-/express-4.17.14.tgz", + "integrity": "sha512-TEbt+vaPFQ+xpxFLFssxUDXj5cWCxZJjIcB7Yg0k0GMHGtgtQgpvx/MUQUeAkNbA9AAGrwkAsoeItdTgS7FMyg==", + "dependencies": { + "@types/body-parser": "*", + "@types/express-serve-static-core": "^4.17.18", + "@types/qs": "*", + "@types/serve-static": "*" + } + }, + "node_modules/apollo-server-express/node_modules/@types/express-serve-static-core": { + "version": "4.17.31", + "resolved": "https://registry.npmjs.org/@types/express-serve-static-core/-/express-serve-static-core-4.17.31.tgz", + "integrity": "sha512-DxMhY+NAsTwMMFHBTtJFNp5qiHKJ7TeqOo23zVEM9alT1Ml27Q3xcTH0xwxn7Q0BbMcVEJOs/7aQtUWupUQN3Q==", + "dependencies": { + "@types/node": "*", + "@types/qs": "*", + "@types/range-parser": "*" } }, - "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==", + "node_modules/apollo-server-plugin-base": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/apollo-server-plugin-base/-/apollo-server-plugin-base-3.7.2.tgz", + "integrity": "sha512-wE8dwGDvBOGehSsPTRZ8P/33Jan6/PmL0y0aN/1Z5a5GcbFhDaaJCjK5cav6npbbGL2DPKK0r6MPXi3k3N45aw==", + "deprecated": "The `apollo-server-plugin-base` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", + "dependencies": { + "apollo-server-types": "^3.8.0" + }, "engines": { - "node": ">=8" + "node": ">=12.0" + }, + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" } }, - "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==", + "node_modules/apollo-server-types": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/apollo-server-types/-/apollo-server-types-3.8.0.tgz", + "integrity": "sha512-ZI/8rTE4ww8BHktsVpb91Sdq7Cb71rdSkXELSwdSR0eXu600/sY+1UXhTWdiJvk+Eq5ljqoHLwLbY2+Clq2b9A==", + "deprecated": "The `apollo-server-types` package is part of Apollo Server v2 and v3, which are now deprecated (end-of-life October 22nd 2023 and October 22nd 2024, respectively). This package's functionality is now found in the `@apollo/server` package. See https://www.apollographql.com/docs/apollo-server/previous-versions/ for more details.", "dependencies": { - "color-convert": "^2.0.1" + "@apollo/utils.keyvaluecache": "^1.0.1", + "@apollo/utils.logger": "^1.0.0", + "apollo-reporting-protobuf": "^3.4.0", + "apollo-server-env": "^4.2.1" }, "engines": { - "node": ">=8" + "node": ">=12.0" }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" + "peerDependencies": { + "graphql": "^15.3.0 || ^16.0.0" } }, - "node_modules/any-promise": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/any-promise/-/any-promise-1.3.0.tgz", - "integrity": "sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A==" - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", + "node_modules/apollo-server-types/node_modules/@apollo/utils.keyvaluecache": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@apollo/utils.keyvaluecache/-/utils.keyvaluecache-1.0.2.tgz", + "integrity": "sha512-p7PVdLPMnPzmXSQVEsy27cYEjVON+SH/Wb7COyW3rQN8+wJgT1nv9jZouYtztWW8ZgTkii5T6tC9qfoDREd4mg==", "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, + "@apollo/utils.logger": "^1.0.0", + "lru-cache": "7.10.1 - 7.13.1" + } + }, + "node_modules/apollo-server-types/node_modules/@apollo/utils.logger": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@apollo/utils.logger/-/utils.logger-1.0.1.tgz", + "integrity": "sha512-XdlzoY7fYNK4OIcvMD2G94RoFZbzTQaNP0jozmqqMudmaGo2I/2Jx71xlDJ801mWA/mbYRihyaw6KJii7k5RVA==" + }, + "node_modules/apollo-server-types/node_modules/lru-cache": { + "version": "7.13.1", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.13.1.tgz", + "integrity": "sha512-CHqbAq7NFlW3RSnoWXLJBxCWaZVBrfa9UEHId2M3AW8iEBurbqduNexEUCGc3SHc6iCYXNJCDi903LajSVAEPQ==", "engines": { - "node": ">= 8" + "node": ">=12" } }, "node_modules/app-root-path": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/app-root-path/-/app-root-path-3.1.0.tgz", "integrity": "sha512-biN3PwB2gUtjaYy/isrU3aNWI5w+fAfvHkSvCKeQGxhmYpwKFUxudR3Yya+KqVRHBmEDYh+/lTozYCFbmzX4nA==", + "peer": true, "engines": { "node": ">= 6.0.0" } @@ -2930,11 +4090,18 @@ "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==" }, + "node_modules/async-retry": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/async-retry/-/async-retry-1.3.3.tgz", + "integrity": "sha512-wfr/jstw9xNi/0teMHrRW7dsz3Lt5ARhYNZ2ewpadnhaIp5mbALhOAP+EAdsC7t4Z6wqsDVv9+W6gm1Dk9mEyw==", + "dependencies": { + "retry": "0.13.1" + } + }, "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 + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==" }, "node_modules/available-typed-arrays": { "version": "1.0.5", @@ -3064,6 +4231,11 @@ "@babel/core": "^7.0.0" } }, + "node_modules/backo2": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/backo2/-/backo2-1.0.2.tgz", + "integrity": "sha512-zj6Z6M7Eq+PBZ7PQxl5NT665MvJdAkzp0f60nAJ+sLaSCBPMwVak5ZegFbgVCzFcCJTKFoMizvM5Ld7+JrRJHA==" + }, "node_modules/balanced-match": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", @@ -3489,6 +4661,7 @@ "version": "2.1.11", "resolved": "https://registry.npmjs.org/cli-highlight/-/cli-highlight-2.1.11.tgz", "integrity": "sha512-9KDcoEVwyUXrjcJNvHD0NFc/hiwe/WPVYIleQh2O1N2Zro5gWJZ/K+3DGn8w8P/F6FxOgzyC5bxDyHIgCSPhGg==", + "peer": true, "dependencies": { "chalk": "^4.0.0", "highlight.js": "^10.7.1", @@ -3509,6 +4682,7 @@ "version": "7.0.4", "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", + "peer": true, "dependencies": { "string-width": "^4.2.0", "strip-ansi": "^6.0.0", @@ -3519,6 +4693,7 @@ "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "peer": true, "dependencies": { "ansi-styles": "^4.0.0", "string-width": "^4.1.0", @@ -3535,6 +4710,7 @@ "version": "16.2.0", "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", + "peer": true, "dependencies": { "cliui": "^7.0.2", "escalade": "^3.1.1", @@ -3552,6 +4728,7 @@ "version": "20.2.9", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", + "peer": true, "engines": { "node": ">=10" } @@ -3774,7 +4951,6 @@ "version": "1.0.8", "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", - "dev": true, "dependencies": { "delayed-stream": "~1.0.0" }, @@ -3957,6 +5133,17 @@ "integrity": "sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==", "devOptional": true }, + "node_modules/cross-inspect": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cross-inspect/-/cross-inspect-1.0.0.tgz", + "integrity": "sha512-4PFfn4b5ZN6FMNGSZlyb7wUhuN8wvj8t/VQHZdM4JsDcruGJ8L2kf9zao98QIrBPFCpdk27qst/AGTl7pL3ypQ==", + "dependencies": { + "tslib": "^2.4.0" + }, + "engines": { + "node": ">=16.0.0" + } + }, "node_modules/cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", @@ -3970,10 +5157,16 @@ "node": ">= 8" } }, + "node_modules/cssfilter": { + "version": "0.0.10", + "resolved": "https://registry.npmjs.org/cssfilter/-/cssfilter-0.0.10.tgz", + "integrity": "sha512-FAaLDaplstoRsDR8XGYH51znUN0UY7nMc6Z9/fvE8EXGwvJE9hu7W2vHwx1+bd6gCYnln9nLbzxFTrcO9YQDZw==" + }, "node_modules/date-fns": { "version": "2.30.0", "resolved": "https://registry.npmjs.org/date-fns/-/date-fns-2.30.0.tgz", "integrity": "sha512-fnULvOpxnC5/Vg3NCiWelDsLiUc9bRwAPs/+LfTLNvetFCtCTN+yQz15C/fs4AwX1R9K5GLtLfn8QW+dWisaAw==", + "peer": true, "dependencies": { "@babel/runtime": "^7.21.0" }, @@ -4236,7 +5429,6 @@ "version": "1.0.0", "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", - "dev": true, "engines": { "node": ">=0.4.0" } @@ -4338,6 +5530,14 @@ "node": ">=12" } }, + "node_modules/dset": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/dset/-/dset-3.1.3.tgz", + "integrity": "sha512-20TuZZHCEZ2O71q9/+8BwKwZ0QtD9D8ObhrihJPr+vLLYlSuAU3/zL4cSlgbfeoGHTjCSJBa7NGcrF9/Bx/WJQ==", + "engines": { + "node": ">=4" + } + }, "node_modules/eastasianwidth": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", @@ -5310,7 +6510,6 @@ "version": "3.3.2", "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.3.2.tgz", "integrity": "sha512-oX2ruAFQwf/Orj8m737Y5adxDQO0LAB7/S5MnxCdTNDd4p6BsyIVsv9JQsATbTSq8KHRpLwIHbVlUNatxd+1Ow==", - "dev": true, "dependencies": { "@nodelib/fs.stat": "^2.0.2", "@nodelib/fs.walk": "^1.2.3", @@ -5342,7 +6541,6 @@ "version": "1.15.0", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.15.0.tgz", "integrity": "sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw==", - "dev": true, "dependencies": { "reusify": "^1.0.4" } @@ -5567,7 +6765,6 @@ "version": "4.0.0", "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", - "dev": true, "dependencies": { "asynckit": "^0.4.0", "combined-stream": "^1.0.8", @@ -5903,6 +7100,39 @@ "integrity": "sha512-EtKwoO6kxCL9WO5xipiHTZlSzBm7WLT627TqC/uVRd0HKmq8NXyebnNYxDoBi7wt8eTWrUrKXCOVaFq9x1kgag==", "dev": true }, + "node_modules/graphql": { + "version": "16.8.1", + "resolved": "https://registry.npmjs.org/graphql/-/graphql-16.8.1.tgz", + "integrity": "sha512-59LZHPdGZVh695Ud9lRzPBVTtlX9ZCV150Er2W43ro37wVof0ctenSaskPPjN7lVTIN8mSZt8PHUNKZuNQUuxw==", + "engines": { + "node": "^12.22.0 || ^14.16.0 || ^16.0.0 || >=17.0.0" + } + }, + "node_modules/graphql-tag": { + "version": "2.12.6", + "resolved": "https://registry.npmjs.org/graphql-tag/-/graphql-tag-2.12.6.tgz", + "integrity": "sha512-FdSNcu2QQcWnM2VNvSCCDCVS5PpPqpzgFT8+GXzqJuoDd0CBncxCY278u4mhRO7tMgo2JjgJA5aZ+nWSQ/Z+xg==", + "dependencies": { + "tslib": "^2.1.0" + }, + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": "^0.9.0 || ^0.10.0 || ^0.11.0 || ^0.12.0 || ^0.13.0 || ^14.0.0 || ^15.0.0 || ^16.0.0" + } + }, + "node_modules/graphql-ws": { + "version": "5.14.3", + "resolved": "https://registry.npmjs.org/graphql-ws/-/graphql-ws-5.14.3.tgz", + "integrity": "sha512-F/i2xNIVbaEF2xWggID0X/UZQa2V8kqKDPO8hwmu53bVOcTL7uNkxnexeEgSCVxYBQUTUNEI8+e4LO1FOhKPKQ==", + "engines": { + "node": ">=10" + }, + "peerDependencies": { + "graphql": ">=0.11 <=16" + } + }, "node_modules/has-bigints": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/has-bigints/-/has-bigints-1.0.2.tgz", @@ -6008,6 +7238,7 @@ "version": "10.7.3", "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.7.3.tgz", "integrity": "sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A==", + "peer": true, "engines": { "node": "*" } @@ -6658,6 +7889,11 @@ "node": ">=8" } }, + "node_modules/iterall": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/iterall/-/iterall-1.3.0.tgz", + "integrity": "sha512-QZ9qOMdF+QLHxy1QIpUHUU1D5pS2CG2P69LF6L6CPjPYA/XMOmKV3PZpawHoAjHNyB0swdVTRxdYT4tbBbxqwg==" + }, "node_modules/iterare": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/iterare/-/iterare-1.2.1.tgz", @@ -7760,6 +8996,16 @@ "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", "dev": true }, + "node_modules/lodash.omit": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.omit/-/lodash.omit-4.5.0.tgz", + "integrity": "sha512-XeqSp49hNGmlkj2EJlfrQFIzQ6lXdNro9sddtQzcJY8QaoC2GO0DT7xaIokHeyM+mIT0mPMlPvkYzg2xCuHdZg==" + }, + "node_modules/lodash.sortby": { + "version": "4.7.0", + "resolved": "https://registry.npmjs.org/lodash.sortby/-/lodash.sortby-4.7.0.tgz", + "integrity": "sha512-HDWXG8isMntAyRF5vZ7xKuEvOhT4AhlRt/3czTSjvGUxjYCBVRQY48ViDHyfYz9VIoBkW4TMGQNapx+l3RUwdA==" + }, "node_modules/log-symbols": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", @@ -7992,6 +9238,23 @@ "node": ">=0.1.90" } }, + "node_modules/loglevel": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/loglevel/-/loglevel-1.9.1.tgz", + "integrity": "sha512-hP3I3kCrDIMuRwAwHltphhDM1r8i55H33GgqjXbrisuJhF4kRhW1dNuxsRklp4bXl8DSdLaNLuiL4A/LWRfxvg==", + "engines": { + "node": ">= 0.6.0" + }, + "funding": { + "type": "tidelift", + "url": "https://tidelift.com/funding/github/npm/loglevel" + } + }, + "node_modules/long": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/long/-/long-4.0.0.tgz", + "integrity": "sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA==" + }, "node_modules/lru-cache": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", @@ -8086,7 +9349,6 @@ "version": "1.4.1", "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.4.1.tgz", "integrity": "sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg==", - "dev": true, "engines": { "node": ">= 8" } @@ -8103,7 +9365,6 @@ "version": "4.0.5", "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.5.tgz", "integrity": "sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA==", - "dev": true, "dependencies": { "braces": "^3.0.2", "picomatch": "^2.3.1" @@ -8219,6 +9480,7 @@ "version": "2.7.0", "resolved": "https://registry.npmjs.org/mz/-/mz-2.7.0.tgz", "integrity": "sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q==", + "peer": true, "dependencies": { "any-promise": "^1.0.0", "object-assign": "^4.0.1", @@ -8256,6 +9518,116 @@ "winston": "^3.0.0" } }, + "node_modules/nestjs-prisma": { + "version": "0.22.0", + "resolved": "https://registry.npmjs.org/nestjs-prisma/-/nestjs-prisma-0.22.0.tgz", + "integrity": "sha512-vseCukdWYijWxQBIdtC1XVSwMNZLZMjJen0ostsaRWaQ7yF8ny2Xruu0mA1d/t16uPOMUVUkSZro6JikOEkcuw==", + "dependencies": { + "@angular-devkit/core": "^13.3.0", + "@angular-devkit/schematics": "^13.3.0", + "@schematics/angular": "~13.3.0" + }, + "peerDependencies": { + "@nestjs/common": "^7.0.0 || ^8.0.0 || ^9.0.0 || ^10.0.0", + "@prisma/client": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0", + "prisma": "^2.0.0 || ^3.0.0 || ^4.0.0 || ^5.0.0" + } + }, + "node_modules/nestjs-prisma/node_modules/@angular-devkit/core": { + "version": "13.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/core/-/core-13.3.11.tgz", + "integrity": "sha512-rfqoLMRYhlz0wzKlHx7FfyIyQq8dKTsmbCoIVU1cEIH0gyTMVY7PbVzwRRcO6xp5waY+0hA+0Brriujpuhkm4w==", + "dependencies": { + "ajv": "8.9.0", + "ajv-formats": "2.1.1", + "fast-json-stable-stringify": "2.1.0", + "magic-string": "0.25.7", + "rxjs": "6.6.7", + "source-map": "0.7.3" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + }, + "peerDependencies": { + "chokidar": "^3.5.2" + }, + "peerDependenciesMeta": { + "chokidar": { + "optional": true + } + } + }, + "node_modules/nestjs-prisma/node_modules/@angular-devkit/schematics": { + "version": "13.3.11", + "resolved": "https://registry.npmjs.org/@angular-devkit/schematics/-/schematics-13.3.11.tgz", + "integrity": "sha512-ben+EGXpCrClnIVAAnEQmhQdKmnnqFhMp5BqMxgOslSYBAmCutLA6rBu5vsc8kZcGian1wt+lueF7G1Uk5cGBg==", + "dependencies": { + "@angular-devkit/core": "13.3.11", + "jsonc-parser": "3.0.0", + "magic-string": "0.25.7", + "ora": "5.4.1", + "rxjs": "6.6.7" + }, + "engines": { + "node": "^12.20.0 || ^14.15.0 || >=16.10.0", + "npm": "^6.11.0 || ^7.5.6 || >=8.0.0", + "yarn": ">= 1.13.0" + } + }, + "node_modules/nestjs-prisma/node_modules/ajv": { + "version": "8.9.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-8.9.0.tgz", + "integrity": "sha512-qOKJyNj/h+OWx7s5DePL6Zu1KeM9jPZhwBqs+7DzP6bGOvqzVCSf0xueYmVuaC/oQ/VtS2zLMLHdQFbkka+XDQ==", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "json-schema-traverse": "^1.0.0", + "require-from-string": "^2.0.2", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/nestjs-prisma/node_modules/jsonc-parser": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-3.0.0.tgz", + "integrity": "sha512-fQzRfAbIBnR0IQvftw9FJveWiHp72Fg20giDrHz6TdfB12UH/uue0D3hm57UB5KgAVuniLMCaS8P1IMj9NR7cA==" + }, + "node_modules/nestjs-prisma/node_modules/magic-string": { + "version": "0.25.7", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", + "dependencies": { + "sourcemap-codec": "^1.4.4" + } + }, + "node_modules/nestjs-prisma/node_modules/rxjs": { + "version": "6.6.7", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.7.tgz", + "integrity": "sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ==", + "dependencies": { + "tslib": "^1.9.0" + }, + "engines": { + "npm": ">=2.0.0" + } + }, + "node_modules/nestjs-prisma/node_modules/source-map": { + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", + "engines": { + "node": ">= 8" + } + }, + "node_modules/nestjs-prisma/node_modules/tslib": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.14.1.tgz", + "integrity": "sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg==" + }, "node_modules/node-abort-controller": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/node-abort-controller/-/node-abort-controller-3.1.1.tgz", @@ -8617,12 +9989,14 @@ "node_modules/parse5": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-5.1.1.tgz", - "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==" + "integrity": "sha512-ugq4DFI0Ptb+WWjAdOK16+u/nHfiIrcE+sh8kZMaM0WllQKLI9rOUq6c2b7cwPkXdzfQESqvoqK6ug7U/Yyzug==", + "peer": true }, "node_modules/parse5-htmlparser2-tree-adapter": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-6.0.1.tgz", "integrity": "sha512-qPuWvbLgvDGilKc5BoicRovlT4MtYT6JfJyBOMDsKoiT+GiuP5qyrPCnR9HcPECIJJmZh5jRndyNThnhhb/vlA==", + "peer": true, "dependencies": { "parse5": "^6.0.1" } @@ -8630,7 +10004,8 @@ "node_modules/parse5-htmlparser2-tree-adapter/node_modules/parse5": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/parse5/-/parse5-6.0.1.tgz", - "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==" + "integrity": "sha512-Ofn/CTFzRGTTxwpNEs9PP93gXShHcTq255nzRYSKe8AkVpZY7e1fpmTfOyoIvjP5HG7Z2ZM7VS9PPhQGW2pOpw==", + "peer": true }, "node_modules/parseurl": { "version": "1.3.3", @@ -8995,6 +10370,21 @@ "url": "https://github.com/chalk/ansi-styles?sponsor=1" } }, + "node_modules/prisma": { + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/prisma/-/prisma-5.8.1.tgz", + "integrity": "sha512-N6CpjzECnUHZ5beeYpDzkt2rYpEdAeqXX2dweu6BoQaeYkNZrC/WJHM+5MO/uidFHTak8QhkPKBWck1o/4MD4A==", + "hasInstallScript": true, + "dependencies": { + "@prisma/engines": "5.8.1" + }, + "bin": { + "prisma": "build/index.js" + }, + "engines": { + "node": ">=16.13" + } + }, "node_modules/process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", @@ -9076,7 +10466,6 @@ "version": "1.2.3", "resolved": "https://registry.npmjs.org/queue-microtask/-/queue-microtask-1.2.3.tgz", "integrity": "sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A==", - "dev": true, "funding": [ { "type": "github", @@ -9177,7 +10566,8 @@ "node_modules/regenerator-runtime": { "version": "0.14.0", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.0.tgz", - "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==" + "integrity": "sha512-srw17NI0TUWHuGa5CFGGmhfNIeja30WMBfbslPNhf6JrqQlLN5gcrvig1oqPxiVaXb0oW0XRKtH6Nngs5lKCIA==", + "peer": true }, "node_modules/regexp.prototype.flags": { "version": "1.5.1", @@ -9313,11 +10703,18 @@ "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==" }, + "node_modules/retry": { + "version": "0.13.1", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.13.1.tgz", + "integrity": "sha512-XQBQ3I8W1Cge0Seh+6gjj03LbmRFWuoszgK9ooCpwYIrhhoO80pfq4cUkU5DkknwfOfFteRwlZ56PYOGYyFWdg==", + "engines": { + "node": ">= 4" + } + }, "node_modules/reusify": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", - "dev": true, "engines": { "iojs": ">=1.0.0", "node": ">=0.10.0" @@ -9373,7 +10770,6 @@ "version": "1.2.0", "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.2.0.tgz", "integrity": "sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA==", - "dev": true, "funding": [ { "type": "github", @@ -9812,6 +11208,12 @@ "node": ">=0.10.0" } }, + "node_modules/sourcemap-codec": { + "version": "1.4.8", + "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", + "deprecated": "Please use @jridgewell/sourcemap-codec instead" + }, "node_modules/split2": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", @@ -10046,6 +11448,55 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/subscriptions-transport-ws": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/subscriptions-transport-ws/-/subscriptions-transport-ws-0.11.0.tgz", + "integrity": "sha512-8D4C6DIH5tGiAIpp5I0wD/xRlNiZAPGHygzCe7VzyzUoxHtawzjNAY9SUTXU05/EY2NMY9/9GF0ycizkXr1CWQ==", + "deprecated": "The `subscriptions-transport-ws` package is no longer maintained. We recommend you use `graphql-ws` instead. For help migrating Apollo software to `graphql-ws`, see https://www.apollographql.com/docs/apollo-server/data/subscriptions/#switching-from-subscriptions-transport-ws For general help using `graphql-ws`, see https://github.com/enisdenjo/graphql-ws/blob/master/README.md", + "dependencies": { + "backo2": "^1.0.2", + "eventemitter3": "^3.1.0", + "iterall": "^1.2.1", + "symbol-observable": "^1.0.4", + "ws": "^5.2.0 || ^6.0.0 || ^7.0.0" + }, + "peerDependencies": { + "graphql": "^15.7.2 || ^16.0.0" + } + }, + "node_modules/subscriptions-transport-ws/node_modules/eventemitter3": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-3.1.2.tgz", + "integrity": "sha512-tvtQIeLVHjDkJYnzf2dgVMxfuSGJeM/7UCG17TT4EumTfNtF+0nebF/4zWOIkCreAbtNqhGEboB6BWrwqNaw4Q==" + }, + "node_modules/subscriptions-transport-ws/node_modules/symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/subscriptions-transport-ws/node_modules/ws": { + "version": "7.5.9", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.9.tgz", + "integrity": "sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q==", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/superagent": { "version": "8.1.2", "resolved": "https://registry.npmjs.org/superagent/-/superagent-8.1.2.tgz", @@ -10296,6 +11747,7 @@ "version": "3.3.1", "resolved": "https://registry.npmjs.org/thenify/-/thenify-3.3.1.tgz", "integrity": "sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw==", + "peer": true, "dependencies": { "any-promise": "^1.0.0" } @@ -10304,6 +11756,7 @@ "version": "1.6.0", "resolved": "https://registry.npmjs.org/thenify-all/-/thenify-all-1.6.0.tgz", "integrity": "sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA==", + "peer": true, "dependencies": { "thenify": ">= 3.1.0 < 4" }, @@ -10670,6 +12123,7 @@ "version": "0.3.17", "resolved": "https://registry.npmjs.org/typeorm/-/typeorm-0.3.17.tgz", "integrity": "sha512-UDjUEwIQalO9tWw9O2A4GU+sT3oyoUXheHJy4ft+RFdnRdQctdQ34L9SqE2p7LdwzafHx1maxT+bqXON+Qnmig==", + "peer": true, "dependencies": { "@sqltools/formatter": "^1.2.5", "app-root-path": "^3.1.0", @@ -10775,6 +12229,7 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "peer": true, "dependencies": { "balanced-match": "^1.0.0" } @@ -10797,6 +12252,7 @@ "url": "https://feross.org/support" } ], + "peer": true, "dependencies": { "base64-js": "^1.3.1", "ieee754": "^1.2.1" @@ -10806,6 +12262,7 @@ "version": "8.1.0", "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", + "peer": true, "dependencies": { "fs.realpath": "^1.0.0", "inflight": "^1.0.4", @@ -10824,6 +12281,7 @@ "version": "5.1.6", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "peer": true, "dependencies": { "brace-expansion": "^2.0.1" }, @@ -10835,6 +12293,7 @@ "version": "2.1.6", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-2.1.6.tgz", "integrity": "sha512-+hEnITedc8LAtIP9u3HJDFIdcLV2vXP33sqLLIzkv1Db1zO/1OxbvYf0Y1OC/S/Qo5dxHXepofhmxL02PsKe+A==", + "peer": true, "bin": { "mkdirp": "dist/cjs/src/bin.js" }, @@ -10991,6 +12450,14 @@ "node": ">=10.12.0" } }, + "node_modules/value-or-promise": { + "version": "1.0.12", + "resolved": "https://registry.npmjs.org/value-or-promise/-/value-or-promise-1.0.12.tgz", + "integrity": "sha512-Z6Uz+TYwEqE7ZN50gwn+1LCVo9ZVrpxRPOhOLnncYkY1ZzOYtrX8Fwf/rFktZ8R5mJms6EZf5TqNOMeZmnPq9Q==", + "engines": { + "node": ">=12" + } + }, "node_modules/vary": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", @@ -11115,6 +12582,14 @@ "node": ">=4.0" } }, + "node_modules/whatwg-mimetype": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-3.0.0.tgz", + "integrity": "sha512-nt+N2dzIutVRxARx1nghPKGv1xHikU7HKdfafKkLNLindmPU/ch3U31NOCGGA/dmPcmb1VlofO0vnKAcsm0o/Q==", + "engines": { + "node": ">=12" + } + }, "node_modules/whatwg-url": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", @@ -11358,12 +12833,52 @@ "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", "dev": true }, + "node_modules/ws": { + "version": "8.14.2", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.14.2.tgz", + "integrity": "sha512-wEBG1ftX4jcglPxgFCMJmZ2PLtSbJ2Peg6TmpJFTbe9GZYOQCDPdMYu/Tm0/bGZkw8paZnJY45J4K2PZrLYq8g==", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, "node_modules/xml": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/xml/-/xml-1.0.1.tgz", "integrity": "sha512-huCv9IH9Tcf95zuYCsQraZtWnJvBtLVE0QHMOs8bWyZAFZNDcYjsPq1nEx8jKA9y+Beo9v+7OBPRisQTjinQMw==", "dev": true }, + "node_modules/xss": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/xss/-/xss-1.0.14.tgz", + "integrity": "sha512-og7TEJhXvn1a7kzZGQ7ETjdQVS2UfZyTlsEdDOqvQF7GoxNfY+0YLCzBy1kPdsDDx4QuNAonQPddpsn6Xl/7sw==", + "dependencies": { + "commander": "^2.20.3", + "cssfilter": "0.0.10" + }, + "bin": { + "xss": "bin/xss" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/xss/node_modules/commander": { + "version": "2.20.3", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" + }, "node_modules/xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", diff --git a/backend/package.json b/backend/package.json index 8365a024..dc474575 100644 --- a/backend/package.json +++ b/backend/package.json @@ -4,6 +4,7 @@ "main": "index.js", "scripts": { "prebuild": "rimraf dist", + "prisma-generate": "prisma generate", "build": "nest build", "format": "prettier --write \"src/**/*.ts\" \"test/**/*.ts\"", "start": "nest start", @@ -21,25 +22,33 @@ "test:e2e": "jest --config ./test/jest-e2e.json" }, "dependencies": { + "@apollo/server": "^4.10.0", + "@nestjs/apollo": "^12.0.11", "@nestjs/cli": "^10.1.16", "@nestjs/common": "^10.0.0", "@nestjs/config": "^3.0.0", "@nestjs/core": "^10.0.0", + "@nestjs/graphql": "^12.0.11", "@nestjs/platform-express": "^10.0.0", "@nestjs/schematics": "^10.0.0", "@nestjs/swagger": "^7.0.3", "@nestjs/testing": "^10.0.0", "@nestjs/typeorm": "^10.0.0", + "@prisma/client": "^5.8.1", + "apollo-server-express": "^3.13.0", "dotenv": "^16.0.1", + "graphql": "^16.8.1", + "graphql-ws": "^5.14.3", + "helmet": "^7.0.0", + "nest-winston": "^1.9.4", + "nestjs-prisma": "^0.22.0", "pg": "^8.11.3", + "prisma": "^5.8.1", "reflect-metadata": "^0.1.13", "rimraf": "^5.0.0", "rxjs": "^7.8.0", "swagger-ui-express": "^5.0.0", - "typeorm": "^0.3.17", - "winston": "^3.11.0", - "nest-winston": "^1.9.4", - "helmet": "^7.0.0" + "winston": "^3.11.0" }, "devDependencies": { "@types/express": "^4.17.15", diff --git a/backend/prisma/schema.prisma b/backend/prisma/schema.prisma new file mode 100644 index 00000000..044a769f --- /dev/null +++ b/backend/prisma/schema.prisma @@ -0,0 +1,20 @@ +// This is your Prisma schema file, +// learn more about it in the docs: https://pris.ly/d/prisma-schema + +generator client { + provider = "prisma-client-js" + output = "../node_modules/.prisma/client" +} + +datasource db { + provider = "postgresql" + url = env("DATABASE_URL") +} + +model User { + id Int @id @default(autoincrement()) @map("id") + name String @map("name") + email String + + @@map("users") +} diff --git a/backend/schema.gql b/backend/schema.gql new file mode 100644 index 00000000..2653b499 --- /dev/null +++ b/backend/schema.gql @@ -0,0 +1,22 @@ +# ------------------------------------------------------ +# THIS FILE WAS AUTOMATICALLY GENERATED (DO NOT MODIFY) +# ------------------------------------------------------ + +type User { + id: ID! + name: String! + email: String! +} + +type Query { + users: [User!]! +} + +type Mutation { + createUser(createUserInput: CreateUserInput!): User! +} + +input CreateUserInput { + name: String! + email: String! +} \ No newline at end of file diff --git a/backend/src/app.module.ts b/backend/src/app.module.ts index ec261baf..e915f6f8 100644 --- a/backend/src/app.module.ts +++ b/backend/src/app.module.ts @@ -1,28 +1,23 @@ import "dotenv/config"; import { MiddlewareConsumer, Module } from '@nestjs/common'; -import {TypeOrmModule} from "@nestjs/typeorm"; import {ConfigModule} from "@nestjs/config"; import {AppController} from "./app.controller"; import {AppService} from "./app.service"; -import {UsersModule} from "./users/users.module"; import { HTTPLoggerMiddleware } from './middleware/req.res.logger'; +import { UsersModule } from "./users/users.module"; +import { PrismaModule } from "./prisma/prisma.module"; +import { GraphQLModule } from "@nestjs/graphql"; +import { ApolloDriver, ApolloDriverConfig } from "@nestjs/apollo"; @Module({ imports: [ ConfigModule.forRoot(), - TypeOrmModule.forRoot({ - type: "postgres", - host: process.env.POSTGRES_HOST || "127.0.0.1", - port: 5432, - database: process.env.POSTGRES_DATABASE || "postgres", - username: process.env.POSTGRES_USER || "postgres", - password: process.env.POSTGRES_PASSWORD || "postgres", // helps in UT and e2e testing - // entities: [User], - autoLoadEntities: true, // Auto load all entities regiestered by typeorm forFeature method. - schema: "users", - //logging: "all" - }), UsersModule, + PrismaModule, + GraphQLModule.forRoot({ + driver: ApolloDriver, + autoSchemaFile: 'schema.gql', + }), ], controllers: [AppController], providers: [AppService], diff --git a/backend/src/app.ts b/backend/src/app.ts index f77062ab..ea25a6d3 100644 --- a/backend/src/app.ts +++ b/backend/src/app.ts @@ -14,7 +14,13 @@ export async function bootstrap() { await NestFactory.create(AppModule, { logger: customLogger, }); - app.use(helmet()); + app.use(helmet({ + contentSecurityPolicy: { + directives: { + "script-src": ["'self'", "cdn.jsdelivr.net", "'unsafe-inline'"] + } + } + })); app.enableCors(); app.set("trust proxy", 1); app.enableShutdownHooks(); diff --git a/backend/src/main.ts b/backend/src/main.ts index 900459c5..221075f6 100644 --- a/backend/src/main.ts +++ b/backend/src/main.ts @@ -1,10 +1,13 @@ import {NestExpressApplication} from "@nestjs/platform-express"; import {bootstrap} from "./app"; import {Logger} from "@nestjs/common"; +import dotenv from 'dotenv'; const logger = new Logger('NestApplication'); +dotenv.config(); bootstrap().then(async (app: NestExpressApplication) => { - await app.listen(3000); + const port = process.env.BACKEND_PORT ? Number(process.env.BACKEND_PORT) : 3000; + await app.listen(port); logger.log(`Listening on ${await app.getUrl()}`); }).catch(err=>{ logger.error(err); diff --git a/backend/src/models/user.model.ts b/backend/src/models/user.model.ts new file mode 100644 index 00000000..bae6e696 --- /dev/null +++ b/backend/src/models/user.model.ts @@ -0,0 +1,14 @@ +import { ObjectType, Field, ID } from '@nestjs/graphql'; + +@ObjectType() +export class User { + @Field(type => ID) + id: number; + + @Field() + name: string; + + @Field() + email: string; + +} diff --git a/backend/src/prisma/prisma.module.ts b/backend/src/prisma/prisma.module.ts new file mode 100644 index 00000000..90a1a518 --- /dev/null +++ b/backend/src/prisma/prisma.module.ts @@ -0,0 +1,8 @@ +import { Module } from '@nestjs/common'; +import { PrismaService } from 'nestjs-prisma'; + +@Module({ + providers: [PrismaService], + exports: [PrismaService], +}) +export class PrismaModule {} diff --git a/backend/src/prisma/prisma.service.ts b/backend/src/prisma/prisma.service.ts new file mode 100644 index 00000000..130736c6 --- /dev/null +++ b/backend/src/prisma/prisma.service.ts @@ -0,0 +1,14 @@ +import { Injectable, OnModuleInit, OnModuleDestroy } from '@nestjs/common'; +import { PrismaClient } from '@prisma/client'; + +@Injectable() +export class PrismaService extends PrismaClient implements OnModuleInit, OnModuleDestroy { + + async onModuleInit() { + await this.$connect(); + } + + async onModuleDestroy() { + await this.$disconnect(); + } +} diff --git a/backend/src/users/dto/create-user.input.ts b/backend/src/users/dto/create-user.input.ts new file mode 100644 index 00000000..ee9aadb1 --- /dev/null +++ b/backend/src/users/dto/create-user.input.ts @@ -0,0 +1,11 @@ +import { InputType, Field } from '@nestjs/graphql'; + +@InputType() +export class CreateUserInput { + @Field() + name: string; + + @Field() + email: string; + +} diff --git a/backend/src/users/entities/users.entity.ts b/backend/src/users/entities/users.entity.ts deleted file mode 100644 index f03d039e..00000000 --- a/backend/src/users/entities/users.entity.ts +++ /dev/null @@ -1,28 +0,0 @@ -import {ApiProperty} from "@nestjs/swagger"; -import {Entity, Column, PrimaryGeneratedColumn} from "typeorm"; - -@Entity() -export class Users { - @ApiProperty({ - example: "1", - description: "The ID of the user", - }) - @PrimaryGeneratedColumn() - id: number; - - @ApiProperty({example: "Peter Green", description: "The name of the user"}) - @Column() - name: string; - - @ApiProperty({ - example: "abc@gmail.com", - description: "The email of the user", - }) - @Column() - email: string; - - constructor(name: string, email: string) { - this.name = name; - this.email = email; - } -} diff --git a/backend/src/users/users.controller.spec.ts b/backend/src/users/users.controller.spec.ts deleted file mode 100644 index cf390ab2..00000000 --- a/backend/src/users/users.controller.spec.ts +++ /dev/null @@ -1,174 +0,0 @@ -import {Test, TestingModule} from "@nestjs/testing"; -import {getRepositoryToken} from "@nestjs/typeorm"; -import {UsersController} from "./users.controller"; -import {UsersService} from "./users.service"; -import {Users} from "./entities/users.entity"; -import * as request from 'supertest'; -import {HttpException, INestApplication} from "@nestjs/common"; -import {CreateUserDto} from "./dto/create-user.dto"; -import {UpdateUserDto} from "./dto/update-user.dto"; -import {UserDto} from "./dto/user.dto"; - -describe("UserController", () => { - let controller: UsersController; - let usersService: UsersService; - let app: INestApplication; - - beforeEach(async () => { - const module: TestingModule = await Test.createTestingModule({ - controllers: [UsersController], - providers: [ - UsersService, - { - provide: getRepositoryToken(Users), - useValue: {}, - }, - ], - }).compile(); - usersService = module.get(UsersService); - controller = module.get(UsersController); - app = module.createNestApplication(); - await app.init(); - }); - // Close the app after each test - afterEach(async () => { - await app.close(); - }); - - it("should be defined", () => { - expect(controller).toBeDefined(); - }); - - describe('create', () => { - it('should call the service create method with the given dto and return the result', async () => { - // Arrange - const createUserDto: CreateUserDto = { - email: 'test@example.com', - name: 'Test User', - }; - const expectedResult = { - id: 1, - ...createUserDto, - }; - jest.spyOn(usersService, 'create').mockResolvedValue(expectedResult); - - // Act - const result = await controller.create(createUserDto); - - // Assert - expect(usersService.create).toHaveBeenCalledWith(createUserDto); - expect(result).toEqual(expectedResult); - }); - }); - describe('findAll', () => { - it('should return an array of users', async () => { - const result: Users[] = []; - result.push({id: 1, name: 'Alice', email: 'test@gmail.com'}); - jest.spyOn(usersService, 'findAll').mockResolvedValue(result); - expect(await controller.findAll()).toBe(result); - }); - }); - describe('findOne', () => { - it('should return a user object', async () => { - const result = new Users('john', 'John Doe'); - result.id = 1; - jest.spyOn(usersService, 'findOne').mockResolvedValue(result); - - expect(await controller.findOne('1')).toBe(result); - }); - }); - describe('update', () => { - it('should update and return a user object', async () => { - const id = '1'; - const updateUserDto: UpdateUserDto = { - email: 'johndoe@example.com', - name: 'John Doe', - }; - const userDto: UserDto = { - id: 1, - name: 'John Doe', - email: 'johndoe@example.com', - }; - jest.spyOn(usersService, 'update').mockResolvedValue(userDto); - - expect(await controller.update(id, updateUserDto)).toBe(userDto); - expect(usersService.update).toHaveBeenCalledWith(+id, updateUserDto); - }); - }); - describe('remove', () => { - it('should remove a user', async () => { - const id = '1'; - jest.spyOn(usersService, 'remove').mockResolvedValue(undefined); - - expect(await controller.remove(id)).toBeUndefined(); - expect(usersService.remove).toHaveBeenCalledWith(+id); - }); - }); - // Test the GET /users/search endpoint - describe('GET /users/search', () => { - // Test with valid query parameters - it('given valid query parameters_should return an array of users with pagination metadata', async () => { - // Mock the usersService.searchUsers method to return a sample result - const result = { - users: [ - {id: 1, name: 'Alice', email: 'alice@example.com'}, - {id: 2, name: 'Adam', email: 'Adam@example.com'}, - ], - page: 1, - limit: 10, - sort: '{"name":"ASC"}', - filter: '[{"key":"name","operation":"like","value":"A"}]', - total: 2, - totalPages: 1, - }; - jest.spyOn(usersService, 'searchUsers').mockImplementation(async () => result); - - // Make a GET request with query parameters and expect a 200 status code and the result object - return request(app.getHttpServer()) - .get('/users/search') - .query({ - page: 1, - limit: 10, - sort: '{"name":"ASC"}', - filter: '[{"key":"name","operation":"like","value":"A"}]', - }) - .expect(200) - .expect(result); - }); - - // Test with invalid query parameters - it('given invalid query parameters_should return a 400 status code with an error message', async () => { - // Make a GET request with invalid query parameters and expect a 400 status code and an error message - return request(app.getHttpServer()) - .get('/users/search') - .query({ - page: 'invalid', - limit: 'invalid', - }) - .expect(400) - .expect({ - statusCode: 400, - message: 'Invalid query parameters' - }); - }); - it('given sort and filter as invalid query parameters_should return a 400 status code with an error message', async () => { - // Make a GET request with invalid query parameters and expect a 400 status code and an error message - jest.spyOn(usersService, 'searchUsers').mockImplementation(async () => { - throw new HttpException('Invalid query parameters', 400) - }); - return request(app.getHttpServer()) - .get('/users/search') - .query({ - page: 1, - limit: 10, - sort: 'invalid', - filter: 'invalid', - }) - .expect(400) - .expect({ - statusCode: 400, - message: 'Invalid query parameters' - }); - }); - }); -}); diff --git a/backend/src/users/users.controller.ts b/backend/src/users/users.controller.ts deleted file mode 100644 index 7374e80b..00000000 --- a/backend/src/users/users.controller.ts +++ /dev/null @@ -1,64 +0,0 @@ -import { - Controller, - Get, - Post, - Body, - Put, - Param, - Delete, Query, HttpException, -} from "@nestjs/common"; -import {ApiTags} from "@nestjs/swagger"; -import {UsersService} from "./users.service"; -import {CreateUserDto} from "./dto/create-user.dto"; -import {UpdateUserDto} from "./dto/update-user.dto"; - -@ApiTags("users") -@Controller({path: "users", version: "1"}) -export class UsersController { - constructor(private readonly usersService: UsersService) { - } - - @Post() - create(@Body() createUserDto: CreateUserDto) { - return this.usersService.create(createUserDto); - } - - @Get() - findAll() { - return this.usersService.findAll(); - } - - @Get("search") // it must be ahead of the below Get(":id") to avoid conflict - async searchUsers( - @Query("page") page: number, - @Query("limit") limit: number, - @Query("sort") sort: string, // JSON string to store sort key and sort value, ex: {name: "ASC"} - @Query("filter") filter: string // JSON array for key, operation and value, ex: [{key: "name", operation: "like", value: "Peter"}] - ) { - if (isNaN(page) || isNaN(limit)) { - throw new HttpException("Invalid query parameters", 400); - } - return this.usersService.searchUsers(page, limit, sort, filter); - } - - @Get(":id") - async findOne(@Param("id") id: string) { - const user = await this.usersService.findOne(+id); - if (!user) { - throw new HttpException("User not found.", 404); - } - return user; - } - - @Put(":id") - update(@Param("id") id: string, @Body() updateUserDto: UpdateUserDto) { - return this.usersService.update(+id, updateUserDto); - } - - @Delete(":id") - remove(@Param("id") id: string) { - return this.usersService.remove(+id); - } - - -} diff --git a/backend/src/users/users.module.ts b/backend/src/users/users.module.ts index 1fc554dd..700ef407 100644 --- a/backend/src/users/users.module.ts +++ b/backend/src/users/users.module.ts @@ -1,12 +1,10 @@ -import { Module } from "@nestjs/common"; -import { TypeOrmModule } from "@nestjs/typeorm"; -import { UsersService } from "./users.service"; -import { UsersController } from "./users.controller"; -import { Users } from "./entities/users.entity"; +import { Module } from '@nestjs/common'; +import { UsersService } from './users.service'; +import { UsersResolver } from './users.resolver'; +import { PrismaModule } from 'nestjs-prisma'; @Module({ - imports: [TypeOrmModule.forFeature([Users])], - controllers: [UsersController], - providers: [UsersService], + imports: [PrismaModule], + providers: [UsersService, UsersResolver], }) export class UsersModule {} diff --git a/backend/src/users/users.resolver.ts b/backend/src/users/users.resolver.ts new file mode 100644 index 00000000..1fc0d896 --- /dev/null +++ b/backend/src/users/users.resolver.ts @@ -0,0 +1,21 @@ +import { Resolver, Query, Mutation, Args } from '@nestjs/graphql'; +import { UsersService } from './users.service'; +import { User } from '../models/user.model'; // You need to define this GraphQL model +import { CreateUserInput } from './dto/create-user.input'; // Define GraphQL input types + +@Resolver(of => User) +export class UsersResolver { + constructor(private readonly usersService: UsersService) {} + + @Query(returns => [User]) + async users(): Promise { + return this.usersService.findAll(); + } + + @Mutation(returns => User) + async createUser(@Args('createUserInput') createUserInput: CreateUserInput): Promise { + return this.usersService.createUser(createUserInput); + } + + // Add more queries and mutations as needed +} diff --git a/backend/src/users/users.service.spec.ts b/backend/src/users/users.service.spec.ts index 025f9dda..2c2d3fa7 100644 --- a/backend/src/users/users.service.spec.ts +++ b/backend/src/users/users.service.spec.ts @@ -1,240 +1,80 @@ import type { TestingModule } from "@nestjs/testing"; import { Test } from "@nestjs/testing"; -import { getRepositoryToken } from "@nestjs/typeorm"; -import type { Repository } from "typeorm"; import { UsersService } from "./users.service"; -import { Users } from "./entities/users.entity"; +import { PrismaService } from "nestjs-prisma"; +import { Prisma } from "@prisma/client"; describe("UserService", () => { let service: UsersService; - let repo: Repository; + let prisma: PrismaService; - const oneUserName = "Test Numone"; - const oneUserEamil = "numone@test.com"; - const oneUser = new Users(oneUserName, oneUserEamil); + const savedUser1 = { + id: new Prisma.Decimal(1), + name: "Test Numone", + email: "numone@test.com" + }; + const savedUser2 = { + id: new Prisma.Decimal(2), + name: "Test Numtwo", + email: "numtwo@test.com" + }; + const oneUser = { + id: 1, + name: "Test Numone", + email: "numone@test.com" + }; const updateUser = { - name: oneUserName, - email: oneUserEamil, + id: 1, + name: "Test Numone update", + email: "numoneupdate@test.com" + }; + const updatedUser = { + id: new Prisma.Decimal(1), + name: "Test Numone update", + email: "numoneupdate@test.com" }; - const twoUser = new Users("Test Numtwo", "numtwo@test.com"); + const twoUser = { + id: 2, + name: "Test Numtwo", + email: "numtwo@test.com" + }; - const threeUserName = "Test Numthree"; - const threeUserEamil = "numthree@test.com"; - const newUser = { - name: threeUserName, - email: threeUserEamil, + const threeUser = { + id: 3, + name: "Test Numthree", + email: "numthree@test.com" }; - const threeUser = new Users(threeUserName, threeUserEamil); const userArray = [oneUser, twoUser]; + const savedUserArray = [savedUser1, savedUser2]; beforeEach(async () => { const module: TestingModule = await Test.createTestingModule({ providers: [ UsersService, { - provide: getRepositoryToken(Users), + provide: PrismaService, useValue: { - // mock repository functions for testing - find: jest.fn().mockResolvedValue(userArray), - findOne: jest.fn().mockResolvedValue(oneUser), - create: jest.fn().mockReturnValue(threeUser), - save: jest.fn(), - // as these do not actually use their return values in our sample - // we just make sure that their resolve is true to not crash - update: jest.fn().mockResolvedValue(true), - // as these do not actually use their return values in our sample - // we just make sure that their resolve is true to not crash - delete: jest.fn().mockResolvedValue(true), - createQueryBuilder: jest.fn(), - getManyAndCount: jest.fn(), - }, - }, - ], + users: { + findMany: jest.fn().mockResolvedValue(savedUserArray), + findUnique: jest.fn().mockResolvedValue(savedUser1), + create: jest.fn().mockResolvedValue(savedUser1), + update: jest.fn().mockResolvedValue(updatedUser), + delete: jest.fn().mockResolvedValue(true), + count: jest.fn() + } + } + } + ] }).compile(); service = module.get(UsersService); - repo = module.get>(getRepositoryToken(Users)); + prisma = module.get(PrismaService); }); it("should be defined", () => { expect(service).toBeDefined(); }); - describe("createOne", () => { - it("should successfully add a user", () => { - expect(service.create(newUser)).resolves.toEqual(threeUser); - expect(repo.create).toBeCalledTimes(1); - expect(repo.create).toBeCalledWith(newUser); - expect(repo.save).toBeCalledTimes(1); - }); - }); - - describe("findAll", () => { - it("should return an array of users", async () => { - const users = await service.findAll(); - expect(users).toEqual(userArray); - }); - }); - - describe("findOne", () => { - it("should get a single user", () => { - const repoSpy = jest.spyOn(repo, "findOne"); - expect(service.findOne(1)).resolves.toEqual(oneUser); - expect(repoSpy).toBeCalledWith({ where: { id: 1 } }); - }); - }); - - describe("update", () => { - it("should call the update method", async () => { - const user = await service.update(1, updateUser); - expect(user).toEqual(oneUser); - expect(repo.update).toBeCalledTimes(1); - expect(repo.update).toBeCalledWith({ id: 1 }, updateUser); - }); - }); - - describe("remove", () => { - it("should return {deleted: true}", () => { - expect(service.remove(2)).resolves.toEqual({ deleted: true }); - }); - it("should return {deleted: false, message: err.message}", () => { - const repoSpy = jest - .spyOn(repo, "delete") - .mockRejectedValueOnce(new Error("Bad Delete Method.")); - expect(service.remove(-1)).resolves.toEqual({ - deleted: false, - message: "Bad Delete Method.", - }); - expect(repoSpy).toBeCalledWith(-1); - expect(repoSpy).toBeCalledTimes(1); - }); - }); - describe("searchUsers", () => { - it("should return a list of users with pagination and filtering", async () => { - const page = 1; - const limit = 10; - const sort: any = '{ "name": "ASC" }'; - const filter: any = - '[{ "key": "name", "operation": "=", "value": "Peter" }]'; - const queryBuilder = { - skip: jest.fn().mockReturnThis(), - take: jest.fn().mockReturnThis(), - andWhere: jest.fn().mockReturnThis(), - orderBy: jest.fn().mockReturnThis(), - getManyAndCount: jest.fn().mockResolvedValueOnce([[], 0]), - }; - jest - .spyOn(repo, "createQueryBuilder") - .mockReturnValue(queryBuilder as any); - - const result = await service.searchUsers(page, limit, sort, filter); - - expect(repo.createQueryBuilder).toHaveBeenCalledWith("users"); - expect(queryBuilder.skip).toHaveBeenCalledWith(0); - expect(queryBuilder.take).toHaveBeenCalledWith(limit); - expect(queryBuilder.getManyAndCount).toHaveBeenCalled(); - expect(result).toEqual({ - users: [], - page, - limit, - total: 0, - totalPages: 0, - }); - }); - - it("given no page should return a list of users with pagination and filtering with default page 1", async () => { - const limit = 10; - const sort: any = '{ "name": "ASC" }'; - const filter: any = - '[{ "key": "name", "operation": "=", "value": "Peter" }]'; - const queryBuilder = { - skip: jest.fn().mockReturnThis(), - take: jest.fn().mockReturnThis(), - andWhere: jest.fn().mockReturnThis(), - orderBy: jest.fn().mockReturnThis(), - getManyAndCount: jest.fn().mockResolvedValueOnce([[], 0]), - }; - jest - .spyOn(repo, "createQueryBuilder") - .mockReturnValue(queryBuilder as any); - - const result = await service.searchUsers(null, limit, sort, filter); - - expect(repo.createQueryBuilder).toHaveBeenCalledWith("users"); - expect(queryBuilder.skip).toHaveBeenCalledWith(0); - expect(queryBuilder.take).toHaveBeenCalledWith(limit); - expect(queryBuilder.getManyAndCount).toHaveBeenCalled(); - expect(result).toEqual({ - users: [], - page: 1, - limit, - total: 0, - totalPages: 0, - }); - }); - it("given no limit should return a list of users with pagination and filtering with default limit 10", async () => { - const page = 1; - const sort: any = '{ "name": "ASC" }'; - const filter: any = - '[{ "key": "name", "operation": "=", "value": "Peter" }]'; - const queryBuilder = { - skip: jest.fn().mockReturnThis(), - take: jest.fn().mockReturnThis(), - andWhere: jest.fn().mockReturnThis(), - orderBy: jest.fn().mockReturnThis(), - getManyAndCount: jest.fn().mockResolvedValueOnce([[], 0]), - }; - jest - .spyOn(repo, "createQueryBuilder") - .mockReturnValue(queryBuilder as any); - - const result = await service.searchUsers(page, null, sort, filter); - - expect(repo.createQueryBuilder).toHaveBeenCalledWith("users"); - expect(queryBuilder.skip).toHaveBeenCalledWith(0); - expect(queryBuilder.take).toHaveBeenCalledWith(10); - expect(queryBuilder.getManyAndCount).toHaveBeenCalled(); - expect(result).toEqual({ - users: [], - page: 1, - limit: 10, - total: 0, - totalPages: 0, - }); - }); - - it("given limit greater than 200 should return a list of users with pagination and filtering with default limit 10", async () => { - const page = 1; - const limit = 201; - const sort: any = '{ "name": "ASC" }'; - const filter: any = - '[{ "key": "name", "operation": "=", "value": "Peter" }]'; - const queryBuilder = { - skip: jest.fn().mockReturnThis(), - take: jest.fn().mockReturnThis(), - andWhere: jest.fn().mockReturnThis(), - orderBy: jest.fn().mockReturnThis(), - getManyAndCount: jest.fn().mockResolvedValueOnce([[], 0]), - }; - jest - .spyOn(repo, "createQueryBuilder") - .mockReturnValue(queryBuilder as any); - - const result = await service.searchUsers(page, limit, sort, filter); - - expect(repo.createQueryBuilder).toHaveBeenCalledWith("users"); - expect(queryBuilder.skip).toHaveBeenCalledWith(0); - expect(queryBuilder.take).toHaveBeenCalledWith(10); - expect(queryBuilder.getManyAndCount).toHaveBeenCalled(); - expect(result).toEqual({ - users: [], - page: 1, - limit: 10, - total: 0, - totalPages: 0, - }); - }); - }); }); diff --git a/backend/src/users/users.service.ts b/backend/src/users/users.service.ts index 501cc3e1..2589b51b 100644 --- a/backend/src/users/users.service.ts +++ b/backend/src/users/users.service.ts @@ -1,106 +1,42 @@ -import {HttpException, Injectable} from "@nestjs/common"; -import {InjectRepository} from "@nestjs/typeorm"; -import {Repository, SelectQueryBuilder} from "typeorm"; -import {Users} from "./entities/users.entity"; - -import {CreateUserDto} from "./dto/create-user.dto"; -import {UpdateUserDto} from "./dto/update-user.dto"; +import { Injectable } from '@nestjs/common'; +import { PrismaService } from "nestjs-prisma"; +import { User, Prisma } from '@prisma/client'; @Injectable() export class UsersService { - constructor( - @InjectRepository(Users) - private usersRepository: Repository - ) { - } - - async create(user: CreateUserDto): Promise { - const newUser = this.usersRepository.create(user); - await this.usersRepository.save(newUser); - return newUser; - } - - async findAll(): Promise { - return this.usersRepository.find(); - } - - async findOne(id: any): Promise { - return this.usersRepository.findOne({ where: { id } }); - } + constructor(private prisma: PrismaService) {} - async update(id: number, updateUserDto: UpdateUserDto): Promise { - await this.usersRepository.update({id}, updateUserDto); - return this.findOne(id); + // Create a new user + async createUser(userData: Prisma.UserCreateInput): Promise { + return this.prisma.user.create({ + data: userData, + }); } - async remove(id: number): Promise<{ deleted: boolean; message?: string }> { - try { - await this.usersRepository.delete(id); - return {deleted: true}; - } catch (err) { - return {deleted: false, message: err.message}; - } + // Get all users + async findAll(): Promise { + return this.prisma.user.findMany(); } - async searchUsers(page: number, - limit: number, - sort: string, // JSON string to store sort key and sort value, ex: {name: "ASC"} - filter: string): Promise { // JSON array for key, operation and value, ex: [{key: "name", operation: "like", value: "Peter"}] - - - page = page || 1; // default page is 1 - if (!limit || limit > 200) { - limit = 10; // default limit is 10 for no value or value > 200 - } - - const queryBuilder = this.usersRepository.createQueryBuilder('users'); - if (filter) { - this.setFilter(filter, queryBuilder); - } - if (sort) { - this.setSort(sort, queryBuilder); - } - // Apply pagination condition - queryBuilder.skip((page - 1) * limit).take(limit); - const [users, count] = await queryBuilder.getManyAndCount(); - return { - users, - page, - limit, - total: count, - totalPages: Math.ceil(count / limit), - }; + // Get a single user by ID + async findUserById(userId: number): Promise { + return this.prisma.user.findUnique({ + where: { id: userId }, + }); } - private setSort(sort: string, queryBuilder: SelectQueryBuilder) { - let sortObj; - try { - sortObj = JSON.parse(sort); - } catch (e) { - throw new HttpException("Invalid query parameters as sort", 400); - } - Object.keys(sortObj).forEach((item, index) => { - if (index === 0) { - queryBuilder.orderBy(`users.${item}`, sortObj[item]); - } else { - queryBuilder.addOrderBy(`users.${item}`, sortObj[item]); - } + // Update a user + async updateUser(userId: number, userData: Prisma.UserUpdateInput): Promise { + return this.prisma.user.update({ + where: { id: userId }, + data: userData, }); } - private setFilter(filter: string, queryBuilder: SelectQueryBuilder) { - let filterObj; - try { - filterObj = JSON.parse(filter); - } catch (e) { - throw new HttpException("Invalid query parameters as filter", 400); - } - for (const item of filterObj) { - if (item.operation === "like") { - queryBuilder.andWhere(`users.${item.key} ${item.operation} :${item.key}`, {[item.key]: `%${item.value}%`}); - } else { - queryBuilder.andWhere(`users.${item.key} ${item.operation} :${item.key}`, {[item.key]: item.value}); - } - } + // Delete a user + async deleteUser(userId: number): Promise { + return this.prisma.user.delete({ + where: { id: userId }, + }); } } diff --git a/charts/nr-compliance-enforcement-cm/values.yaml b/charts/nr-compliance-enforcement-cm/values.yaml index 51f640f3..ce27d973 100644 --- a/charts/nr-compliance-enforcement-cm/values.yaml +++ b/charts/nr-compliance-enforcement-cm/values.yaml @@ -124,7 +124,7 @@ backend: - name: FLYWAY_BASELINE_ON_MIGRATE value: "true" - name: FLYWAY_DEFAULT_SCHEMA - value: "USERS" + value: "case_management" - name: FLYWAY_CONNECT_RETRIES value: "30" #-- the resources for the container. it is optional and is an object. for default values check this link: @@ -320,8 +320,8 @@ postgresql: tag: 15.5.0 auth: existingSecret: '{{ .Release.Name }}' - username: 'quickstart' - database: quickstart + username: 'case_management' + database: case_management shmVolume: enabled: false backup: diff --git a/docker-compose.yml b/docker-compose.yml index e8f3159d..1426a810 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -18,7 +18,7 @@ x-postgres-vars: &postgres-vars services: database: image: postgres:15 - container_name: database + container_name: cm-database environment: <<: *postgres-vars healthcheck: @@ -31,23 +31,25 @@ services: command: info migrate info volumes: ["./migrations/sql:/flyway/sql:ro"] environment: - FLYWAY_URL: jdbc:postgresql://database:5432/postgres + FLYWAY_URL: jdbc:postgresql://cm-database:5432/postgres FLYWAY_USER: *POSTGRES_USER FLYWAY_PASSWORD: *POSTGRES_PASSWORD FLYWAY_BASELINE_ON_MIGRATE: true - FLYWAY_DEFAULT_SCHEMA: USERS + FLYWAY_DEFAULT_SCHEMA: case_management depends_on: database: condition: service_healthy backend: - container_name: backend + container_name: cm-backend entrypoint: sh -c "npm i && npm run start:dev" environment: <<: *postgres-vars NODE_ENV: development + DATABASE_URL: "postgresql://postgres:default@cm-database:5432/postgres?schema=case_management" + BACKEND_PORT: "3000" image: node:20-bullseye - ports: ["3002:3000"] + ports: ["3003:3000"] volumes: ["./backend:/app", "/app/node_modules"] healthcheck: test: ["CMD", "curl", "-f", "http://localhost:3000/api"] diff --git a/migrations/sql/V1.0.0__init.sql b/migrations/sql/V1.0.0__init.sql index 2be16859..4d66d93f 100644 --- a/migrations/sql/V1.0.0__init.sql +++ b/migrations/sql/V1.0.0__init.sql @@ -1,21 +1,21 @@ -CREATE SCHEMA IF NOT EXISTS USERS; +CREATE SCHEMA IF NOT EXISTS case_management; -CREATE SEQUENCE IF NOT EXISTS USERS."USER_SEQ" +CREATE SEQUENCE IF NOT EXISTS case_management."USER_SEQ" START WITH 1 INCREMENT BY 1 NO MINVALUE NO MAXVALUE CACHE 100; -CREATE TABLE IF NOT EXISTS USERS.USERS +CREATE TABLE IF NOT EXISTS case_management.USERS ( ID numeric not null constraint "USER_PK" - primary key DEFAULT nextval('USERS."USER_SEQ"'), + primary key DEFAULT nextval('case_management."USER_SEQ"'), NAME varchar(200) not null, EMAIL varchar(200) not null ); -INSERT INTO USERS.USERS (NAME, EMAIL) +INSERT INTO case_management.USERS (NAME, EMAIL) VALUES ('John', 'John.ipsum@test.com'), ('Jane', 'Jane.ipsum@test.com'), ('Jack', 'Jack.ipsum@test.com'), diff --git a/migrations/sql/V1.0.1__alter_user_seq.sql b/migrations/sql/V1.0.1__alter_user_seq.sql index 6be8cd5b..c2f1e794 100644 --- a/migrations/sql/V1.0.1__alter_user_seq.sql +++ b/migrations/sql/V1.0.1__alter_user_seq.sql @@ -1 +1 @@ -ALTER SEQUENCE USERS."USER_SEQ" RESTART WITH 6 CACHE 1; +ALTER SEQUENCE case_management."USER_SEQ" RESTART WITH 6 CACHE 1;