Skip to content

Commit

Permalink
Hide all mongo _ids from the API
Browse files Browse the repository at this point in the history
  • Loading branch information
Maelstromeous committed Jul 31, 2023
1 parent e3104c8 commit 9eb2762
Show file tree
Hide file tree
Showing 20 changed files with 40 additions and 20 deletions.
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {World, worldArray} from '../../../ps2alerts-constants/world';
Expand All @@ -25,6 +25,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalCharacterAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {World, worldArray} from '../../../ps2alerts-constants/world';
import FacilityFactionControl from '../common/facility.faction.control.embed';
Expand All @@ -18,6 +18,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalFacilityControlAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, ObjectID, Index} from 'typeorm';
import {World, worldArray} from '../../../ps2alerts-constants/world';
Expand All @@ -18,6 +18,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalFactionCombatAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Loadout, loadoutArray} from '../../../ps2alerts-constants/loadout';
import {World, worldArray} from '../../../ps2alerts-constants/world';
Expand All @@ -18,6 +18,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalLoadoutAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {World, worldArray} from '../../../ps2alerts-constants/world';
Expand All @@ -25,6 +25,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalOutfitAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({type: OutfitEmbed, description: 'Outfit details'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import VehicleStatsEmbed from '../common/vehicle.vs.vehicle.embed';
Expand All @@ -17,6 +17,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalVehicleAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: Vehicle.FLASH, enum: vehicleArray, description: 'Vehicle ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import VehicleStatsEmbed from '../common/vehicle.vs.vehicle.embed';
Expand All @@ -18,6 +18,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalVehicleCharacterAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: World.MILLER, enum: worldArray, description: 'World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {World, worldArray} from '../../../ps2alerts-constants/world';
import {Zone, zoneArray} from '../../../ps2alerts-constants/zone';
Expand All @@ -17,6 +17,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalVictoryAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {World, worldArray} from '../../../ps2alerts-constants/world';
Expand All @@ -22,6 +22,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class GlobalWeaponAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({enum: worldArray, example: 10, description: 'Server / World ID'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import CharacterEmbed from '../common/character.embed';
Expand All @@ -16,6 +16,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceCharacterAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import CombatStats from '../common/combat.stats.embed';
Expand All @@ -12,6 +12,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceCombatHistoryAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import FacilityFactionControl from '../common/facility.faction.control.embed';
Expand All @@ -15,6 +15,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceFacilityControlAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, ObjectID, Index} from 'typeorm';
import CombatStats from '../common/combat.stats.embed';
Expand All @@ -14,6 +14,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceFactionCombatAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id?: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import {Loadout, loadoutArray} from '../../../ps2alerts-constants/loadout';
Expand All @@ -15,6 +15,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceLoadoutAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import OutfitEmbed from '../common/outfit.embed';
Expand All @@ -16,6 +16,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceOutfitAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';

Expand All @@ -10,6 +10,7 @@ import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
export default class InstancePopulationAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';

Expand All @@ -10,6 +10,7 @@ import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
export default class InstancePopulationAveragesAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import VehicleStatsEmbed from '../common/vehicle.vs.vehicle.embed';
Expand All @@ -15,6 +15,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceVehicleAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import VehicleStatsEmbed from '../common/vehicle.vs.vehicle.embed';
Expand All @@ -15,6 +15,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceVehicleCharacterAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/* eslint-disable @typescript-eslint/explicit-member-accessibility,@typescript-eslint/naming-convention */
import {ApiProperty} from '@nestjs/swagger';
import {ApiHideProperty, ApiProperty} from '@nestjs/swagger';
import {Exclude} from 'class-transformer';
import {Column, ObjectIdColumn, Entity, Index, ObjectID} from 'typeorm';
import ItemEmbed from '../common/item.embed';
Expand All @@ -15,6 +15,7 @@ import {Ps2AlertsEventType} from '../../../ps2alerts-constants/ps2AlertsEventTyp
export default class InstanceWeaponAggregateEntity {
@ObjectIdColumn()
@Exclude()
@ApiHideProperty()
_id: ObjectID;

@ApiProperty({example: '10-12345', description: 'The Server-CensusInstanceId combination'})
Expand Down

0 comments on commit 9eb2762

Please sign in to comment.