60 Commits

Author SHA1 Message Date
9165b96e0f Fix comments-server 2019-09-16 20:46:52 +07:00
73c27aec6a Fix packages/comments-common 2019-09-16 11:39:36 +07:00
30d1f1fcd4 Partiall upgrade packages/client 2019-09-15 18:29:55 +07:00
50d36f268f Fix linting errors in packages/jsonrpc 2019-09-15 17:14:31 +07:00
ac8f1d9ff3 Run rondo syncEsmConfig 2019-09-14 12:01:29 +07:00
195d7226e8 Rename jsonrpc types 2019-09-13 23:49:05 +07:00
9199961fdb Add jsonrpc createClientMock 2019-09-10 21:29:10 +07:00
eebe26f706 Extract redux, http-types, http-client and test-utils 2019-09-10 17:56:25 +07:00
3739f27ebe Add first test for JSONRPC service 2019-09-07 09:38:43 +07:00
0a1eabadd9 Add test for _-prefixed methods 2019-09-05 09:31:32 +07:00
c4ae271604 Move private _-prefix method check into getAllMethods 2019-09-05 09:28:48 +07:00
1aa6cae0f3 Add ability to specify jsonrpc context asynchronously 2019-09-05 09:25:38 +07:00
4814316fa7 Use @rondo.dev/comments-common instead of @rondo.dev/common 2019-08-31 10:28:41 +07:00
67e3da3246 Add ability to configure rpc services. Needs further testing 2019-08-31 09:12:10 +07:00
fbd7a2229b Do not use proxy in createLocalClient, add bulk methods 2019-08-31 08:22:17 +07:00
d2a5a35543 Revert back to context in createLocalClient 2019-08-30 17:51:14 +07:00
0222455cd7 Breaking change: JSONRPC context is always 1st argument 2019-08-30 17:12:46 +07:00
b8fb7c2eba Add warning message about JSONRPC 2019-08-30 16:26:29 +07:00
5cc20ccd8e Remove baseURL from packages/jsonrpc#createRemoteClient 2019-08-30 15:01:01 +07:00
9cc5a7affb Add ability to wrap method calls in jsonrpc 2019-08-30 13:19:13 +07:00
4ea534293b Use Object.getPrototypeOf instead of obj.__proto__ 2019-08-30 13:19:04 +07:00
05946ee342 Remove space in supertest.ts 2019-08-30 13:18:33 +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
b9e043e39e Export @ensure 2019-08-27 21:15:00 +07:00
8d73ece7b9 Remove comment 2019-08-27 21:14:41 +07:00
954f94f6b0 Add test for @ensure and instance methods 2019-08-27 21:13:13 +07:00
46a0a064d0 Make @ensure work with classes 2019-08-27 21:09:39 +07:00
0c867e916e Rename v to validate 2019-08-27 20:34:05 +07:00
9262cb636e Use getMetadata instead of getOwnMetadata 2019-08-27 20:33:21 +07:00
c7ab4fe387 Add ability to validate context via @ensure 2019-08-27 16:17:05 +07:00
dffad844ad Rename scope @rondo to @rondo.dev 2019-08-25 11:33:06 +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
cc2f5f58e2 Add ability to specify jsonrpc context as extra argument
In this case the interface does not define context, but the implementing
service may use it as an optional argument:

  interface IService {
    add(a: number, b: number): number
  }

  class Service implements IService {
    add(a: number, b: number, ctx?: IContext): number {
      return a + b + ctx!.userId
    }
  }
2019-08-06 20:10:38 +07:00
86e90d28bb Make express jsonrpc use a builder pattern 2019-08-05 21:07:46 +07:00
f3f6166aab Send 405 when GET request is not allowed 2019-08-05 21:07:46 +07:00
e2f6c5f798 Encode JSON-RPC GET request params as JSON 2019-08-05 21:07:46 +07:00
81225b77a8 Implement GET method for idempotent methods 2019-08-05 21:07:46 +07:00
7edbe354a9 Remove TODO from jsonrpc 2019-08-05 21:07:46 +07:00
15d54639ab Move ILogger to @rondo/common 2019-08-04 13:15:33 +07:00
aeb208162f Refactor express#handleError 2019-08-04 13:02:01 +07:00
e6a98bb450 Add ability to call idempotent methods via GET request 2019-08-04 10:19:42 +07:00
c273c1b914 Extract jsonrpc functionality into a separate file 2019-08-04 10:08:06 +07:00
1cb41e4b4a Move types to types.ts, rename some types 2019-08-02 08:27:53 +07:00
9aba9000b7 Rename createReduxClient to createActions 2019-08-01 20:01:30 +07:00
daf32de431 Add test for missing method 2019-08-01 19:55:30 +07:00
2b0ccfb984 Update createReducer API for jsonrpc 2019-08-01 19:40:26 +07:00
4faedc23ce WIP: Add ability to define reducer handlers 2019-08-01 19:03:10 +07:00
82ec4c321a Add & test createReducer 2019-08-01 16:35:40 +07:00