@abp/ng.account.core 7.2.2 → 7.3.0-rc.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/README.md +129 -2
- package/{esm2020 → esm2022}/abp-ng.account.core.mjs +4 -4
- package/esm2022/lib/auth-wrapper.service.mjs +43 -0
- package/esm2022/lib/tenant-box.service.mjs +56 -0
- package/{esm2020 → esm2022}/proxy/abp-ng.account.core-proxy.mjs +4 -4
- package/{esm2020 → esm2022}/proxy/lib/index.mjs +2 -2
- package/esm2022/proxy/lib/proxy/account/account.service.mjs +35 -0
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/index.mjs +5 -5
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/models.mjs +1 -1
- package/esm2022/proxy/lib/proxy/account/profile.service.mjs +34 -0
- package/esm2022/proxy/lib/proxy/account/web/areas/account/controllers/account.service.mjs +34 -0
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/account/controllers/index.mjs +3 -3
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/account/controllers/models/index.mjs +2 -2
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.mjs +10 -10
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/account/controllers/models/models.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/account/index.mjs +2 -2
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/areas/index.mjs +2 -2
- package/{esm2020 → esm2022}/proxy/lib/proxy/account/web/index.mjs +2 -2
- package/{esm2020 → esm2022}/proxy/lib/proxy/identity/index.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/lib/proxy/identity/models.mjs +1 -1
- package/{esm2020 → esm2022}/proxy/public-api.mjs +1 -1
- package/{esm2020 → esm2022}/public-api.mjs +5 -5
- package/{fesm2020 → fesm2022}/abp-ng.account.core-proxy.mjs +92 -92
- package/{fesm2020 → fesm2022}/abp-ng.account.core-proxy.mjs.map +1 -1
- package/{fesm2020 → fesm2022}/abp-ng.account.core.mjs +84 -84
- package/{fesm2020 → fesm2022}/abp-ng.account.core.mjs.map +1 -1
- package/index.d.ts +5 -5
- package/lib/auth-wrapper.service.d.ts +19 -19
- package/lib/tenant-box.service.d.ts +20 -20
- package/package.json +24 -18
- package/proxy/index.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
- package/esm2020/lib/auth-wrapper.service.mjs +0 -42
- package/esm2020/lib/tenant-box.service.mjs +0 -55
- package/esm2020/proxy/lib/proxy/account/account.service.mjs +0 -34
- package/esm2020/proxy/lib/proxy/account/profile.service.mjs +0 -33
- package/esm2020/proxy/lib/proxy/account/web/areas/account/controllers/account.service.mjs +0 -33
- package/fesm2015/abp-ng.account.core-proxy.mjs +0 -136
- package/fesm2015/abp-ng.account.core-proxy.mjs.map +0 -1
- package/fesm2015/abp-ng.account.core.mjs +0 -104
- package/fesm2015/abp-ng.account.core.mjs.map +0 -1
- package/proxy/src/lib/proxy/README.md +0 -17
|
@@ -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
|
-
let AccountService$1 = class AccountService {
|
|
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
|
-
|
|
43
|
-
|
|
44
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
45
|
-
type: Injectable,
|
|
46
|
-
args: [{
|
|
47
|
-
providedIn: 'root',
|
|
48
|
-
}]
|
|
22
|
+
let AccountService$1 = class AccountService {
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AccountService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
42
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AccountService, providedIn: 'root' }); }
|
|
43
|
+
};
|
|
44
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", 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
|
-
|
|
94
|
-
|
|
95
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AccountService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
93
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AccountService, providedIn: 'root' }); }
|
|
94
|
+
}
|
|
95
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", 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
|
-
|
|
123
|
-
|
|
124
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
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
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: ProfileService, deps: [{ token: i1.RestService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
122
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: ProfileService, providedIn: 'root' }); }
|
|
123
|
+
}
|
|
124
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", 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 };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abp-ng.account.core-proxy.mjs","sources":["../../../../packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/account.service.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/account.service.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/profile.service.ts","../../../../packages/account-core/proxy/src/abp-ng.account.core-proxy.ts"],"sourcesContent":["import { mapEnumToOptions } from '@abp/ng.core';\r\n\r\nexport enum LoginResultType {\r\n Success = 1,\r\n InvalidUserNameOrPassword = 2,\r\n NotAllowed = 3,\r\n LockedOut = 4,\r\n RequiresTwoFactor = 5,\r\n}\r\n\r\nexport const loginResultTypeOptions = mapEnumToOptions(LoginResultType);\r\n","import type { AbpLoginResult, UserLoginInfo } from './models/models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AccountService {\r\n apiName = 'AbpAccount';\r\n\r\n checkPasswordByLogin = (login: UserLoginInfo) =>\r\n this.restService.request<any, AbpLoginResult>({\r\n method: 'POST',\r\n url: '/api/account/check-password',\r\n body: login,\r\n },\r\n { apiName: this.apiName });\r\n\r\n loginByLogin = (login: UserLoginInfo) =>\r\n this.restService.request<any, AbpLoginResult>({\r\n method: 'POST',\r\n url: '/api/account/login',\r\n body: login,\r\n },\r\n { apiName: this.apiName });\r\n\r\n logout = () =>\r\n this.restService.request<any, void>({\r\n method: 'GET',\r\n url: '/api/account/logout',\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\nimport type { IdentityUserDto } from '../identity/models';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AccountService {\r\n apiName = 'AbpAccount';\r\n\r\n register = (input: RegisterDto) =>\r\n this.restService.request<any, IdentityUserDto>({\r\n method: 'POST',\r\n url: '/api/account/register',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n resetPassword = (input: ResetPasswordDto) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/reset-password',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n sendPasswordResetCode = (input: SendPasswordResetCodeDto) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/send-password-reset-code',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","import type { ChangePasswordInput, ProfileDto, UpdateProfileDto } from './models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ProfileService {\r\n apiName = 'AbpAccount';\r\n\r\n changePassword = (input: ChangePasswordInput) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/my-profile/change-password',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n get = () =>\r\n this.restService.request<any, ProfileDto>({\r\n method: 'GET',\r\n url: '/api/account/my-profile',\r\n },\r\n { apiName: this.apiName });\r\n\r\n update = (input: UpdateProfileDto) =>\r\n this.restService.request<any, ProfileDto>({\r\n method: 'PUT',\r\n url: '/api/account/my-profile',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["AccountService"],"mappings":";;;;;AAEA,IAAY,eAMX,CAAA;AAND,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,eAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW,CAAA;AACX,IAAA,eAAA,CAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,CAAA,CAAA,GAAA,2BAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,eAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAc,CAAA;AACd,IAAA,eAAA,CAAA,eAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa,CAAA;AACb,IAAA,eAAA,CAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,mBAAqB,CAAA;AACvB,CAAC,EANW,eAAe,KAAf,eAAe,GAM1B,EAAA,CAAA,CAAA,CAAA;AAEM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,eAAe,CAAC;;;;;;;;
|
|
1
|
+
{"version":3,"file":"abp-ng.account.core-proxy.mjs","sources":["../../../../packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/models/login-result-type.enum.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/web/areas/account/controllers/account.service.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/account.service.ts","../../../../packages/account-core/proxy/src/lib/proxy/account/profile.service.ts","../../../../packages/account-core/proxy/src/abp-ng.account.core-proxy.ts"],"sourcesContent":["import { mapEnumToOptions } from '@abp/ng.core';\r\n\r\nexport enum LoginResultType {\r\n Success = 1,\r\n InvalidUserNameOrPassword = 2,\r\n NotAllowed = 3,\r\n LockedOut = 4,\r\n RequiresTwoFactor = 5,\r\n}\r\n\r\nexport const loginResultTypeOptions = mapEnumToOptions(LoginResultType);\r\n","import type { AbpLoginResult, UserLoginInfo } from './models/models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AccountService {\r\n apiName = 'AbpAccount';\r\n\r\n checkPasswordByLogin = (login: UserLoginInfo) =>\r\n this.restService.request<any, AbpLoginResult>({\r\n method: 'POST',\r\n url: '/api/account/check-password',\r\n body: login,\r\n },\r\n { apiName: this.apiName });\r\n\r\n loginByLogin = (login: UserLoginInfo) =>\r\n this.restService.request<any, AbpLoginResult>({\r\n method: 'POST',\r\n url: '/api/account/login',\r\n body: login,\r\n },\r\n { apiName: this.apiName });\r\n\r\n logout = () =>\r\n this.restService.request<any, void>({\r\n method: 'GET',\r\n url: '/api/account/logout',\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","import type { RegisterDto, ResetPasswordDto, SendPasswordResetCodeDto } from './models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\nimport type { IdentityUserDto } from '../identity/models';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class AccountService {\r\n apiName = 'AbpAccount';\r\n\r\n register = (input: RegisterDto) =>\r\n this.restService.request<any, IdentityUserDto>({\r\n method: 'POST',\r\n url: '/api/account/register',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n resetPassword = (input: ResetPasswordDto) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/reset-password',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n sendPasswordResetCode = (input: SendPasswordResetCodeDto) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/send-password-reset-code',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","import type { ChangePasswordInput, ProfileDto, UpdateProfileDto } from './models';\r\nimport { RestService } from '@abp/ng.core';\r\nimport { Injectable } from '@angular/core';\r\n\r\n@Injectable({\r\n providedIn: 'root',\r\n})\r\nexport class ProfileService {\r\n apiName = 'AbpAccount';\r\n\r\n changePassword = (input: ChangePasswordInput) =>\r\n this.restService.request<any, void>({\r\n method: 'POST',\r\n url: '/api/account/my-profile/change-password',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n get = () =>\r\n this.restService.request<any, ProfileDto>({\r\n method: 'GET',\r\n url: '/api/account/my-profile',\r\n },\r\n { apiName: this.apiName });\r\n\r\n update = (input: UpdateProfileDto) =>\r\n this.restService.request<any, ProfileDto>({\r\n method: 'PUT',\r\n url: '/api/account/my-profile',\r\n body: input,\r\n },\r\n { apiName: this.apiName });\r\n\r\n constructor(private restService: RestService) {}\r\n}\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["AccountService"],"mappings":";;;;;AAEA,IAAY,eAMX,CAAA;AAND,CAAA,UAAY,eAAe,EAAA;AACzB,IAAA,eAAA,CAAA,eAAA,CAAA,SAAA,CAAA,GAAA,CAAA,CAAA,GAAA,SAAW,CAAA;AACX,IAAA,eAAA,CAAA,eAAA,CAAA,2BAAA,CAAA,GAAA,CAAA,CAAA,GAAA,2BAA6B,CAAA;AAC7B,IAAA,eAAA,CAAA,eAAA,CAAA,YAAA,CAAA,GAAA,CAAA,CAAA,GAAA,YAAc,CAAA;AACd,IAAA,eAAA,CAAA,eAAA,CAAA,WAAA,CAAA,GAAA,CAAA,CAAA,GAAA,WAAa,CAAA;AACb,IAAA,eAAA,CAAA,eAAA,CAAA,mBAAA,CAAA,GAAA,CAAA,CAAA,GAAA,mBAAqB,CAAA;AACvB,CAAC,EANW,eAAe,KAAf,eAAe,GAM1B,EAAA,CAAA,CAAA,CAAA;AAEM,MAAM,sBAAsB,GAAG,gBAAgB,CAAC,eAAe,CAAC;;;;;;;;uBCNvE,MAGa,cAAc,CAAA;AA0BzB,IAAA,WAAA,CAAoB,WAAwB,EAAA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EAAA,CAAA,CAAA,EAAA;AAAd,IAAA,SAAA,IAAA,CAAA,KAAA,GAAA,EAAA,CAAA,qBAAA,CAAA,EAAA,UAAA,EAAA,QAAA,EAAA,OAAA,EAAA,QAAA,EAAA,QAAA,EAAA,EAAA,EAAA,IAAA,EAAA,cAAc,cAFb,MAAM,EAAA,CAAA,CAAA,EAAA;;2FAEP,cAAc,EAAA,UAAA,EAAA,CAAA;kBAH1B,UAAU;AAAC,YAAA,IAAA,EAAA,CAAA;AACV,oBAAA,UAAU,EAAE,MAAM;AACnB,iBAAA,CAAA;;;ACND;;AAEG;;;;"}
|
|
@@ -5,96 +5,96 @@ import { ActivatedRoute } from '@angular/router';
|
|
|
5
5
|
import * as i2 from '@abp/ng.core';
|
|
6
6
|
import * as i1 from '@abp/ng.theme.shared';
|
|
7
7
|
|
|
8
|
-
class AuthWrapperService {
|
|
9
|
-
|
|
10
|
-
this.
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
}
|
|
27
|
-
getMostInnerChild() {
|
|
28
|
-
let child = this.route.snapshot;
|
|
29
|
-
let depth = 0;
|
|
30
|
-
const depthLimit = 10;
|
|
31
|
-
while (child.firstChild && depth < depthLimit) {
|
|
32
|
-
child = child.firstChild;
|
|
33
|
-
depth++;
|
|
34
|
-
}
|
|
35
|
-
return child;
|
|
36
|
-
}
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
41
|
-
type: Injectable
|
|
8
|
+
class AuthWrapperService {
|
|
9
|
+
get enableLocalLogin$() {
|
|
10
|
+
return this.configState
|
|
11
|
+
.getSetting$('Abp.Account.EnableLocalLogin')
|
|
12
|
+
.pipe(map(value => value?.toLowerCase() !== 'false'));
|
|
13
|
+
}
|
|
14
|
+
get isTenantBoxVisibleForCurrentRoute() {
|
|
15
|
+
return this.getMostInnerChild().data.tenantBoxVisible ?? true;
|
|
16
|
+
}
|
|
17
|
+
get isTenantBoxVisible() {
|
|
18
|
+
return this.isTenantBoxVisibleForCurrentRoute && this.multiTenancy.isTenantBoxVisible;
|
|
19
|
+
}
|
|
20
|
+
constructor(multiTenancy, configState, injector) {
|
|
21
|
+
this.multiTenancy = multiTenancy;
|
|
22
|
+
this.configState = configState;
|
|
23
|
+
this.isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled');
|
|
24
|
+
this.tenantBoxKey = 'Account.TenantBoxComponent';
|
|
25
|
+
this.route = injector.get(ActivatedRoute);
|
|
26
|
+
}
|
|
27
|
+
getMostInnerChild() {
|
|
28
|
+
let child = this.route.snapshot;
|
|
29
|
+
let depth = 0;
|
|
30
|
+
const depthLimit = 10;
|
|
31
|
+
while (child.firstChild && depth < depthLimit) {
|
|
32
|
+
child = child.firstChild;
|
|
33
|
+
depth++;
|
|
34
|
+
}
|
|
35
|
+
return child;
|
|
36
|
+
}
|
|
37
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AuthWrapperService, deps: [{ token: i2.MultiTenancyService }, { token: i2.ConfigStateService }, { token: i0.Injector }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
38
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AuthWrapperService }); }
|
|
39
|
+
}
|
|
40
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: AuthWrapperService, decorators: [{
|
|
41
|
+
type: Injectable
|
|
42
42
|
}], ctorParameters: function () { return [{ type: i2.MultiTenancyService }, { type: i2.ConfigStateService }, { type: i0.Injector }]; } });
|
|
43
43
|
|
|
44
|
-
class TenantBoxService {
|
|
45
|
-
constructor(toasterService, tenantService, sessionState, configState) {
|
|
46
|
-
this.toasterService = toasterService;
|
|
47
|
-
this.tenantService = tenantService;
|
|
48
|
-
this.sessionState = sessionState;
|
|
49
|
-
this.configState = configState;
|
|
50
|
-
this.currentTenant$ = this.sessionState.getTenant$();
|
|
51
|
-
}
|
|
52
|
-
onSwitch() {
|
|
53
|
-
const tenant = this.sessionState.getTenant();
|
|
54
|
-
this.name = tenant?.name || '';
|
|
55
|
-
this.isModalVisible = true;
|
|
56
|
-
}
|
|
57
|
-
save() {
|
|
58
|
-
if (!this.name) {
|
|
59
|
-
this.setTenant(null);
|
|
60
|
-
this.isModalVisible = false;
|
|
61
|
-
return;
|
|
62
|
-
}
|
|
63
|
-
this.modalBusy = true;
|
|
64
|
-
this.tenantService
|
|
65
|
-
.findTenantByName(this.name)
|
|
66
|
-
.pipe(finalize(() => (this.modalBusy = false)))
|
|
67
|
-
.subscribe(({ success, tenantId: id, ...tenant }) => {
|
|
68
|
-
if (!success) {
|
|
69
|
-
this.showError();
|
|
70
|
-
return;
|
|
71
|
-
}
|
|
72
|
-
this.setTenant({ ...tenant, id, isAvailable: true });
|
|
73
|
-
this.isModalVisible = false;
|
|
74
|
-
});
|
|
75
|
-
}
|
|
76
|
-
setTenant(tenant) {
|
|
77
|
-
this.sessionState.setTenant(tenant);
|
|
78
|
-
this.configState.refreshAppState();
|
|
79
|
-
}
|
|
80
|
-
showError() {
|
|
81
|
-
this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {
|
|
82
|
-
messageLocalizationParams: [this.name || ''],
|
|
83
|
-
});
|
|
84
|
-
}
|
|
85
|
-
}
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "
|
|
89
|
-
type: Injectable
|
|
44
|
+
class TenantBoxService {
|
|
45
|
+
constructor(toasterService, tenantService, sessionState, configState) {
|
|
46
|
+
this.toasterService = toasterService;
|
|
47
|
+
this.tenantService = tenantService;
|
|
48
|
+
this.sessionState = sessionState;
|
|
49
|
+
this.configState = configState;
|
|
50
|
+
this.currentTenant$ = this.sessionState.getTenant$();
|
|
51
|
+
}
|
|
52
|
+
onSwitch() {
|
|
53
|
+
const tenant = this.sessionState.getTenant();
|
|
54
|
+
this.name = tenant?.name || '';
|
|
55
|
+
this.isModalVisible = true;
|
|
56
|
+
}
|
|
57
|
+
save() {
|
|
58
|
+
if (!this.name) {
|
|
59
|
+
this.setTenant(null);
|
|
60
|
+
this.isModalVisible = false;
|
|
61
|
+
return;
|
|
62
|
+
}
|
|
63
|
+
this.modalBusy = true;
|
|
64
|
+
this.tenantService
|
|
65
|
+
.findTenantByName(this.name)
|
|
66
|
+
.pipe(finalize(() => (this.modalBusy = false)))
|
|
67
|
+
.subscribe(({ success, tenantId: id, ...tenant }) => {
|
|
68
|
+
if (!success) {
|
|
69
|
+
this.showError();
|
|
70
|
+
return;
|
|
71
|
+
}
|
|
72
|
+
this.setTenant({ ...tenant, id, isAvailable: true });
|
|
73
|
+
this.isModalVisible = false;
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
setTenant(tenant) {
|
|
77
|
+
this.sessionState.setTenant(tenant);
|
|
78
|
+
this.configState.refreshAppState();
|
|
79
|
+
}
|
|
80
|
+
showError() {
|
|
81
|
+
this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {
|
|
82
|
+
messageLocalizationParams: [this.name || ''],
|
|
83
|
+
});
|
|
84
|
+
}
|
|
85
|
+
static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: TenantBoxService, deps: [{ token: i1.ToasterService }, { token: i2.AbpTenantService }, { token: i2.SessionStateService }, { token: i2.ConfigStateService }], target: i0.ɵɵFactoryTarget.Injectable }); }
|
|
86
|
+
static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: TenantBoxService }); }
|
|
87
|
+
}
|
|
88
|
+
i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.0.1", ngImport: i0, type: TenantBoxService, decorators: [{
|
|
89
|
+
type: Injectable
|
|
90
90
|
}], ctorParameters: function () { return [{ type: i1.ToasterService }, { type: i2.AbpTenantService }, { type: i2.SessionStateService }, { type: i2.ConfigStateService }]; } });
|
|
91
91
|
|
|
92
|
-
/*
|
|
93
|
-
* Public API Surface of account-core
|
|
92
|
+
/*
|
|
93
|
+
* Public API Surface of account-core
|
|
94
94
|
*/
|
|
95
95
|
|
|
96
|
-
/**
|
|
97
|
-
* Generated bundle index. Do not edit.
|
|
96
|
+
/**
|
|
97
|
+
* Generated bundle index. Do not edit.
|
|
98
98
|
*/
|
|
99
99
|
|
|
100
100
|
export { AuthWrapperService, TenantBoxService };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abp-ng.account.core.mjs","sources":["../../../../packages/account-core/src/lib/auth-wrapper.service.ts","../../../../packages/account-core/src/lib/tenant-box.service.ts","../../../../packages/account-core/src/public-api.ts","../../../../packages/account-core/src/abp-ng.account.core.ts"],"sourcesContent":["import { Injectable, Injector } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { ConfigStateService, MultiTenancyService } from '@abp/ng.core';\r\n\r\n@Injectable()\r\nexport class AuthWrapperService {\r\n isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled');\r\n\r\n get enableLocalLogin$(): Observable<boolean> {\r\n return this.configState\r\n .getSetting$('Abp.Account.EnableLocalLogin')\r\n .pipe(map(value => value?.toLowerCase() !== 'false'));\r\n }\r\n\r\n tenantBoxKey = 'Account.TenantBoxComponent';\r\n route: ActivatedRoute;\r\n\r\n get isTenantBoxVisibleForCurrentRoute() {\r\n return this.getMostInnerChild().data.tenantBoxVisible ?? true;\r\n }\r\n\r\n get isTenantBoxVisible() {\r\n return this.isTenantBoxVisibleForCurrentRoute && this.multiTenancy.isTenantBoxVisible;\r\n }\r\n\r\n constructor(\r\n public readonly multiTenancy: MultiTenancyService,\r\n private configState: ConfigStateService,\r\n injector: Injector,\r\n ) {\r\n this.route = injector.get(ActivatedRoute);\r\n }\r\n\r\n private getMostInnerChild() {\r\n let child = this.route.snapshot;\r\n let depth = 0;\r\n const depthLimit = 10;\r\n while (child.firstChild && depth < depthLimit) {\r\n child = child.firstChild;\r\n depth++;\r\n }\r\n return child;\r\n }\r\n}\r\n","import {\r\n AbpTenantService,\r\n ConfigStateService,\r\n CurrentTenantDto,\r\n SessionStateService,\r\n} from '@abp/ng.core';\r\nimport { ToasterService } from '@abp/ng.theme.shared';\r\nimport { Injectable } from '@angular/core';\r\nimport { finalize } from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class TenantBoxService {\r\n currentTenant$ = this.sessionState.getTenant$();\r\n\r\n name?: string;\r\n\r\n isModalVisible!: boolean;\r\n\r\n modalBusy!: boolean;\r\n\r\n constructor(\r\n private toasterService: ToasterService,\r\n private tenantService: AbpTenantService,\r\n private sessionState: SessionStateService,\r\n private configState: ConfigStateService,\r\n ) {}\r\n\r\n onSwitch() {\r\n const tenant = this.sessionState.getTenant();\r\n this.name = tenant?.name || '';\r\n this.isModalVisible = true;\r\n }\r\n\r\n save() {\r\n if (!this.name) {\r\n this.setTenant(null);\r\n this.isModalVisible = false;\r\n return;\r\n }\r\n\r\n this.modalBusy = true;\r\n this.tenantService\r\n .findTenantByName(this.name)\r\n .pipe(finalize(() => (this.modalBusy = false)))\r\n .subscribe(({ success, tenantId: id, ...tenant }) => {\r\n if (!success) {\r\n this.showError();\r\n return;\r\n }\r\n\r\n this.setTenant({ ...tenant, id, isAvailable: true });\r\n this.isModalVisible = false;\r\n });\r\n }\r\n\r\n private setTenant(tenant: CurrentTenantDto | null) {\r\n this.sessionState.setTenant(tenant);\r\n this.configState.refreshAppState();\r\n }\r\n\r\n private showError() {\r\n this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {\r\n messageLocalizationParams: [this.name || ''],\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of account-core\r\n */\r\n\r\nexport * from './lib/auth-wrapper.service';\r\nexport * from './lib/tenant-box.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["i1"],"mappings":";;;;;;;
|
|
1
|
+
{"version":3,"file":"abp-ng.account.core.mjs","sources":["../../../../packages/account-core/src/lib/auth-wrapper.service.ts","../../../../packages/account-core/src/lib/tenant-box.service.ts","../../../../packages/account-core/src/public-api.ts","../../../../packages/account-core/src/abp-ng.account.core.ts"],"sourcesContent":["import { Injectable, Injector } from '@angular/core';\r\nimport { Observable } from 'rxjs';\r\nimport { map } from 'rxjs/operators';\r\nimport { ActivatedRoute } from '@angular/router';\r\nimport { ConfigStateService, MultiTenancyService } from '@abp/ng.core';\r\n\r\n@Injectable()\r\nexport class AuthWrapperService {\r\n isMultiTenancyEnabled$ = this.configState.getDeep$('multiTenancy.isEnabled');\r\n\r\n get enableLocalLogin$(): Observable<boolean> {\r\n return this.configState\r\n .getSetting$('Abp.Account.EnableLocalLogin')\r\n .pipe(map(value => value?.toLowerCase() !== 'false'));\r\n }\r\n\r\n tenantBoxKey = 'Account.TenantBoxComponent';\r\n route: ActivatedRoute;\r\n\r\n get isTenantBoxVisibleForCurrentRoute() {\r\n return this.getMostInnerChild().data.tenantBoxVisible ?? true;\r\n }\r\n\r\n get isTenantBoxVisible() {\r\n return this.isTenantBoxVisibleForCurrentRoute && this.multiTenancy.isTenantBoxVisible;\r\n }\r\n\r\n constructor(\r\n public readonly multiTenancy: MultiTenancyService,\r\n private configState: ConfigStateService,\r\n injector: Injector,\r\n ) {\r\n this.route = injector.get(ActivatedRoute);\r\n }\r\n\r\n private getMostInnerChild() {\r\n let child = this.route.snapshot;\r\n let depth = 0;\r\n const depthLimit = 10;\r\n while (child.firstChild && depth < depthLimit) {\r\n child = child.firstChild;\r\n depth++;\r\n }\r\n return child;\r\n }\r\n}\r\n","import {\r\n AbpTenantService,\r\n ConfigStateService,\r\n CurrentTenantDto,\r\n SessionStateService,\r\n} from '@abp/ng.core';\r\nimport { ToasterService } from '@abp/ng.theme.shared';\r\nimport { Injectable } from '@angular/core';\r\nimport { finalize } from 'rxjs/operators';\r\n\r\n@Injectable()\r\nexport class TenantBoxService {\r\n currentTenant$ = this.sessionState.getTenant$();\r\n\r\n name?: string;\r\n\r\n isModalVisible!: boolean;\r\n\r\n modalBusy!: boolean;\r\n\r\n constructor(\r\n private toasterService: ToasterService,\r\n private tenantService: AbpTenantService,\r\n private sessionState: SessionStateService,\r\n private configState: ConfigStateService,\r\n ) {}\r\n\r\n onSwitch() {\r\n const tenant = this.sessionState.getTenant();\r\n this.name = tenant?.name || '';\r\n this.isModalVisible = true;\r\n }\r\n\r\n save() {\r\n if (!this.name) {\r\n this.setTenant(null);\r\n this.isModalVisible = false;\r\n return;\r\n }\r\n\r\n this.modalBusy = true;\r\n this.tenantService\r\n .findTenantByName(this.name)\r\n .pipe(finalize(() => (this.modalBusy = false)))\r\n .subscribe(({ success, tenantId: id, ...tenant }) => {\r\n if (!success) {\r\n this.showError();\r\n return;\r\n }\r\n\r\n this.setTenant({ ...tenant, id, isAvailable: true });\r\n this.isModalVisible = false;\r\n });\r\n }\r\n\r\n private setTenant(tenant: CurrentTenantDto | null) {\r\n this.sessionState.setTenant(tenant);\r\n this.configState.refreshAppState();\r\n }\r\n\r\n private showError() {\r\n this.toasterService.error('AbpUiMultiTenancy::GivenTenantIsNotAvailable', 'AbpUi::Error', {\r\n messageLocalizationParams: [this.name || ''],\r\n });\r\n }\r\n}\r\n","/*\r\n * Public API Surface of account-core\r\n */\r\n\r\nexport * from './lib/auth-wrapper.service';\r\nexport * from './lib/tenant-box.service';\r\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from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UAAU;;;ACVX;;AAEG;;ACFH;;AAEG;;;;"}
|
package/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Generated bundle index. Do not edit.
|
|
3
|
-
*/
|
|
4
|
-
/// <amd-module name="@abp/ng.account.core" />
|
|
5
|
-
export * from './public-api';
|
|
1
|
+
/**
|
|
2
|
+
* Generated bundle index. Do not edit.
|
|
3
|
+
*/
|
|
4
|
+
/// <amd-module name="@abp/ng.account.core" />
|
|
5
|
+
export * from './public-api';
|
|
@@ -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
|
+
}
|