137 Commits

Author SHA1 Message Date
7631f085ef Fix packages/server 2019-09-16 10:46:17 +07:00
6cbcf3c69c Update TODO.md 2019-09-14 12:59:08 +07:00
0d1fddf512 Fix linting errors 2019-09-14 12:53:30 +07:00
ac8f1d9ff3 Run rondo syncEsmConfig 2019-09-14 12:01:29 +07:00
c14456b606 Move validator into separate package 2019-09-14 11:41:21 +07:00
103f6d1e7a Remove BaseService 2019-09-14 11:14:28 +07:00
1fde923dbf Fix concurrency issue in TeamService.test.ts 2019-09-14 10:30:44 +07:00
d532ac82f0 Fix broken tests 2019-09-14 10:05:35 +07:00
195d7226e8 Rename jsonrpc types 2019-09-13 23:49:05 +07:00
25589b870c Refactor common/team 2019-09-11 13:34:41 +07:00
ae2ed21f05 Remove unused routes
TBD: fix comments-server
2019-09-11 12:18:13 +07:00
055d9588bf Use JSONRPC in TeamService (needs more testing) 2019-09-11 00:40:10 +07:00
eebe26f706 Extract redux, http-types, http-client and test-utils 2019-09-10 17:56:25 +07:00
f509004dac Add rpc/TeamService.test.ts 2019-09-07 19:44:29 +07:00
b813916c19 Use simpler interface for Bootstrap app server 2019-09-07 19:27:21 +07:00
4f533e7fff Return headers from login/registerAccount test methods 2019-09-07 09:44:00 +07:00
3739f27ebe Add first test for JSONRPC service 2019-09-07 09:38:43 +07:00
5cf54d0be9 Rename old UserService to AuthService, LoginRoutes to AuthRoutes 2019-09-05 10:19:27 +07:00
5b5adb6408 Update dependencies
TypeScript 3.6 cannot be updated because of a current bug with
FindConditions<?>.

https://github.com/typeorm/typeorm/pull/4470
https://github.com/typeorm/typeorm/issues/4662

https://github.com/microsoft/TypeScript/pull/33144
2019-09-01 14:17:08 +07:00
dcc5b52725 Do not subclass Bootstrap.ts 2019-08-31 15:29:37 +07:00
5688a65cb0 Rename configureApplication to configureServer 2019-08-31 14:19:56 +07:00
8ca6107ce6 Replace Application class w/ configureApplication 2019-08-31 14:14:11 +07:00
64f5f2f642 Replace Application.ts with createAppication and configureApplication 2019-08-31 11:42:12 +07:00
67e3da3246 Add ability to configure rpc services. Needs further testing 2019-08-31 09:12:10 +07:00
5b9f4b9321 Create transaction for JSONRPC middleware 2019-08-30 13:21:16 +07:00
2f35b65f48 Add jsonrpc services to server(s) 2019-08-30 11:02:31 +07:00
7434c9fb42 Add UserService (RPC version) 2019-08-28 18:26:26 +07:00
cd5ff9b5da Generate @rondo.dev/common entities 2019-08-28 08:08:00 +07:00
22f0b15e3a Add debounce.cancel, cancel session cleanup 2019-08-27 14:54:47 +07:00
2256fbc1e8 Fix SessionStore concurrency in tests by debouncing fn 2019-08-26 20:13:35 +07:00
359c6afd08 Add test for doInNewTransaction (mysql) 2019-08-26 19:25:54 +07:00
76bf7d8d47 Add transactionId to SqlLogger 2019-08-26 19:08:35 +07:00
02d072a361 Add TransactionManager.doInNewTransaction 2019-08-26 19:07:21 +07:00
67ae8dac57 Replace unnecessary DB with IDatabase 2019-08-26 18:53:52 +07:00
291d05e2be Expose bootstrap in test.ts 2019-08-26 18:46:06 +07:00
772c3f6682 Use real cls-hooked in tests instead of NamespaceMock
https://github.com/Jeff-Lewis/cls-hooked/issues/17#issuecomment-510168720

Note: uses undocumented methods ns.enter(context) and ns.exit(context)
2019-08-26 11:14:11 +07:00
e2c8fca29b TODO: fix deadlock caused by SessionStore#cleanup 2019-08-26 09:10:27 +07:00
d8ab2decef Fix correlation id for tests 2019-08-25 23:37:27 +07:00
040af18765 Use process.env.JEST_WORKER_ID when creating username 2019-08-25 23:08:16 +07:00
1762dad4d1 Add ability to run @rondo/server tests in parallel 2019-08-25 23:07:47 +07:00
1e53f55cfa Check if date is valid before calling toISOString() 2019-08-25 22:21:34 +07:00
91ecdbba10 Move js-yaml to packages/config 2019-08-25 20:46:47 +07:00
1bbc3ed97d Extract ConfigReader to @rondo.dev/config pkg 2019-08-25 20:43:09 +07:00
9aaf8b62a9 Add @rondo.dev/logger, remove winston 2019-08-25 14:12:24 +07:00
dffad844ad Rename scope @rondo to @rondo.dev 2019-08-25 11:33:06 +07:00
79c6d1a608 Refactor scripts, add ability to load external scripts 2019-08-18 09:57:47 +07:00
19565563cc Add Contextual<Service, Context> type
As seen in TeamService2.ts, the Contextual type will add Context as the
last argument to any method of the interface, as long as the method has
0-4 arguments.

Interfaces with more than 4 arguments cannot use this type, but they
could be converted to interfaces which use 1 argument
(object/dictionary) only.

Some long-term thinking: Maybe only methods with a single argument
should be supported, similar to the way gRPC does it.
2019-08-07 22:37:48 +07:00
b617069784 Add packages/services/src/services/TeamService2.ts
A few notes:

1) The context higher-order function will be tedious to define - a lot
   more typing than just an extra function argument.
2) As some methods do not require the context function, forgetting to
   call it might introduce bugs (await fn will not error out), but
   compile checks of the return value type might detect this

Possible solution is to go the GRPC way and allow only a single method
type as a parameter so all server-side method types would look like:

  async fn(param: IParam, context: Context) {}

and all client-side method types would look like:

  async fn(param: IParam) {}

However, This would deviate from the JSON-RPC standard which allows
multiple arguments to be passed in an array.

Alternatively, context could be passed as a first argument and then
filtered out:

  type Arguments<T> = T extends (context: Ctx, ...args: infer A) => infer R
    ? A
    : never

In this case, the type of Ctx would need to be known in advance. Will
have to think about this some more.
2019-08-06 19:26:11 +07:00
15d54639ab Move ILogger to @rondo/common 2019-08-04 13:15:33 +07:00
4c3570a9ce Do not extend/modify existing entities
Typeorm loads all @Entities and decorator-defined relations into a
global variable, and thus makes it impossible to override already
defined variables.

Will have to think about how to disable this behaviour in case the user
of this library does not want to use predefined variables, but for now
we will use the predefined defaults.
2019-08-02 20:17:10 +07:00