@alterior/runtime 3.11.1 → 3.13.4
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/dist/app-options.d.ts +65 -65
- package/dist/app-options.js +26 -26
- package/dist/app-options.js.map +1 -1
- package/dist/application.d.ts +52 -52
- package/dist/application.js +172 -171
- package/dist/application.js.map +1 -1
- package/dist/args.d.ts +7 -7
- package/dist/args.js +13 -13
- package/dist/expose.d.ts +12 -12
- package/dist/expose.d.ts.map +1 -1
- package/dist/expose.js +36 -36
- package/dist/expose.js.map +1 -1
- package/dist/index.d.ts +9 -9
- package/dist/index.js +12 -12
- package/dist/lifecycle.d.ts +24 -24
- package/dist/lifecycle.js +2 -2
- package/dist/module.test.d.ts +1 -1
- package/dist/modules.d.ts +120 -120
- package/dist/modules.js +282 -282
- package/dist/modules.js.map +1 -1
- package/dist/reflector.d.ts +123 -123
- package/dist/reflector.js +306 -306
- package/dist/reflector.js.map +1 -1
- package/dist/roles.service.d.ts +79 -79
- package/dist/roles.service.js +124 -124
- package/dist/roles.service.js.map +1 -1
- package/dist/service.d.ts +24 -24
- package/dist/service.js +19 -19
- package/dist/service.js.map +1 -1
- package/dist/test.d.ts +1 -1
- package/dist.esm/app-options.d.ts +65 -65
- package/dist.esm/app-options.js +23 -23
- package/dist.esm/app-options.js.map +1 -1
- package/dist.esm/application.d.ts +52 -52
- package/dist.esm/application.js +167 -166
- package/dist.esm/application.js.map +1 -1
- package/dist.esm/args.d.ts +7 -7
- package/dist.esm/args.js +9 -9
- package/dist.esm/expose.d.ts +12 -12
- package/dist.esm/expose.d.ts.map +1 -1
- package/dist.esm/expose.js +31 -31
- package/dist.esm/expose.js.map +1 -1
- package/dist.esm/index.d.ts +9 -9
- package/dist.esm/index.js +9 -9
- package/dist.esm/lifecycle.d.ts +24 -24
- package/dist.esm/lifecycle.js +1 -1
- package/dist.esm/module.test.d.ts +1 -1
- package/dist.esm/modules.d.ts +120 -120
- package/dist.esm/modules.js +276 -276
- package/dist.esm/modules.js.map +1 -1
- package/dist.esm/reflector.d.ts +123 -123
- package/dist.esm/reflector.js +296 -296
- package/dist.esm/reflector.js.map +1 -1
- package/dist.esm/roles.service.d.ts +79 -79
- package/dist.esm/roles.service.js +121 -121
- package/dist.esm/roles.service.js.map +1 -1
- package/dist.esm/service.d.ts +24 -24
- package/dist.esm/service.js +15 -15
- package/dist.esm/service.js.map +1 -1
- package/dist.esm/test.d.ts +1 -1
- package/package.json +11 -11
- package/src/application.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -5546
package/dist/roles.service.d.ts
CHANGED
|
@@ -1,80 +1,80 @@
|
|
|
1
|
-
export type RoleConfigurationMode = 'default' | 'default-except' | 'all-except' | 'only';
|
|
2
|
-
export interface RoleConfiguration {
|
|
3
|
-
mode: RoleConfigurationMode;
|
|
4
|
-
roles: any[];
|
|
5
|
-
}
|
|
6
|
-
/**
|
|
7
|
-
* Role registration information. Use this when your module provides a service which should support being turned on and
|
|
8
|
-
* off at runtime.
|
|
9
|
-
*/
|
|
10
|
-
export interface RoleRegistration {
|
|
11
|
-
/**
|
|
12
|
-
* The instance of the module being registered. This should be `this` for the caller in most cases, as it should be
|
|
13
|
-
* called from an Alterior module's `altOnInit()` method.
|
|
14
|
-
*/
|
|
15
|
-
instance?: any;
|
|
16
|
-
/**
|
|
17
|
-
* Set to false to cause this role to be disabled unless explicitly asked for. When unspecified, the default is
|
|
18
|
-
* true.
|
|
19
|
-
*/
|
|
20
|
-
enabledByDefault?: boolean;
|
|
21
|
-
/**
|
|
22
|
-
* The identifier that will be matched when interpreting command line role enablements.
|
|
23
|
-
*/
|
|
24
|
-
identifier: string;
|
|
25
|
-
/**
|
|
26
|
-
* The human readable name for this role.
|
|
27
|
-
*/
|
|
28
|
-
name: string;
|
|
29
|
-
/**
|
|
30
|
-
* A short (one sentence) summary which may be shown in command line help output and other places.
|
|
31
|
-
*/
|
|
32
|
-
summary: string;
|
|
33
|
-
/**
|
|
34
|
-
* Start services associated with this role.
|
|
35
|
-
* For instance, an HTTP server module would start it's HTTP server.
|
|
36
|
-
*/
|
|
37
|
-
start(): Promise<void>;
|
|
38
|
-
/**
|
|
39
|
-
* Stop services associated with this role.
|
|
40
|
-
*/
|
|
41
|
-
stop(): Promise<void>;
|
|
42
|
-
}
|
|
43
|
-
export interface RoleState extends RoleRegistration {
|
|
44
|
-
class: any;
|
|
45
|
-
running: boolean;
|
|
46
|
-
}
|
|
47
|
-
/**
|
|
48
|
-
* Roles allow runtime configuration of which outward facing services to start.
|
|
49
|
-
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
50
|
-
* so that they can be easily turned on and off when the application is called.
|
|
51
|
-
*
|
|
52
|
-
*/
|
|
53
|
-
export declare class RolesService {
|
|
54
|
-
constructor();
|
|
55
|
-
_activeRoles: any[];
|
|
56
|
-
_configuration: RoleConfiguration;
|
|
57
|
-
_roles: RoleState[];
|
|
58
|
-
get configuration(): RoleConfiguration;
|
|
59
|
-
/**
|
|
60
|
-
* Register a role which can be managed by this service.
|
|
61
|
-
*/
|
|
62
|
-
registerRole(role: RoleRegistration): void;
|
|
63
|
-
get roles(): RoleState[];
|
|
64
|
-
/**
|
|
65
|
-
* Calculate the exact list of roles the configuration currently applies to.
|
|
66
|
-
*/
|
|
67
|
-
get effectiveRoles(): RoleState[];
|
|
68
|
-
get activeRoles(): RoleState[];
|
|
69
|
-
/**
|
|
70
|
-
* Configure which roles should be run by this service
|
|
71
|
-
*/
|
|
72
|
-
configure(config: RoleConfiguration): void;
|
|
73
|
-
getForModule(roleModuleClass: any): RoleState;
|
|
74
|
-
getById(id: string): RoleState;
|
|
75
|
-
restartAll(): Promise<void>;
|
|
76
|
-
silent: boolean;
|
|
77
|
-
startAll(): Promise<void>;
|
|
78
|
-
stopAll(): Promise<void>;
|
|
79
|
-
}
|
|
1
|
+
export type RoleConfigurationMode = 'default' | 'default-except' | 'all-except' | 'only';
|
|
2
|
+
export interface RoleConfiguration {
|
|
3
|
+
mode: RoleConfigurationMode;
|
|
4
|
+
roles: any[];
|
|
5
|
+
}
|
|
6
|
+
/**
|
|
7
|
+
* Role registration information. Use this when your module provides a service which should support being turned on and
|
|
8
|
+
* off at runtime.
|
|
9
|
+
*/
|
|
10
|
+
export interface RoleRegistration {
|
|
11
|
+
/**
|
|
12
|
+
* The instance of the module being registered. This should be `this` for the caller in most cases, as it should be
|
|
13
|
+
* called from an Alterior module's `altOnInit()` method.
|
|
14
|
+
*/
|
|
15
|
+
instance?: any;
|
|
16
|
+
/**
|
|
17
|
+
* Set to false to cause this role to be disabled unless explicitly asked for. When unspecified, the default is
|
|
18
|
+
* true.
|
|
19
|
+
*/
|
|
20
|
+
enabledByDefault?: boolean;
|
|
21
|
+
/**
|
|
22
|
+
* The identifier that will be matched when interpreting command line role enablements.
|
|
23
|
+
*/
|
|
24
|
+
identifier: string;
|
|
25
|
+
/**
|
|
26
|
+
* The human readable name for this role.
|
|
27
|
+
*/
|
|
28
|
+
name: string;
|
|
29
|
+
/**
|
|
30
|
+
* A short (one sentence) summary which may be shown in command line help output and other places.
|
|
31
|
+
*/
|
|
32
|
+
summary: string;
|
|
33
|
+
/**
|
|
34
|
+
* Start services associated with this role.
|
|
35
|
+
* For instance, an HTTP server module would start it's HTTP server.
|
|
36
|
+
*/
|
|
37
|
+
start(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* Stop services associated with this role.
|
|
40
|
+
*/
|
|
41
|
+
stop(): Promise<void>;
|
|
42
|
+
}
|
|
43
|
+
export interface RoleState extends RoleRegistration {
|
|
44
|
+
class: any;
|
|
45
|
+
running: boolean;
|
|
46
|
+
}
|
|
47
|
+
/**
|
|
48
|
+
* Roles allow runtime configuration of which outward facing services to start.
|
|
49
|
+
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
50
|
+
* so that they can be easily turned on and off when the application is called.
|
|
51
|
+
*
|
|
52
|
+
*/
|
|
53
|
+
export declare class RolesService {
|
|
54
|
+
constructor();
|
|
55
|
+
_activeRoles: any[];
|
|
56
|
+
_configuration: RoleConfiguration;
|
|
57
|
+
_roles: RoleState[];
|
|
58
|
+
get configuration(): RoleConfiguration;
|
|
59
|
+
/**
|
|
60
|
+
* Register a role which can be managed by this service.
|
|
61
|
+
*/
|
|
62
|
+
registerRole(role: RoleRegistration): void;
|
|
63
|
+
get roles(): RoleState[];
|
|
64
|
+
/**
|
|
65
|
+
* Calculate the exact list of roles the configuration currently applies to.
|
|
66
|
+
*/
|
|
67
|
+
get effectiveRoles(): RoleState[];
|
|
68
|
+
get activeRoles(): RoleState[];
|
|
69
|
+
/**
|
|
70
|
+
* Configure which roles should be run by this service
|
|
71
|
+
*/
|
|
72
|
+
configure(config: RoleConfiguration): void;
|
|
73
|
+
getForModule(roleModuleClass: any): RoleState;
|
|
74
|
+
getById(id: string): RoleState;
|
|
75
|
+
restartAll(): Promise<void>;
|
|
76
|
+
silent: boolean;
|
|
77
|
+
startAll(): Promise<void>;
|
|
78
|
+
stopAll(): Promise<void>;
|
|
79
|
+
}
|
|
80
80
|
//# sourceMappingURL=roles.service.d.ts.map
|
package/dist/roles.service.js
CHANGED
|
@@ -1,125 +1,125 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.RolesService = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const di_1 = require("@alterior/di");
|
|
6
|
-
const common_1 = require("@alterior/common");
|
|
7
|
-
const SUPPORTED_ROLE_MODES = ['default', 'default-except', 'all-except', 'only'];
|
|
8
|
-
/**
|
|
9
|
-
* Roles allow runtime configuration of which outward facing services to start.
|
|
10
|
-
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
11
|
-
* so that they can be easily turned on and off when the application is called.
|
|
12
|
-
*
|
|
13
|
-
*/
|
|
14
|
-
let RolesService = class RolesService {
|
|
15
|
-
constructor() {
|
|
16
|
-
this._activeRoles = null;
|
|
17
|
-
this._configuration = { mode: 'default', roles: [] };
|
|
18
|
-
this._roles = [];
|
|
19
|
-
this.silent = false;
|
|
20
|
-
}
|
|
21
|
-
get configuration() {
|
|
22
|
-
return this._configuration;
|
|
23
|
-
}
|
|
24
|
-
/**
|
|
25
|
-
* Register a role which can be managed by this service.
|
|
26
|
-
*/
|
|
27
|
-
registerRole(role) {
|
|
28
|
-
var _a, _b;
|
|
29
|
-
let roleState = Object.assign(role, {
|
|
30
|
-
class: (_b = (_a = role.instance) === null || _a === void 0 ? void 0 : _a.constructor) !== null && _b !== void 0 ? _b : {},
|
|
31
|
-
running: false
|
|
32
|
-
});
|
|
33
|
-
this._roles.push(roleState);
|
|
34
|
-
}
|
|
35
|
-
get roles() {
|
|
36
|
-
return this._roles;
|
|
37
|
-
}
|
|
38
|
-
/**
|
|
39
|
-
* Calculate the exact list of roles the configuration currently applies to.
|
|
40
|
-
*/
|
|
41
|
-
get effectiveRoles() {
|
|
42
|
-
let config = this._configuration;
|
|
43
|
-
if (config.mode === 'default') {
|
|
44
|
-
return this._roles
|
|
45
|
-
.filter(x => x.enabledByDefault !== false);
|
|
46
|
-
}
|
|
47
|
-
else if (config.mode == 'all-except') {
|
|
48
|
-
return this._roles
|
|
49
|
-
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
50
|
-
}
|
|
51
|
-
else if (config.mode == 'default-except') {
|
|
52
|
-
return this._roles
|
|
53
|
-
.filter(x => x.enabledByDefault !== false)
|
|
54
|
-
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
55
|
-
}
|
|
56
|
-
else if (config.mode == 'only') {
|
|
57
|
-
return this._roles
|
|
58
|
-
.filter(x => config.roles.includes(x.class) || config.roles.includes(x.identifier));
|
|
59
|
-
}
|
|
60
|
-
return [];
|
|
61
|
-
}
|
|
62
|
-
get activeRoles() {
|
|
63
|
-
return this._roles.filter(x => x.running);
|
|
64
|
-
}
|
|
65
|
-
/**
|
|
66
|
-
* Configure which roles should be run by this service
|
|
67
|
-
*/
|
|
68
|
-
configure(config) {
|
|
69
|
-
if (!SUPPORTED_ROLE_MODES.includes(config.mode))
|
|
70
|
-
throw new common_1.InvalidOperationError(`Role mode '${config.mode}' is not supported (supports 'all-except', 'only')`);
|
|
71
|
-
let missingRoles = config.roles.filter(x => !this.roles.find(y => y.identifier === x || y.class === x));
|
|
72
|
-
if (missingRoles.length > 0) {
|
|
73
|
-
throw new Error(`The following roles have not been defined: ${missingRoles.join(', ')}. Did you define roles in altOnStart() instead of altOnInit()?`);
|
|
74
|
-
}
|
|
75
|
-
this._configuration = config;
|
|
76
|
-
}
|
|
77
|
-
getForModule(roleModuleClass) {
|
|
78
|
-
let roles = this._roles.filter(x => x.class === roleModuleClass);
|
|
79
|
-
if (roles.length === 0)
|
|
80
|
-
throw new common_1.ArgumentError(`Role module class ${roleModuleClass.name} is not registered`);
|
|
81
|
-
if (roles.length > 0)
|
|
82
|
-
throw new common_1.ArgumentError(`More than one role associated with module '${roleModuleClass.name}'`);
|
|
83
|
-
return roles[0];
|
|
84
|
-
}
|
|
85
|
-
getById(id) {
|
|
86
|
-
let role = this._roles.find(x => x.identifier === id);
|
|
87
|
-
if (!role)
|
|
88
|
-
throw new common_1.ArgumentError(`Role with ID '${id}' is not registered`);
|
|
89
|
-
return role;
|
|
90
|
-
}
|
|
91
|
-
restartAll() {
|
|
92
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
-
yield this.stopAll();
|
|
94
|
-
yield (0, common_1.timeout)(1);
|
|
95
|
-
yield this.startAll();
|
|
96
|
-
});
|
|
97
|
-
}
|
|
98
|
-
startAll() {
|
|
99
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
yield Promise.all(this.effectiveRoles
|
|
101
|
-
.filter(role => !role.running)
|
|
102
|
-
.map((role) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
-
yield role.start();
|
|
104
|
-
if (!this.silent)
|
|
105
|
-
console.log(`** [${role.identifier}] Started`);
|
|
106
|
-
})));
|
|
107
|
-
});
|
|
108
|
-
}
|
|
109
|
-
stopAll() {
|
|
110
|
-
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
111
|
-
yield Promise.all(this.activeRoles
|
|
112
|
-
.map((role) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
113
|
-
yield role.stop();
|
|
114
|
-
if (!this.silent)
|
|
115
|
-
console.log(`** [${role.identifier}] Stopped`);
|
|
116
|
-
})));
|
|
117
|
-
});
|
|
118
|
-
}
|
|
119
|
-
};
|
|
120
|
-
RolesService =
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RolesService = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const di_1 = require("@alterior/di");
|
|
6
|
+
const common_1 = require("@alterior/common");
|
|
7
|
+
const SUPPORTED_ROLE_MODES = ['default', 'default-except', 'all-except', 'only'];
|
|
8
|
+
/**
|
|
9
|
+
* Roles allow runtime configuration of which outward facing services to start.
|
|
10
|
+
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
11
|
+
* so that they can be easily turned on and off when the application is called.
|
|
12
|
+
*
|
|
13
|
+
*/
|
|
14
|
+
let RolesService = class RolesService {
|
|
15
|
+
constructor() {
|
|
16
|
+
this._activeRoles = null;
|
|
17
|
+
this._configuration = { mode: 'default', roles: [] };
|
|
18
|
+
this._roles = [];
|
|
19
|
+
this.silent = false;
|
|
20
|
+
}
|
|
21
|
+
get configuration() {
|
|
22
|
+
return this._configuration;
|
|
23
|
+
}
|
|
24
|
+
/**
|
|
25
|
+
* Register a role which can be managed by this service.
|
|
26
|
+
*/
|
|
27
|
+
registerRole(role) {
|
|
28
|
+
var _a, _b;
|
|
29
|
+
let roleState = Object.assign(role, {
|
|
30
|
+
class: (_b = (_a = role.instance) === null || _a === void 0 ? void 0 : _a.constructor) !== null && _b !== void 0 ? _b : {},
|
|
31
|
+
running: false
|
|
32
|
+
});
|
|
33
|
+
this._roles.push(roleState);
|
|
34
|
+
}
|
|
35
|
+
get roles() {
|
|
36
|
+
return this._roles;
|
|
37
|
+
}
|
|
38
|
+
/**
|
|
39
|
+
* Calculate the exact list of roles the configuration currently applies to.
|
|
40
|
+
*/
|
|
41
|
+
get effectiveRoles() {
|
|
42
|
+
let config = this._configuration;
|
|
43
|
+
if (config.mode === 'default') {
|
|
44
|
+
return this._roles
|
|
45
|
+
.filter(x => x.enabledByDefault !== false);
|
|
46
|
+
}
|
|
47
|
+
else if (config.mode == 'all-except') {
|
|
48
|
+
return this._roles
|
|
49
|
+
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
50
|
+
}
|
|
51
|
+
else if (config.mode == 'default-except') {
|
|
52
|
+
return this._roles
|
|
53
|
+
.filter(x => x.enabledByDefault !== false)
|
|
54
|
+
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
55
|
+
}
|
|
56
|
+
else if (config.mode == 'only') {
|
|
57
|
+
return this._roles
|
|
58
|
+
.filter(x => config.roles.includes(x.class) || config.roles.includes(x.identifier));
|
|
59
|
+
}
|
|
60
|
+
return [];
|
|
61
|
+
}
|
|
62
|
+
get activeRoles() {
|
|
63
|
+
return this._roles.filter(x => x.running);
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Configure which roles should be run by this service
|
|
67
|
+
*/
|
|
68
|
+
configure(config) {
|
|
69
|
+
if (!SUPPORTED_ROLE_MODES.includes(config.mode))
|
|
70
|
+
throw new common_1.InvalidOperationError(`Role mode '${config.mode}' is not supported (supports 'all-except', 'only')`);
|
|
71
|
+
let missingRoles = config.roles.filter(x => !this.roles.find(y => y.identifier === x || y.class === x));
|
|
72
|
+
if (missingRoles.length > 0) {
|
|
73
|
+
throw new Error(`The following roles have not been defined: ${missingRoles.join(', ')}. Did you define roles in altOnStart() instead of altOnInit()?`);
|
|
74
|
+
}
|
|
75
|
+
this._configuration = config;
|
|
76
|
+
}
|
|
77
|
+
getForModule(roleModuleClass) {
|
|
78
|
+
let roles = this._roles.filter(x => x.class === roleModuleClass);
|
|
79
|
+
if (roles.length === 0)
|
|
80
|
+
throw new common_1.ArgumentError(`Role module class ${roleModuleClass.name} is not registered`);
|
|
81
|
+
if (roles.length > 0)
|
|
82
|
+
throw new common_1.ArgumentError(`More than one role associated with module '${roleModuleClass.name}'`);
|
|
83
|
+
return roles[0];
|
|
84
|
+
}
|
|
85
|
+
getById(id) {
|
|
86
|
+
let role = this._roles.find(x => x.identifier === id);
|
|
87
|
+
if (!role)
|
|
88
|
+
throw new common_1.ArgumentError(`Role with ID '${id}' is not registered`);
|
|
89
|
+
return role;
|
|
90
|
+
}
|
|
91
|
+
restartAll() {
|
|
92
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
93
|
+
yield this.stopAll();
|
|
94
|
+
yield (0, common_1.timeout)(1);
|
|
95
|
+
yield this.startAll();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
startAll() {
|
|
99
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
yield Promise.all(this.effectiveRoles
|
|
101
|
+
.filter(role => !role.running)
|
|
102
|
+
.map((role) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
103
|
+
yield role.start();
|
|
104
|
+
if (!this.silent)
|
|
105
|
+
console.log(`** [${role.identifier}] Started`);
|
|
106
|
+
})));
|
|
107
|
+
});
|
|
108
|
+
}
|
|
109
|
+
stopAll() {
|
|
110
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
111
|
+
yield Promise.all(this.activeRoles
|
|
112
|
+
.map((role) => tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
113
|
+
yield role.stop();
|
|
114
|
+
if (!this.silent)
|
|
115
|
+
console.log(`** [${role.identifier}] Stopped`);
|
|
116
|
+
})));
|
|
117
|
+
});
|
|
118
|
+
}
|
|
119
|
+
};
|
|
120
|
+
exports.RolesService = RolesService;
|
|
121
|
+
exports.RolesService = RolesService = tslib_1.__decorate([
|
|
122
|
+
(0, di_1.Injectable)(),
|
|
123
|
+
tslib_1.__metadata("design:paramtypes", [])
|
|
124
|
+
], RolesService);
|
|
125
125
|
//# sourceMappingURL=roles.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.service.js","sourceRoot":"","sources":["../src/roles.service.ts"],"names":[],"mappings":";;;;AAAA,qCAA0C;AAC1C,6CAAiF;AAEjF,MAAM,oBAAoB,GAAS,CAAE,SAAS,EAAE,gBAAgB,EAAE,YAAY,EAAE,MAAM,CAAE,CAAC;AAyDzF;;;;;GAKG;AAEI,IAAM,YAAY,GAAlB,MAAM,YAAY;IACrB;QAIA,iBAAY,GAAW,IAAI,CAAC;QAC5B,mBAAc,GAAuB,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;QACpE,WAAM,GAAiB,EAAE,CAAC;QA+F1B,WAAM,GAAG,KAAK,CAAC;IAnGf,CAAC;IAMD,IAAI,aAAa;QACb,OAAO,IAAI,CAAC,cAAc,CAAC;IAC/B,CAAC;IAED;;OAEG;IACH,YAAY,CAAC,IAAuB;;QAChC,IAAI,SAAS,GAAe,MAAM,CAAC,MAAM,CACrC,IAAI,EACJ;YACI,KAAK,EAAE,MAAA,MAAA,IAAI,CAAC,QAAQ,0CAAE,WAAW,mCAAI,EAAE;YACvC,OAAO,EAAE,KAAK;SACjB,CACJ,CAAC;QAEF,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,KAAK;QACL,OAAO,IAAI,CAAC,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACH,IAAI,cAAc;QACd,IAAI,MAAM,GAAG,IAAI,CAAC,cAAc,CAAC;QAEjC,I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AC;YACrB,MAAM,IAAA,gBAAO,EAAC,CAAC,CAAC,CAAC;YACjB,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC;QAC1B,CAAC;KAAA;IAIK,QAAQ;;YACV,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,cAAc;iBACd,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC;iBAC7B,GAAG,CAAC,CAAM,IAAI,EAAC,EAAE;gBACd,MAAM,IAAI,CAAC,KAAK,EAAE,CAAC;gBACnB,IAAI,CAAC,IAAI,CAAC,MAAM;oBACZ,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,WAAW,CAAC,CAAC;YACvD,CAAC,CAAA,CAAC,CACT,CAAC;QACN,CAAC;KAAA;IAEK,OAAO;;YAET,MAAM,OAAO,CAAC,GAAG,CACb,IAAI,CAAC,WAAW;iBACX,GAAG,CAAC,CAAM,IAAI,EAAC,EAAE;gBACd,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;gBAClB,IAAI,CAAC,IAAI,CAAC,MAAM;oBACZ,OAAO,CAAC,GAAG,CAAC,OAAO,IAAI,CAAC,UAAU,WAAW,CAAC,CAAC;YACvD,CAAC,CAAA,CAAC,CACT,CAAC;QACN,CAAC;KAAA;CACJ,CAAA;AA/HY,oCAAY;uBAAZ,YAAY;IADxB,IAAA,eAAU,GAAE;;GACA,YAAY,CA+HxB"}
|
package/dist/service.d.ts
CHANGED
|
@@ -1,25 +1,25 @@
|
|
|
1
|
-
import { Annotation } from '@alterior/annotations';
|
|
2
|
-
import { Type } from '@alterior/di';
|
|
3
|
-
export interface MethodShimParam {
|
|
4
|
-
name: string;
|
|
5
|
-
type: Type;
|
|
6
|
-
default?: any;
|
|
7
|
-
}
|
|
8
|
-
export interface MethodShim {
|
|
9
|
-
name: string;
|
|
10
|
-
params: MethodShimParam[];
|
|
11
|
-
target: Type;
|
|
12
|
-
body: string;
|
|
13
|
-
}
|
|
14
|
-
export declare abstract class ServiceCompiler {
|
|
15
|
-
abstract compileMethod(method: MethodShim): void;
|
|
16
|
-
}
|
|
17
|
-
export interface ServiceOptions {
|
|
18
|
-
compiler: Type<ServiceCompiler>;
|
|
19
|
-
}
|
|
20
|
-
export declare class ServiceAnnotation extends Annotation implements ServiceOptions {
|
|
21
|
-
constructor(options?: ServiceOptions);
|
|
22
|
-
compiler: Type<ServiceCompiler>;
|
|
23
|
-
}
|
|
24
|
-
export declare const Service: (options?: ServiceOptions) => ClassDecorator & MethodDecorator & PropertyDecorator & ParameterDecorator;
|
|
1
|
+
import { Annotation } from '@alterior/annotations';
|
|
2
|
+
import { Type } from '@alterior/di';
|
|
3
|
+
export interface MethodShimParam {
|
|
4
|
+
name: string;
|
|
5
|
+
type: Type;
|
|
6
|
+
default?: any;
|
|
7
|
+
}
|
|
8
|
+
export interface MethodShim {
|
|
9
|
+
name: string;
|
|
10
|
+
params: MethodShimParam[];
|
|
11
|
+
target: Type;
|
|
12
|
+
body: string;
|
|
13
|
+
}
|
|
14
|
+
export declare abstract class ServiceCompiler {
|
|
15
|
+
abstract compileMethod(method: MethodShim): void;
|
|
16
|
+
}
|
|
17
|
+
export interface ServiceOptions {
|
|
18
|
+
compiler: Type<ServiceCompiler>;
|
|
19
|
+
}
|
|
20
|
+
export declare class ServiceAnnotation extends Annotation implements ServiceOptions {
|
|
21
|
+
constructor(options?: ServiceOptions);
|
|
22
|
+
compiler: Type<ServiceCompiler>;
|
|
23
|
+
}
|
|
24
|
+
export declare const Service: (options?: ServiceOptions) => ClassDecorator & MethodDecorator & PropertyDecorator & ParameterDecorator;
|
|
25
25
|
//# sourceMappingURL=service.d.ts.map
|
package/dist/service.js
CHANGED
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Service = exports.ServiceAnnotation = exports.ServiceCompiler = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const annotations_1 = require("@alterior/annotations");
|
|
6
|
-
class ServiceCompiler {
|
|
7
|
-
}
|
|
8
|
-
exports.ServiceCompiler = ServiceCompiler;
|
|
9
|
-
let ServiceAnnotation = class ServiceAnnotation extends annotations_1.Annotation {
|
|
10
|
-
constructor(options) {
|
|
11
|
-
super(options);
|
|
12
|
-
}
|
|
13
|
-
};
|
|
14
|
-
ServiceAnnotation =
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
exports.Service = ServiceAnnotation.decorator();
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Service = exports.ServiceAnnotation = exports.ServiceCompiler = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const annotations_1 = require("@alterior/annotations");
|
|
6
|
+
class ServiceCompiler {
|
|
7
|
+
}
|
|
8
|
+
exports.ServiceCompiler = ServiceCompiler;
|
|
9
|
+
let ServiceAnnotation = class ServiceAnnotation extends annotations_1.Annotation {
|
|
10
|
+
constructor(options) {
|
|
11
|
+
super(options);
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
exports.ServiceAnnotation = ServiceAnnotation;
|
|
15
|
+
exports.ServiceAnnotation = ServiceAnnotation = tslib_1.__decorate([
|
|
16
|
+
(0, annotations_1.MetadataName)('@alterior/runtime:Service'),
|
|
17
|
+
tslib_1.__metadata("design:paramtypes", [Object])
|
|
18
|
+
], ServiceAnnotation);
|
|
19
|
+
exports.Service = ServiceAnnotation.decorator();
|
|
20
20
|
//# sourceMappingURL=service.js.map
|
package/dist/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;AAAA,uDAAiE;AAgBjE,MAAsB,eAAe;CAEpC;AAFD,0CAEC;AAOM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,wBAAU;IAC7C,YAAY,OAAyB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CAGJ,CAAA;AANY,iBAAiB;IAD7B,IAAA,0BAAY,EAAC,2BAA2B,CAAC;;GAC7B,iBAAiB,CAM7B;
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";;;;AAAA,uDAAiE;AAgBjE,MAAsB,eAAe;CAEpC;AAFD,0CAEC;AAOM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,wBAAU;IAC7C,YAAY,OAAyB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CAGJ,CAAA;AANY,8CAAiB;4BAAjB,iBAAiB;IAD7B,IAAA,0BAAY,EAAC,2BAA2B,CAAC;;GAC7B,iBAAiB,CAM7B;AAEY,QAAA,OAAO,GAAG,iBAAiB,CAAC,SAAS,EAAE,CAAC"}
|
package/dist/test.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
1
|
+
import "reflect-metadata";
|
|
2
2
|
//# sourceMappingURL=test.d.ts.map
|