Commit Graph
100 Commits
Author SHA1 Message Date
Tau 0d8d5845c9 schema: Fix M0011 for newly-created databases 2019-12-09 23:06:20 -05:00
Tau 143f534ba1 npm audit 2019-12-09 22:55:25 -05:00
Tau 4db3d94ee8 idz: Un-hardcode result limit in repo layer
Minor design nit but I should probably take my own code review
advice.
2019-11-30 14:13:49 -05:00
Tau e195cf77cd idz: Wire up TA topTen team results 2019-11-30 14:05:36 -05:00
Tau ac9622f1bd idz: Extend Time Attack topTen result set 2019-11-30 14:05:14 -05:00
Tau e8535b1a80 idz: Label additional team info in topTen response 2019-11-30 13:35:37 -05:00
Tau 60d2f7cfd3 Fix working directory issues in startup batch file 2019-11-09 14:03:16 -05:00
Tau 0ac8b44ce0 idz/sql/teamMember.ts: Fix another ignored result set
That should cover all the leftover uses of forUpdate() ...
2019-11-09 14:00:24 -05:00
Tau 59fec74d08 Add Project DIVA workaround to startup script 2019-11-09 13:42:40 -05:00
Tau 52f142a2b9 Bump deps so npm audit will shut up 2019-11-08 19:46:19 -05:00
Tau 3a7132d276 Drop ts-node
Stopped using it a while ago, `tsc --watch` is more convenient.
2019-11-08 19:43:59 -05:00
Tau 4f89894fd1 chunithm: Raise POST payload size limit 2019-11-08 19:39:03 -05:00
Tau c50a0093fd idz/sql/teamReservation.ts: Fix ignored result set
Apparently the latest SQLite driver doesn't like it if you do that.
2019-11-06 17:29:07 -05:00
Tau 1b41b82745 Tiny cosmetic change 2019-11-06 17:29:07 -05:00
Tau d1d63e1ef9 chunithm: Initial implementation code drop
No cleaner development history than this exists. It's difficult to
methodically design something when you don't yet know what it is
you're designing.
2019-11-06 17:29:07 -05:00
Tau beb9144e9b sql/util.ts: Add a simple SQL record mapper
sql-bricks can write queries for us, and the mapper handles type
conversions to and from SQL-friendly strings.
2019-11-06 17:29:07 -05:00
Tau d58f4bed8f Add npm "snakeCase" dep 2019-11-06 17:29:07 -05:00
Tau 125e4d8ca7 sql/sqlite.ts: Fix NULL handling 2019-11-06 17:29:07 -05:00
Tau b096a79f95 Simplify aime_player schema 2019-11-06 17:29:07 -05:00
Tau 04b0ccfda3 Force UTC for all internal date processing 2019-11-06 17:29:07 -05:00
Tau 82bd9ad7bb Additional assorted layering cleanups 2019-11-06 17:29:07 -05:00
Tau 6a4ac795b2 Heal the layer break around the Id<> type 2019-11-06 17:29:07 -05:00
Tau 3a71f5054c Bump to Node v12
This is the LTS version now, might as well use it.
2019-11-06 17:29:07 -05:00
Tau 650e05310d Flip-flop on debug logging code style 2019-11-06 17:29:07 -05:00
Tau 3aee0f611c sql/sqlite.ts: Make FK constraints do something
They don't by default, because they didn't in older versions of
SQLite and some older applications might rely on that. You have to
send an explicit pragma prior to opening a transaction to make them
take effect.
2019-11-06 17:29:07 -05:00
Tau fa45169b96 Enhance vscode config files 2019-11-06 17:29:07 -05:00
Tau 07222c9ae9 Add stub README.md 2019-11-06 17:29:01 -05:00
Tau 38298a2840 Add Windows batch file to init and start the server 2019-11-06 17:28:31 -05:00
Tau 2440bedf4a Add Markdown to .editorconfig 2019-11-06 17:28:31 -05:00
Tau 9acc375d99 Tweak switchboard defaults 2019-11-06 17:28:31 -05:00
Tau 799ace06d7 Wire up schema automation 2019-11-06 17:28:31 -05:00
Tau 6d91659b24 Add automated schema management 2019-11-06 17:28:31 -05:00
Tau 151dd41e64 sql: Add db compaction method 2019-11-06 17:28:31 -05:00
Tau 13e234a68c sql: Add raw SQL interface method 2019-11-06 17:28:31 -05:00
Tau 839debca97 Bump declared TypeScript dep 2019-11-06 17:28:31 -05:00
Tau abda3d5279 Switch to npm from Yarn
Yarn is the better package manager IMO, but npm comes with node and
using it does make the end-user installation experience a little
simpler as a result.
2019-11-06 17:28:31 -05:00
Tau 44d8c0a824 Tweak package.json lifecycle scripts 2019-11-06 17:28:31 -05:00
Tau f348feff62 sql/sqlite.ts: Fix type check 2019-11-06 17:28:30 -05:00
Tau 6603b6aaa6 Rename database file 2019-11-06 17:28:30 -05:00
Tau a96924c24f Abbreviate startup msg logging 2019-11-06 17:28:30 -05:00
Tau aa53fd8146 allnet: Add some environment fallbacks 2019-11-06 17:28:30 -05:00
Tau bbb5a3b408 aimedb/pipeline.ts: Silence a deprecation warning 2019-11-06 17:28:30 -05:00
Tau 072d70b42a Migrate to SQLite3
We'll keep the door open for side-by-side support of Postgres in
the background, but due to SQLite's type system quirks we cannot
use the same DDL for both databases, so we would have to maintain
two sets of DDL (schema init and schema migration scripts) at once.

Interested future contributors can shoulder this maintenance burden
if they so choose.
2019-11-06 17:28:30 -05:00
Tau f9970fa81c Force explicit conversion of rows fetched from SQL DB
Everything is a scalar value now, and while this does involve more
boilerplate it will also catch type conversion issues like
"1" + 0 === "10" in the future.
2019-11-06 17:28:30 -05:00
Tau 30d42bd832 Store array colums as CSV text
This is in preparation for a transition to SQLite, which sadly does
not support array-valued columns (or indeed have much of a type
system in general).
2019-11-06 17:28:30 -05:00
Tau 3e6b4f4798 Add an SQL DB abstraction layer
Because what self-respecting Enterprise(R) project doesn't have
one of those?
2019-11-06 17:28:30 -05:00
Tau 2ccd9dc382 types/sql-bricks-postgres: Add initial typings
This commit declares and type-checks the following clauses:

* limit().offset() chains on SelectStatement
* onConflict().doUpdate() chains on InsertStatement

We need to flesh out the other possibilities for onConflict() in
particular before all these changes get submitted as an upstream
PR.
2019-11-06 17:28:30 -05:00
Tau 691841187b types/sql-bricks: Make Statement chains polymorphic
This will allow us to cleanly extend these interfaces with
additional clauses understood by Postgres, which we can then chain
without having to redeclare the entire interface.
2019-11-06 17:28:30 -05:00
Tau a71a73e324 types/sql-bricks: Export Statement interfaces
We'll need access to these statements so that we can extend them.
2019-11-06 17:28:30 -05:00
Tau 078cb84b35 types/sql-bricks: Export SqlBricksFn type
We'll need to export this in order to define the ops exported from
sql-bricks-postgres in terms of the base sql-bricks exports.
2019-11-06 17:28:30 -05:00
Tau 775584a645 types/sql-bricks: Fixup forked typings
Wrap everything in a module instead of a namespace. I'm still not
entirely clear on what the distinction is but the forked typings
don't seem to get applied without this change.
2019-11-06 17:28:30 -05:00
Tau 384212ce2e Locally fork sql-bricks types 2019-11-06 17:28:30 -05:00
Tau 1567b689b9 Add local typings directory to project 2019-11-06 17:28:30 -05:00
Tau 254478e20c Use workspace TypeScript ver in vscode 2019-11-06 17:28:30 -05:00
Tau 4dd3f39472 Fix sql-bricks import style 2019-11-06 17:28:30 -05:00
Tau 49802602bf Minor package.json cleanups 2019-11-06 17:28:30 -05:00
Tau 6ab2112ea9 Stop using SQL namespaces ("schemas")
This is in preparation for a transition to SQLite. SQLite does have
a similar concept called "attached databases", but it's kind of a
pain to deal with if you're casually browsing a database from the
`sqlite3` CLI so we'll just use some slightly uglier explicitly
namespaced table name identifiers instead.
2019-11-06 17:28:30 -05:00
Tau 6be23145d8 Crack Diva handlers 2019-11-06 17:28:30 -05:00
Tau cc0cd06c92 Crack Chunithm handlers 2019-11-06 17:28:30 -05:00
Tau 9697b4b06e Use debug package for logging 2019-11-06 17:28:30 -05:00
Tau db260d5f2f idz/decoder: Drop RequestCode typedef
This is just boilerplate for its own sake.
2019-11-06 17:28:30 -05:00
Tau 3f62f1683b idz/handler/createTeam.ts: Fix incomplete refactor
This looks like duplicated code that wasn't deleted after being
factored out into a helper proc.
2019-11-06 17:28:30 -05:00
Tau 7118a72b3b Use esModuleInterop 2019-11-06 17:28:30 -05:00
Tau a5256c97d3 Fix SQL column capitalization 2019-11-06 17:28:30 -05:00
Tau 84023e2eb8 chunithm.ts: Beat compression m/ware with a wrench
Force unconditional compression of responses harder.
2019-11-06 17:28:30 -05:00
Tau 39849483c8 Clean up obsolete state files
Hostname is configured from .env now along with everything else.
JSON state storage backend has been abandoned. We might add an
SQLite backend to go with the current Postgres backend at some
point though; SQLite even supports window functions these days.
2019-11-06 17:28:30 -05:00
Tau 490264b35a Check in a canonical PKI
For some reason initpki doesn't generate a set of certs that are
acceptable to the P-Ras core, even though I never modified it.
Maybe some defaults changed in a recent release of OpenSSL or
something.

Well, to make everybody's life easier let's all just use the same
private keys for everything. It's not like it matters.
2019-11-06 17:28:30 -05:00
Tau 4298810728 aimedb: Defensively close connection after a Goodbye
We should probably also add request timeouts and such.
2019-11-06 17:28:30 -05:00
Tau 3fea2dae56 allnet.ts: Restrict request filter to PowerOn
PowerOn uses HTTP slightly incorrectly, but other endpoints use
HTTP incorrectly in different ways (or maybe even correctly, who
knows). Scope the current request interceptor to just PowerOn.
2019-11-06 17:28:30 -05:00
Tau 4a2b3f51a4 allnet.ts: Rename from startup.ts 2019-11-06 17:28:30 -05:00
Tau 355f20c50b Add host/port "switchboard" module
Centrally list all hostnames and port numbers here. Need to push
this into IDZ further but I'm a bit short on time (so what else is
new).
2019-11-06 17:28:30 -05:00
Tau ff4545d468 aimedb: Return decimal IDm as access code 2019-11-06 17:28:30 -05:00
Tau 7fd6f74986 db: Fix expected schema version 2019-11-06 17:28:30 -05:00
Tau 2478bc5ceb idz: Implement team leadership transfer 2019-11-06 17:28:30 -05:00
Tau 3bee10d948 idz: Implement team member add/remove 2019-11-06 17:28:30 -05:00
Tau 2bd9ce919a idz: Implement saveTeamBanner 2019-11-06 17:28:30 -05:00
Tau a3df4df277 idz: Wire up team create and load 2019-11-06 17:28:30 -05:00
Tau ec214d5beb idz: Add team "reservation" repository
This is a hack necessary to support certain quirks of the
Initial D Zero profile creation process.
2019-11-06 17:28:30 -05:00
Tau a5dbdef33f idz: Add TeamAutoRepository 2019-11-06 17:28:30 -05:00
Tau be48619a4a idz: Add TeamMemberRepository 2019-11-06 17:28:30 -05:00
Tau c6a67bd647 idz: Add TeamRepository 2019-11-06 17:28:30 -05:00
Tau d1c3051a5e idz: Add initial team tables 2019-11-06 17:28:30 -05:00
Tau f874f56816 idz: Expose some row mappers 2019-11-06 17:28:30 -05:00
Tau 4f044de9fb idz: Add "Auto team" data model
New players get packed into automatically-created teams whose
names follow an automated pattern. Add data models to support this.
2019-11-06 17:28:30 -05:00
Tau 33e2f55dce idz: Clean up Team and TeamMember data models 2019-11-06 17:28:30 -05:00
Tau 85510ee0e1 idz: Tweak ProfileRepository interface 2019-11-06 17:28:30 -05:00
Tau 9c06d6635f idz: Rename encoder funcs
Avoid name collision between nouns and verbs.
2019-11-06 17:28:30 -05:00
Tau c2b0bcabc4 idz: Remove profile ext id
Turns out (while researching team creation) the profile ext id
is just the aime id. After creating a team a profile discovery
request is immediately issued with the "profile id" in the field
that holds the aime id during initial profile load.
2019-11-06 17:28:30 -05:00
Tau 7c96253160 idz: Trim trailing NULs in team name 2019-11-06 17:28:30 -05:00
Tau faaeb53cd9 idz: Label banner field in team creation 2019-11-06 17:28:30 -05:00
Tau 1aaae51eab Add ID generation sprocs for manual db interventions 2019-11-06 17:28:30 -05:00
Tau 98f6fb9d5b idz: Fix backwards compatibility
Silently drop OOB course IDs instead of erroring. Those IDs may
come from later versions which have bigger arrays in that spot.
2019-11-06 17:28:30 -05:00
Tau 4d7a0d64a1 idz: Fix loadTopTen harder
Unconditionally return a response; the team ID and profile ID
don't actually seem to affect what the client expects to receive
(world top ten must be returned in all cases).
2019-11-06 17:28:30 -05:00
Tau 9dd45558ec aimedb: Stub a FeliCa lookup response 2019-11-06 17:28:30 -05:00
Tau af8cdf3072 idz: TA world record fixes 2019-11-06 17:28:30 -05:00
Tau a3705730ce idz: Stub new UpdateStoryClearNum 2019-11-06 17:28:30 -05:00
Tau 83ddfcc022 idz: Decode new LoadTopTenRequest
Response code and presumably layout is still the same.
2019-11-06 17:28:30 -05:00
Tau 5c6b8f27a4 idz: Add LockProfileExtend 2019-11-06 17:28:30 -05:00
Tau 6a89e6a15a idz: Fix LockProfileRequest type name 2019-11-06 17:28:30 -05:00
Tau 1e809f59a3 idz: Implement new req code for TA save..? 2019-11-06 17:28:30 -05:00