1
0
Fork 0
Commit Graph

7 Commits (9b5cd4e89f8d8778994a01eca641d4b78296c4d9)

Author SHA1 Message Date
Austin Schaffer 9b5cd4e89f [DEV-5312] Call data-processor and instantiate classes 2019-11-20 09:48:28 -05:00
Austin Schaffer 91a7cf94b2 [DEV-5312] Add dao for deltas 2019-11-12 16:21:01 -05:00
Austin Schaffer 015a3f5d47 [DEV-5312] Convert MongoServerDao to TS 2019-11-11 15:14:49 -05:00
Mike Gerwitz ddf5892c83 src/types/mongo.d.ts: Add findAndModify
* src/types/mongo.d.ts (MongoCollection)[#findAndModify]: New method.
2019-10-18 09:55:10 -04:00
Mike Gerwitz 18e86ebfe7 TokenDao: Add test and further refine types
This tests the existing state of TokenDao before additional modifications
are made.  This commit also further refines the types introduced in a
previous commit.

This is also the first test written in Typescript.

* package.json.in (devDependencies): Add node, chai, and mocha types.
* src/server/token/TokenDao.ts (updateToken): `data` accepts null (as it
    should).  Do not conditionall add data to object (it doesn't matter for
    later retrieval).  Note nondeterminism with date.  More concise syntax
    for object fields.
* src/server/token/TokenQueryResult.ts: Make all fields readonly.
  (TokenStatus): Date is no longer optional (see above mention).
* src/types/mongodb.d.ts: Remove generics (erroneously added).
  (Collection)[update]: Remove 3-argument declaration (see comment).
* test/server/token/TokenDaoTest.ts: New test case.
2019-10-17 11:47:14 -04:00
Mike Gerwitz b83f13f480 TokenDao: Add type information for Mongo interactions
This adds type information for both MongoCollection and some details about
the structure of the data itself as it is stored in the database.

* src/server/token/TokenDao.ts: Import types from TokenQueryResult.
  (TokenType): Move to TokenQueryResult module.
  (TokenData)[status]: string=>TokenStatus.
  (TokenDao)[_collection]: Remove optional type specifier.
    [_collection]: Make readonly.
    [updateToken]: Use TokenStatus type for token_entry.
    [getToken]: Add return type.  Add type for query result.  Remove useless
      length check (no such field exists).  Add types for variables.
    [_getLatestToken]: Use interface instead of inline type definition.
    [_getRequestedToken]: Use type definition for `data' instead of
      `any'.  Add type of variable.
* src/server/token/TokenQueryResult.ts: Define structure of data in Mongo.
* src/types/mongodb.d.ts: Add type information for methods used by TokenDao.
2019-10-17 11:47:14 -04:00
Mike Gerwitz 5a1b84c271 TokenDao: Typescript conversion
This is the first test of integrating typescript.  I'm using the `export ='
syntax to keep imports the same using `require', but note that the `new'
keyword is now required for instantiation (whereas it was not with easejs).
2019-10-17 11:47:14 -04:00