32 Commits

Author SHA1 Message Date
7631f085ef Fix packages/server 2019-09-16 10:46:17 +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
ae2ed21f05 Remove unused routes
TBD: fix comments-server
2019-09-11 12:18:13 +07:00
5cf54d0be9 Rename old UserService to AuthService, LoginRoutes to AuthRoutes 2019-09-05 10:19:27 +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
67ae8dac57 Replace unnecessary DB with IDatabase 2019-08-26 18:53:52 +07:00
040af18765 Use process.env.JEST_WORKER_ID when creating username 2019-08-25 23:08:16 +07:00
1e53f55cfa Check if date is valid before calling toISOString() 2019-08-25 22:21:34 +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
a6649def72 Add packages/server/src/database/DB.ts 2019-08-02 17:05:36 +07:00
89af2f0845 Add StringUtils 2019-04-06 13:58:20 +08:00
a628082a73 Add packages/client/src/team 2019-03-20 15:01:15 +05:00
9aff78b7a9 Add ability to search users by email
This might be a security concern, even though the user will have to
provide an email to retrieve user information.

This functionality is needed by Team management functionality because
expecting users to add a user by id is hard.

TODO: explore other options. Maybe add public profiles and request the
user to go to the profile to invite a user to team?
2019-03-20 13:23:47 +05:00
30a8c56119 Fix test for User firstName & lastName
Also fix CSRF token. This was probably broken since csurf middleware was
modified to use cookie instead of session storage to provide support for
single page app (SPA).
2019-03-18 15:53:05 +05:00
36c61646ed Fix UserService.test.ts 2019-03-13 11:33:02 +05:00
155c98d000 Extract comments functionality to packages/comments-server 2019-03-13 11:24:08 +05:00
2b431bee78 Separate services and routes into features 2019-01-25 10:12:40 +01:00
2ed3aeac26 Add Routes to application 2019-01-24 17:55:49 +01:00
f0943cfe80 Add SiteRoutes, StoryRoutes and TeamRoutes 2019-01-22 13:30:15 +01:00
d0e94808bb Fix CommentRoutes 2019-01-22 13:06:01 +01:00
8865b58747 Add basic Site, Story and TeamService 2019-01-22 12:29:47 +01:00
78056e53a0 Remove comment.id before inserting new ones 2019-01-22 12:06:45 +01:00
0c70a3b688 Move ICommentTree to @rondo/common 2019-01-22 11:59:23 +01:00
2e0402b189 Implement basic CommentService 2019-01-22 11:57:15 +01:00
10e5775bf4 Add initial comments setup 2019-01-21 01:04:58 +01:00
eedd57c527 Add ability to easily create unions of action types 2019-01-19 15:23:51 +01:00
8a5ab067f6 Move server into src/ 2019-01-18 20:34:16 +01:00