Compare commits

...

2 Commits

Author SHA1 Message Date
d45b26fe09 Add deploy-lib workflow
Some checks failed
Deploy Lib / docker (ubuntu-latest, 2.44.0, 20.x) (push) Has been cancelled
2024-04-14 16:15:47 -04:00
13c0a76e97 DNS Record types 2024-04-14 16:10:45 -04:00
3 changed files with 85 additions and 16 deletions

View File

@ -0,0 +1,35 @@
name: Deploy Lib
on:
push:
branches: ["master"]
paths: ["Lib/**"]
jobs:
docker:
strategy:
matrix:
arch: ["ubuntu-latest"]
git-version: ["2.44.0"]
node-version: ["20.x"]
runs-on: ${{ matrix.arch }}
defaults:
run:
working-directory: ./Lib
# Steps to run
steps:
# Checkout the repo
- name: Checkout
uses: actions/checkout@v4
# Setup NodeJS
- name: Setup NodeJS
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Publish to NPM
run: npm publish
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

49
Lib/src/types/dns.d.ts vendored Normal file
View File

@ -0,0 +1,49 @@
/**
* An A record.
*/
interface ARecord extends DNSRecord {
/**
* The address of this record, undefined if unresolved.
*/
address?: string | undefined;
}
/**
* An SRV record.
*/
interface SRVRecord extends DNSRecord {
/**
* The priority of this record.
*/
priority: number;
/**
* The weight of this record.
*/
weight: number;
/**
* The port of this record.
*/
port: number;
/**
* The target of this record.
*/
target: string;
}
/**
* A representation of a DNS record.
*/
type DNSRecord = {
/**
* The type of this record.
*/
type: RecordType;
/**
* The TTL (Time To Live) of this record.
*/
ttl: number;
};

View File

@ -20,7 +20,7 @@ type MinecraftServer = {
/**
* The DNS records resolved for this server.
*/
records: DNSRecord[];
records: ARecord | SRVRecord[];
/**
* The player counts of this server.
@ -33,21 +33,6 @@ type MinecraftServer = {
motd: MOTD;
};
/**
* A representation of a DNS record.
*/
type DNSRecord = {
/**
* The type of this record.
*/
type: RecordType;
/**
* The TTL (Time To Live) of this record.
*/
ttl: number;
};
/**
* Player count data for a server.
*/