@abp/ng.account.core 5.0.0-rc.1 → 5.0.2
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/abp-ng.account.core.d.ts +5 -5
- package/bundles/abp-ng.account.core-proxy.umd.js +98 -98
- package/bundles/abp-ng.account.core.umd.js +417 -417
- package/esm2015/abp-ng.account.core.js +4 -4
- package/esm2015/lib/auth-wrapper.service.js +42 -42
- package/esm2015/lib/tenant-box.service.js +56 -56
- package/esm2015/proxy/abp-ng.account.core-proxy.js +4 -4
- package/esm2015/proxy/lib/index.js +2 -2
- package/esm2015/proxy/lib/proxy/account/account.service.js +33 -33
- package/esm2015/proxy/lib/proxy/account/index.js +5 -5
- package/esm2015/proxy/lib/proxy/account/models.js +1 -1
- package/esm2015/proxy/lib/proxy/account/profile.service.js +32 -32
- package/esm2015/proxy/lib/proxy/account/web/areas/account/controllers/account.service.js +32 -32
- package/esm2015/proxy/lib/proxy/account/web/areas/account/controllers/index.js +3 -3
- package/esm2015/proxy/lib/proxy/account/web/areas/account/controllers/models/index.js +2 -2
- package/esm2015/proxy/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.js +10 -10
- package/esm2015/proxy/lib/proxy/account/web/areas/account/controllers/models/models.js +1 -1
- package/esm2015/proxy/lib/proxy/account/web/areas/account/index.js +2 -2
- package/esm2015/proxy/lib/proxy/account/web/areas/index.js +2 -2
- package/esm2015/proxy/lib/proxy/account/web/index.js +2 -2
- package/esm2015/proxy/lib/proxy/identity/index.js +1 -1
- package/esm2015/proxy/lib/proxy/identity/models.js +1 -1
- package/esm2015/proxy/public-api.js +1 -1
- package/esm2015/public-api.js +5 -5
- package/fesm2015/abp-ng.account.core-proxy.js +92 -92
- package/fesm2015/abp-ng.account.core.js +86 -86
- package/lib/auth-wrapper.service.d.ts +19 -19
- package/lib/tenant-box.service.d.ts +20 -20
- package/package.json +3 -3
- package/proxy/abp-ng.account.core-proxy.d.ts +5 -5
- package/proxy/lib/index.d.ts +2 -2
- package/proxy/lib/proxy/account/account.service.d.ts +14 -14
- package/proxy/lib/proxy/account/index.d.ts +5 -5
- package/proxy/lib/proxy/account/models.d.ts +40 -40
- package/proxy/lib/proxy/account/profile.service.d.ts +13 -13
- package/proxy/lib/proxy/account/web/areas/account/controllers/account.service.d.ts +13 -13
- package/proxy/lib/proxy/account/web/areas/account/controllers/index.d.ts +3 -3
- package/proxy/lib/proxy/account/web/areas/account/controllers/models/index.d.ts +2 -2
- package/proxy/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.d.ts +8 -8
- package/proxy/lib/proxy/account/web/areas/account/controllers/models/models.d.ts +10 -10
- package/proxy/lib/proxy/account/web/areas/account/index.d.ts +2 -2
- package/proxy/lib/proxy/account/web/areas/index.d.ts +2 -2
- package/proxy/lib/proxy/account/web/index.d.ts +2 -2
- package/proxy/lib/proxy/identity/index.d.ts +1 -1
- package/proxy/lib/proxy/identity/models.d.ts +15 -15
- package/proxy/public-api.d.ts +1 -1
- package/public-api.d.ts +2 -2
|
@@ -3,14 +3,14 @@ import { mapEnumToOptions } from '@abp/ng.core';
|
|
|
3
3
|
import * as i0 from '@angular/core';
|
|
4
4
|
import { Injectable } from '@angular/core';
|
|
5
5
|
|
|
6
|
-
var LoginResultType;
|
|
7
|
-
(function (LoginResultType) {
|
|
8
|
-
LoginResultType[LoginResultType["Success"] = 1] = "Success";
|
|
9
|
-
LoginResultType[LoginResultType["InvalidUserNameOrPassword"] = 2] = "InvalidUserNameOrPassword";
|
|
10
|
-
LoginResultType[LoginResultType["NotAllowed"] = 3] = "NotAllowed";
|
|
11
|
-
LoginResultType[LoginResultType["LockedOut"] = 4] = "LockedOut";
|
|
12
|
-
LoginResultType[LoginResultType["RequiresTwoFactor"] = 5] = "RequiresTwoFactor";
|
|
13
|
-
})(LoginResultType || (LoginResultType = {}));
|
|
6
|
+
var LoginResultType;
|
|
7
|
+
(function (LoginResultType) {
|
|
8
|
+
LoginResultType[LoginResultType["Success"] = 1] = "Success";
|
|
9
|
+
LoginResultType[LoginResultType["InvalidUserNameOrPassword"] = 2] = "InvalidUserNameOrPassword";
|
|
10
|
+
LoginResultType[LoginResultType["NotAllowed"] = 3] = "NotAllowed";
|
|
11
|
+
LoginResultType[LoginResultType["LockedOut"] = 4] = "LockedOut";
|
|
12
|
+
LoginResultType[LoginResultType["RequiresTwoFactor"] = 5] = "RequiresTwoFactor";
|
|
13
|
+
})(LoginResultType || (LoginResultType = {}));
|
|
14
14
|
const loginResultTypeOptions = mapEnumToOptions(LoginResultType);
|
|
15
15
|
|
|
16
16
|
var index$4 = /*#__PURE__*/Object.freeze({
|
|
@@ -19,33 +19,33 @@ var index$4 = /*#__PURE__*/Object.freeze({
|
|
|
19
19
|
loginResultTypeOptions: loginResultTypeOptions
|
|
20
20
|
});
|
|
21
21
|
|
|
22
|
-
class AccountService$1 {
|
|
23
|
-
constructor(restService) {
|
|
24
|
-
this.restService = restService;
|
|
25
|
-
this.apiName = 'AbpAccount';
|
|
26
|
-
this.checkPasswordByLogin = (login) => this.restService.request({
|
|
27
|
-
method: 'POST',
|
|
28
|
-
url: '/api/account/check-password',
|
|
29
|
-
body: login,
|
|
30
|
-
}, { apiName: this.apiName });
|
|
31
|
-
this.loginByLogin = (login) => this.restService.request({
|
|
32
|
-
method: 'POST',
|
|
33
|
-
url: '/api/account/login',
|
|
34
|
-
body: login,
|
|
35
|
-
}, { apiName: this.apiName });
|
|
36
|
-
this.logout = () => this.restService.request({
|
|
37
|
-
method: 'GET',
|
|
38
|
-
url: '/api/account/logout',
|
|
39
|
-
}, { apiName: this.apiName });
|
|
40
|
-
}
|
|
41
|
-
}
|
|
42
|
-
AccountService$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
-
AccountService$1.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, providedIn: 'root' });
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, decorators: [{
|
|
45
|
-
type: Injectable,
|
|
46
|
-
args: [{
|
|
47
|
-
providedIn: 'root',
|
|
48
|
-
}]
|
|
22
|
+
class AccountService$1 {
|
|
23
|
+
constructor(restService) {
|
|
24
|
+
this.restService = restService;
|
|
25
|
+
this.apiName = 'AbpAccount';
|
|
26
|
+
this.checkPasswordByLogin = (login) => this.restService.request({
|
|
27
|
+
method: 'POST',
|
|
28
|
+
url: '/api/account/check-password',
|
|
29
|
+
body: login,
|
|
30
|
+
}, { apiName: this.apiName });
|
|
31
|
+
this.loginByLogin = (login) => this.restService.request({
|
|
32
|
+
method: 'POST',
|
|
33
|
+
url: '/api/account/login',
|
|
34
|
+
body: login,
|
|
35
|
+
}, { apiName: this.apiName });
|
|
36
|
+
this.logout = () => this.restService.request({
|
|
37
|
+
method: 'GET',
|
|
38
|
+
url: '/api/account/logout',
|
|
39
|
+
}, { apiName: this.apiName });
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
AccountService$1.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
43
|
+
AccountService$1.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, providedIn: 'root' });
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService$1, decorators: [{
|
|
45
|
+
type: Injectable,
|
|
46
|
+
args: [{
|
|
47
|
+
providedIn: 'root',
|
|
48
|
+
}]
|
|
49
49
|
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
50
50
|
|
|
51
51
|
var index$3 = /*#__PURE__*/Object.freeze({
|
|
@@ -69,67 +69,67 @@ var index = /*#__PURE__*/Object.freeze({
|
|
|
69
69
|
Areas: index$1
|
|
70
70
|
});
|
|
71
71
|
|
|
72
|
-
class AccountService {
|
|
73
|
-
constructor(restService) {
|
|
74
|
-
this.restService = restService;
|
|
75
|
-
this.apiName = 'AbpAccount';
|
|
76
|
-
this.register = (input) => this.restService.request({
|
|
77
|
-
method: 'POST',
|
|
78
|
-
url: '/api/account/register',
|
|
79
|
-
body: input,
|
|
80
|
-
}, { apiName: this.apiName });
|
|
81
|
-
this.resetPassword = (input) => this.restService.request({
|
|
82
|
-
method: 'POST',
|
|
83
|
-
url: '/api/account/reset-password',
|
|
84
|
-
body: input,
|
|
85
|
-
}, { apiName: this.apiName });
|
|
86
|
-
this.sendPasswordResetCode = (input) => this.restService.request({
|
|
87
|
-
method: 'POST',
|
|
88
|
-
url: '/api/account/send-password-reset-code',
|
|
89
|
-
body: input,
|
|
90
|
-
}, { apiName: this.apiName });
|
|
91
|
-
}
|
|
92
|
-
}
|
|
93
|
-
AccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
94
|
-
AccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, providedIn: 'root' });
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, decorators: [{
|
|
96
|
-
type: Injectable,
|
|
97
|
-
args: [{
|
|
98
|
-
providedIn: 'root',
|
|
99
|
-
}]
|
|
72
|
+
class AccountService {
|
|
73
|
+
constructor(restService) {
|
|
74
|
+
this.restService = restService;
|
|
75
|
+
this.apiName = 'AbpAccount';
|
|
76
|
+
this.register = (input) => this.restService.request({
|
|
77
|
+
method: 'POST',
|
|
78
|
+
url: '/api/account/register',
|
|
79
|
+
body: input,
|
|
80
|
+
}, { apiName: this.apiName });
|
|
81
|
+
this.resetPassword = (input) => this.restService.request({
|
|
82
|
+
method: 'POST',
|
|
83
|
+
url: '/api/account/reset-password',
|
|
84
|
+
body: input,
|
|
85
|
+
}, { apiName: this.apiName });
|
|
86
|
+
this.sendPasswordResetCode = (input) => this.restService.request({
|
|
87
|
+
method: 'POST',
|
|
88
|
+
url: '/api/account/send-password-reset-code',
|
|
89
|
+
body: input,
|
|
90
|
+
}, { apiName: this.apiName });
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
AccountService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
94
|
+
AccountService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, providedIn: 'root' });
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AccountService, decorators: [{
|
|
96
|
+
type: Injectable,
|
|
97
|
+
args: [{
|
|
98
|
+
providedIn: 'root',
|
|
99
|
+
}]
|
|
100
100
|
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
101
101
|
|
|
102
|
-
class ProfileService {
|
|
103
|
-
constructor(restService) {
|
|
104
|
-
this.restService = restService;
|
|
105
|
-
this.apiName = 'AbpAccount';
|
|
106
|
-
this.changePassword = (input) => this.restService.request({
|
|
107
|
-
method: 'POST',
|
|
108
|
-
url: '/api/account/my-profile/change-password',
|
|
109
|
-
body: input,
|
|
110
|
-
}, { apiName: this.apiName });
|
|
111
|
-
this.get = () => this.restService.request({
|
|
112
|
-
method: 'GET',
|
|
113
|
-
url: '/api/account/my-profile',
|
|
114
|
-
}, { apiName: this.apiName });
|
|
115
|
-
this.update = (input) => this.restService.request({
|
|
116
|
-
method: 'PUT',
|
|
117
|
-
url: '/api/account/my-profile',
|
|
118
|
-
body: input,
|
|
119
|
-
}, { apiName: this.apiName });
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
ProfileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
-
ProfileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, providedIn: 'root' });
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, decorators: [{
|
|
125
|
-
type: Injectable,
|
|
126
|
-
args: [{
|
|
127
|
-
providedIn: 'root',
|
|
128
|
-
}]
|
|
102
|
+
class ProfileService {
|
|
103
|
+
constructor(restService) {
|
|
104
|
+
this.restService = restService;
|
|
105
|
+
this.apiName = 'AbpAccount';
|
|
106
|
+
this.changePassword = (input) => this.restService.request({
|
|
107
|
+
method: 'POST',
|
|
108
|
+
url: '/api/account/my-profile/change-password',
|
|
109
|
+
body: input,
|
|
110
|
+
}, { apiName: this.apiName });
|
|
111
|
+
this.get = () => this.restService.request({
|
|
112
|
+
method: 'GET',
|
|
113
|
+
url: '/api/account/my-profile',
|
|
114
|
+
}, { apiName: this.apiName });
|
|
115
|
+
this.update = (input) => this.restService.request({
|
|
116
|
+
method: 'PUT',
|
|
117
|
+
url: '/api/account/my-profile',
|
|
118
|
+
body: input,
|
|
119
|
+
}, { apiName: this.apiName });
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
ProfileService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
123
|
+
ProfileService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, providedIn: 'root' });
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: ProfileService, decorators: [{
|
|
125
|
+
type: Injectable,
|
|
126
|
+
args: [{
|
|
127
|
+
providedIn: 'root',
|
|
128
|
+
}]
|
|
129
129
|
}], ctorParameters: function () { return [{ type: i1.RestService }]; } });
|
|
130
130
|
|
|
131
|
-
/**
|
|
132
|
-
* Generated bundle index. Do not edit.
|
|
131
|
+
/**
|
|
132
|
+
* Generated bundle index. Do not edit.
|
|
133
133
|
*/
|
|
134
134
|
|
|
135
135
|
export { AccountService, ProfileService, index as Web };
|
|
@@ -6,98 +6,98 @@ import * as i2 from '@abp/ng.core';
|
|
|
6
6
|
import { __rest } from 'tslib';
|
|
7
7
|
import * as i1 from '@abp/ng.theme.shared';
|
|
8
8
|
|
|
9
|
-
class AuthWrapperService {
|
|
10
|
-
constructor(multiTenancy, configState, injector) {
|
|
11
|
-
this.multiTenancy = multiTenancy;
|
|
12
|
-
this.configState = configState;
|
|
13
|
-
this.isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled');
|
|
14
|
-
this.tenantBoxKey = 'Account.TenantBoxComponent';
|
|
15
|
-
this.route = injector.get(ActivatedRoute);
|
|
16
|
-
}
|
|
17
|
-
get enableLocalLogin$() {
|
|
18
|
-
return this.configState
|
|
19
|
-
.getSetting$('Abp.Account.EnableLocalLogin')
|
|
20
|
-
.pipe(map(value => (value === null || value === void 0 ? void 0 : value.toLowerCase()) !== 'false'));
|
|
21
|
-
}
|
|
22
|
-
get isTenantBoxVisibleForCurrentRoute() {
|
|
23
|
-
var _a;
|
|
24
|
-
return (_a = this.getMostInnerChild().data.tenantBoxVisible) !== null && _a !== void 0 ? _a : true;
|
|
25
|
-
}
|
|
26
|
-
get isTenantBoxVisible() {
|
|
27
|
-
return this.isTenantBoxVisibleForCurrentRoute && this.multiTenancy.isTenantBoxVisible;
|
|
28
|
-
}
|
|
29
|
-
getMostInnerChild() {
|
|
30
|
-
let child = this.route.snapshot;
|
|
31
|
-
let depth = 0;
|
|
32
|
-
const depthLimit = 10;
|
|
33
|
-
while (child.firstChild && depth < depthLimit) {
|
|
34
|
-
child = child.firstChild;
|
|
35
|
-
depth++;
|
|
36
|
-
}
|
|
37
|
-
return child;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
AuthWrapperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService, deps: [{ token: i2.MultiTenancyService }, { token: i2.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
-
AuthWrapperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService });
|
|
42
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService, decorators: [{
|
|
43
|
-
type: Injectable
|
|
9
|
+
class AuthWrapperService {
|
|
10
|
+
constructor(multiTenancy, configState, injector) {
|
|
11
|
+
this.multiTenancy = multiTenancy;
|
|
12
|
+
this.configState = configState;
|
|
13
|
+
this.isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled');
|
|
14
|
+
this.tenantBoxKey = 'Account.TenantBoxComponent';
|
|
15
|
+
this.route = injector.get(ActivatedRoute);
|
|
16
|
+
}
|
|
17
|
+
get enableLocalLogin$() {
|
|
18
|
+
return this.configState
|
|
19
|
+
.getSetting$('Abp.Account.EnableLocalLogin')
|
|
20
|
+
.pipe(map(value => (value === null || value === void 0 ? void 0 : value.toLowerCase()) !== 'false'));
|
|
21
|
+
}
|
|
22
|
+
get isTenantBoxVisibleForCurrentRoute() {
|
|
23
|
+
var _a;
|
|
24
|
+
return (_a = this.getMostInnerChild().data.tenantBoxVisible) !== null && _a !== void 0 ? _a : true;
|
|
25
|
+
}
|
|
26
|
+
get isTenantBoxVisible() {
|
|
27
|
+
return this.isTenantBoxVisibleForCurrentRoute && this.multiTenancy.isTenantBoxVisible;
|
|
28
|
+
}
|
|
29
|
+
getMostInnerChild() {
|
|
30
|
+
let child = this.route.snapshot;
|
|
31
|
+
let depth = 0;
|
|
32
|
+
const depthLimit = 10;
|
|
33
|
+
while (child.firstChild && depth < depthLimit) {
|
|
34
|
+
child = child.firstChild;
|
|
35
|
+
depth++;
|
|
36
|
+
}
|
|
37
|
+
return child;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
AuthWrapperService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService, deps: [{ token: i2.MultiTenancyService }, { token: i2.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
41
|
+
AuthWrapperService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService });
|
|
42
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: AuthWrapperService, decorators: [{
|
|
43
|
+
type: Injectable
|
|
44
44
|
}], ctorParameters: function () { return [{ type: i2.MultiTenancyService }, { type: i2.ConfigStateService }, { type: i0.Injector }]; } });
|
|
45
45
|
|
|
46
|
-
class TenantBoxService {
|
|
47
|
-
constructor(toasterService, tenantService, sessionState, configState) {
|
|
48
|
-
this.toasterService = toasterService;
|
|
49
|
-
this.tenantService = tenantService;
|
|
50
|
-
this.sessionState = sessionState;
|
|
51
|
-
this.configState = configState;
|
|
52
|
-
this.currentTenant$ = this.sessionState.getTenant$();
|
|
53
|
-
}
|
|
54
|
-
onSwitch() {
|
|
55
|
-
const tenant = this.sessionState.getTenant();
|
|
56
|
-
this.name = tenant === null || tenant === void 0 ? void 0 : tenant.name;
|
|
57
|
-
this.isModalVisible = true;
|
|
58
|
-
}
|
|
59
|
-
save() {
|
|
60
|
-
if (!this.name) {
|
|
61
|
-
this.setTenant(null);
|
|
62
|
-
this.isModalVisible = false;
|
|
63
|
-
return;
|
|
64
|
-
}
|
|
65
|
-
this.modalBusy = true;
|
|
66
|
-
this.tenantService
|
|
67
|
-
.findTenantByName(this.name, {})
|
|
68
|
-
.pipe(finalize(() => (this.modalBusy = false)))
|
|
69
|
-
.subscribe((_a) => {
|
|
70
|
-
var { success, tenantId: id } = _a, tenant = __rest(_a, ["success", "tenantId"]);
|
|
71
|
-
if (!success) {
|
|
72
|
-
this.showError();
|
|
73
|
-
return;
|
|
74
|
-
}
|
|
75
|
-
this.setTenant(Object.assign(Object.assign({}, tenant), { id, isAvailable: true }));
|
|
76
|
-
this.isModalVisible = false;
|
|
77
|
-
});
|
|
78
|
-
}
|
|
79
|
-
setTenant(tenant) {
|
|
80
|
-
this.sessionState.setTenant(tenant);
|
|
81
|
-
this.configState.refreshAppState();
|
|
82
|
-
}
|
|
83
|
-
showError() {
|
|
84
|
-
this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {
|
|
85
|
-
messageLocalizationParams: [this.name],
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
TenantBoxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService, deps: [{ token: i1.ToasterService }, { token: i2.AbpTenantService }, { token: i2.SessionStateService }, { token: i2.ConfigStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
90
|
-
TenantBoxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService });
|
|
91
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService, decorators: [{
|
|
92
|
-
type: Injectable
|
|
46
|
+
class TenantBoxService {
|
|
47
|
+
constructor(toasterService, tenantService, sessionState, configState) {
|
|
48
|
+
this.toasterService = toasterService;
|
|
49
|
+
this.tenantService = tenantService;
|
|
50
|
+
this.sessionState = sessionState;
|
|
51
|
+
this.configState = configState;
|
|
52
|
+
this.currentTenant$ = this.sessionState.getTenant$();
|
|
53
|
+
}
|
|
54
|
+
onSwitch() {
|
|
55
|
+
const tenant = this.sessionState.getTenant();
|
|
56
|
+
this.name = tenant === null || tenant === void 0 ? void 0 : tenant.name;
|
|
57
|
+
this.isModalVisible = true;
|
|
58
|
+
}
|
|
59
|
+
save() {
|
|
60
|
+
if (!this.name) {
|
|
61
|
+
this.setTenant(null);
|
|
62
|
+
this.isModalVisible = false;
|
|
63
|
+
return;
|
|
64
|
+
}
|
|
65
|
+
this.modalBusy = true;
|
|
66
|
+
this.tenantService
|
|
67
|
+
.findTenantByName(this.name, {})
|
|
68
|
+
.pipe(finalize(() => (this.modalBusy = false)))
|
|
69
|
+
.subscribe((_a) => {
|
|
70
|
+
var { success, tenantId: id } = _a, tenant = __rest(_a, ["success", "tenantId"]);
|
|
71
|
+
if (!success) {
|
|
72
|
+
this.showError();
|
|
73
|
+
return;
|
|
74
|
+
}
|
|
75
|
+
this.setTenant(Object.assign(Object.assign({}, tenant), { id, isAvailable: true }));
|
|
76
|
+
this.isModalVisible = false;
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
setTenant(tenant) {
|
|
80
|
+
this.sessionState.setTenant(tenant);
|
|
81
|
+
this.configState.refreshAppState();
|
|
82
|
+
}
|
|
83
|
+
showError() {
|
|
84
|
+
this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {
|
|
85
|
+
messageLocalizationParams: [this.name],
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
TenantBoxService.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService, deps: [{ token: i1.ToasterService }, { token: i2.AbpTenantService }, { token: i2.SessionStateService }, { token: i2.ConfigStateService }], target: i0.ɵɵFactoryTarget.Injectable });
|
|
90
|
+
TenantBoxService.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService });
|
|
91
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "12.2.13", ngImport: i0, type: TenantBoxService, decorators: [{
|
|
92
|
+
type: Injectable
|
|
93
93
|
}], ctorParameters: function () { return [{ type: i1.ToasterService }, { type: i2.AbpTenantService }, { type: i2.SessionStateService }, { type: i2.ConfigStateService }]; } });
|
|
94
94
|
|
|
95
|
-
/*
|
|
96
|
-
* Public API Surface of account-core
|
|
95
|
+
/*
|
|
96
|
+
* Public API Surface of account-core
|
|
97
97
|
*/
|
|
98
98
|
|
|
99
|
-
/**
|
|
100
|
-
* Generated bundle index. Do not edit.
|
|
99
|
+
/**
|
|
100
|
+
* Generated bundle index. Do not edit.
|
|
101
101
|
*/
|
|
102
102
|
|
|
103
103
|
export { AuthWrapperService, TenantBoxService };
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import { Injector } from '@angular/core';
|
|
2
|
-
import { Observable } from 'rxjs';
|
|
3
|
-
import { ActivatedRoute } from '@angular/router';
|
|
4
|
-
import { ConfigStateService, MultiTenancyService } from '@abp/ng.core';
|
|
5
|
-
import * as i0 from "@angular/core";
|
|
6
|
-
export declare class AuthWrapperService {
|
|
7
|
-
readonly multiTenancy: MultiTenancyService;
|
|
8
|
-
private configState;
|
|
9
|
-
isMultiTenancyEnabled$: Observable<any>;
|
|
10
|
-
get enableLocalLogin$(): Observable<boolean>;
|
|
11
|
-
tenantBoxKey: string;
|
|
12
|
-
route: ActivatedRoute;
|
|
13
|
-
get isTenantBoxVisibleForCurrentRoute(): any;
|
|
14
|
-
get isTenantBoxVisible(): boolean;
|
|
15
|
-
constructor(multiTenancy: MultiTenancyService, configState: ConfigStateService, injector: Injector);
|
|
16
|
-
private getMostInnerChild;
|
|
17
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AuthWrapperService, never>;
|
|
18
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AuthWrapperService>;
|
|
19
|
-
}
|
|
1
|
+
import { Injector } from '@angular/core';
|
|
2
|
+
import { Observable } from 'rxjs';
|
|
3
|
+
import { ActivatedRoute } from '@angular/router';
|
|
4
|
+
import { ConfigStateService, MultiTenancyService } from '@abp/ng.core';
|
|
5
|
+
import * as i0 from "@angular/core";
|
|
6
|
+
export declare class AuthWrapperService {
|
|
7
|
+
readonly multiTenancy: MultiTenancyService;
|
|
8
|
+
private configState;
|
|
9
|
+
isMultiTenancyEnabled$: Observable<any>;
|
|
10
|
+
get enableLocalLogin$(): Observable<boolean>;
|
|
11
|
+
tenantBoxKey: string;
|
|
12
|
+
route: ActivatedRoute;
|
|
13
|
+
get isTenantBoxVisibleForCurrentRoute(): any;
|
|
14
|
+
get isTenantBoxVisible(): boolean;
|
|
15
|
+
constructor(multiTenancy: MultiTenancyService, configState: ConfigStateService, injector: Injector);
|
|
16
|
+
private getMostInnerChild;
|
|
17
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AuthWrapperService, never>;
|
|
18
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AuthWrapperService>;
|
|
19
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
|
-
import { AbpTenantService, ConfigStateService, CurrentTenantDto, SessionStateService } from '@abp/ng.core';
|
|
2
|
-
import { ToasterService } from '@abp/ng.theme.shared';
|
|
3
|
-
import * as i0 from "@angular/core";
|
|
4
|
-
export declare class TenantBoxService {
|
|
5
|
-
private toasterService;
|
|
6
|
-
private tenantService;
|
|
7
|
-
private sessionState;
|
|
8
|
-
private configState;
|
|
9
|
-
currentTenant$: import("rxjs").Observable<CurrentTenantDto>;
|
|
10
|
-
name: string;
|
|
11
|
-
isModalVisible: boolean;
|
|
12
|
-
modalBusy: boolean;
|
|
13
|
-
constructor(toasterService: ToasterService, tenantService: AbpTenantService, sessionState: SessionStateService, configState: ConfigStateService);
|
|
14
|
-
onSwitch(): void;
|
|
15
|
-
save(): void;
|
|
16
|
-
private setTenant;
|
|
17
|
-
private showError;
|
|
18
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<TenantBoxService, never>;
|
|
19
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<TenantBoxService>;
|
|
20
|
-
}
|
|
1
|
+
import { AbpTenantService, ConfigStateService, CurrentTenantDto, SessionStateService } from '@abp/ng.core';
|
|
2
|
+
import { ToasterService } from '@abp/ng.theme.shared';
|
|
3
|
+
import * as i0 from "@angular/core";
|
|
4
|
+
export declare class TenantBoxService {
|
|
5
|
+
private toasterService;
|
|
6
|
+
private tenantService;
|
|
7
|
+
private sessionState;
|
|
8
|
+
private configState;
|
|
9
|
+
currentTenant$: import("rxjs").Observable<CurrentTenantDto>;
|
|
10
|
+
name: string;
|
|
11
|
+
isModalVisible: boolean;
|
|
12
|
+
modalBusy: boolean;
|
|
13
|
+
constructor(toasterService: ToasterService, tenantService: AbpTenantService, sessionState: SessionStateService, configState: ConfigStateService);
|
|
14
|
+
onSwitch(): void;
|
|
15
|
+
save(): void;
|
|
16
|
+
private setTenant;
|
|
17
|
+
private showError;
|
|
18
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<TenantBoxService, never>;
|
|
19
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<TenantBoxService>;
|
|
20
|
+
}
|
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@abp/ng.account.core",
|
|
3
|
-
"version": "5.0.
|
|
3
|
+
"version": "5.0.2",
|
|
4
4
|
"homepage": "https://abp.io",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
7
7
|
"url": "https://github.com/abpframework/abp.git"
|
|
8
8
|
},
|
|
9
9
|
"peerDependencies": {
|
|
10
|
-
"@abp/ng.core": "~5.0.
|
|
11
|
-
"@abp/ng.theme.shared": "~5.0.
|
|
10
|
+
"@abp/ng.core": "~5.0.1",
|
|
11
|
+
"@abp/ng.theme.shared": "~5.0.1",
|
|
12
12
|
"@angular/common": ">=12.0.0",
|
|
13
13
|
"@angular/core": ">=12.0.0"
|
|
14
14
|
},
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@abp/ng.account.core/proxy" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@abp/ng.account.core/proxy" />
|
|
5
|
+
export * from './public-api';
|
package/proxy/lib/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export * from './proxy/account';
|
|
2
|
-
export * from './proxy/identity';
|
|
1
|
+
export * from './proxy/account';
|
|
2
|
+
export * from './proxy/identity';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models';
|
|
2
|
-
import { RestService } from '@abp/ng.core';
|
|
3
|
-
import type { IdentityUserDto } from '../identity/models';
|
|
4
|
-
import * as i0 from "@angular/core";
|
|
5
|
-
export declare class AccountService {
|
|
6
|
-
private restService;
|
|
7
|
-
apiName: string;
|
|
8
|
-
register: (input: RegisterDto) => import("rxjs").Observable<IdentityUserDto>;
|
|
9
|
-
resetPassword: (input: ResetPasswordDto) => import("rxjs").Observable<void>;
|
|
10
|
-
sendPasswordResetCode: (input: SendPasswordResetCodeDto) => import("rxjs").Observable<void>;
|
|
11
|
-
constructor(restService: RestService);
|
|
12
|
-
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
|
|
13
|
-
static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
|
|
14
|
-
}
|
|
1
|
+
import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models';
|
|
2
|
+
import { RestService } from '@abp/ng.core';
|
|
3
|
+
import type { IdentityUserDto } from '../identity/models';
|
|
4
|
+
import * as i0 from "@angular/core";
|
|
5
|
+
export declare class AccountService {
|
|
6
|
+
private restService;
|
|
7
|
+
apiName: string;
|
|
8
|
+
register: (input: RegisterDto) => import("rxjs").Observable<IdentityUserDto>;
|
|
9
|
+
resetPassword: (input: ResetPasswordDto) => import("rxjs").Observable<void>;
|
|
10
|
+
sendPasswordResetCode: (input: SendPasswordResetCodeDto) => import("rxjs").Observable<void>;
|
|
11
|
+
constructor(restService: RestService);
|
|
12
|
+
static ɵfac: i0.ɵɵFactoryDeclaration<AccountService, never>;
|
|
13
|
+
static ɵprov: i0.ɵɵInjectableDeclaration<AccountService>;
|
|
14
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as Web from './web';
|
|
2
|
-
export * from './account.service';
|
|
3
|
-
export * from './models';
|
|
4
|
-
export * from './profile.service';
|
|
5
|
-
export { Web };
|
|
1
|
+
import * as Web from './web';
|
|
2
|
+
export * from './account.service';
|
|
3
|
+
export * from './models';
|
|
4
|
+
export * from './profile.service';
|
|
5
|
+
export { Web };
|
|
@@ -1,40 +1,40 @@
|
|
|
1
|
-
import type { ExtensibleObject } from '@abp/ng.core';
|
|
2
|
-
export interface ChangePasswordInput {
|
|
3
|
-
currentPassword?: string;
|
|
4
|
-
newPassword: string;
|
|
5
|
-
}
|
|
6
|
-
export interface ProfileDto extends ExtensibleObject {
|
|
7
|
-
userName?: string;
|
|
8
|
-
email?: string;
|
|
9
|
-
name?: string;
|
|
10
|
-
surname?: string;
|
|
11
|
-
phoneNumber?: string;
|
|
12
|
-
isExternal: boolean;
|
|
13
|
-
hasPassword: boolean;
|
|
14
|
-
concurrencyStamp?: string;
|
|
15
|
-
}
|
|
16
|
-
export interface RegisterDto extends ExtensibleObject {
|
|
17
|
-
userName: string;
|
|
18
|
-
emailAddress: string;
|
|
19
|
-
password: string;
|
|
20
|
-
appName: string;
|
|
21
|
-
}
|
|
22
|
-
export interface ResetPasswordDto {
|
|
23
|
-
userId?: string;
|
|
24
|
-
resetToken: string;
|
|
25
|
-
password: string;
|
|
26
|
-
}
|
|
27
|
-
export interface SendPasswordResetCodeDto {
|
|
28
|
-
email: string;
|
|
29
|
-
appName: string;
|
|
30
|
-
returnUrl?: string;
|
|
31
|
-
returnUrlHash?: string;
|
|
32
|
-
}
|
|
33
|
-
export interface UpdateProfileDto extends ExtensibleObject {
|
|
34
|
-
userName?: string;
|
|
35
|
-
email?: string;
|
|
36
|
-
name?: string;
|
|
37
|
-
surname?: string;
|
|
38
|
-
phoneNumber?: string;
|
|
39
|
-
concurrencyStamp?: string;
|
|
40
|
-
}
|
|
1
|
+
import type { ExtensibleObject } from '@abp/ng.core';
|
|
2
|
+
export interface ChangePasswordInput {
|
|
3
|
+
currentPassword?: string;
|
|
4
|
+
newPassword: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ProfileDto extends ExtensibleObject {
|
|
7
|
+
userName?: string;
|
|
8
|
+
email?: string;
|
|
9
|
+
name?: string;
|
|
10
|
+
surname?: string;
|
|
11
|
+
phoneNumber?: string;
|
|
12
|
+
isExternal: boolean;
|
|
13
|
+
hasPassword: boolean;
|
|
14
|
+
concurrencyStamp?: string;
|
|
15
|
+
}
|
|
16
|
+
export interface RegisterDto extends ExtensibleObject {
|
|
17
|
+
userName: string;
|
|
18
|
+
emailAddress: string;
|
|
19
|
+
password: string;
|
|
20
|
+
appName: string;
|
|
21
|
+
}
|
|
22
|
+
export interface ResetPasswordDto {
|
|
23
|
+
userId?: string;
|
|
24
|
+
resetToken: string;
|
|
25
|
+
password: string;
|
|
26
|
+
}
|
|
27
|
+
export interface SendPasswordResetCodeDto {
|
|
28
|
+
email: string;
|
|
29
|
+
appName: string;
|
|
30
|
+
returnUrl?: string;
|
|
31
|
+
returnUrlHash?: string;
|
|
32
|
+
}
|
|
33
|
+
export interface UpdateProfileDto extends ExtensibleObject {
|
|
34
|
+
userName?: string;
|
|
35
|
+
email?: string;
|
|
36
|
+
name?: string;
|
|
37
|
+
surname?: string;
|
|
38
|
+
phoneNumber?: string;
|
|
39
|
+
concurrencyStamp?: string;
|
|
40
|
+
}
|