Skip to content

Commit

Permalink
v3.1.0 release 🎉
Browse files Browse the repository at this point in the history
- Fix broken SSL Chain (close #141)
- Add new header for requirements for DPS API
Close #139
Close #138
  • Loading branch information
phamleduy04 committed Jul 29, 2024
1 parent da8883e commit 884271b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
15 changes: 8 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "texas-dps-scheduler",
"version": "3.0.0",
"version": "3.1.0",
"description": "Texas DPS Automatic Scheduler",
"main": "dist/index.js",
"scripts": {
Expand All @@ -20,18 +20,18 @@
},
"homepage": "https://github.com/phamleduy04/texas-dps-scheduler#readme",
"devDependencies": {
"@eslint/create-config": "^1.1.6",
"@eslint/create-config": "^1.2.0",
"@types/ms": "^0.7.34",
"@types/node": "^20.14.11",
"@types/node": "^22.0.0",
"@types/prompts": "^2.4.9",
"@typescript-eslint/eslint-plugin": "^7.16.1",
"@typescript-eslint/parser": "^7.16.1",
"@typescript-eslint/eslint-plugin": "^7.17.0",
"@typescript-eslint/parser": "^7.17.0",
"eslint": "^8.57.0",
"eslint-config-prettier": "^9.1.0",
"eslint-plugin-prettier": "^5.2.1",
"prettier": "^3.3.3",
"ts-node": "^10.9.2",
"typescript": "^5.5.3"
"typescript": "^5.5.4"
},
"dependencies": {
"colorette": "^2.0.20",
Expand All @@ -40,9 +40,10 @@
"js-yaml": "^4.1.0",
"p-queue": "6.6.2",
"prompts": "^2.4.2",
"random-useragent": "^0.5.0",
"tslib": "^2.6.3",
"undici": "^6.19.4",
"yaml": "^2.4.5",
"yaml": "^2.5.0",
"zod": "^3.23.8"
},
"engines": {
Expand Down
10 changes: 8 additions & 2 deletions src/Client/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@ import type { ExistBookingPayload, ExistBookingResponse } from '../Interfaces/Ex
import type { CancelBookingPayload } from '../Interfaces/CancelBooking';

import { existsSync, mkdirSync, readFileSync, writeFileSync } from 'fs';
import randomUseragent from 'random-useragent';

// eslint-disable-next-line @typescript-eslint/no-var-requires
let packagejson;
Expand All @@ -29,14 +30,19 @@ try {
}
}
class TexasScheduler {
public requestInstance = new undici.Pool('https://apptapi.txdpsscheduler.com');
public requestInstance = new undici.Pool('https://apptapi.txdpsscheduler.com', {
connect: {
rejectUnauthorized: false,
},
});
public config = parseConfig();
public existBooking: { exist: boolean; response: ExistBookingResponse[] } | undefined;

private availableLocation: AvailableLocationResponse[] | null = null;
private isBooked = false;
private isHolded = false;
private queue = new pQueue({ concurrency: 1 });
private userAgent = randomUseragent.getRandom();

public constructor() {
// eslint-disable-next-line @typescript-eslint/no-var-requires, prettier/prettier
Expand Down Expand Up @@ -231,7 +237,7 @@ class TexasScheduler {
headers: {
'Content-Type': 'application/json;charset=UTF-8',
Origin: 'https://public.txdpsscheduler.com',
Referer: 'https://public.txdpsscheduler.com/',
'User-Agent': this.userAgent,
},
headersTimeout: this.config.appSettings.headersTimeout,
body: JSON.stringify(body),
Expand Down

0 comments on commit 884271b

Please sign in to comment.