@thzero/library_server 0.15.26 → 0.15.29

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,10 +1,10 @@
1
1
  {
2
2
  "name": "@thzero/library_server",
3
3
  "type": "module",
4
- "version": "0.15.26",
4
+ "version": "0.15.29",
5
5
  "version_major": 0,
6
6
  "version_minor": 15,
7
- "version_patch": 26,
7
+ "version_patch": 29,
8
8
  "version_date": "04/16/2022",
9
9
  "description": "An opinionated library of common functionality to bootstrap a Koa based API application using MongoDb and Firebase.",
10
10
  "author": "thZero",
@@ -50,7 +50,9 @@ class AdminBaseRoute extends BaseRoute {
50
50
  }),
51
51
  // eslint-disable-next-line
52
52
  async (ctx, next) => {
53
- const response = (await router.service.create(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
53
+ // const service = this._injector.getService(this._options.serviceKey);
54
+ // const response = (await router.service.create(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
55
+ const response = (await ctx.router.service.create(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
54
56
  this._jsonResponse(ctx, Utility.stringify(response));
55
57
  }
56
58
  );
@@ -63,7 +65,9 @@ class AdminBaseRoute extends BaseRoute {
63
65
  authorization([ `${self._options.role}.delete` ]),
64
66
  // eslint-disable-next-line
65
67
  async (ctx, next) => {
66
- const response = (await router.service.delete(ctx.correlationId, ctx.state.user, ctx.params.id)).check(ctx);
68
+ // const service = this._injector.getService(this._options.serviceKey);
69
+ // const response = (await service.delete(ctx.correlationId, ctx.state.user, ctx.params.id)).check(ctx);
70
+ const response = (await ctx.router.service.delete(ctx.correlationId, ctx.state.user, ctx.params.id)).check(ctx);
67
71
  this._jsonResponse(ctx, Utility.stringify(response));
68
72
  }
69
73
  );
@@ -79,7 +83,9 @@ class AdminBaseRoute extends BaseRoute {
79
83
  }),
80
84
  // eslint-disable-next-line
81
85
  async (ctx, next) => {
82
- const response = (await router.service.update(ctx.correlationId, ctx.state.user, ctx.params.id, ctx.request.body)).check(ctx);
86
+ // const service = this._injector.getService(this._options.serviceKey);
87
+ // const response = (await service.update(ctx.correlationId, ctx.state.user, ctx.params.id, ctx.request.body)).check(ctx);
88
+ const response = (await ctx.router.service.update(ctx.correlationId, ctx.state.user, ctx.params.id, ctx.request.body)).check(ctx);
83
89
  this._jsonResponse(ctx, Utility.stringify(response));
84
90
  }
85
91
  );
@@ -97,8 +103,9 @@ class AdminBaseRoute extends BaseRoute {
97
103
  }),
98
104
  // eslint-disable-next-line
99
105
  async (ctx, next) => {
100
- const service = this._injector.getService(this._options.serviceKey);
101
- const response = (await service.search(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
106
+ // const service = this._injector.getService(this._options.serviceKey);
107
+ // const response = (await service.search(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
108
+ const response = (await ctx.router.service.search(ctx.correlationId, ctx.state.user, ctx.request.body)).check(ctx);
102
109
  this._jsonResponse(ctx, Utility.stringify(response));
103
110
  }
104
111
  );
@@ -28,6 +28,8 @@ class BaseNewsRoute extends BaseRoute {
28
28
  authentication(false),
29
29
  // eslint-disable-next-line
30
30
  async (ctx, next) => {
31
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_NEWS);
32
+ // const response = (await service.latest(ctx.correlationId, ctx.state.user, parseInt(ctx.params.date))).check(ctx);
31
33
  const response = (await ctx.router.serviceNews.latest(ctx.correlationId, ctx.state.user, parseInt(ctx.params.date))).check(ctx);
32
34
  this._jsonResponse(ctx, Utility.stringify(response));
33
35
  }
@@ -43,6 +43,8 @@ class BaseUsersRoute extends BaseRoute {
43
43
  }),
44
44
  // eslint-disable-next-line
45
45
  async (ctx, next) => {
46
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USERS);
47
+ // const response = (await service.fetchByGamerId(ctx.correlationId, ctx.params.gamerId)).check(ctx);
46
48
  const response = (await ctx.router.serviceUsers.fetchByGamerId(ctx.correlationId, ctx.params.gamerId)).check(ctx);
47
49
  this._jsonResponse(ctx, Utility.stringify(response));
48
50
  }
@@ -58,6 +60,8 @@ class BaseUsersRoute extends BaseRoute {
58
60
  }),
59
61
  // eslint-disable-next-line
60
62
  async (ctx, next) => {
63
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USERS);
64
+ // const response = (await service.fetchByGamerTag(ctx.correlationId, ctx.params.gamerTag)).check(ctx);
61
65
  const response = (await ctx.router.serviceUsers.fetchByGamerTag(ctx.correlationId, ctx.params.gamerTag)).check(ctx);
62
66
  this._jsonResponse(ctx, Utility.stringify(response));
63
67
  }
@@ -73,7 +77,9 @@ class BaseUsersRoute extends BaseRoute {
73
77
  }),
74
78
  // eslint-disable-next-line
75
79
  async (ctx, next) => {
76
- const response = (await ctx.router.serviceUsers.refreshSettings(ctx.correlationId, ctx.request.body)).check(ctx);
80
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USERS);
81
+ const response = (await service.refreshSettings(ctx.correlationId, ctx.request.body)).check(ctx);
82
+ // const response = (await ctx.router.serviceUsers.refreshSettings(ctx.correlationId, ctx.request.body)).check(ctx);
77
83
  this._jsonResponse(ctx, Utility.stringify(response));
78
84
  }
79
85
  );
@@ -88,6 +94,8 @@ class BaseUsersRoute extends BaseRoute {
88
94
  }),
89
95
  // eslint-disable-next-line
90
96
  async (ctx, next) => {
97
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USERS);
98
+ // const response = (await service.update(ctx.correlationId, ctx.request.body)).check(ctx);
91
99
  const response = (await ctx.router.serviceUsers.update(ctx.correlationId, ctx.request.body)).check(ctx);
92
100
  this._jsonResponse(ctx, Utility.stringify(response));
93
101
  }
@@ -103,6 +111,8 @@ class BaseUsersRoute extends BaseRoute {
103
111
  }),
104
112
  // eslint-disable-next-line
105
113
  async (ctx, next) => {
114
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_USERS);
115
+ // const response = (await service.updateSettings(ctx.correlationId, ctx.request.body)).check(ctx);
106
116
  const response = (await ctx.router.serviceUsers.updateSettings(ctx.correlationId, ctx.request.body)).check(ctx);
107
117
  this._jsonResponse(ctx, Utility.stringify(response));
108
118
  }
package/routes/plans.js CHANGED
@@ -25,7 +25,9 @@ class PlansRoute extends BaseRoute {
25
25
  router.get('/',
26
26
  // eslint-disable-next-line
27
27
  async (ctx, next) => {
28
- const response = (await router.servicePlans.listing(ctx.correlationId)).check(ctx);
28
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_PLANS);
29
+ // const response = (await service.servicePlans.listing(ctx.correlationId)).check(ctx);
30
+ const response = (await ctx.router.servicePlans.listing(ctx.correlationId)).check(ctx);
29
31
  this._jsonResponse(ctx, Utility.stringify(response));
30
32
  }
31
33
  );
package/routes/utility.js CHANGED
@@ -35,6 +35,8 @@ class UtilityRoute extends BaseRoute {
35
35
  text: false,
36
36
  }),
37
37
  async (ctx, next) => {
38
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_UTILITY);
39
+ // const response = (await service.logger(ctx.correlationId, ctx.request.body)).check(ctx);
38
40
  const response = (await ctx.router.serviceUtility.logger(ctx.correlationId, ctx.request.body)).check(ctx);
39
41
  this._jsonResponse(ctx, Utility.stringify(response));
40
42
  }
package/routes/version.js CHANGED
@@ -25,6 +25,8 @@ class VersionRoute extends BaseRoute {
25
25
  router.get('/version',
26
26
  // eslint-disable-next-line
27
27
  async (ctx, next) => {
28
+ // const service = this._injector.getService(LibraryConstants.InjectorKeys.SERVICE_VERSION);
29
+ // const response = (await service.version(ctx.correlationId)).check(ctx);
28
30
  const response = (await ctx.router.serviceVersion.version(ctx.correlationId)).check(ctx);
29
31
  this._jsonResponse(ctx, Utility.stringify(response));
30
32
  }