Skip to content

Commit 106e151

Browse files
committed
update non-esm packages
1 parent 42dc579 commit 106e151

File tree

9 files changed

+902
-781
lines changed

9 files changed

+902
-781
lines changed

package-lock.json

Lines changed: 890 additions & 758 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"url": "http://github.com/odota/core"
3232
},
3333
"dependencies": {
34-
"@aws-sdk/client-s3": "^3.726.0",
34+
"@aws-sdk/client-s3": "^3.879.0",
3535
"@elastic/elasticsearch": "^7.17.14",
3636
"ansi-colors": "^4.1.3",
3737
"axios": "^1.7.9",
@@ -50,7 +50,7 @@
5050
"moment": "^2.30.1",
5151
"passport": "^0.5.3",
5252
"passport-steam": "^1.0.18",
53-
"pg": "^8.13.1",
53+
"pg": "^8.16.3",
5454
"pg-query-stream": "^4.7.1",
5555
"pm2": "^6.0.8",
5656
"protobufjs": "^7.2.5",

svc/api/spec.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import constants from 'dotaconstants';
22
import moment from 'moment';
3-
import pg from 'pg';
3+
import { Client } from 'pg';
44
import config from '../../config.ts';
55
import { addJob, addReliableJob, getReliableJob } from '../store/queue.ts';
66
import { search } from '../store/search.ts';
@@ -50,7 +50,6 @@ import {
5050
getItemTimings,
5151
isSubscriber,
5252
} from '../util/queries.ts';
53-
const { Client } = pg;
5453
import heroParams from './requests/heroParams.ts';
5554
import leagueParams from './requests/leagueParams.ts';
5655
import matchParams from './requests/matchParams.ts';

svc/store/archive.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import type { PutObjectCommandInput, PutObjectCommandOutput } from '@aws-sdk/client-s3';
22
import config from '../../config.ts';
33
import { gzipSync, gunzipSync } from 'zlib';
4-
import s3 from '@aws-sdk/client-s3';
4+
import { S3Client, PutObjectCommand, GetObjectCommand } from '@aws-sdk/client-s3';
55
import { redisCount } from '../util/utility.ts';
66
import axios from 'axios';
77

8-
const { S3Client, PutObjectCommand, GetObjectCommand } = s3;
9-
108
async function stream2buffer(stream: any): Promise<Buffer> {
119
return new Promise((resolve, reject) => {
1210
const _buf: any[] = [];
@@ -21,7 +19,7 @@ class Archive {
2119
private accessKeyId: string = '';
2220
private secretAccessKey: string = '';
2321
private bucket: string = '';
24-
private client: s3.S3Client | null = null;
22+
private client: S3Client | null = null;
2523
constructor(type: 'match' | 'player' | 'blob') {
2624
this.endpoint = config.ARCHIVE_S3_ENDPOINT;
2725
this.accessKeyId = config.ARCHIVE_S3_KEY_ID;

svc/store/db.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
import pg from 'pg';
1+
import { types } from 'pg';
22
import knex from 'knex';
33
import config from '../../config.ts';
44
// remember: all values returned from the server are either NULL or a string
5-
pg.types.setTypeParser(20, (val) => (val === null ? null : parseInt(val, 10)));
5+
types.setTypeParser(20, (val) => (val === null ? null : parseInt(val, 10)));
66
console.log('connecting %s', config.POSTGRES_URL);
77
export const db = knex({
88
client: 'pg',

svc/store/queue.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,9 @@ import redis from './redis.ts';
33
import db from './db.ts';
44
import { Redis } from 'ioredis';
55
import config from '../../config.ts';
6-
import pg from 'pg';
6+
import { Client } from 'pg';
77
import c from 'ansi-colors';
88

9-
const { Client } = pg;
10-
119
moment.relativeTimeThreshold('ss', 0);
1210

1311
export async function runQueue(

svc/util/archiveUtil.ts

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,13 @@
11
import config from '../../config.ts';
22
import { matchArchive, playerArchive } from '../store/archive.ts';
33
import QueryStream from 'pg-query-stream';
4-
import pg from 'pg';
4+
import { Client } from 'pg';
55
import db from '../store/db.ts';
66
import type { PutObjectCommandOutput } from '@aws-sdk/client-s3';
77
import { getFullPlayerMatchesWithMetadata } from './buildPlayer.ts';
88
import { getMatchDataFromBlobWithMetadata } from './buildMatch.ts';
99
import { isDataComplete, randomInt, redisCount } from './utility.ts';
1010

11-
const { Client } = pg;
12-
1311
async function processMatch(matchId: number) {
1412
// Check if we should archive the blobs (should be parsed and not archived)
1513
// const isParsed = await checkIsParsed(matchId);

test/test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ import nock from 'nock';
88
import assert from 'assert';
99
import supertest from 'supertest';
1010
import stripe from '../svc/store/stripe.ts';
11-
import pg from 'pg';
11+
import { Pool } from 'pg';
1212
import { readFileSync } from 'fs';
1313
import url from 'url';
1414
import { Client } from 'cassandra-driver';
@@ -31,11 +31,8 @@ import redis from '../svc/store/redis.ts';
3131
import db from '../svc/store/db.ts';
3232
import cassandra from '../svc/store/cassandra.ts';
3333
import c from 'ansi-colors';
34-
import s3 from '@aws-sdk/client-s3';
34+
import { CreateBucketCommand, S3Client } from '@aws-sdk/client-s3';
3535

36-
const { CreateBucketCommand, S3Client } = s3;
37-
38-
const { Pool } = pg;
3936
const { RETRIEVER_HOST, POSTGRES_URL, CASSANDRA_URL } = config;
4037
const initPostgresHost = POSTGRES_URL.replace('/yasp_test', '/postgres');
4138
const initCassandraHost = url.parse(CASSANDRA_URL).host as string;

tsconfig.json

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
{
22
"compilerOptions": {
33
"target": "es2020",
4-
"module": "NodeNext",
4+
"module": "nodenext",
55
"allowJs": true,
66
"strict": true,
77
"esModuleInterop": true,
8-
"outDir": "./build",
98
"resolveJsonModule": true,
109
"noEmit": true,
1110
"allowImportingTsExtensions": true

0 commit comments

Comments
 (0)