Merge branch '77c48a7a075b14445d39a902e74aae025ada319d' into main
This commit is contained in:
+145
@@ -0,0 +1,145 @@
|
||||
"use strict";
|
||||
/*
|
||||
* For a detailed explanation regarding each configuration property and type check, visit:
|
||||
* https://jestjs.io/docs/configuration
|
||||
*/
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.default = {
|
||||
// All imported modules in your tests should be mocked automatically
|
||||
// automock: false,
|
||||
// Stop running tests after `n` failures
|
||||
// bail: 0,
|
||||
// The directory where Jest should store its cached dependency information
|
||||
// cacheDirectory: "C:\\Users\\legon\\AppData\\Local\\Temp\\jest",
|
||||
// Automatically clear mock calls, instances, contexts and results before every test
|
||||
// clearMocks: false,
|
||||
// Indicates whether the coverage information should be collected while executing the test
|
||||
collectCoverage: true,
|
||||
// An array of glob patterns indicating a set of files for which coverage information should be collected
|
||||
// collectCoverageFrom: undefined,
|
||||
// The directory where Jest should output its coverage files
|
||||
coverageDirectory: "coverage",
|
||||
// An array of regexp pattern strings used to skip coverage collection
|
||||
// coveragePathIgnorePatterns: [
|
||||
// "\\\\node_modules\\\\"
|
||||
// ],
|
||||
// Indicates which provider should be used to instrument code for coverage
|
||||
// coverageProvider: "babel",
|
||||
// A list of reporter names that Jest uses when writing coverage reports
|
||||
// coverageReporters: [
|
||||
// "json",
|
||||
// "text",
|
||||
// "lcov",
|
||||
// "clover"
|
||||
// ],
|
||||
// An object that configures minimum threshold enforcement for coverage results
|
||||
// coverageThreshold: undefined,
|
||||
// A path to a custom dependency extractor
|
||||
// dependencyExtractor: undefined,
|
||||
// Make calling deprecated APIs throw helpful error messages
|
||||
// errorOnDeprecated: false,
|
||||
// The default configuration for fake timers
|
||||
// fakeTimers: {
|
||||
// "enableGlobally": false
|
||||
// },
|
||||
// Force coverage collection from ignored files using an array of glob patterns
|
||||
// forceCoverageMatch: [],
|
||||
// A path to a module which exports an async function that is triggered once before all test suites
|
||||
// globalSetup: undefined,
|
||||
// A path to a module which exports an async function that is triggered once after all test suites
|
||||
// globalTeardown: undefined,
|
||||
// A set of global variables that need to be available in all test environments
|
||||
// globals: {},
|
||||
// The maximum amount of workers used to run your tests. Can be specified as % or a number. E.g. maxWorkers: 10% will use 10% of your CPU amount + 1 as the maximum worker number. maxWorkers: 2 will use a maximum of 2 workers.
|
||||
// maxWorkers: "50%",
|
||||
// An array of directory names to be searched recursively up from the requiring module's location
|
||||
// moduleDirectories: [
|
||||
// "node_modules"
|
||||
// ],
|
||||
// An array of file extensions your modules use
|
||||
// moduleFileExtensions: [
|
||||
// "js",
|
||||
// "mjs",
|
||||
// "cjs",
|
||||
// "jsx",
|
||||
// "ts",
|
||||
// "tsx",
|
||||
// "json",
|
||||
// "node"
|
||||
// ],
|
||||
// A map from regular expressions to module names or to arrays of module names that allow to stub out resources with a single module
|
||||
// moduleNameMapper: {},
|
||||
// An array of regexp pattern strings, matched against all module paths before considered 'visible' to the module loader
|
||||
// modulePathIgnorePatterns: [],
|
||||
// Activates notifications for test results
|
||||
// notify: false,
|
||||
// An enum that specifies notification mode. Requires { notify: true }
|
||||
// notifyMode: "failure-change",
|
||||
// A preset that is used as a base for Jest's configuration
|
||||
// preset: undefined,
|
||||
// Run tests from one or more projects
|
||||
// projects: undefined,
|
||||
// Use this configuration option to add custom reporters to Jest
|
||||
// reporters: undefined,
|
||||
// Automatically reset mock state before every test
|
||||
// resetMocks: false,
|
||||
// Reset the module registry before running each individual test
|
||||
// resetModules: false,
|
||||
// A path to a custom resolver
|
||||
// resolver: undefined,
|
||||
// Automatically restore mock state and implementation before every test
|
||||
// restoreMocks: false,
|
||||
// The root directory that Jest should scan for tests and modules within
|
||||
// rootDir: undefined,
|
||||
// A list of paths to directories that Jest should use to search for files in
|
||||
// roots: [
|
||||
// "<rootDir>"
|
||||
// ],
|
||||
// Allows you to use a custom runner instead of Jest's default test runner
|
||||
// runner: "jest-runner",
|
||||
// The paths to modules that run some code to configure or set up the testing environment before each test
|
||||
// setupFiles: [],
|
||||
// A list of paths to modules that run some code to configure or set up the testing framework before each test
|
||||
// setupFilesAfterEnv: [],
|
||||
// The number of seconds after which a test is considered as slow and reported as such in the results.
|
||||
// slowTestThreshold: 5,
|
||||
// A list of paths to snapshot serializer modules Jest should use for snapshot testing
|
||||
// snapshotSerializers: [],
|
||||
// The test environment that will be used for testing
|
||||
// testEnvironment: "jest-environment-node",
|
||||
// Options that will be passed to the testEnvironment
|
||||
// testEnvironmentOptions: {},
|
||||
// Adds a location field to test results
|
||||
// testLocationInResults: false,
|
||||
// The glob patterns Jest uses to detect test files
|
||||
// testMatch: [
|
||||
// "**/__tests__/**/*.[jt]s?(x)",
|
||||
// "**/?(*.)+(spec|test).[tj]s?(x)"
|
||||
// ],
|
||||
// An array of regexp pattern strings that are matched against all test paths, matched tests are skipped
|
||||
// testPathIgnorePatterns: [
|
||||
// "\\\\node_modules\\\\"
|
||||
// ],
|
||||
// The regexp pattern or array of patterns that Jest uses to detect test files
|
||||
// testRegex: [],
|
||||
// This option allows the use of a custom results processor
|
||||
// testResultsProcessor: undefined,
|
||||
// This option allows use of a custom test runner
|
||||
// testRunner: "jest-circus/runner",
|
||||
// A map from regular expressions to paths to transformers
|
||||
// transform: undefined,
|
||||
// An array of regexp pattern strings that are matched against all source file paths, matched files will skip transformation
|
||||
// transformIgnorePatterns: [
|
||||
// "\\\\node_modules\\\\",
|
||||
// "\\.pnp\\.[^\\\\]+$"
|
||||
// ],
|
||||
// An array of regexp pattern strings that are matched against all modules before the module loader will automatically return a mock for them
|
||||
// unmockedModulePathPatterns: undefined,
|
||||
// Indicates whether each individual test should be reported during the run
|
||||
// verbose: undefined,
|
||||
// An array of regexp patterns that are matched against all source file paths before re-running tests in watch mode
|
||||
// watchPathIgnorePatterns: [],
|
||||
// Whether to use watchman for file crawling
|
||||
// watchman: true,
|
||||
};
|
||||
//# sourceMappingURL=jest.config.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"jest.config.js","sourceRoot":"","sources":["jest.config.ts"],"names":[],"mappings":";AAAA;;;GAGG;;AAEH,kBAAe;IACb,oEAAoE;IACpE,mBAAmB;IAEnB,wCAAwC;IACxC,WAAW;IAEX,0EAA0E;IAC1E,kEAAkE;IAElE,oFAAoF;IACpF,qBAAqB;IAErB,0FAA0F;IAC1F,eAAe,EAAE,IAAI;IAErB,yGAAyG;IACzG,kCAAkC;IAElC,4DAA4D;IAC5D,iBAAiB,EAAE,UAAU;IAE7B,sEAAsE;IACtE,gCAAgC;IAChC,2BAA2B;IAC3B,KAAK;IAEL,0EAA0E;IAC1E,6BAA6B;IAE7B,wEAAwE;IACxE,uBAAuB;IACvB,YAAY;IACZ,YAAY;IACZ,YAAY;IACZ,aAAa;IACb,KAAK;IAEL,+EAA+E;IAC/E,gCAAgC;IAEhC,0CAA0C;IAC1C,kCAAkC;IAElC,4DAA4D;IAC5D,4BAA4B;IAE5B,4CAA4C;IAC5C,gBAAgB;IAChB,4BAA4B;IAC5B,KAAK;IAEL,+EAA+E;IAC/E,0BAA0B;IAE1B,mGAAmG;IACnG,0BAA0B;IAE1B,kGAAkG;IAClG,6BAA6B;IAE7B,+EAA+E;IAC/E,eAAe;IAEf,iOAAiO;IACjO,qBAAqB;IAErB,iGAAiG;IACjG,uBAAuB;IACvB,mBAAmB;IACnB,KAAK;IAEL,+CAA+C;IAC/C,0BAA0B;IAC1B,UAAU;IACV,WAAW;IACX,WAAW;IACX,WAAW;IACX,UAAU;IACV,WAAW;IACX,YAAY;IACZ,WAAW;IACX,KAAK;IAEL,oIAAoI;IACpI,wBAAwB;IAExB,wHAAwH;IACxH,gCAAgC;IAEhC,2CAA2C;IAC3C,iBAAiB;IAEjB,sEAAsE;IACtE,gCAAgC;IAEhC,2DAA2D;IAC3D,qBAAqB;IAErB,sCAAsC;IACtC,uBAAuB;IAEvB,gEAAgE;IAChE,wBAAwB;IAExB,mDAAmD;IACnD,qBAAqB;IAErB,gEAAgE;IAChE,uBAAuB;IAEvB,8BAA8B;IAC9B,uBAAuB;IAEvB,wEAAwE;IACxE,uBAAuB;IAEvB,wEAAwE;IACxE,sBAAsB;IAEtB,6EAA6E;IAC7E,WAAW;IACX,gBAAgB;IAChB,KAAK;IAEL,0EAA0E;IAC1E,yBAAyB;IAEzB,0GAA0G;IAC1G,kBAAkB;IAElB,8GAA8G;IAC9G,0BAA0B;IAE1B,sGAAsG;IACtG,wBAAwB;IAExB,sFAAsF;IACtF,2BAA2B;IAE3B,qDAAqD;IACrD,4CAA4C;IAE5C,qDAAqD;IACrD,8BAA8B;IAE9B,wCAAwC;IACxC,gCAAgC;IAEhC,mDAAmD;IACnD,eAAe;IACf,mCAAmC;IACnC,qCAAqC;IACrC,KAAK;IAEL,wGAAwG;IACxG,4BAA4B;IAC5B,2BAA2B;IAC3B,KAAK;IAEL,8EAA8E;IAC9E,iBAAiB;IAEjB,2DAA2D;IAC3D,mCAAmC;IAEnC,iDAAiD;IACjD,oCAAoC;IAEpC,0DAA0D;IAC1D,wBAAwB;IAExB,4HAA4H;IAC5H,6BAA6B;IAC7B,4BAA4B;IAC5B,yBAAyB;IACzB,KAAK;IAEL,6IAA6I;IAC7I,yCAAyC;IAEzC,2EAA2E;IAC3E,sBAAsB;IAEtB,mHAAmH;IACnH,+BAA+B;IAE/B,4CAA4C;IAC5C,kBAAkB;CACnB,CAAC"}
|
||||
@@ -425,7 +425,7 @@ components:
|
||||
required:
|
||||
- cause_of_death
|
||||
PlayerID:
|
||||
title: EntityID
|
||||
title: PlayerId
|
||||
x-stoplight:
|
||||
id: 9icavmq5bgsqp
|
||||
type: integer
|
||||
|
||||
+10
-23
@@ -1,7 +1,7 @@
|
||||
import { Kysely, PostgresDialect } from 'kysely'
|
||||
import { InsertObject, Kysely, PostgresDialect } from 'kysely'
|
||||
import { Pool } from 'pg'
|
||||
import migrateToLatest from './migrations'
|
||||
import Database from './model'
|
||||
import Database, { KillTable } from './model'
|
||||
|
||||
const migration = migrateToLatest()
|
||||
// You'd create one of these when you start your app.
|
||||
@@ -17,28 +17,15 @@ const db = new Kysely<Database>({
|
||||
})
|
||||
})
|
||||
|
||||
interface KillRecord {
|
||||
server: string
|
||||
attacker: number
|
||||
victim: number
|
||||
weapon: number
|
||||
map: number
|
||||
distance: number
|
||||
date: Date
|
||||
interface RemoveFromKill {
|
||||
id: unknown
|
||||
unix_time: unknown
|
||||
}
|
||||
export async function CreateKillRecord({
|
||||
server,
|
||||
attacker,
|
||||
victim,
|
||||
weapon,
|
||||
map,
|
||||
distance,
|
||||
date
|
||||
}: KillRecord) {
|
||||
await db
|
||||
.insertInto('kill')
|
||||
.values({ server, attacker, victim, weapon, map, distance })
|
||||
.execute()
|
||||
|
||||
type KillRecord = Omit<KillTable, keyof RemoveFromKill>
|
||||
|
||||
export async function CreateKillRecord(data: KillRecord) {
|
||||
await db.insertInto('kill').values({ ...data })
|
||||
}
|
||||
/*
|
||||
async function demo() {
|
||||
|
||||
@@ -1,54 +1,66 @@
|
||||
import { Kysely, sql } from "kysely";
|
||||
import { Kysely, sql } from 'kysely'
|
||||
|
||||
export async function up(db: Kysely<any>): Promise<void> {
|
||||
await db.schema
|
||||
.createTable("entity")
|
||||
.addColumn("id", "integer", (col) => col.unique().primaryKey())
|
||||
.addColumn("name", "varchar")
|
||||
.execute();
|
||||
.createTable('player')
|
||||
.addColumn('id', 'integer', (col) => col.unique().primaryKey())
|
||||
.addColumn('name', 'varchar')
|
||||
.addColumn('optout', 'boolean')
|
||||
.addColumn('hide_TOS', 'boolean')
|
||||
.execute()
|
||||
|
||||
await db.schema
|
||||
.createTable("weapon")
|
||||
.addColumn("id", "varchar", (col) => col.unique().primaryKey())
|
||||
.addColumn("name", "varchar")
|
||||
.addColumn("description", "varchar")
|
||||
.addColumn("image", "varchar")
|
||||
.execute();
|
||||
.createTable('weapon')
|
||||
.addColumn('id', 'varchar', (col) => col.unique().primaryKey())
|
||||
.addColumn('name', 'varchar')
|
||||
.addColumn('description', 'varchar')
|
||||
.addColumn('image', 'varchar')
|
||||
.execute()
|
||||
|
||||
await db.schema
|
||||
.createTable("map")
|
||||
.addColumn("id", "varchar", (col) => col.unique().primaryKey())
|
||||
.addColumn("name", "varchar")
|
||||
.addColumn("description", "varchar")
|
||||
.addColumn("image", "varchar")
|
||||
.execute();
|
||||
.createTable('map')
|
||||
.addColumn('id', 'varchar', (col) => col.unique().primaryKey())
|
||||
.addColumn('name', 'varchar')
|
||||
.addColumn('description', 'varchar')
|
||||
.addColumn('image', 'varchar')
|
||||
.execute()
|
||||
|
||||
await db.schema
|
||||
.createTable("server")
|
||||
.addColumn("name", "varchar", (col) => col.unique().primaryKey())
|
||||
.addColumn("description", "varchar")
|
||||
.addColumn("token", "varchar")
|
||||
.execute();
|
||||
.createTable('server')
|
||||
.addColumn('id', 'integer')
|
||||
.addColumn('name', 'varchar', (col) => col.unique().primaryKey())
|
||||
.addColumn('description', 'varchar')
|
||||
.addColumn('token', 'varchar')
|
||||
.execute()
|
||||
|
||||
await db.schema
|
||||
.createTable("kill")
|
||||
.addColumn("id", "serial", (col) => col.primaryKey())
|
||||
.addColumn("server", "varchar", (col) =>
|
||||
col.references("server.name").notNull()
|
||||
.createTable('kill')
|
||||
.addColumn('id', 'serial', (col) => col.primaryKey())
|
||||
.addColumn('server', 'integer', (col) =>
|
||||
col.references('server.id').notNull().onDelete('cascade')
|
||||
)
|
||||
.addColumn("attacker", "integer", (col) =>
|
||||
col.references("entity.id").notNull()
|
||||
)
|
||||
.addColumn("victim", "integer", (col) =>
|
||||
col.references("entity.id").notNull()
|
||||
)
|
||||
.addColumn("weapon", "varchar", (col) =>
|
||||
col.references("weapon.id").notNull()
|
||||
)
|
||||
.addColumn("map", "varchar", (col) => col.references("map.id").notNull())
|
||||
.addColumn("distance", "integer", (col) => col.notNull())
|
||||
.addColumn("date", "varchar", (col) => col.defaultTo(sql`now()`).notNull())
|
||||
.execute();
|
||||
.addColumn('damage_source', 'varchar')
|
||||
.addColumn('attacker', 'integer')
|
||||
.addColumn('attacker_type', 'varchar')
|
||||
.addColumn('attacker_weapon', 'varchar')
|
||||
.addColumn('attacker_weapon_2', 'varchar')
|
||||
.addColumn('attacker_weapon_3', 'varchar')
|
||||
.addColumn('attacker_ordnance', 'varchar')
|
||||
.addColumn('attacker_ability', 'varchar')
|
||||
.addColumn('attacker_kit_1', 'varchar')
|
||||
.addColumn('attacker_kit_2', 'varchar')
|
||||
.addColumn('victim', 'integer')
|
||||
.addColumn('victim_weapon', 'varchar')
|
||||
.addColumn('victim_weapon_2', 'integer')
|
||||
.addColumn('victim_weapon_3', 'integer')
|
||||
.addColumn('victim_ordnance', 'integer')
|
||||
.addColumn('victim_ability', 'integer')
|
||||
.addColumn('victim_kit_1', 'integer')
|
||||
.addColumn('victim_kit_2', 'integer')
|
||||
.addColumn('map', 'varchar')
|
||||
.addColumn('distance', 'integer')
|
||||
.addColumn('date', 'varchar', (col) => col.defaultTo(sql`now()`).notNull())
|
||||
.execute()
|
||||
|
||||
/*await db.schema
|
||||
.createTable("pet")
|
||||
@@ -68,9 +80,9 @@ export async function up(db: Kysely<any>): Promise<void> {
|
||||
}
|
||||
|
||||
export async function down(db: Kysely<any>): Promise<void> {
|
||||
await db.schema.dropTable("kill").execute();
|
||||
await db.schema.dropTable("entity").execute();
|
||||
await db.schema.dropTable("weapon").execute();
|
||||
await db.schema.dropTable("map").execute();
|
||||
await db.schema.dropTable("server").execute();
|
||||
await db.schema.dropTable('kill').execute()
|
||||
await db.schema.dropTable('entity').execute()
|
||||
await db.schema.dropTable('weapon').execute()
|
||||
await db.schema.dropTable('map').execute()
|
||||
await db.schema.dropTable('server').execute()
|
||||
}
|
||||
|
||||
+36
-7
@@ -2,18 +2,47 @@ import { ColumnType, Generated } from 'kysely'
|
||||
|
||||
export interface KillTable {
|
||||
id: Generated<number>
|
||||
server: string
|
||||
attacker: number
|
||||
victim: number
|
||||
weapon: string
|
||||
server: number
|
||||
tone_version: string
|
||||
match_id: string
|
||||
game_mode: string
|
||||
map: string
|
||||
unix_time: Generated<Date>
|
||||
game_time: number
|
||||
player_count: number
|
||||
attacker_name: string
|
||||
attacker_id: number
|
||||
attacker_current_weapon: string
|
||||
attacker_current_weapon_mods: string
|
||||
attacker_weapon_1: string
|
||||
attacker_weapon_1_mods: string
|
||||
attacker_weapon_2: string
|
||||
attacker_weapon_2_mods: string
|
||||
attacker_weapon_3: string
|
||||
attacker_weapon_3_mods: string
|
||||
attacker_offhand_weapon_1: string
|
||||
attacker_offhand_weapon_2: string
|
||||
victim_name: string
|
||||
victim_id: number
|
||||
victim_current_weapon: string
|
||||
victim_current_weapon_mods: string
|
||||
victim_weapon_1: string
|
||||
victim_weapon_1_mods: string
|
||||
victim_weapon_2: string
|
||||
victim_weapon_2_mods: string
|
||||
victim_weapon_3: string
|
||||
victim_weapon_3_mods: string
|
||||
victim_offhand_weapon_1: string
|
||||
victim_offhand_weapon_2: string
|
||||
cause_of_death: string
|
||||
distance: number
|
||||
date: ColumnType<Date, string | Date | undefined, never>
|
||||
}
|
||||
|
||||
interface EntityTable {
|
||||
interface PlayerTable {
|
||||
id: number
|
||||
name: string
|
||||
'opt-out': boolean
|
||||
hide_TOS: boolean
|
||||
}
|
||||
interface WeaponTable {
|
||||
id: string
|
||||
@@ -34,7 +63,7 @@ interface ServerTable {
|
||||
}
|
||||
interface Database {
|
||||
kill: KillTable
|
||||
entity: EntityTable
|
||||
player: PlayerTable
|
||||
weapon: WeaponTable
|
||||
maps: MapTable
|
||||
server: ServerTable
|
||||
|
||||
+3
-1
@@ -8,7 +8,9 @@ import server from './server'
|
||||
console.log('dotenv')
|
||||
|
||||
const app = express()
|
||||
const port = 3000
|
||||
const port = 3001
|
||||
|
||||
app.use(express.json())
|
||||
|
||||
app.get('/', (req, res) => {
|
||||
res.send('Hello World!')
|
||||
|
||||
+124
-11
@@ -1,23 +1,136 @@
|
||||
import { Router } from 'express'
|
||||
import { CreateKillRecord } from './db/db'
|
||||
import db, { CreateKillRecord } from './db/db'
|
||||
import { body } from 'express-validator'
|
||||
const router = Router()
|
||||
|
||||
//auth middleware
|
||||
//auth middleware, maybe some timeout ?
|
||||
router.post('/*', (req, res, next) => {
|
||||
next()
|
||||
})
|
||||
router.post(
|
||||
'/severs/:serverId/kills',
|
||||
body('server').isString(),
|
||||
body('attacker').isInt(),
|
||||
body('victim').isInt(),
|
||||
body('weapon').isString(),
|
||||
body('map').isString(),
|
||||
body('distance').isInt(),
|
||||
'/servers/:serverId/kills',
|
||||
body(
|
||||
['attacker_id', 'victim_id'],
|
||||
'attacker and victim must be player UIDs'
|
||||
).isInt(),
|
||||
body(
|
||||
[
|
||||
'tone_version',
|
||||
'match_id',
|
||||
'game_mode',
|
||||
'map',
|
||||
'player_count',
|
||||
'attacker_name',
|
||||
'attacker_current_weapon',
|
||||
'attacker_current_weapon_mods',
|
||||
'attacker_weapon_1',
|
||||
'attacker_weapon_1_mods',
|
||||
'attacker_weapon_2',
|
||||
'attacker_weapon_2_mods',
|
||||
'attacker_weapon_3',
|
||||
'attacker_weapon_3_mods',
|
||||
'attacker_offhand_weapon_1',
|
||||
'attacker_offhand_weapon_2',
|
||||
'victim_name',
|
||||
'victim_current_weapon',
|
||||
'victim_current_weapon_mods',
|
||||
'victim_weapon_1',
|
||||
'victim_weapon_1_mods',
|
||||
'victim_weapon_2',
|
||||
'victim_weapon_2_mods',
|
||||
'victim_weapon_3',
|
||||
'victim_weapon_3_mods',
|
||||
'victim_offhand_weapon_1',
|
||||
'victim_offhand_weapon_2',
|
||||
'cause_of_death'
|
||||
],
|
||||
'values must be composed of a maximum of 50 valid ascii characters'
|
||||
)
|
||||
.isString()
|
||||
.isLength({ max: 50 })
|
||||
.isAscii(),
|
||||
body(
|
||||
['distance', 'game_time'],
|
||||
'distance and game_time must be postitive floats'
|
||||
).isFloat({
|
||||
min: 0
|
||||
}),
|
||||
body(
|
||||
['cause_of_death', 'victim_id'],
|
||||
'cause_of_death and victim_id are mandatory'
|
||||
).notEmpty(),
|
||||
(req, res, next) => {
|
||||
//CreateKillRecord({ server, attacker, victim, weapon, map, distance })
|
||||
res.send(400)
|
||||
const server = 1 // set server ID here
|
||||
const {
|
||||
tone_version,
|
||||
match_id,
|
||||
game_mode,
|
||||
map,
|
||||
game_time,
|
||||
player_count,
|
||||
attacker_name,
|
||||
attacker_id,
|
||||
attacker_current_weapon,
|
||||
attacker_current_weapon_mods,
|
||||
attacker_weapon_1,
|
||||
attacker_weapon_1_mods,
|
||||
attacker_weapon_2,
|
||||
attacker_weapon_2_mods,
|
||||
attacker_weapon_3,
|
||||
attacker_weapon_3_mods,
|
||||
attacker_offhand_weapon_1,
|
||||
attacker_offhand_weapon_2,
|
||||
victim_name,
|
||||
victim_id,
|
||||
victim_current_weapon,
|
||||
victim_current_weapon_mods,
|
||||
victim_weapon_1,
|
||||
victim_weapon_1_mods,
|
||||
victim_weapon_2,
|
||||
victim_weapon_2_mods,
|
||||
victim_weapon_3,
|
||||
victim_weapon_3_mods,
|
||||
victim_offhand_weapon_1,
|
||||
victim_offhand_weapon_2,
|
||||
cause_of_death,
|
||||
distance
|
||||
} = req.body
|
||||
CreateKillRecord({
|
||||
tone_version,
|
||||
server,
|
||||
match_id,
|
||||
game_mode,
|
||||
map,
|
||||
game_time,
|
||||
player_count,
|
||||
attacker_name,
|
||||
attacker_id,
|
||||
attacker_current_weapon,
|
||||
attacker_current_weapon_mods,
|
||||
attacker_weapon_1,
|
||||
attacker_weapon_1_mods,
|
||||
attacker_weapon_2,
|
||||
attacker_weapon_2_mods,
|
||||
attacker_weapon_3,
|
||||
attacker_weapon_3_mods,
|
||||
attacker_offhand_weapon_1,
|
||||
attacker_offhand_weapon_2,
|
||||
victim_name,
|
||||
victim_id,
|
||||
victim_current_weapon,
|
||||
victim_current_weapon_mods,
|
||||
victim_weapon_1,
|
||||
victim_weapon_1_mods,
|
||||
victim_weapon_2,
|
||||
victim_weapon_2_mods,
|
||||
victim_weapon_3,
|
||||
victim_weapon_3_mods,
|
||||
victim_offhand_weapon_1,
|
||||
victim_offhand_weapon_2,
|
||||
cause_of_death,
|
||||
distance
|
||||
})
|
||||
res.send(200)
|
||||
}
|
||||
)
|
||||
export default router
|
||||
|
||||
@@ -0,0 +1,9 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const globals_1 = require("@jest/globals");
|
||||
(0, globals_1.describe)('integer module', () => {
|
||||
(0, globals_1.test)('3', () => {
|
||||
(0, globals_1.expect)(3).toBe(3);
|
||||
});
|
||||
});
|
||||
//# sourceMappingURL=tess.test.js.map
|
||||
@@ -0,0 +1 @@
|
||||
{"version":3,"file":"tess.test.js","sourceRoot":"","sources":["tess.test.ts"],"names":[],"mappings":";;AAAA,2CAAsD;AAEtD,IAAA,kBAAQ,EAAC,gBAAgB,EAAE,GAAG,EAAE;IAC9B,IAAA,cAAI,EAAC,GAAG,EAAE,GAAG,EAAE;QACb,IAAA,gBAAM,EAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,CAAA;IACnB,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
||||
+11
-10
@@ -11,7 +11,7 @@
|
||||
// "disableReferencedProjectLoad": true, /* Reduce the number of projects loaded automatically by TypeScript. */
|
||||
|
||||
/* Language and Environment */
|
||||
"target": "es2016", /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */
|
||||
"target": "es2016" /* Set the JavaScript language version for emitted JavaScript and include compatible library declarations. */,
|
||||
// "lib": [], /* Specify a set of bundled library declaration files that describe the target runtime environment. */
|
||||
// "jsx": "preserve", /* Specify what JSX code is generated. */
|
||||
// "experimentalDecorators": true, /* Enable experimental support for TC39 stage 2 draft decorators. */
|
||||
@@ -25,8 +25,8 @@
|
||||
// "moduleDetection": "auto", /* Control what method is used to detect module-format JS files. */
|
||||
|
||||
/* Modules */
|
||||
"module": "commonjs", /* Specify what module code is generated. */
|
||||
// "rootDir": "./", /* Specify the root folder within your source files. */
|
||||
"module": "commonjs" /* Specify what module code is generated. */,
|
||||
// "rootDir": "./" /* Specify the root folder within your source files. */,
|
||||
// "moduleResolution": "node", /* Specify how TypeScript looks up a file from a given module specifier. */
|
||||
// "baseUrl": "./", /* Specify the base directory to resolve non-relative module names. */
|
||||
// "paths": {}, /* Specify a set of entries that re-map imports to additional lookup locations. */
|
||||
@@ -47,9 +47,9 @@
|
||||
// "declaration": true, /* Generate .d.ts files from TypeScript and JavaScript files in your project. */
|
||||
// "declarationMap": true, /* Create sourcemaps for d.ts files. */
|
||||
// "emitDeclarationOnly": true, /* Only output d.ts files and not JavaScript files. */
|
||||
"sourceMap": true, /* Create source map files for emitted JavaScript files. */
|
||||
"sourceMap": true /* Create source map files for emitted JavaScript files. */,
|
||||
// "outFile": "./", /* Specify a file that bundles all outputs into one JavaScript file. If 'declaration' is true, also designates a file that bundles all .d.ts output. */
|
||||
"outDir": "./out/", /* Specify an output folder for all emitted files. */
|
||||
"outDir": "./out/" /* Specify an output folder for all emitted files. */,
|
||||
// "removeComments": true, /* Disable emitting comments. */
|
||||
// "noEmit": true, /* Disable emitting files from a compilation. */
|
||||
// "importHelpers": true, /* Allow importing helper functions from tslib once per project, instead of including them per-file. */
|
||||
@@ -71,12 +71,12 @@
|
||||
/* Interop Constraints */
|
||||
// "isolatedModules": true, /* Ensure that each file can be safely transpiled without relying on other imports. */
|
||||
// "allowSyntheticDefaultImports": true, /* Allow 'import x from y' when a module doesn't have a default export. */
|
||||
"esModuleInterop": true, /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */
|
||||
"esModuleInterop": true /* Emit additional JavaScript to ease support for importing CommonJS modules. This enables 'allowSyntheticDefaultImports' for type compatibility. */,
|
||||
// "preserveSymlinks": true, /* Disable resolving symlinks to their realpath. This correlates to the same flag in node. */
|
||||
"forceConsistentCasingInFileNames": true, /* Ensure that casing is correct in imports. */
|
||||
"forceConsistentCasingInFileNames": true /* Ensure that casing is correct in imports. */,
|
||||
|
||||
/* Type Checking */
|
||||
"strict": true, /* Enable all strict type-checking options. */
|
||||
"strict": true /* Enable all strict type-checking options. */,
|
||||
// "noImplicitAny": true, /* Enable error reporting for expressions and declarations with an implied 'any' type. */
|
||||
// "strictNullChecks": true, /* When type checking, take into account 'null' and 'undefined'. */
|
||||
// "strictFunctionTypes": true, /* When assigning functions, check to ensure parameters and the return values are subtype-compatible. */
|
||||
@@ -98,6 +98,7 @@
|
||||
|
||||
/* Completeness */
|
||||
// "skipDefaultLibCheck": true, /* Skip type checking .d.ts files that are included with TypeScript. */
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
}
|
||||
"skipLibCheck": true /* Skip type checking all .d.ts files. */
|
||||
},
|
||||
"compileOnSave": true
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user