Skip to content

Commit

Permalink
apply source formatting/linting according to latest jslind and pretti…
Browse files Browse the repository at this point in the history
…er configs
  • Loading branch information
hotzevzl committed Oct 16, 2023
1 parent 8c93e89 commit e923fe3
Show file tree
Hide file tree
Showing 520 changed files with 3,110 additions and 3,035 deletions.
9 changes: 5 additions & 4 deletions api/apps/api/src/guards/jwt-auth.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,11 @@ export class JwtAuthGuard extends AuthGuard('jwt') {
[context.getHandler(), context.getClass()],
);

const isMissingAclImplementation = this.reflector.getAllAndOverride<boolean>(
IS_MISSING_ACL_IMPLEMENTATION,
[context.getHandler(), context.getClass()],
);
const isMissingAclImplementation =
this.reflector.getAllAndOverride<boolean>(IS_MISSING_ACL_IMPLEMENTATION, [
context.getHandler(),
context.getClass(),
]);

return implementsAcl || isMissingAclImplementation;
}
Expand Down
2 changes: 1 addition & 1 deletion api/apps/api/src/guards/x-api.guard.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export class XApiGuard implements CanActivate {

constructor() {
// throws if not provided
// eslint-disable-next-line @typescript-eslint/no-non-null-assertion

this.#secret = AppConfig.get<string>('auth.xApiKey.secret')!;
}

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class InitialProjectsAndOrganizationsTables1608218183000
implements MigrationInterface {
implements MigrationInterface
{
async up(queryRunner: QueryRunner): Promise<any> {
await queryRunner.query(`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm';
import { PostgreSQLUtils } from '@marxan-api/utils/postgresql.utils';

export class AddSupportForAuthentication1610395720000
implements MigrationInterface {
implements MigrationInterface
{
async up(queryRunner: QueryRunner): Promise<any> {
// Only CREATEDB privilege required in 13+ rather than SUPERUSER (ht @agnessa)
if (await PostgreSQLUtils.version13Plus(queryRunner)) {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class InitialDataMetadataEntities1611329857558
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TYPE "job_status" AS ENUM (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddCascadesToJoinTables1611764861883
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
queryRunner.query(`
ALTER TABLE users_projects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddMetadataToProjectsAndOrganizationsEntities1611934127026
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE organizations
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class UpdateNullableColumnsForProjectsAndScenarios1613988195000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE projects
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddCascadeToAllowDeletingProjectsWithScenarios1616155304000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE scenarios
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class UpdateScenarioTableForProtectedAreaSelection1616764914000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE scenarios
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddDraftStatusToJobStatusEnum1618241224000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TYPE job_status ADD VALUE 'draft';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AllowToLinkCustomGeoFeaturesToProjects1618248224000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE features
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@ import { MigrationInterface, QueryRunner } from 'typeorm';
import { v4 } from 'uuid';

export class DropNotNullsOnTimeUserMetadataColumns1619711501000
implements MigrationInterface {
implements MigrationInterface
{
private tablesToAlter = ['organizations', 'projects', 'scenarios'];

public async up(queryRunner: QueryRunner): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class PropertyListForFeatures1619777176256
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE features
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddScenariosCostSurfaceFileCache1622202936552
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
CREATE TYPE "cost_surface_file_cache_artifactType_enum" AS ENUM('CostTemplate');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ScenarioPlanningUnitInclusionEvents1623159171726
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddPlannigAreaGeometryIdToProject1624275320285
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE projects ADD planning_area_geometry_id uuid`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddRunAtLeastOnceFlagToScenario1625209470391
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE scenarios ADD "ran_at_least_once" boolean NOT NULL DEFAULT false`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddExternalUniqueIdToApiEvents1626458359147
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`ALTER TABLE api_events ADD external_id character varying`,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ScenarioSaveOutputEvents1627417842777
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddSpecificaitonsToScenario1628596256734
implements MigrationInterface {
implements MigrationInterface
{
name = 'AddSpecificaitonsToScenario1628596256734';

public async up(queryRunner: QueryRunner): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class SpecificationParamsAndRaw1628690501769
implements MigrationInterface {
implements MigrationInterface
{
name = 'SpecificationParamsAndRaw1628690501769';

public async up(queryRunner: QueryRunner): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class SpecifiationDrowDefaultRaw1628691378426
implements MigrationInterface {
implements MigrationInterface
{
name = 'SpecifiationDrowDefaultRaw1628691378426';

public async up(queryRunner: QueryRunner): Promise<void> {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddLastModifiedAtToSpecification1629195451410
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE specifications
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddSubmittedEventToProtectedArea1629285532316
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddEventsForSpecification1629703588844
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ChangeFeaturesPersistence1630160053768
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
alter table specification_feature_configs add column features jsonb default '[]';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class FeatureWithPuIntersectionEvents1631545360495
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddPlanningUnitCalculationEvents1632901740965
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddTimestampToJobStatusView1632999358910
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
DROP VIEW "scenario_job_status";
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddCascadeToFeaturesFKs1634209362000
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE public.features DROP CONSTRAINT features_project_id_fkey;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddPublishedProjectsTable1634807093754
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`CREATE TABLE "published_projects"
(
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class CustomPaEventsAreNowScenario1637067288518
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddScenarioCalibrationEvents1638358277396
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddRoleIdUsersScenariosTable1640175714642
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
ALTER TABLE users_scenarios ADD COLUMN role_id varchar NOT NULL references roles(name),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddExportScenarioEvents1643298778270
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(`
INSERT INTO api_event_kinds (id) values
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class AddTokenIdColumnToLocks1645026803969
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
await queryRunner.query(
`
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export class SyncPuShapeEnumFromGeoprocessingToApi1645449750000
`);
}

public async down(queryRunner: QueryRunner): Promise<void> {
public async down(_queryRunner: QueryRunner): Promise<void> {
/**
* Arguably not worth the effort sorry. Creating a new type with the old set
* of values, making sure the values to be "dropped" are not used anywhere,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import { MigrationInterface, QueryRunner } from 'typeorm';

export class ImplicitRolesFunctionsAndTriggers1645550554581
implements MigrationInterface {
implements MigrationInterface
{
public async up(queryRunner: QueryRunner): Promise<void> {
// remove legacy column - we never used this
await queryRunner.query(`
Expand Down
Loading

1 comment on commit e923fe3

@vercel
Copy link

@vercel vercel bot commented on e923fe3 Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

marxan – ./

marxan-vizzuality1.vercel.app
marxan-git-develop-vizzuality1.vercel.app
marxan23.vercel.app

Please sign in to comment.