@alterior/runtime 3.13.3 → 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 +9 -9
- package/src/application.ts +1 -1
- package/tsconfig.esm.tsbuildinfo +1 -0
- package/tsconfig.json +0 -2
- package/tsconfig.tsbuildinfo +1 -5546
|
@@ -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
|
|
@@ -1,122 +1,122 @@
|
|
|
1
|
-
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
-
import { Injectable } from "@alterior/di";
|
|
3
|
-
import { timeout, InvalidOperationError, ArgumentError } from "@alterior/common";
|
|
4
|
-
const SUPPORTED_ROLE_MODES = ['default', 'default-except', 'all-except', 'only'];
|
|
5
|
-
/**
|
|
6
|
-
* Roles allow runtime configuration of which outward facing services to start.
|
|
7
|
-
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
8
|
-
* so that they can be easily turned on and off when the application is called.
|
|
9
|
-
*
|
|
10
|
-
*/
|
|
11
|
-
let RolesService = class RolesService {
|
|
12
|
-
constructor() {
|
|
13
|
-
this._activeRoles = null;
|
|
14
|
-
this._configuration = { mode: 'default', roles: [] };
|
|
15
|
-
this._roles = [];
|
|
16
|
-
this.silent = false;
|
|
17
|
-
}
|
|
18
|
-
get configuration() {
|
|
19
|
-
return this._configuration;
|
|
20
|
-
}
|
|
21
|
-
/**
|
|
22
|
-
* Register a role which can be managed by this service.
|
|
23
|
-
*/
|
|
24
|
-
registerRole(role) {
|
|
25
|
-
var _a, _b;
|
|
26
|
-
let roleState = Object.assign(role, {
|
|
27
|
-
class: (_b = (_a = role.instance) === null || _a === void 0 ? void 0 : _a.constructor) !== null && _b !== void 0 ? _b : {},
|
|
28
|
-
running: false
|
|
29
|
-
});
|
|
30
|
-
this._roles.push(roleState);
|
|
31
|
-
}
|
|
32
|
-
get roles() {
|
|
33
|
-
return this._roles;
|
|
34
|
-
}
|
|
35
|
-
/**
|
|
36
|
-
* Calculate the exact list of roles the configuration currently applies to.
|
|
37
|
-
*/
|
|
38
|
-
get effectiveRoles() {
|
|
39
|
-
let config = this._configuration;
|
|
40
|
-
if (config.mode === 'default') {
|
|
41
|
-
return this._roles
|
|
42
|
-
.filter(x => x.enabledByDefault !== false);
|
|
43
|
-
}
|
|
44
|
-
else if (config.mode == 'all-except') {
|
|
45
|
-
return this._roles
|
|
46
|
-
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
47
|
-
}
|
|
48
|
-
else if (config.mode == 'default-except') {
|
|
49
|
-
return this._roles
|
|
50
|
-
.filter(x => x.enabledByDefault !== false)
|
|
51
|
-
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
52
|
-
}
|
|
53
|
-
else if (config.mode == 'only') {
|
|
54
|
-
return this._roles
|
|
55
|
-
.filter(x => config.roles.includes(x.class) || config.roles.includes(x.identifier));
|
|
56
|
-
}
|
|
57
|
-
return [];
|
|
58
|
-
}
|
|
59
|
-
get activeRoles() {
|
|
60
|
-
return this._roles.filter(x => x.running);
|
|
61
|
-
}
|
|
62
|
-
/**
|
|
63
|
-
* Configure which roles should be run by this service
|
|
64
|
-
*/
|
|
65
|
-
configure(config) {
|
|
66
|
-
if (!SUPPORTED_ROLE_MODES.includes(config.mode))
|
|
67
|
-
throw new InvalidOperationError(`Role mode '${config.mode}' is not supported (supports 'all-except', 'only')`);
|
|
68
|
-
let missingRoles = config.roles.filter(x => !this.roles.find(y => y.identifier === x || y.class === x));
|
|
69
|
-
if (missingRoles.length > 0) {
|
|
70
|
-
throw new Error(`The following roles have not been defined: ${missingRoles.join(', ')}. Did you define roles in altOnStart() instead of altOnInit()?`);
|
|
71
|
-
}
|
|
72
|
-
this._configuration = config;
|
|
73
|
-
}
|
|
74
|
-
getForModule(roleModuleClass) {
|
|
75
|
-
let roles = this._roles.filter(x => x.class === roleModuleClass);
|
|
76
|
-
if (roles.length === 0)
|
|
77
|
-
throw new ArgumentError(`Role module class ${roleModuleClass.name} is not registered`);
|
|
78
|
-
if (roles.length > 0)
|
|
79
|
-
throw new ArgumentError(`More than one role associated with module '${roleModuleClass.name}'`);
|
|
80
|
-
return roles[0];
|
|
81
|
-
}
|
|
82
|
-
getById(id) {
|
|
83
|
-
let role = this._roles.find(x => x.identifier === id);
|
|
84
|
-
if (!role)
|
|
85
|
-
throw new ArgumentError(`Role with ID '${id}' is not registered`);
|
|
86
|
-
return role;
|
|
87
|
-
}
|
|
88
|
-
restartAll() {
|
|
89
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
-
yield this.stopAll();
|
|
91
|
-
yield timeout(1);
|
|
92
|
-
yield this.startAll();
|
|
93
|
-
});
|
|
94
|
-
}
|
|
95
|
-
startAll() {
|
|
96
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
-
yield Promise.all(this.effectiveRoles
|
|
98
|
-
.filter(role => !role.running)
|
|
99
|
-
.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
-
yield role.start();
|
|
101
|
-
if (!this.silent)
|
|
102
|
-
console.log(`** [${role.identifier}] Started`);
|
|
103
|
-
})));
|
|
104
|
-
});
|
|
105
|
-
}
|
|
106
|
-
stopAll() {
|
|
107
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
-
yield Promise.all(this.activeRoles
|
|
109
|
-
.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
-
yield role.stop();
|
|
111
|
-
if (!this.silent)
|
|
112
|
-
console.log(`** [${role.identifier}] Stopped`);
|
|
113
|
-
})));
|
|
114
|
-
});
|
|
115
|
-
}
|
|
116
|
-
};
|
|
117
|
-
RolesService = __decorate([
|
|
118
|
-
Injectable(),
|
|
119
|
-
__metadata("design:paramtypes", [])
|
|
120
|
-
], RolesService);
|
|
121
|
-
export { RolesService };
|
|
1
|
+
import { __awaiter, __decorate, __metadata } from "tslib";
|
|
2
|
+
import { Injectable } from "@alterior/di";
|
|
3
|
+
import { timeout, InvalidOperationError, ArgumentError } from "@alterior/common";
|
|
4
|
+
const SUPPORTED_ROLE_MODES = ['default', 'default-except', 'all-except', 'only'];
|
|
5
|
+
/**
|
|
6
|
+
* Roles allow runtime configuration of which outward facing services to start.
|
|
7
|
+
* For instance WebServerModule and TasksModule both register their respective roles,
|
|
8
|
+
* so that they can be easily turned on and off when the application is called.
|
|
9
|
+
*
|
|
10
|
+
*/
|
|
11
|
+
let RolesService = class RolesService {
|
|
12
|
+
constructor() {
|
|
13
|
+
this._activeRoles = null;
|
|
14
|
+
this._configuration = { mode: 'default', roles: [] };
|
|
15
|
+
this._roles = [];
|
|
16
|
+
this.silent = false;
|
|
17
|
+
}
|
|
18
|
+
get configuration() {
|
|
19
|
+
return this._configuration;
|
|
20
|
+
}
|
|
21
|
+
/**
|
|
22
|
+
* Register a role which can be managed by this service.
|
|
23
|
+
*/
|
|
24
|
+
registerRole(role) {
|
|
25
|
+
var _a, _b;
|
|
26
|
+
let roleState = Object.assign(role, {
|
|
27
|
+
class: (_b = (_a = role.instance) === null || _a === void 0 ? void 0 : _a.constructor) !== null && _b !== void 0 ? _b : {},
|
|
28
|
+
running: false
|
|
29
|
+
});
|
|
30
|
+
this._roles.push(roleState);
|
|
31
|
+
}
|
|
32
|
+
get roles() {
|
|
33
|
+
return this._roles;
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Calculate the exact list of roles the configuration currently applies to.
|
|
37
|
+
*/
|
|
38
|
+
get effectiveRoles() {
|
|
39
|
+
let config = this._configuration;
|
|
40
|
+
if (config.mode === 'default') {
|
|
41
|
+
return this._roles
|
|
42
|
+
.filter(x => x.enabledByDefault !== false);
|
|
43
|
+
}
|
|
44
|
+
else if (config.mode == 'all-except') {
|
|
45
|
+
return this._roles
|
|
46
|
+
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
47
|
+
}
|
|
48
|
+
else if (config.mode == 'default-except') {
|
|
49
|
+
return this._roles
|
|
50
|
+
.filter(x => x.enabledByDefault !== false)
|
|
51
|
+
.filter(x => !config.roles.includes(x.class) && !config.roles.includes(x.identifier));
|
|
52
|
+
}
|
|
53
|
+
else if (config.mode == 'only') {
|
|
54
|
+
return this._roles
|
|
55
|
+
.filter(x => config.roles.includes(x.class) || config.roles.includes(x.identifier));
|
|
56
|
+
}
|
|
57
|
+
return [];
|
|
58
|
+
}
|
|
59
|
+
get activeRoles() {
|
|
60
|
+
return this._roles.filter(x => x.running);
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Configure which roles should be run by this service
|
|
64
|
+
*/
|
|
65
|
+
configure(config) {
|
|
66
|
+
if (!SUPPORTED_ROLE_MODES.includes(config.mode))
|
|
67
|
+
throw new InvalidOperationError(`Role mode '${config.mode}' is not supported (supports 'all-except', 'only')`);
|
|
68
|
+
let missingRoles = config.roles.filter(x => !this.roles.find(y => y.identifier === x || y.class === x));
|
|
69
|
+
if (missingRoles.length > 0) {
|
|
70
|
+
throw new Error(`The following roles have not been defined: ${missingRoles.join(', ')}. Did you define roles in altOnStart() instead of altOnInit()?`);
|
|
71
|
+
}
|
|
72
|
+
this._configuration = config;
|
|
73
|
+
}
|
|
74
|
+
getForModule(roleModuleClass) {
|
|
75
|
+
let roles = this._roles.filter(x => x.class === roleModuleClass);
|
|
76
|
+
if (roles.length === 0)
|
|
77
|
+
throw new ArgumentError(`Role module class ${roleModuleClass.name} is not registered`);
|
|
78
|
+
if (roles.length > 0)
|
|
79
|
+
throw new ArgumentError(`More than one role associated with module '${roleModuleClass.name}'`);
|
|
80
|
+
return roles[0];
|
|
81
|
+
}
|
|
82
|
+
getById(id) {
|
|
83
|
+
let role = this._roles.find(x => x.identifier === id);
|
|
84
|
+
if (!role)
|
|
85
|
+
throw new ArgumentError(`Role with ID '${id}' is not registered`);
|
|
86
|
+
return role;
|
|
87
|
+
}
|
|
88
|
+
restartAll() {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
yield this.stopAll();
|
|
91
|
+
yield timeout(1);
|
|
92
|
+
yield this.startAll();
|
|
93
|
+
});
|
|
94
|
+
}
|
|
95
|
+
startAll() {
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
97
|
+
yield Promise.all(this.effectiveRoles
|
|
98
|
+
.filter(role => !role.running)
|
|
99
|
+
.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
100
|
+
yield role.start();
|
|
101
|
+
if (!this.silent)
|
|
102
|
+
console.log(`** [${role.identifier}] Started`);
|
|
103
|
+
})));
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
stopAll() {
|
|
107
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
108
|
+
yield Promise.all(this.activeRoles
|
|
109
|
+
.map((role) => __awaiter(this, void 0, void 0, function* () {
|
|
110
|
+
yield role.stop();
|
|
111
|
+
if (!this.silent)
|
|
112
|
+
console.log(`** [${role.identifier}] Stopped`);
|
|
113
|
+
})));
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
};
|
|
117
|
+
RolesService = __decorate([
|
|
118
|
+
Injectable(),
|
|
119
|
+
__metadata("design:paramtypes", [])
|
|
120
|
+
], RolesService);
|
|
121
|
+
export { RolesService };
|
|
122
122
|
//# sourceMappingURL=roles.service.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"roles.service.js","sourceRoot":"","sources":["../src/roles.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,OAAO,EAAE,qBAAqB,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;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,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;
|
|
1
|
+
{"version":3,"file":"roles.service.js","sourceRoot":"","sources":["../src/roles.service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE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,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,YAAY;IADxB,UAAU,EAAE;;GACA,YAAY,CA+HxB"}
|
package/dist.esm/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.esm/service.js
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { __decorate, __metadata } from "tslib";
|
|
2
|
-
import { MetadataName, Annotation } from '@alterior/annotations';
|
|
3
|
-
export class ServiceCompiler {
|
|
4
|
-
}
|
|
5
|
-
let ServiceAnnotation = class ServiceAnnotation extends Annotation {
|
|
6
|
-
constructor(options) {
|
|
7
|
-
super(options);
|
|
8
|
-
}
|
|
9
|
-
};
|
|
10
|
-
ServiceAnnotation = __decorate([
|
|
11
|
-
MetadataName('@alterior/runtime:Service'),
|
|
12
|
-
__metadata("design:paramtypes", [Object])
|
|
13
|
-
], ServiceAnnotation);
|
|
14
|
-
export { ServiceAnnotation };
|
|
15
|
-
export const Service = ServiceAnnotation.decorator();
|
|
1
|
+
import { __decorate, __metadata } from "tslib";
|
|
2
|
+
import { MetadataName, Annotation } from '@alterior/annotations';
|
|
3
|
+
export class ServiceCompiler {
|
|
4
|
+
}
|
|
5
|
+
let ServiceAnnotation = class ServiceAnnotation extends Annotation {
|
|
6
|
+
constructor(options) {
|
|
7
|
+
super(options);
|
|
8
|
+
}
|
|
9
|
+
};
|
|
10
|
+
ServiceAnnotation = __decorate([
|
|
11
|
+
MetadataName('@alterior/runtime:Service'),
|
|
12
|
+
__metadata("design:paramtypes", [Object])
|
|
13
|
+
], ServiceAnnotation);
|
|
14
|
+
export { ServiceAnnotation };
|
|
15
|
+
export const Service = ServiceAnnotation.decorator();
|
|
16
16
|
//# sourceMappingURL=service.js.map
|
package/dist.esm/service.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBjE,MAAM,OAAgB,eAAe;CAEpC;AAOM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAC7C,YAAY,OAAyB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CAGJ,CAAA;AANY,iBAAiB;IAD7B,YAAY,CAAC,2BAA2B,CAAC;;GAC7B,iBAAiB,CAM7B
|
|
1
|
+
{"version":3,"file":"service.js","sourceRoot":"","sources":["../src/service.ts"],"names":[],"mappings":";AAAA,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAgBjE,MAAM,OAAgB,eAAe;CAEpC;AAOM,IAAM,iBAAiB,GAAvB,MAAM,iBAAkB,SAAQ,UAAU;IAC7C,YAAY,OAAyB;QACjC,KAAK,CAAC,OAAO,CAAC,CAAC;IACnB,CAAC;CAGJ,CAAA;AANY,iBAAiB;IAD7B,YAAY,CAAC,2BAA2B,CAAC;;GAC7B,iBAAiB,CAM7B;;AAED,MAAM,CAAC,MAAM,OAAO,GAAG,iBAAiB,CAAC,SAAS,EAAE,CAAC"}
|
package/dist.esm/test.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import "reflect-metadata";
|
|
1
|
+
import "reflect-metadata";
|
|
2
2
|
//# sourceMappingURL=test.d.ts.map
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@alterior/runtime",
|
|
3
|
-
"version": "3.13.
|
|
3
|
+
"version": "3.13.4",
|
|
4
4
|
"description": "Core runtime for Alterior apps",
|
|
5
5
|
"author": "The Alterior Project (https://github.com/alterior-mvc)",
|
|
6
6
|
"license": "MIT",
|
|
@@ -29,17 +29,17 @@
|
|
|
29
29
|
},
|
|
30
30
|
"scripts": {
|
|
31
31
|
"clean": "rimraf dist dist.esm",
|
|
32
|
-
"build": "npm run
|
|
33
|
-
"build:cjs": "tsc",
|
|
34
|
-
"build:esm": "tsc -
|
|
32
|
+
"build": "npm run build:cjs && npm run build:esm",
|
|
33
|
+
"build:cjs": "tsc -b",
|
|
34
|
+
"build:esm": "tsc -b tsconfig.esm.json",
|
|
35
35
|
"prepublishOnly": "npm test",
|
|
36
|
-
"test": "
|
|
37
|
-
"docs": "typedoc ."
|
|
36
|
+
"test": "node dist/test.js",
|
|
37
|
+
"docs": "typedoc src/index.ts"
|
|
38
38
|
},
|
|
39
39
|
"dependencies": {
|
|
40
|
-
"@alterior/annotations": "^3.13.
|
|
41
|
-
"@alterior/common": "^3.13.
|
|
42
|
-
"@alterior/di": "^3.13.
|
|
40
|
+
"@alterior/annotations": "^3.13.4",
|
|
41
|
+
"@alterior/common": "^3.13.4",
|
|
42
|
+
"@alterior/di": "^3.13.4",
|
|
43
43
|
"tslib": "^2.3.1"
|
|
44
44
|
},
|
|
45
45
|
"peerDependencies": {
|
package/src/application.ts
CHANGED
|
@@ -109,7 +109,7 @@ export class Application {
|
|
|
109
109
|
// into the bootstrapped providers
|
|
110
110
|
|
|
111
111
|
let appOptionsAnnotation = AppOptionsAnnotation.getForClass(entryModule);
|
|
112
|
-
let appProvidedOptions: ApplicationOptions = appOptionsAnnotation
|
|
112
|
+
let appProvidedOptions: ApplicationOptions = appOptionsAnnotation?.options ?? {};
|
|
113
113
|
|
|
114
114
|
return Object.assign(
|
|
115
115
|
<ApplicationOptions>{
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"root":["./src/app-options.ts","./src/application.ts","./src/args.ts","./src/expose.ts","./src/index.ts","./src/lifecycle.ts","./src/module.test.ts","./src/modules.ts","./src/reflector.ts","./src/roles.service.ts","./src/service.ts","./src/test.ts"],"version":"5.9.3"}
|