Skip to content

Commit

Permalink
feat(sdk,lib): add demostf
Browse files Browse the repository at this point in the history
  • Loading branch information
c43721 committed Nov 8, 2024
1 parent c8b4eea commit 1b61c42
Show file tree
Hide file tree
Showing 10 changed files with 177 additions and 0 deletions.
15 changes: 15 additions & 0 deletions node-sdk/lib/demostf-api-types/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"name": "logstf-api-types",
"version": "0.0.0",
"license": "MIT",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"scripts": {
"build": "tsup"
},
"devDependencies": {
"@types/node": "^18.11.17",
"tsup": "^6.5.0",
"typescript": "^4.9.4"
}
}
Empty file.
71 changes: 71 additions & 0 deletions node-sdk/lib/demostf-api-types/src/types/demo.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
export type Demo = {
/**
* Unique ID of the Demo
*/
id: number;

/**
* The download URL for the demo file
*/
url: string;

/**
* The name of the demo file
*/
name: string;

/**
* The name of server during the game
*/
server: string;

/**
* The length of the match in seconds
*/
duration: number;

/**
* The nickname of the user recording the demo
*/
nick: string;

/**
* The name of the map that was played
*/
map: string;

/**
* The time the demo was uploaded as a unix timestamp
*/
time: number;

/**
* The name of the RED team during the match
*/
red: string;

/**
* The name of the BLU team during the match
*/
blue: string;

/**
* The ending score of the RED team
*/
redScore: number;

/**
* The ending score of the BLU team
*/
blueScore: number;

/**
* The number of players in the game
*/
playerCount: number;

/**
* The unique id of the user who uploaded the demo
*/
uploader: number;
};
15 changes: 15 additions & 0 deletions node-sdk/lib/demostf-api-types/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"rootDir": "src",
"module": "ESNext",
"target": "ESNext",
"outDir": "dist",
"emitDecoratorMetadata": false,
"tsBuildInfoFile": "dist/.tsbuildinfo",
"skipLibCheck": true,
"baseUrl": "src",
"lib": ["ESNext"],
"removeComments": true
}
}
17 changes: 17 additions & 0 deletions node-sdk/lib/demostf-api-types/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from "tsup";

export default defineConfig({
clean: false,
bundle: false,
dts: true,
entry: ["src/**/*.ts", "!src/**/*.d.ts"],
format: ["esm", "cjs"],
minify: false,
tsconfig: "tsconfig.json",
target: "esnext",
splitting: false,
skipNodeModulesBundle: true,
sourcemap: true,
shims: false,
keepNames: true,
});
20 changes: 20 additions & 0 deletions node-sdk/sdks/demostf/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
{
"name": "demostf",
"version": "0.0.0",
"main": "./dist/index.js",
"types": "./dist/index.d.ts",
"license": "MIT",
"private": false,
"scripts": {
"build": "tsup"
},
"dependencies": {
"common": "*"
},
"devDependencies": {
"@sapphire/ts-config": "^3.3.4",
"@types/node": "^18.11.17",
"tsup": "^6.5.0",
"typescript": "^4.9.4"
}
}
7 changes: 7 additions & 0 deletions node-sdk/sdks/demostf/src/demostf.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
export class Demostf {
#apiKey: string;

constructor(apiKey: string) {
this.#apiKey = apiKey;
}
}
Empty file.
15 changes: 15 additions & 0 deletions node-sdk/sdks/demostf/tsconfig.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"extends": "@sapphire/ts-config",
"compilerOptions": {
"rootDir": "src",
"module": "ESNext",
"target": "ESNext",
"outDir": "dist",
"emitDecoratorMetadata": false,
"tsBuildInfoFile": "dist/.tsbuildinfo",
"skipLibCheck": true,
"baseUrl": "src",
"lib": ["ESNext"],
"removeComments": true
}
}
17 changes: 17 additions & 0 deletions node-sdk/sdks/demostf/tsup.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
import { defineConfig } from "tsup";

export default defineConfig({
clean: false,
bundle: false,
dts: false,
entry: ["src/**/*.ts", "!src/**/*.d.ts"],
format: ["esm", "cjs"],
minify: false,
tsconfig: "tsconfig.json",
target: "esnext",
splitting: false,
skipNodeModulesBundle: true,
sourcemap: true,
shims: false,
keepNames: true,
});

0 comments on commit 1b61c42

Please sign in to comment.