@thzero/library_server 0.18.21 → 0.18.22

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.
Files changed (53) hide show
  1. package/README.md +112 -112
  2. package/boot/index.js +529 -529
  3. package/boot/plugins/admin/index.js +6 -6
  4. package/boot/plugins/admin/news.js +33 -33
  5. package/boot/plugins/admin/users.js +33 -33
  6. package/boot/plugins/api.js +64 -64
  7. package/boot/plugins/apiFront.js +31 -31
  8. package/boot/plugins/index.js +70 -70
  9. package/boot/plugins/news.js +44 -44
  10. package/boot/plugins/users.js +46 -46
  11. package/boot/plugins/usersExtended.js +32 -32
  12. package/constants.js +45 -45
  13. package/data/baseNews.js +42 -42
  14. package/data/baseSettingsUser.js +9 -9
  15. package/data/baseUser.js +28 -28
  16. package/data/index.js +24 -24
  17. package/data/named.js +20 -20
  18. package/errors/tokenExpired.js +7 -7
  19. package/license.md +8 -8
  20. package/openSource.js +66 -66
  21. package/package.json +38 -38
  22. package/repository/index.js +182 -182
  23. package/repository/usageMetrics/devnull.js +16 -16
  24. package/routes/index.js +76 -76
  25. package/service/admin/baseNews.js +45 -45
  26. package/service/admin/index.js +130 -130
  27. package/service/admin/news.js +6 -6
  28. package/service/admin/users.js +107 -107
  29. package/service/baseSecurity.js +183 -183
  30. package/service/baseUser.js +122 -122
  31. package/service/communication.js +6 -6
  32. package/service/config.js +37 -37
  33. package/service/crypto.js +16 -16
  34. package/service/discovery/index.js +6 -6
  35. package/service/discovery/resources/index.js +101 -101
  36. package/service/external.js +19 -19
  37. package/service/externalRest.js +19 -19
  38. package/service/index.js +20 -20
  39. package/service/monitoring.js +12 -12
  40. package/service/news/base.js +59 -59
  41. package/service/news/index.js +6 -6
  42. package/service/news/validation/index.js +6 -6
  43. package/service/plans.js +31 -31
  44. package/service/restCommunication.js +21 -21
  45. package/service/usageMetrics.js +84 -84
  46. package/service/utility.js +190 -190
  47. package/service/version.js +37 -37
  48. package/utility/injector.js +59 -59
  49. package/utility/internalIp/index.js +48 -48
  50. package/utility/list/doubleLinked.js +88 -88
  51. package/utility/list/priorityQueue.js +109 -109
  52. package/utility/list/queue.js +72 -72
  53. package/utility/os.js +20 -20
@@ -1,182 +1,182 @@
1
- import LibraryCommonServiceConstants from '@thzero/library_common_service/constants.js';
2
-
3
- import Response from '@thzero/library_common/response/index.js';
4
- import ExtractResponse from '@thzero/library_common/response/extract.js';
5
-
6
- class Repository {
7
- async init(injector) {
8
- this._injector = injector;
9
- }
10
-
11
- get _config() {
12
- return this._injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_CONFIG)
13
- }
14
-
15
- _enforce(clazz, method, value, name, correlationId, message) {
16
- if (!value) {
17
- if (!String.isNullOrEmpty(message))
18
- message = `${name} is invalid.`;
19
-
20
- this._logger.error(clazz, method, message, null, correlationId);
21
- const error = Error(message, true);
22
- error.correlationId = correlationId;
23
- throw error;
24
- }
25
- }
26
-
27
- _enforceNotEmpty(clazz, method, value, name, correlationId) {
28
- if (String.isNullOrEmpty(value)) {
29
- this._logger.error(clazz, method, `${name} is empty.`, null, correlationId);
30
- const error = Error(`${name} is empty.`, true);
31
- error.correlationId = correlationId;
32
- throw error;
33
- }
34
- }
35
-
36
- _enforceNotEmptyEither(clazz, method, value1, value2, name1, name2, correlationId) {
37
- if (String.isNullOrEmpty(value1) && String.isNullOrEmpty(value2)) {
38
- this._logger.error(clazz, method, `Either ${name1} or ${name2} is empty.`, null, correlationId);
39
- const error = Error(`Either ${name1} or ${name2} is empty.`, true);
40
- error.correlationId = correlationId;
41
- throw error;
42
- }
43
- }
44
-
45
- _enforceNotEmptyMultiple(clazz, method, values, names, correlationId) {
46
- let valid = true;
47
- for (const value of values)
48
- valid &= String.isNullOrEmpty(value);
49
- if (!valid) {
50
- names = names.join(', ');
51
- this._logger.error(clazz, method, `None of the fields are not null: ${names}`, null, correlationId);
52
- const error = Error(`None of the fields are not null: ${names}`, true);
53
- error.correlationId = correlationId;
54
- throw error;
55
- }
56
- }
57
-
58
- _enforceNotEmptyResponse(clazz, method, value, name, correlationId) {
59
- if (String.isNullOrEmpty(value)) {
60
- this._logger.error(clazz, method, `${name} is empty.`, null, correlationId);
61
- return Response.error(clazz, method, `${name} is empty.`, null, null, null, correlationId);
62
- }
63
-
64
- return this._successResponse(value, correlationId);
65
- }
66
-
67
- _enforceNotNull(clazz, method, value, name, correlationId) {
68
- if (!value || value === undefined) {
69
- this._logger.error(clazz, method, `${name} is null.`, null, correlationId);
70
- const error = Error(`${name} is null.`, true);
71
- error.correlationId = correlationId;
72
- throw error;
73
- }
74
- }
75
-
76
- _enforceNotNullEither(clazz, method, value1, value2, name1, name2, correlationId) {
77
- if ((!value1 || value1 === undefined) && (!value2 || value2 == undefined)) {
78
- this._logger.error(clazz, method, `Either ${name1} or ${name2} is null.`, null, correlationId);
79
- const error = Error(`Either ${name1} or ${name2} is null.`, true);
80
- error.correlationId = correlationId;
81
- throw error;
82
- }
83
- }
84
-
85
- _enforceNotNullMultiple(clazz, method, values, names, correlationId) {
86
- let valid = true;
87
- for (const value of values)
88
- valid &= values;
89
- if (!valid) {
90
- names = names.join(', ');
91
- this._logger.error(clazz, method, `None of the fields are not null: ${names}`, null, correlationId);
92
- const error = Error(`None of the fields are not null: ${names}`, true);
93
- error.correlationId = correlationId;
94
- throw error;
95
- }
96
- }
97
-
98
- _enforceNotNullResponse(clazz, method, value, name, correlationId) {
99
- if (!value || value === undefined) {
100
- this._logger.error(clazz, method, `${name} is null.`, null, correlationId);
101
- return Response.error(clazz, method, `${name} is null.`, null, null, null, correlationId);
102
- }
103
-
104
- return this._successResponse(value, correlationId);
105
- }
106
-
107
- _enforceResponse(clazz, method, response, name, correlationId, message) {
108
- if (!response || (response && !response.success)) {
109
- if (!String.isNullOrEmpty(message))
110
- message = `Unsuccessful response for ${name}.`;
111
-
112
- this._logger.error(clazz, method, message, null, correlationId);
113
- const error = Error(message, true);
114
- error.correlationId = correlationId;
115
- throw error;
116
- }
117
- }
118
-
119
- _error(clazz, method, message, err, code, errors, correlationId) {
120
- if (message)
121
- this._logger.error(clazz, method, message, null, correlationId);
122
- if (err)
123
- this._logger.exception(clazz, method, err, correlationId);
124
- if (code)
125
- this._logger.error(clazz, method, 'code', code, correlationId);
126
- if (errors) {
127
- for (const error of errors)
128
- this._logger.exception(clazz, method, error, correlationId);
129
- }
130
- return Response.error(clazz, method, message, err, code, errors, correlationId);
131
- }
132
-
133
- _errorResponse(clazz, method, value, code, correlationId) {
134
- if (code)
135
- this._logger.error(clazz, method, 'code', code, correlationId);
136
- const response = Response.error(null, null, null, null, code, null, correlationId);
137
- response.results = value;
138
- return response;
139
- }
140
-
141
- _hasFailed(response) {
142
- return Response.hasFailed(response);
143
- }
144
-
145
- _hasSucceeded(response) {
146
- return Response.hasSucceeded(response);
147
- }
148
-
149
- _initResponse(correlationId) {
150
- return new Response(correlationId);
151
- }
152
-
153
- _initResponseExtract(correlationId) {
154
- return new ExtractResponse(correlationId);
155
- }
156
-
157
- get _logger() {
158
- return this._injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER)
159
- }
160
-
161
- _success(correlationId) {
162
- return Response.success(correlationId);
163
- }
164
-
165
- _successResponse(value, correlationId) {
166
- return Response.success(correlationId, value);
167
- }
168
-
169
- _warn(clazz, method, message, err, code, errors, correlationId) {
170
- if (message)
171
- this._logger.warn(clazz, method, message, null, correlationId);
172
- if (err)
173
- this._logger.warn(clazz, method, err.message, null, correlationId);
174
- if (code)
175
- this._logger.warn(clazz, method, 'code', code, correlationId);
176
- if (errors)
177
- this._logger.warn(clazz, method, null, errors, correlationId);
178
- return Response.error(clazz, method, message, err, code, errors, correlationId);
179
- }
180
- }
181
-
182
- export default Repository;
1
+ import LibraryCommonServiceConstants from '@thzero/library_common_service/constants.js';
2
+
3
+ import Response from '@thzero/library_common/response/index.js';
4
+ import ExtractResponse from '@thzero/library_common/response/extract.js';
5
+
6
+ class Repository {
7
+ async init(injector) {
8
+ this._injector = injector;
9
+ }
10
+
11
+ get _config() {
12
+ return this._injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_CONFIG)
13
+ }
14
+
15
+ _enforce(clazz, method, value, name, correlationId, message) {
16
+ if (!value) {
17
+ if (!String.isNullOrEmpty(message))
18
+ message = `${name} is invalid.`;
19
+
20
+ this._logger.error(clazz, method, message, null, correlationId);
21
+ const error = Error(message, true);
22
+ error.correlationId = correlationId;
23
+ throw error;
24
+ }
25
+ }
26
+
27
+ _enforceNotEmpty(clazz, method, value, name, correlationId) {
28
+ if (String.isNullOrEmpty(value)) {
29
+ this._logger.error(clazz, method, `${name} is empty.`, null, correlationId);
30
+ const error = Error(`${name} is empty.`, true);
31
+ error.correlationId = correlationId;
32
+ throw error;
33
+ }
34
+ }
35
+
36
+ _enforceNotEmptyEither(clazz, method, value1, value2, name1, name2, correlationId) {
37
+ if (String.isNullOrEmpty(value1) && String.isNullOrEmpty(value2)) {
38
+ this._logger.error(clazz, method, `Either ${name1} or ${name2} is empty.`, null, correlationId);
39
+ const error = Error(`Either ${name1} or ${name2} is empty.`, true);
40
+ error.correlationId = correlationId;
41
+ throw error;
42
+ }
43
+ }
44
+
45
+ _enforceNotEmptyMultiple(clazz, method, values, names, correlationId) {
46
+ let valid = true;
47
+ for (const value of values)
48
+ valid &= String.isNullOrEmpty(value);
49
+ if (!valid) {
50
+ names = names.join(', ');
51
+ this._logger.error(clazz, method, `None of the fields are not null: ${names}`, null, correlationId);
52
+ const error = Error(`None of the fields are not null: ${names}`, true);
53
+ error.correlationId = correlationId;
54
+ throw error;
55
+ }
56
+ }
57
+
58
+ _enforceNotEmptyResponse(clazz, method, value, name, correlationId) {
59
+ if (String.isNullOrEmpty(value)) {
60
+ this._logger.error(clazz, method, `${name} is empty.`, null, correlationId);
61
+ return Response.error(clazz, method, `${name} is empty.`, null, null, null, correlationId);
62
+ }
63
+
64
+ return this._successResponse(value, correlationId);
65
+ }
66
+
67
+ _enforceNotNull(clazz, method, value, name, correlationId) {
68
+ if (!value || value === undefined) {
69
+ this._logger.error(clazz, method, `${name} is null.`, null, correlationId);
70
+ const error = Error(`${name} is null.`, true);
71
+ error.correlationId = correlationId;
72
+ throw error;
73
+ }
74
+ }
75
+
76
+ _enforceNotNullEither(clazz, method, value1, value2, name1, name2, correlationId) {
77
+ if ((!value1 || value1 === undefined) && (!value2 || value2 == undefined)) {
78
+ this._logger.error(clazz, method, `Either ${name1} or ${name2} is null.`, null, correlationId);
79
+ const error = Error(`Either ${name1} or ${name2} is null.`, true);
80
+ error.correlationId = correlationId;
81
+ throw error;
82
+ }
83
+ }
84
+
85
+ _enforceNotNullMultiple(clazz, method, values, names, correlationId) {
86
+ let valid = true;
87
+ for (const value of values)
88
+ valid &= values;
89
+ if (!valid) {
90
+ names = names.join(', ');
91
+ this._logger.error(clazz, method, `None of the fields are not null: ${names}`, null, correlationId);
92
+ const error = Error(`None of the fields are not null: ${names}`, true);
93
+ error.correlationId = correlationId;
94
+ throw error;
95
+ }
96
+ }
97
+
98
+ _enforceNotNullResponse(clazz, method, value, name, correlationId) {
99
+ if (!value || value === undefined) {
100
+ this._logger.error(clazz, method, `${name} is null.`, null, correlationId);
101
+ return Response.error(clazz, method, `${name} is null.`, null, null, null, correlationId);
102
+ }
103
+
104
+ return this._successResponse(value, correlationId);
105
+ }
106
+
107
+ _enforceResponse(clazz, method, response, name, correlationId, message) {
108
+ if (!response || (response && !response.success)) {
109
+ if (!String.isNullOrEmpty(message))
110
+ message = `Unsuccessful response for ${name}.`;
111
+
112
+ this._logger.error(clazz, method, message, null, correlationId);
113
+ const error = Error(message, true);
114
+ error.correlationId = correlationId;
115
+ throw error;
116
+ }
117
+ }
118
+
119
+ _error(clazz, method, message, err, code, errors, correlationId) {
120
+ if (message)
121
+ this._logger.error(clazz, method, message, null, correlationId);
122
+ if (err)
123
+ this._logger.exception(clazz, method, err, correlationId);
124
+ if (code)
125
+ this._logger.error(clazz, method, 'code', code, correlationId);
126
+ if (errors) {
127
+ for (const error of errors)
128
+ this._logger.exception(clazz, method, error, correlationId);
129
+ }
130
+ return Response.error(clazz, method, message, err, code, errors, correlationId);
131
+ }
132
+
133
+ _errorResponse(clazz, method, value, code, correlationId) {
134
+ if (code)
135
+ this._logger.error(clazz, method, 'code', code, correlationId);
136
+ const response = Response.error(null, null, null, null, code, null, correlationId);
137
+ response.results = value;
138
+ return response;
139
+ }
140
+
141
+ _hasFailed(response) {
142
+ return Response.hasFailed(response);
143
+ }
144
+
145
+ _hasSucceeded(response) {
146
+ return Response.hasSucceeded(response);
147
+ }
148
+
149
+ _initResponse(correlationId) {
150
+ return new Response(correlationId);
151
+ }
152
+
153
+ _initResponseExtract(correlationId) {
154
+ return new ExtractResponse(correlationId);
155
+ }
156
+
157
+ get _logger() {
158
+ return this._injector.getService(LibraryCommonServiceConstants.InjectorKeys.SERVICE_LOGGER)
159
+ }
160
+
161
+ _success(correlationId) {
162
+ return Response.success(correlationId);
163
+ }
164
+
165
+ _successResponse(value, correlationId) {
166
+ return Response.success(correlationId, value);
167
+ }
168
+
169
+ _warn(clazz, method, message, err, code, errors, correlationId) {
170
+ if (message)
171
+ this._logger.warn(clazz, method, message, null, correlationId);
172
+ if (err)
173
+ this._logger.warn(clazz, method, err.message, null, correlationId);
174
+ if (code)
175
+ this._logger.warn(clazz, method, 'code', code, correlationId);
176
+ if (errors)
177
+ this._logger.warn(clazz, method, null, errors, correlationId);
178
+ return Response.error(clazz, method, message, err, code, errors, correlationId);
179
+ }
180
+ }
181
+
182
+ export default Repository;
@@ -1,16 +1,16 @@
1
- import Repository from '../index.js';
2
-
3
- class DevNullUsageMetricsRepository extends Repository {
4
- async register(usageMetrics) {
5
- const correlationId = usageMetrics ? usageMetrics.correlationId : null;
6
- // Do nothing here.
7
- return this._success(correlationId);
8
- }
9
-
10
- async tag(correlationId, userId, tag) {
11
- // Do nothing here.
12
- return this._success(correlationId);
13
- }
14
- }
15
-
16
- export default DevNullUsageMetricsRepository;
1
+ import Repository from '../index.js';
2
+
3
+ class DevNullUsageMetricsRepository extends Repository {
4
+ async register(usageMetrics) {
5
+ const correlationId = usageMetrics ? usageMetrics.correlationId : null;
6
+ // Do nothing here.
7
+ return this._success(correlationId);
8
+ }
9
+
10
+ async tag(correlationId, userId, tag) {
11
+ // Do nothing here.
12
+ return this._success(correlationId);
13
+ }
14
+ }
15
+
16
+ export default DevNullUsageMetricsRepository;
package/routes/index.js CHANGED
@@ -1,76 +1,76 @@
1
- class BaseRoute {
2
- constructor(prefix) {
3
- if (prefix === null || prefix === undefined)
4
- throw Error('Invalid prefix');
5
-
6
- this.app = null;
7
- this._prefix = prefix;
8
- }
9
-
10
- get id() {
11
- return null;
12
- }
13
-
14
- get router() {
15
- return this._router;
16
- }
17
-
18
- async init(injector, app, config) {
19
- if (!injector)
20
- throw Error('Invalid injector for route.');
21
- if (!config)
22
- throw Error('Invalid config for route.');
23
- if (this._prefix === null || this._prefix === undefined)
24
- throw Error('Invalid prefix for route.');
25
-
26
- this.app = app;
27
- this._injector = injector;
28
-
29
- const api = config.get('api', { });
30
- let prefix = '';
31
- if (!this._ignoreApi) {
32
- prefix = api.prefix !== null && api.prefix !== undefined ? api.prefix : 'api';
33
- if (!String.isNullOrEmpty(prefix) && (prefix !== '/'))
34
- prefix = '/' + prefix;
35
- }
36
-
37
- let version = !String.isNullOrEmpty(api.version) ? api.version : null;
38
- if (this._version !== null && this._version !== undefined)
39
- version = this._version;
40
- if (!String.isNullOrEmpty(this.id) && api.apis && Array.isArray(api.apis))
41
- version = api.apis[this.id];
42
-
43
- if (!String.isNullOrEmpty(version))
44
- prefix += '/' + version;
45
-
46
- if (!String.isNullOrEmpty(this._prefix) && (this._prefix[0] !== '/'))
47
- this._prefix = '/' + this._prefix;
48
-
49
- this._prefix = prefix + this._prefix;
50
-
51
- this._router = this._initializeRouter(app, config);
52
- if (this._router === null || this._router === undefined)
53
- throw Error('Invalid router.');
54
-
55
- this._initializeRoutes(this._router);
56
-
57
- return this._router;
58
- }
59
-
60
- _initializeRouter(app, config) {
61
- return null;
62
- }
63
-
64
- _initializeRoutes(router) {
65
- }
66
-
67
- get _ignoreApi() {
68
- return false;
69
- }
70
-
71
- get _version() {
72
- return null;
73
- }
74
- }
75
-
76
- export default BaseRoute;
1
+ class BaseRoute {
2
+ constructor(prefix) {
3
+ if (prefix === null || prefix === undefined)
4
+ throw Error('Invalid prefix');
5
+
6
+ this.app = null;
7
+ this._prefix = prefix;
8
+ }
9
+
10
+ get id() {
11
+ return null;
12
+ }
13
+
14
+ get router() {
15
+ return this._router;
16
+ }
17
+
18
+ async init(injector, app, config) {
19
+ if (!injector)
20
+ throw Error('Invalid injector for route.');
21
+ if (!config)
22
+ throw Error('Invalid config for route.');
23
+ if (this._prefix === null || this._prefix === undefined)
24
+ throw Error('Invalid prefix for route.');
25
+
26
+ this.app = app;
27
+ this._injector = injector;
28
+
29
+ const api = config.get('api', { });
30
+ let prefix = '';
31
+ if (!this._ignoreApi) {
32
+ prefix = api.prefix !== null && api.prefix !== undefined ? api.prefix : 'api';
33
+ if (!String.isNullOrEmpty(prefix) && (prefix !== '/'))
34
+ prefix = '/' + prefix;
35
+ }
36
+
37
+ let version = !String.isNullOrEmpty(api.version) ? api.version : null;
38
+ if (this._version !== null && this._version !== undefined)
39
+ version = this._version;
40
+ if (!String.isNullOrEmpty(this.id) && api.apis && Array.isArray(api.apis))
41
+ version = api.apis[this.id];
42
+
43
+ if (!String.isNullOrEmpty(version))
44
+ prefix += '/' + version;
45
+
46
+ if (!String.isNullOrEmpty(this._prefix) && (this._prefix[0] !== '/'))
47
+ this._prefix = '/' + this._prefix;
48
+
49
+ this._prefix = prefix + this._prefix;
50
+
51
+ this._router = this._initializeRouter(app, config);
52
+ if (this._router === null || this._router === undefined)
53
+ throw Error('Invalid router.');
54
+
55
+ this._initializeRoutes(this._router);
56
+
57
+ return this._router;
58
+ }
59
+
60
+ _initializeRouter(app, config) {
61
+ return null;
62
+ }
63
+
64
+ _initializeRoutes(router) {
65
+ }
66
+
67
+ get _ignoreApi() {
68
+ return false;
69
+ }
70
+
71
+ get _version() {
72
+ return null;
73
+ }
74
+ }
75
+
76
+ export default BaseRoute;
@@ -1,45 +1,45 @@
1
- import LibraryServerConstants from '../../constants.js';
2
-
3
- import BaseAdminService from './index.js';
4
-
5
- import NotImplementedError from '@thzero/library_common/errors/notImplemented.js';
6
-
7
- class BaseNewsAdminService extends BaseAdminService {
8
- constructor() {
9
- super();
10
-
11
- this._repositoryNews = null;
12
-
13
- this._serviceValidationNews = null;
14
- }
15
-
16
- async init(injector) {
17
- await super.init(injector);
18
-
19
- this._repositoryNews = this._injector.getService(LibraryServerConstants.InjectorKeys.REPOSITORY_ADMIN_NEWS);
20
-
21
- this._serviceValidationNews = this._injector.getService(LibraryServerConstants.InjectorKeys.SERVICE_VALIDATION_NEWS);
22
- }
23
-
24
- _initializeData() {
25
- throw new NotImplementedError();
26
- }
27
-
28
- get _repository() {
29
- return this._repositoryNews;
30
- }
31
-
32
- get _validationCreateSchema() {
33
- return this._serviceValidationNews.getNewsSchema();
34
- }
35
-
36
- get _validationUpdateSchema() {
37
- return this._serviceValidationNews.getNewsUpdateSchema();
38
- }
39
-
40
- get _validationCheckKey() {
41
- return 'adminNews';
42
- }
43
- }
44
-
45
- export default BaseNewsAdminService;
1
+ import LibraryServerConstants from '../../constants.js';
2
+
3
+ import BaseAdminService from './index.js';
4
+
5
+ import NotImplementedError from '@thzero/library_common/errors/notImplemented.js';
6
+
7
+ class BaseNewsAdminService extends BaseAdminService {
8
+ constructor() {
9
+ super();
10
+
11
+ this._repositoryNews = null;
12
+
13
+ this._serviceValidationNews = null;
14
+ }
15
+
16
+ async init(injector) {
17
+ await super.init(injector);
18
+
19
+ this._repositoryNews = this._injector.getService(LibraryServerConstants.InjectorKeys.REPOSITORY_ADMIN_NEWS);
20
+
21
+ this._serviceValidationNews = this._injector.getService(LibraryServerConstants.InjectorKeys.SERVICE_VALIDATION_NEWS);
22
+ }
23
+
24
+ _initializeData() {
25
+ throw new NotImplementedError();
26
+ }
27
+
28
+ get _repository() {
29
+ return this._repositoryNews;
30
+ }
31
+
32
+ get _validationCreateSchema() {
33
+ return this._serviceValidationNews.getNewsSchema();
34
+ }
35
+
36
+ get _validationUpdateSchema() {
37
+ return this._serviceValidationNews.getNewsUpdateSchema();
38
+ }
39
+
40
+ get _validationCheckKey() {
41
+ return 'adminNews';
42
+ }
43
+ }
44
+
45
+ export default BaseNewsAdminService;